diff --git a/services/providerhub/mgmt/2020-11-20/providerhub/CHANGELOG.md b/services/providerhub/mgmt/2020-11-20/providerhub/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/providerhub/mgmt/2020-11-20/providerhub/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/providerhub/mgmt/2020-11-20/providerhub/_meta.json b/services/providerhub/mgmt/2020-11-20/providerhub/_meta.json new file mode 100644 index 000000000000..fa480a1efc3e --- /dev/null +++ b/services/providerhub/mgmt/2020-11-20/providerhub/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "c45182f1cefbcd7f37fb3d000f5d38ac5e77460f", + "readme": "/_/azure-rest-api-specs/specification/providerhub/resource-manager/readme.md", + "tag": "package-2020-11-20", + "use": "@microsoft.azure/autorest.go@2.1.183", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.183 --tag=package-2020-11-20 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/providerhub/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/providerhub/mgmt/2020-11-20/providerhub/client.go b/services/providerhub/mgmt/2020-11-20/providerhub/client.go new file mode 100644 index 000000000000..670fff819c82 --- /dev/null +++ b/services/providerhub/mgmt/2020-11-20/providerhub/client.go @@ -0,0 +1,212 @@ +// Package providerhub implements the Azure ARM Providerhub service API version 2020-11-20. +// +// Microsoft ProviderHub +package providerhub + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +const ( + // DefaultBaseURI is the default URI used for the service Providerhub + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Providerhub. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} + +// CheckinManifest checkin the manifest. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// checkinManifestParams - the required body parameters supplied to the checkin manifest operation. +func (client BaseClient) CheckinManifest(ctx context.Context, providerNamespace string, checkinManifestParams CheckinManifestParams) (result CheckinManifestInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckinManifest") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: checkinManifestParams, + Constraints: []validation.Constraint{{Target: "checkinManifestParams.Environment", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "checkinManifestParams.BaselineArmManifestLocation", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.BaseClient", "CheckinManifest", err.Error()) + } + + req, err := client.CheckinManifestPreparer(ctx, providerNamespace, checkinManifestParams) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.BaseClient", "CheckinManifest", nil, "Failure preparing request") + return + } + + resp, err := client.CheckinManifestSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.BaseClient", "CheckinManifest", resp, "Failure sending request") + return + } + + result, err = client.CheckinManifestResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.BaseClient", "CheckinManifest", resp, "Failure responding to request") + return + } + + return +} + +// CheckinManifestPreparer prepares the CheckinManifest request. +func (client BaseClient) CheckinManifestPreparer(ctx context.Context, providerNamespace string, checkinManifestParams CheckinManifestParams) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/checkinManifest", pathParameters), + autorest.WithJSON(checkinManifestParams), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckinManifestSender sends the CheckinManifest request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CheckinManifestSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckinManifestResponder handles the response to the CheckinManifest request. The method always +// closes the http.Response Body. +func (client BaseClient) CheckinManifestResponder(resp *http.Response) (result CheckinManifestInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GenerateManifest generates the manifest for the given provider. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +func (client BaseClient) GenerateManifest(ctx context.Context, providerNamespace string) (result ResourceProviderManifest, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GenerateManifest") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.BaseClient", "GenerateManifest", err.Error()) + } + + req, err := client.GenerateManifestPreparer(ctx, providerNamespace) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.BaseClient", "GenerateManifest", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateManifestSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.BaseClient", "GenerateManifest", resp, "Failure sending request") + return + } + + result, err = client.GenerateManifestResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.BaseClient", "GenerateManifest", resp, "Failure responding to request") + return + } + + return +} + +// GenerateManifestPreparer prepares the GenerateManifest request. +func (client BaseClient) GenerateManifestPreparer(ctx context.Context, providerNamespace string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/generateManifest", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateManifestSender sends the GenerateManifest request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GenerateManifestSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GenerateManifestResponder handles the response to the GenerateManifest request. The method always +// closes the http.Response Body. +func (client BaseClient) GenerateManifestResponder(resp *http.Response) (result ResourceProviderManifest, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/providerhub/mgmt/2020-11-20/providerhub/customrollouts.go b/services/providerhub/mgmt/2020-11-20/providerhub/customrollouts.go new file mode 100644 index 000000000000..a7a0f83cc880 --- /dev/null +++ b/services/providerhub/mgmt/2020-11-20/providerhub/customrollouts.go @@ -0,0 +1,323 @@ +package providerhub + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CustomRolloutsClient is the microsoft ProviderHub +type CustomRolloutsClient struct { + BaseClient +} + +// NewCustomRolloutsClient creates an instance of the CustomRolloutsClient client. +func NewCustomRolloutsClient(subscriptionID string) CustomRolloutsClient { + return NewCustomRolloutsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCustomRolloutsClientWithBaseURI creates an instance of the CustomRolloutsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewCustomRolloutsClientWithBaseURI(baseURI string, subscriptionID string) CustomRolloutsClient { + return CustomRolloutsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates the rollout details. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// rolloutName - the rollout name. +// properties - the custom rollout properties supplied to the CreateOrUpdate operation. +func (client CustomRolloutsClient) CreateOrUpdate(ctx context.Context, providerNamespace string, rolloutName string, properties CustomRollout) (result CustomRollout, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomRolloutsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: properties, + Constraints: []validation.Constraint{{Target: "properties.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.CustomRolloutsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, providerNamespace, rolloutName, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.CustomRolloutsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.CustomRolloutsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.CustomRolloutsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CustomRolloutsClient) CreateOrUpdatePreparer(ctx context.Context, providerNamespace string, rolloutName string, properties CustomRollout) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "rolloutName": autorest.Encode("path", rolloutName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts/{rolloutName}", pathParameters), + autorest.WithJSON(properties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CustomRolloutsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client CustomRolloutsClient) CreateOrUpdateResponder(resp *http.Response) (result CustomRollout, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the custom rollout details. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// rolloutName - the rollout name. +func (client CustomRolloutsClient) Get(ctx context.Context, providerNamespace string, rolloutName string) (result CustomRollout, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomRolloutsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.CustomRolloutsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, providerNamespace, rolloutName) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.CustomRolloutsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.CustomRolloutsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.CustomRolloutsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CustomRolloutsClient) GetPreparer(ctx context.Context, providerNamespace string, rolloutName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "rolloutName": autorest.Encode("path", rolloutName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts/{rolloutName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CustomRolloutsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CustomRolloutsClient) GetResponder(resp *http.Response) (result CustomRollout, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByProviderRegistration gets the list of the custom rollouts for the given provider. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +func (client CustomRolloutsClient) ListByProviderRegistration(ctx context.Context, providerNamespace string) (result CustomRolloutArrayResponseWithContinuationPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomRolloutsClient.ListByProviderRegistration") + defer func() { + sc := -1 + if result.crarwc.Response.Response != nil { + sc = result.crarwc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.CustomRolloutsClient", "ListByProviderRegistration", err.Error()) + } + + result.fn = client.listByProviderRegistrationNextResults + req, err := client.ListByProviderRegistrationPreparer(ctx, providerNamespace) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.CustomRolloutsClient", "ListByProviderRegistration", nil, "Failure preparing request") + return + } + + resp, err := client.ListByProviderRegistrationSender(req) + if err != nil { + result.crarwc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.CustomRolloutsClient", "ListByProviderRegistration", resp, "Failure sending request") + return + } + + result.crarwc, err = client.ListByProviderRegistrationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.CustomRolloutsClient", "ListByProviderRegistration", resp, "Failure responding to request") + return + } + if result.crarwc.hasNextLink() && result.crarwc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByProviderRegistrationPreparer prepares the ListByProviderRegistration request. +func (client CustomRolloutsClient) ListByProviderRegistrationPreparer(ctx context.Context, providerNamespace string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/customRollouts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByProviderRegistrationSender sends the ListByProviderRegistration request. The method will close the +// http.Response Body if it receives an error. +func (client CustomRolloutsClient) ListByProviderRegistrationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByProviderRegistrationResponder handles the response to the ListByProviderRegistration request. The method always +// closes the http.Response Body. +func (client CustomRolloutsClient) ListByProviderRegistrationResponder(resp *http.Response) (result CustomRolloutArrayResponseWithContinuation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByProviderRegistrationNextResults retrieves the next set of results, if any. +func (client CustomRolloutsClient) listByProviderRegistrationNextResults(ctx context.Context, lastResults CustomRolloutArrayResponseWithContinuation) (result CustomRolloutArrayResponseWithContinuation, err error) { + req, err := lastResults.customRolloutArrayResponseWithContinuationPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "providerhub.CustomRolloutsClient", "listByProviderRegistrationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByProviderRegistrationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "providerhub.CustomRolloutsClient", "listByProviderRegistrationNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByProviderRegistrationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.CustomRolloutsClient", "listByProviderRegistrationNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByProviderRegistrationComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomRolloutsClient) ListByProviderRegistrationComplete(ctx context.Context, providerNamespace string) (result CustomRolloutArrayResponseWithContinuationIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomRolloutsClient.ListByProviderRegistration") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByProviderRegistration(ctx, providerNamespace) + return +} diff --git a/services/providerhub/mgmt/2020-11-20/providerhub/defaultrollouts.go b/services/providerhub/mgmt/2020-11-20/providerhub/defaultrollouts.go new file mode 100644 index 000000000000..7d161d741ae4 --- /dev/null +++ b/services/providerhub/mgmt/2020-11-20/providerhub/defaultrollouts.go @@ -0,0 +1,485 @@ +package providerhub + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DefaultRolloutsClient is the microsoft ProviderHub +type DefaultRolloutsClient struct { + BaseClient +} + +// NewDefaultRolloutsClient creates an instance of the DefaultRolloutsClient client. +func NewDefaultRolloutsClient(subscriptionID string) DefaultRolloutsClient { + return NewDefaultRolloutsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDefaultRolloutsClientWithBaseURI creates an instance of the DefaultRolloutsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDefaultRolloutsClientWithBaseURI(baseURI string, subscriptionID string) DefaultRolloutsClient { + return DefaultRolloutsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates the rollout details. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// rolloutName - the rollout name. +// properties - the Default rollout properties supplied to the CreateOrUpdate operation. +func (client DefaultRolloutsClient) CreateOrUpdate(ctx context.Context, providerNamespace string, rolloutName string, properties DefaultRollout) (result DefaultRolloutsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefaultRolloutsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.DefaultRolloutsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, providerNamespace, rolloutName, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "CreateOrUpdate", nil, "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DefaultRolloutsClient) CreateOrUpdatePreparer(ctx context.Context, providerNamespace string, rolloutName string, properties DefaultRollout) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "rolloutName": autorest.Encode("path", rolloutName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}", pathParameters), + autorest.WithJSON(properties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DefaultRolloutsClient) CreateOrUpdateSender(req *http.Request) (future DefaultRolloutsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DefaultRolloutsClient) CreateOrUpdateResponder(resp *http.Response) (result DefaultRollout, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the rollout resource. Rollout must be in terminal state. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// rolloutName - the rollout name. +func (client DefaultRolloutsClient) Delete(ctx context.Context, providerNamespace string, rolloutName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefaultRolloutsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.DefaultRolloutsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, providerNamespace, rolloutName) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DefaultRolloutsClient) DeletePreparer(ctx context.Context, providerNamespace string, rolloutName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "rolloutName": autorest.Encode("path", rolloutName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DefaultRolloutsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DefaultRolloutsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the default rollout details. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// rolloutName - the rollout name. +func (client DefaultRolloutsClient) Get(ctx context.Context, providerNamespace string, rolloutName string) (result DefaultRollout, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefaultRolloutsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.DefaultRolloutsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, providerNamespace, rolloutName) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DefaultRolloutsClient) GetPreparer(ctx context.Context, providerNamespace string, rolloutName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "rolloutName": autorest.Encode("path", rolloutName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DefaultRolloutsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DefaultRolloutsClient) GetResponder(resp *http.Response) (result DefaultRollout, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByProviderRegistration gets the list of the rollouts for the given provider. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +func (client DefaultRolloutsClient) ListByProviderRegistration(ctx context.Context, providerNamespace string) (result DefaultRolloutArrayResponseWithContinuationPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefaultRolloutsClient.ListByProviderRegistration") + defer func() { + sc := -1 + if result.drarwc.Response.Response != nil { + sc = result.drarwc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.DefaultRolloutsClient", "ListByProviderRegistration", err.Error()) + } + + result.fn = client.listByProviderRegistrationNextResults + req, err := client.ListByProviderRegistrationPreparer(ctx, providerNamespace) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "ListByProviderRegistration", nil, "Failure preparing request") + return + } + + resp, err := client.ListByProviderRegistrationSender(req) + if err != nil { + result.drarwc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "ListByProviderRegistration", resp, "Failure sending request") + return + } + + result.drarwc, err = client.ListByProviderRegistrationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "ListByProviderRegistration", resp, "Failure responding to request") + return + } + if result.drarwc.hasNextLink() && result.drarwc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByProviderRegistrationPreparer prepares the ListByProviderRegistration request. +func (client DefaultRolloutsClient) ListByProviderRegistrationPreparer(ctx context.Context, providerNamespace string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByProviderRegistrationSender sends the ListByProviderRegistration request. The method will close the +// http.Response Body if it receives an error. +func (client DefaultRolloutsClient) ListByProviderRegistrationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByProviderRegistrationResponder handles the response to the ListByProviderRegistration request. The method always +// closes the http.Response Body. +func (client DefaultRolloutsClient) ListByProviderRegistrationResponder(resp *http.Response) (result DefaultRolloutArrayResponseWithContinuation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByProviderRegistrationNextResults retrieves the next set of results, if any. +func (client DefaultRolloutsClient) listByProviderRegistrationNextResults(ctx context.Context, lastResults DefaultRolloutArrayResponseWithContinuation) (result DefaultRolloutArrayResponseWithContinuation, err error) { + req, err := lastResults.defaultRolloutArrayResponseWithContinuationPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "listByProviderRegistrationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByProviderRegistrationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "listByProviderRegistrationNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByProviderRegistrationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "listByProviderRegistrationNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByProviderRegistrationComplete enumerates all values, automatically crossing page boundaries as required. +func (client DefaultRolloutsClient) ListByProviderRegistrationComplete(ctx context.Context, providerNamespace string) (result DefaultRolloutArrayResponseWithContinuationIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefaultRolloutsClient.ListByProviderRegistration") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByProviderRegistration(ctx, providerNamespace) + return +} + +// Stop stops or cancels the rollout, if in progress. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// rolloutName - the rollout name. +func (client DefaultRolloutsClient) Stop(ctx context.Context, providerNamespace string, rolloutName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefaultRolloutsClient.Stop") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.DefaultRolloutsClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, providerNamespace, rolloutName) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "Stop", nil, "Failure preparing request") + return + } + + resp, err := client.StopSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "Stop", resp, "Failure sending request") + return + } + + result, err = client.StopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsClient", "Stop", resp, "Failure responding to request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client DefaultRolloutsClient) StopPreparer(ctx context.Context, providerNamespace string, rolloutName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "rolloutName": autorest.Encode("path", rolloutName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/defaultRollouts/{rolloutName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client DefaultRolloutsClient) StopSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client DefaultRolloutsClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/providerhub/mgmt/2020-11-20/providerhub/enums.go b/services/providerhub/mgmt/2020-11-20/providerhub/enums.go new file mode 100644 index 000000000000..dad70df313c2 --- /dev/null +++ b/services/providerhub/mgmt/2020-11-20/providerhub/enums.go @@ -0,0 +1,722 @@ +package providerhub + +// 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. + +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // Internal ... + Internal ActionType = "Internal" + // NotSpecified ... + NotSpecified ActionType = "NotSpecified" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{Internal, NotSpecified} +} + +// ExtensionCategory enumerates the values for extension category. +type ExtensionCategory string + +const ( + // ExtensionCategoryNotSpecified ... + ExtensionCategoryNotSpecified ExtensionCategory = "NotSpecified" + // ExtensionCategoryResourceCreationBegin ... + ExtensionCategoryResourceCreationBegin ExtensionCategory = "ResourceCreationBegin" + // ExtensionCategoryResourceCreationCompleted ... + ExtensionCategoryResourceCreationCompleted ExtensionCategory = "ResourceCreationCompleted" + // ExtensionCategoryResourceCreationValidate ... + ExtensionCategoryResourceCreationValidate ExtensionCategory = "ResourceCreationValidate" + // ExtensionCategoryResourceDeletionBegin ... + ExtensionCategoryResourceDeletionBegin ExtensionCategory = "ResourceDeletionBegin" + // ExtensionCategoryResourceDeletionCompleted ... + ExtensionCategoryResourceDeletionCompleted ExtensionCategory = "ResourceDeletionCompleted" + // ExtensionCategoryResourceDeletionValidate ... + ExtensionCategoryResourceDeletionValidate ExtensionCategory = "ResourceDeletionValidate" + // ExtensionCategoryResourceMoveBegin ... + ExtensionCategoryResourceMoveBegin ExtensionCategory = "ResourceMoveBegin" + // ExtensionCategoryResourceMoveCompleted ... + ExtensionCategoryResourceMoveCompleted ExtensionCategory = "ResourceMoveCompleted" + // ExtensionCategoryResourcePatchBegin ... + ExtensionCategoryResourcePatchBegin ExtensionCategory = "ResourcePatchBegin" + // ExtensionCategoryResourcePatchCompleted ... + ExtensionCategoryResourcePatchCompleted ExtensionCategory = "ResourcePatchCompleted" + // ExtensionCategoryResourcePatchValidate ... + ExtensionCategoryResourcePatchValidate ExtensionCategory = "ResourcePatchValidate" + // ExtensionCategoryResourcePostAction ... + ExtensionCategoryResourcePostAction ExtensionCategory = "ResourcePostAction" + // ExtensionCategoryResourceReadBegin ... + ExtensionCategoryResourceReadBegin ExtensionCategory = "ResourceReadBegin" + // ExtensionCategoryResourceReadValidate ... + ExtensionCategoryResourceReadValidate ExtensionCategory = "ResourceReadValidate" + // ExtensionCategorySubscriptionLifecycleNotification ... + ExtensionCategorySubscriptionLifecycleNotification ExtensionCategory = "SubscriptionLifecycleNotification" +) + +// PossibleExtensionCategoryValues returns an array of possible values for the ExtensionCategory const type. +func PossibleExtensionCategoryValues() []ExtensionCategory { + return []ExtensionCategory{ExtensionCategoryNotSpecified, ExtensionCategoryResourceCreationBegin, ExtensionCategoryResourceCreationCompleted, ExtensionCategoryResourceCreationValidate, ExtensionCategoryResourceDeletionBegin, ExtensionCategoryResourceDeletionCompleted, ExtensionCategoryResourceDeletionValidate, ExtensionCategoryResourceMoveBegin, ExtensionCategoryResourceMoveCompleted, ExtensionCategoryResourcePatchBegin, ExtensionCategoryResourcePatchCompleted, ExtensionCategoryResourcePatchValidate, ExtensionCategoryResourcePostAction, ExtensionCategoryResourceReadBegin, ExtensionCategoryResourceReadValidate, ExtensionCategorySubscriptionLifecycleNotification} +} + +// ExtensionOptionType enumerates the values for extension option type. +type ExtensionOptionType string + +const ( + // ExtensionOptionTypeDoNotMergeExistingReadOnlyAndSecretProperties ... + ExtensionOptionTypeDoNotMergeExistingReadOnlyAndSecretProperties ExtensionOptionType = "DoNotMergeExistingReadOnlyAndSecretProperties" + // ExtensionOptionTypeIncludeInternalMetadata ... + ExtensionOptionTypeIncludeInternalMetadata ExtensionOptionType = "IncludeInternalMetadata" + // ExtensionOptionTypeNotSpecified ... + ExtensionOptionTypeNotSpecified ExtensionOptionType = "NotSpecified" +) + +// PossibleExtensionOptionTypeValues returns an array of possible values for the ExtensionOptionType const type. +func PossibleExtensionOptionTypeValues() []ExtensionOptionType { + return []ExtensionOptionType{ExtensionOptionTypeDoNotMergeExistingReadOnlyAndSecretProperties, ExtensionOptionTypeIncludeInternalMetadata, ExtensionOptionTypeNotSpecified} +} + +// FeaturesPolicy enumerates the values for features policy. +type FeaturesPolicy string + +const ( + // All ... + All FeaturesPolicy = "All" + // Any ... + Any FeaturesPolicy = "Any" +) + +// PossibleFeaturesPolicyValues returns an array of possible values for the FeaturesPolicy const type. +func PossibleFeaturesPolicyValues() []FeaturesPolicy { + return []FeaturesPolicy{All, Any} +} + +// IdentityManagementTypes enumerates the values for identity management types. +type IdentityManagementTypes string + +const ( + // IdentityManagementTypesActor ... + IdentityManagementTypesActor IdentityManagementTypes = "Actor" + // IdentityManagementTypesDelegatedResourceIdentity ... + IdentityManagementTypesDelegatedResourceIdentity IdentityManagementTypes = "DelegatedResourceIdentity" + // IdentityManagementTypesNotSpecified ... + IdentityManagementTypesNotSpecified IdentityManagementTypes = "NotSpecified" + // IdentityManagementTypesSystemAssigned ... + IdentityManagementTypesSystemAssigned IdentityManagementTypes = "SystemAssigned" + // IdentityManagementTypesUserAssigned ... + IdentityManagementTypesUserAssigned IdentityManagementTypes = "UserAssigned" +) + +// PossibleIdentityManagementTypesValues returns an array of possible values for the IdentityManagementTypes const type. +func PossibleIdentityManagementTypesValues() []IdentityManagementTypes { + return []IdentityManagementTypes{IdentityManagementTypesActor, IdentityManagementTypesDelegatedResourceIdentity, IdentityManagementTypesNotSpecified, IdentityManagementTypesSystemAssigned, IdentityManagementTypesUserAssigned} +} + +// LinkedAction enumerates the values for linked action. +type LinkedAction string + +const ( + // LinkedActionBlocked ... + LinkedActionBlocked LinkedAction = "Blocked" + // LinkedActionEnabled ... + LinkedActionEnabled LinkedAction = "Enabled" + // LinkedActionNotSpecified ... + LinkedActionNotSpecified LinkedAction = "NotSpecified" + // LinkedActionValidate ... + LinkedActionValidate LinkedAction = "Validate" +) + +// PossibleLinkedActionValues returns an array of possible values for the LinkedAction const type. +func PossibleLinkedActionValues() []LinkedAction { + return []LinkedAction{LinkedActionBlocked, LinkedActionEnabled, LinkedActionNotSpecified, LinkedActionValidate} +} + +// LinkedOperation enumerates the values for linked operation. +type LinkedOperation string + +const ( + // CrossResourceGroupResourceMove ... + CrossResourceGroupResourceMove LinkedOperation = "CrossResourceGroupResourceMove" + // CrossSubscriptionResourceMove ... + CrossSubscriptionResourceMove LinkedOperation = "CrossSubscriptionResourceMove" + // None ... + None LinkedOperation = "None" +) + +// PossibleLinkedOperationValues returns an array of possible values for the LinkedOperation const type. +func PossibleLinkedOperationValues() []LinkedOperation { + return []LinkedOperation{CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, None} +} + +// LoggingDetails enumerates the values for logging details. +type LoggingDetails string + +const ( + // LoggingDetailsBody ... + LoggingDetailsBody LoggingDetails = "Body" + // LoggingDetailsNone ... + LoggingDetailsNone LoggingDetails = "None" +) + +// PossibleLoggingDetailsValues returns an array of possible values for the LoggingDetails const type. +func PossibleLoggingDetailsValues() []LoggingDetails { + return []LoggingDetails{LoggingDetailsBody, LoggingDetailsNone} +} + +// LoggingDirections enumerates the values for logging directions. +type LoggingDirections string + +const ( + // LoggingDirectionsNone ... + LoggingDirectionsNone LoggingDirections = "None" + // LoggingDirectionsRequest ... + LoggingDirectionsRequest LoggingDirections = "Request" + // LoggingDirectionsResponse ... + LoggingDirectionsResponse LoggingDirections = "Response" +) + +// PossibleLoggingDirectionsValues returns an array of possible values for the LoggingDirections const type. +func PossibleLoggingDirectionsValues() []LoggingDirections { + return []LoggingDirections{LoggingDirectionsNone, LoggingDirectionsRequest, LoggingDirectionsResponse} +} + +// ManifestResourceDeletionPolicy enumerates the values for manifest resource deletion policy. +type ManifestResourceDeletionPolicy string + +const ( + // ManifestResourceDeletionPolicyCascade ... + ManifestResourceDeletionPolicyCascade ManifestResourceDeletionPolicy = "Cascade" + // ManifestResourceDeletionPolicyForce ... + ManifestResourceDeletionPolicyForce ManifestResourceDeletionPolicy = "Force" + // ManifestResourceDeletionPolicyNotSpecified ... + ManifestResourceDeletionPolicyNotSpecified ManifestResourceDeletionPolicy = "NotSpecified" +) + +// PossibleManifestResourceDeletionPolicyValues returns an array of possible values for the ManifestResourceDeletionPolicy const type. +func PossibleManifestResourceDeletionPolicyValues() []ManifestResourceDeletionPolicy { + return []ManifestResourceDeletionPolicy{ManifestResourceDeletionPolicyCascade, ManifestResourceDeletionPolicyForce, ManifestResourceDeletionPolicyNotSpecified} +} + +// MarketplaceType enumerates the values for marketplace type. +type MarketplaceType string + +const ( + // MarketplaceTypeAddOn ... + MarketplaceTypeAddOn MarketplaceType = "AddOn" + // MarketplaceTypeBypass ... + MarketplaceTypeBypass MarketplaceType = "Bypass" + // MarketplaceTypeNotSpecified ... + MarketplaceTypeNotSpecified MarketplaceType = "NotSpecified" + // MarketplaceTypeStore ... + MarketplaceTypeStore MarketplaceType = "Store" +) + +// PossibleMarketplaceTypeValues returns an array of possible values for the MarketplaceType const type. +func PossibleMarketplaceTypeValues() []MarketplaceType { + return []MarketplaceType{MarketplaceTypeAddOn, MarketplaceTypeBypass, MarketplaceTypeNotSpecified, MarketplaceTypeStore} +} + +// MarketplaceType1 enumerates the values for marketplace type 1. +type MarketplaceType1 string + +const ( + // MarketplaceType1AddOn ... + MarketplaceType1AddOn MarketplaceType1 = "AddOn" + // MarketplaceType1Bypass ... + MarketplaceType1Bypass MarketplaceType1 = "Bypass" + // MarketplaceType1NotSpecified ... + MarketplaceType1NotSpecified MarketplaceType1 = "NotSpecified" + // MarketplaceType1Store ... + MarketplaceType1Store MarketplaceType1 = "Store" +) + +// PossibleMarketplaceType1Values returns an array of possible values for the MarketplaceType1 const type. +func PossibleMarketplaceType1Values() []MarketplaceType1 { + return []MarketplaceType1{MarketplaceType1AddOn, MarketplaceType1Bypass, MarketplaceType1NotSpecified, MarketplaceType1Store} +} + +// MessageScope enumerates the values for message scope. +type MessageScope string + +const ( + // MessageScopeNotSpecified ... + MessageScopeNotSpecified MessageScope = "NotSpecified" + // MessageScopeRegisteredSubscriptions ... + MessageScopeRegisteredSubscriptions MessageScope = "RegisteredSubscriptions" +) + +// PossibleMessageScopeValues returns an array of possible values for the MessageScope const type. +func PossibleMessageScopeValues() []MessageScope { + return []MessageScope{MessageScopeNotSpecified, MessageScopeRegisteredSubscriptions} +} + +// NotificationMode enumerates the values for notification mode. +type NotificationMode string + +const ( + // NotificationModeEventHub ... + NotificationModeEventHub NotificationMode = "EventHub" + // NotificationModeNotSpecified ... + NotificationModeNotSpecified NotificationMode = "NotSpecified" + // NotificationModeWebHook ... + NotificationModeWebHook NotificationMode = "WebHook" +) + +// PossibleNotificationModeValues returns an array of possible values for the NotificationMode const type. +func PossibleNotificationModeValues() []NotificationMode { + return []NotificationMode{NotificationModeEventHub, NotificationModeNotSpecified, NotificationModeWebHook} +} + +// OptInHeaderType enumerates the values for opt in header type. +type OptInHeaderType string + +const ( + // OptInHeaderTypeClientGroupMembership ... + OptInHeaderTypeClientGroupMembership OptInHeaderType = "ClientGroupMembership" + // OptInHeaderTypeNotSpecified ... + OptInHeaderTypeNotSpecified OptInHeaderType = "NotSpecified" + // OptInHeaderTypeSignedAuxiliaryTokens ... + OptInHeaderTypeSignedAuxiliaryTokens OptInHeaderType = "SignedAuxiliaryTokens" + // OptInHeaderTypeSignedUserToken ... + OptInHeaderTypeSignedUserToken OptInHeaderType = "SignedUserToken" + // OptInHeaderTypeUnboundedClientGroupMembership ... + OptInHeaderTypeUnboundedClientGroupMembership OptInHeaderType = "UnboundedClientGroupMembership" +) + +// PossibleOptInHeaderTypeValues returns an array of possible values for the OptInHeaderType const type. +func PossibleOptInHeaderTypeValues() []OptInHeaderType { + return []OptInHeaderType{OptInHeaderTypeClientGroupMembership, OptInHeaderTypeNotSpecified, OptInHeaderTypeSignedAuxiliaryTokens, OptInHeaderTypeSignedUserToken, OptInHeaderTypeUnboundedClientGroupMembership} +} + +// Origin enumerates the values for origin. +type Origin string + +const ( + // OriginNotSpecified ... + OriginNotSpecified Origin = "NotSpecified" + // OriginSystem ... + OriginSystem Origin = "System" + // OriginUser ... + OriginUser Origin = "User" +) + +// PossibleOriginValues returns an array of possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{OriginNotSpecified, OriginSystem, OriginUser} +} + +// PreflightOption enumerates the values for preflight option. +type PreflightOption string + +const ( + // PreflightOptionContinueDeploymentOnFailure ... + PreflightOptionContinueDeploymentOnFailure PreflightOption = "ContinueDeploymentOnFailure" + // PreflightOptionDefaultValidationOnly ... + PreflightOptionDefaultValidationOnly PreflightOption = "DefaultValidationOnly" + // PreflightOptionNone ... + PreflightOptionNone PreflightOption = "None" +) + +// PossiblePreflightOptionValues returns an array of possible values for the PreflightOption const type. +func PossiblePreflightOptionValues() []PreflightOption { + return []PreflightOption{PreflightOptionContinueDeploymentOnFailure, PreflightOptionDefaultValidationOnly, PreflightOptionNone} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateAccepted ... + ProvisioningStateAccepted ProvisioningState = "Accepted" + // ProvisioningStateCanceled ... + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateCreated ... + ProvisioningStateCreated ProvisioningState = "Created" + // ProvisioningStateCreating ... + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleted ... + ProvisioningStateDeleted ProvisioningState = "Deleted" + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateMovingResources ... + ProvisioningStateMovingResources ProvisioningState = "MovingResources" + // ProvisioningStateNotSpecified ... + ProvisioningStateNotSpecified ProvisioningState = "NotSpecified" + // ProvisioningStateRolloutInProgress ... + ProvisioningStateRolloutInProgress ProvisioningState = "RolloutInProgress" + // ProvisioningStateRunning ... + ProvisioningStateRunning ProvisioningState = "Running" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateTransientFailure ... + ProvisioningStateTransientFailure ProvisioningState = "TransientFailure" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateAccepted, ProvisioningStateCanceled, ProvisioningStateCreated, ProvisioningStateCreating, ProvisioningStateDeleted, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMovingResources, ProvisioningStateNotSpecified, ProvisioningStateRolloutInProgress, ProvisioningStateRunning, ProvisioningStateSucceeded, ProvisioningStateTransientFailure} +} + +// Regionality enumerates the values for regionality. +type Regionality string + +const ( + // RegionalityGlobal ... + RegionalityGlobal Regionality = "Global" + // RegionalityNotSpecified ... + RegionalityNotSpecified Regionality = "NotSpecified" + // RegionalityRegional ... + RegionalityRegional Regionality = "Regional" +) + +// PossibleRegionalityValues returns an array of possible values for the Regionality const type. +func PossibleRegionalityValues() []Regionality { + return []Regionality{RegionalityGlobal, RegionalityNotSpecified, RegionalityRegional} +} + +// ResourceAccessPolicy enumerates the values for resource access policy. +type ResourceAccessPolicy string + +const ( + // ResourceAccessPolicyAcisActionAllowed ... + ResourceAccessPolicyAcisActionAllowed ResourceAccessPolicy = "AcisActionAllowed" + // ResourceAccessPolicyAcisReadAllowed ... + ResourceAccessPolicyAcisReadAllowed ResourceAccessPolicy = "AcisReadAllowed" + // ResourceAccessPolicyNotSpecified ... + ResourceAccessPolicyNotSpecified ResourceAccessPolicy = "NotSpecified" +) + +// PossibleResourceAccessPolicyValues returns an array of possible values for the ResourceAccessPolicy const type. +func PossibleResourceAccessPolicyValues() []ResourceAccessPolicy { + return []ResourceAccessPolicy{ResourceAccessPolicyAcisActionAllowed, ResourceAccessPolicyAcisReadAllowed, ResourceAccessPolicyNotSpecified} +} + +// ResourceDeletionPolicy enumerates the values for resource deletion policy. +type ResourceDeletionPolicy string + +const ( + // ResourceDeletionPolicyCascadeDeleteAll ... + ResourceDeletionPolicyCascadeDeleteAll ResourceDeletionPolicy = "CascadeDeleteAll" + // ResourceDeletionPolicyCascadeDeleteProxyOnlyChildren ... + ResourceDeletionPolicyCascadeDeleteProxyOnlyChildren ResourceDeletionPolicy = "CascadeDeleteProxyOnlyChildren" + // ResourceDeletionPolicyNotSpecified ... + ResourceDeletionPolicyNotSpecified ResourceDeletionPolicy = "NotSpecified" +) + +// PossibleResourceDeletionPolicyValues returns an array of possible values for the ResourceDeletionPolicy const type. +func PossibleResourceDeletionPolicyValues() []ResourceDeletionPolicy { + return []ResourceDeletionPolicy{ResourceDeletionPolicyCascadeDeleteAll, ResourceDeletionPolicyCascadeDeleteProxyOnlyChildren, ResourceDeletionPolicyNotSpecified} +} + +// ResourceProviderCapabilitiesEffect enumerates the values for resource provider capabilities effect. +type ResourceProviderCapabilitiesEffect string + +const ( + // ResourceProviderCapabilitiesEffectAllow ... + ResourceProviderCapabilitiesEffectAllow ResourceProviderCapabilitiesEffect = "Allow" + // ResourceProviderCapabilitiesEffectDisallow ... + ResourceProviderCapabilitiesEffectDisallow ResourceProviderCapabilitiesEffect = "Disallow" + // ResourceProviderCapabilitiesEffectNotSpecified ... + ResourceProviderCapabilitiesEffectNotSpecified ResourceProviderCapabilitiesEffect = "NotSpecified" +) + +// PossibleResourceProviderCapabilitiesEffectValues returns an array of possible values for the ResourceProviderCapabilitiesEffect const type. +func PossibleResourceProviderCapabilitiesEffectValues() []ResourceProviderCapabilitiesEffect { + return []ResourceProviderCapabilitiesEffect{ResourceProviderCapabilitiesEffectAllow, ResourceProviderCapabilitiesEffectDisallow, ResourceProviderCapabilitiesEffectNotSpecified} +} + +// ResourceProviderType enumerates the values for resource provider type. +type ResourceProviderType string + +const ( + // ResourceProviderTypeAuthorizationFree ... + ResourceProviderTypeAuthorizationFree ResourceProviderType = "AuthorizationFree" + // ResourceProviderTypeExternal ... + ResourceProviderTypeExternal ResourceProviderType = "External" + // ResourceProviderTypeHidden ... + ResourceProviderTypeHidden ResourceProviderType = "Hidden" + // ResourceProviderTypeInternal ... + ResourceProviderTypeInternal ResourceProviderType = "Internal" + // ResourceProviderTypeLegacyRegistrationRequired ... + ResourceProviderTypeLegacyRegistrationRequired ResourceProviderType = "LegacyRegistrationRequired" + // ResourceProviderTypeNotSpecified ... + ResourceProviderTypeNotSpecified ResourceProviderType = "NotSpecified" + // ResourceProviderTypeRegistrationFree ... + ResourceProviderTypeRegistrationFree ResourceProviderType = "RegistrationFree" + // ResourceProviderTypeTenantOnly ... + ResourceProviderTypeTenantOnly ResourceProviderType = "TenantOnly" +) + +// PossibleResourceProviderTypeValues returns an array of possible values for the ResourceProviderType const type. +func PossibleResourceProviderTypeValues() []ResourceProviderType { + return []ResourceProviderType{ResourceProviderTypeAuthorizationFree, ResourceProviderTypeExternal, ResourceProviderTypeHidden, ResourceProviderTypeInternal, ResourceProviderTypeLegacyRegistrationRequired, ResourceProviderTypeNotSpecified, ResourceProviderTypeRegistrationFree, ResourceProviderTypeTenantOnly} +} + +// ResourceValidation enumerates the values for resource validation. +type ResourceValidation string + +const ( + // ResourceValidationNotSpecified ... + ResourceValidationNotSpecified ResourceValidation = "NotSpecified" + // ResourceValidationProfaneWords ... + ResourceValidationProfaneWords ResourceValidation = "ProfaneWords" + // ResourceValidationReservedWords ... + ResourceValidationReservedWords ResourceValidation = "ReservedWords" +) + +// PossibleResourceValidationValues returns an array of possible values for the ResourceValidation const type. +func PossibleResourceValidationValues() []ResourceValidation { + return []ResourceValidation{ResourceValidationNotSpecified, ResourceValidationProfaneWords, ResourceValidationReservedWords} +} + +// RoutingType enumerates the values for routing type. +type RoutingType string + +const ( + // CascadeExtension ... + CascadeExtension RoutingType = "CascadeExtension" + // Default ... + Default RoutingType = "Default" + // Extension ... + Extension RoutingType = "Extension" + // Failover ... + Failover RoutingType = "Failover" + // Fanout ... + Fanout RoutingType = "Fanout" + // HostBased ... + HostBased RoutingType = "HostBased" + // LocationBased ... + LocationBased RoutingType = "LocationBased" + // ProxyOnly ... + ProxyOnly RoutingType = "ProxyOnly" + // Tenant ... + Tenant RoutingType = "Tenant" +) + +// PossibleRoutingTypeValues returns an array of possible values for the RoutingType const type. +func PossibleRoutingTypeValues() []RoutingType { + return []RoutingType{CascadeExtension, Default, Extension, Failover, Fanout, HostBased, LocationBased, ProxyOnly, Tenant} +} + +// SkuScaleType enumerates the values for sku scale type. +type SkuScaleType string + +const ( + // SkuScaleTypeAutomatic ... + SkuScaleTypeAutomatic SkuScaleType = "Automatic" + // SkuScaleTypeManual ... + SkuScaleTypeManual SkuScaleType = "Manual" + // SkuScaleTypeNone ... + SkuScaleTypeNone SkuScaleType = "None" +) + +// PossibleSkuScaleTypeValues returns an array of possible values for the SkuScaleType const type. +func PossibleSkuScaleTypeValues() []SkuScaleType { + return []SkuScaleType{SkuScaleTypeAutomatic, SkuScaleTypeManual, SkuScaleTypeNone} +} + +// SubscriptionNotificationOperation enumerates the values for subscription notification operation. +type SubscriptionNotificationOperation string + +const ( + // BillingCancellation ... + BillingCancellation SubscriptionNotificationOperation = "BillingCancellation" + // DeleteAllResources ... + DeleteAllResources SubscriptionNotificationOperation = "DeleteAllResources" + // NoOp ... + NoOp SubscriptionNotificationOperation = "NoOp" + // NotDefined ... + NotDefined SubscriptionNotificationOperation = "NotDefined" + // SoftDeleteAllResources ... + SoftDeleteAllResources SubscriptionNotificationOperation = "SoftDeleteAllResources" + // UndoSoftDelete ... + UndoSoftDelete SubscriptionNotificationOperation = "UndoSoftDelete" +) + +// PossibleSubscriptionNotificationOperationValues returns an array of possible values for the SubscriptionNotificationOperation const type. +func PossibleSubscriptionNotificationOperationValues() []SubscriptionNotificationOperation { + return []SubscriptionNotificationOperation{BillingCancellation, DeleteAllResources, NoOp, NotDefined, SoftDeleteAllResources, UndoSoftDelete} +} + +// SubscriptionReregistrationResult enumerates the values for subscription reregistration result. +type SubscriptionReregistrationResult string + +const ( + // ConditionalUpdate ... + ConditionalUpdate SubscriptionReregistrationResult = "ConditionalUpdate" + // Failed ... + Failed SubscriptionReregistrationResult = "Failed" + // ForcedUpdate ... + ForcedUpdate SubscriptionReregistrationResult = "ForcedUpdate" + // NotApplicable ... + NotApplicable SubscriptionReregistrationResult = "NotApplicable" +) + +// PossibleSubscriptionReregistrationResultValues returns an array of possible values for the SubscriptionReregistrationResult const type. +func PossibleSubscriptionReregistrationResultValues() []SubscriptionReregistrationResult { + return []SubscriptionReregistrationResult{ConditionalUpdate, Failed, ForcedUpdate, NotApplicable} +} + +// SubscriptionState enumerates the values for subscription state. +type SubscriptionState string + +const ( + // SubscriptionStateDeleted ... + SubscriptionStateDeleted SubscriptionState = "Deleted" + // SubscriptionStateDisabled ... + SubscriptionStateDisabled SubscriptionState = "Disabled" + // SubscriptionStateEnabled ... + SubscriptionStateEnabled SubscriptionState = "Enabled" + // SubscriptionStateNotDefined ... + SubscriptionStateNotDefined SubscriptionState = "NotDefined" + // SubscriptionStatePastDue ... + SubscriptionStatePastDue SubscriptionState = "PastDue" + // SubscriptionStateWarned ... + SubscriptionStateWarned SubscriptionState = "Warned" +) + +// PossibleSubscriptionStateValues returns an array of possible values for the SubscriptionState const type. +func PossibleSubscriptionStateValues() []SubscriptionState { + return []SubscriptionState{SubscriptionStateDeleted, SubscriptionStateDisabled, SubscriptionStateEnabled, SubscriptionStateNotDefined, SubscriptionStatePastDue, SubscriptionStateWarned} +} + +// SubscriptionTransitioningState enumerates the values for subscription transitioning state. +type SubscriptionTransitioningState string + +const ( + // Deleted ... + Deleted SubscriptionTransitioningState = "Deleted" + // Registered ... + Registered SubscriptionTransitioningState = "Registered" + // Suspended ... + Suspended SubscriptionTransitioningState = "Suspended" + // SuspendedToDeleted ... + SuspendedToDeleted SubscriptionTransitioningState = "SuspendedToDeleted" + // SuspendedToRegistered ... + SuspendedToRegistered SubscriptionTransitioningState = "SuspendedToRegistered" + // SuspendedToUnregistered ... + SuspendedToUnregistered SubscriptionTransitioningState = "SuspendedToUnregistered" + // SuspendedToWarned ... + SuspendedToWarned SubscriptionTransitioningState = "SuspendedToWarned" + // Unregistered ... + Unregistered SubscriptionTransitioningState = "Unregistered" + // Warned ... + Warned SubscriptionTransitioningState = "Warned" + // WarnedToDeleted ... + WarnedToDeleted SubscriptionTransitioningState = "WarnedToDeleted" + // WarnedToRegistered ... + WarnedToRegistered SubscriptionTransitioningState = "WarnedToRegistered" + // WarnedToSuspended ... + WarnedToSuspended SubscriptionTransitioningState = "WarnedToSuspended" + // WarnedToUnregistered ... + WarnedToUnregistered SubscriptionTransitioningState = "WarnedToUnregistered" +) + +// PossibleSubscriptionTransitioningStateValues returns an array of possible values for the SubscriptionTransitioningState const type. +func PossibleSubscriptionTransitioningStateValues() []SubscriptionTransitioningState { + return []SubscriptionTransitioningState{Deleted, Registered, Suspended, SuspendedToDeleted, SuspendedToRegistered, SuspendedToUnregistered, SuspendedToWarned, Unregistered, Warned, WarnedToDeleted, WarnedToRegistered, WarnedToSuspended, WarnedToUnregistered} +} + +// TemplateDeploymentCapabilities enumerates the values for template deployment capabilities. +type TemplateDeploymentCapabilities string + +const ( + // TemplateDeploymentCapabilitiesDefault ... + TemplateDeploymentCapabilitiesDefault TemplateDeploymentCapabilities = "Default" + // TemplateDeploymentCapabilitiesPreflight ... + TemplateDeploymentCapabilitiesPreflight TemplateDeploymentCapabilities = "Preflight" +) + +// PossibleTemplateDeploymentCapabilitiesValues returns an array of possible values for the TemplateDeploymentCapabilities const type. +func PossibleTemplateDeploymentCapabilitiesValues() []TemplateDeploymentCapabilities { + return []TemplateDeploymentCapabilities{TemplateDeploymentCapabilitiesDefault, TemplateDeploymentCapabilitiesPreflight} +} + +// TemplateDeploymentPreflightOptions enumerates the values for template deployment preflight options. +type TemplateDeploymentPreflightOptions string + +const ( + // TemplateDeploymentPreflightOptionsDeploymentRequests ... + TemplateDeploymentPreflightOptionsDeploymentRequests TemplateDeploymentPreflightOptions = "DeploymentRequests" + // TemplateDeploymentPreflightOptionsNone ... + TemplateDeploymentPreflightOptionsNone TemplateDeploymentPreflightOptions = "None" + // TemplateDeploymentPreflightOptionsRegisteredOnly ... + TemplateDeploymentPreflightOptionsRegisteredOnly TemplateDeploymentPreflightOptions = "RegisteredOnly" + // TemplateDeploymentPreflightOptionsTestOnly ... + TemplateDeploymentPreflightOptionsTestOnly TemplateDeploymentPreflightOptions = "TestOnly" + // TemplateDeploymentPreflightOptionsValidationRequests ... + TemplateDeploymentPreflightOptionsValidationRequests TemplateDeploymentPreflightOptions = "ValidationRequests" +) + +// PossibleTemplateDeploymentPreflightOptionsValues returns an array of possible values for the TemplateDeploymentPreflightOptions const type. +func PossibleTemplateDeploymentPreflightOptionsValues() []TemplateDeploymentPreflightOptions { + return []TemplateDeploymentPreflightOptions{TemplateDeploymentPreflightOptionsDeploymentRequests, TemplateDeploymentPreflightOptionsNone, TemplateDeploymentPreflightOptionsRegisteredOnly, TemplateDeploymentPreflightOptionsTestOnly, TemplateDeploymentPreflightOptionsValidationRequests} +} + +// ThrottlingMetricType enumerates the values for throttling metric type. +type ThrottlingMetricType string + +const ( + // ThrottlingMetricTypeNotSpecified ... + ThrottlingMetricTypeNotSpecified ThrottlingMetricType = "NotSpecified" + // ThrottlingMetricTypeNumberOfRequests ... + ThrottlingMetricTypeNumberOfRequests ThrottlingMetricType = "NumberOfRequests" + // ThrottlingMetricTypeNumberOfResources ... + ThrottlingMetricTypeNumberOfResources ThrottlingMetricType = "NumberOfResources" +) + +// PossibleThrottlingMetricTypeValues returns an array of possible values for the ThrottlingMetricType const type. +func PossibleThrottlingMetricTypeValues() []ThrottlingMetricType { + return []ThrottlingMetricType{ThrottlingMetricTypeNotSpecified, ThrottlingMetricTypeNumberOfRequests, ThrottlingMetricTypeNumberOfResources} +} + +// TrafficRegionCategory enumerates the values for traffic region category. +type TrafficRegionCategory string + +const ( + // TrafficRegionCategoryCanary ... + TrafficRegionCategoryCanary TrafficRegionCategory = "Canary" + // TrafficRegionCategoryHighTraffic ... + TrafficRegionCategoryHighTraffic TrafficRegionCategory = "HighTraffic" + // TrafficRegionCategoryLowTraffic ... + TrafficRegionCategoryLowTraffic TrafficRegionCategory = "LowTraffic" + // TrafficRegionCategoryMediumTraffic ... + TrafficRegionCategoryMediumTraffic TrafficRegionCategory = "MediumTraffic" + // TrafficRegionCategoryNone ... + TrafficRegionCategoryNone TrafficRegionCategory = "None" + // TrafficRegionCategoryNotSpecified ... + TrafficRegionCategoryNotSpecified TrafficRegionCategory = "NotSpecified" + // TrafficRegionCategoryRestOfTheWorldGroupOne ... + TrafficRegionCategoryRestOfTheWorldGroupOne TrafficRegionCategory = "RestOfTheWorldGroupOne" + // TrafficRegionCategoryRestOfTheWorldGroupTwo ... + TrafficRegionCategoryRestOfTheWorldGroupTwo TrafficRegionCategory = "RestOfTheWorldGroupTwo" +) + +// PossibleTrafficRegionCategoryValues returns an array of possible values for the TrafficRegionCategory const type. +func PossibleTrafficRegionCategoryValues() []TrafficRegionCategory { + return []TrafficRegionCategory{TrafficRegionCategoryCanary, TrafficRegionCategoryHighTraffic, TrafficRegionCategoryLowTraffic, TrafficRegionCategoryMediumTraffic, TrafficRegionCategoryNone, TrafficRegionCategoryNotSpecified, TrafficRegionCategoryRestOfTheWorldGroupOne, TrafficRegionCategoryRestOfTheWorldGroupTwo} +} + +// Type enumerates the values for type. +type Type string + +const ( + // TypeArcZone ... + TypeArcZone Type = "ArcZone" + // TypeEdgeZone ... + TypeEdgeZone Type = "EdgeZone" + // TypeNotSpecified ... + TypeNotSpecified Type = "NotSpecified" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeArcZone, TypeEdgeZone, TypeNotSpecified} +} diff --git a/services/providerhub/mgmt/2020-11-20/providerhub/models.go b/services/providerhub/mgmt/2020-11-20/providerhub/models.go new file mode 100644 index 000000000000..336a3a06dd59 --- /dev/null +++ b/services/providerhub/mgmt/2020-11-20/providerhub/models.go @@ -0,0 +1,2812 @@ +package providerhub + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/providerhub/mgmt/2020-11-20/providerhub" + +// AuthorizationActionMapping ... +type AuthorizationActionMapping struct { + Original *string `json:"original,omitempty"` + Desired *string `json:"desired,omitempty"` +} + +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CanaryTrafficRegionRolloutConfiguration ... +type CanaryTrafficRegionRolloutConfiguration struct { + SkipRegions *[]string `json:"skipRegions,omitempty"` + Regions *[]string `json:"regions,omitempty"` +} + +// CheckinManifestInfo ... +type CheckinManifestInfo struct { + autorest.Response `json:"-"` + IsCheckedIn *bool `json:"isCheckedIn,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + PullRequest *string `json:"pullRequest,omitempty"` + CommitID *string `json:"commitId,omitempty"` +} + +// CheckinManifestParams ... +type CheckinManifestParams struct { + // Environment - The environment supplied to the checkin manifest operation. + Environment *string `json:"environment,omitempty"` + // BaselineArmManifestLocation - The baseline ARM manifest location supplied to the checkin manifest operation. + BaselineArmManifestLocation *string `json:"baselineArmManifestLocation,omitempty"` +} + +// CheckNameAvailabilitySpecifications ... +type CheckNameAvailabilitySpecifications struct { + EnableDefaultValidation *bool `json:"enableDefaultValidation,omitempty"` + ResourceTypesWithCustomValidation *[]string `json:"resourceTypesWithCustomValidation,omitempty"` +} + +// CustomRollout rollout details. +type CustomRollout struct { + autorest.Response `json:"-"` + // Properties - Properties of the rollout. + Properties *CustomRolloutPropertiesModel `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomRollout. +func (cr CustomRollout) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cr.Properties != nil { + objectMap["properties"] = cr.Properties + } + return json.Marshal(objectMap) +} + +// CustomRolloutArrayResponseWithContinuation ... +type CustomRolloutArrayResponseWithContinuation struct { + autorest.Response `json:"-"` + Value *[]CustomRollout `json:"value,omitempty"` + // NextLink - The URL to get to the next set of results, if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// CustomRolloutArrayResponseWithContinuationIterator provides access to a complete listing of +// CustomRollout values. +type CustomRolloutArrayResponseWithContinuationIterator struct { + i int + page CustomRolloutArrayResponseWithContinuationPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CustomRolloutArrayResponseWithContinuationIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomRolloutArrayResponseWithContinuationIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CustomRolloutArrayResponseWithContinuationIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CustomRolloutArrayResponseWithContinuationIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CustomRolloutArrayResponseWithContinuationIterator) Response() CustomRolloutArrayResponseWithContinuation { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CustomRolloutArrayResponseWithContinuationIterator) Value() CustomRollout { + if !iter.page.NotDone() { + return CustomRollout{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CustomRolloutArrayResponseWithContinuationIterator type. +func NewCustomRolloutArrayResponseWithContinuationIterator(page CustomRolloutArrayResponseWithContinuationPage) CustomRolloutArrayResponseWithContinuationIterator { + return CustomRolloutArrayResponseWithContinuationIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (crarwc CustomRolloutArrayResponseWithContinuation) IsEmpty() bool { + return crarwc.Value == nil || len(*crarwc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (crarwc CustomRolloutArrayResponseWithContinuation) hasNextLink() bool { + return crarwc.NextLink != nil && len(*crarwc.NextLink) != 0 +} + +// customRolloutArrayResponseWithContinuationPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (crarwc CustomRolloutArrayResponseWithContinuation) customRolloutArrayResponseWithContinuationPreparer(ctx context.Context) (*http.Request, error) { + if !crarwc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(crarwc.NextLink))) +} + +// CustomRolloutArrayResponseWithContinuationPage contains a page of CustomRollout values. +type CustomRolloutArrayResponseWithContinuationPage struct { + fn func(context.Context, CustomRolloutArrayResponseWithContinuation) (CustomRolloutArrayResponseWithContinuation, error) + crarwc CustomRolloutArrayResponseWithContinuation +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CustomRolloutArrayResponseWithContinuationPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomRolloutArrayResponseWithContinuationPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.crarwc) + if err != nil { + return err + } + page.crarwc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CustomRolloutArrayResponseWithContinuationPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CustomRolloutArrayResponseWithContinuationPage) NotDone() bool { + return !page.crarwc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CustomRolloutArrayResponseWithContinuationPage) Response() CustomRolloutArrayResponseWithContinuation { + return page.crarwc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CustomRolloutArrayResponseWithContinuationPage) Values() []CustomRollout { + if page.crarwc.IsEmpty() { + return nil + } + return *page.crarwc.Value +} + +// Creates a new instance of the CustomRolloutArrayResponseWithContinuationPage type. +func NewCustomRolloutArrayResponseWithContinuationPage(cur CustomRolloutArrayResponseWithContinuation, getNextPage func(context.Context, CustomRolloutArrayResponseWithContinuation) (CustomRolloutArrayResponseWithContinuation, error)) CustomRolloutArrayResponseWithContinuationPage { + return CustomRolloutArrayResponseWithContinuationPage{ + fn: getNextPage, + crarwc: cur, + } +} + +// CustomRolloutProperties ... +type CustomRolloutProperties struct { + // ProvisioningState - Possible values include: 'ProvisioningStateNotSpecified', 'ProvisioningStateAccepted', 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateCreated', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateCanceled', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateMovingResources', 'ProvisioningStateTransientFailure', 'ProvisioningStateRolloutInProgress' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + Specification *CustomRolloutPropertiesSpecification `json:"specification,omitempty"` + Status *CustomRolloutPropertiesStatus `json:"status,omitempty"` +} + +// CustomRolloutPropertiesModel properties of the rollout. +type CustomRolloutPropertiesModel struct { + // ProvisioningState - Possible values include: 'ProvisioningStateNotSpecified', 'ProvisioningStateAccepted', 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateCreated', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateCanceled', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateMovingResources', 'ProvisioningStateTransientFailure', 'ProvisioningStateRolloutInProgress' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + Specification *CustomRolloutPropertiesSpecification `json:"specification,omitempty"` + Status *CustomRolloutPropertiesStatus `json:"status,omitempty"` +} + +// CustomRolloutPropertiesSpecification ... +type CustomRolloutPropertiesSpecification struct { + Canary *CustomRolloutSpecificationCanary `json:"canary,omitempty"` + ProviderRegistration *CustomRolloutSpecificationProviderRegistration `json:"providerRegistration,omitempty"` + ResourceTypeRegistrations *[]ResourceTypeRegistration `json:"resourceTypeRegistrations,omitempty"` +} + +// CustomRolloutPropertiesStatus ... +type CustomRolloutPropertiesStatus struct { + CompletedRegions *[]string `json:"completedRegions,omitempty"` + FailedOrSkippedRegions map[string]*ExtendedErrorInfo `json:"failedOrSkippedRegions"` +} + +// MarshalJSON is the custom marshaler for CustomRolloutPropertiesStatus. +func (crp CustomRolloutPropertiesStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if crp.CompletedRegions != nil { + objectMap["completedRegions"] = crp.CompletedRegions + } + if crp.FailedOrSkippedRegions != nil { + objectMap["failedOrSkippedRegions"] = crp.FailedOrSkippedRegions + } + return json.Marshal(objectMap) +} + +// CustomRolloutSpecification ... +type CustomRolloutSpecification struct { + Canary *CustomRolloutSpecificationCanary `json:"canary,omitempty"` + ProviderRegistration *CustomRolloutSpecificationProviderRegistration `json:"providerRegistration,omitempty"` + ResourceTypeRegistrations *[]ResourceTypeRegistration `json:"resourceTypeRegistrations,omitempty"` +} + +// CustomRolloutSpecificationCanary ... +type CustomRolloutSpecificationCanary struct { + Regions *[]string `json:"regions,omitempty"` +} + +// CustomRolloutSpecificationProviderRegistration ... +type CustomRolloutSpecificationProviderRegistration struct { + Properties *ProviderRegistrationPropertiesModel `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomRolloutSpecificationProviderRegistration. +func (crsR CustomRolloutSpecificationProviderRegistration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if crsR.Properties != nil { + objectMap["properties"] = crsR.Properties + } + return json.Marshal(objectMap) +} + +// CustomRolloutStatus ... +type CustomRolloutStatus struct { + CompletedRegions *[]string `json:"completedRegions,omitempty"` + FailedOrSkippedRegions map[string]*ExtendedErrorInfo `json:"failedOrSkippedRegions"` +} + +// MarshalJSON is the custom marshaler for CustomRolloutStatus. +func (crs CustomRolloutStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if crs.CompletedRegions != nil { + objectMap["completedRegions"] = crs.CompletedRegions + } + if crs.FailedOrSkippedRegions != nil { + objectMap["failedOrSkippedRegions"] = crs.FailedOrSkippedRegions + } + return json.Marshal(objectMap) +} + +// DefaultRollout default rollout definition. +type DefaultRollout struct { + autorest.Response `json:"-"` + // Properties - Properties of the rollout. + Properties *DefaultRolloutPropertiesModel `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefaultRollout. +func (dr DefaultRollout) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dr.Properties != nil { + objectMap["properties"] = dr.Properties + } + return json.Marshal(objectMap) +} + +// DefaultRolloutArrayResponseWithContinuation ... +type DefaultRolloutArrayResponseWithContinuation struct { + autorest.Response `json:"-"` + Value *[]DefaultRollout `json:"value,omitempty"` + // NextLink - The URL to get to the next set of results, if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// DefaultRolloutArrayResponseWithContinuationIterator provides access to a complete listing of +// DefaultRollout values. +type DefaultRolloutArrayResponseWithContinuationIterator struct { + i int + page DefaultRolloutArrayResponseWithContinuationPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DefaultRolloutArrayResponseWithContinuationIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefaultRolloutArrayResponseWithContinuationIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DefaultRolloutArrayResponseWithContinuationIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DefaultRolloutArrayResponseWithContinuationIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DefaultRolloutArrayResponseWithContinuationIterator) Response() DefaultRolloutArrayResponseWithContinuation { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DefaultRolloutArrayResponseWithContinuationIterator) Value() DefaultRollout { + if !iter.page.NotDone() { + return DefaultRollout{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DefaultRolloutArrayResponseWithContinuationIterator type. +func NewDefaultRolloutArrayResponseWithContinuationIterator(page DefaultRolloutArrayResponseWithContinuationPage) DefaultRolloutArrayResponseWithContinuationIterator { + return DefaultRolloutArrayResponseWithContinuationIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (drarwc DefaultRolloutArrayResponseWithContinuation) IsEmpty() bool { + return drarwc.Value == nil || len(*drarwc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (drarwc DefaultRolloutArrayResponseWithContinuation) hasNextLink() bool { + return drarwc.NextLink != nil && len(*drarwc.NextLink) != 0 +} + +// defaultRolloutArrayResponseWithContinuationPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (drarwc DefaultRolloutArrayResponseWithContinuation) defaultRolloutArrayResponseWithContinuationPreparer(ctx context.Context) (*http.Request, error) { + if !drarwc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(drarwc.NextLink))) +} + +// DefaultRolloutArrayResponseWithContinuationPage contains a page of DefaultRollout values. +type DefaultRolloutArrayResponseWithContinuationPage struct { + fn func(context.Context, DefaultRolloutArrayResponseWithContinuation) (DefaultRolloutArrayResponseWithContinuation, error) + drarwc DefaultRolloutArrayResponseWithContinuation +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DefaultRolloutArrayResponseWithContinuationPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefaultRolloutArrayResponseWithContinuationPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.drarwc) + if err != nil { + return err + } + page.drarwc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DefaultRolloutArrayResponseWithContinuationPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DefaultRolloutArrayResponseWithContinuationPage) NotDone() bool { + return !page.drarwc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DefaultRolloutArrayResponseWithContinuationPage) Response() DefaultRolloutArrayResponseWithContinuation { + return page.drarwc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DefaultRolloutArrayResponseWithContinuationPage) Values() []DefaultRollout { + if page.drarwc.IsEmpty() { + return nil + } + return *page.drarwc.Value +} + +// Creates a new instance of the DefaultRolloutArrayResponseWithContinuationPage type. +func NewDefaultRolloutArrayResponseWithContinuationPage(cur DefaultRolloutArrayResponseWithContinuation, getNextPage func(context.Context, DefaultRolloutArrayResponseWithContinuation) (DefaultRolloutArrayResponseWithContinuation, error)) DefaultRolloutArrayResponseWithContinuationPage { + return DefaultRolloutArrayResponseWithContinuationPage{ + fn: getNextPage, + drarwc: cur, + } +} + +// DefaultRolloutProperties ... +type DefaultRolloutProperties struct { + // ProvisioningState - Possible values include: 'ProvisioningStateNotSpecified', 'ProvisioningStateAccepted', 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateCreated', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateCanceled', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateMovingResources', 'ProvisioningStateTransientFailure', 'ProvisioningStateRolloutInProgress' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + Specification *DefaultRolloutPropertiesSpecification `json:"specification,omitempty"` + Status *DefaultRolloutPropertiesStatus `json:"status,omitempty"` +} + +// DefaultRolloutPropertiesModel properties of the rollout. +type DefaultRolloutPropertiesModel struct { + // ProvisioningState - Possible values include: 'ProvisioningStateNotSpecified', 'ProvisioningStateAccepted', 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateCreated', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateCanceled', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateMovingResources', 'ProvisioningStateTransientFailure', 'ProvisioningStateRolloutInProgress' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + Specification *DefaultRolloutPropertiesSpecification `json:"specification,omitempty"` + Status *DefaultRolloutPropertiesStatus `json:"status,omitempty"` +} + +// DefaultRolloutPropertiesSpecification ... +type DefaultRolloutPropertiesSpecification struct { + Canary *DefaultRolloutSpecificationCanary `json:"canary,omitempty"` + LowTraffic *DefaultRolloutSpecificationLowTraffic `json:"lowTraffic,omitempty"` + MediumTraffic *DefaultRolloutSpecificationMediumTraffic `json:"mediumTraffic,omitempty"` + HighTraffic *DefaultRolloutSpecificationHighTraffic `json:"highTraffic,omitempty"` + RestOfTheWorldGroupOne *DefaultRolloutSpecificationRestOfTheWorldGroupOne `json:"restOfTheWorldGroupOne,omitempty"` + RestOfTheWorldGroupTwo *DefaultRolloutSpecificationRestOfTheWorldGroupTwo `json:"restOfTheWorldGroupTwo,omitempty"` + ProviderRegistration *DefaultRolloutSpecificationProviderRegistration `json:"providerRegistration,omitempty"` + ResourceTypeRegistrations *[]ResourceTypeRegistration `json:"resourceTypeRegistrations,omitempty"` +} + +// DefaultRolloutPropertiesStatus ... +type DefaultRolloutPropertiesStatus struct { + // NextTrafficRegion - Possible values include: 'TrafficRegionCategoryNotSpecified', 'TrafficRegionCategoryCanary', 'TrafficRegionCategoryLowTraffic', 'TrafficRegionCategoryMediumTraffic', 'TrafficRegionCategoryHighTraffic', 'TrafficRegionCategoryNone', 'TrafficRegionCategoryRestOfTheWorldGroupOne', 'TrafficRegionCategoryRestOfTheWorldGroupTwo' + NextTrafficRegion TrafficRegionCategory `json:"nextTrafficRegion,omitempty"` + NextTrafficRegionScheduledTime *date.Time `json:"nextTrafficRegionScheduledTime,omitempty"` + // SubscriptionReregistrationResult - Possible values include: 'NotApplicable', 'ConditionalUpdate', 'ForcedUpdate', 'Failed' + SubscriptionReregistrationResult SubscriptionReregistrationResult `json:"subscriptionReregistrationResult,omitempty"` + CompletedRegions *[]string `json:"completedRegions,omitempty"` + FailedOrSkippedRegions map[string]*ExtendedErrorInfo `json:"failedOrSkippedRegions"` +} + +// MarshalJSON is the custom marshaler for DefaultRolloutPropertiesStatus. +func (drp DefaultRolloutPropertiesStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if drp.NextTrafficRegion != "" { + objectMap["nextTrafficRegion"] = drp.NextTrafficRegion + } + if drp.NextTrafficRegionScheduledTime != nil { + objectMap["nextTrafficRegionScheduledTime"] = drp.NextTrafficRegionScheduledTime + } + if drp.SubscriptionReregistrationResult != "" { + objectMap["subscriptionReregistrationResult"] = drp.SubscriptionReregistrationResult + } + if drp.CompletedRegions != nil { + objectMap["completedRegions"] = drp.CompletedRegions + } + if drp.FailedOrSkippedRegions != nil { + objectMap["failedOrSkippedRegions"] = drp.FailedOrSkippedRegions + } + return json.Marshal(objectMap) +} + +// DefaultRolloutsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DefaultRolloutsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DefaultRolloutsClient) (DefaultRollout, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DefaultRolloutsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DefaultRolloutsCreateOrUpdateFuture.Result. +func (future *DefaultRolloutsCreateOrUpdateFuture) result(client DefaultRolloutsClient) (dr DefaultRollout, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("providerhub.DefaultRolloutsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dr.Response.Response, err = future.GetResult(sender); err == nil && dr.Response.Response.StatusCode != http.StatusNoContent { + dr, err = client.CreateOrUpdateResponder(dr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.DefaultRolloutsCreateOrUpdateFuture", "Result", dr.Response.Response, "Failure responding to request") + } + } + return +} + +// DefaultRolloutSpecification ... +type DefaultRolloutSpecification struct { + Canary *DefaultRolloutSpecificationCanary `json:"canary,omitempty"` + LowTraffic *DefaultRolloutSpecificationLowTraffic `json:"lowTraffic,omitempty"` + MediumTraffic *DefaultRolloutSpecificationMediumTraffic `json:"mediumTraffic,omitempty"` + HighTraffic *DefaultRolloutSpecificationHighTraffic `json:"highTraffic,omitempty"` + RestOfTheWorldGroupOne *DefaultRolloutSpecificationRestOfTheWorldGroupOne `json:"restOfTheWorldGroupOne,omitempty"` + RestOfTheWorldGroupTwo *DefaultRolloutSpecificationRestOfTheWorldGroupTwo `json:"restOfTheWorldGroupTwo,omitempty"` + ProviderRegistration *DefaultRolloutSpecificationProviderRegistration `json:"providerRegistration,omitempty"` + ResourceTypeRegistrations *[]ResourceTypeRegistration `json:"resourceTypeRegistrations,omitempty"` +} + +// DefaultRolloutSpecificationCanary ... +type DefaultRolloutSpecificationCanary struct { + SkipRegions *[]string `json:"skipRegions,omitempty"` + Regions *[]string `json:"regions,omitempty"` +} + +// DefaultRolloutSpecificationHighTraffic ... +type DefaultRolloutSpecificationHighTraffic struct { + WaitDuration *string `json:"waitDuration,omitempty"` + Regions *[]string `json:"regions,omitempty"` +} + +// DefaultRolloutSpecificationLowTraffic ... +type DefaultRolloutSpecificationLowTraffic struct { + WaitDuration *string `json:"waitDuration,omitempty"` + Regions *[]string `json:"regions,omitempty"` +} + +// DefaultRolloutSpecificationMediumTraffic ... +type DefaultRolloutSpecificationMediumTraffic struct { + WaitDuration *string `json:"waitDuration,omitempty"` + Regions *[]string `json:"regions,omitempty"` +} + +// DefaultRolloutSpecificationProviderRegistration ... +type DefaultRolloutSpecificationProviderRegistration struct { + Properties *ProviderRegistrationPropertiesModel `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefaultRolloutSpecificationProviderRegistration. +func (drsR DefaultRolloutSpecificationProviderRegistration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if drsR.Properties != nil { + objectMap["properties"] = drsR.Properties + } + return json.Marshal(objectMap) +} + +// DefaultRolloutSpecificationRestOfTheWorldGroupOne ... +type DefaultRolloutSpecificationRestOfTheWorldGroupOne struct { + WaitDuration *string `json:"waitDuration,omitempty"` + Regions *[]string `json:"regions,omitempty"` +} + +// DefaultRolloutSpecificationRestOfTheWorldGroupTwo ... +type DefaultRolloutSpecificationRestOfTheWorldGroupTwo struct { + WaitDuration *string `json:"waitDuration,omitempty"` + Regions *[]string `json:"regions,omitempty"` +} + +// DefaultRolloutStatus ... +type DefaultRolloutStatus struct { + // NextTrafficRegion - Possible values include: 'TrafficRegionCategoryNotSpecified', 'TrafficRegionCategoryCanary', 'TrafficRegionCategoryLowTraffic', 'TrafficRegionCategoryMediumTraffic', 'TrafficRegionCategoryHighTraffic', 'TrafficRegionCategoryNone', 'TrafficRegionCategoryRestOfTheWorldGroupOne', 'TrafficRegionCategoryRestOfTheWorldGroupTwo' + NextTrafficRegion TrafficRegionCategory `json:"nextTrafficRegion,omitempty"` + NextTrafficRegionScheduledTime *date.Time `json:"nextTrafficRegionScheduledTime,omitempty"` + // SubscriptionReregistrationResult - Possible values include: 'NotApplicable', 'ConditionalUpdate', 'ForcedUpdate', 'Failed' + SubscriptionReregistrationResult SubscriptionReregistrationResult `json:"subscriptionReregistrationResult,omitempty"` + CompletedRegions *[]string `json:"completedRegions,omitempty"` + FailedOrSkippedRegions map[string]*ExtendedErrorInfo `json:"failedOrSkippedRegions"` +} + +// MarshalJSON is the custom marshaler for DefaultRolloutStatus. +func (drs DefaultRolloutStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if drs.NextTrafficRegion != "" { + objectMap["nextTrafficRegion"] = drs.NextTrafficRegion + } + if drs.NextTrafficRegionScheduledTime != nil { + objectMap["nextTrafficRegionScheduledTime"] = drs.NextTrafficRegionScheduledTime + } + if drs.SubscriptionReregistrationResult != "" { + objectMap["subscriptionReregistrationResult"] = drs.SubscriptionReregistrationResult + } + if drs.CompletedRegions != nil { + objectMap["completedRegions"] = drs.CompletedRegions + } + if drs.FailedOrSkippedRegions != nil { + objectMap["failedOrSkippedRegions"] = drs.FailedOrSkippedRegions + } + return json.Marshal(objectMap) +} + +// Error standard error object. +type Error struct { + // Code - READ-ONLY; Server-defined set of error codes. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Human-readable representation of the error. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; Target of the error. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; Array of details about specific errors that led to this reported error. + Details *[]Error `json:"details,omitempty"` + // InnerError - READ-ONLY; Object containing more specific information than the current object about the error. + InnerError *ErrorInnerError `json:"innerError,omitempty"` +} + +// MarshalJSON is the custom marshaler for Error. +func (e Error) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorInnerError object containing more specific information than the current object about the error. +type ErrorInnerError struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Code - READ-ONLY; Specific error code than was provided by the containing error. + Code *string `json:"code,omitempty"` + // InnerError - READ-ONLY; Object containing more specific information than the current object about the error. + InnerError interface{} `json:"innerError,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorInnerError. +func (eE ErrorInnerError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + for k, v := range eE.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ErrorInnerError struct. +func (eE *ErrorInnerError) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if eE.AdditionalProperties == nil { + eE.AdditionalProperties = make(map[string]interface{}) + } + eE.AdditionalProperties[k] = additionalProperties + } + case "code": + if v != nil { + var code string + err = json.Unmarshal(*v, &code) + if err != nil { + return err + } + eE.Code = &code + } + case "innerError": + if v != nil { + var innerError interface{} + err = json.Unmarshal(*v, &innerError) + if err != nil { + return err + } + eE.InnerError = innerError + } + } + } + + return nil +} + +// ErrorResponse standard error response. +type ErrorResponse struct { + // Error - Standard error object. + Error *ErrorResponseError `json:"error,omitempty"` +} + +// ErrorResponseError standard error object. +type ErrorResponseError struct { + // Code - READ-ONLY; Server-defined set of error codes. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Human-readable representation of the error. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; Target of the error. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; Array of details about specific errors that led to this reported error. + Details *[]Error `json:"details,omitempty"` + // InnerError - READ-ONLY; Object containing more specific information than the current object about the error. + InnerError *ErrorInnerError `json:"innerError,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorResponseError. +func (er ErrorResponseError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ExtendedErrorInfo ... +type ExtendedErrorInfo struct { + Code *string `json:"code,omitempty"` + Target *string `json:"target,omitempty"` + Message *string `json:"message,omitempty"` + Details *[]ExtendedErrorInfo `json:"details,omitempty"` + AdditionalInfo *[]TypedErrorInfo `json:"additionalInfo,omitempty"` +} + +// ExtendedLocationOptions ... +type ExtendedLocationOptions struct { + Type *string `json:"type,omitempty"` + SupportedPolicy *string `json:"supportedPolicy,omitempty"` +} + +// ExtensionOptions ... +type ExtensionOptions struct { + Request *[]ExtensionOptionType `json:"request,omitempty"` + Response *[]ExtensionOptionType `json:"response,omitempty"` +} + +// FeaturesRule ... +type FeaturesRule struct { + // RequiredFeaturesPolicy - Possible values include: 'Any', 'All' + RequiredFeaturesPolicy FeaturesPolicy `json:"requiredFeaturesPolicy,omitempty"` +} + +// IdentityManagement ... +type IdentityManagement struct { + // Type - Possible values include: 'IdentityManagementTypesNotSpecified', 'IdentityManagementTypesSystemAssigned', 'IdentityManagementTypesUserAssigned', 'IdentityManagementTypesActor', 'IdentityManagementTypesDelegatedResourceIdentity' + Type IdentityManagementTypes `json:"type,omitempty"` +} + +// IdentityManagementProperties ... +type IdentityManagementProperties struct { + // Type - Possible values include: 'IdentityManagementTypesNotSpecified', 'IdentityManagementTypesSystemAssigned', 'IdentityManagementTypesUserAssigned', 'IdentityManagementTypesActor', 'IdentityManagementTypesDelegatedResourceIdentity' + Type IdentityManagementTypes `json:"type,omitempty"` + ApplicationID *string `json:"applicationId,omitempty"` +} + +// InnerError inner error containing list of errors. +type InnerError struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Code - READ-ONLY; Specific error code than was provided by the containing error. + Code *string `json:"code,omitempty"` + // InnerError - READ-ONLY; Object containing more specific information than the current object about the error. + InnerError interface{} `json:"innerError,omitempty"` +} + +// MarshalJSON is the custom marshaler for InnerError. +func (ie InnerError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + for k, v := range ie.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for InnerError struct. +func (ie *InnerError) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ie.AdditionalProperties == nil { + ie.AdditionalProperties = make(map[string]interface{}) + } + ie.AdditionalProperties[k] = additionalProperties + } + case "code": + if v != nil { + var code string + err = json.Unmarshal(*v, &code) + if err != nil { + return err + } + ie.Code = &code + } + case "innerError": + if v != nil { + var innerError interface{} + err = json.Unmarshal(*v, &innerError) + if err != nil { + return err + } + ie.InnerError = innerError + } + } + } + + return nil +} + +// LightHouseAuthorization ... +type LightHouseAuthorization struct { + PrincipalID *string `json:"principalId,omitempty"` + RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` +} + +// LinkedAccessCheck ... +type LinkedAccessCheck struct { + ActionName *string `json:"actionName,omitempty"` + LinkedProperty *string `json:"linkedProperty,omitempty"` + LinkedAction *string `json:"linkedAction,omitempty"` + LinkedActionVerb *string `json:"linkedActionVerb,omitempty"` + LinkedType *string `json:"linkedType,omitempty"` +} + +// LinkedOperationRule ... +type LinkedOperationRule struct { + // LinkedOperation - Possible values include: 'None', 'CrossResourceGroupResourceMove', 'CrossSubscriptionResourceMove' + LinkedOperation LinkedOperation `json:"linkedOperation,omitempty"` + // LinkedAction - Possible values include: 'LinkedActionNotSpecified', 'LinkedActionBlocked', 'LinkedActionValidate', 'LinkedActionEnabled' + LinkedAction LinkedAction `json:"linkedAction,omitempty"` +} + +// ListOperationsDefinition ... +type ListOperationsDefinition struct { + autorest.Response `json:"-"` + Value *[]OperationsDefinition `json:"value,omitempty"` +} + +// LoggingHiddenPropertyPath ... +type LoggingHiddenPropertyPath struct { + HiddenPathsOnRequest *[]string `json:"hiddenPathsOnRequest,omitempty"` + HiddenPathsOnResponse *[]string `json:"hiddenPathsOnResponse,omitempty"` +} + +// LoggingRule ... +type LoggingRule struct { + Action *string `json:"action,omitempty"` + // Direction - Possible values include: 'LoggingDirectionsNone', 'LoggingDirectionsRequest', 'LoggingDirectionsResponse' + Direction LoggingDirections `json:"direction,omitempty"` + // DetailLevel - Possible values include: 'LoggingDetailsNone', 'LoggingDetailsBody' + DetailLevel LoggingDetails `json:"detailLevel,omitempty"` + HiddenPropertyPaths *LoggingRuleHiddenPropertyPaths `json:"hiddenPropertyPaths,omitempty"` +} + +// LoggingRuleHiddenPropertyPaths ... +type LoggingRuleHiddenPropertyPaths struct { + HiddenPathsOnRequest *[]string `json:"hiddenPathsOnRequest,omitempty"` + HiddenPathsOnResponse *[]string `json:"hiddenPathsOnResponse,omitempty"` +} + +// Metadata ... +type Metadata struct { + ProviderAuthorizations *[]ResourceProviderAuthorization `json:"providerAuthorizations,omitempty"` + ProviderAuthentication *MetadataProviderAuthentication `json:"providerAuthentication,omitempty"` + ThirdPartyProviderAuthorization *MetadataThirdPartyProviderAuthorization `json:"thirdPartyProviderAuthorization,omitempty"` +} + +// MetadataProviderAuthentication ... +type MetadataProviderAuthentication struct { + AllowedAudiences *[]string `json:"allowedAudiences,omitempty"` +} + +// MetadataThirdPartyProviderAuthorization ... +type MetadataThirdPartyProviderAuthorization struct { + Authorizations *[]LightHouseAuthorization `json:"authorizations,omitempty"` + ManagedByTenantID *string `json:"managedByTenantId,omitempty"` +} + +// NotificationEndpoint ... +type NotificationEndpoint struct { + NotificationDestination *string `json:"notificationDestination,omitempty"` + Locations *[]string `json:"locations,omitempty"` +} + +// NotificationRegistration the notification registration definition. +type NotificationRegistration struct { + autorest.Response `json:"-"` + Properties *NotificationRegistrationPropertiesModel `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for NotificationRegistration. +func (nr NotificationRegistration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nr.Properties != nil { + objectMap["properties"] = nr.Properties + } + return json.Marshal(objectMap) +} + +// NotificationRegistrationArrayResponseWithContinuation ... +type NotificationRegistrationArrayResponseWithContinuation struct { + autorest.Response `json:"-"` + Value *[]NotificationRegistration `json:"value,omitempty"` + // NextLink - The URL to get to the next set of results, if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// NotificationRegistrationArrayResponseWithContinuationIterator provides access to a complete listing of +// NotificationRegistration values. +type NotificationRegistrationArrayResponseWithContinuationIterator struct { + i int + page NotificationRegistrationArrayResponseWithContinuationPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NotificationRegistrationArrayResponseWithContinuationIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotificationRegistrationArrayResponseWithContinuationIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NotificationRegistrationArrayResponseWithContinuationIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NotificationRegistrationArrayResponseWithContinuationIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NotificationRegistrationArrayResponseWithContinuationIterator) Response() NotificationRegistrationArrayResponseWithContinuation { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NotificationRegistrationArrayResponseWithContinuationIterator) Value() NotificationRegistration { + if !iter.page.NotDone() { + return NotificationRegistration{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NotificationRegistrationArrayResponseWithContinuationIterator type. +func NewNotificationRegistrationArrayResponseWithContinuationIterator(page NotificationRegistrationArrayResponseWithContinuationPage) NotificationRegistrationArrayResponseWithContinuationIterator { + return NotificationRegistrationArrayResponseWithContinuationIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nrarwc NotificationRegistrationArrayResponseWithContinuation) IsEmpty() bool { + return nrarwc.Value == nil || len(*nrarwc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nrarwc NotificationRegistrationArrayResponseWithContinuation) hasNextLink() bool { + return nrarwc.NextLink != nil && len(*nrarwc.NextLink) != 0 +} + +// notificationRegistrationArrayResponseWithContinuationPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nrarwc NotificationRegistrationArrayResponseWithContinuation) notificationRegistrationArrayResponseWithContinuationPreparer(ctx context.Context) (*http.Request, error) { + if !nrarwc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nrarwc.NextLink))) +} + +// NotificationRegistrationArrayResponseWithContinuationPage contains a page of NotificationRegistration +// values. +type NotificationRegistrationArrayResponseWithContinuationPage struct { + fn func(context.Context, NotificationRegistrationArrayResponseWithContinuation) (NotificationRegistrationArrayResponseWithContinuation, error) + nrarwc NotificationRegistrationArrayResponseWithContinuation +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NotificationRegistrationArrayResponseWithContinuationPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotificationRegistrationArrayResponseWithContinuationPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nrarwc) + if err != nil { + return err + } + page.nrarwc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NotificationRegistrationArrayResponseWithContinuationPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NotificationRegistrationArrayResponseWithContinuationPage) NotDone() bool { + return !page.nrarwc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NotificationRegistrationArrayResponseWithContinuationPage) Response() NotificationRegistrationArrayResponseWithContinuation { + return page.nrarwc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NotificationRegistrationArrayResponseWithContinuationPage) Values() []NotificationRegistration { + if page.nrarwc.IsEmpty() { + return nil + } + return *page.nrarwc.Value +} + +// Creates a new instance of the NotificationRegistrationArrayResponseWithContinuationPage type. +func NewNotificationRegistrationArrayResponseWithContinuationPage(cur NotificationRegistrationArrayResponseWithContinuation, getNextPage func(context.Context, NotificationRegistrationArrayResponseWithContinuation) (NotificationRegistrationArrayResponseWithContinuation, error)) NotificationRegistrationArrayResponseWithContinuationPage { + return NotificationRegistrationArrayResponseWithContinuationPage{ + fn: getNextPage, + nrarwc: cur, + } +} + +// NotificationRegistrationProperties ... +type NotificationRegistrationProperties struct { + // NotificationMode - Possible values include: 'NotificationModeNotSpecified', 'NotificationModeEventHub', 'NotificationModeWebHook' + NotificationMode NotificationMode `json:"notificationMode,omitempty"` + // MessageScope - Possible values include: 'MessageScopeNotSpecified', 'MessageScopeRegisteredSubscriptions' + MessageScope MessageScope `json:"messageScope,omitempty"` + IncludedEvents *[]string `json:"includedEvents,omitempty"` + NotificationEndpoints *[]NotificationEndpoint `json:"notificationEndpoints,omitempty"` +} + +// NotificationRegistrationPropertiesModel ... +type NotificationRegistrationPropertiesModel struct { + // NotificationMode - Possible values include: 'NotificationModeNotSpecified', 'NotificationModeEventHub', 'NotificationModeWebHook' + NotificationMode NotificationMode `json:"notificationMode,omitempty"` + // MessageScope - Possible values include: 'MessageScopeNotSpecified', 'MessageScopeRegisteredSubscriptions' + MessageScope MessageScope `json:"messageScope,omitempty"` + IncludedEvents *[]string `json:"includedEvents,omitempty"` + NotificationEndpoints *[]NotificationEndpoint `json:"notificationEndpoints,omitempty"` +} + +// OperationsContent ... +type OperationsContent struct { + autorest.Response `json:"-"` + // OperationsDefinition - Operations content. + *OperationsDefinition `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationsContent. +func (oc OperationsContent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oc.OperationsDefinition != nil { + objectMap["properties"] = oc.OperationsDefinition + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationsContent struct. +func (oc *OperationsContent) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var operationsDefinition OperationsDefinition + err = json.Unmarshal(*v, &operationsDefinition) + if err != nil { + return err + } + oc.OperationsDefinition = &operationsDefinition + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + oc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + oc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + oc.Type = &typeVar + } + } + } + + return nil +} + +// OperationsDefinition properties of an Operation. +type OperationsDefinition struct { + // Name - Name of the operation. + Name *string `json:"name,omitempty"` + // IsDataAction - Indicates whether the operation applies to data-plane. + IsDataAction *bool `json:"isDataAction,omitempty"` + // Origin - Possible values include: 'OriginNotSpecified', 'OriginUser', 'OriginSystem' + Origin Origin `json:"origin,omitempty"` + // Display - Display information of the operation. + Display *OperationsDefinitionDisplay `json:"display,omitempty"` + // ActionType - Possible values include: 'NotSpecified', 'Internal' + ActionType ActionType `json:"actionType,omitempty"` + Properties interface{} `json:"properties,omitempty"` +} + +// OperationsDefinitionArrayResponseWithContinuation ... +type OperationsDefinitionArrayResponseWithContinuation struct { + autorest.Response `json:"-"` + Value *[]OperationsDefinition `json:"value,omitempty"` + // NextLink - The URL to get to the next set of results, if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationsDefinitionArrayResponseWithContinuationIterator provides access to a complete listing of +// OperationsDefinition values. +type OperationsDefinitionArrayResponseWithContinuationIterator struct { + i int + page OperationsDefinitionArrayResponseWithContinuationPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationsDefinitionArrayResponseWithContinuationIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDefinitionArrayResponseWithContinuationIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationsDefinitionArrayResponseWithContinuationIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationsDefinitionArrayResponseWithContinuationIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationsDefinitionArrayResponseWithContinuationIterator) Response() OperationsDefinitionArrayResponseWithContinuation { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationsDefinitionArrayResponseWithContinuationIterator) Value() OperationsDefinition { + if !iter.page.NotDone() { + return OperationsDefinition{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationsDefinitionArrayResponseWithContinuationIterator type. +func NewOperationsDefinitionArrayResponseWithContinuationIterator(page OperationsDefinitionArrayResponseWithContinuationPage) OperationsDefinitionArrayResponseWithContinuationIterator { + return OperationsDefinitionArrayResponseWithContinuationIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (odarwc OperationsDefinitionArrayResponseWithContinuation) IsEmpty() bool { + return odarwc.Value == nil || len(*odarwc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (odarwc OperationsDefinitionArrayResponseWithContinuation) hasNextLink() bool { + return odarwc.NextLink != nil && len(*odarwc.NextLink) != 0 +} + +// operationsDefinitionArrayResponseWithContinuationPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (odarwc OperationsDefinitionArrayResponseWithContinuation) operationsDefinitionArrayResponseWithContinuationPreparer(ctx context.Context) (*http.Request, error) { + if !odarwc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(odarwc.NextLink))) +} + +// OperationsDefinitionArrayResponseWithContinuationPage contains a page of OperationsDefinition values. +type OperationsDefinitionArrayResponseWithContinuationPage struct { + fn func(context.Context, OperationsDefinitionArrayResponseWithContinuation) (OperationsDefinitionArrayResponseWithContinuation, error) + odarwc OperationsDefinitionArrayResponseWithContinuation +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationsDefinitionArrayResponseWithContinuationPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsDefinitionArrayResponseWithContinuationPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.odarwc) + if err != nil { + return err + } + page.odarwc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationsDefinitionArrayResponseWithContinuationPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationsDefinitionArrayResponseWithContinuationPage) NotDone() bool { + return !page.odarwc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationsDefinitionArrayResponseWithContinuationPage) Response() OperationsDefinitionArrayResponseWithContinuation { + return page.odarwc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationsDefinitionArrayResponseWithContinuationPage) Values() []OperationsDefinition { + if page.odarwc.IsEmpty() { + return nil + } + return *page.odarwc.Value +} + +// Creates a new instance of the OperationsDefinitionArrayResponseWithContinuationPage type. +func NewOperationsDefinitionArrayResponseWithContinuationPage(cur OperationsDefinitionArrayResponseWithContinuation, getNextPage func(context.Context, OperationsDefinitionArrayResponseWithContinuation) (OperationsDefinitionArrayResponseWithContinuation, error)) OperationsDefinitionArrayResponseWithContinuationPage { + return OperationsDefinitionArrayResponseWithContinuationPage{ + fn: getNextPage, + odarwc: cur, + } +} + +// OperationsDefinitionDisplay display information of the operation. +type OperationsDefinitionDisplay struct { + Provider *string `json:"provider,omitempty"` + Resource *string `json:"resource,omitempty"` + Operation *string `json:"operation,omitempty"` + Description *string `json:"description,omitempty"` +} + +// OperationsDisplayDefinition ... +type OperationsDisplayDefinition struct { + Provider *string `json:"provider,omitempty"` + Resource *string `json:"resource,omitempty"` + Operation *string `json:"operation,omitempty"` + Description *string `json:"description,omitempty"` +} + +// OperationsPutContent ... +type OperationsPutContent struct { + Contents *[]OperationsDefinition `json:"contents,omitempty"` +} + +// ProviderRegistration ... +type ProviderRegistration struct { + autorest.Response `json:"-"` + Properties *ProviderRegistrationPropertiesModel `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProviderRegistration. +func (pr ProviderRegistration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pr.Properties != nil { + objectMap["properties"] = pr.Properties + } + return json.Marshal(objectMap) +} + +// ProviderRegistrationArrayResponseWithContinuation ... +type ProviderRegistrationArrayResponseWithContinuation struct { + autorest.Response `json:"-"` + Value *[]ProviderRegistration `json:"value,omitempty"` + // NextLink - The URL to get to the next set of results, if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProviderRegistrationArrayResponseWithContinuationIterator provides access to a complete listing of +// ProviderRegistration values. +type ProviderRegistrationArrayResponseWithContinuationIterator struct { + i int + page ProviderRegistrationArrayResponseWithContinuationPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProviderRegistrationArrayResponseWithContinuationIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderRegistrationArrayResponseWithContinuationIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProviderRegistrationArrayResponseWithContinuationIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProviderRegistrationArrayResponseWithContinuationIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProviderRegistrationArrayResponseWithContinuationIterator) Response() ProviderRegistrationArrayResponseWithContinuation { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProviderRegistrationArrayResponseWithContinuationIterator) Value() ProviderRegistration { + if !iter.page.NotDone() { + return ProviderRegistration{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProviderRegistrationArrayResponseWithContinuationIterator type. +func NewProviderRegistrationArrayResponseWithContinuationIterator(page ProviderRegistrationArrayResponseWithContinuationPage) ProviderRegistrationArrayResponseWithContinuationIterator { + return ProviderRegistrationArrayResponseWithContinuationIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (prarwc ProviderRegistrationArrayResponseWithContinuation) IsEmpty() bool { + return prarwc.Value == nil || len(*prarwc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (prarwc ProviderRegistrationArrayResponseWithContinuation) hasNextLink() bool { + return prarwc.NextLink != nil && len(*prarwc.NextLink) != 0 +} + +// providerRegistrationArrayResponseWithContinuationPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (prarwc ProviderRegistrationArrayResponseWithContinuation) providerRegistrationArrayResponseWithContinuationPreparer(ctx context.Context) (*http.Request, error) { + if !prarwc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(prarwc.NextLink))) +} + +// ProviderRegistrationArrayResponseWithContinuationPage contains a page of ProviderRegistration values. +type ProviderRegistrationArrayResponseWithContinuationPage struct { + fn func(context.Context, ProviderRegistrationArrayResponseWithContinuation) (ProviderRegistrationArrayResponseWithContinuation, error) + prarwc ProviderRegistrationArrayResponseWithContinuation +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProviderRegistrationArrayResponseWithContinuationPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderRegistrationArrayResponseWithContinuationPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.prarwc) + if err != nil { + return err + } + page.prarwc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProviderRegistrationArrayResponseWithContinuationPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProviderRegistrationArrayResponseWithContinuationPage) NotDone() bool { + return !page.prarwc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProviderRegistrationArrayResponseWithContinuationPage) Response() ProviderRegistrationArrayResponseWithContinuation { + return page.prarwc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProviderRegistrationArrayResponseWithContinuationPage) Values() []ProviderRegistration { + if page.prarwc.IsEmpty() { + return nil + } + return *page.prarwc.Value +} + +// Creates a new instance of the ProviderRegistrationArrayResponseWithContinuationPage type. +func NewProviderRegistrationArrayResponseWithContinuationPage(cur ProviderRegistrationArrayResponseWithContinuation, getNextPage func(context.Context, ProviderRegistrationArrayResponseWithContinuation) (ProviderRegistrationArrayResponseWithContinuation, error)) ProviderRegistrationArrayResponseWithContinuationPage { + return ProviderRegistrationArrayResponseWithContinuationPage{ + fn: getNextPage, + prarwc: cur, + } +} + +// ProviderRegistrationProperties ... +type ProviderRegistrationProperties struct { + ProviderHubMetadata *ProviderRegistrationPropertiesProviderHubMetadata `json:"providerHubMetadata,omitempty"` + // ProvisioningState - Possible values include: 'ProvisioningStateNotSpecified', 'ProvisioningStateAccepted', 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateCreated', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateCanceled', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateMovingResources', 'ProvisioningStateTransientFailure', 'ProvisioningStateRolloutInProgress' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + SubscriptionLifecycleNotificationSpecifications *ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications `json:"subscriptionLifecycleNotificationSpecifications,omitempty"` + ProviderAuthentication *ResourceProviderManifestPropertiesProviderAuthentication `json:"providerAuthentication,omitempty"` + ProviderAuthorizations *[]ResourceProviderAuthorization `json:"providerAuthorizations,omitempty"` + Namespace *string `json:"namespace,omitempty"` + ProviderVersion *string `json:"providerVersion,omitempty"` + // ProviderType - Possible values include: 'ResourceProviderTypeNotSpecified', 'ResourceProviderTypeInternal', 'ResourceProviderTypeExternal', 'ResourceProviderTypeHidden', 'ResourceProviderTypeRegistrationFree', 'ResourceProviderTypeLegacyRegistrationRequired', 'ResourceProviderTypeTenantOnly', 'ResourceProviderTypeAuthorizationFree' + ProviderType ResourceProviderType `json:"providerType,omitempty"` + RequiredFeatures *[]string `json:"requiredFeatures,omitempty"` + FeaturesRule *ResourceProviderManifestPropertiesFeaturesRule `json:"featuresRule,omitempty"` + RequestHeaderOptions *ResourceProviderManifestPropertiesRequestHeaderOptions `json:"requestHeaderOptions,omitempty"` + Management *ResourceProviderManifestPropertiesManagement `json:"management,omitempty"` + Capabilities *[]ResourceProviderCapabilities `json:"capabilities,omitempty"` + Metadata interface{} `json:"metadata,omitempty"` + TemplateDeploymentOptions *ResourceProviderManifestPropertiesTemplateDeploymentOptions `json:"templateDeploymentOptions,omitempty"` +} + +// ProviderRegistrationPropertiesModel ... +type ProviderRegistrationPropertiesModel struct { + ProviderHubMetadata *ProviderRegistrationPropertiesProviderHubMetadata `json:"providerHubMetadata,omitempty"` + // ProvisioningState - Possible values include: 'ProvisioningStateNotSpecified', 'ProvisioningStateAccepted', 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateCreated', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateCanceled', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateMovingResources', 'ProvisioningStateTransientFailure', 'ProvisioningStateRolloutInProgress' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + SubscriptionLifecycleNotificationSpecifications *ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications `json:"subscriptionLifecycleNotificationSpecifications,omitempty"` + ProviderAuthentication *ResourceProviderManifestPropertiesProviderAuthentication `json:"providerAuthentication,omitempty"` + ProviderAuthorizations *[]ResourceProviderAuthorization `json:"providerAuthorizations,omitempty"` + Namespace *string `json:"namespace,omitempty"` + ProviderVersion *string `json:"providerVersion,omitempty"` + // ProviderType - Possible values include: 'ResourceProviderTypeNotSpecified', 'ResourceProviderTypeInternal', 'ResourceProviderTypeExternal', 'ResourceProviderTypeHidden', 'ResourceProviderTypeRegistrationFree', 'ResourceProviderTypeLegacyRegistrationRequired', 'ResourceProviderTypeTenantOnly', 'ResourceProviderTypeAuthorizationFree' + ProviderType ResourceProviderType `json:"providerType,omitempty"` + RequiredFeatures *[]string `json:"requiredFeatures,omitempty"` + FeaturesRule *ResourceProviderManifestPropertiesFeaturesRule `json:"featuresRule,omitempty"` + RequestHeaderOptions *ResourceProviderManifestPropertiesRequestHeaderOptions `json:"requestHeaderOptions,omitempty"` + Management *ResourceProviderManifestPropertiesManagement `json:"management,omitempty"` + Capabilities *[]ResourceProviderCapabilities `json:"capabilities,omitempty"` + Metadata interface{} `json:"metadata,omitempty"` + TemplateDeploymentOptions *ResourceProviderManifestPropertiesTemplateDeploymentOptions `json:"templateDeploymentOptions,omitempty"` +} + +// ProviderRegistrationPropertiesProviderHubMetadata ... +type ProviderRegistrationPropertiesProviderHubMetadata struct { + ProviderAuthorizations *[]ResourceProviderAuthorization `json:"providerAuthorizations,omitempty"` + ProviderAuthentication *MetadataProviderAuthentication `json:"providerAuthentication,omitempty"` + ThirdPartyProviderAuthorization *MetadataThirdPartyProviderAuthorization `json:"thirdPartyProviderAuthorization,omitempty"` +} + +// ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications ... +type ProviderRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications struct { + SubscriptionStateOverrideActions *[]SubscriptionStateOverrideAction `json:"subscriptionStateOverrideActions,omitempty"` + SoftDeleteTTL *string `json:"softDeleteTTL,omitempty"` +} + +// ProviderRegistrationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ProviderRegistrationsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ProviderRegistrationsClient) (ProviderRegistration, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ProviderRegistrationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ProviderRegistrationsCreateOrUpdateFuture.Result. +func (future *ProviderRegistrationsCreateOrUpdateFuture) result(client ProviderRegistrationsClient) (pr ProviderRegistration, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("providerhub.ProviderRegistrationsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pr.Response.Response, err = future.GetResult(sender); err == nil && pr.Response.Response.StatusCode != http.StatusNoContent { + pr, err = client.CreateOrUpdateResponder(pr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsCreateOrUpdateFuture", "Result", pr.Response.Response, "Failure responding to request") + } + } + return +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RequestHeaderOptions ... +type RequestHeaderOptions struct { + // OptInHeaders - Possible values include: 'OptInHeaderTypeNotSpecified', 'OptInHeaderTypeSignedUserToken', 'OptInHeaderTypeClientGroupMembership', 'OptInHeaderTypeSignedAuxiliaryTokens', 'OptInHeaderTypeUnboundedClientGroupMembership' + OptInHeaders OptInHeaderType `json:"optInHeaders,omitempty"` +} + +// ReRegisterSubscriptionMetadata ... +type ReRegisterSubscriptionMetadata struct { + Enabled *bool `json:"enabled,omitempty"` + ConcurrencyLimit *int32 `json:"concurrencyLimit,omitempty"` +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceMovePolicy ... +type ResourceMovePolicy struct { + ValidationRequired *bool `json:"validationRequired,omitempty"` + CrossResourceGroupMoveEnabled *bool `json:"crossResourceGroupMoveEnabled,omitempty"` + CrossSubscriptionMoveEnabled *bool `json:"crossSubscriptionMoveEnabled,omitempty"` +} + +// ResourceProviderAuthentication ... +type ResourceProviderAuthentication struct { + AllowedAudiences *[]string `json:"allowedAudiences,omitempty"` +} + +// ResourceProviderAuthorization ... +type ResourceProviderAuthorization struct { + ApplicationID *string `json:"applicationId,omitempty"` + RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` + ManagedByRoleDefinitionID *string `json:"managedByRoleDefinitionId,omitempty"` +} + +// ResourceProviderCapabilities ... +type ResourceProviderCapabilities struct { + QuotaID *string `json:"quotaId,omitempty"` + // Effect - Possible values include: 'ResourceProviderCapabilitiesEffectNotSpecified', 'ResourceProviderCapabilitiesEffectAllow', 'ResourceProviderCapabilitiesEffectDisallow' + Effect ResourceProviderCapabilitiesEffect `json:"effect,omitempty"` + RequiredFeatures *[]string `json:"requiredFeatures,omitempty"` +} + +// ResourceProviderEndpoint ... +type ResourceProviderEndpoint struct { + Enabled *bool `json:"enabled,omitempty"` + APIVersions *[]string `json:"apiVersions,omitempty"` + EndpointURI *string `json:"endpointUri,omitempty"` + Locations *[]string `json:"locations,omitempty"` + RequiredFeatures *[]string `json:"requiredFeatures,omitempty"` + FeaturesRule *ResourceProviderEndpointFeaturesRule `json:"featuresRule,omitempty"` + Timeout *string `json:"timeout,omitempty"` +} + +// ResourceProviderEndpointFeaturesRule ... +type ResourceProviderEndpointFeaturesRule struct { + // RequiredFeaturesPolicy - Possible values include: 'Any', 'All' + RequiredFeaturesPolicy FeaturesPolicy `json:"requiredFeaturesPolicy,omitempty"` +} + +// ResourceProviderManagement ... +type ResourceProviderManagement struct { + SchemaOwners *[]string `json:"schemaOwners,omitempty"` + ManifestOwners *[]string `json:"manifestOwners,omitempty"` + IncidentRoutingService *string `json:"incidentRoutingService,omitempty"` + IncidentRoutingTeam *string `json:"incidentRoutingTeam,omitempty"` + IncidentContactEmail *string `json:"incidentContactEmail,omitempty"` + ServiceTreeInfos *[]ServiceTreeInfo `json:"serviceTreeInfos,omitempty"` + // ResourceAccessPolicy - Possible values include: 'ResourceAccessPolicyNotSpecified', 'ResourceAccessPolicyAcisReadAllowed', 'ResourceAccessPolicyAcisActionAllowed' + ResourceAccessPolicy ResourceAccessPolicy `json:"resourceAccessPolicy,omitempty"` + ResourceAccessRoles *[]interface{} `json:"resourceAccessRoles,omitempty"` +} + +// ResourceProviderManifest ... +type ResourceProviderManifest struct { + autorest.Response `json:"-"` + ProviderAuthentication *ResourceProviderManifestProviderAuthentication `json:"providerAuthentication,omitempty"` + ProviderAuthorizations *[]ResourceProviderAuthorization `json:"providerAuthorizations,omitempty"` + Namespace *string `json:"namespace,omitempty"` + ProviderVersion *string `json:"providerVersion,omitempty"` + // ProviderType - Possible values include: 'ResourceProviderTypeNotSpecified', 'ResourceProviderTypeInternal', 'ResourceProviderTypeExternal', 'ResourceProviderTypeHidden', 'ResourceProviderTypeRegistrationFree', 'ResourceProviderTypeLegacyRegistrationRequired', 'ResourceProviderTypeTenantOnly', 'ResourceProviderTypeAuthorizationFree' + ProviderType ResourceProviderType `json:"providerType,omitempty"` + RequiredFeatures *[]string `json:"requiredFeatures,omitempty"` + FeaturesRule *ResourceProviderManifestFeaturesRule `json:"featuresRule,omitempty"` + RequestHeaderOptions *ResourceProviderManifestRequestHeaderOptions `json:"requestHeaderOptions,omitempty"` + ResourceTypes *[]ResourceType `json:"resourceTypes,omitempty"` + Management *ResourceProviderManifestManagement `json:"management,omitempty"` + Capabilities *[]ResourceProviderCapabilities `json:"capabilities,omitempty"` + Metadata interface{} `json:"metadata,omitempty"` + GlobalNotificationEndpoints *[]ResourceProviderEndpoint `json:"globalNotificationEndpoints,omitempty"` + ReRegisterSubscriptionMetadata *ResourceProviderManifestReRegisterSubscriptionMetadata `json:"reRegisterSubscriptionMetadata,omitempty"` +} + +// ResourceProviderManifestFeaturesRule ... +type ResourceProviderManifestFeaturesRule struct { + // RequiredFeaturesPolicy - Possible values include: 'Any', 'All' + RequiredFeaturesPolicy FeaturesPolicy `json:"requiredFeaturesPolicy,omitempty"` +} + +// ResourceProviderManifestManagement ... +type ResourceProviderManifestManagement struct { + SchemaOwners *[]string `json:"schemaOwners,omitempty"` + ManifestOwners *[]string `json:"manifestOwners,omitempty"` + IncidentRoutingService *string `json:"incidentRoutingService,omitempty"` + IncidentRoutingTeam *string `json:"incidentRoutingTeam,omitempty"` + IncidentContactEmail *string `json:"incidentContactEmail,omitempty"` + ServiceTreeInfos *[]ServiceTreeInfo `json:"serviceTreeInfos,omitempty"` + // ResourceAccessPolicy - Possible values include: 'ResourceAccessPolicyNotSpecified', 'ResourceAccessPolicyAcisReadAllowed', 'ResourceAccessPolicyAcisActionAllowed' + ResourceAccessPolicy ResourceAccessPolicy `json:"resourceAccessPolicy,omitempty"` + ResourceAccessRoles *[]interface{} `json:"resourceAccessRoles,omitempty"` +} + +// ResourceProviderManifestProperties ... +type ResourceProviderManifestProperties struct { + ProviderAuthentication *ResourceProviderManifestPropertiesProviderAuthentication `json:"providerAuthentication,omitempty"` + ProviderAuthorizations *[]ResourceProviderAuthorization `json:"providerAuthorizations,omitempty"` + Namespace *string `json:"namespace,omitempty"` + ProviderVersion *string `json:"providerVersion,omitempty"` + // ProviderType - Possible values include: 'ResourceProviderTypeNotSpecified', 'ResourceProviderTypeInternal', 'ResourceProviderTypeExternal', 'ResourceProviderTypeHidden', 'ResourceProviderTypeRegistrationFree', 'ResourceProviderTypeLegacyRegistrationRequired', 'ResourceProviderTypeTenantOnly', 'ResourceProviderTypeAuthorizationFree' + ProviderType ResourceProviderType `json:"providerType,omitempty"` + RequiredFeatures *[]string `json:"requiredFeatures,omitempty"` + FeaturesRule *ResourceProviderManifestPropertiesFeaturesRule `json:"featuresRule,omitempty"` + RequestHeaderOptions *ResourceProviderManifestPropertiesRequestHeaderOptions `json:"requestHeaderOptions,omitempty"` + Management *ResourceProviderManifestPropertiesManagement `json:"management,omitempty"` + Capabilities *[]ResourceProviderCapabilities `json:"capabilities,omitempty"` + Metadata interface{} `json:"metadata,omitempty"` + TemplateDeploymentOptions *ResourceProviderManifestPropertiesTemplateDeploymentOptions `json:"templateDeploymentOptions,omitempty"` +} + +// ResourceProviderManifestPropertiesFeaturesRule ... +type ResourceProviderManifestPropertiesFeaturesRule struct { + // RequiredFeaturesPolicy - Possible values include: 'Any', 'All' + RequiredFeaturesPolicy FeaturesPolicy `json:"requiredFeaturesPolicy,omitempty"` +} + +// ResourceProviderManifestPropertiesManagement ... +type ResourceProviderManifestPropertiesManagement struct { + SchemaOwners *[]string `json:"schemaOwners,omitempty"` + ManifestOwners *[]string `json:"manifestOwners,omitempty"` + IncidentRoutingService *string `json:"incidentRoutingService,omitempty"` + IncidentRoutingTeam *string `json:"incidentRoutingTeam,omitempty"` + IncidentContactEmail *string `json:"incidentContactEmail,omitempty"` + ServiceTreeInfos *[]ServiceTreeInfo `json:"serviceTreeInfos,omitempty"` + // ResourceAccessPolicy - Possible values include: 'ResourceAccessPolicyNotSpecified', 'ResourceAccessPolicyAcisReadAllowed', 'ResourceAccessPolicyAcisActionAllowed' + ResourceAccessPolicy ResourceAccessPolicy `json:"resourceAccessPolicy,omitempty"` + ResourceAccessRoles *[]interface{} `json:"resourceAccessRoles,omitempty"` +} + +// ResourceProviderManifestPropertiesProviderAuthentication ... +type ResourceProviderManifestPropertiesProviderAuthentication struct { + AllowedAudiences *[]string `json:"allowedAudiences,omitempty"` +} + +// ResourceProviderManifestPropertiesRequestHeaderOptions ... +type ResourceProviderManifestPropertiesRequestHeaderOptions struct { + // OptInHeaders - Possible values include: 'OptInHeaderTypeNotSpecified', 'OptInHeaderTypeSignedUserToken', 'OptInHeaderTypeClientGroupMembership', 'OptInHeaderTypeSignedAuxiliaryTokens', 'OptInHeaderTypeUnboundedClientGroupMembership' + OptInHeaders OptInHeaderType `json:"optInHeaders,omitempty"` +} + +// ResourceProviderManifestPropertiesTemplateDeploymentOptions ... +type ResourceProviderManifestPropertiesTemplateDeploymentOptions struct { + PreflightSupported *bool `json:"preflightSupported,omitempty"` + PreflightOptions *[]PreflightOption `json:"preflightOptions,omitempty"` +} + +// ResourceProviderManifestProviderAuthentication ... +type ResourceProviderManifestProviderAuthentication struct { + AllowedAudiences *[]string `json:"allowedAudiences,omitempty"` +} + +// ResourceProviderManifestRequestHeaderOptions ... +type ResourceProviderManifestRequestHeaderOptions struct { + // OptInHeaders - Possible values include: 'OptInHeaderTypeNotSpecified', 'OptInHeaderTypeSignedUserToken', 'OptInHeaderTypeClientGroupMembership', 'OptInHeaderTypeSignedAuxiliaryTokens', 'OptInHeaderTypeUnboundedClientGroupMembership' + OptInHeaders OptInHeaderType `json:"optInHeaders,omitempty"` +} + +// ResourceProviderManifestReRegisterSubscriptionMetadata ... +type ResourceProviderManifestReRegisterSubscriptionMetadata struct { + Enabled *bool `json:"enabled,omitempty"` + ConcurrencyLimit *int32 `json:"concurrencyLimit,omitempty"` +} + +// ResourceType ... +type ResourceType struct { + Name *string `json:"name,omitempty"` + // RoutingType - Possible values include: 'Default', 'ProxyOnly', 'HostBased', 'Extension', 'Tenant', 'Fanout', 'LocationBased', 'Failover', 'CascadeExtension' + RoutingType RoutingType `json:"routingType,omitempty"` + // ResourceValidation - Possible values include: 'ResourceValidationNotSpecified', 'ResourceValidationReservedWords', 'ResourceValidationProfaneWords' + ResourceValidation ResourceValidation `json:"resourceValidation,omitempty"` + AllowedUnauthorizedActions *[]string `json:"allowedUnauthorizedActions,omitempty"` + AuthorizationActionMappings *[]AuthorizationActionMapping `json:"authorizationActionMappings,omitempty"` + LinkedAccessChecks *[]LinkedAccessCheck `json:"linkedAccessChecks,omitempty"` + DefaultAPIVersion *string `json:"defaultApiVersion,omitempty"` + LoggingRules *[]LoggingRule `json:"loggingRules,omitempty"` + ThrottlingRules *[]ThrottlingRule `json:"throttlingRules,omitempty"` + Endpoints *[]ResourceProviderEndpoint `json:"endpoints,omitempty"` + // MarketplaceType - Possible values include: 'MarketplaceTypeNotSpecified', 'MarketplaceTypeAddOn', 'MarketplaceTypeBypass', 'MarketplaceTypeStore' + MarketplaceType MarketplaceType `json:"marketplaceType,omitempty"` + IdentityManagement *ResourceTypeIdentityManagement `json:"identityManagement,omitempty"` + Metadata interface{} `json:"metadata,omitempty"` + RequiredFeatures *[]string `json:"requiredFeatures,omitempty"` + FeaturesRule *ResourceTypeFeaturesRule `json:"featuresRule,omitempty"` + SubscriptionStateRules *[]SubscriptionStateRule `json:"subscriptionStateRules,omitempty"` + ServiceTreeInfos *[]ServiceTreeInfo `json:"serviceTreeInfos,omitempty"` + RequestHeaderOptions *ResourceTypeRequestHeaderOptions `json:"requestHeaderOptions,omitempty"` + SkuLink *string `json:"skuLink,omitempty"` + DisallowedActionVerbs *[]string `json:"disallowedActionVerbs,omitempty"` + TemplateDeploymentPolicy *ResourceTypeTemplateDeploymentPolicy `json:"templateDeploymentPolicy,omitempty"` + ExtendedLocations *[]ExtendedLocationOptions `json:"extendedLocations,omitempty"` + LinkedOperationRules *[]LinkedOperationRule `json:"linkedOperationRules,omitempty"` + // ResourceDeletionPolicy - Possible values include: 'ManifestResourceDeletionPolicyNotSpecified', 'ManifestResourceDeletionPolicyCascade', 'ManifestResourceDeletionPolicyForce' + ResourceDeletionPolicy ManifestResourceDeletionPolicy `json:"resourceDeletionPolicy,omitempty"` +} + +// ResourceTypeEndpoint ... +type ResourceTypeEndpoint struct { + Enabled *bool `json:"enabled,omitempty"` + APIVersions *[]string `json:"apiVersions,omitempty"` + Locations *[]string `json:"locations,omitempty"` + RequiredFeatures *[]string `json:"requiredFeatures,omitempty"` + FeaturesRule *ResourceTypeEndpointFeaturesRule `json:"featuresRule,omitempty"` + Extensions *[]ResourceTypeExtension `json:"extensions,omitempty"` + Timeout *string `json:"timeout,omitempty"` +} + +// ResourceTypeEndpointFeaturesRule ... +type ResourceTypeEndpointFeaturesRule struct { + // RequiredFeaturesPolicy - Possible values include: 'Any', 'All' + RequiredFeaturesPolicy FeaturesPolicy `json:"requiredFeaturesPolicy,omitempty"` +} + +// ResourceTypeExtension ... +type ResourceTypeExtension struct { + EndpointURI *string `json:"endpointUri,omitempty"` + ExtensionCategories *[]ExtensionCategory `json:"extensionCategories,omitempty"` + Timeout *string `json:"timeout,omitempty"` +} + +// ResourceTypeExtensionOptions ... +type ResourceTypeExtensionOptions struct { + ResourceCreationBegin *ResourceTypeExtensionOptionsResourceCreationBegin `json:"resourceCreationBegin,omitempty"` +} + +// ResourceTypeExtensionOptionsResourceCreationBegin ... +type ResourceTypeExtensionOptionsResourceCreationBegin struct { + Request *[]ExtensionOptionType `json:"request,omitempty"` + Response *[]ExtensionOptionType `json:"response,omitempty"` +} + +// ResourceTypeFeaturesRule ... +type ResourceTypeFeaturesRule struct { + // RequiredFeaturesPolicy - Possible values include: 'Any', 'All' + RequiredFeaturesPolicy FeaturesPolicy `json:"requiredFeaturesPolicy,omitempty"` +} + +// ResourceTypeIdentityManagement ... +type ResourceTypeIdentityManagement struct { + // Type - Possible values include: 'IdentityManagementTypesNotSpecified', 'IdentityManagementTypesSystemAssigned', 'IdentityManagementTypesUserAssigned', 'IdentityManagementTypesActor', 'IdentityManagementTypesDelegatedResourceIdentity' + Type IdentityManagementTypes `json:"type,omitempty"` +} + +// ResourceTypeRegistration ... +type ResourceTypeRegistration struct { + autorest.Response `json:"-"` + Properties *ResourceTypeRegistrationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceTypeRegistration. +func (rtr ResourceTypeRegistration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rtr.Properties != nil { + objectMap["properties"] = rtr.Properties + } + return json.Marshal(objectMap) +} + +// ResourceTypeRegistrationArrayResponseWithContinuation ... +type ResourceTypeRegistrationArrayResponseWithContinuation struct { + autorest.Response `json:"-"` + Value *[]ResourceTypeRegistration `json:"value,omitempty"` + // NextLink - The URL to get to the next set of results, if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ResourceTypeRegistrationArrayResponseWithContinuationIterator provides access to a complete listing of +// ResourceTypeRegistration values. +type ResourceTypeRegistrationArrayResponseWithContinuationIterator struct { + i int + page ResourceTypeRegistrationArrayResponseWithContinuationPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ResourceTypeRegistrationArrayResponseWithContinuationIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceTypeRegistrationArrayResponseWithContinuationIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ResourceTypeRegistrationArrayResponseWithContinuationIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceTypeRegistrationArrayResponseWithContinuationIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ResourceTypeRegistrationArrayResponseWithContinuationIterator) Response() ResourceTypeRegistrationArrayResponseWithContinuation { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ResourceTypeRegistrationArrayResponseWithContinuationIterator) Value() ResourceTypeRegistration { + if !iter.page.NotDone() { + return ResourceTypeRegistration{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ResourceTypeRegistrationArrayResponseWithContinuationIterator type. +func NewResourceTypeRegistrationArrayResponseWithContinuationIterator(page ResourceTypeRegistrationArrayResponseWithContinuationPage) ResourceTypeRegistrationArrayResponseWithContinuationIterator { + return ResourceTypeRegistrationArrayResponseWithContinuationIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rtrarwc ResourceTypeRegistrationArrayResponseWithContinuation) IsEmpty() bool { + return rtrarwc.Value == nil || len(*rtrarwc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rtrarwc ResourceTypeRegistrationArrayResponseWithContinuation) hasNextLink() bool { + return rtrarwc.NextLink != nil && len(*rtrarwc.NextLink) != 0 +} + +// resourceTypeRegistrationArrayResponseWithContinuationPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rtrarwc ResourceTypeRegistrationArrayResponseWithContinuation) resourceTypeRegistrationArrayResponseWithContinuationPreparer(ctx context.Context) (*http.Request, error) { + if !rtrarwc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rtrarwc.NextLink))) +} + +// ResourceTypeRegistrationArrayResponseWithContinuationPage contains a page of ResourceTypeRegistration +// values. +type ResourceTypeRegistrationArrayResponseWithContinuationPage struct { + fn func(context.Context, ResourceTypeRegistrationArrayResponseWithContinuation) (ResourceTypeRegistrationArrayResponseWithContinuation, error) + rtrarwc ResourceTypeRegistrationArrayResponseWithContinuation +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ResourceTypeRegistrationArrayResponseWithContinuationPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceTypeRegistrationArrayResponseWithContinuationPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rtrarwc) + if err != nil { + return err + } + page.rtrarwc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ResourceTypeRegistrationArrayResponseWithContinuationPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceTypeRegistrationArrayResponseWithContinuationPage) NotDone() bool { + return !page.rtrarwc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceTypeRegistrationArrayResponseWithContinuationPage) Response() ResourceTypeRegistrationArrayResponseWithContinuation { + return page.rtrarwc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceTypeRegistrationArrayResponseWithContinuationPage) Values() []ResourceTypeRegistration { + if page.rtrarwc.IsEmpty() { + return nil + } + return *page.rtrarwc.Value +} + +// Creates a new instance of the ResourceTypeRegistrationArrayResponseWithContinuationPage type. +func NewResourceTypeRegistrationArrayResponseWithContinuationPage(cur ResourceTypeRegistrationArrayResponseWithContinuation, getNextPage func(context.Context, ResourceTypeRegistrationArrayResponseWithContinuation) (ResourceTypeRegistrationArrayResponseWithContinuation, error)) ResourceTypeRegistrationArrayResponseWithContinuationPage { + return ResourceTypeRegistrationArrayResponseWithContinuationPage{ + fn: getNextPage, + rtrarwc: cur, + } +} + +// ResourceTypeRegistrationProperties ... +type ResourceTypeRegistrationProperties struct { + // RoutingType - Possible values include: 'Default', 'ProxyOnly', 'HostBased', 'Extension', 'Tenant', 'Fanout', 'LocationBased', 'Failover', 'CascadeExtension' + RoutingType RoutingType `json:"routingType,omitempty"` + // Regionality - Possible values include: 'RegionalityNotSpecified', 'RegionalityGlobal', 'RegionalityRegional' + Regionality Regionality `json:"regionality,omitempty"` + Endpoints *[]ResourceTypeEndpoint `json:"endpoints,omitempty"` + ExtensionOptions *ResourceTypeRegistrationPropertiesExtensionOptions `json:"extensionOptions,omitempty"` + // MarketplaceType - Possible values include: 'MarketplaceType1NotSpecified', 'MarketplaceType1AddOn', 'MarketplaceType1Bypass', 'MarketplaceType1Store' + MarketplaceType MarketplaceType1 `json:"marketplaceType,omitempty"` + SwaggerSpecifications *[]SwaggerSpecification `json:"swaggerSpecifications,omitempty"` + AllowedUnauthorizedActions *[]string `json:"allowedUnauthorizedActions,omitempty"` + AuthorizationActionMappings *[]AuthorizationActionMapping `json:"authorizationActionMappings,omitempty"` + LinkedAccessChecks *[]LinkedAccessCheck `json:"linkedAccessChecks,omitempty"` + DefaultAPIVersion *string `json:"defaultApiVersion,omitempty"` + LoggingRules *[]LoggingRule `json:"loggingRules,omitempty"` + ThrottlingRules *[]ThrottlingRule `json:"throttlingRules,omitempty"` + RequiredFeatures *[]string `json:"requiredFeatures,omitempty"` + FeaturesRule *ResourceTypeRegistrationPropertiesFeaturesRule `json:"featuresRule,omitempty"` + EnableAsyncOperation *bool `json:"enableAsyncOperation,omitempty"` + // ProvisioningState - Possible values include: 'ProvisioningStateNotSpecified', 'ProvisioningStateAccepted', 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateCreated', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateCanceled', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateMovingResources', 'ProvisioningStateTransientFailure', 'ProvisioningStateRolloutInProgress' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + EnableThirdPartyS2S *bool `json:"enableThirdPartyS2S,omitempty"` + SubscriptionLifecycleNotificationSpecifications *ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications `json:"subscriptionLifecycleNotificationSpecifications,omitempty"` + IsPureProxy *bool `json:"isPureProxy,omitempty"` + IdentityManagement *ResourceTypeRegistrationPropertiesIdentityManagement `json:"identityManagement,omitempty"` + CheckNameAvailabilitySpecifications *ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications `json:"checkNameAvailabilitySpecifications,omitempty"` + DisallowedActionVerbs *[]string `json:"disallowedActionVerbs,omitempty"` + ServiceTreeInfos *[]ServiceTreeInfo `json:"serviceTreeInfos,omitempty"` + RequestHeaderOptions *ResourceTypeRegistrationPropertiesRequestHeaderOptions `json:"requestHeaderOptions,omitempty"` + SubscriptionStateRules *[]SubscriptionStateRule `json:"subscriptionStateRules,omitempty"` + TemplateDeploymentOptions *ResourceTypeRegistrationPropertiesTemplateDeploymentOptions `json:"templateDeploymentOptions,omitempty"` + ExtendedLocations *[]ExtendedLocationOptions `json:"extendedLocations,omitempty"` + ResourceMovePolicy *ResourceTypeRegistrationPropertiesResourceMovePolicy `json:"resourceMovePolicy,omitempty"` + // ResourceDeletionPolicy - Possible values include: 'ResourceDeletionPolicyNotSpecified', 'ResourceDeletionPolicyCascadeDeleteAll', 'ResourceDeletionPolicyCascadeDeleteProxyOnlyChildren' + ResourceDeletionPolicy ResourceDeletionPolicy `json:"resourceDeletionPolicy,omitempty"` +} + +// ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications ... +type ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications struct { + EnableDefaultValidation *bool `json:"enableDefaultValidation,omitempty"` + ResourceTypesWithCustomValidation *[]string `json:"resourceTypesWithCustomValidation,omitempty"` +} + +// ResourceTypeRegistrationPropertiesExtensionOptions ... +type ResourceTypeRegistrationPropertiesExtensionOptions struct { + ResourceCreationBegin *ResourceTypeExtensionOptionsResourceCreationBegin `json:"resourceCreationBegin,omitempty"` +} + +// ResourceTypeRegistrationPropertiesFeaturesRule ... +type ResourceTypeRegistrationPropertiesFeaturesRule struct { + // RequiredFeaturesPolicy - Possible values include: 'Any', 'All' + RequiredFeaturesPolicy FeaturesPolicy `json:"requiredFeaturesPolicy,omitempty"` +} + +// ResourceTypeRegistrationPropertiesIdentityManagement ... +type ResourceTypeRegistrationPropertiesIdentityManagement struct { + // Type - Possible values include: 'IdentityManagementTypesNotSpecified', 'IdentityManagementTypesSystemAssigned', 'IdentityManagementTypesUserAssigned', 'IdentityManagementTypesActor', 'IdentityManagementTypesDelegatedResourceIdentity' + Type IdentityManagementTypes `json:"type,omitempty"` + ApplicationID *string `json:"applicationId,omitempty"` +} + +// ResourceTypeRegistrationPropertiesModel ... +type ResourceTypeRegistrationPropertiesModel struct { + // RoutingType - Possible values include: 'Default', 'ProxyOnly', 'HostBased', 'Extension', 'Tenant', 'Fanout', 'LocationBased', 'Failover', 'CascadeExtension' + RoutingType RoutingType `json:"routingType,omitempty"` + // Regionality - Possible values include: 'RegionalityNotSpecified', 'RegionalityGlobal', 'RegionalityRegional' + Regionality Regionality `json:"regionality,omitempty"` + Endpoints *[]ResourceTypeEndpoint `json:"endpoints,omitempty"` + ExtensionOptions *ResourceTypeRegistrationPropertiesExtensionOptions `json:"extensionOptions,omitempty"` + // MarketplaceType - Possible values include: 'MarketplaceType1NotSpecified', 'MarketplaceType1AddOn', 'MarketplaceType1Bypass', 'MarketplaceType1Store' + MarketplaceType MarketplaceType1 `json:"marketplaceType,omitempty"` + SwaggerSpecifications *[]SwaggerSpecification `json:"swaggerSpecifications,omitempty"` + AllowedUnauthorizedActions *[]string `json:"allowedUnauthorizedActions,omitempty"` + AuthorizationActionMappings *[]AuthorizationActionMapping `json:"authorizationActionMappings,omitempty"` + LinkedAccessChecks *[]LinkedAccessCheck `json:"linkedAccessChecks,omitempty"` + DefaultAPIVersion *string `json:"defaultApiVersion,omitempty"` + LoggingRules *[]LoggingRule `json:"loggingRules,omitempty"` + ThrottlingRules *[]ThrottlingRule `json:"throttlingRules,omitempty"` + RequiredFeatures *[]string `json:"requiredFeatures,omitempty"` + FeaturesRule *ResourceTypeRegistrationPropertiesFeaturesRule `json:"featuresRule,omitempty"` + EnableAsyncOperation *bool `json:"enableAsyncOperation,omitempty"` + // ProvisioningState - Possible values include: 'ProvisioningStateNotSpecified', 'ProvisioningStateAccepted', 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateCreated', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateCanceled', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateMovingResources', 'ProvisioningStateTransientFailure', 'ProvisioningStateRolloutInProgress' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + EnableThirdPartyS2S *bool `json:"enableThirdPartyS2S,omitempty"` + SubscriptionLifecycleNotificationSpecifications *ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications `json:"subscriptionLifecycleNotificationSpecifications,omitempty"` + IsPureProxy *bool `json:"isPureProxy,omitempty"` + IdentityManagement *ResourceTypeRegistrationPropertiesIdentityManagement `json:"identityManagement,omitempty"` + CheckNameAvailabilitySpecifications *ResourceTypeRegistrationPropertiesCheckNameAvailabilitySpecifications `json:"checkNameAvailabilitySpecifications,omitempty"` + DisallowedActionVerbs *[]string `json:"disallowedActionVerbs,omitempty"` + ServiceTreeInfos *[]ServiceTreeInfo `json:"serviceTreeInfos,omitempty"` + RequestHeaderOptions *ResourceTypeRegistrationPropertiesRequestHeaderOptions `json:"requestHeaderOptions,omitempty"` + SubscriptionStateRules *[]SubscriptionStateRule `json:"subscriptionStateRules,omitempty"` + TemplateDeploymentOptions *ResourceTypeRegistrationPropertiesTemplateDeploymentOptions `json:"templateDeploymentOptions,omitempty"` + ExtendedLocations *[]ExtendedLocationOptions `json:"extendedLocations,omitempty"` + ResourceMovePolicy *ResourceTypeRegistrationPropertiesResourceMovePolicy `json:"resourceMovePolicy,omitempty"` + // ResourceDeletionPolicy - Possible values include: 'ResourceDeletionPolicyNotSpecified', 'ResourceDeletionPolicyCascadeDeleteAll', 'ResourceDeletionPolicyCascadeDeleteProxyOnlyChildren' + ResourceDeletionPolicy ResourceDeletionPolicy `json:"resourceDeletionPolicy,omitempty"` +} + +// ResourceTypeRegistrationPropertiesRequestHeaderOptions ... +type ResourceTypeRegistrationPropertiesRequestHeaderOptions struct { + // OptInHeaders - Possible values include: 'OptInHeaderTypeNotSpecified', 'OptInHeaderTypeSignedUserToken', 'OptInHeaderTypeClientGroupMembership', 'OptInHeaderTypeSignedAuxiliaryTokens', 'OptInHeaderTypeUnboundedClientGroupMembership' + OptInHeaders OptInHeaderType `json:"optInHeaders,omitempty"` +} + +// ResourceTypeRegistrationPropertiesResourceMovePolicy ... +type ResourceTypeRegistrationPropertiesResourceMovePolicy struct { + ValidationRequired *bool `json:"validationRequired,omitempty"` + CrossResourceGroupMoveEnabled *bool `json:"crossResourceGroupMoveEnabled,omitempty"` + CrossSubscriptionMoveEnabled *bool `json:"crossSubscriptionMoveEnabled,omitempty"` +} + +// ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications ... +type ResourceTypeRegistrationPropertiesSubscriptionLifecycleNotificationSpecifications struct { + SubscriptionStateOverrideActions *[]SubscriptionStateOverrideAction `json:"subscriptionStateOverrideActions,omitempty"` + SoftDeleteTTL *string `json:"softDeleteTTL,omitempty"` +} + +// ResourceTypeRegistrationPropertiesTemplateDeploymentOptions ... +type ResourceTypeRegistrationPropertiesTemplateDeploymentOptions struct { + PreflightSupported *bool `json:"preflightSupported,omitempty"` + PreflightOptions *[]PreflightOption `json:"preflightOptions,omitempty"` +} + +// ResourceTypeRegistrationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ResourceTypeRegistrationsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ResourceTypeRegistrationsClient) (ResourceTypeRegistration, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ResourceTypeRegistrationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ResourceTypeRegistrationsCreateOrUpdateFuture.Result. +func (future *ResourceTypeRegistrationsCreateOrUpdateFuture) result(client ResourceTypeRegistrationsClient) (rtr ResourceTypeRegistration, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rtr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("providerhub.ResourceTypeRegistrationsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rtr.Response.Response, err = future.GetResult(sender); err == nil && rtr.Response.Response.StatusCode != http.StatusNoContent { + rtr, err = client.CreateOrUpdateResponder(rtr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsCreateOrUpdateFuture", "Result", rtr.Response.Response, "Failure responding to request") + } + } + return +} + +// ResourceTypeRequestHeaderOptions ... +type ResourceTypeRequestHeaderOptions struct { + // OptInHeaders - Possible values include: 'OptInHeaderTypeNotSpecified', 'OptInHeaderTypeSignedUserToken', 'OptInHeaderTypeClientGroupMembership', 'OptInHeaderTypeSignedAuxiliaryTokens', 'OptInHeaderTypeUnboundedClientGroupMembership' + OptInHeaders OptInHeaderType `json:"optInHeaders,omitempty"` +} + +// ResourceTypeSku ... +type ResourceTypeSku struct { + SkuSettings *[]SkuSetting `json:"skuSettings,omitempty"` +} + +// ResourceTypeTemplateDeploymentPolicy ... +type ResourceTypeTemplateDeploymentPolicy struct { + // Capabilities - Possible values include: 'TemplateDeploymentCapabilitiesDefault', 'TemplateDeploymentCapabilitiesPreflight' + Capabilities TemplateDeploymentCapabilities `json:"capabilities,omitempty"` + // PreflightOptions - Possible values include: 'TemplateDeploymentPreflightOptionsNone', 'TemplateDeploymentPreflightOptionsValidationRequests', 'TemplateDeploymentPreflightOptionsDeploymentRequests', 'TemplateDeploymentPreflightOptionsTestOnly', 'TemplateDeploymentPreflightOptionsRegisteredOnly' + PreflightOptions TemplateDeploymentPreflightOptions `json:"preflightOptions,omitempty"` +} + +// RolloutStatusBase ... +type RolloutStatusBase struct { + CompletedRegions *[]string `json:"completedRegions,omitempty"` + FailedOrSkippedRegions map[string]*ExtendedErrorInfo `json:"failedOrSkippedRegions"` +} + +// MarshalJSON is the custom marshaler for RolloutStatusBase. +func (rsb RolloutStatusBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsb.CompletedRegions != nil { + objectMap["completedRegions"] = rsb.CompletedRegions + } + if rsb.FailedOrSkippedRegions != nil { + objectMap["failedOrSkippedRegions"] = rsb.FailedOrSkippedRegions + } + return json.Marshal(objectMap) +} + +// ServiceTreeInfo ... +type ServiceTreeInfo struct { + ServiceID *string `json:"serviceId,omitempty"` + ComponentID *string `json:"componentId,omitempty"` +} + +// SkuCapability ... +type SkuCapability struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +// SkuCapacity ... +type SkuCapacity struct { + Minimum *int32 `json:"minimum,omitempty"` + Maximum *int32 `json:"maximum,omitempty"` + Default *int32 `json:"default,omitempty"` + // ScaleType - Possible values include: 'SkuScaleTypeNone', 'SkuScaleTypeManual', 'SkuScaleTypeAutomatic' + ScaleType SkuScaleType `json:"scaleType,omitempty"` +} + +// SkuCost ... +type SkuCost struct { + MeterID *string `json:"meterId,omitempty"` + Quantity *int32 `json:"quantity,omitempty"` + ExtendedUnit *string `json:"extendedUnit,omitempty"` +} + +// SkuLocationInfo ... +type SkuLocationInfo struct { + Location *string `json:"location,omitempty"` + Zones *[]string `json:"zones,omitempty"` + ZoneDetails *[]SkuZoneDetail `json:"zoneDetails,omitempty"` + ExtendedLocations *[]string `json:"extendedLocations,omitempty"` + // Type - Possible values include: 'TypeNotSpecified', 'TypeEdgeZone', 'TypeArcZone' + Type Type `json:"type,omitempty"` +} + +// SkuResource ... +type SkuResource struct { + autorest.Response `json:"-"` + Properties *SkuResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SkuResource. +func (sr SkuResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sr.Properties != nil { + objectMap["properties"] = sr.Properties + } + return json.Marshal(objectMap) +} + +// SkuResourceArrayResponseWithContinuation ... +type SkuResourceArrayResponseWithContinuation struct { + autorest.Response `json:"-"` + Value *[]SkuResource `json:"value,omitempty"` + // NextLink - The URL to get to the next set of results, if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// SkuResourceArrayResponseWithContinuationIterator provides access to a complete listing of SkuResource +// values. +type SkuResourceArrayResponseWithContinuationIterator struct { + i int + page SkuResourceArrayResponseWithContinuationPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SkuResourceArrayResponseWithContinuationIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkuResourceArrayResponseWithContinuationIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SkuResourceArrayResponseWithContinuationIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SkuResourceArrayResponseWithContinuationIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SkuResourceArrayResponseWithContinuationIterator) Response() SkuResourceArrayResponseWithContinuation { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SkuResourceArrayResponseWithContinuationIterator) Value() SkuResource { + if !iter.page.NotDone() { + return SkuResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SkuResourceArrayResponseWithContinuationIterator type. +func NewSkuResourceArrayResponseWithContinuationIterator(page SkuResourceArrayResponseWithContinuationPage) SkuResourceArrayResponseWithContinuationIterator { + return SkuResourceArrayResponseWithContinuationIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (srarwc SkuResourceArrayResponseWithContinuation) IsEmpty() bool { + return srarwc.Value == nil || len(*srarwc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (srarwc SkuResourceArrayResponseWithContinuation) hasNextLink() bool { + return srarwc.NextLink != nil && len(*srarwc.NextLink) != 0 +} + +// skuResourceArrayResponseWithContinuationPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (srarwc SkuResourceArrayResponseWithContinuation) skuResourceArrayResponseWithContinuationPreparer(ctx context.Context) (*http.Request, error) { + if !srarwc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(srarwc.NextLink))) +} + +// SkuResourceArrayResponseWithContinuationPage contains a page of SkuResource values. +type SkuResourceArrayResponseWithContinuationPage struct { + fn func(context.Context, SkuResourceArrayResponseWithContinuation) (SkuResourceArrayResponseWithContinuation, error) + srarwc SkuResourceArrayResponseWithContinuation +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SkuResourceArrayResponseWithContinuationPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkuResourceArrayResponseWithContinuationPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.srarwc) + if err != nil { + return err + } + page.srarwc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SkuResourceArrayResponseWithContinuationPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SkuResourceArrayResponseWithContinuationPage) NotDone() bool { + return !page.srarwc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SkuResourceArrayResponseWithContinuationPage) Response() SkuResourceArrayResponseWithContinuation { + return page.srarwc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SkuResourceArrayResponseWithContinuationPage) Values() []SkuResource { + if page.srarwc.IsEmpty() { + return nil + } + return *page.srarwc.Value +} + +// Creates a new instance of the SkuResourceArrayResponseWithContinuationPage type. +func NewSkuResourceArrayResponseWithContinuationPage(cur SkuResourceArrayResponseWithContinuation, getNextPage func(context.Context, SkuResourceArrayResponseWithContinuation) (SkuResourceArrayResponseWithContinuation, error)) SkuResourceArrayResponseWithContinuationPage { + return SkuResourceArrayResponseWithContinuationPage{ + fn: getNextPage, + srarwc: cur, + } +} + +// SkuResourceProperties ... +type SkuResourceProperties struct { + SkuSettings *[]SkuSetting `json:"skuSettings,omitempty"` +} + +// SkuSetting ... +type SkuSetting struct { + Name *string `json:"name,omitempty"` + Tier *string `json:"tier,omitempty"` + Size *string `json:"size,omitempty"` + Family *string `json:"family,omitempty"` + Kind *string `json:"kind,omitempty"` + Locations *[]string `json:"locations,omitempty"` + LocationInfo *[]SkuLocationInfo `json:"locationInfo,omitempty"` + RequiredQuotaIds *[]string `json:"requiredQuotaIds,omitempty"` + RequiredFeatures *[]string `json:"requiredFeatures,omitempty"` + Capacity *SkuSettingCapacity `json:"capacity,omitempty"` + Costs *[]SkuCost `json:"costs,omitempty"` + Capabilities *[]SkuCapability `json:"capabilities,omitempty"` +} + +// SkuSettingCapacity ... +type SkuSettingCapacity struct { + Minimum *int32 `json:"minimum,omitempty"` + Maximum *int32 `json:"maximum,omitempty"` + Default *int32 `json:"default,omitempty"` + // ScaleType - Possible values include: 'SkuScaleTypeNone', 'SkuScaleTypeManual', 'SkuScaleTypeAutomatic' + ScaleType SkuScaleType `json:"scaleType,omitempty"` +} + +// SkuZoneDetail ... +type SkuZoneDetail struct { + Name *[]string `json:"name,omitempty"` + Capabilities *[]SkuCapability `json:"capabilities,omitempty"` +} + +// SubscriptionLifecycleNotificationSpecifications ... +type SubscriptionLifecycleNotificationSpecifications struct { + SubscriptionStateOverrideActions *[]SubscriptionStateOverrideAction `json:"subscriptionStateOverrideActions,omitempty"` + SoftDeleteTTL *string `json:"softDeleteTTL,omitempty"` +} + +// SubscriptionStateOverrideAction ... +type SubscriptionStateOverrideAction struct { + // State - Possible values include: 'Registered', 'Unregistered', 'Warned', 'Suspended', 'Deleted', 'WarnedToRegistered', 'WarnedToSuspended', 'WarnedToDeleted', 'WarnedToUnregistered', 'SuspendedToRegistered', 'SuspendedToWarned', 'SuspendedToDeleted', 'SuspendedToUnregistered' + State SubscriptionTransitioningState `json:"state,omitempty"` + // Action - Possible values include: 'NotDefined', 'DeleteAllResources', 'SoftDeleteAllResources', 'NoOp', 'BillingCancellation', 'UndoSoftDelete' + Action SubscriptionNotificationOperation `json:"action,omitempty"` +} + +// SubscriptionStateRule ... +type SubscriptionStateRule struct { + // State - Possible values include: 'SubscriptionStateNotDefined', 'SubscriptionStateEnabled', 'SubscriptionStateWarned', 'SubscriptionStatePastDue', 'SubscriptionStateDisabled', 'SubscriptionStateDeleted' + State SubscriptionState `json:"state,omitempty"` + AllowedActions *[]string `json:"allowedActions,omitempty"` +} + +// SwaggerSpecification ... +type SwaggerSpecification struct { + APIVersions *[]string `json:"apiVersions,omitempty"` + SwaggerSpecFolderURI *string `json:"swaggerSpecFolderUri,omitempty"` +} + +// TemplateDeploymentOptions ... +type TemplateDeploymentOptions struct { + PreflightSupported *bool `json:"preflightSupported,omitempty"` + PreflightOptions *[]PreflightOption `json:"preflightOptions,omitempty"` +} + +// TemplateDeploymentPolicy ... +type TemplateDeploymentPolicy struct { + // Capabilities - Possible values include: 'TemplateDeploymentCapabilitiesDefault', 'TemplateDeploymentCapabilitiesPreflight' + Capabilities TemplateDeploymentCapabilities `json:"capabilities,omitempty"` + // PreflightOptions - Possible values include: 'TemplateDeploymentPreflightOptionsNone', 'TemplateDeploymentPreflightOptionsValidationRequests', 'TemplateDeploymentPreflightOptionsDeploymentRequests', 'TemplateDeploymentPreflightOptionsTestOnly', 'TemplateDeploymentPreflightOptionsRegisteredOnly' + PreflightOptions TemplateDeploymentPreflightOptions `json:"preflightOptions,omitempty"` +} + +// ThirdPartyProviderAuthorization ... +type ThirdPartyProviderAuthorization struct { + Authorizations *[]LightHouseAuthorization `json:"authorizations,omitempty"` + ManagedByTenantID *string `json:"managedByTenantId,omitempty"` +} + +// ThrottlingMetric ... +type ThrottlingMetric struct { + // Type - Possible values include: 'ThrottlingMetricTypeNotSpecified', 'ThrottlingMetricTypeNumberOfRequests', 'ThrottlingMetricTypeNumberOfResources' + Type ThrottlingMetricType `json:"type,omitempty"` + Limit *int64 `json:"limit,omitempty"` + Interval *string `json:"interval,omitempty"` +} + +// ThrottlingRule ... +type ThrottlingRule struct { + Action *string `json:"action,omitempty"` + Metrics *[]ThrottlingMetric `json:"metrics,omitempty"` + RequiredFeatures *[]string `json:"requiredFeatures,omitempty"` +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + +// TrafficRegionRolloutConfiguration ... +type TrafficRegionRolloutConfiguration struct { + WaitDuration *string `json:"waitDuration,omitempty"` + Regions *[]string `json:"regions,omitempty"` +} + +// TrafficRegions ... +type TrafficRegions struct { + Regions *[]string `json:"regions,omitempty"` +} + +// TypedErrorInfo ... +type TypedErrorInfo struct { + Type *string `json:"type,omitempty"` + // Info - READ-ONLY + Info interface{} `json:"info,omitempty"` +} + +// MarshalJSON is the custom marshaler for TypedErrorInfo. +func (tei TypedErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tei.Type != nil { + objectMap["type"] = tei.Type + } + return json.Marshal(objectMap) +} diff --git a/services/providerhub/mgmt/2020-11-20/providerhub/notificationregistrations.go b/services/providerhub/mgmt/2020-11-20/providerhub/notificationregistrations.go new file mode 100644 index 000000000000..89cecbe17692 --- /dev/null +++ b/services/providerhub/mgmt/2020-11-20/providerhub/notificationregistrations.go @@ -0,0 +1,403 @@ +package providerhub + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// NotificationRegistrationsClient is the microsoft ProviderHub +type NotificationRegistrationsClient struct { + BaseClient +} + +// NewNotificationRegistrationsClient creates an instance of the NotificationRegistrationsClient client. +func NewNotificationRegistrationsClient(subscriptionID string) NotificationRegistrationsClient { + return NewNotificationRegistrationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNotificationRegistrationsClientWithBaseURI creates an instance of the NotificationRegistrationsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewNotificationRegistrationsClientWithBaseURI(baseURI string, subscriptionID string) NotificationRegistrationsClient { + return NotificationRegistrationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a notification registration. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// notificationRegistrationName - the notification registration. +// properties - the required body parameters supplied to the notification registration operation. +func (client NotificationRegistrationsClient) CreateOrUpdate(ctx context.Context, providerNamespace string, notificationRegistrationName string, properties NotificationRegistration) (result NotificationRegistration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotificationRegistrationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.NotificationRegistrationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, providerNamespace, notificationRegistrationName, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client NotificationRegistrationsClient) CreateOrUpdatePreparer(ctx context.Context, providerNamespace string, notificationRegistrationName string, properties NotificationRegistration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "notificationRegistrationName": autorest.Encode("path", notificationRegistrationName), + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}", pathParameters), + autorest.WithJSON(properties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationRegistrationsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client NotificationRegistrationsClient) CreateOrUpdateResponder(resp *http.Response) (result NotificationRegistration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a notification registration. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// notificationRegistrationName - the notification registration. +func (client NotificationRegistrationsClient) Delete(ctx context.Context, providerNamespace string, notificationRegistrationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotificationRegistrationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.NotificationRegistrationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, providerNamespace, notificationRegistrationName) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client NotificationRegistrationsClient) DeletePreparer(ctx context.Context, providerNamespace string, notificationRegistrationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "notificationRegistrationName": autorest.Encode("path", notificationRegistrationName), + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationRegistrationsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client NotificationRegistrationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the notification registration details. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// notificationRegistrationName - the notification registration. +func (client NotificationRegistrationsClient) Get(ctx context.Context, providerNamespace string, notificationRegistrationName string) (result NotificationRegistration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotificationRegistrationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.NotificationRegistrationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, providerNamespace, notificationRegistrationName) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client NotificationRegistrationsClient) GetPreparer(ctx context.Context, providerNamespace string, notificationRegistrationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "notificationRegistrationName": autorest.Encode("path", notificationRegistrationName), + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations/{notificationRegistrationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationRegistrationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client NotificationRegistrationsClient) GetResponder(resp *http.Response) (result NotificationRegistration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByProviderRegistration gets the list of the notification registrations for the given provider. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +func (client NotificationRegistrationsClient) ListByProviderRegistration(ctx context.Context, providerNamespace string) (result NotificationRegistrationArrayResponseWithContinuationPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotificationRegistrationsClient.ListByProviderRegistration") + defer func() { + sc := -1 + if result.nrarwc.Response.Response != nil { + sc = result.nrarwc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.NotificationRegistrationsClient", "ListByProviderRegistration", err.Error()) + } + + result.fn = client.listByProviderRegistrationNextResults + req, err := client.ListByProviderRegistrationPreparer(ctx, providerNamespace) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "ListByProviderRegistration", nil, "Failure preparing request") + return + } + + resp, err := client.ListByProviderRegistrationSender(req) + if err != nil { + result.nrarwc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "ListByProviderRegistration", resp, "Failure sending request") + return + } + + result.nrarwc, err = client.ListByProviderRegistrationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "ListByProviderRegistration", resp, "Failure responding to request") + return + } + if result.nrarwc.hasNextLink() && result.nrarwc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByProviderRegistrationPreparer prepares the ListByProviderRegistration request. +func (client NotificationRegistrationsClient) ListByProviderRegistrationPreparer(ctx context.Context, providerNamespace string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/notificationRegistrations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByProviderRegistrationSender sends the ListByProviderRegistration request. The method will close the +// http.Response Body if it receives an error. +func (client NotificationRegistrationsClient) ListByProviderRegistrationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByProviderRegistrationResponder handles the response to the ListByProviderRegistration request. The method always +// closes the http.Response Body. +func (client NotificationRegistrationsClient) ListByProviderRegistrationResponder(resp *http.Response) (result NotificationRegistrationArrayResponseWithContinuation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByProviderRegistrationNextResults retrieves the next set of results, if any. +func (client NotificationRegistrationsClient) listByProviderRegistrationNextResults(ctx context.Context, lastResults NotificationRegistrationArrayResponseWithContinuation) (result NotificationRegistrationArrayResponseWithContinuation, err error) { + req, err := lastResults.notificationRegistrationArrayResponseWithContinuationPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "listByProviderRegistrationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByProviderRegistrationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "listByProviderRegistrationNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByProviderRegistrationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.NotificationRegistrationsClient", "listByProviderRegistrationNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByProviderRegistrationComplete enumerates all values, automatically crossing page boundaries as required. +func (client NotificationRegistrationsClient) ListByProviderRegistrationComplete(ctx context.Context, providerNamespace string) (result NotificationRegistrationArrayResponseWithContinuationIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotificationRegistrationsClient.ListByProviderRegistration") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByProviderRegistration(ctx, providerNamespace) + return +} diff --git a/services/providerhub/mgmt/2020-11-20/providerhub/operations.go b/services/providerhub/mgmt/2020-11-20/providerhub/operations.go new file mode 100644 index 000000000000..6a3a77561557 --- /dev/null +++ b/services/providerhub/mgmt/2020-11-20/providerhub/operations.go @@ -0,0 +1,379 @@ +package providerhub + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the microsoft ProviderHub +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates the operation supported by the given provider. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// operationsPutContent - the operations content properties supplied to the CreateOrUpdate operation. +func (client OperationsClient) CreateOrUpdate(ctx context.Context, providerNamespace string, operationsPutContent OperationsPutContent) (result OperationsContent, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: operationsPutContent, + Constraints: []validation.Constraint{{Target: "operationsPutContent.Contents", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.OperationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, providerNamespace, operationsPutContent) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.OperationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.OperationsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.OperationsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client OperationsClient) CreateOrUpdatePreparer(ctx context.Context, providerNamespace string, operationsPutContent OperationsPutContent) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default", pathParameters), + autorest.WithJSON(operationsPutContent), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client OperationsClient) CreateOrUpdateResponder(resp *http.Response) (result OperationsContent, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an operation. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +func (client OperationsClient) Delete(ctx context.Context, providerNamespace string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.OperationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, providerNamespace) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.OperationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "providerhub.OperationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.OperationsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client OperationsClient) DeletePreparer(ctx context.Context, providerNamespace string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client OperationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// List lists all the operations supported by Microsoft.ProviderHub. +func (client OperationsClient) List(ctx context.Context) (result OperationsDefinitionArrayResponseWithContinuationPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.odarwc.Response.Response != nil { + sc = result.odarwc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.odarwc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.odarwc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.odarwc.hasNextLink() && result.odarwc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ProviderHub/operations")) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationsDefinitionArrayResponseWithContinuation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationsDefinitionArrayResponseWithContinuation) (result OperationsDefinitionArrayResponseWithContinuation, err error) { + req, err := lastResults.operationsDefinitionArrayResponseWithContinuationPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "providerhub.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "providerhub.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationsDefinitionArrayResponseWithContinuationIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByProviderRegistration gets the operations supported by the given provider. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +func (client OperationsClient) ListByProviderRegistration(ctx context.Context, providerNamespace string) (result ListOperationsDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.ListByProviderRegistration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.OperationsClient", "ListByProviderRegistration", err.Error()) + } + + req, err := client.ListByProviderRegistrationPreparer(ctx, providerNamespace) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.OperationsClient", "ListByProviderRegistration", nil, "Failure preparing request") + return + } + + resp, err := client.ListByProviderRegistrationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.OperationsClient", "ListByProviderRegistration", resp, "Failure sending request") + return + } + + result, err = client.ListByProviderRegistrationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.OperationsClient", "ListByProviderRegistration", resp, "Failure responding to request") + return + } + + return +} + +// ListByProviderRegistrationPreparer prepares the ListByProviderRegistration request. +func (client OperationsClient) ListByProviderRegistrationPreparer(ctx context.Context, providerNamespace string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/operations/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByProviderRegistrationSender sends the ListByProviderRegistration request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListByProviderRegistrationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByProviderRegistrationResponder handles the response to the ListByProviderRegistration request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListByProviderRegistrationResponder(resp *http.Response) (result ListOperationsDefinition, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/providerhub/mgmt/2020-11-20/providerhub/providerhubapi/interfaces.go b/services/providerhub/mgmt/2020-11-20/providerhub/providerhubapi/interfaces.go new file mode 100644 index 000000000000..6f6ac1e492c3 --- /dev/null +++ b/services/providerhub/mgmt/2020-11-20/providerhub/providerhubapi/interfaces.go @@ -0,0 +1,114 @@ +package providerhubapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/providerhub/mgmt/2020-11-20/providerhub" + "github.com/Azure/go-autorest/autorest" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + CheckinManifest(ctx context.Context, providerNamespace string, checkinManifestParams providerhub.CheckinManifestParams) (result providerhub.CheckinManifestInfo, err error) + GenerateManifest(ctx context.Context, providerNamespace string) (result providerhub.ResourceProviderManifest, err error) +} + +var _ BaseClientAPI = (*providerhub.BaseClient)(nil) + +// CustomRolloutsClientAPI contains the set of methods on the CustomRolloutsClient type. +type CustomRolloutsClientAPI interface { + CreateOrUpdate(ctx context.Context, providerNamespace string, rolloutName string, properties providerhub.CustomRollout) (result providerhub.CustomRollout, err error) + Get(ctx context.Context, providerNamespace string, rolloutName string) (result providerhub.CustomRollout, err error) + ListByProviderRegistration(ctx context.Context, providerNamespace string) (result providerhub.CustomRolloutArrayResponseWithContinuationPage, err error) + ListByProviderRegistrationComplete(ctx context.Context, providerNamespace string) (result providerhub.CustomRolloutArrayResponseWithContinuationIterator, err error) +} + +var _ CustomRolloutsClientAPI = (*providerhub.CustomRolloutsClient)(nil) + +// DefaultRolloutsClientAPI contains the set of methods on the DefaultRolloutsClient type. +type DefaultRolloutsClientAPI interface { + CreateOrUpdate(ctx context.Context, providerNamespace string, rolloutName string, properties providerhub.DefaultRollout) (result providerhub.DefaultRolloutsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, providerNamespace string, rolloutName string) (result autorest.Response, err error) + Get(ctx context.Context, providerNamespace string, rolloutName string) (result providerhub.DefaultRollout, err error) + ListByProviderRegistration(ctx context.Context, providerNamespace string) (result providerhub.DefaultRolloutArrayResponseWithContinuationPage, err error) + ListByProviderRegistrationComplete(ctx context.Context, providerNamespace string) (result providerhub.DefaultRolloutArrayResponseWithContinuationIterator, err error) + Stop(ctx context.Context, providerNamespace string, rolloutName string) (result autorest.Response, err error) +} + +var _ DefaultRolloutsClientAPI = (*providerhub.DefaultRolloutsClient)(nil) + +// NotificationRegistrationsClientAPI contains the set of methods on the NotificationRegistrationsClient type. +type NotificationRegistrationsClientAPI interface { + CreateOrUpdate(ctx context.Context, providerNamespace string, notificationRegistrationName string, properties providerhub.NotificationRegistration) (result providerhub.NotificationRegistration, err error) + Delete(ctx context.Context, providerNamespace string, notificationRegistrationName string) (result autorest.Response, err error) + Get(ctx context.Context, providerNamespace string, notificationRegistrationName string) (result providerhub.NotificationRegistration, err error) + ListByProviderRegistration(ctx context.Context, providerNamespace string) (result providerhub.NotificationRegistrationArrayResponseWithContinuationPage, err error) + ListByProviderRegistrationComplete(ctx context.Context, providerNamespace string) (result providerhub.NotificationRegistrationArrayResponseWithContinuationIterator, err error) +} + +var _ NotificationRegistrationsClientAPI = (*providerhub.NotificationRegistrationsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + CreateOrUpdate(ctx context.Context, providerNamespace string, operationsPutContent providerhub.OperationsPutContent) (result providerhub.OperationsContent, err error) + Delete(ctx context.Context, providerNamespace string) (result autorest.Response, err error) + List(ctx context.Context) (result providerhub.OperationsDefinitionArrayResponseWithContinuationPage, err error) + ListComplete(ctx context.Context) (result providerhub.OperationsDefinitionArrayResponseWithContinuationIterator, err error) + ListByProviderRegistration(ctx context.Context, providerNamespace string) (result providerhub.ListOperationsDefinition, err error) +} + +var _ OperationsClientAPI = (*providerhub.OperationsClient)(nil) + +// ProviderRegistrationsClientAPI contains the set of methods on the ProviderRegistrationsClient type. +type ProviderRegistrationsClientAPI interface { + CreateOrUpdate(ctx context.Context, providerNamespace string, properties providerhub.ProviderRegistration) (result providerhub.ProviderRegistrationsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, providerNamespace string) (result autorest.Response, err error) + GenerateOperations(ctx context.Context, providerNamespace string) (result providerhub.ListOperationsDefinition, err error) + Get(ctx context.Context, providerNamespace string) (result providerhub.ProviderRegistration, err error) + List(ctx context.Context) (result providerhub.ProviderRegistrationArrayResponseWithContinuationPage, err error) + ListComplete(ctx context.Context) (result providerhub.ProviderRegistrationArrayResponseWithContinuationIterator, err error) +} + +var _ ProviderRegistrationsClientAPI = (*providerhub.ProviderRegistrationsClient)(nil) + +// ResourceTypeRegistrationsClientAPI contains the set of methods on the ResourceTypeRegistrationsClient type. +type ResourceTypeRegistrationsClientAPI interface { + CreateOrUpdate(ctx context.Context, providerNamespace string, resourceType string, properties providerhub.ResourceTypeRegistration) (result providerhub.ResourceTypeRegistrationsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, providerNamespace string, resourceType string) (result autorest.Response, err error) + Get(ctx context.Context, providerNamespace string, resourceType string) (result providerhub.ResourceTypeRegistration, err error) + ListByProviderRegistration(ctx context.Context, providerNamespace string) (result providerhub.ResourceTypeRegistrationArrayResponseWithContinuationPage, err error) + ListByProviderRegistrationComplete(ctx context.Context, providerNamespace string) (result providerhub.ResourceTypeRegistrationArrayResponseWithContinuationIterator, err error) +} + +var _ ResourceTypeRegistrationsClientAPI = (*providerhub.ResourceTypeRegistrationsClient)(nil) + +// SkusClientAPI contains the set of methods on the SkusClient type. +type SkusClientAPI interface { + CreateOrUpdate(ctx context.Context, providerNamespace string, resourceType string, sku string, properties providerhub.ResourceTypeSku) (result providerhub.SkuResource, err error) + CreateOrUpdateNestedResourceTypeFirst(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string, properties providerhub.ResourceTypeSku) (result providerhub.SkuResource, err error) + CreateOrUpdateNestedResourceTypeSecond(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string, properties providerhub.ResourceTypeSku) (result providerhub.SkuResource, err error) + CreateOrUpdateNestedResourceTypeThird(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string, properties providerhub.ResourceTypeSku) (result providerhub.SkuResource, err error) + Delete(ctx context.Context, providerNamespace string, resourceType string, sku string) (result autorest.Response, err error) + DeleteNestedResourceTypeFirst(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string) (result autorest.Response, err error) + DeleteNestedResourceTypeSecond(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string) (result autorest.Response, err error) + DeleteNestedResourceTypeThird(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string) (result autorest.Response, err error) + Get(ctx context.Context, providerNamespace string, resourceType string, sku string) (result providerhub.SkuResource, err error) + GetNestedResourceTypeFirst(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string) (result providerhub.SkuResource, err error) + GetNestedResourceTypeSecond(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string) (result providerhub.SkuResource, err error) + GetNestedResourceTypeThird(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string) (result providerhub.SkuResource, err error) + ListByResourceTypeRegistrations(ctx context.Context, providerNamespace string, resourceType string) (result providerhub.SkuResourceArrayResponseWithContinuationPage, err error) + ListByResourceTypeRegistrationsComplete(ctx context.Context, providerNamespace string, resourceType string) (result providerhub.SkuResourceArrayResponseWithContinuationIterator, err error) + ListByResourceTypeRegistrationsNestedResourceTypeFirst(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string) (result providerhub.SkuResourceArrayResponseWithContinuationPage, err error) + ListByResourceTypeRegistrationsNestedResourceTypeFirstComplete(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string) (result providerhub.SkuResourceArrayResponseWithContinuationIterator, err error) + ListByResourceTypeRegistrationsNestedResourceTypeSecond(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string) (result providerhub.SkuResourceArrayResponseWithContinuationPage, err error) + ListByResourceTypeRegistrationsNestedResourceTypeSecondComplete(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string) (result providerhub.SkuResourceArrayResponseWithContinuationIterator, err error) + ListByResourceTypeRegistrationsNestedResourceTypeThird(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string) (result providerhub.SkuResourceArrayResponseWithContinuationPage, err error) + ListByResourceTypeRegistrationsNestedResourceTypeThirdComplete(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string) (result providerhub.SkuResourceArrayResponseWithContinuationIterator, err error) +} + +var _ SkusClientAPI = (*providerhub.SkusClient)(nil) diff --git a/services/providerhub/mgmt/2020-11-20/providerhub/providerregistrations.go b/services/providerhub/mgmt/2020-11-20/providerhub/providerregistrations.go new file mode 100644 index 000000000000..70ae84577ccb --- /dev/null +++ b/services/providerhub/mgmt/2020-11-20/providerhub/providerregistrations.go @@ -0,0 +1,476 @@ +package providerhub + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ProviderRegistrationsClient is the microsoft ProviderHub +type ProviderRegistrationsClient struct { + BaseClient +} + +// NewProviderRegistrationsClient creates an instance of the ProviderRegistrationsClient client. +func NewProviderRegistrationsClient(subscriptionID string) ProviderRegistrationsClient { + return NewProviderRegistrationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProviderRegistrationsClientWithBaseURI creates an instance of the ProviderRegistrationsClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewProviderRegistrationsClientWithBaseURI(baseURI string, subscriptionID string) ProviderRegistrationsClient { + return ProviderRegistrationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates the provider registration. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// properties - the provider registration properties supplied to the CreateOrUpdate operation. +func (client ProviderRegistrationsClient) CreateOrUpdate(ctx context.Context, providerNamespace string, properties ProviderRegistration) (result ProviderRegistrationsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderRegistrationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.ProviderRegistrationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, providerNamespace, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "CreateOrUpdate", nil, "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ProviderRegistrationsClient) CreateOrUpdatePreparer(ctx context.Context, providerNamespace string, properties ProviderRegistration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}", pathParameters), + autorest.WithJSON(properties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderRegistrationsClient) CreateOrUpdateSender(req *http.Request) (future ProviderRegistrationsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ProviderRegistrationsClient) CreateOrUpdateResponder(resp *http.Response) (result ProviderRegistration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a provider registration. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +func (client ProviderRegistrationsClient) Delete(ctx context.Context, providerNamespace string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderRegistrationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.ProviderRegistrationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, providerNamespace) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ProviderRegistrationsClient) DeletePreparer(ctx context.Context, providerNamespace string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderRegistrationsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ProviderRegistrationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GenerateOperations generates the operations api for the given provider. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +func (client ProviderRegistrationsClient) GenerateOperations(ctx context.Context, providerNamespace string) (result ListOperationsDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderRegistrationsClient.GenerateOperations") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.ProviderRegistrationsClient", "GenerateOperations", err.Error()) + } + + req, err := client.GenerateOperationsPreparer(ctx, providerNamespace) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "GenerateOperations", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateOperationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "GenerateOperations", resp, "Failure sending request") + return + } + + result, err = client.GenerateOperationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "GenerateOperations", resp, "Failure responding to request") + return + } + + return +} + +// GenerateOperationsPreparer prepares the GenerateOperations request. +func (client ProviderRegistrationsClient) GenerateOperationsPreparer(ctx context.Context, providerNamespace string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/generateOperations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateOperationsSender sends the GenerateOperations request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderRegistrationsClient) GenerateOperationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GenerateOperationsResponder handles the response to the GenerateOperations request. The method always +// closes the http.Response Body. +func (client ProviderRegistrationsClient) GenerateOperationsResponder(resp *http.Response) (result ListOperationsDefinition, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the provider registration details. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +func (client ProviderRegistrationsClient) Get(ctx context.Context, providerNamespace string) (result ProviderRegistration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderRegistrationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.ProviderRegistrationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, providerNamespace) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProviderRegistrationsClient) GetPreparer(ctx context.Context, providerNamespace string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderRegistrationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProviderRegistrationsClient) GetResponder(resp *http.Response) (result ProviderRegistration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of the provider registrations in the subscription. +func (client ProviderRegistrationsClient) List(ctx context.Context) (result ProviderRegistrationArrayResponseWithContinuationPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderRegistrationsClient.List") + defer func() { + sc := -1 + if result.prarwc.Response.Response != nil { + sc = result.prarwc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.ProviderRegistrationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.prarwc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "List", resp, "Failure sending request") + return + } + + result.prarwc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "List", resp, "Failure responding to request") + return + } + if result.prarwc.hasNextLink() && result.prarwc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ProviderRegistrationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderRegistrationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ProviderRegistrationsClient) ListResponder(resp *http.Response) (result ProviderRegistrationArrayResponseWithContinuation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ProviderRegistrationsClient) listNextResults(ctx context.Context, lastResults ProviderRegistrationArrayResponseWithContinuation) (result ProviderRegistrationArrayResponseWithContinuation, err error) { + req, err := lastResults.providerRegistrationArrayResponseWithContinuationPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ProviderRegistrationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProviderRegistrationsClient) ListComplete(ctx context.Context) (result ProviderRegistrationArrayResponseWithContinuationIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderRegistrationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/providerhub/mgmt/2020-11-20/providerhub/resourcetyperegistrations.go b/services/providerhub/mgmt/2020-11-20/providerhub/resourcetyperegistrations.go new file mode 100644 index 000000000000..8432d85c324c --- /dev/null +++ b/services/providerhub/mgmt/2020-11-20/providerhub/resourcetyperegistrations.go @@ -0,0 +1,406 @@ +package providerhub + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ResourceTypeRegistrationsClient is the microsoft ProviderHub +type ResourceTypeRegistrationsClient struct { + BaseClient +} + +// NewResourceTypeRegistrationsClient creates an instance of the ResourceTypeRegistrationsClient client. +func NewResourceTypeRegistrationsClient(subscriptionID string) ResourceTypeRegistrationsClient { + return NewResourceTypeRegistrationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceTypeRegistrationsClientWithBaseURI creates an instance of the ResourceTypeRegistrationsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewResourceTypeRegistrationsClientWithBaseURI(baseURI string, subscriptionID string) ResourceTypeRegistrationsClient { + return ResourceTypeRegistrationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a resource type. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// properties - the required request body parameters supplied to the resource type registration CreateOrUpdate +// operation. +func (client ResourceTypeRegistrationsClient) CreateOrUpdate(ctx context.Context, providerNamespace string, resourceType string, properties ResourceTypeRegistration) (result ResourceTypeRegistrationsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceTypeRegistrationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.ResourceTypeRegistrationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, providerNamespace, resourceType, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsClient", "CreateOrUpdate", nil, "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ResourceTypeRegistrationsClient) CreateOrUpdatePreparer(ctx context.Context, providerNamespace string, resourceType string, properties ResourceTypeRegistration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}", pathParameters), + autorest.WithJSON(properties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceTypeRegistrationsClient) CreateOrUpdateSender(req *http.Request) (future ResourceTypeRegistrationsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ResourceTypeRegistrationsClient) CreateOrUpdateResponder(resp *http.Response) (result ResourceTypeRegistration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a resource type +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +func (client ResourceTypeRegistrationsClient) Delete(ctx context.Context, providerNamespace string, resourceType string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceTypeRegistrationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.ResourceTypeRegistrationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, providerNamespace, resourceType) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ResourceTypeRegistrationsClient) DeletePreparer(ctx context.Context, providerNamespace string, resourceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceTypeRegistrationsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ResourceTypeRegistrationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a resource type details in the given subscription and provider. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +func (client ResourceTypeRegistrationsClient) Get(ctx context.Context, providerNamespace string, resourceType string) (result ResourceTypeRegistration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceTypeRegistrationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.ResourceTypeRegistrationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, providerNamespace, resourceType) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ResourceTypeRegistrationsClient) GetPreparer(ctx context.Context, providerNamespace string, resourceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceTypeRegistrationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ResourceTypeRegistrationsClient) GetResponder(resp *http.Response) (result ResourceTypeRegistration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByProviderRegistration gets the list of the resource types for the given provider. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +func (client ResourceTypeRegistrationsClient) ListByProviderRegistration(ctx context.Context, providerNamespace string) (result ResourceTypeRegistrationArrayResponseWithContinuationPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceTypeRegistrationsClient.ListByProviderRegistration") + defer func() { + sc := -1 + if result.rtrarwc.Response.Response != nil { + sc = result.rtrarwc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.ResourceTypeRegistrationsClient", "ListByProviderRegistration", err.Error()) + } + + result.fn = client.listByProviderRegistrationNextResults + req, err := client.ListByProviderRegistrationPreparer(ctx, providerNamespace) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsClient", "ListByProviderRegistration", nil, "Failure preparing request") + return + } + + resp, err := client.ListByProviderRegistrationSender(req) + if err != nil { + result.rtrarwc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsClient", "ListByProviderRegistration", resp, "Failure sending request") + return + } + + result.rtrarwc, err = client.ListByProviderRegistrationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsClient", "ListByProviderRegistration", resp, "Failure responding to request") + return + } + if result.rtrarwc.hasNextLink() && result.rtrarwc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByProviderRegistrationPreparer prepares the ListByProviderRegistration request. +func (client ResourceTypeRegistrationsClient) ListByProviderRegistrationPreparer(ctx context.Context, providerNamespace string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByProviderRegistrationSender sends the ListByProviderRegistration request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceTypeRegistrationsClient) ListByProviderRegistrationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByProviderRegistrationResponder handles the response to the ListByProviderRegistration request. The method always +// closes the http.Response Body. +func (client ResourceTypeRegistrationsClient) ListByProviderRegistrationResponder(resp *http.Response) (result ResourceTypeRegistrationArrayResponseWithContinuation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByProviderRegistrationNextResults retrieves the next set of results, if any. +func (client ResourceTypeRegistrationsClient) listByProviderRegistrationNextResults(ctx context.Context, lastResults ResourceTypeRegistrationArrayResponseWithContinuation) (result ResourceTypeRegistrationArrayResponseWithContinuation, err error) { + req, err := lastResults.resourceTypeRegistrationArrayResponseWithContinuationPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsClient", "listByProviderRegistrationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByProviderRegistrationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsClient", "listByProviderRegistrationNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByProviderRegistrationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.ResourceTypeRegistrationsClient", "listByProviderRegistrationNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByProviderRegistrationComplete enumerates all values, automatically crossing page boundaries as required. +func (client ResourceTypeRegistrationsClient) ListByProviderRegistrationComplete(ctx context.Context, providerNamespace string) (result ResourceTypeRegistrationArrayResponseWithContinuationIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceTypeRegistrationsClient.ListByProviderRegistration") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByProviderRegistration(ctx, providerNamespace) + return +} diff --git a/services/providerhub/mgmt/2020-11-20/providerhub/skus.go b/services/providerhub/mgmt/2020-11-20/providerhub/skus.go new file mode 100644 index 000000000000..6bb9fa8ae94f --- /dev/null +++ b/services/providerhub/mgmt/2020-11-20/providerhub/skus.go @@ -0,0 +1,1600 @@ +package providerhub + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SkusClient is the microsoft ProviderHub +type SkusClient struct { + BaseClient +} + +// NewSkusClient creates an instance of the SkusClient client. +func NewSkusClient(subscriptionID string) SkusClient { + return NewSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSkusClientWithBaseURI creates an instance of the SkusClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient { + return SkusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates the resource type skus in the given resource type. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// sku - the SKU. +// properties - the required body parameters supplied to the resource sku operation. +func (client SkusClient) CreateOrUpdate(ctx context.Context, providerNamespace string, resourceType string, sku string, properties ResourceTypeSku) (result SkuResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: properties, + Constraints: []validation.Constraint{{Target: "properties.SkuSettings", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, providerNamespace, resourceType, sku, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SkusClient) CreateOrUpdatePreparer(ctx context.Context, providerNamespace string, resourceType string, sku string, properties ResourceTypeSku) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "sku": autorest.Encode("path", sku), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}", pathParameters), + autorest.WithJSON(properties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SkusClient) CreateOrUpdateResponder(resp *http.Response) (result SkuResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateNestedResourceTypeFirst creates or updates the resource type skus in the given resource type. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// nestedResourceTypeFirst - the first child resource type. +// sku - the SKU. +// properties - the required body parameters supplied to the resource sku operation. +func (client SkusClient) CreateOrUpdateNestedResourceTypeFirst(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string, properties ResourceTypeSku) (result SkuResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.CreateOrUpdateNestedResourceTypeFirst") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: properties, + Constraints: []validation.Constraint{{Target: "properties.SkuSettings", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "CreateOrUpdateNestedResourceTypeFirst", err.Error()) + } + + req, err := client.CreateOrUpdateNestedResourceTypeFirstPreparer(ctx, providerNamespace, resourceType, nestedResourceTypeFirst, sku, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "CreateOrUpdateNestedResourceTypeFirst", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateNestedResourceTypeFirstSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "CreateOrUpdateNestedResourceTypeFirst", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateNestedResourceTypeFirstResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "CreateOrUpdateNestedResourceTypeFirst", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateNestedResourceTypeFirstPreparer prepares the CreateOrUpdateNestedResourceTypeFirst request. +func (client SkusClient) CreateOrUpdateNestedResourceTypeFirstPreparer(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string, properties ResourceTypeSku) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nestedResourceTypeFirst": autorest.Encode("path", nestedResourceTypeFirst), + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "sku": autorest.Encode("path", sku), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}", pathParameters), + autorest.WithJSON(properties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateNestedResourceTypeFirstSender sends the CreateOrUpdateNestedResourceTypeFirst request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) CreateOrUpdateNestedResourceTypeFirstSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateNestedResourceTypeFirstResponder handles the response to the CreateOrUpdateNestedResourceTypeFirst request. The method always +// closes the http.Response Body. +func (client SkusClient) CreateOrUpdateNestedResourceTypeFirstResponder(resp *http.Response) (result SkuResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateNestedResourceTypeSecond creates or updates the resource type skus in the given resource type. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// nestedResourceTypeFirst - the first child resource type. +// nestedResourceTypeSecond - the second child resource type. +// sku - the SKU. +// properties - the required body parameters supplied to the resource sku operation. +func (client SkusClient) CreateOrUpdateNestedResourceTypeSecond(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string, properties ResourceTypeSku) (result SkuResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.CreateOrUpdateNestedResourceTypeSecond") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: properties, + Constraints: []validation.Constraint{{Target: "properties.SkuSettings", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "CreateOrUpdateNestedResourceTypeSecond", err.Error()) + } + + req, err := client.CreateOrUpdateNestedResourceTypeSecondPreparer(ctx, providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "CreateOrUpdateNestedResourceTypeSecond", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateNestedResourceTypeSecondSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "CreateOrUpdateNestedResourceTypeSecond", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateNestedResourceTypeSecondResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "CreateOrUpdateNestedResourceTypeSecond", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateNestedResourceTypeSecondPreparer prepares the CreateOrUpdateNestedResourceTypeSecond request. +func (client SkusClient) CreateOrUpdateNestedResourceTypeSecondPreparer(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string, properties ResourceTypeSku) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nestedResourceTypeFirst": autorest.Encode("path", nestedResourceTypeFirst), + "nestedResourceTypeSecond": autorest.Encode("path", nestedResourceTypeSecond), + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "sku": autorest.Encode("path", sku), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}", pathParameters), + autorest.WithJSON(properties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateNestedResourceTypeSecondSender sends the CreateOrUpdateNestedResourceTypeSecond request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) CreateOrUpdateNestedResourceTypeSecondSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateNestedResourceTypeSecondResponder handles the response to the CreateOrUpdateNestedResourceTypeSecond request. The method always +// closes the http.Response Body. +func (client SkusClient) CreateOrUpdateNestedResourceTypeSecondResponder(resp *http.Response) (result SkuResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateNestedResourceTypeThird creates or updates the resource type skus in the given resource type. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// nestedResourceTypeFirst - the first child resource type. +// nestedResourceTypeSecond - the second child resource type. +// nestedResourceTypeThird - the third child resource type. +// sku - the SKU. +// properties - the required body parameters supplied to the resource sku operation. +func (client SkusClient) CreateOrUpdateNestedResourceTypeThird(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string, properties ResourceTypeSku) (result SkuResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.CreateOrUpdateNestedResourceTypeThird") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: properties, + Constraints: []validation.Constraint{{Target: "properties.SkuSettings", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "CreateOrUpdateNestedResourceTypeThird", err.Error()) + } + + req, err := client.CreateOrUpdateNestedResourceTypeThirdPreparer(ctx, providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, nestedResourceTypeThird, sku, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "CreateOrUpdateNestedResourceTypeThird", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateNestedResourceTypeThirdSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "CreateOrUpdateNestedResourceTypeThird", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateNestedResourceTypeThirdResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "CreateOrUpdateNestedResourceTypeThird", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateNestedResourceTypeThirdPreparer prepares the CreateOrUpdateNestedResourceTypeThird request. +func (client SkusClient) CreateOrUpdateNestedResourceTypeThirdPreparer(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string, properties ResourceTypeSku) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nestedResourceTypeFirst": autorest.Encode("path", nestedResourceTypeFirst), + "nestedResourceTypeSecond": autorest.Encode("path", nestedResourceTypeSecond), + "nestedResourceTypeThird": autorest.Encode("path", nestedResourceTypeThird), + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "sku": autorest.Encode("path", sku), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}", pathParameters), + autorest.WithJSON(properties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateNestedResourceTypeThirdSender sends the CreateOrUpdateNestedResourceTypeThird request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) CreateOrUpdateNestedResourceTypeThirdSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateNestedResourceTypeThirdResponder handles the response to the CreateOrUpdateNestedResourceTypeThird request. The method always +// closes the http.Response Body. +func (client SkusClient) CreateOrUpdateNestedResourceTypeThirdResponder(resp *http.Response) (result SkuResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a resource type sku. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// sku - the SKU. +func (client SkusClient) Delete(ctx context.Context, providerNamespace string, resourceType string, sku string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, providerNamespace, resourceType, sku) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SkusClient) DeletePreparer(ctx context.Context, providerNamespace string, resourceType string, sku string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "sku": autorest.Encode("path", sku), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SkusClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteNestedResourceTypeFirst deletes a resource type sku. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// nestedResourceTypeFirst - the first child resource type. +// sku - the SKU. +func (client SkusClient) DeleteNestedResourceTypeFirst(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.DeleteNestedResourceTypeFirst") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "DeleteNestedResourceTypeFirst", err.Error()) + } + + req, err := client.DeleteNestedResourceTypeFirstPreparer(ctx, providerNamespace, resourceType, nestedResourceTypeFirst, sku) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "DeleteNestedResourceTypeFirst", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteNestedResourceTypeFirstSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "DeleteNestedResourceTypeFirst", resp, "Failure sending request") + return + } + + result, err = client.DeleteNestedResourceTypeFirstResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "DeleteNestedResourceTypeFirst", resp, "Failure responding to request") + return + } + + return +} + +// DeleteNestedResourceTypeFirstPreparer prepares the DeleteNestedResourceTypeFirst request. +func (client SkusClient) DeleteNestedResourceTypeFirstPreparer(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nestedResourceTypeFirst": autorest.Encode("path", nestedResourceTypeFirst), + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "sku": autorest.Encode("path", sku), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteNestedResourceTypeFirstSender sends the DeleteNestedResourceTypeFirst request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) DeleteNestedResourceTypeFirstSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteNestedResourceTypeFirstResponder handles the response to the DeleteNestedResourceTypeFirst request. The method always +// closes the http.Response Body. +func (client SkusClient) DeleteNestedResourceTypeFirstResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteNestedResourceTypeSecond deletes a resource type sku. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// nestedResourceTypeFirst - the first child resource type. +// nestedResourceTypeSecond - the second child resource type. +// sku - the SKU. +func (client SkusClient) DeleteNestedResourceTypeSecond(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.DeleteNestedResourceTypeSecond") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "DeleteNestedResourceTypeSecond", err.Error()) + } + + req, err := client.DeleteNestedResourceTypeSecondPreparer(ctx, providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "DeleteNestedResourceTypeSecond", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteNestedResourceTypeSecondSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "DeleteNestedResourceTypeSecond", resp, "Failure sending request") + return + } + + result, err = client.DeleteNestedResourceTypeSecondResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "DeleteNestedResourceTypeSecond", resp, "Failure responding to request") + return + } + + return +} + +// DeleteNestedResourceTypeSecondPreparer prepares the DeleteNestedResourceTypeSecond request. +func (client SkusClient) DeleteNestedResourceTypeSecondPreparer(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nestedResourceTypeFirst": autorest.Encode("path", nestedResourceTypeFirst), + "nestedResourceTypeSecond": autorest.Encode("path", nestedResourceTypeSecond), + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "sku": autorest.Encode("path", sku), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteNestedResourceTypeSecondSender sends the DeleteNestedResourceTypeSecond request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) DeleteNestedResourceTypeSecondSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteNestedResourceTypeSecondResponder handles the response to the DeleteNestedResourceTypeSecond request. The method always +// closes the http.Response Body. +func (client SkusClient) DeleteNestedResourceTypeSecondResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteNestedResourceTypeThird deletes a resource type sku. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// nestedResourceTypeFirst - the first child resource type. +// nestedResourceTypeSecond - the second child resource type. +// nestedResourceTypeThird - the third child resource type. +// sku - the SKU. +func (client SkusClient) DeleteNestedResourceTypeThird(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.DeleteNestedResourceTypeThird") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "DeleteNestedResourceTypeThird", err.Error()) + } + + req, err := client.DeleteNestedResourceTypeThirdPreparer(ctx, providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, nestedResourceTypeThird, sku) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "DeleteNestedResourceTypeThird", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteNestedResourceTypeThirdSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "DeleteNestedResourceTypeThird", resp, "Failure sending request") + return + } + + result, err = client.DeleteNestedResourceTypeThirdResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "DeleteNestedResourceTypeThird", resp, "Failure responding to request") + return + } + + return +} + +// DeleteNestedResourceTypeThirdPreparer prepares the DeleteNestedResourceTypeThird request. +func (client SkusClient) DeleteNestedResourceTypeThirdPreparer(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nestedResourceTypeFirst": autorest.Encode("path", nestedResourceTypeFirst), + "nestedResourceTypeSecond": autorest.Encode("path", nestedResourceTypeSecond), + "nestedResourceTypeThird": autorest.Encode("path", nestedResourceTypeThird), + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "sku": autorest.Encode("path", sku), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteNestedResourceTypeThirdSender sends the DeleteNestedResourceTypeThird request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) DeleteNestedResourceTypeThirdSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteNestedResourceTypeThirdResponder handles the response to the DeleteNestedResourceTypeThird request. The method always +// closes the http.Response Body. +func (client SkusClient) DeleteNestedResourceTypeThirdResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the sku details for the given resource type and sku name. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// sku - the SKU. +func (client SkusClient) Get(ctx context.Context, providerNamespace string, resourceType string, sku string) (result SkuResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, providerNamespace, resourceType, sku) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SkusClient) GetPreparer(ctx context.Context, providerNamespace string, resourceType string, sku string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "sku": autorest.Encode("path", sku), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus/{sku}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SkusClient) GetResponder(resp *http.Response) (result SkuResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetNestedResourceTypeFirst gets the sku details for the given resource type and sku name. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// nestedResourceTypeFirst - the first child resource type. +// sku - the SKU. +func (client SkusClient) GetNestedResourceTypeFirst(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string) (result SkuResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.GetNestedResourceTypeFirst") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "GetNestedResourceTypeFirst", err.Error()) + } + + req, err := client.GetNestedResourceTypeFirstPreparer(ctx, providerNamespace, resourceType, nestedResourceTypeFirst, sku) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "GetNestedResourceTypeFirst", nil, "Failure preparing request") + return + } + + resp, err := client.GetNestedResourceTypeFirstSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "GetNestedResourceTypeFirst", resp, "Failure sending request") + return + } + + result, err = client.GetNestedResourceTypeFirstResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "GetNestedResourceTypeFirst", resp, "Failure responding to request") + return + } + + return +} + +// GetNestedResourceTypeFirstPreparer prepares the GetNestedResourceTypeFirst request. +func (client SkusClient) GetNestedResourceTypeFirstPreparer(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, sku string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nestedResourceTypeFirst": autorest.Encode("path", nestedResourceTypeFirst), + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "sku": autorest.Encode("path", sku), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus/{sku}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetNestedResourceTypeFirstSender sends the GetNestedResourceTypeFirst request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) GetNestedResourceTypeFirstSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetNestedResourceTypeFirstResponder handles the response to the GetNestedResourceTypeFirst request. The method always +// closes the http.Response Body. +func (client SkusClient) GetNestedResourceTypeFirstResponder(resp *http.Response) (result SkuResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetNestedResourceTypeSecond gets the sku details for the given resource type and sku name. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// nestedResourceTypeFirst - the first child resource type. +// nestedResourceTypeSecond - the second child resource type. +// sku - the SKU. +func (client SkusClient) GetNestedResourceTypeSecond(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string) (result SkuResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.GetNestedResourceTypeSecond") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "GetNestedResourceTypeSecond", err.Error()) + } + + req, err := client.GetNestedResourceTypeSecondPreparer(ctx, providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "GetNestedResourceTypeSecond", nil, "Failure preparing request") + return + } + + resp, err := client.GetNestedResourceTypeSecondSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "GetNestedResourceTypeSecond", resp, "Failure sending request") + return + } + + result, err = client.GetNestedResourceTypeSecondResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "GetNestedResourceTypeSecond", resp, "Failure responding to request") + return + } + + return +} + +// GetNestedResourceTypeSecondPreparer prepares the GetNestedResourceTypeSecond request. +func (client SkusClient) GetNestedResourceTypeSecondPreparer(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, sku string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nestedResourceTypeFirst": autorest.Encode("path", nestedResourceTypeFirst), + "nestedResourceTypeSecond": autorest.Encode("path", nestedResourceTypeSecond), + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "sku": autorest.Encode("path", sku), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetNestedResourceTypeSecondSender sends the GetNestedResourceTypeSecond request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) GetNestedResourceTypeSecondSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetNestedResourceTypeSecondResponder handles the response to the GetNestedResourceTypeSecond request. The method always +// closes the http.Response Body. +func (client SkusClient) GetNestedResourceTypeSecondResponder(resp *http.Response) (result SkuResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetNestedResourceTypeThird gets the sku details for the given resource type and sku name. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// nestedResourceTypeFirst - the first child resource type. +// nestedResourceTypeSecond - the second child resource type. +// nestedResourceTypeThird - the third child resource type. +// sku - the SKU. +func (client SkusClient) GetNestedResourceTypeThird(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string) (result SkuResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.GetNestedResourceTypeThird") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "GetNestedResourceTypeThird", err.Error()) + } + + req, err := client.GetNestedResourceTypeThirdPreparer(ctx, providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, nestedResourceTypeThird, sku) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "GetNestedResourceTypeThird", nil, "Failure preparing request") + return + } + + resp, err := client.GetNestedResourceTypeThirdSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "GetNestedResourceTypeThird", resp, "Failure sending request") + return + } + + result, err = client.GetNestedResourceTypeThirdResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "GetNestedResourceTypeThird", resp, "Failure responding to request") + return + } + + return +} + +// GetNestedResourceTypeThirdPreparer prepares the GetNestedResourceTypeThird request. +func (client SkusClient) GetNestedResourceTypeThirdPreparer(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string, sku string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nestedResourceTypeFirst": autorest.Encode("path", nestedResourceTypeFirst), + "nestedResourceTypeSecond": autorest.Encode("path", nestedResourceTypeSecond), + "nestedResourceTypeThird": autorest.Encode("path", nestedResourceTypeThird), + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "sku": autorest.Encode("path", sku), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus/{sku}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetNestedResourceTypeThirdSender sends the GetNestedResourceTypeThird request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) GetNestedResourceTypeThirdSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetNestedResourceTypeThirdResponder handles the response to the GetNestedResourceTypeThird request. The method always +// closes the http.Response Body. +func (client SkusClient) GetNestedResourceTypeThirdResponder(resp *http.Response) (result SkuResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceTypeRegistrations gets the list of skus for the given resource type. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +func (client SkusClient) ListByResourceTypeRegistrations(ctx context.Context, providerNamespace string, resourceType string) (result SkuResourceArrayResponseWithContinuationPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.ListByResourceTypeRegistrations") + defer func() { + sc := -1 + if result.srarwc.Response.Response != nil { + sc = result.srarwc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "ListByResourceTypeRegistrations", err.Error()) + } + + result.fn = client.listByResourceTypeRegistrationsNextResults + req, err := client.ListByResourceTypeRegistrationsPreparer(ctx, providerNamespace, resourceType) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "ListByResourceTypeRegistrations", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceTypeRegistrationsSender(req) + if err != nil { + result.srarwc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "ListByResourceTypeRegistrations", resp, "Failure sending request") + return + } + + result.srarwc, err = client.ListByResourceTypeRegistrationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "ListByResourceTypeRegistrations", resp, "Failure responding to request") + return + } + if result.srarwc.hasNextLink() && result.srarwc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceTypeRegistrationsPreparer prepares the ListByResourceTypeRegistrations request. +func (client SkusClient) ListByResourceTypeRegistrationsPreparer(ctx context.Context, providerNamespace string, resourceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceTypeRegistrationsSender sends the ListByResourceTypeRegistrations request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) ListByResourceTypeRegistrationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceTypeRegistrationsResponder handles the response to the ListByResourceTypeRegistrations request. The method always +// closes the http.Response Body. +func (client SkusClient) ListByResourceTypeRegistrationsResponder(resp *http.Response) (result SkuResourceArrayResponseWithContinuation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceTypeRegistrationsNextResults retrieves the next set of results, if any. +func (client SkusClient) listByResourceTypeRegistrationsNextResults(ctx context.Context, lastResults SkuResourceArrayResponseWithContinuation) (result SkuResourceArrayResponseWithContinuation, err error) { + req, err := lastResults.skuResourceArrayResponseWithContinuationPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "providerhub.SkusClient", "listByResourceTypeRegistrationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceTypeRegistrationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "providerhub.SkusClient", "listByResourceTypeRegistrationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceTypeRegistrationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "listByResourceTypeRegistrationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceTypeRegistrationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client SkusClient) ListByResourceTypeRegistrationsComplete(ctx context.Context, providerNamespace string, resourceType string) (result SkuResourceArrayResponseWithContinuationIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.ListByResourceTypeRegistrations") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceTypeRegistrations(ctx, providerNamespace, resourceType) + return +} + +// ListByResourceTypeRegistrationsNestedResourceTypeFirst gets the list of skus for the given resource type. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// nestedResourceTypeFirst - the first child resource type. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeFirst(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string) (result SkuResourceArrayResponseWithContinuationPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.ListByResourceTypeRegistrationsNestedResourceTypeFirst") + defer func() { + sc := -1 + if result.srarwc.Response.Response != nil { + sc = result.srarwc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "ListByResourceTypeRegistrationsNestedResourceTypeFirst", err.Error()) + } + + result.fn = client.listByResourceTypeRegistrationsNestedResourceTypeFirstNextResults + req, err := client.ListByResourceTypeRegistrationsNestedResourceTypeFirstPreparer(ctx, providerNamespace, resourceType, nestedResourceTypeFirst) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "ListByResourceTypeRegistrationsNestedResourceTypeFirst", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceTypeRegistrationsNestedResourceTypeFirstSender(req) + if err != nil { + result.srarwc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "ListByResourceTypeRegistrationsNestedResourceTypeFirst", resp, "Failure sending request") + return + } + + result.srarwc, err = client.ListByResourceTypeRegistrationsNestedResourceTypeFirstResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "ListByResourceTypeRegistrationsNestedResourceTypeFirst", resp, "Failure responding to request") + return + } + if result.srarwc.hasNextLink() && result.srarwc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceTypeRegistrationsNestedResourceTypeFirstPreparer prepares the ListByResourceTypeRegistrationsNestedResourceTypeFirst request. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeFirstPreparer(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nestedResourceTypeFirst": autorest.Encode("path", nestedResourceTypeFirst), + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceTypeRegistrationsNestedResourceTypeFirstSender sends the ListByResourceTypeRegistrationsNestedResourceTypeFirst request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeFirstSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceTypeRegistrationsNestedResourceTypeFirstResponder handles the response to the ListByResourceTypeRegistrationsNestedResourceTypeFirst request. The method always +// closes the http.Response Body. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeFirstResponder(resp *http.Response) (result SkuResourceArrayResponseWithContinuation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceTypeRegistrationsNestedResourceTypeFirstNextResults retrieves the next set of results, if any. +func (client SkusClient) listByResourceTypeRegistrationsNestedResourceTypeFirstNextResults(ctx context.Context, lastResults SkuResourceArrayResponseWithContinuation) (result SkuResourceArrayResponseWithContinuation, err error) { + req, err := lastResults.skuResourceArrayResponseWithContinuationPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "providerhub.SkusClient", "listByResourceTypeRegistrationsNestedResourceTypeFirstNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceTypeRegistrationsNestedResourceTypeFirstSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "providerhub.SkusClient", "listByResourceTypeRegistrationsNestedResourceTypeFirstNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceTypeRegistrationsNestedResourceTypeFirstResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "listByResourceTypeRegistrationsNestedResourceTypeFirstNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceTypeRegistrationsNestedResourceTypeFirstComplete enumerates all values, automatically crossing page boundaries as required. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeFirstComplete(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string) (result SkuResourceArrayResponseWithContinuationIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.ListByResourceTypeRegistrationsNestedResourceTypeFirst") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceTypeRegistrationsNestedResourceTypeFirst(ctx, providerNamespace, resourceType, nestedResourceTypeFirst) + return +} + +// ListByResourceTypeRegistrationsNestedResourceTypeSecond gets the list of skus for the given resource type. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// nestedResourceTypeFirst - the first child resource type. +// nestedResourceTypeSecond - the second child resource type. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeSecond(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string) (result SkuResourceArrayResponseWithContinuationPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.ListByResourceTypeRegistrationsNestedResourceTypeSecond") + defer func() { + sc := -1 + if result.srarwc.Response.Response != nil { + sc = result.srarwc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "ListByResourceTypeRegistrationsNestedResourceTypeSecond", err.Error()) + } + + result.fn = client.listByResourceTypeRegistrationsNestedResourceTypeSecondNextResults + req, err := client.ListByResourceTypeRegistrationsNestedResourceTypeSecondPreparer(ctx, providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "ListByResourceTypeRegistrationsNestedResourceTypeSecond", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceTypeRegistrationsNestedResourceTypeSecondSender(req) + if err != nil { + result.srarwc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "ListByResourceTypeRegistrationsNestedResourceTypeSecond", resp, "Failure sending request") + return + } + + result.srarwc, err = client.ListByResourceTypeRegistrationsNestedResourceTypeSecondResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "ListByResourceTypeRegistrationsNestedResourceTypeSecond", resp, "Failure responding to request") + return + } + if result.srarwc.hasNextLink() && result.srarwc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceTypeRegistrationsNestedResourceTypeSecondPreparer prepares the ListByResourceTypeRegistrationsNestedResourceTypeSecond request. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeSecondPreparer(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nestedResourceTypeFirst": autorest.Encode("path", nestedResourceTypeFirst), + "nestedResourceTypeSecond": autorest.Encode("path", nestedResourceTypeSecond), + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceTypeRegistrationsNestedResourceTypeSecondSender sends the ListByResourceTypeRegistrationsNestedResourceTypeSecond request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeSecondSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceTypeRegistrationsNestedResourceTypeSecondResponder handles the response to the ListByResourceTypeRegistrationsNestedResourceTypeSecond request. The method always +// closes the http.Response Body. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeSecondResponder(resp *http.Response) (result SkuResourceArrayResponseWithContinuation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceTypeRegistrationsNestedResourceTypeSecondNextResults retrieves the next set of results, if any. +func (client SkusClient) listByResourceTypeRegistrationsNestedResourceTypeSecondNextResults(ctx context.Context, lastResults SkuResourceArrayResponseWithContinuation) (result SkuResourceArrayResponseWithContinuation, err error) { + req, err := lastResults.skuResourceArrayResponseWithContinuationPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "providerhub.SkusClient", "listByResourceTypeRegistrationsNestedResourceTypeSecondNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceTypeRegistrationsNestedResourceTypeSecondSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "providerhub.SkusClient", "listByResourceTypeRegistrationsNestedResourceTypeSecondNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceTypeRegistrationsNestedResourceTypeSecondResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "listByResourceTypeRegistrationsNestedResourceTypeSecondNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceTypeRegistrationsNestedResourceTypeSecondComplete enumerates all values, automatically crossing page boundaries as required. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeSecondComplete(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string) (result SkuResourceArrayResponseWithContinuationIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.ListByResourceTypeRegistrationsNestedResourceTypeSecond") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceTypeRegistrationsNestedResourceTypeSecond(ctx, providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond) + return +} + +// ListByResourceTypeRegistrationsNestedResourceTypeThird gets the list of skus for the given resource type. +// Parameters: +// providerNamespace - the name of the resource provider hosted within ProviderHub. +// resourceType - the resource type. +// nestedResourceTypeFirst - the first child resource type. +// nestedResourceTypeSecond - the second child resource type. +// nestedResourceTypeThird - the third child resource type. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeThird(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string) (result SkuResourceArrayResponseWithContinuationPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.ListByResourceTypeRegistrationsNestedResourceTypeThird") + defer func() { + sc := -1 + if result.srarwc.Response.Response != nil { + sc = result.srarwc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("providerhub.SkusClient", "ListByResourceTypeRegistrationsNestedResourceTypeThird", err.Error()) + } + + result.fn = client.listByResourceTypeRegistrationsNestedResourceTypeThirdNextResults + req, err := client.ListByResourceTypeRegistrationsNestedResourceTypeThirdPreparer(ctx, providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, nestedResourceTypeThird) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "ListByResourceTypeRegistrationsNestedResourceTypeThird", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceTypeRegistrationsNestedResourceTypeThirdSender(req) + if err != nil { + result.srarwc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "ListByResourceTypeRegistrationsNestedResourceTypeThird", resp, "Failure sending request") + return + } + + result.srarwc, err = client.ListByResourceTypeRegistrationsNestedResourceTypeThirdResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "ListByResourceTypeRegistrationsNestedResourceTypeThird", resp, "Failure responding to request") + return + } + if result.srarwc.hasNextLink() && result.srarwc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceTypeRegistrationsNestedResourceTypeThirdPreparer prepares the ListByResourceTypeRegistrationsNestedResourceTypeThird request. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeThirdPreparer(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nestedResourceTypeFirst": autorest.Encode("path", nestedResourceTypeFirst), + "nestedResourceTypeSecond": autorest.Encode("path", nestedResourceTypeSecond), + "nestedResourceTypeThird": autorest.Encode("path", nestedResourceTypeThird), + "providerNamespace": autorest.Encode("path", providerNamespace), + "resourceType": autorest.Encode("path", resourceType), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-20" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations/{nestedResourceTypeThird}/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceTypeRegistrationsNestedResourceTypeThirdSender sends the ListByResourceTypeRegistrationsNestedResourceTypeThird request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeThirdSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceTypeRegistrationsNestedResourceTypeThirdResponder handles the response to the ListByResourceTypeRegistrationsNestedResourceTypeThird request. The method always +// closes the http.Response Body. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeThirdResponder(resp *http.Response) (result SkuResourceArrayResponseWithContinuation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceTypeRegistrationsNestedResourceTypeThirdNextResults retrieves the next set of results, if any. +func (client SkusClient) listByResourceTypeRegistrationsNestedResourceTypeThirdNextResults(ctx context.Context, lastResults SkuResourceArrayResponseWithContinuation) (result SkuResourceArrayResponseWithContinuation, err error) { + req, err := lastResults.skuResourceArrayResponseWithContinuationPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "providerhub.SkusClient", "listByResourceTypeRegistrationsNestedResourceTypeThirdNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceTypeRegistrationsNestedResourceTypeThirdSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "providerhub.SkusClient", "listByResourceTypeRegistrationsNestedResourceTypeThirdNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceTypeRegistrationsNestedResourceTypeThirdResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "providerhub.SkusClient", "listByResourceTypeRegistrationsNestedResourceTypeThirdNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceTypeRegistrationsNestedResourceTypeThirdComplete enumerates all values, automatically crossing page boundaries as required. +func (client SkusClient) ListByResourceTypeRegistrationsNestedResourceTypeThirdComplete(ctx context.Context, providerNamespace string, resourceType string, nestedResourceTypeFirst string, nestedResourceTypeSecond string, nestedResourceTypeThird string) (result SkuResourceArrayResponseWithContinuationIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.ListByResourceTypeRegistrationsNestedResourceTypeThird") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceTypeRegistrationsNestedResourceTypeThird(ctx, providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, nestedResourceTypeThird) + return +} diff --git a/services/providerhub/mgmt/2020-11-20/providerhub/version.go b/services/providerhub/mgmt/2020-11-20/providerhub/version.go new file mode 100644 index 000000000000..c06040f4f752 --- /dev/null +++ b/services/providerhub/mgmt/2020-11-20/providerhub/version.go @@ -0,0 +1,19 @@ +package providerhub + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " providerhub/2020-11-20" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +}