diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/CHANGELOG.md deleted file mode 100644 index 52911e4cc5e4..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/_meta.json deleted file mode 100644 index b09833ee085d..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", - "readme": "/_/azure-rest-api-specs/specification/devspaces/resource-manager/readme.md", - "tag": "package-2019-04-01", - "use": "@microsoft.azure/autorest.go@2.1.187", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2019-04-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/devspaces/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" - } -} \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/client.go deleted file mode 100644 index fb5a59d82306..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/client.go +++ /dev/null @@ -1,41 +0,0 @@ -// Package devspaces implements the Azure ARM Devspaces service API version 2019-04-01. -// -// Dev Spaces Client -package devspaces - -// 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 ( - "github.com/Azure/go-autorest/autorest" -) - -const ( - // DefaultBaseURI is the default URI used for the service Devspaces - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Devspaces. -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, - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/containerhostmappings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/containerhostmappings.go deleted file mode 100644 index 598c7c8dcfd2..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/containerhostmappings.go +++ /dev/null @@ -1,119 +0,0 @@ -package devspaces - -// 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" -) - -// ContainerHostMappingsClient is the dev Spaces Client -type ContainerHostMappingsClient struct { - BaseClient -} - -// NewContainerHostMappingsClient creates an instance of the ContainerHostMappingsClient client. -func NewContainerHostMappingsClient(subscriptionID string) ContainerHostMappingsClient { - return NewContainerHostMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewContainerHostMappingsClientWithBaseURI creates an instance of the ContainerHostMappingsClient 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 NewContainerHostMappingsClientWithBaseURI(baseURI string, subscriptionID string) ContainerHostMappingsClient { - return ContainerHostMappingsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// GetContainerHostMapping sends the get container host mapping request. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// location - location of the container host. -func (client ContainerHostMappingsClient) GetContainerHostMapping(ctx context.Context, containerHostMapping ContainerHostMapping, resourceGroupName string, location string) (result ContainerHostMapping, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerHostMappingsClient.GetContainerHostMapping") - 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ContainerHostMappingsClient", "GetContainerHostMapping", err.Error()) - } - - req, err := client.GetContainerHostMappingPreparer(ctx, containerHostMapping, resourceGroupName, location) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ContainerHostMappingsClient", "GetContainerHostMapping", nil, "Failure preparing request") - return - } - - resp, err := client.GetContainerHostMappingSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ContainerHostMappingsClient", "GetContainerHostMapping", resp, "Failure sending request") - return - } - - result, err = client.GetContainerHostMappingResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ContainerHostMappingsClient", "GetContainerHostMapping", resp, "Failure responding to request") - return - } - - return -} - -// GetContainerHostMappingPreparer prepares the GetContainerHostMapping request. -func (client ContainerHostMappingsClient) GetContainerHostMappingPreparer(ctx context.Context, containerHostMapping ContainerHostMapping, resourceGroupName string, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - containerHostMapping.MappedControllerResourceID = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/locations/{location}/checkContainerHostMapping", pathParameters), - autorest.WithJSON(containerHostMapping), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetContainerHostMappingSender sends the GetContainerHostMapping request. The method will close the -// http.Response Body if it receives an error. -func (client ContainerHostMappingsClient) GetContainerHostMappingSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetContainerHostMappingResponder handles the response to the GetContainerHostMapping request. The method always -// closes the http.Response Body. -func (client ContainerHostMappingsClient) GetContainerHostMappingResponder(resp *http.Response) (result ContainerHostMapping, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/controllers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/controllers.go deleted file mode 100644 index 98bc0851e89c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/controllers.go +++ /dev/null @@ -1,728 +0,0 @@ -package devspaces - -// 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" -) - -// ControllersClient is the dev Spaces Client -type ControllersClient struct { - BaseClient -} - -// NewControllersClient creates an instance of the ControllersClient client. -func NewControllersClient(subscriptionID string) ControllersClient { - return NewControllersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewControllersClientWithBaseURI creates an instance of the ControllersClient 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 NewControllersClientWithBaseURI(baseURI string, subscriptionID string) ControllersClient { - return ControllersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates an Azure Dev Spaces Controller with the specified create parameters. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -// controller - controller create parameters. -func (client ControllersClient) Create(ctx context.Context, resourceGroupName string, name string, controller Controller) (result ControllersCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.Create") - 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]([_-]*[a-zA-Z0-9])*$`, Chain: nil}}}, - {TargetValue: controller, - Constraints: []validation.Constraint{{Target: "controller.ControllerProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "controller.ControllerProperties.TargetContainerHostResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "controller.ControllerProperties.TargetContainerHostCredentialsBase64", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "controller.Sku", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "controller.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, name, controller) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client ControllersClient) CreatePreparer(ctx context.Context, resourceGroupName string, name string, controller Controller) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", pathParameters), - autorest.WithJSON(controller), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client ControllersClient) CreateSender(req *http.Request) (future ControllersCreateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - 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 -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client ControllersClient) CreateResponder(resp *http.Response) (result Controller, 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 an existing Azure Dev Spaces Controller. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -func (client ControllersClient) Delete(ctx context.Context, resourceGroupName string, name string) (result ControllersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.Delete") - 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]([_-]*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, name) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ControllersClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", 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 ControllersClient) DeleteSender(req *http.Request) (future ControllersDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - 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 -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ControllersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the properties for an Azure Dev Spaces Controller. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -func (client ControllersClient) Get(ctx context.Context, resourceGroupName string, name string) (result Controller, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]([_-]*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, name) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ControllersClient) GetPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", 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 ControllersClient) 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 ControllersClient) GetResponder(resp *http.Response) (result Controller, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the Azure Dev Spaces Controllers with their properties in the subscription. -func (client ControllersClient) List(ctx context.Context) (result ControllerListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.List") - defer func() { - sc := -1 - if result.cl.Response.Response != nil { - sc = result.cl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "List", resp, "Failure sending request") - return - } - - result.cl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "List", resp, "Failure responding to request") - return - } - if result.cl.hasNextLink() && result.cl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ControllersClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers", 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 ControllersClient) 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 ControllersClient) ListResponder(resp *http.Response) (result ControllerList, 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 ControllersClient) listNextResults(ctx context.Context, lastResults ControllerList) (result ControllerList, err error) { - req, err := lastResults.controllerListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "devspaces.ControllersClient", "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, "devspaces.ControllersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ControllersClient) ListComplete(ctx context.Context) (result ControllerListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.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 -} - -// ListByResourceGroup lists all the Azure Dev Spaces Controllers with their properties in the specified resource group -// and subscription. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -func (client ControllersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ControllerListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.cl.Response.Response != nil { - sc = result.cl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "ListByResourceGroup", err.Error()) - } - - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.cl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.cl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.cl.hasNextLink() && result.cl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ControllersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ControllersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ControllersClient) ListByResourceGroupResponder(resp *http.Response) (result ControllerList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ControllersClient) listByResourceGroupNextResults(ctx context.Context, lastResults ControllerList) (result ControllerList, err error) { - req, err := lastResults.controllerListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "devspaces.ControllersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "devspaces.ControllersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ControllersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ControllerListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.ListByResourceGroup") - 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.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListConnectionDetails lists connection details for the underlying container resources of an Azure Dev Spaces -// Controller. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -// listConnectionDetailsParameters - parameters for listing connection details of Azure Dev Spaces Controller. -func (client ControllersClient) ListConnectionDetails(ctx context.Context, resourceGroupName string, name string, listConnectionDetailsParameters ListConnectionDetailsParameters) (result ControllerConnectionDetailsList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.ListConnectionDetails") - 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]([_-]*[a-zA-Z0-9])*$`, Chain: nil}}}, - {TargetValue: listConnectionDetailsParameters, - Constraints: []validation.Constraint{{Target: "listConnectionDetailsParameters.TargetContainerHostResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "ListConnectionDetails", err.Error()) - } - - req, err := client.ListConnectionDetailsPreparer(ctx, resourceGroupName, name, listConnectionDetailsParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListConnectionDetails", nil, "Failure preparing request") - return - } - - resp, err := client.ListConnectionDetailsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListConnectionDetails", resp, "Failure sending request") - return - } - - result, err = client.ListConnectionDetailsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "ListConnectionDetails", resp, "Failure responding to request") - return - } - - return -} - -// ListConnectionDetailsPreparer prepares the ListConnectionDetails request. -func (client ControllersClient) ListConnectionDetailsPreparer(ctx context.Context, resourceGroupName string, name string, listConnectionDetailsParameters ListConnectionDetailsParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}/listConnectionDetails", pathParameters), - autorest.WithJSON(listConnectionDetailsParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListConnectionDetailsSender sends the ListConnectionDetails request. The method will close the -// http.Response Body if it receives an error. -func (client ControllersClient) ListConnectionDetailsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListConnectionDetailsResponder handles the response to the ListConnectionDetails request. The method always -// closes the http.Response Body. -func (client ControllersClient) ListConnectionDetailsResponder(resp *http.Response) (result ControllerConnectionDetailsList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update updates the properties of an existing Azure Dev Spaces Controller with the specified update parameters. -// Parameters: -// resourceGroupName - resource group to which the resource belongs. -// name - name of the resource. -// controllerUpdateParameters - parameters for updating the Azure Dev Spaces Controller. -func (client ControllersClient) Update(ctx context.Context, resourceGroupName string, name string, controllerUpdateParameters ControllerUpdateParameters) (result Controller, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllersClient.Update") - 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: name, - Constraints: []validation.Constraint{{Target: "name", Name: validation.MaxLength, Rule: 63, Chain: nil}, - {Target: "name", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]([_-]*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("devspaces.ControllersClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, name, controllerUpdateParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ControllersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, controllerUpdateParameters ControllerUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", pathParameters), - autorest.WithJSON(controllerUpdateParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ControllersClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ControllersClient) UpdateResponder(resp *http.Response) (result Controller, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/enums.go deleted file mode 100644 index e73c4a310676..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/enums.go +++ /dev/null @@ -1,60 +0,0 @@ -package devspaces - -// 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. - -// InstanceType enumerates the values for instance type. -type InstanceType string - -const ( - // InstanceTypeKubernetes ... - InstanceTypeKubernetes InstanceType = "Kubernetes" - // InstanceTypeOrchestratorSpecificConnectionDetails ... - InstanceTypeOrchestratorSpecificConnectionDetails InstanceType = "OrchestratorSpecificConnectionDetails" -) - -// PossibleInstanceTypeValues returns an array of possible values for the InstanceType const type. -func PossibleInstanceTypeValues() []InstanceType { - return []InstanceType{InstanceTypeKubernetes, InstanceTypeOrchestratorSpecificConnectionDetails} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // Canceled ... - Canceled ProvisioningState = "Canceled" - // Creating ... - Creating ProvisioningState = "Creating" - // Deleted ... - Deleted ProvisioningState = "Deleted" - // Deleting ... - Deleting ProvisioningState = "Deleting" - // Failed ... - Failed ProvisioningState = "Failed" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" - // Updating ... - Updating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Canceled, Creating, Deleted, Deleting, Failed, Succeeded, Updating} -} - -// SkuTier enumerates the values for sku tier. -type SkuTier string - -const ( - // Standard ... - Standard SkuTier = "Standard" -) - -// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. -func PossibleSkuTierValues() []SkuTier { - return []SkuTier{Standard} -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/models.go deleted file mode 100644 index ef79543ba86e..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/models.go +++ /dev/null @@ -1,901 +0,0 @@ -package devspaces - -// 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/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/devspaces/mgmt/2019-04-01/devspaces" - -// ContainerHostMapping container host mapping object specifying the Container host resource ID and its -// associated Controller resource. -type ContainerHostMapping struct { - autorest.Response `json:"-"` - // ContainerHostResourceID - ARM ID of the Container Host resource - ContainerHostResourceID *string `json:"containerHostResourceId,omitempty"` - // MappedControllerResourceID - READ-ONLY; ARM ID of the mapped Controller resource - MappedControllerResourceID *string `json:"mappedControllerResourceId,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerHostMapping. -func (chm ContainerHostMapping) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if chm.ContainerHostResourceID != nil { - objectMap["containerHostResourceId"] = chm.ContainerHostResourceID - } - return json.Marshal(objectMap) -} - -// Controller ... -type Controller struct { - autorest.Response `json:"-"` - *ControllerProperties `json:"properties,omitempty"` - Sku *Sku `json:"sku,omitempty"` - // Tags - Tags for the Azure resource. - Tags map[string]*string `json:"tags"` - // Location - Region where the Azure resource is located. - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. - 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. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Controller. -func (c Controller) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ControllerProperties != nil { - objectMap["properties"] = c.ControllerProperties - } - if c.Sku != nil { - objectMap["sku"] = c.Sku - } - if c.Tags != nil { - objectMap["tags"] = c.Tags - } - if c.Location != nil { - objectMap["location"] = c.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Controller struct. -func (c *Controller) 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 controllerProperties ControllerProperties - err = json.Unmarshal(*v, &controllerProperties) - if err != nil { - return err - } - c.ControllerProperties = &controllerProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - c.Sku = &sku - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - c.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - c.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - c.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - c.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - c.Type = &typeVar - } - } - } - - return nil -} - -// ControllerConnectionDetails ... -type ControllerConnectionDetails struct { - OrchestratorSpecificConnectionDetails BasicOrchestratorSpecificConnectionDetails `json:"orchestratorSpecificConnectionDetails,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for ControllerConnectionDetails struct. -func (ccd *ControllerConnectionDetails) 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 "orchestratorSpecificConnectionDetails": - if v != nil { - orchestratorSpecificConnectionDetails, err := unmarshalBasicOrchestratorSpecificConnectionDetails(*v) - if err != nil { - return err - } - ccd.OrchestratorSpecificConnectionDetails = orchestratorSpecificConnectionDetails - } - } - } - - return nil -} - -// ControllerConnectionDetailsList ... -type ControllerConnectionDetailsList struct { - autorest.Response `json:"-"` - // ConnectionDetailsList - List of Azure Dev Spaces Controller connection details. - ConnectionDetailsList *[]ControllerConnectionDetails `json:"connectionDetailsList,omitempty"` -} - -// ControllerList ... -type ControllerList struct { - autorest.Response `json:"-"` - // Value - List of Azure Dev Spaces Controllers. - Value *[]Controller `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI that can be used to request the next page for list of Azure Dev Spaces Controllers. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ControllerList. -func (cl ControllerList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cl.Value != nil { - objectMap["value"] = cl.Value - } - return json.Marshal(objectMap) -} - -// ControllerListIterator provides access to a complete listing of Controller values. -type ControllerListIterator struct { - i int - page ControllerListPage -} - -// 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 *ControllerListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllerListIterator.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 *ControllerListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ControllerListIterator) 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 ControllerListIterator) Response() ControllerList { - 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 ControllerListIterator) Value() Controller { - if !iter.page.NotDone() { - return Controller{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ControllerListIterator type. -func NewControllerListIterator(page ControllerListPage) ControllerListIterator { - return ControllerListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cl ControllerList) IsEmpty() bool { - return cl.Value == nil || len(*cl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cl ControllerList) hasNextLink() bool { - return cl.NextLink != nil && len(*cl.NextLink) != 0 -} - -// controllerListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cl ControllerList) controllerListPreparer(ctx context.Context) (*http.Request, error) { - if !cl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cl.NextLink))) -} - -// ControllerListPage contains a page of Controller values. -type ControllerListPage struct { - fn func(context.Context, ControllerList) (ControllerList, error) - cl ControllerList -} - -// 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 *ControllerListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ControllerListPage.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.cl) - if err != nil { - return err - } - page.cl = 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 *ControllerListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ControllerListPage) NotDone() bool { - return !page.cl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ControllerListPage) Response() ControllerList { - return page.cl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ControllerListPage) Values() []Controller { - if page.cl.IsEmpty() { - return nil - } - return *page.cl.Value -} - -// Creates a new instance of the ControllerListPage type. -func NewControllerListPage(cur ControllerList, getNextPage func(context.Context, ControllerList) (ControllerList, error)) ControllerListPage { - return ControllerListPage{ - fn: getNextPage, - cl: cur, - } -} - -// ControllerProperties ... -type ControllerProperties struct { - // ProvisioningState - READ-ONLY; Provisioning state of the Azure Dev Spaces Controller. Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating', 'Deleting', 'Deleted' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // HostSuffix - READ-ONLY; DNS suffix for public endpoints running in the Azure Dev Spaces Controller. - HostSuffix *string `json:"hostSuffix,omitempty"` - // DataPlaneFqdn - READ-ONLY; DNS name for accessing DataPlane services - DataPlaneFqdn *string `json:"dataPlaneFqdn,omitempty"` - // TargetContainerHostAPIServerFqdn - READ-ONLY; DNS of the target container host's API server - TargetContainerHostAPIServerFqdn *string `json:"targetContainerHostApiServerFqdn,omitempty"` - // TargetContainerHostResourceID - Resource ID of the target container host - TargetContainerHostResourceID *string `json:"targetContainerHostResourceId,omitempty"` - // TargetContainerHostCredentialsBase64 - Credentials of the target container host (base64). - TargetContainerHostCredentialsBase64 *string `json:"targetContainerHostCredentialsBase64,omitempty"` -} - -// MarshalJSON is the custom marshaler for ControllerProperties. -func (cp ControllerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cp.TargetContainerHostResourceID != nil { - objectMap["targetContainerHostResourceId"] = cp.TargetContainerHostResourceID - } - if cp.TargetContainerHostCredentialsBase64 != nil { - objectMap["targetContainerHostCredentialsBase64"] = cp.TargetContainerHostCredentialsBase64 - } - return json.Marshal(objectMap) -} - -// ControllersCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ControllersCreateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ControllersClient) (Controller, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ControllersCreateFuture) 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 ControllersCreateFuture.Result. -func (future *ControllersCreateFuture) result(client ControllersClient) (c Controller, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - c.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("devspaces.ControllersCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { - c, err = client.CreateResponder(c.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersCreateFuture", "Result", c.Response.Response, "Failure responding to request") - } - } - return -} - -// ControllersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ControllersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ControllersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ControllersDeleteFuture) 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 ControllersDeleteFuture.Result. -func (future *ControllersDeleteFuture) result(client ControllersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.ControllersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("devspaces.ControllersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ControllerUpdateParameters parameters for updating an Azure Dev Spaces Controller. -type ControllerUpdateParameters struct { - // Tags - Tags for the Azure Dev Spaces Controller. - Tags map[string]*string `json:"tags"` - *ControllerUpdateParametersProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ControllerUpdateParameters. -func (cup ControllerUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cup.Tags != nil { - objectMap["tags"] = cup.Tags - } - if cup.ControllerUpdateParametersProperties != nil { - objectMap["properties"] = cup.ControllerUpdateParametersProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ControllerUpdateParameters struct. -func (cup *ControllerUpdateParameters) 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 "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cup.Tags = tags - } - case "properties": - if v != nil { - var controllerUpdateParametersProperties ControllerUpdateParametersProperties - err = json.Unmarshal(*v, &controllerUpdateParametersProperties) - if err != nil { - return err - } - cup.ControllerUpdateParametersProperties = &controllerUpdateParametersProperties - } - } - } - - return nil -} - -// ControllerUpdateParametersProperties ... -type ControllerUpdateParametersProperties struct { - // TargetContainerHostCredentialsBase64 - Credentials of the target container host (base64). - TargetContainerHostCredentialsBase64 *string `json:"targetContainerHostCredentialsBase64,omitempty"` -} - -// ErrorDetails ... -type ErrorDetails struct { - // Code - READ-ONLY; Status code for the error. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; Error message describing the error in detail. - Message *string `json:"message,omitempty"` - // Target - READ-ONLY; The target of the particular error. - Target *string `json:"target,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorDetails. -func (ed ErrorDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ErrorResponse error response indicates that the service is not able to process the incoming request. The -// reason is provided in the error message. -type ErrorResponse struct { - // Error - The details of the error. - Error *ErrorDetails `json:"error,omitempty"` -} - -// KubernetesConnectionDetails contains information used to connect to a Kubernetes cluster -type KubernetesConnectionDetails struct { - // KubeConfig - Gets the kubeconfig for the cluster. - KubeConfig *string `json:"kubeConfig,omitempty"` - // InstanceType - Possible values include: 'InstanceTypeOrchestratorSpecificConnectionDetails', 'InstanceTypeKubernetes' - InstanceType InstanceType `json:"instanceType,omitempty"` -} - -// MarshalJSON is the custom marshaler for KubernetesConnectionDetails. -func (kcd KubernetesConnectionDetails) MarshalJSON() ([]byte, error) { - kcd.InstanceType = InstanceTypeKubernetes - objectMap := make(map[string]interface{}) - if kcd.KubeConfig != nil { - objectMap["kubeConfig"] = kcd.KubeConfig - } - if kcd.InstanceType != "" { - objectMap["instanceType"] = kcd.InstanceType - } - return json.Marshal(objectMap) -} - -// AsKubernetesConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for KubernetesConnectionDetails. -func (kcd KubernetesConnectionDetails) AsKubernetesConnectionDetails() (*KubernetesConnectionDetails, bool) { - return &kcd, true -} - -// AsOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for KubernetesConnectionDetails. -func (kcd KubernetesConnectionDetails) AsOrchestratorSpecificConnectionDetails() (*OrchestratorSpecificConnectionDetails, bool) { - return nil, false -} - -// AsBasicOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for KubernetesConnectionDetails. -func (kcd KubernetesConnectionDetails) AsBasicOrchestratorSpecificConnectionDetails() (BasicOrchestratorSpecificConnectionDetails, bool) { - return &kcd, true -} - -// ListConnectionDetailsParameters parameters for listing connection details of an Azure Dev Spaces -// Controller. -type ListConnectionDetailsParameters struct { - // TargetContainerHostResourceID - Resource ID of the target container host mapped to the Azure Dev Spaces Controller. - TargetContainerHostResourceID *string `json:"targetContainerHostResourceId,omitempty"` -} - -// BasicOrchestratorSpecificConnectionDetails base class for types that supply values used to connect to container -// orchestrators -type BasicOrchestratorSpecificConnectionDetails interface { - AsKubernetesConnectionDetails() (*KubernetesConnectionDetails, bool) - AsOrchestratorSpecificConnectionDetails() (*OrchestratorSpecificConnectionDetails, bool) -} - -// OrchestratorSpecificConnectionDetails base class for types that supply values used to connect to container -// orchestrators -type OrchestratorSpecificConnectionDetails struct { - // InstanceType - Possible values include: 'InstanceTypeOrchestratorSpecificConnectionDetails', 'InstanceTypeKubernetes' - InstanceType InstanceType `json:"instanceType,omitempty"` -} - -func unmarshalBasicOrchestratorSpecificConnectionDetails(body []byte) (BasicOrchestratorSpecificConnectionDetails, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["instanceType"] { - case string(InstanceTypeKubernetes): - var kcd KubernetesConnectionDetails - err := json.Unmarshal(body, &kcd) - return kcd, err - default: - var oscd OrchestratorSpecificConnectionDetails - err := json.Unmarshal(body, &oscd) - return oscd, err - } -} -func unmarshalBasicOrchestratorSpecificConnectionDetailsArray(body []byte) ([]BasicOrchestratorSpecificConnectionDetails, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - oscdArray := make([]BasicOrchestratorSpecificConnectionDetails, len(rawMessages)) - - for index, rawMessage := range rawMessages { - oscd, err := unmarshalBasicOrchestratorSpecificConnectionDetails(*rawMessage) - if err != nil { - return nil, err - } - oscdArray[index] = oscd - } - return oscdArray, nil -} - -// MarshalJSON is the custom marshaler for OrchestratorSpecificConnectionDetails. -func (oscd OrchestratorSpecificConnectionDetails) MarshalJSON() ([]byte, error) { - oscd.InstanceType = InstanceTypeOrchestratorSpecificConnectionDetails - objectMap := make(map[string]interface{}) - if oscd.InstanceType != "" { - objectMap["instanceType"] = oscd.InstanceType - } - return json.Marshal(objectMap) -} - -// AsKubernetesConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for OrchestratorSpecificConnectionDetails. -func (oscd OrchestratorSpecificConnectionDetails) AsKubernetesConnectionDetails() (*KubernetesConnectionDetails, bool) { - return nil, false -} - -// AsOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for OrchestratorSpecificConnectionDetails. -func (oscd OrchestratorSpecificConnectionDetails) AsOrchestratorSpecificConnectionDetails() (*OrchestratorSpecificConnectionDetails, bool) { - return &oscd, true -} - -// AsBasicOrchestratorSpecificConnectionDetails is the BasicOrchestratorSpecificConnectionDetails implementation for OrchestratorSpecificConnectionDetails. -func (oscd OrchestratorSpecificConnectionDetails) AsBasicOrchestratorSpecificConnectionDetails() (BasicOrchestratorSpecificConnectionDetails, bool) { - return &oscd, true -} - -// Resource an Azure resource. -type Resource struct { - // ID - READ-ONLY; Fully qualified resource Id for the resource. - 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. - 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) -} - -// ResourceProviderOperationDefinition ... -type ResourceProviderOperationDefinition struct { - // Name - Resource provider operation name. - Name *string `json:"name,omitempty"` - Display *ResourceProviderOperationDisplay `json:"display,omitempty"` -} - -// ResourceProviderOperationDisplay ... -type ResourceProviderOperationDisplay struct { - // Provider - Name of the resource provider. - Provider *string `json:"provider,omitempty"` - // Resource - Name of the resource type. - Resource *string `json:"resource,omitempty"` - // Operation - Name of the resource provider operation. - Operation *string `json:"operation,omitempty"` - // Description - Description of the resource provider operation. - Description *string `json:"description,omitempty"` -} - -// ResourceProviderOperationList ... -type ResourceProviderOperationList struct { - autorest.Response `json:"-"` - // Value - Resource provider operations list. - Value *[]ResourceProviderOperationDefinition `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI that can be used to request the next page for list of Azure operations. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceProviderOperationList. -func (rpol ResourceProviderOperationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rpol.Value != nil { - objectMap["value"] = rpol.Value - } - return json.Marshal(objectMap) -} - -// ResourceProviderOperationListIterator provides access to a complete listing of -// ResourceProviderOperationDefinition values. -type ResourceProviderOperationListIterator struct { - i int - page ResourceProviderOperationListPage -} - -// 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 *ResourceProviderOperationListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceProviderOperationListIterator.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 *ResourceProviderOperationListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResourceProviderOperationListIterator) 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 ResourceProviderOperationListIterator) Response() ResourceProviderOperationList { - 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 ResourceProviderOperationListIterator) Value() ResourceProviderOperationDefinition { - if !iter.page.NotDone() { - return ResourceProviderOperationDefinition{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResourceProviderOperationListIterator type. -func NewResourceProviderOperationListIterator(page ResourceProviderOperationListPage) ResourceProviderOperationListIterator { - return ResourceProviderOperationListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rpol ResourceProviderOperationList) IsEmpty() bool { - return rpol.Value == nil || len(*rpol.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rpol ResourceProviderOperationList) hasNextLink() bool { - return rpol.NextLink != nil && len(*rpol.NextLink) != 0 -} - -// resourceProviderOperationListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rpol ResourceProviderOperationList) resourceProviderOperationListPreparer(ctx context.Context) (*http.Request, error) { - if !rpol.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rpol.NextLink))) -} - -// ResourceProviderOperationListPage contains a page of ResourceProviderOperationDefinition values. -type ResourceProviderOperationListPage struct { - fn func(context.Context, ResourceProviderOperationList) (ResourceProviderOperationList, error) - rpol ResourceProviderOperationList -} - -// 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 *ResourceProviderOperationListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceProviderOperationListPage.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.rpol) - if err != nil { - return err - } - page.rpol = 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 *ResourceProviderOperationListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResourceProviderOperationListPage) NotDone() bool { - return !page.rpol.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResourceProviderOperationListPage) Response() ResourceProviderOperationList { - return page.rpol -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResourceProviderOperationListPage) Values() []ResourceProviderOperationDefinition { - if page.rpol.IsEmpty() { - return nil - } - return *page.rpol.Value -} - -// Creates a new instance of the ResourceProviderOperationListPage type. -func NewResourceProviderOperationListPage(cur ResourceProviderOperationList, getNextPage func(context.Context, ResourceProviderOperationList) (ResourceProviderOperationList, error)) ResourceProviderOperationListPage { - return ResourceProviderOperationListPage{ - fn: getNextPage, - rpol: cur, - } -} - -// Sku model representing SKU for Azure Dev Spaces Controller. -type Sku struct { - // Name - The name of the SKU for Azure Dev Spaces Controller. - Name *string `json:"name,omitempty"` - // Tier - The tier of the SKU for Azure Dev Spaces Controller. Possible values include: 'Standard' - Tier SkuTier `json:"tier,omitempty"` -} - -// TrackedResource the resource model definition for a ARM tracked top level resource. -type TrackedResource struct { - // Tags - Tags for the Azure resource. - Tags map[string]*string `json:"tags"` - // Location - Region where the Azure resource is located. - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource Id for the resource. - 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. - 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) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/operations.go deleted file mode 100644 index 139504464fde..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/operations.go +++ /dev/null @@ -1,140 +0,0 @@ -package devspaces - -// 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/tracing" - "net/http" -) - -// OperationsClient is the dev Spaces Client -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)} -} - -// List lists all the supported operations by the Microsoft.DevSpaces resource provider along with their description. -func (client OperationsClient) List(ctx context.Context) (result ResourceProviderOperationListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.rpol.Response.Response != nil { - sc = result.rpol.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rpol.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "devspaces.OperationsClient", "List", resp, "Failure sending request") - return - } - - result.rpol, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.OperationsClient", "List", resp, "Failure responding to request") - return - } - if result.rpol.hasNextLink() && result.rpol.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.DevSpaces/operations"), - 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 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 ResourceProviderOperationList, 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 ResourceProviderOperationList) (result ResourceProviderOperationList, err error) { - req, err := lastResults.resourceProviderOperationListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "devspaces.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, "devspaces.OperationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "devspaces.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 ResourceProviderOperationListIterator, 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 -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/version.go deleted file mode 100644 index ca424a49735c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package devspaces - -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() + " devspaces/2019-04-01" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/CHANGELOG.md deleted file mode 100644 index 52911e4cc5e4..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/_meta.json deleted file mode 100644 index 9cc80229ad39..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", - "readme": "/_/azure-rest-api-specs/specification/servicefabricmesh/resource-manager/readme.md", - "tag": "package-2018-09-01-preview", - "use": "@microsoft.azure/autorest.go@2.1.187", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2018-09-01-preview --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/servicefabricmesh/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" - } -} \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/application.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/application.go deleted file mode 100644 index 06ddd12cb0d9..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/application.go +++ /dev/null @@ -1,501 +0,0 @@ -package servicefabricmesh - -// 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" -) - -// ApplicationClient is the service Fabric Mesh Management Client -type ApplicationClient struct { - BaseClient -} - -// NewApplicationClient creates an instance of the ApplicationClient client. -func NewApplicationClient(subscriptionID string) ApplicationClient { - return NewApplicationClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewApplicationClientWithBaseURI creates an instance of the ApplicationClient 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 NewApplicationClientWithBaseURI(baseURI string, subscriptionID string) ApplicationClient { - return ApplicationClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates an application resource with the specified name, description and properties. If an application -// resource with the same name exists, then it is updated with the specified description and properties. -// Parameters: -// resourceGroupName - azure resource group name -// applicationResourceName - the identity of the application. -// applicationResourceDescription - description for creating a Application resource. -func (client ApplicationClient) Create(ctx context.Context, resourceGroupName string, applicationResourceName string, applicationResourceDescription ApplicationResourceDescription) (result ApplicationResourceDescription, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationClient.Create") - 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: applicationResourceDescription, - Constraints: []validation.Constraint{{Target: "applicationResourceDescription.ApplicationResourceProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("servicefabricmesh.ApplicationClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, applicationResourceName, applicationResourceDescription) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client ApplicationClient) CreatePreparer(ctx context.Context, resourceGroupName string, applicationResourceName string, applicationResourceDescription ApplicationResourceDescription) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationResourceName": applicationResourceName, - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationResourceName}", pathParameters), - autorest.WithJSON(applicationResourceDescription), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client ApplicationClient) CreateResponder(resp *http.Response) (result ApplicationResourceDescription, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the application resource identified by the name. -// Parameters: -// resourceGroupName - azure resource group name -// applicationResourceName - the identity of the application. -func (client ApplicationClient) Delete(ctx context.Context, resourceGroupName string, applicationResourceName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, applicationResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ApplicationClient) DeletePreparer(ctx context.Context, resourceGroupName string, applicationResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationResourceName": applicationResourceName, - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationResourceName}", 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 ApplicationClient) 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 ApplicationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the information about the application resource with the given name. The information include the description -// and other properties of the application. -// Parameters: -// resourceGroupName - azure resource group name -// applicationResourceName - the identity of the application. -func (client ApplicationClient) Get(ctx context.Context, resourceGroupName string, applicationResourceName string) (result ApplicationResourceDescription, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, applicationResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationResourceName": applicationResourceName, - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationResourceName}", 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 ApplicationClient) 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 ApplicationClient) GetResponder(resp *http.Response) (result ApplicationResourceDescription, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup gets the information about all application resources in a given resource group. The information -// include the description and other properties of the Application. -// Parameters: -// resourceGroupName - azure resource group name -func (client ApplicationClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ApplicationResourceDescriptionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.ardl.Response.Response != nil { - sc = result.ardl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.ardl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.ardl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.ardl.hasNextLink() && result.ardl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ApplicationClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ApplicationClient) ListByResourceGroupResponder(resp *http.Response) (result ApplicationResourceDescriptionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ApplicationClient) listByResourceGroupNextResults(ctx context.Context, lastResults ApplicationResourceDescriptionList) (result ApplicationResourceDescriptionList, err error) { - req, err := lastResults.applicationResourceDescriptionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ApplicationResourceDescriptionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationClient.ListByResourceGroup") - 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.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription gets the information about all application resources in a given resource group. The information -// include the description and other properties of the application. -func (client ApplicationClient) ListBySubscription(ctx context.Context) (result ApplicationResourceDescriptionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationClient.ListBySubscription") - defer func() { - sc := -1 - if result.ardl.Response.Response != nil { - sc = result.ardl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.ardl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.ardl, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.ardl.hasNextLink() && result.ardl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client ApplicationClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/applications", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client ApplicationClient) ListBySubscriptionResponder(resp *http.Response) (result ApplicationResourceDescriptionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client ApplicationClient) listBySubscriptionNextResults(ctx context.Context, lastResults ApplicationResourceDescriptionList) (result ApplicationResourceDescriptionList, err error) { - req, err := lastResults.applicationResourceDescriptionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ApplicationClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationClient) ListBySubscriptionComplete(ctx context.Context) (result ApplicationResourceDescriptionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationClient.ListBySubscription") - 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.ListBySubscription(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/client.go deleted file mode 100644 index 06a7d9821f1d..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/client.go +++ /dev/null @@ -1,41 +0,0 @@ -// Package servicefabricmesh implements the Azure ARM Servicefabricmesh service API version 2018-09-01-preview. -// -// Service Fabric Mesh Management Client -package servicefabricmesh - -// 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 ( - "github.com/Azure/go-autorest/autorest" -) - -const ( - // DefaultBaseURI is the default URI used for the service Servicefabricmesh - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Servicefabricmesh. -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, - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/codepackage.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/codepackage.go deleted file mode 100644 index a79e5d9393e1..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/codepackage.go +++ /dev/null @@ -1,117 +0,0 @@ -package servicefabricmesh - -// 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/tracing" - "net/http" -) - -// CodePackageClient is the service Fabric Mesh Management Client -type CodePackageClient struct { - BaseClient -} - -// NewCodePackageClient creates an instance of the CodePackageClient client. -func NewCodePackageClient(subscriptionID string) CodePackageClient { - return NewCodePackageClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCodePackageClientWithBaseURI creates an instance of the CodePackageClient 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 NewCodePackageClientWithBaseURI(baseURI string, subscriptionID string) CodePackageClient { - return CodePackageClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// GetContainerLogs gets the logs for the container of the specified code package of the service replica. -// Parameters: -// resourceGroupName - azure resource group name -// applicationResourceName - the identity of the application. -// serviceResourceName - the identity of the service. -// replicaName - service Fabric replica name. -// codePackageName - the name of code package of the service. -// tail - number of lines to show from the end of the logs. Default is 100. -func (client CodePackageClient) GetContainerLogs(ctx context.Context, resourceGroupName string, applicationResourceName string, serviceResourceName string, replicaName string, codePackageName string, tail *int32) (result ContainerLogs, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CodePackageClient.GetContainerLogs") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetContainerLogsPreparer(ctx, resourceGroupName, applicationResourceName, serviceResourceName, replicaName, codePackageName, tail) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.CodePackageClient", "GetContainerLogs", nil, "Failure preparing request") - return - } - - resp, err := client.GetContainerLogsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.CodePackageClient", "GetContainerLogs", resp, "Failure sending request") - return - } - - result, err = client.GetContainerLogsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.CodePackageClient", "GetContainerLogs", resp, "Failure responding to request") - return - } - - return -} - -// GetContainerLogsPreparer prepares the GetContainerLogs request. -func (client CodePackageClient) GetContainerLogsPreparer(ctx context.Context, resourceGroupName string, applicationResourceName string, serviceResourceName string, replicaName string, codePackageName string, tail *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationResourceName": applicationResourceName, - "codePackageName": autorest.Encode("path", codePackageName), - "replicaName": replicaName, - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceResourceName": serviceResourceName, - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if tail != nil { - queryParameters["tail"] = autorest.Encode("query", *tail) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationResourceName}/services/{serviceResourceName}/replicas/{replicaName}/codePackages/{codePackageName}/logs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetContainerLogsSender sends the GetContainerLogs request. The method will close the -// http.Response Body if it receives an error. -func (client CodePackageClient) GetContainerLogsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetContainerLogsResponder handles the response to the GetContainerLogs request. The method always -// closes the http.Response Body. -func (client CodePackageClient) GetContainerLogsResponder(resp *http.Response) (result ContainerLogs, 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/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/enums.go deleted file mode 100644 index e3c80923cfa8..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/enums.go +++ /dev/null @@ -1,332 +0,0 @@ -package servicefabricmesh - -// 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. - -// ApplicationScopedVolumeKind enumerates the values for application scoped volume kind. -type ApplicationScopedVolumeKind string - -const ( - // ServiceFabricVolumeDisk Provides Service Fabric High Availability Volume Disk - ServiceFabricVolumeDisk ApplicationScopedVolumeKind = "ServiceFabricVolumeDisk" -) - -// PossibleApplicationScopedVolumeKindValues returns an array of possible values for the ApplicationScopedVolumeKind const type. -func PossibleApplicationScopedVolumeKindValues() []ApplicationScopedVolumeKind { - return []ApplicationScopedVolumeKind{ServiceFabricVolumeDisk} -} - -// AutoScalingMechanismKind enumerates the values for auto scaling mechanism kind. -type AutoScalingMechanismKind string - -const ( - // AddRemoveReplica Indicates that scaling should be performed by adding or removing replicas. - AddRemoveReplica AutoScalingMechanismKind = "AddRemoveReplica" -) - -// PossibleAutoScalingMechanismKindValues returns an array of possible values for the AutoScalingMechanismKind const type. -func PossibleAutoScalingMechanismKindValues() []AutoScalingMechanismKind { - return []AutoScalingMechanismKind{AddRemoveReplica} -} - -// AutoScalingMetricKind enumerates the values for auto scaling metric kind. -type AutoScalingMetricKind string - -const ( - // AutoScalingMetricKindResource Indicates that the metric is one of resources, like cpu or memory. - AutoScalingMetricKindResource AutoScalingMetricKind = "Resource" -) - -// PossibleAutoScalingMetricKindValues returns an array of possible values for the AutoScalingMetricKind const type. -func PossibleAutoScalingMetricKindValues() []AutoScalingMetricKind { - return []AutoScalingMetricKind{AutoScalingMetricKindResource} -} - -// AutoScalingResourceMetricName enumerates the values for auto scaling resource metric name. -type AutoScalingResourceMetricName string - -const ( - // CPU Indicates that the resource is CPU cores. - CPU AutoScalingResourceMetricName = "cpu" - // MemoryInGB Indicates that the resource is memory in GB. - MemoryInGB AutoScalingResourceMetricName = "memoryInGB" -) - -// PossibleAutoScalingResourceMetricNameValues returns an array of possible values for the AutoScalingResourceMetricName const type. -func PossibleAutoScalingResourceMetricNameValues() []AutoScalingResourceMetricName { - return []AutoScalingResourceMetricName{CPU, MemoryInGB} -} - -// AutoScalingTriggerKind enumerates the values for auto scaling trigger kind. -type AutoScalingTriggerKind string - -const ( - // AverageLoad Indicates that scaling should be performed based on average load of all replicas in the - // service. - AverageLoad AutoScalingTriggerKind = "AverageLoad" -) - -// PossibleAutoScalingTriggerKindValues returns an array of possible values for the AutoScalingTriggerKind const type. -func PossibleAutoScalingTriggerKindValues() []AutoScalingTriggerKind { - return []AutoScalingTriggerKind{AverageLoad} -} - -// DiagnosticsSinkKind enumerates the values for diagnostics sink kind. -type DiagnosticsSinkKind string - -const ( - // AzureInternalMonitoringPipeline Diagnostics settings for Geneva. - AzureInternalMonitoringPipeline DiagnosticsSinkKind = "AzureInternalMonitoringPipeline" - // Invalid Indicates an invalid sink kind. All Service Fabric enumerations have the invalid type. - Invalid DiagnosticsSinkKind = "Invalid" -) - -// PossibleDiagnosticsSinkKindValues returns an array of possible values for the DiagnosticsSinkKind const type. -func PossibleDiagnosticsSinkKindValues() []DiagnosticsSinkKind { - return []DiagnosticsSinkKind{AzureInternalMonitoringPipeline, Invalid} -} - -// HeaderMatchType enumerates the values for header match type. -type HeaderMatchType string - -const ( - // Exact ... - Exact HeaderMatchType = "exact" -) - -// PossibleHeaderMatchTypeValues returns an array of possible values for the HeaderMatchType const type. -func PossibleHeaderMatchTypeValues() []HeaderMatchType { - return []HeaderMatchType{Exact} -} - -// HealthState enumerates the values for health state. -type HealthState string - -const ( - // HealthStateError Indicates the health state is at an error level. Error health state should be - // investigated, as they can impact the correct functionality of the cluster. The value is 3. - HealthStateError HealthState = "Error" - // HealthStateInvalid Indicates an invalid health state. All Service Fabric enumerations have the invalid - // type. The value is zero. - HealthStateInvalid HealthState = "Invalid" - // HealthStateOk Indicates the health state is okay. The value is 1. - HealthStateOk HealthState = "Ok" - // HealthStateUnknown Indicates an unknown health status. The value is 65535. - HealthStateUnknown HealthState = "Unknown" - // HealthStateWarning Indicates the health state is at a warning level. The value is 2. - HealthStateWarning HealthState = "Warning" -) - -// PossibleHealthStateValues returns an array of possible values for the HealthState const type. -func PossibleHealthStateValues() []HealthState { - return []HealthState{HealthStateError, HealthStateInvalid, HealthStateOk, HealthStateUnknown, HealthStateWarning} -} - -// Kind enumerates the values for kind. -type Kind string - -const ( - // KindInlinedValue ... - KindInlinedValue Kind = "inlinedValue" - // KindSecretResourceProperties ... - KindSecretResourceProperties Kind = "SecretResourceProperties" - // KindSecretResourcePropertiesBase ... - KindSecretResourcePropertiesBase Kind = "SecretResourcePropertiesBase" -) - -// PossibleKindValues returns an array of possible values for the Kind const type. -func PossibleKindValues() []Kind { - return []Kind{KindInlinedValue, KindSecretResourceProperties, KindSecretResourcePropertiesBase} -} - -// KindBasicApplicationScopedVolumeCreationParameters enumerates the values for kind basic application scoped -// volume creation parameters. -type KindBasicApplicationScopedVolumeCreationParameters string - -const ( - // KindApplicationScopedVolumeCreationParameters ... - KindApplicationScopedVolumeCreationParameters KindBasicApplicationScopedVolumeCreationParameters = "ApplicationScopedVolumeCreationParameters" - // KindServiceFabricVolumeDisk ... - KindServiceFabricVolumeDisk KindBasicApplicationScopedVolumeCreationParameters = "ServiceFabricVolumeDisk" -) - -// PossibleKindBasicApplicationScopedVolumeCreationParametersValues returns an array of possible values for the KindBasicApplicationScopedVolumeCreationParameters const type. -func PossibleKindBasicApplicationScopedVolumeCreationParametersValues() []KindBasicApplicationScopedVolumeCreationParameters { - return []KindBasicApplicationScopedVolumeCreationParameters{KindApplicationScopedVolumeCreationParameters, KindServiceFabricVolumeDisk} -} - -// KindBasicAutoScalingMechanism enumerates the values for kind basic auto scaling mechanism. -type KindBasicAutoScalingMechanism string - -const ( - // KindAddRemoveReplica ... - KindAddRemoveReplica KindBasicAutoScalingMechanism = "AddRemoveReplica" - // KindAutoScalingMechanism ... - KindAutoScalingMechanism KindBasicAutoScalingMechanism = "AutoScalingMechanism" -) - -// PossibleKindBasicAutoScalingMechanismValues returns an array of possible values for the KindBasicAutoScalingMechanism const type. -func PossibleKindBasicAutoScalingMechanismValues() []KindBasicAutoScalingMechanism { - return []KindBasicAutoScalingMechanism{KindAddRemoveReplica, KindAutoScalingMechanism} -} - -// KindBasicAutoScalingMetric enumerates the values for kind basic auto scaling metric. -type KindBasicAutoScalingMetric string - -const ( - // KindAutoScalingMetric ... - KindAutoScalingMetric KindBasicAutoScalingMetric = "AutoScalingMetric" - // KindResource ... - KindResource KindBasicAutoScalingMetric = "Resource" -) - -// PossibleKindBasicAutoScalingMetricValues returns an array of possible values for the KindBasicAutoScalingMetric const type. -func PossibleKindBasicAutoScalingMetricValues() []KindBasicAutoScalingMetric { - return []KindBasicAutoScalingMetric{KindAutoScalingMetric, KindResource} -} - -// KindBasicAutoScalingTrigger enumerates the values for kind basic auto scaling trigger. -type KindBasicAutoScalingTrigger string - -const ( - // KindAutoScalingTrigger ... - KindAutoScalingTrigger KindBasicAutoScalingTrigger = "AutoScalingTrigger" - // KindAverageLoad ... - KindAverageLoad KindBasicAutoScalingTrigger = "AverageLoad" -) - -// PossibleKindBasicAutoScalingTriggerValues returns an array of possible values for the KindBasicAutoScalingTrigger const type. -func PossibleKindBasicAutoScalingTriggerValues() []KindBasicAutoScalingTrigger { - return []KindBasicAutoScalingTrigger{KindAutoScalingTrigger, KindAverageLoad} -} - -// KindBasicDiagnosticsSinkProperties enumerates the values for kind basic diagnostics sink properties. -type KindBasicDiagnosticsSinkProperties string - -const ( - // KindAzureInternalMonitoringPipeline ... - KindAzureInternalMonitoringPipeline KindBasicDiagnosticsSinkProperties = "AzureInternalMonitoringPipeline" - // KindDiagnosticsSinkProperties ... - KindDiagnosticsSinkProperties KindBasicDiagnosticsSinkProperties = "DiagnosticsSinkProperties" -) - -// PossibleKindBasicDiagnosticsSinkPropertiesValues returns an array of possible values for the KindBasicDiagnosticsSinkProperties const type. -func PossibleKindBasicDiagnosticsSinkPropertiesValues() []KindBasicDiagnosticsSinkProperties { - return []KindBasicDiagnosticsSinkProperties{KindAzureInternalMonitoringPipeline, KindDiagnosticsSinkProperties} -} - -// KindBasicNetworkResourcePropertiesBase enumerates the values for kind basic network resource properties -// base. -type KindBasicNetworkResourcePropertiesBase string - -const ( - // KindLocal ... - KindLocal KindBasicNetworkResourcePropertiesBase = "Local" - // KindNetworkResourceProperties ... - KindNetworkResourceProperties KindBasicNetworkResourcePropertiesBase = "NetworkResourceProperties" - // KindNetworkResourcePropertiesBase ... - KindNetworkResourcePropertiesBase KindBasicNetworkResourcePropertiesBase = "NetworkResourcePropertiesBase" -) - -// PossibleKindBasicNetworkResourcePropertiesBaseValues returns an array of possible values for the KindBasicNetworkResourcePropertiesBase const type. -func PossibleKindBasicNetworkResourcePropertiesBaseValues() []KindBasicNetworkResourcePropertiesBase { - return []KindBasicNetworkResourcePropertiesBase{KindLocal, KindNetworkResourceProperties, KindNetworkResourcePropertiesBase} -} - -// NetworkKind enumerates the values for network kind. -type NetworkKind string - -const ( - // Local Indicates a container network local to a single Service Fabric cluster. The value is 1. - Local NetworkKind = "Local" -) - -// PossibleNetworkKindValues returns an array of possible values for the NetworkKind const type. -func PossibleNetworkKindValues() []NetworkKind { - return []NetworkKind{Local} -} - -// OperatingSystemType enumerates the values for operating system type. -type OperatingSystemType string - -const ( - // Linux The required operating system is Linux. - Linux OperatingSystemType = "Linux" - // Windows The required operating system is Windows. - Windows OperatingSystemType = "Windows" -) - -// PossibleOperatingSystemTypeValues returns an array of possible values for the OperatingSystemType const type. -func PossibleOperatingSystemTypeValues() []OperatingSystemType { - return []OperatingSystemType{Linux, Windows} -} - -// ResourceStatus enumerates the values for resource status. -type ResourceStatus string - -const ( - // Creating Indicates the resource is being created. The value is 3. - Creating ResourceStatus = "Creating" - // Deleting Indicates the resource is being deleted. The value is 4. - Deleting ResourceStatus = "Deleting" - // Failed Indicates the resource is not functional due to persistent failures. See statusDetails property - // for more details. The value is 5. - Failed ResourceStatus = "Failed" - // Ready Indicates the resource is ready. The value is 1. - Ready ResourceStatus = "Ready" - // Unknown Indicates the resource status is unknown. The value is zero. - Unknown ResourceStatus = "Unknown" - // Upgrading Indicates the resource is upgrading. The value is 2. - Upgrading ResourceStatus = "Upgrading" -) - -// PossibleResourceStatusValues returns an array of possible values for the ResourceStatus const type. -func PossibleResourceStatusValues() []ResourceStatus { - return []ResourceStatus{Creating, Deleting, Failed, Ready, Unknown, Upgrading} -} - -// SecretKind enumerates the values for secret kind. -type SecretKind string - -const ( - // InlinedValue A simple secret resource whose plaintext value is provided by the user. - InlinedValue SecretKind = "inlinedValue" -) - -// PossibleSecretKindValues returns an array of possible values for the SecretKind const type. -func PossibleSecretKindValues() []SecretKind { - return []SecretKind{InlinedValue} -} - -// SizeTypes enumerates the values for size types. -type SizeTypes string - -const ( - // Large ... - Large SizeTypes = "Large" - // Medium ... - Medium SizeTypes = "Medium" - // Small ... - Small SizeTypes = "Small" -) - -// PossibleSizeTypesValues returns an array of possible values for the SizeTypes const type. -func PossibleSizeTypesValues() []SizeTypes { - return []SizeTypes{Large, Medium, Small} -} - -// VolumeProvider enumerates the values for volume provider. -type VolumeProvider string - -const ( - // SFAzureFile Provides volumes that are backed by Azure Files. - SFAzureFile VolumeProvider = "SFAzureFile" -) - -// PossibleVolumeProviderValues returns an array of possible values for the VolumeProvider const type. -func PossibleVolumeProviderValues() []VolumeProvider { - return []VolumeProvider{SFAzureFile} -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/gateway.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/gateway.go deleted file mode 100644 index 9ffa3ecf9605..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/gateway.go +++ /dev/null @@ -1,505 +0,0 @@ -package servicefabricmesh - -// 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" -) - -// GatewayClient is the service Fabric Mesh Management Client -type GatewayClient struct { - BaseClient -} - -// NewGatewayClient creates an instance of the GatewayClient client. -func NewGatewayClient(subscriptionID string) GatewayClient { - return NewGatewayClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGatewayClientWithBaseURI creates an instance of the GatewayClient 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 NewGatewayClientWithBaseURI(baseURI string, subscriptionID string) GatewayClient { - return GatewayClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates a gateway resource with the specified name, description and properties. If a gateway resource with -// the same name exists, then it is updated with the specified description and properties. Use gateway resources to -// create a gateway for public connectivity for services within your application. -// Parameters: -// resourceGroupName - azure resource group name -// gatewayResourceName - the identity of the gateway. -// gatewayResourceDescription - description for creating a Gateway resource. -func (client GatewayClient) Create(ctx context.Context, resourceGroupName string, gatewayResourceName string, gatewayResourceDescription GatewayResourceDescription) (result GatewayResourceDescription, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.Create") - 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: gatewayResourceDescription, - Constraints: []validation.Constraint{{Target: "gatewayResourceDescription.GatewayResourceProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "gatewayResourceDescription.GatewayResourceProperties.SourceNetwork", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "gatewayResourceDescription.GatewayResourceProperties.DestinationNetwork", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("servicefabricmesh.GatewayClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, gatewayResourceName, gatewayResourceDescription) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client GatewayClient) CreatePreparer(ctx context.Context, resourceGroupName string, gatewayResourceName string, gatewayResourceDescription GatewayResourceDescription) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayResourceName": gatewayResourceName, - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/gateways/{gatewayResourceName}", pathParameters), - autorest.WithJSON(gatewayResourceDescription), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client GatewayClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client GatewayClient) CreateResponder(resp *http.Response) (result GatewayResourceDescription, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the gateway resource identified by the name. -// Parameters: -// resourceGroupName - azure resource group name -// gatewayResourceName - the identity of the gateway. -func (client GatewayClient) Delete(ctx context.Context, resourceGroupName string, gatewayResourceName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, gatewayResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GatewayClient) DeletePreparer(ctx context.Context, resourceGroupName string, gatewayResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayResourceName": gatewayResourceName, - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/gateways/{gatewayResourceName}", 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 GatewayClient) 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 GatewayClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the information about the gateway resource with the given name. The information include the description and -// other properties of the gateway. -// Parameters: -// resourceGroupName - azure resource group name -// gatewayResourceName - the identity of the gateway. -func (client GatewayClient) Get(ctx context.Context, resourceGroupName string, gatewayResourceName string) (result GatewayResourceDescription, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, gatewayResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GatewayClient) GetPreparer(ctx context.Context, resourceGroupName string, gatewayResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayResourceName": gatewayResourceName, - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/gateways/{gatewayResourceName}", 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 GatewayClient) 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 GatewayClient) GetResponder(resp *http.Response) (result GatewayResourceDescription, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup gets the information about all gateway resources in a given resource group. The information -// include the description and other properties of the Gateway. -// Parameters: -// resourceGroupName - azure resource group name -func (client GatewayClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result GatewayResourceDescriptionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.grdl.Response.Response != nil { - sc = result.grdl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.grdl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.grdl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.grdl.hasNextLink() && result.grdl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client GatewayClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/gateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client GatewayClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client GatewayClient) ListByResourceGroupResponder(resp *http.Response) (result GatewayResourceDescriptionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client GatewayClient) listByResourceGroupNextResults(ctx context.Context, lastResults GatewayResourceDescriptionList) (result GatewayResourceDescriptionList, err error) { - req, err := lastResults.gatewayResourceDescriptionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client GatewayClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result GatewayResourceDescriptionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.ListByResourceGroup") - 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.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription gets the information about all gateway resources in a given resource group. The information -// include the description and other properties of the gateway. -func (client GatewayClient) ListBySubscription(ctx context.Context) (result GatewayResourceDescriptionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.ListBySubscription") - defer func() { - sc := -1 - if result.grdl.Response.Response != nil { - sc = result.grdl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.grdl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.grdl, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.grdl.hasNextLink() && result.grdl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client GatewayClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/gateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client GatewayClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client GatewayClient) ListBySubscriptionResponder(resp *http.Response) (result GatewayResourceDescriptionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client GatewayClient) listBySubscriptionNextResults(ctx context.Context, lastResults GatewayResourceDescriptionList) (result GatewayResourceDescriptionList, err error) { - req, err := lastResults.gatewayResourceDescriptionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.GatewayClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client GatewayClient) ListBySubscriptionComplete(ctx context.Context) (result GatewayResourceDescriptionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.ListBySubscription") - 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.ListBySubscription(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/models.go deleted file mode 100644 index 4644e8cf10dc..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/models.go +++ /dev/null @@ -1,4333 +0,0 @@ -package servicefabricmesh - -// 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/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/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh" - -// AddRemoveReplicaScalingMechanism describes the horizontal auto scaling mechanism that adds or removes -// replicas (containers or container groups). -type AddRemoveReplicaScalingMechanism struct { - // MinCount - Minimum number of containers (scale down won't be performed below this number). - MinCount *int32 `json:"minCount,omitempty"` - // MaxCount - Maximum number of containers (scale up won't be performed above this number). - MaxCount *int32 `json:"maxCount,omitempty"` - // ScaleIncrement - Each time auto scaling is performed, this number of containers will be added or removed. - ScaleIncrement *int32 `json:"scaleIncrement,omitempty"` - // Kind - Possible values include: 'KindAutoScalingMechanism', 'KindAddRemoveReplica' - Kind KindBasicAutoScalingMechanism `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for AddRemoveReplicaScalingMechanism. -func (arrsm AddRemoveReplicaScalingMechanism) MarshalJSON() ([]byte, error) { - arrsm.Kind = KindAddRemoveReplica - objectMap := make(map[string]interface{}) - if arrsm.MinCount != nil { - objectMap["minCount"] = arrsm.MinCount - } - if arrsm.MaxCount != nil { - objectMap["maxCount"] = arrsm.MaxCount - } - if arrsm.ScaleIncrement != nil { - objectMap["scaleIncrement"] = arrsm.ScaleIncrement - } - if arrsm.Kind != "" { - objectMap["kind"] = arrsm.Kind - } - return json.Marshal(objectMap) -} - -// AsAddRemoveReplicaScalingMechanism is the BasicAutoScalingMechanism implementation for AddRemoveReplicaScalingMechanism. -func (arrsm AddRemoveReplicaScalingMechanism) AsAddRemoveReplicaScalingMechanism() (*AddRemoveReplicaScalingMechanism, bool) { - return &arrsm, true -} - -// AsAutoScalingMechanism is the BasicAutoScalingMechanism implementation for AddRemoveReplicaScalingMechanism. -func (arrsm AddRemoveReplicaScalingMechanism) AsAutoScalingMechanism() (*AutoScalingMechanism, bool) { - return nil, false -} - -// AsBasicAutoScalingMechanism is the BasicAutoScalingMechanism implementation for AddRemoveReplicaScalingMechanism. -func (arrsm AddRemoveReplicaScalingMechanism) AsBasicAutoScalingMechanism() (BasicAutoScalingMechanism, bool) { - return &arrsm, true -} - -// ApplicationProperties describes properties of a application resource. -type ApplicationProperties struct { - // Description - User readable description of the application. - Description *string `json:"description,omitempty"` - // Services - Describes the services in the application. This property is used to create or modify services of the application. On get only the name of the service is returned. The service description can be obtained by querying for the service resource. - Services *[]ServiceResourceDescription `json:"services,omitempty"` - // Diagnostics - Describes the diagnostics definition and usage for an application resource. - Diagnostics *DiagnosticsDescription `json:"diagnostics,omitempty"` - // DebugParams - Internal - used by Visual Studio to setup the debugging session on the local development environment. - DebugParams *string `json:"debugParams,omitempty"` - // ServiceNames - READ-ONLY; Names of the services in the application. - ServiceNames *[]string `json:"serviceNames,omitempty"` - // Status - READ-ONLY; Status of the application. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' - Status ResourceStatus `json:"status,omitempty"` - // StatusDetails - READ-ONLY; Gives additional information about the current status of the application. - StatusDetails *string `json:"statusDetails,omitempty"` - // HealthState - READ-ONLY; Describes the health state of an application resource. Possible values include: 'HealthStateInvalid', 'HealthStateOk', 'HealthStateWarning', 'HealthStateError', 'HealthStateUnknown' - HealthState HealthState `json:"healthState,omitempty"` - // UnhealthyEvaluation - READ-ONLY; When the application's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the application is marked unhealthy. - UnhealthyEvaluation *string `json:"unhealthyEvaluation,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationProperties. -func (ap ApplicationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ap.Description != nil { - objectMap["description"] = ap.Description - } - if ap.Services != nil { - objectMap["services"] = ap.Services - } - if ap.Diagnostics != nil { - objectMap["diagnostics"] = ap.Diagnostics - } - if ap.DebugParams != nil { - objectMap["debugParams"] = ap.DebugParams - } - return json.Marshal(objectMap) -} - -// ApplicationResourceDescription this type describes an application resource. -type ApplicationResourceDescription struct { - autorest.Response `json:"-"` - // ApplicationResourceProperties - This type describes properties of an application resource. - *ApplicationResourceProperties `json:"properties,omitempty"` - // 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 identifier 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationResourceDescription. -func (ard ApplicationResourceDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ard.ApplicationResourceProperties != nil { - objectMap["properties"] = ard.ApplicationResourceProperties - } - if ard.Tags != nil { - objectMap["tags"] = ard.Tags - } - if ard.Location != nil { - objectMap["location"] = ard.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationResourceDescription struct. -func (ard *ApplicationResourceDescription) 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 applicationResourceProperties ApplicationResourceProperties - err = json.Unmarshal(*v, &applicationResourceProperties) - if err != nil { - return err - } - ard.ApplicationResourceProperties = &applicationResourceProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ard.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ard.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ard.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ard.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ard.Type = &typeVar - } - } - } - - return nil -} - -// ApplicationResourceDescriptionList a pageable list of application resources. -type ApplicationResourceDescriptionList struct { - autorest.Response `json:"-"` - // Value - One page of the list. - Value *[]ApplicationResourceDescription `json:"value,omitempty"` - // NextLink - URI to fetch the next page of the list. - NextLink *string `json:"nextLink,omitempty"` -} - -// ApplicationResourceDescriptionListIterator provides access to a complete listing of -// ApplicationResourceDescription values. -type ApplicationResourceDescriptionListIterator struct { - i int - page ApplicationResourceDescriptionListPage -} - -// 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 *ApplicationResourceDescriptionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationResourceDescriptionListIterator.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 *ApplicationResourceDescriptionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationResourceDescriptionListIterator) 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 ApplicationResourceDescriptionListIterator) Response() ApplicationResourceDescriptionList { - 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 ApplicationResourceDescriptionListIterator) Value() ApplicationResourceDescription { - if !iter.page.NotDone() { - return ApplicationResourceDescription{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ApplicationResourceDescriptionListIterator type. -func NewApplicationResourceDescriptionListIterator(page ApplicationResourceDescriptionListPage) ApplicationResourceDescriptionListIterator { - return ApplicationResourceDescriptionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ardl ApplicationResourceDescriptionList) IsEmpty() bool { - return ardl.Value == nil || len(*ardl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ardl ApplicationResourceDescriptionList) hasNextLink() bool { - return ardl.NextLink != nil && len(*ardl.NextLink) != 0 -} - -// applicationResourceDescriptionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ardl ApplicationResourceDescriptionList) applicationResourceDescriptionListPreparer(ctx context.Context) (*http.Request, error) { - if !ardl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ardl.NextLink))) -} - -// ApplicationResourceDescriptionListPage contains a page of ApplicationResourceDescription values. -type ApplicationResourceDescriptionListPage struct { - fn func(context.Context, ApplicationResourceDescriptionList) (ApplicationResourceDescriptionList, error) - ardl ApplicationResourceDescriptionList -} - -// 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 *ApplicationResourceDescriptionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationResourceDescriptionListPage.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.ardl) - if err != nil { - return err - } - page.ardl = 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 *ApplicationResourceDescriptionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationResourceDescriptionListPage) NotDone() bool { - return !page.ardl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationResourceDescriptionListPage) Response() ApplicationResourceDescriptionList { - return page.ardl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationResourceDescriptionListPage) Values() []ApplicationResourceDescription { - if page.ardl.IsEmpty() { - return nil - } - return *page.ardl.Value -} - -// Creates a new instance of the ApplicationResourceDescriptionListPage type. -func NewApplicationResourceDescriptionListPage(cur ApplicationResourceDescriptionList, getNextPage func(context.Context, ApplicationResourceDescriptionList) (ApplicationResourceDescriptionList, error)) ApplicationResourceDescriptionListPage { - return ApplicationResourceDescriptionListPage{ - fn: getNextPage, - ardl: cur, - } -} - -// ApplicationResourceProperties this type describes properties of an application resource. -type ApplicationResourceProperties struct { - // ProvisioningState - READ-ONLY; State of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Description - User readable description of the application. - Description *string `json:"description,omitempty"` - // Services - Describes the services in the application. This property is used to create or modify services of the application. On get only the name of the service is returned. The service description can be obtained by querying for the service resource. - Services *[]ServiceResourceDescription `json:"services,omitempty"` - // Diagnostics - Describes the diagnostics definition and usage for an application resource. - Diagnostics *DiagnosticsDescription `json:"diagnostics,omitempty"` - // DebugParams - Internal - used by Visual Studio to setup the debugging session on the local development environment. - DebugParams *string `json:"debugParams,omitempty"` - // ServiceNames - READ-ONLY; Names of the services in the application. - ServiceNames *[]string `json:"serviceNames,omitempty"` - // Status - READ-ONLY; Status of the application. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' - Status ResourceStatus `json:"status,omitempty"` - // StatusDetails - READ-ONLY; Gives additional information about the current status of the application. - StatusDetails *string `json:"statusDetails,omitempty"` - // HealthState - READ-ONLY; Describes the health state of an application resource. Possible values include: 'HealthStateInvalid', 'HealthStateOk', 'HealthStateWarning', 'HealthStateError', 'HealthStateUnknown' - HealthState HealthState `json:"healthState,omitempty"` - // UnhealthyEvaluation - READ-ONLY; When the application's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the application is marked unhealthy. - UnhealthyEvaluation *string `json:"unhealthyEvaluation,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationResourceProperties. -func (arp ApplicationResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if arp.Description != nil { - objectMap["description"] = arp.Description - } - if arp.Services != nil { - objectMap["services"] = arp.Services - } - if arp.Diagnostics != nil { - objectMap["diagnostics"] = arp.Diagnostics - } - if arp.DebugParams != nil { - objectMap["debugParams"] = arp.DebugParams - } - return json.Marshal(objectMap) -} - -// ApplicationScopedVolume describes a volume whose lifetime is scoped to the application's lifetime. -type ApplicationScopedVolume struct { - // CreationParameters - Describes parameters for creating application-scoped volumes. - CreationParameters BasicApplicationScopedVolumeCreationParameters `json:"creationParameters,omitempty"` - // Name - Name of the volume being referenced. - Name *string `json:"name,omitempty"` - // ReadOnly - The flag indicating whether the volume is read only. Default is 'false'. - ReadOnly *bool `json:"readOnly,omitempty"` - // DestinationPath - The path within the container at which the volume should be mounted. Only valid path characters are allowed. - DestinationPath *string `json:"destinationPath,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationScopedVolume struct. -func (asv *ApplicationScopedVolume) 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 "creationParameters": - if v != nil { - creationParameters, err := unmarshalBasicApplicationScopedVolumeCreationParameters(*v) - if err != nil { - return err - } - asv.CreationParameters = creationParameters - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - asv.Name = &name - } - case "readOnly": - if v != nil { - var readOnly bool - err = json.Unmarshal(*v, &readOnly) - if err != nil { - return err - } - asv.ReadOnly = &readOnly - } - case "destinationPath": - if v != nil { - var destinationPath string - err = json.Unmarshal(*v, &destinationPath) - if err != nil { - return err - } - asv.DestinationPath = &destinationPath - } - } - } - - return nil -} - -// BasicApplicationScopedVolumeCreationParameters describes parameters for creating application-scoped volumes. -type BasicApplicationScopedVolumeCreationParameters interface { - AsApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk() (*ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk, bool) - AsApplicationScopedVolumeCreationParameters() (*ApplicationScopedVolumeCreationParameters, bool) -} - -// ApplicationScopedVolumeCreationParameters describes parameters for creating application-scoped volumes. -type ApplicationScopedVolumeCreationParameters struct { - // Description - User readable description of the volume. - Description *string `json:"description,omitempty"` - // Kind - Possible values include: 'KindApplicationScopedVolumeCreationParameters', 'KindServiceFabricVolumeDisk' - Kind KindBasicApplicationScopedVolumeCreationParameters `json:"kind,omitempty"` -} - -func unmarshalBasicApplicationScopedVolumeCreationParameters(body []byte) (BasicApplicationScopedVolumeCreationParameters, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["kind"] { - case string(KindServiceFabricVolumeDisk): - var asvcpsfvd ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk - err := json.Unmarshal(body, &asvcpsfvd) - return asvcpsfvd, err - default: - var asvcp ApplicationScopedVolumeCreationParameters - err := json.Unmarshal(body, &asvcp) - return asvcp, err - } -} -func unmarshalBasicApplicationScopedVolumeCreationParametersArray(body []byte) ([]BasicApplicationScopedVolumeCreationParameters, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - asvcpArray := make([]BasicApplicationScopedVolumeCreationParameters, len(rawMessages)) - - for index, rawMessage := range rawMessages { - asvcp, err := unmarshalBasicApplicationScopedVolumeCreationParameters(*rawMessage) - if err != nil { - return nil, err - } - asvcpArray[index] = asvcp - } - return asvcpArray, nil -} - -// MarshalJSON is the custom marshaler for ApplicationScopedVolumeCreationParameters. -func (asvcp ApplicationScopedVolumeCreationParameters) MarshalJSON() ([]byte, error) { - asvcp.Kind = KindApplicationScopedVolumeCreationParameters - objectMap := make(map[string]interface{}) - if asvcp.Description != nil { - objectMap["description"] = asvcp.Description - } - if asvcp.Kind != "" { - objectMap["kind"] = asvcp.Kind - } - return json.Marshal(objectMap) -} - -// AsApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk is the BasicApplicationScopedVolumeCreationParameters implementation for ApplicationScopedVolumeCreationParameters. -func (asvcp ApplicationScopedVolumeCreationParameters) AsApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk() (*ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk, bool) { - return nil, false -} - -// AsApplicationScopedVolumeCreationParameters is the BasicApplicationScopedVolumeCreationParameters implementation for ApplicationScopedVolumeCreationParameters. -func (asvcp ApplicationScopedVolumeCreationParameters) AsApplicationScopedVolumeCreationParameters() (*ApplicationScopedVolumeCreationParameters, bool) { - return &asvcp, true -} - -// AsBasicApplicationScopedVolumeCreationParameters is the BasicApplicationScopedVolumeCreationParameters implementation for ApplicationScopedVolumeCreationParameters. -func (asvcp ApplicationScopedVolumeCreationParameters) AsBasicApplicationScopedVolumeCreationParameters() (BasicApplicationScopedVolumeCreationParameters, bool) { - return &asvcp, true -} - -// ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk describes parameters for creating -// application-scoped volumes provided by Service Fabric Volume Disks -type ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk struct { - // SizeDisk - Volume size. Possible values include: 'Small', 'Medium', 'Large' - SizeDisk SizeTypes `json:"sizeDisk,omitempty"` - // Description - User readable description of the volume. - Description *string `json:"description,omitempty"` - // Kind - Possible values include: 'KindApplicationScopedVolumeCreationParameters', 'KindServiceFabricVolumeDisk' - Kind KindBasicApplicationScopedVolumeCreationParameters `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk. -func (asvcpsfvd ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk) MarshalJSON() ([]byte, error) { - asvcpsfvd.Kind = KindServiceFabricVolumeDisk - objectMap := make(map[string]interface{}) - if asvcpsfvd.SizeDisk != "" { - objectMap["sizeDisk"] = asvcpsfvd.SizeDisk - } - if asvcpsfvd.Description != nil { - objectMap["description"] = asvcpsfvd.Description - } - if asvcpsfvd.Kind != "" { - objectMap["kind"] = asvcpsfvd.Kind - } - return json.Marshal(objectMap) -} - -// AsApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk is the BasicApplicationScopedVolumeCreationParameters implementation for ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk. -func (asvcpsfvd ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk) AsApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk() (*ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk, bool) { - return &asvcpsfvd, true -} - -// AsApplicationScopedVolumeCreationParameters is the BasicApplicationScopedVolumeCreationParameters implementation for ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk. -func (asvcpsfvd ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk) AsApplicationScopedVolumeCreationParameters() (*ApplicationScopedVolumeCreationParameters, bool) { - return nil, false -} - -// AsBasicApplicationScopedVolumeCreationParameters is the BasicApplicationScopedVolumeCreationParameters implementation for ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk. -func (asvcpsfvd ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk) AsBasicApplicationScopedVolumeCreationParameters() (BasicApplicationScopedVolumeCreationParameters, bool) { - return &asvcpsfvd, true -} - -// BasicAutoScalingMechanism describes the mechanism for performing auto scaling operation. Derived classes will -// describe the actual mechanism. -type BasicAutoScalingMechanism interface { - AsAddRemoveReplicaScalingMechanism() (*AddRemoveReplicaScalingMechanism, bool) - AsAutoScalingMechanism() (*AutoScalingMechanism, bool) -} - -// AutoScalingMechanism describes the mechanism for performing auto scaling operation. Derived classes will -// describe the actual mechanism. -type AutoScalingMechanism struct { - // Kind - Possible values include: 'KindAutoScalingMechanism', 'KindAddRemoveReplica' - Kind KindBasicAutoScalingMechanism `json:"kind,omitempty"` -} - -func unmarshalBasicAutoScalingMechanism(body []byte) (BasicAutoScalingMechanism, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["kind"] { - case string(KindAddRemoveReplica): - var arrsm AddRemoveReplicaScalingMechanism - err := json.Unmarshal(body, &arrsm) - return arrsm, err - default: - var asm AutoScalingMechanism - err := json.Unmarshal(body, &asm) - return asm, err - } -} -func unmarshalBasicAutoScalingMechanismArray(body []byte) ([]BasicAutoScalingMechanism, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - asmArray := make([]BasicAutoScalingMechanism, len(rawMessages)) - - for index, rawMessage := range rawMessages { - asm, err := unmarshalBasicAutoScalingMechanism(*rawMessage) - if err != nil { - return nil, err - } - asmArray[index] = asm - } - return asmArray, nil -} - -// MarshalJSON is the custom marshaler for AutoScalingMechanism. -func (asm AutoScalingMechanism) MarshalJSON() ([]byte, error) { - asm.Kind = KindAutoScalingMechanism - objectMap := make(map[string]interface{}) - if asm.Kind != "" { - objectMap["kind"] = asm.Kind - } - return json.Marshal(objectMap) -} - -// AsAddRemoveReplicaScalingMechanism is the BasicAutoScalingMechanism implementation for AutoScalingMechanism. -func (asm AutoScalingMechanism) AsAddRemoveReplicaScalingMechanism() (*AddRemoveReplicaScalingMechanism, bool) { - return nil, false -} - -// AsAutoScalingMechanism is the BasicAutoScalingMechanism implementation for AutoScalingMechanism. -func (asm AutoScalingMechanism) AsAutoScalingMechanism() (*AutoScalingMechanism, bool) { - return &asm, true -} - -// AsBasicAutoScalingMechanism is the BasicAutoScalingMechanism implementation for AutoScalingMechanism. -func (asm AutoScalingMechanism) AsBasicAutoScalingMechanism() (BasicAutoScalingMechanism, bool) { - return &asm, true -} - -// BasicAutoScalingMetric describes the metric that is used for triggering auto scaling operation. Derived classes will -// describe resources or metrics. -type BasicAutoScalingMetric interface { - AsAutoScalingResourceMetric() (*AutoScalingResourceMetric, bool) - AsAutoScalingMetric() (*AutoScalingMetric, bool) -} - -// AutoScalingMetric describes the metric that is used for triggering auto scaling operation. Derived classes -// will describe resources or metrics. -type AutoScalingMetric struct { - // Kind - Possible values include: 'KindAutoScalingMetric', 'KindResource' - Kind KindBasicAutoScalingMetric `json:"kind,omitempty"` -} - -func unmarshalBasicAutoScalingMetric(body []byte) (BasicAutoScalingMetric, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["kind"] { - case string(KindResource): - var asrm AutoScalingResourceMetric - err := json.Unmarshal(body, &asrm) - return asrm, err - default: - var asm AutoScalingMetric - err := json.Unmarshal(body, &asm) - return asm, err - } -} -func unmarshalBasicAutoScalingMetricArray(body []byte) ([]BasicAutoScalingMetric, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - asmArray := make([]BasicAutoScalingMetric, len(rawMessages)) - - for index, rawMessage := range rawMessages { - asm, err := unmarshalBasicAutoScalingMetric(*rawMessage) - if err != nil { - return nil, err - } - asmArray[index] = asm - } - return asmArray, nil -} - -// MarshalJSON is the custom marshaler for AutoScalingMetric. -func (asm AutoScalingMetric) MarshalJSON() ([]byte, error) { - asm.Kind = KindAutoScalingMetric - objectMap := make(map[string]interface{}) - if asm.Kind != "" { - objectMap["kind"] = asm.Kind - } - return json.Marshal(objectMap) -} - -// AsAutoScalingResourceMetric is the BasicAutoScalingMetric implementation for AutoScalingMetric. -func (asm AutoScalingMetric) AsAutoScalingResourceMetric() (*AutoScalingResourceMetric, bool) { - return nil, false -} - -// AsAutoScalingMetric is the BasicAutoScalingMetric implementation for AutoScalingMetric. -func (asm AutoScalingMetric) AsAutoScalingMetric() (*AutoScalingMetric, bool) { - return &asm, true -} - -// AsBasicAutoScalingMetric is the BasicAutoScalingMetric implementation for AutoScalingMetric. -func (asm AutoScalingMetric) AsBasicAutoScalingMetric() (BasicAutoScalingMetric, bool) { - return &asm, true -} - -// AutoScalingPolicy describes the auto scaling policy -type AutoScalingPolicy struct { - // Name - The name of the auto scaling policy. - Name *string `json:"name,omitempty"` - // Trigger - Determines when auto scaling operation will be invoked. - Trigger BasicAutoScalingTrigger `json:"trigger,omitempty"` - // Mechanism - The mechanism that is used to scale when auto scaling operation is invoked. - Mechanism BasicAutoScalingMechanism `json:"mechanism,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for AutoScalingPolicy struct. -func (asp *AutoScalingPolicy) 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 "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - asp.Name = &name - } - case "trigger": - if v != nil { - trigger, err := unmarshalBasicAutoScalingTrigger(*v) - if err != nil { - return err - } - asp.Trigger = trigger - } - case "mechanism": - if v != nil { - mechanism, err := unmarshalBasicAutoScalingMechanism(*v) - if err != nil { - return err - } - asp.Mechanism = mechanism - } - } - } - - return nil -} - -// AutoScalingResourceMetric describes the resource that is used for triggering auto scaling. -type AutoScalingResourceMetric struct { - // Name - Name of the resource. Possible values include: 'CPU', 'MemoryInGB' - Name AutoScalingResourceMetricName `json:"name,omitempty"` - // Kind - Possible values include: 'KindAutoScalingMetric', 'KindResource' - Kind KindBasicAutoScalingMetric `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for AutoScalingResourceMetric. -func (asrm AutoScalingResourceMetric) MarshalJSON() ([]byte, error) { - asrm.Kind = KindResource - objectMap := make(map[string]interface{}) - if asrm.Name != "" { - objectMap["name"] = asrm.Name - } - if asrm.Kind != "" { - objectMap["kind"] = asrm.Kind - } - return json.Marshal(objectMap) -} - -// AsAutoScalingResourceMetric is the BasicAutoScalingMetric implementation for AutoScalingResourceMetric. -func (asrm AutoScalingResourceMetric) AsAutoScalingResourceMetric() (*AutoScalingResourceMetric, bool) { - return &asrm, true -} - -// AsAutoScalingMetric is the BasicAutoScalingMetric implementation for AutoScalingResourceMetric. -func (asrm AutoScalingResourceMetric) AsAutoScalingMetric() (*AutoScalingMetric, bool) { - return nil, false -} - -// AsBasicAutoScalingMetric is the BasicAutoScalingMetric implementation for AutoScalingResourceMetric. -func (asrm AutoScalingResourceMetric) AsBasicAutoScalingMetric() (BasicAutoScalingMetric, bool) { - return &asrm, true -} - -// BasicAutoScalingTrigger describes the trigger for performing auto scaling operation. -type BasicAutoScalingTrigger interface { - AsAverageLoadScalingTrigger() (*AverageLoadScalingTrigger, bool) - AsAutoScalingTrigger() (*AutoScalingTrigger, bool) -} - -// AutoScalingTrigger describes the trigger for performing auto scaling operation. -type AutoScalingTrigger struct { - // Kind - Possible values include: 'KindAutoScalingTrigger', 'KindAverageLoad' - Kind KindBasicAutoScalingTrigger `json:"kind,omitempty"` -} - -func unmarshalBasicAutoScalingTrigger(body []byte) (BasicAutoScalingTrigger, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["kind"] { - case string(KindAverageLoad): - var alst AverageLoadScalingTrigger - err := json.Unmarshal(body, &alst) - return alst, err - default: - var astVar AutoScalingTrigger - err := json.Unmarshal(body, &astVar) - return astVar, err - } -} -func unmarshalBasicAutoScalingTriggerArray(body []byte) ([]BasicAutoScalingTrigger, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - astVarArray := make([]BasicAutoScalingTrigger, len(rawMessages)) - - for index, rawMessage := range rawMessages { - astVar, err := unmarshalBasicAutoScalingTrigger(*rawMessage) - if err != nil { - return nil, err - } - astVarArray[index] = astVar - } - return astVarArray, nil -} - -// MarshalJSON is the custom marshaler for AutoScalingTrigger. -func (astVar AutoScalingTrigger) MarshalJSON() ([]byte, error) { - astVar.Kind = KindAutoScalingTrigger - objectMap := make(map[string]interface{}) - if astVar.Kind != "" { - objectMap["kind"] = astVar.Kind - } - return json.Marshal(objectMap) -} - -// AsAverageLoadScalingTrigger is the BasicAutoScalingTrigger implementation for AutoScalingTrigger. -func (astVar AutoScalingTrigger) AsAverageLoadScalingTrigger() (*AverageLoadScalingTrigger, bool) { - return nil, false -} - -// AsAutoScalingTrigger is the BasicAutoScalingTrigger implementation for AutoScalingTrigger. -func (astVar AutoScalingTrigger) AsAutoScalingTrigger() (*AutoScalingTrigger, bool) { - return &astVar, true -} - -// AsBasicAutoScalingTrigger is the BasicAutoScalingTrigger implementation for AutoScalingTrigger. -func (astVar AutoScalingTrigger) AsBasicAutoScalingTrigger() (BasicAutoScalingTrigger, bool) { - return &astVar, true -} - -// AvailableOperationDisplay an operation available at the listed Azure resource provider. -type AvailableOperationDisplay struct { - // Provider - Name of the operation provider. - Provider *string `json:"provider,omitempty"` - // Resource - Name of the resource on which the operation is available. - Resource *string `json:"resource,omitempty"` - // Operation - Name of the available operation. - Operation *string `json:"operation,omitempty"` - // Description - Description of the available operation. - Description *string `json:"description,omitempty"` -} - -// AverageLoadScalingTrigger describes the average load trigger used for auto scaling. -type AverageLoadScalingTrigger struct { - // Metric - Description of the metric that is used for scaling. - Metric BasicAutoScalingMetric `json:"metric,omitempty"` - // LowerLoadThreshold - Lower load threshold (if average load is below this threshold, service will scale down). - LowerLoadThreshold *float64 `json:"lowerLoadThreshold,omitempty"` - // UpperLoadThreshold - Upper load threshold (if average load is above this threshold, service will scale up). - UpperLoadThreshold *float64 `json:"upperLoadThreshold,omitempty"` - // ScaleIntervalInSeconds - Scale interval that indicates how often will this trigger be checked. - ScaleIntervalInSeconds *int32 `json:"scaleIntervalInSeconds,omitempty"` - // Kind - Possible values include: 'KindAutoScalingTrigger', 'KindAverageLoad' - Kind KindBasicAutoScalingTrigger `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for AverageLoadScalingTrigger. -func (alst AverageLoadScalingTrigger) MarshalJSON() ([]byte, error) { - alst.Kind = KindAverageLoad - objectMap := make(map[string]interface{}) - objectMap["metric"] = alst.Metric - if alst.LowerLoadThreshold != nil { - objectMap["lowerLoadThreshold"] = alst.LowerLoadThreshold - } - if alst.UpperLoadThreshold != nil { - objectMap["upperLoadThreshold"] = alst.UpperLoadThreshold - } - if alst.ScaleIntervalInSeconds != nil { - objectMap["scaleIntervalInSeconds"] = alst.ScaleIntervalInSeconds - } - if alst.Kind != "" { - objectMap["kind"] = alst.Kind - } - return json.Marshal(objectMap) -} - -// AsAverageLoadScalingTrigger is the BasicAutoScalingTrigger implementation for AverageLoadScalingTrigger. -func (alst AverageLoadScalingTrigger) AsAverageLoadScalingTrigger() (*AverageLoadScalingTrigger, bool) { - return &alst, true -} - -// AsAutoScalingTrigger is the BasicAutoScalingTrigger implementation for AverageLoadScalingTrigger. -func (alst AverageLoadScalingTrigger) AsAutoScalingTrigger() (*AutoScalingTrigger, bool) { - return nil, false -} - -// AsBasicAutoScalingTrigger is the BasicAutoScalingTrigger implementation for AverageLoadScalingTrigger. -func (alst AverageLoadScalingTrigger) AsBasicAutoScalingTrigger() (BasicAutoScalingTrigger, bool) { - return &alst, true -} - -// UnmarshalJSON is the custom unmarshaler for AverageLoadScalingTrigger struct. -func (alst *AverageLoadScalingTrigger) 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 "metric": - if v != nil { - metric, err := unmarshalBasicAutoScalingMetric(*v) - if err != nil { - return err - } - alst.Metric = metric - } - case "lowerLoadThreshold": - if v != nil { - var lowerLoadThreshold float64 - err = json.Unmarshal(*v, &lowerLoadThreshold) - if err != nil { - return err - } - alst.LowerLoadThreshold = &lowerLoadThreshold - } - case "upperLoadThreshold": - if v != nil { - var upperLoadThreshold float64 - err = json.Unmarshal(*v, &upperLoadThreshold) - if err != nil { - return err - } - alst.UpperLoadThreshold = &upperLoadThreshold - } - case "scaleIntervalInSeconds": - if v != nil { - var scaleIntervalInSeconds int32 - err = json.Unmarshal(*v, &scaleIntervalInSeconds) - if err != nil { - return err - } - alst.ScaleIntervalInSeconds = &scaleIntervalInSeconds - } - case "kind": - if v != nil { - var kind KindBasicAutoScalingTrigger - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - alst.Kind = kind - } - } - } - - return nil -} - -// AzureInternalMonitoringPipelineSinkDescription diagnostics settings for Geneva. -type AzureInternalMonitoringPipelineSinkDescription struct { - // AccountName - Azure Internal monitoring pipeline account. - AccountName *string `json:"accountName,omitempty"` - // Namespace - Azure Internal monitoring pipeline account namespace. - Namespace *string `json:"namespace,omitempty"` - // MaConfigURL - Azure Internal monitoring agent configuration. - MaConfigURL *string `json:"maConfigUrl,omitempty"` - // FluentdConfigURL - Azure Internal monitoring agent fluentd configuration. - FluentdConfigURL interface{} `json:"fluentdConfigUrl,omitempty"` - // AutoKeyConfigURL - Azure Internal monitoring pipeline autokey associated with the certificate. - AutoKeyConfigURL *string `json:"autoKeyConfigUrl,omitempty"` - // Name - Name of the sink. This value is referenced by DiagnosticsReferenceDescription - Name *string `json:"name,omitempty"` - // Description - A description of the sink. - Description *string `json:"description,omitempty"` - // Kind - Possible values include: 'KindDiagnosticsSinkProperties', 'KindAzureInternalMonitoringPipeline' - Kind KindBasicDiagnosticsSinkProperties `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureInternalMonitoringPipelineSinkDescription. -func (aimpsd AzureInternalMonitoringPipelineSinkDescription) MarshalJSON() ([]byte, error) { - aimpsd.Kind = KindAzureInternalMonitoringPipeline - objectMap := make(map[string]interface{}) - if aimpsd.AccountName != nil { - objectMap["accountName"] = aimpsd.AccountName - } - if aimpsd.Namespace != nil { - objectMap["namespace"] = aimpsd.Namespace - } - if aimpsd.MaConfigURL != nil { - objectMap["maConfigUrl"] = aimpsd.MaConfigURL - } - if aimpsd.FluentdConfigURL != nil { - objectMap["fluentdConfigUrl"] = aimpsd.FluentdConfigURL - } - if aimpsd.AutoKeyConfigURL != nil { - objectMap["autoKeyConfigUrl"] = aimpsd.AutoKeyConfigURL - } - if aimpsd.Name != nil { - objectMap["name"] = aimpsd.Name - } - if aimpsd.Description != nil { - objectMap["description"] = aimpsd.Description - } - if aimpsd.Kind != "" { - objectMap["kind"] = aimpsd.Kind - } - return json.Marshal(objectMap) -} - -// AsAzureInternalMonitoringPipelineSinkDescription is the BasicDiagnosticsSinkProperties implementation for AzureInternalMonitoringPipelineSinkDescription. -func (aimpsd AzureInternalMonitoringPipelineSinkDescription) AsAzureInternalMonitoringPipelineSinkDescription() (*AzureInternalMonitoringPipelineSinkDescription, bool) { - return &aimpsd, true -} - -// AsDiagnosticsSinkProperties is the BasicDiagnosticsSinkProperties implementation for AzureInternalMonitoringPipelineSinkDescription. -func (aimpsd AzureInternalMonitoringPipelineSinkDescription) AsDiagnosticsSinkProperties() (*DiagnosticsSinkProperties, bool) { - return nil, false -} - -// AsBasicDiagnosticsSinkProperties is the BasicDiagnosticsSinkProperties implementation for AzureInternalMonitoringPipelineSinkDescription. -func (aimpsd AzureInternalMonitoringPipelineSinkDescription) AsBasicDiagnosticsSinkProperties() (BasicDiagnosticsSinkProperties, bool) { - return &aimpsd, true -} - -// ContainerCodePackageProperties describes a container and its runtime properties. -type ContainerCodePackageProperties struct { - // Name - The name of the code package. - Name *string `json:"name,omitempty"` - // Image - The Container image to use. - Image *string `json:"image,omitempty"` - // ImageRegistryCredential - Image registry credential. - ImageRegistryCredential *ImageRegistryCredential `json:"imageRegistryCredential,omitempty"` - // Entrypoint - Override for the default entry point in the container. - Entrypoint *string `json:"entrypoint,omitempty"` - // Commands - Command array to execute within the container in exec form. - Commands *[]string `json:"commands,omitempty"` - // EnvironmentVariables - The environment variables to set in this container - EnvironmentVariables *[]EnvironmentVariable `json:"environmentVariables,omitempty"` - // Settings - The settings to set in this container. The setting file path can be fetched from environment variable "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The path for Linux container is "/var/secrets". - Settings *[]Setting `json:"settings,omitempty"` - // Labels - The labels to set in this container. - Labels *[]ContainerLabel `json:"labels,omitempty"` - // Endpoints - The endpoints exposed by this container. - Endpoints *[]EndpointProperties `json:"endpoints,omitempty"` - // Resources - The resources required by this container. - Resources *ResourceRequirements `json:"resources,omitempty"` - // VolumeRefs - Volumes to be attached to the container. The lifetime of these volumes is independent of the application's lifetime. - VolumeRefs *[]VolumeReference `json:"volumeRefs,omitempty"` - // Volumes - Volumes to be attached to the container. The lifetime of these volumes is scoped to the application's lifetime. - Volumes *[]ApplicationScopedVolume `json:"volumes,omitempty"` - // Diagnostics - Reference to sinks in DiagnosticsDescription. - Diagnostics *DiagnosticsRef `json:"diagnostics,omitempty"` - // ReliableCollectionsRefs - A list of ReliableCollection resources used by this particular code package. Please refer to ReliableCollectionsRef for more details. - ReliableCollectionsRefs *[]ReliableCollectionsRef `json:"reliableCollectionsRefs,omitempty"` - // InstanceView - READ-ONLY; Runtime information of a container instance. - InstanceView *ContainerInstanceView `json:"instanceView,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerCodePackageProperties. -func (ccpp ContainerCodePackageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ccpp.Name != nil { - objectMap["name"] = ccpp.Name - } - if ccpp.Image != nil { - objectMap["image"] = ccpp.Image - } - if ccpp.ImageRegistryCredential != nil { - objectMap["imageRegistryCredential"] = ccpp.ImageRegistryCredential - } - if ccpp.Entrypoint != nil { - objectMap["entrypoint"] = ccpp.Entrypoint - } - if ccpp.Commands != nil { - objectMap["commands"] = ccpp.Commands - } - if ccpp.EnvironmentVariables != nil { - objectMap["environmentVariables"] = ccpp.EnvironmentVariables - } - if ccpp.Settings != nil { - objectMap["settings"] = ccpp.Settings - } - if ccpp.Labels != nil { - objectMap["labels"] = ccpp.Labels - } - if ccpp.Endpoints != nil { - objectMap["endpoints"] = ccpp.Endpoints - } - if ccpp.Resources != nil { - objectMap["resources"] = ccpp.Resources - } - if ccpp.VolumeRefs != nil { - objectMap["volumeRefs"] = ccpp.VolumeRefs - } - if ccpp.Volumes != nil { - objectMap["volumes"] = ccpp.Volumes - } - if ccpp.Diagnostics != nil { - objectMap["diagnostics"] = ccpp.Diagnostics - } - if ccpp.ReliableCollectionsRefs != nil { - objectMap["reliableCollectionsRefs"] = ccpp.ReliableCollectionsRefs - } - return json.Marshal(objectMap) -} - -// ContainerEvent a container event. -type ContainerEvent struct { - // Name - The name of the container event. - Name *string `json:"name,omitempty"` - // Count - The count of the event. - Count *int32 `json:"count,omitempty"` - // FirstTimestamp - Date/time of the first event. - FirstTimestamp *string `json:"firstTimestamp,omitempty"` - // LastTimestamp - Date/time of the last event. - LastTimestamp *string `json:"lastTimestamp,omitempty"` - // Message - The event message - Message *string `json:"message,omitempty"` - // Type - The event type. - Type *string `json:"type,omitempty"` -} - -// ContainerInstanceView runtime information of a container instance. -type ContainerInstanceView struct { - // RestartCount - The number of times the container has been restarted. - RestartCount *int32 `json:"restartCount,omitempty"` - // CurrentState - Current container instance state. - CurrentState *ContainerState `json:"currentState,omitempty"` - // PreviousState - Previous container instance state. - PreviousState *ContainerState `json:"previousState,omitempty"` - // Events - The events of this container instance. - Events *[]ContainerEvent `json:"events,omitempty"` -} - -// ContainerLabel describes a container label. -type ContainerLabel struct { - // Name - The name of the container label. - Name *string `json:"name,omitempty"` - // Value - The value of the container label. - Value *string `json:"value,omitempty"` -} - -// ContainerLogs container logs. -type ContainerLogs struct { - autorest.Response `json:"-"` - // Content - Container logs. - Content *string `json:"content,omitempty"` -} - -// ContainerState the container state. -type ContainerState struct { - // State - The state of this container - State *string `json:"state,omitempty"` - // StartTime - Date/time when the container state started. - StartTime *date.Time `json:"startTime,omitempty"` - // ExitCode - The container exit code. - ExitCode *string `json:"exitCode,omitempty"` - // FinishTime - Date/time when the container state finished. - FinishTime *date.Time `json:"finishTime,omitempty"` - // DetailStatus - Human-readable status of this state. - DetailStatus *string `json:"detailStatus,omitempty"` -} - -// DiagnosticsDescription describes the diagnostics options available -type DiagnosticsDescription struct { - // Sinks - List of supported sinks that can be referenced. - Sinks *[]BasicDiagnosticsSinkProperties `json:"sinks,omitempty"` - // Enabled - Status of whether or not sinks are enabled. - Enabled *bool `json:"enabled,omitempty"` - // DefaultSinkRefs - The sinks to be used if diagnostics is enabled. Sink choices can be overridden at the service and code package level. - DefaultSinkRefs *[]string `json:"defaultSinkRefs,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for DiagnosticsDescription struct. -func (dd *DiagnosticsDescription) 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 "sinks": - if v != nil { - sinks, err := unmarshalBasicDiagnosticsSinkPropertiesArray(*v) - if err != nil { - return err - } - dd.Sinks = &sinks - } - case "enabled": - if v != nil { - var enabled bool - err = json.Unmarshal(*v, &enabled) - if err != nil { - return err - } - dd.Enabled = &enabled - } - case "defaultSinkRefs": - if v != nil { - var defaultSinkRefs []string - err = json.Unmarshal(*v, &defaultSinkRefs) - if err != nil { - return err - } - dd.DefaultSinkRefs = &defaultSinkRefs - } - } - } - - return nil -} - -// DiagnosticsRef reference to sinks in DiagnosticsDescription. -type DiagnosticsRef struct { - // Enabled - Status of whether or not sinks are enabled. - Enabled *bool `json:"enabled,omitempty"` - // SinkRefs - List of sinks to be used if enabled. References the list of sinks in DiagnosticsDescription. - SinkRefs *[]string `json:"sinkRefs,omitempty"` -} - -// BasicDiagnosticsSinkProperties properties of a DiagnosticsSink. -type BasicDiagnosticsSinkProperties interface { - AsAzureInternalMonitoringPipelineSinkDescription() (*AzureInternalMonitoringPipelineSinkDescription, bool) - AsDiagnosticsSinkProperties() (*DiagnosticsSinkProperties, bool) -} - -// DiagnosticsSinkProperties properties of a DiagnosticsSink. -type DiagnosticsSinkProperties struct { - // Name - Name of the sink. This value is referenced by DiagnosticsReferenceDescription - Name *string `json:"name,omitempty"` - // Description - A description of the sink. - Description *string `json:"description,omitempty"` - // Kind - Possible values include: 'KindDiagnosticsSinkProperties', 'KindAzureInternalMonitoringPipeline' - Kind KindBasicDiagnosticsSinkProperties `json:"kind,omitempty"` -} - -func unmarshalBasicDiagnosticsSinkProperties(body []byte) (BasicDiagnosticsSinkProperties, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["kind"] { - case string(KindAzureInternalMonitoringPipeline): - var aimpsd AzureInternalMonitoringPipelineSinkDescription - err := json.Unmarshal(body, &aimpsd) - return aimpsd, err - default: - var dsp DiagnosticsSinkProperties - err := json.Unmarshal(body, &dsp) - return dsp, err - } -} -func unmarshalBasicDiagnosticsSinkPropertiesArray(body []byte) ([]BasicDiagnosticsSinkProperties, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - dspArray := make([]BasicDiagnosticsSinkProperties, len(rawMessages)) - - for index, rawMessage := range rawMessages { - dsp, err := unmarshalBasicDiagnosticsSinkProperties(*rawMessage) - if err != nil { - return nil, err - } - dspArray[index] = dsp - } - return dspArray, nil -} - -// MarshalJSON is the custom marshaler for DiagnosticsSinkProperties. -func (dsp DiagnosticsSinkProperties) MarshalJSON() ([]byte, error) { - dsp.Kind = KindDiagnosticsSinkProperties - objectMap := make(map[string]interface{}) - if dsp.Name != nil { - objectMap["name"] = dsp.Name - } - if dsp.Description != nil { - objectMap["description"] = dsp.Description - } - if dsp.Kind != "" { - objectMap["kind"] = dsp.Kind - } - return json.Marshal(objectMap) -} - -// AsAzureInternalMonitoringPipelineSinkDescription is the BasicDiagnosticsSinkProperties implementation for DiagnosticsSinkProperties. -func (dsp DiagnosticsSinkProperties) AsAzureInternalMonitoringPipelineSinkDescription() (*AzureInternalMonitoringPipelineSinkDescription, bool) { - return nil, false -} - -// AsDiagnosticsSinkProperties is the BasicDiagnosticsSinkProperties implementation for DiagnosticsSinkProperties. -func (dsp DiagnosticsSinkProperties) AsDiagnosticsSinkProperties() (*DiagnosticsSinkProperties, bool) { - return &dsp, true -} - -// AsBasicDiagnosticsSinkProperties is the BasicDiagnosticsSinkProperties implementation for DiagnosticsSinkProperties. -func (dsp DiagnosticsSinkProperties) AsBasicDiagnosticsSinkProperties() (BasicDiagnosticsSinkProperties, bool) { - return &dsp, true -} - -// EndpointProperties describes a container endpoint. -type EndpointProperties struct { - // Name - The name of the endpoint. - Name *string `json:"name,omitempty"` - // Port - Port used by the container. - Port *int32 `json:"port,omitempty"` -} - -// EndpointRef describes a reference to a service endpoint. -type EndpointRef struct { - // Name - Name of the endpoint. - Name *string `json:"name,omitempty"` -} - -// EnvironmentVariable describes an environment variable for the container. -type EnvironmentVariable struct { - // Name - The name of the environment variable. - Name *string `json:"name,omitempty"` - // Value - The value of the environment variable. - Value *string `json:"value,omitempty"` -} - -// ErrorDetailsModel error model details information -type ErrorDetailsModel struct { - Code *string `json:"code,omitempty"` - // Message - Error message. - Message *string `json:"message,omitempty"` -} - -// ErrorErrorModel error model information -type ErrorErrorModel struct { - Code *string `json:"code,omitempty"` - // Message - Error message. - Message *string `json:"message,omitempty"` - InnerError *string `json:"innerError,omitempty"` - // Details - List of error message details. - Details *[]ErrorDetailsModel `json:"details,omitempty"` -} - -// ErrorModel the error details. -type ErrorModel struct { - // Error - Error model information - Error *ErrorErrorModel `json:"error,omitempty"` -} - -// GatewayDestination describes destination endpoint for routing traffic. -type GatewayDestination struct { - // ApplicationName - Name of the service fabric Mesh application. - ApplicationName *string `json:"applicationName,omitempty"` - // ServiceName - service that contains the endpoint. - ServiceName *string `json:"serviceName,omitempty"` - // EndpointName - name of the endpoint in the service. - EndpointName *string `json:"endpointName,omitempty"` -} - -// GatewayProperties describes properties of a gateway resource. -type GatewayProperties struct { - // Description - User readable description of the gateway. - Description *string `json:"description,omitempty"` - // SourceNetwork - Network the gateway should listen on for requests. - SourceNetwork *NetworkRef `json:"sourceNetwork,omitempty"` - // DestinationNetwork - Network that the Application is using. - DestinationNetwork *NetworkRef `json:"destinationNetwork,omitempty"` - // TCP - Configuration for tcp connectivity for this gateway. - TCP *[]TCPConfig `json:"tcp,omitempty"` - // HTTP - Configuration for http connectivity for this gateway. - HTTP *[]HTTPConfig `json:"http,omitempty"` - // Status - READ-ONLY; Status of the resource. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' - Status ResourceStatus `json:"status,omitempty"` - // StatusDetails - READ-ONLY; Gives additional information about the current status of the gateway. - StatusDetails *string `json:"statusDetails,omitempty"` - // IPAddress - READ-ONLY; IP address of the gateway. This is populated in the response and is ignored for incoming requests. - IPAddress *string `json:"ipAddress,omitempty"` -} - -// MarshalJSON is the custom marshaler for GatewayProperties. -func (gp GatewayProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gp.Description != nil { - objectMap["description"] = gp.Description - } - if gp.SourceNetwork != nil { - objectMap["sourceNetwork"] = gp.SourceNetwork - } - if gp.DestinationNetwork != nil { - objectMap["destinationNetwork"] = gp.DestinationNetwork - } - if gp.TCP != nil { - objectMap["tcp"] = gp.TCP - } - if gp.HTTP != nil { - objectMap["http"] = gp.HTTP - } - return json.Marshal(objectMap) -} - -// GatewayResourceDescription this type describes a gateway resource. -type GatewayResourceDescription struct { - autorest.Response `json:"-"` - // GatewayResourceProperties - This type describes properties of a gateway resource. - *GatewayResourceProperties `json:"properties,omitempty"` - // 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 identifier 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for GatewayResourceDescription. -func (grd GatewayResourceDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if grd.GatewayResourceProperties != nil { - objectMap["properties"] = grd.GatewayResourceProperties - } - if grd.Tags != nil { - objectMap["tags"] = grd.Tags - } - if grd.Location != nil { - objectMap["location"] = grd.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GatewayResourceDescription struct. -func (grd *GatewayResourceDescription) 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 gatewayResourceProperties GatewayResourceProperties - err = json.Unmarshal(*v, &gatewayResourceProperties) - if err != nil { - return err - } - grd.GatewayResourceProperties = &gatewayResourceProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - grd.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - grd.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - grd.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - grd.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - grd.Type = &typeVar - } - } - } - - return nil -} - -// GatewayResourceDescriptionList a pageable list of gateway resources. -type GatewayResourceDescriptionList struct { - autorest.Response `json:"-"` - // Value - One page of the list. - Value *[]GatewayResourceDescription `json:"value,omitempty"` - // NextLink - URI to fetch the next page of the list. - NextLink *string `json:"nextLink,omitempty"` -} - -// GatewayResourceDescriptionListIterator provides access to a complete listing of -// GatewayResourceDescription values. -type GatewayResourceDescriptionListIterator struct { - i int - page GatewayResourceDescriptionListPage -} - -// 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 *GatewayResourceDescriptionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GatewayResourceDescriptionListIterator.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 *GatewayResourceDescriptionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GatewayResourceDescriptionListIterator) 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 GatewayResourceDescriptionListIterator) Response() GatewayResourceDescriptionList { - 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 GatewayResourceDescriptionListIterator) Value() GatewayResourceDescription { - if !iter.page.NotDone() { - return GatewayResourceDescription{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GatewayResourceDescriptionListIterator type. -func NewGatewayResourceDescriptionListIterator(page GatewayResourceDescriptionListPage) GatewayResourceDescriptionListIterator { - return GatewayResourceDescriptionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (grdl GatewayResourceDescriptionList) IsEmpty() bool { - return grdl.Value == nil || len(*grdl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (grdl GatewayResourceDescriptionList) hasNextLink() bool { - return grdl.NextLink != nil && len(*grdl.NextLink) != 0 -} - -// gatewayResourceDescriptionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (grdl GatewayResourceDescriptionList) gatewayResourceDescriptionListPreparer(ctx context.Context) (*http.Request, error) { - if !grdl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(grdl.NextLink))) -} - -// GatewayResourceDescriptionListPage contains a page of GatewayResourceDescription values. -type GatewayResourceDescriptionListPage struct { - fn func(context.Context, GatewayResourceDescriptionList) (GatewayResourceDescriptionList, error) - grdl GatewayResourceDescriptionList -} - -// 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 *GatewayResourceDescriptionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GatewayResourceDescriptionListPage.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.grdl) - if err != nil { - return err - } - page.grdl = 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 *GatewayResourceDescriptionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GatewayResourceDescriptionListPage) NotDone() bool { - return !page.grdl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GatewayResourceDescriptionListPage) Response() GatewayResourceDescriptionList { - return page.grdl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GatewayResourceDescriptionListPage) Values() []GatewayResourceDescription { - if page.grdl.IsEmpty() { - return nil - } - return *page.grdl.Value -} - -// Creates a new instance of the GatewayResourceDescriptionListPage type. -func NewGatewayResourceDescriptionListPage(cur GatewayResourceDescriptionList, getNextPage func(context.Context, GatewayResourceDescriptionList) (GatewayResourceDescriptionList, error)) GatewayResourceDescriptionListPage { - return GatewayResourceDescriptionListPage{ - fn: getNextPage, - grdl: cur, - } -} - -// GatewayResourceProperties this type describes properties of a gateway resource. -type GatewayResourceProperties struct { - // ProvisioningState - READ-ONLY; State of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Description - User readable description of the gateway. - Description *string `json:"description,omitempty"` - // SourceNetwork - Network the gateway should listen on for requests. - SourceNetwork *NetworkRef `json:"sourceNetwork,omitempty"` - // DestinationNetwork - Network that the Application is using. - DestinationNetwork *NetworkRef `json:"destinationNetwork,omitempty"` - // TCP - Configuration for tcp connectivity for this gateway. - TCP *[]TCPConfig `json:"tcp,omitempty"` - // HTTP - Configuration for http connectivity for this gateway. - HTTP *[]HTTPConfig `json:"http,omitempty"` - // Status - READ-ONLY; Status of the resource. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' - Status ResourceStatus `json:"status,omitempty"` - // StatusDetails - READ-ONLY; Gives additional information about the current status of the gateway. - StatusDetails *string `json:"statusDetails,omitempty"` - // IPAddress - READ-ONLY; IP address of the gateway. This is populated in the response and is ignored for incoming requests. - IPAddress *string `json:"ipAddress,omitempty"` -} - -// MarshalJSON is the custom marshaler for GatewayResourceProperties. -func (grp GatewayResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if grp.Description != nil { - objectMap["description"] = grp.Description - } - if grp.SourceNetwork != nil { - objectMap["sourceNetwork"] = grp.SourceNetwork - } - if grp.DestinationNetwork != nil { - objectMap["destinationNetwork"] = grp.DestinationNetwork - } - if grp.TCP != nil { - objectMap["tcp"] = grp.TCP - } - if grp.HTTP != nil { - objectMap["http"] = grp.HTTP - } - return json.Marshal(objectMap) -} - -// HTTPConfig describes the http configuration for external connectivity for this network. -type HTTPConfig struct { - // Name - http gateway config name. - Name *string `json:"name,omitempty"` - // Port - Specifies the port at which the service endpoint below needs to be exposed. - Port *int32 `json:"port,omitempty"` - // Hosts - description for routing. - Hosts *[]HTTPHostConfig `json:"hosts,omitempty"` -} - -// HTTPHostConfig describes the hostname properties for http routing. -type HTTPHostConfig struct { - // Name - http hostname config name. - Name *string `json:"name,omitempty"` - // Routes - Route information to use for routing. Routes are processed in the order they are specified. Specify routes that are more specific before routes that can handle general cases. - Routes *[]HTTPRouteConfig `json:"routes,omitempty"` -} - -// HTTPRouteConfig describes the hostname properties for http routing. -type HTTPRouteConfig struct { - // Name - http route name. - Name *string `json:"name,omitempty"` - // Match - Describes a rule for http route matching. - Match *HTTPRouteMatchRule `json:"match,omitempty"` - // Destination - Describes destination endpoint for routing traffic. - Destination *GatewayDestination `json:"destination,omitempty"` -} - -// HTTPRouteMatchHeader describes header information for http route matching. -type HTTPRouteMatchHeader struct { - // Name - Name of header to match in request. - Name *string `json:"name,omitempty"` - // Value - Value of header to match in request. - Value *string `json:"value,omitempty"` - // Type - how to match header value. Possible values include: 'Exact' - Type HeaderMatchType `json:"type,omitempty"` -} - -// HTTPRouteMatchPath path to match for routing. -type HTTPRouteMatchPath struct { - // Value - Uri path to match for request. - Value *string `json:"value,omitempty"` - // Rewrite - replacement string for matched part of the Uri. - Rewrite *string `json:"rewrite,omitempty"` - // Type - how to match value in the Uri - Type *string `json:"type,omitempty"` -} - -// HTTPRouteMatchRule describes a rule for http route matching. -type HTTPRouteMatchRule struct { - // Path - Path to match for routing. - Path *HTTPRouteMatchPath `json:"path,omitempty"` - // Headers - headers and their values to match in request. - Headers *[]HTTPRouteMatchHeader `json:"headers,omitempty"` -} - -// ImageRegistryCredential image registry credential. -type ImageRegistryCredential struct { - // Server - Docker image registry server, without protocol such as `http` and `https`. - Server *string `json:"server,omitempty"` - // Username - The username for the private registry. - Username *string `json:"username,omitempty"` - // Password - The password for the private registry. The password is required for create or update operations, however it is not returned in the get or list operations. - Password *string `json:"password,omitempty"` -} - -// InlinedValueSecretResourceProperties describes the properties of a secret resource whose value is -// provided explicitly as plaintext. The secret resource may have multiple values, each being uniquely -// versioned. The secret value of each version is stored encrypted, and delivered as plaintext into the -// context of applications referencing it. -type InlinedValueSecretResourceProperties struct { - // Description - User readable description of the secret. - Description *string `json:"description,omitempty"` - // Status - READ-ONLY; Status of the resource. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' - Status ResourceStatus `json:"status,omitempty"` - // StatusDetails - READ-ONLY; Gives additional information about the current status of the secret. - StatusDetails *string `json:"statusDetails,omitempty"` - // ContentType - The type of the content stored in the secret value. The value of this property is opaque to Service Fabric. Once set, the value of this property cannot be changed. - ContentType *string `json:"contentType,omitempty"` - // ProvisioningState - READ-ONLY; State of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Kind - Possible values include: 'KindSecretResourcePropertiesBase', 'KindSecretResourceProperties', 'KindInlinedValue' - Kind Kind `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for InlinedValueSecretResourceProperties. -func (ivsrp InlinedValueSecretResourceProperties) MarshalJSON() ([]byte, error) { - ivsrp.Kind = KindInlinedValue - objectMap := make(map[string]interface{}) - if ivsrp.Description != nil { - objectMap["description"] = ivsrp.Description - } - if ivsrp.ContentType != nil { - objectMap["contentType"] = ivsrp.ContentType - } - if ivsrp.Kind != "" { - objectMap["kind"] = ivsrp.Kind - } - return json.Marshal(objectMap) -} - -// AsSecretResourceProperties is the BasicSecretResourcePropertiesBase implementation for InlinedValueSecretResourceProperties. -func (ivsrp InlinedValueSecretResourceProperties) AsSecretResourceProperties() (*SecretResourceProperties, bool) { - return nil, false -} - -// AsBasicSecretResourceProperties is the BasicSecretResourcePropertiesBase implementation for InlinedValueSecretResourceProperties. -func (ivsrp InlinedValueSecretResourceProperties) AsBasicSecretResourceProperties() (BasicSecretResourceProperties, bool) { - return &ivsrp, true -} - -// AsInlinedValueSecretResourceProperties is the BasicSecretResourcePropertiesBase implementation for InlinedValueSecretResourceProperties. -func (ivsrp InlinedValueSecretResourceProperties) AsInlinedValueSecretResourceProperties() (*InlinedValueSecretResourceProperties, bool) { - return &ivsrp, true -} - -// AsSecretResourcePropertiesBase is the BasicSecretResourcePropertiesBase implementation for InlinedValueSecretResourceProperties. -func (ivsrp InlinedValueSecretResourceProperties) AsSecretResourcePropertiesBase() (*SecretResourcePropertiesBase, bool) { - return nil, false -} - -// AsBasicSecretResourcePropertiesBase is the BasicSecretResourcePropertiesBase implementation for InlinedValueSecretResourceProperties. -func (ivsrp InlinedValueSecretResourceProperties) AsBasicSecretResourcePropertiesBase() (BasicSecretResourcePropertiesBase, bool) { - return &ivsrp, true -} - -// LocalNetworkResourceProperties information about a Service Fabric container network local to a single -// Service Fabric cluster. -type LocalNetworkResourceProperties struct { - // NetworkAddressPrefix - Address space for the local container network. - NetworkAddressPrefix *string `json:"networkAddressPrefix,omitempty"` - // Description - User readable description of the network. - Description *string `json:"description,omitempty"` - // Status - READ-ONLY; Status of the network. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' - Status ResourceStatus `json:"status,omitempty"` - // StatusDetails - READ-ONLY; Gives additional information about the current status of the network. - StatusDetails *string `json:"statusDetails,omitempty"` - // ProvisioningState - READ-ONLY; State of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Kind - Possible values include: 'KindNetworkResourcePropertiesBase', 'KindNetworkResourceProperties', 'KindLocal' - Kind KindBasicNetworkResourcePropertiesBase `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for LocalNetworkResourceProperties. -func (lnrp LocalNetworkResourceProperties) MarshalJSON() ([]byte, error) { - lnrp.Kind = KindLocal - objectMap := make(map[string]interface{}) - if lnrp.NetworkAddressPrefix != nil { - objectMap["networkAddressPrefix"] = lnrp.NetworkAddressPrefix - } - if lnrp.Description != nil { - objectMap["description"] = lnrp.Description - } - if lnrp.Kind != "" { - objectMap["kind"] = lnrp.Kind - } - return json.Marshal(objectMap) -} - -// AsNetworkResourceProperties is the BasicNetworkResourcePropertiesBase implementation for LocalNetworkResourceProperties. -func (lnrp LocalNetworkResourceProperties) AsNetworkResourceProperties() (*NetworkResourceProperties, bool) { - return nil, false -} - -// AsBasicNetworkResourceProperties is the BasicNetworkResourcePropertiesBase implementation for LocalNetworkResourceProperties. -func (lnrp LocalNetworkResourceProperties) AsBasicNetworkResourceProperties() (BasicNetworkResourceProperties, bool) { - return &lnrp, true -} - -// AsLocalNetworkResourceProperties is the BasicNetworkResourcePropertiesBase implementation for LocalNetworkResourceProperties. -func (lnrp LocalNetworkResourceProperties) AsLocalNetworkResourceProperties() (*LocalNetworkResourceProperties, bool) { - return &lnrp, true -} - -// AsNetworkResourcePropertiesBase is the BasicNetworkResourcePropertiesBase implementation for LocalNetworkResourceProperties. -func (lnrp LocalNetworkResourceProperties) AsNetworkResourcePropertiesBase() (*NetworkResourcePropertiesBase, bool) { - return nil, false -} - -// AsBasicNetworkResourcePropertiesBase is the BasicNetworkResourcePropertiesBase implementation for LocalNetworkResourceProperties. -func (lnrp LocalNetworkResourceProperties) AsBasicNetworkResourcePropertiesBase() (BasicNetworkResourcePropertiesBase, bool) { - return &lnrp, true -} - -// ManagedProxyResource the resource model definition for Azure Resource Manager proxy resource. It will -// have everything other than required location and tags. This proxy resource is explicitly created or -// updated by including it in the parent resource. -type ManagedProxyResource struct { - // ID - READ-ONLY; Fully qualified identifier for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ManagedProxyResource. -func (mpr ManagedProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mpr.Name != nil { - objectMap["name"] = mpr.Name - } - return json.Marshal(objectMap) -} - -// NetworkRef describes a network reference in a service. -type NetworkRef struct { - // Name - Name of the network - Name *string `json:"name,omitempty"` - // EndpointRefs - A list of endpoints that are exposed on this network. - EndpointRefs *[]EndpointRef `json:"endpointRefs,omitempty"` -} - -// NetworkResourceDescription this type describes a network resource. -type NetworkResourceDescription struct { - autorest.Response `json:"-"` - // Properties - Describes properties of a network resource. - Properties BasicNetworkResourceProperties `json:"properties,omitempty"` - // 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 identifier 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for NetworkResourceDescription. -func (nrd NetworkResourceDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = nrd.Properties - if nrd.Tags != nil { - objectMap["tags"] = nrd.Tags - } - if nrd.Location != nil { - objectMap["location"] = nrd.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for NetworkResourceDescription struct. -func (nrd *NetworkResourceDescription) 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 { - properties, err := unmarshalBasicNetworkResourceProperties(*v) - if err != nil { - return err - } - nrd.Properties = properties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - nrd.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - nrd.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - nrd.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - nrd.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - nrd.Type = &typeVar - } - } - } - - return nil -} - -// NetworkResourceDescriptionList a pageable list of network resources. -type NetworkResourceDescriptionList struct { - autorest.Response `json:"-"` - // Value - One page of the list. - Value *[]NetworkResourceDescription `json:"value,omitempty"` - // NextLink - URI to fetch the next page of the list. - NextLink *string `json:"nextLink,omitempty"` -} - -// NetworkResourceDescriptionListIterator provides access to a complete listing of -// NetworkResourceDescription values. -type NetworkResourceDescriptionListIterator struct { - i int - page NetworkResourceDescriptionListPage -} - -// 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 *NetworkResourceDescriptionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NetworkResourceDescriptionListIterator.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 *NetworkResourceDescriptionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter NetworkResourceDescriptionListIterator) 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 NetworkResourceDescriptionListIterator) Response() NetworkResourceDescriptionList { - 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 NetworkResourceDescriptionListIterator) Value() NetworkResourceDescription { - if !iter.page.NotDone() { - return NetworkResourceDescription{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the NetworkResourceDescriptionListIterator type. -func NewNetworkResourceDescriptionListIterator(page NetworkResourceDescriptionListPage) NetworkResourceDescriptionListIterator { - return NetworkResourceDescriptionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (nrdl NetworkResourceDescriptionList) IsEmpty() bool { - return nrdl.Value == nil || len(*nrdl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (nrdl NetworkResourceDescriptionList) hasNextLink() bool { - return nrdl.NextLink != nil && len(*nrdl.NextLink) != 0 -} - -// networkResourceDescriptionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (nrdl NetworkResourceDescriptionList) networkResourceDescriptionListPreparer(ctx context.Context) (*http.Request, error) { - if !nrdl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(nrdl.NextLink))) -} - -// NetworkResourceDescriptionListPage contains a page of NetworkResourceDescription values. -type NetworkResourceDescriptionListPage struct { - fn func(context.Context, NetworkResourceDescriptionList) (NetworkResourceDescriptionList, error) - nrdl NetworkResourceDescriptionList -} - -// 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 *NetworkResourceDescriptionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NetworkResourceDescriptionListPage.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.nrdl) - if err != nil { - return err - } - page.nrdl = 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 *NetworkResourceDescriptionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page NetworkResourceDescriptionListPage) NotDone() bool { - return !page.nrdl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page NetworkResourceDescriptionListPage) Response() NetworkResourceDescriptionList { - return page.nrdl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page NetworkResourceDescriptionListPage) Values() []NetworkResourceDescription { - if page.nrdl.IsEmpty() { - return nil - } - return *page.nrdl.Value -} - -// Creates a new instance of the NetworkResourceDescriptionListPage type. -func NewNetworkResourceDescriptionListPage(cur NetworkResourceDescriptionList, getNextPage func(context.Context, NetworkResourceDescriptionList) (NetworkResourceDescriptionList, error)) NetworkResourceDescriptionListPage { - return NetworkResourceDescriptionListPage{ - fn: getNextPage, - nrdl: cur, - } -} - -// BasicNetworkResourceProperties describes properties of a network resource. -type BasicNetworkResourceProperties interface { - AsLocalNetworkResourceProperties() (*LocalNetworkResourceProperties, bool) - AsNetworkResourceProperties() (*NetworkResourceProperties, bool) -} - -// NetworkResourceProperties describes properties of a network resource. -type NetworkResourceProperties struct { - // Description - User readable description of the network. - Description *string `json:"description,omitempty"` - // Status - READ-ONLY; Status of the network. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' - Status ResourceStatus `json:"status,omitempty"` - // StatusDetails - READ-ONLY; Gives additional information about the current status of the network. - StatusDetails *string `json:"statusDetails,omitempty"` - // Kind - Possible values include: 'KindNetworkResourcePropertiesBase', 'KindNetworkResourceProperties', 'KindLocal' - Kind KindBasicNetworkResourcePropertiesBase `json:"kind,omitempty"` - // ProvisioningState - READ-ONLY; State of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` -} - -func unmarshalBasicNetworkResourceProperties(body []byte) (BasicNetworkResourceProperties, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["kind"] { - case string(KindLocal): - var lnrp LocalNetworkResourceProperties - err := json.Unmarshal(body, &lnrp) - return lnrp, err - default: - var nrp NetworkResourceProperties - err := json.Unmarshal(body, &nrp) - return nrp, err - } -} -func unmarshalBasicNetworkResourcePropertiesArray(body []byte) ([]BasicNetworkResourceProperties, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - nrpArray := make([]BasicNetworkResourceProperties, len(rawMessages)) - - for index, rawMessage := range rawMessages { - nrp, err := unmarshalBasicNetworkResourceProperties(*rawMessage) - if err != nil { - return nil, err - } - nrpArray[index] = nrp - } - return nrpArray, nil -} - -// MarshalJSON is the custom marshaler for NetworkResourceProperties. -func (nrp NetworkResourceProperties) MarshalJSON() ([]byte, error) { - nrp.Kind = KindNetworkResourceProperties - objectMap := make(map[string]interface{}) - if nrp.Description != nil { - objectMap["description"] = nrp.Description - } - if nrp.Kind != "" { - objectMap["kind"] = nrp.Kind - } - return json.Marshal(objectMap) -} - -// AsNetworkResourceProperties is the BasicNetworkResourcePropertiesBase implementation for NetworkResourceProperties. -func (nrp NetworkResourceProperties) AsNetworkResourceProperties() (*NetworkResourceProperties, bool) { - return &nrp, true -} - -// AsBasicNetworkResourceProperties is the BasicNetworkResourcePropertiesBase implementation for NetworkResourceProperties. -func (nrp NetworkResourceProperties) AsBasicNetworkResourceProperties() (BasicNetworkResourceProperties, bool) { - return &nrp, true -} - -// AsLocalNetworkResourceProperties is the BasicNetworkResourcePropertiesBase implementation for NetworkResourceProperties. -func (nrp NetworkResourceProperties) AsLocalNetworkResourceProperties() (*LocalNetworkResourceProperties, bool) { - return nil, false -} - -// AsNetworkResourcePropertiesBase is the BasicNetworkResourcePropertiesBase implementation for NetworkResourceProperties. -func (nrp NetworkResourceProperties) AsNetworkResourcePropertiesBase() (*NetworkResourcePropertiesBase, bool) { - return nil, false -} - -// AsBasicNetworkResourcePropertiesBase is the BasicNetworkResourcePropertiesBase implementation for NetworkResourceProperties. -func (nrp NetworkResourceProperties) AsBasicNetworkResourcePropertiesBase() (BasicNetworkResourcePropertiesBase, bool) { - return &nrp, true -} - -// BasicNetworkResourcePropertiesBase this type describes the properties of a network resource, including its kind. -type BasicNetworkResourcePropertiesBase interface { - AsNetworkResourceProperties() (*NetworkResourceProperties, bool) - AsBasicNetworkResourceProperties() (BasicNetworkResourceProperties, bool) - AsLocalNetworkResourceProperties() (*LocalNetworkResourceProperties, bool) - AsNetworkResourcePropertiesBase() (*NetworkResourcePropertiesBase, bool) -} - -// NetworkResourcePropertiesBase this type describes the properties of a network resource, including its kind. -type NetworkResourcePropertiesBase struct { - // Kind - Possible values include: 'KindNetworkResourcePropertiesBase', 'KindNetworkResourceProperties', 'KindLocal' - Kind KindBasicNetworkResourcePropertiesBase `json:"kind,omitempty"` - // ProvisioningState - READ-ONLY; State of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` -} - -func unmarshalBasicNetworkResourcePropertiesBase(body []byte) (BasicNetworkResourcePropertiesBase, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["kind"] { - case string(KindNetworkResourceProperties): - var nrp NetworkResourceProperties - err := json.Unmarshal(body, &nrp) - return nrp, err - case string(KindLocal): - var lnrp LocalNetworkResourceProperties - err := json.Unmarshal(body, &lnrp) - return lnrp, err - default: - var nrpb NetworkResourcePropertiesBase - err := json.Unmarshal(body, &nrpb) - return nrpb, err - } -} -func unmarshalBasicNetworkResourcePropertiesBaseArray(body []byte) ([]BasicNetworkResourcePropertiesBase, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - nrpbArray := make([]BasicNetworkResourcePropertiesBase, len(rawMessages)) - - for index, rawMessage := range rawMessages { - nrpb, err := unmarshalBasicNetworkResourcePropertiesBase(*rawMessage) - if err != nil { - return nil, err - } - nrpbArray[index] = nrpb - } - return nrpbArray, nil -} - -// MarshalJSON is the custom marshaler for NetworkResourcePropertiesBase. -func (nrpb NetworkResourcePropertiesBase) MarshalJSON() ([]byte, error) { - nrpb.Kind = KindNetworkResourcePropertiesBase - objectMap := make(map[string]interface{}) - if nrpb.Kind != "" { - objectMap["kind"] = nrpb.Kind - } - return json.Marshal(objectMap) -} - -// AsNetworkResourceProperties is the BasicNetworkResourcePropertiesBase implementation for NetworkResourcePropertiesBase. -func (nrpb NetworkResourcePropertiesBase) AsNetworkResourceProperties() (*NetworkResourceProperties, bool) { - return nil, false -} - -// AsBasicNetworkResourceProperties is the BasicNetworkResourcePropertiesBase implementation for NetworkResourcePropertiesBase. -func (nrpb NetworkResourcePropertiesBase) AsBasicNetworkResourceProperties() (BasicNetworkResourceProperties, bool) { - return nil, false -} - -// AsLocalNetworkResourceProperties is the BasicNetworkResourcePropertiesBase implementation for NetworkResourcePropertiesBase. -func (nrpb NetworkResourcePropertiesBase) AsLocalNetworkResourceProperties() (*LocalNetworkResourceProperties, bool) { - return nil, false -} - -// AsNetworkResourcePropertiesBase is the BasicNetworkResourcePropertiesBase implementation for NetworkResourcePropertiesBase. -func (nrpb NetworkResourcePropertiesBase) AsNetworkResourcePropertiesBase() (*NetworkResourcePropertiesBase, bool) { - return &nrpb, true -} - -// AsBasicNetworkResourcePropertiesBase is the BasicNetworkResourcePropertiesBase implementation for NetworkResourcePropertiesBase. -func (nrpb NetworkResourcePropertiesBase) AsBasicNetworkResourcePropertiesBase() (BasicNetworkResourcePropertiesBase, bool) { - return &nrpb, true -} - -// OperationListResult describes the result of the request to list Service Fabric operations. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - List of Service Fabric operations supported by the Microsoft.ServiceFabric resource provider. - Value *[]OperationResult `json:"value,omitempty"` - // NextLink - READ-ONLY; URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationListResult. -func (olr OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if olr.Value != nil { - objectMap["value"] = olr.Value - } - return json.Marshal(objectMap) -} - -// OperationListResultIterator provides access to a complete listing of OperationResult values. -type OperationListResultIterator struct { - i int - page OperationListResultPage -} - -// 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 *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.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 *OperationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter OperationListResultIterator) 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 OperationListResultIterator) Response() OperationListResult { - 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 OperationListResultIterator) Value() OperationResult { - if !iter.page.NotDone() { - return OperationResult{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the OperationListResultIterator type. -func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { - return OperationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (olr OperationListResult) IsEmpty() bool { - return olr.Value == nil || len(*olr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (olr OperationListResult) hasNextLink() bool { - return olr.NextLink != nil && len(*olr.NextLink) != 0 -} - -// operationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !olr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(olr.NextLink))) -} - -// OperationListResultPage contains a page of OperationResult values. -type OperationListResultPage struct { - fn func(context.Context, OperationListResult) (OperationListResult, error) - olr OperationListResult -} - -// 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 *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.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.olr) - if err != nil { - return err - } - page.olr = 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 *OperationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OperationListResultPage) NotDone() bool { - return !page.olr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page OperationListResultPage) Response() OperationListResult { - return page.olr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page OperationListResultPage) Values() []OperationResult { - if page.olr.IsEmpty() { - return nil - } - return *page.olr.Value -} - -// Creates a new instance of the OperationListResultPage type. -func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { - return OperationListResultPage{ - fn: getNextPage, - olr: cur, - } -} - -// OperationResult list of operations available at the listed Azure resource provider. -type OperationResult struct { - // Name - The name of the operation. - Name *string `json:"name,omitempty"` - // Display - The object that represents the operation. - Display *AvailableOperationDisplay `json:"display,omitempty"` - // Origin - Origin result - Origin *string `json:"origin,omitempty"` - // NextLink - The URL to use for getting the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ProvisionedResourceProperties describes common properties of a provisioned resource. -type ProvisionedResourceProperties struct { - // ProvisioningState - READ-ONLY; State of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProvisionedResourceProperties. -func (prp ProvisionedResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ProxyResource the resource model definition for Azure Resource Manager proxy resource. It will have -// everything other than required location and tags. -type ProxyResource struct { - // ID - READ-ONLY; Fully qualified identifier 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. Ex- 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) -} - -// ReliableCollectionsRef specifying this parameter adds support for reliable collections -type ReliableCollectionsRef struct { - // Name - Name of ReliableCollection resource. Right now it's not used and you can use any string. - Name *string `json:"name,omitempty"` - // DoNotPersistState - False (the default) if ReliableCollections state is persisted to disk as usual. True if you do not want to persist state, in which case replication is still enabled and you can use ReliableCollections as distributed cache. - DoNotPersistState *bool `json:"doNotPersistState,omitempty"` -} - -// Resource the resource model definition for Azure Resource Manager resource. -type Resource struct { - // ID - READ-ONLY; Fully qualified identifier 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. Ex- 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) -} - -// ResourceLimits this type describes the resource limits for a given container. It describes the most -// amount of resources a container is allowed to use before being restarted. -type ResourceLimits struct { - // MemoryInGB - The memory limit in GB. - MemoryInGB *float64 `json:"memoryInGB,omitempty"` - // CPU - CPU limits in cores. At present, only full cores are supported. - CPU *float64 `json:"cpu,omitempty"` -} - -// ResourceRequests this type describes the requested resources for a given container. It describes the -// least amount of resources required for the container. A container can consume more than requested -// resources up to the specified limits before being restarted. Currently, the requested resources are -// treated as limits. -type ResourceRequests struct { - // MemoryInGB - The memory request in GB for this container. - MemoryInGB *float64 `json:"memoryInGB,omitempty"` - // CPU - Requested number of CPU cores. At present, only full cores are supported. - CPU *float64 `json:"cpu,omitempty"` -} - -// ResourceRequirements this type describes the resource requirements for a container or a service. -type ResourceRequirements struct { - // Requests - Describes the requested resources for a given container. - Requests *ResourceRequests `json:"requests,omitempty"` - // Limits - Describes the maximum limits on the resources for a given container. - Limits *ResourceLimits `json:"limits,omitempty"` -} - -// SecretResourceDescription this type describes a secret resource. -type SecretResourceDescription struct { - autorest.Response `json:"-"` - // Properties - Describes the properties of a secret resource. - Properties BasicSecretResourceProperties `json:"properties,omitempty"` - // 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 identifier 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecretResourceDescription. -func (srd SecretResourceDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = srd.Properties - if srd.Tags != nil { - objectMap["tags"] = srd.Tags - } - if srd.Location != nil { - objectMap["location"] = srd.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SecretResourceDescription struct. -func (srd *SecretResourceDescription) 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 { - properties, err := unmarshalBasicSecretResourceProperties(*v) - if err != nil { - return err - } - srd.Properties = properties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - srd.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - srd.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - srd.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - srd.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - srd.Type = &typeVar - } - } - } - - return nil -} - -// SecretResourceDescriptionList a pageable list of secret resources. -type SecretResourceDescriptionList struct { - autorest.Response `json:"-"` - // Value - One page of the list. - Value *[]SecretResourceDescription `json:"value,omitempty"` - // NextLink - URI to fetch the next page of the list. - NextLink *string `json:"nextLink,omitempty"` -} - -// SecretResourceDescriptionListIterator provides access to a complete listing of SecretResourceDescription -// values. -type SecretResourceDescriptionListIterator struct { - i int - page SecretResourceDescriptionListPage -} - -// 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 *SecretResourceDescriptionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretResourceDescriptionListIterator.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 *SecretResourceDescriptionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecretResourceDescriptionListIterator) 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 SecretResourceDescriptionListIterator) Response() SecretResourceDescriptionList { - 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 SecretResourceDescriptionListIterator) Value() SecretResourceDescription { - if !iter.page.NotDone() { - return SecretResourceDescription{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SecretResourceDescriptionListIterator type. -func NewSecretResourceDescriptionListIterator(page SecretResourceDescriptionListPage) SecretResourceDescriptionListIterator { - return SecretResourceDescriptionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (srdl SecretResourceDescriptionList) IsEmpty() bool { - return srdl.Value == nil || len(*srdl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (srdl SecretResourceDescriptionList) hasNextLink() bool { - return srdl.NextLink != nil && len(*srdl.NextLink) != 0 -} - -// secretResourceDescriptionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (srdl SecretResourceDescriptionList) secretResourceDescriptionListPreparer(ctx context.Context) (*http.Request, error) { - if !srdl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(srdl.NextLink))) -} - -// SecretResourceDescriptionListPage contains a page of SecretResourceDescription values. -type SecretResourceDescriptionListPage struct { - fn func(context.Context, SecretResourceDescriptionList) (SecretResourceDescriptionList, error) - srdl SecretResourceDescriptionList -} - -// 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 *SecretResourceDescriptionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretResourceDescriptionListPage.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.srdl) - if err != nil { - return err - } - page.srdl = 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 *SecretResourceDescriptionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecretResourceDescriptionListPage) NotDone() bool { - return !page.srdl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SecretResourceDescriptionListPage) Response() SecretResourceDescriptionList { - return page.srdl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SecretResourceDescriptionListPage) Values() []SecretResourceDescription { - if page.srdl.IsEmpty() { - return nil - } - return *page.srdl.Value -} - -// Creates a new instance of the SecretResourceDescriptionListPage type. -func NewSecretResourceDescriptionListPage(cur SecretResourceDescriptionList, getNextPage func(context.Context, SecretResourceDescriptionList) (SecretResourceDescriptionList, error)) SecretResourceDescriptionListPage { - return SecretResourceDescriptionListPage{ - fn: getNextPage, - srdl: cur, - } -} - -// BasicSecretResourceProperties describes the properties of a secret resource. -type BasicSecretResourceProperties interface { - AsInlinedValueSecretResourceProperties() (*InlinedValueSecretResourceProperties, bool) - AsSecretResourceProperties() (*SecretResourceProperties, bool) -} - -// SecretResourceProperties describes the properties of a secret resource. -type SecretResourceProperties struct { - // Description - User readable description of the secret. - Description *string `json:"description,omitempty"` - // Status - READ-ONLY; Status of the resource. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' - Status ResourceStatus `json:"status,omitempty"` - // StatusDetails - READ-ONLY; Gives additional information about the current status of the secret. - StatusDetails *string `json:"statusDetails,omitempty"` - // ContentType - The type of the content stored in the secret value. The value of this property is opaque to Service Fabric. Once set, the value of this property cannot be changed. - ContentType *string `json:"contentType,omitempty"` - // Kind - Possible values include: 'KindSecretResourcePropertiesBase', 'KindSecretResourceProperties', 'KindInlinedValue' - Kind Kind `json:"kind,omitempty"` - // ProvisioningState - READ-ONLY; State of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` -} - -func unmarshalBasicSecretResourceProperties(body []byte) (BasicSecretResourceProperties, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["kind"] { - case string(KindInlinedValue): - var ivsrp InlinedValueSecretResourceProperties - err := json.Unmarshal(body, &ivsrp) - return ivsrp, err - default: - var srp SecretResourceProperties - err := json.Unmarshal(body, &srp) - return srp, err - } -} -func unmarshalBasicSecretResourcePropertiesArray(body []byte) ([]BasicSecretResourceProperties, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - srpArray := make([]BasicSecretResourceProperties, len(rawMessages)) - - for index, rawMessage := range rawMessages { - srp, err := unmarshalBasicSecretResourceProperties(*rawMessage) - if err != nil { - return nil, err - } - srpArray[index] = srp - } - return srpArray, nil -} - -// MarshalJSON is the custom marshaler for SecretResourceProperties. -func (srp SecretResourceProperties) MarshalJSON() ([]byte, error) { - srp.Kind = KindSecretResourceProperties - objectMap := make(map[string]interface{}) - if srp.Description != nil { - objectMap["description"] = srp.Description - } - if srp.ContentType != nil { - objectMap["contentType"] = srp.ContentType - } - if srp.Kind != "" { - objectMap["kind"] = srp.Kind - } - return json.Marshal(objectMap) -} - -// AsSecretResourceProperties is the BasicSecretResourcePropertiesBase implementation for SecretResourceProperties. -func (srp SecretResourceProperties) AsSecretResourceProperties() (*SecretResourceProperties, bool) { - return &srp, true -} - -// AsBasicSecretResourceProperties is the BasicSecretResourcePropertiesBase implementation for SecretResourceProperties. -func (srp SecretResourceProperties) AsBasicSecretResourceProperties() (BasicSecretResourceProperties, bool) { - return &srp, true -} - -// AsInlinedValueSecretResourceProperties is the BasicSecretResourcePropertiesBase implementation for SecretResourceProperties. -func (srp SecretResourceProperties) AsInlinedValueSecretResourceProperties() (*InlinedValueSecretResourceProperties, bool) { - return nil, false -} - -// AsSecretResourcePropertiesBase is the BasicSecretResourcePropertiesBase implementation for SecretResourceProperties. -func (srp SecretResourceProperties) AsSecretResourcePropertiesBase() (*SecretResourcePropertiesBase, bool) { - return nil, false -} - -// AsBasicSecretResourcePropertiesBase is the BasicSecretResourcePropertiesBase implementation for SecretResourceProperties. -func (srp SecretResourceProperties) AsBasicSecretResourcePropertiesBase() (BasicSecretResourcePropertiesBase, bool) { - return &srp, true -} - -// BasicSecretResourcePropertiesBase this type describes the properties of a secret resource, including its kind. -type BasicSecretResourcePropertiesBase interface { - AsSecretResourceProperties() (*SecretResourceProperties, bool) - AsBasicSecretResourceProperties() (BasicSecretResourceProperties, bool) - AsInlinedValueSecretResourceProperties() (*InlinedValueSecretResourceProperties, bool) - AsSecretResourcePropertiesBase() (*SecretResourcePropertiesBase, bool) -} - -// SecretResourcePropertiesBase this type describes the properties of a secret resource, including its kind. -type SecretResourcePropertiesBase struct { - // Kind - Possible values include: 'KindSecretResourcePropertiesBase', 'KindSecretResourceProperties', 'KindInlinedValue' - Kind Kind `json:"kind,omitempty"` - // ProvisioningState - READ-ONLY; State of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` -} - -func unmarshalBasicSecretResourcePropertiesBase(body []byte) (BasicSecretResourcePropertiesBase, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["kind"] { - case string(KindSecretResourceProperties): - var srp SecretResourceProperties - err := json.Unmarshal(body, &srp) - return srp, err - case string(KindInlinedValue): - var ivsrp InlinedValueSecretResourceProperties - err := json.Unmarshal(body, &ivsrp) - return ivsrp, err - default: - var srpb SecretResourcePropertiesBase - err := json.Unmarshal(body, &srpb) - return srpb, err - } -} -func unmarshalBasicSecretResourcePropertiesBaseArray(body []byte) ([]BasicSecretResourcePropertiesBase, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - srpbArray := make([]BasicSecretResourcePropertiesBase, len(rawMessages)) - - for index, rawMessage := range rawMessages { - srpb, err := unmarshalBasicSecretResourcePropertiesBase(*rawMessage) - if err != nil { - return nil, err - } - srpbArray[index] = srpb - } - return srpbArray, nil -} - -// MarshalJSON is the custom marshaler for SecretResourcePropertiesBase. -func (srpb SecretResourcePropertiesBase) MarshalJSON() ([]byte, error) { - srpb.Kind = KindSecretResourcePropertiesBase - objectMap := make(map[string]interface{}) - if srpb.Kind != "" { - objectMap["kind"] = srpb.Kind - } - return json.Marshal(objectMap) -} - -// AsSecretResourceProperties is the BasicSecretResourcePropertiesBase implementation for SecretResourcePropertiesBase. -func (srpb SecretResourcePropertiesBase) AsSecretResourceProperties() (*SecretResourceProperties, bool) { - return nil, false -} - -// AsBasicSecretResourceProperties is the BasicSecretResourcePropertiesBase implementation for SecretResourcePropertiesBase. -func (srpb SecretResourcePropertiesBase) AsBasicSecretResourceProperties() (BasicSecretResourceProperties, bool) { - return nil, false -} - -// AsInlinedValueSecretResourceProperties is the BasicSecretResourcePropertiesBase implementation for SecretResourcePropertiesBase. -func (srpb SecretResourcePropertiesBase) AsInlinedValueSecretResourceProperties() (*InlinedValueSecretResourceProperties, bool) { - return nil, false -} - -// AsSecretResourcePropertiesBase is the BasicSecretResourcePropertiesBase implementation for SecretResourcePropertiesBase. -func (srpb SecretResourcePropertiesBase) AsSecretResourcePropertiesBase() (*SecretResourcePropertiesBase, bool) { - return &srpb, true -} - -// AsBasicSecretResourcePropertiesBase is the BasicSecretResourcePropertiesBase implementation for SecretResourcePropertiesBase. -func (srpb SecretResourcePropertiesBase) AsBasicSecretResourcePropertiesBase() (BasicSecretResourcePropertiesBase, bool) { - return &srpb, true -} - -// SecretValue this type represents the unencrypted value of the secret. -type SecretValue struct { - autorest.Response `json:"-"` - // Value - The actual value of the secret. - Value *string `json:"value,omitempty"` -} - -// SecretValueProperties this type describes properties of secret value resource. -type SecretValueProperties struct { - // Value - The actual value of the secret. - Value *string `json:"value,omitempty"` -} - -// SecretValueResourceDescription this type describes a value of a secret resource. The name of this -// resource is the version identifier corresponding to this secret value. -type SecretValueResourceDescription struct { - autorest.Response `json:"-"` - // SecretValueResourceProperties - This type describes properties of a secret value resource. - *SecretValueResourceProperties `json:"properties,omitempty"` - // 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 identifier 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecretValueResourceDescription. -func (svrd SecretValueResourceDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if svrd.SecretValueResourceProperties != nil { - objectMap["properties"] = svrd.SecretValueResourceProperties - } - if svrd.Tags != nil { - objectMap["tags"] = svrd.Tags - } - if svrd.Location != nil { - objectMap["location"] = svrd.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SecretValueResourceDescription struct. -func (svrd *SecretValueResourceDescription) 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 secretValueResourceProperties SecretValueResourceProperties - err = json.Unmarshal(*v, &secretValueResourceProperties) - if err != nil { - return err - } - svrd.SecretValueResourceProperties = &secretValueResourceProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - svrd.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - svrd.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - svrd.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - svrd.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - svrd.Type = &typeVar - } - } - } - - return nil -} - -// SecretValueResourceDescriptionList a pageable list of values of a secret resource. The information does -// not include only the name of the value and not the actual unencrypted value. -type SecretValueResourceDescriptionList struct { - autorest.Response `json:"-"` - // Value - One page of the list. - Value *[]SecretValueResourceDescription `json:"value,omitempty"` - // NextLink - URI to fetch the next page of the list. - NextLink *string `json:"nextLink,omitempty"` -} - -// SecretValueResourceDescriptionListIterator provides access to a complete listing of -// SecretValueResourceDescription values. -type SecretValueResourceDescriptionListIterator struct { - i int - page SecretValueResourceDescriptionListPage -} - -// 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 *SecretValueResourceDescriptionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretValueResourceDescriptionListIterator.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 *SecretValueResourceDescriptionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecretValueResourceDescriptionListIterator) 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 SecretValueResourceDescriptionListIterator) Response() SecretValueResourceDescriptionList { - 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 SecretValueResourceDescriptionListIterator) Value() SecretValueResourceDescription { - if !iter.page.NotDone() { - return SecretValueResourceDescription{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SecretValueResourceDescriptionListIterator type. -func NewSecretValueResourceDescriptionListIterator(page SecretValueResourceDescriptionListPage) SecretValueResourceDescriptionListIterator { - return SecretValueResourceDescriptionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (svrdl SecretValueResourceDescriptionList) IsEmpty() bool { - return svrdl.Value == nil || len(*svrdl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (svrdl SecretValueResourceDescriptionList) hasNextLink() bool { - return svrdl.NextLink != nil && len(*svrdl.NextLink) != 0 -} - -// secretValueResourceDescriptionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (svrdl SecretValueResourceDescriptionList) secretValueResourceDescriptionListPreparer(ctx context.Context) (*http.Request, error) { - if !svrdl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(svrdl.NextLink))) -} - -// SecretValueResourceDescriptionListPage contains a page of SecretValueResourceDescription values. -type SecretValueResourceDescriptionListPage struct { - fn func(context.Context, SecretValueResourceDescriptionList) (SecretValueResourceDescriptionList, error) - svrdl SecretValueResourceDescriptionList -} - -// 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 *SecretValueResourceDescriptionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretValueResourceDescriptionListPage.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.svrdl) - if err != nil { - return err - } - page.svrdl = 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 *SecretValueResourceDescriptionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecretValueResourceDescriptionListPage) NotDone() bool { - return !page.svrdl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SecretValueResourceDescriptionListPage) Response() SecretValueResourceDescriptionList { - return page.svrdl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SecretValueResourceDescriptionListPage) Values() []SecretValueResourceDescription { - if page.svrdl.IsEmpty() { - return nil - } - return *page.svrdl.Value -} - -// Creates a new instance of the SecretValueResourceDescriptionListPage type. -func NewSecretValueResourceDescriptionListPage(cur SecretValueResourceDescriptionList, getNextPage func(context.Context, SecretValueResourceDescriptionList) (SecretValueResourceDescriptionList, error)) SecretValueResourceDescriptionListPage { - return SecretValueResourceDescriptionListPage{ - fn: getNextPage, - svrdl: cur, - } -} - -// SecretValueResourceProperties this type describes properties of a secret value resource. -type SecretValueResourceProperties struct { - // ProvisioningState - READ-ONLY; State of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Value - The actual value of the secret. - Value *string `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecretValueResourceProperties. -func (svrp SecretValueResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if svrp.Value != nil { - objectMap["value"] = svrp.Value - } - return json.Marshal(objectMap) -} - -// ServiceProperties describes properties of a service resource. -type ServiceProperties struct { - // Description - User readable description of the service. - Description *string `json:"description,omitempty"` - // ReplicaCount - The number of replicas of the service to create. Defaults to 1 if not specified. - ReplicaCount *int32 `json:"replicaCount,omitempty"` - // AutoScalingPolicies - Auto scaling policies - AutoScalingPolicies *[]AutoScalingPolicy `json:"autoScalingPolicies,omitempty"` - // Status - READ-ONLY; Status of the service. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' - Status ResourceStatus `json:"status,omitempty"` - // StatusDetails - READ-ONLY; Gives additional information about the current status of the service. - StatusDetails *string `json:"statusDetails,omitempty"` - // HealthState - READ-ONLY; Describes the health state of an application resource. Possible values include: 'HealthStateInvalid', 'HealthStateOk', 'HealthStateWarning', 'HealthStateError', 'HealthStateUnknown' - HealthState HealthState `json:"healthState,omitempty"` - // UnhealthyEvaluation - READ-ONLY; When the service's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the service is marked unhealthy. - UnhealthyEvaluation *string `json:"unhealthyEvaluation,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceProperties. -func (sp ServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sp.Description != nil { - objectMap["description"] = sp.Description - } - if sp.ReplicaCount != nil { - objectMap["replicaCount"] = sp.ReplicaCount - } - if sp.AutoScalingPolicies != nil { - objectMap["autoScalingPolicies"] = sp.AutoScalingPolicies - } - return json.Marshal(objectMap) -} - -// ServiceReplicaDescription describes a replica of a service resource. -type ServiceReplicaDescription struct { - autorest.Response `json:"-"` - // ReplicaName - Name of the replica. - ReplicaName *string `json:"replicaName,omitempty"` - // OsType - The operation system required by the code in service. Possible values include: 'Linux', 'Windows' - OsType OperatingSystemType `json:"osType,omitempty"` - // CodePackages - Describes the set of code packages that forms the service. A code package describes the container and the properties for running it. All the code packages are started together on the same host and share the same context (network, process etc.). - CodePackages *[]ContainerCodePackageProperties `json:"codePackages,omitempty"` - // NetworkRefs - The names of the private networks that this service needs to be part of. - NetworkRefs *[]NetworkRef `json:"networkRefs,omitempty"` - // Diagnostics - Reference to sinks in DiagnosticsDescription. - Diagnostics *DiagnosticsRef `json:"diagnostics,omitempty"` -} - -// ServiceReplicaDescriptionList a pageable list of service replicas. -type ServiceReplicaDescriptionList struct { - autorest.Response `json:"-"` - // Value - One page of the list. - Value *[]ServiceReplicaDescription `json:"value,omitempty"` - // NextLink - URI to fetch the next page of the list. - NextLink *string `json:"nextLink,omitempty"` -} - -// ServiceReplicaDescriptionListIterator provides access to a complete listing of ServiceReplicaDescription -// values. -type ServiceReplicaDescriptionListIterator struct { - i int - page ServiceReplicaDescriptionListPage -} - -// 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 *ServiceReplicaDescriptionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceReplicaDescriptionListIterator.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 *ServiceReplicaDescriptionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ServiceReplicaDescriptionListIterator) 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 ServiceReplicaDescriptionListIterator) Response() ServiceReplicaDescriptionList { - 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 ServiceReplicaDescriptionListIterator) Value() ServiceReplicaDescription { - if !iter.page.NotDone() { - return ServiceReplicaDescription{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ServiceReplicaDescriptionListIterator type. -func NewServiceReplicaDescriptionListIterator(page ServiceReplicaDescriptionListPage) ServiceReplicaDescriptionListIterator { - return ServiceReplicaDescriptionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (srdl ServiceReplicaDescriptionList) IsEmpty() bool { - return srdl.Value == nil || len(*srdl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (srdl ServiceReplicaDescriptionList) hasNextLink() bool { - return srdl.NextLink != nil && len(*srdl.NextLink) != 0 -} - -// serviceReplicaDescriptionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (srdl ServiceReplicaDescriptionList) serviceReplicaDescriptionListPreparer(ctx context.Context) (*http.Request, error) { - if !srdl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(srdl.NextLink))) -} - -// ServiceReplicaDescriptionListPage contains a page of ServiceReplicaDescription values. -type ServiceReplicaDescriptionListPage struct { - fn func(context.Context, ServiceReplicaDescriptionList) (ServiceReplicaDescriptionList, error) - srdl ServiceReplicaDescriptionList -} - -// 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 *ServiceReplicaDescriptionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceReplicaDescriptionListPage.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.srdl) - if err != nil { - return err - } - page.srdl = 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 *ServiceReplicaDescriptionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ServiceReplicaDescriptionListPage) NotDone() bool { - return !page.srdl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ServiceReplicaDescriptionListPage) Response() ServiceReplicaDescriptionList { - return page.srdl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ServiceReplicaDescriptionListPage) Values() []ServiceReplicaDescription { - if page.srdl.IsEmpty() { - return nil - } - return *page.srdl.Value -} - -// Creates a new instance of the ServiceReplicaDescriptionListPage type. -func NewServiceReplicaDescriptionListPage(cur ServiceReplicaDescriptionList, getNextPage func(context.Context, ServiceReplicaDescriptionList) (ServiceReplicaDescriptionList, error)) ServiceReplicaDescriptionListPage { - return ServiceReplicaDescriptionListPage{ - fn: getNextPage, - srdl: cur, - } -} - -// ServiceReplicaProperties describes the properties of a service replica. -type ServiceReplicaProperties struct { - // OsType - The operation system required by the code in service. Possible values include: 'Linux', 'Windows' - OsType OperatingSystemType `json:"osType,omitempty"` - // CodePackages - Describes the set of code packages that forms the service. A code package describes the container and the properties for running it. All the code packages are started together on the same host and share the same context (network, process etc.). - CodePackages *[]ContainerCodePackageProperties `json:"codePackages,omitempty"` - // NetworkRefs - The names of the private networks that this service needs to be part of. - NetworkRefs *[]NetworkRef `json:"networkRefs,omitempty"` - // Diagnostics - Reference to sinks in DiagnosticsDescription. - Diagnostics *DiagnosticsRef `json:"diagnostics,omitempty"` -} - -// ServiceResourceDescription this type describes a service resource. -type ServiceResourceDescription struct { - autorest.Response `json:"-"` - // ServiceResourceProperties - This type describes properties of a service resource. - *ServiceResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified identifier for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceResourceDescription. -func (srd ServiceResourceDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if srd.ServiceResourceProperties != nil { - objectMap["properties"] = srd.ServiceResourceProperties - } - if srd.Name != nil { - objectMap["name"] = srd.Name - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServiceResourceDescription struct. -func (srd *ServiceResourceDescription) 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 serviceResourceProperties ServiceResourceProperties - err = json.Unmarshal(*v, &serviceResourceProperties) - if err != nil { - return err - } - srd.ServiceResourceProperties = &serviceResourceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - srd.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - srd.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - srd.Type = &typeVar - } - } - } - - return nil -} - -// ServiceResourceDescriptionList a pageable list of service resources. -type ServiceResourceDescriptionList struct { - autorest.Response `json:"-"` - // Value - One page of the list. - Value *[]ServiceResourceDescription `json:"value,omitempty"` - // NextLink - URI to fetch the next page of the list. - NextLink *string `json:"nextLink,omitempty"` -} - -// ServiceResourceDescriptionListIterator provides access to a complete listing of -// ServiceResourceDescription values. -type ServiceResourceDescriptionListIterator struct { - i int - page ServiceResourceDescriptionListPage -} - -// 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 *ServiceResourceDescriptionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceResourceDescriptionListIterator.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 *ServiceResourceDescriptionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ServiceResourceDescriptionListIterator) 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 ServiceResourceDescriptionListIterator) Response() ServiceResourceDescriptionList { - 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 ServiceResourceDescriptionListIterator) Value() ServiceResourceDescription { - if !iter.page.NotDone() { - return ServiceResourceDescription{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ServiceResourceDescriptionListIterator type. -func NewServiceResourceDescriptionListIterator(page ServiceResourceDescriptionListPage) ServiceResourceDescriptionListIterator { - return ServiceResourceDescriptionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (srdl ServiceResourceDescriptionList) IsEmpty() bool { - return srdl.Value == nil || len(*srdl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (srdl ServiceResourceDescriptionList) hasNextLink() bool { - return srdl.NextLink != nil && len(*srdl.NextLink) != 0 -} - -// serviceResourceDescriptionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (srdl ServiceResourceDescriptionList) serviceResourceDescriptionListPreparer(ctx context.Context) (*http.Request, error) { - if !srdl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(srdl.NextLink))) -} - -// ServiceResourceDescriptionListPage contains a page of ServiceResourceDescription values. -type ServiceResourceDescriptionListPage struct { - fn func(context.Context, ServiceResourceDescriptionList) (ServiceResourceDescriptionList, error) - srdl ServiceResourceDescriptionList -} - -// 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 *ServiceResourceDescriptionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceResourceDescriptionListPage.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.srdl) - if err != nil { - return err - } - page.srdl = 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 *ServiceResourceDescriptionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ServiceResourceDescriptionListPage) NotDone() bool { - return !page.srdl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ServiceResourceDescriptionListPage) Response() ServiceResourceDescriptionList { - return page.srdl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ServiceResourceDescriptionListPage) Values() []ServiceResourceDescription { - if page.srdl.IsEmpty() { - return nil - } - return *page.srdl.Value -} - -// Creates a new instance of the ServiceResourceDescriptionListPage type. -func NewServiceResourceDescriptionListPage(cur ServiceResourceDescriptionList, getNextPage func(context.Context, ServiceResourceDescriptionList) (ServiceResourceDescriptionList, error)) ServiceResourceDescriptionListPage { - return ServiceResourceDescriptionListPage{ - fn: getNextPage, - srdl: cur, - } -} - -// ServiceResourceProperties this type describes properties of a service resource. -type ServiceResourceProperties struct { - // ProvisioningState - READ-ONLY; State of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // OsType - The operation system required by the code in service. Possible values include: 'Linux', 'Windows' - OsType OperatingSystemType `json:"osType,omitempty"` - // CodePackages - Describes the set of code packages that forms the service. A code package describes the container and the properties for running it. All the code packages are started together on the same host and share the same context (network, process etc.). - CodePackages *[]ContainerCodePackageProperties `json:"codePackages,omitempty"` - // NetworkRefs - The names of the private networks that this service needs to be part of. - NetworkRefs *[]NetworkRef `json:"networkRefs,omitempty"` - // Diagnostics - Reference to sinks in DiagnosticsDescription. - Diagnostics *DiagnosticsRef `json:"diagnostics,omitempty"` - // Description - User readable description of the service. - Description *string `json:"description,omitempty"` - // ReplicaCount - The number of replicas of the service to create. Defaults to 1 if not specified. - ReplicaCount *int32 `json:"replicaCount,omitempty"` - // AutoScalingPolicies - Auto scaling policies - AutoScalingPolicies *[]AutoScalingPolicy `json:"autoScalingPolicies,omitempty"` - // Status - READ-ONLY; Status of the service. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' - Status ResourceStatus `json:"status,omitempty"` - // StatusDetails - READ-ONLY; Gives additional information about the current status of the service. - StatusDetails *string `json:"statusDetails,omitempty"` - // HealthState - READ-ONLY; Describes the health state of an application resource. Possible values include: 'HealthStateInvalid', 'HealthStateOk', 'HealthStateWarning', 'HealthStateError', 'HealthStateUnknown' - HealthState HealthState `json:"healthState,omitempty"` - // UnhealthyEvaluation - READ-ONLY; When the service's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the service is marked unhealthy. - UnhealthyEvaluation *string `json:"unhealthyEvaluation,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceResourceProperties. -func (srp ServiceResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if srp.OsType != "" { - objectMap["osType"] = srp.OsType - } - if srp.CodePackages != nil { - objectMap["codePackages"] = srp.CodePackages - } - if srp.NetworkRefs != nil { - objectMap["networkRefs"] = srp.NetworkRefs - } - if srp.Diagnostics != nil { - objectMap["diagnostics"] = srp.Diagnostics - } - if srp.Description != nil { - objectMap["description"] = srp.Description - } - if srp.ReplicaCount != nil { - objectMap["replicaCount"] = srp.ReplicaCount - } - if srp.AutoScalingPolicies != nil { - objectMap["autoScalingPolicies"] = srp.AutoScalingPolicies - } - return json.Marshal(objectMap) -} - -// Setting describes a setting for the container. The setting file path can be fetched from environment -// variable "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The path for Linux -// container is "/var/secrets". -type Setting struct { - // Name - The name of the setting. - Name *string `json:"name,omitempty"` - // Value - The value of the setting. - Value *string `json:"value,omitempty"` -} - -// TCPConfig describes the tcp configuration for external connectivity for this network. -type TCPConfig struct { - // Name - tcp gateway config name. - Name *string `json:"name,omitempty"` - // Port - Specifies the port at which the service endpoint below needs to be exposed. - Port *int32 `json:"port,omitempty"` - // Destination - Describes destination endpoint for routing traffic. - Destination *GatewayDestination `json:"destination,omitempty"` -} - -// TrackedResource the resource model definition for Azure Resource Manager tracked top-level resource. -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 identifier 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. Ex- 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) -} - -// VolumeProperties describes properties of a volume resource. -type VolumeProperties struct { - // Description - User readable description of the volume. - Description *string `json:"description,omitempty"` - // Status - READ-ONLY; Status of the volume. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' - Status ResourceStatus `json:"status,omitempty"` - // StatusDetails - READ-ONLY; Gives additional information about the current status of the volume. - StatusDetails *string `json:"statusDetails,omitempty"` - // Provider - Provider of the volume. - Provider *string `json:"provider,omitempty"` - // AzureFileParameters - This type describes a volume provided by an Azure Files file share. - AzureFileParameters *VolumeProviderParametersAzureFile `json:"azureFileParameters,omitempty"` -} - -// MarshalJSON is the custom marshaler for VolumeProperties. -func (vp VolumeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vp.Description != nil { - objectMap["description"] = vp.Description - } - if vp.Provider != nil { - objectMap["provider"] = vp.Provider - } - if vp.AzureFileParameters != nil { - objectMap["azureFileParameters"] = vp.AzureFileParameters - } - return json.Marshal(objectMap) -} - -// VolumeProviderParametersAzureFile this type describes a volume provided by an Azure Files file share. -type VolumeProviderParametersAzureFile struct { - // AccountName - Name of the Azure storage account for the File Share. - AccountName *string `json:"accountName,omitempty"` - // AccountKey - Access key of the Azure storage account for the File Share. - AccountKey *string `json:"accountKey,omitempty"` - // ShareName - Name of the Azure Files file share that provides storage for the volume. - ShareName *string `json:"shareName,omitempty"` -} - -// VolumeReference describes a reference to a volume resource. -type VolumeReference struct { - // Name - Name of the volume being referenced. - Name *string `json:"name,omitempty"` - // ReadOnly - The flag indicating whether the volume is read only. Default is 'false'. - ReadOnly *bool `json:"readOnly,omitempty"` - // DestinationPath - The path within the container at which the volume should be mounted. Only valid path characters are allowed. - DestinationPath *string `json:"destinationPath,omitempty"` -} - -// VolumeResourceDescription this type describes a volume resource. -type VolumeResourceDescription struct { - autorest.Response `json:"-"` - // VolumeResourceProperties - This type describes properties of a volume resource. - *VolumeResourceProperties `json:"properties,omitempty"` - // 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 identifier 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for VolumeResourceDescription. -func (vrd VolumeResourceDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vrd.VolumeResourceProperties != nil { - objectMap["properties"] = vrd.VolumeResourceProperties - } - if vrd.Tags != nil { - objectMap["tags"] = vrd.Tags - } - if vrd.Location != nil { - objectMap["location"] = vrd.Location - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VolumeResourceDescription struct. -func (vrd *VolumeResourceDescription) 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 volumeResourceProperties VolumeResourceProperties - err = json.Unmarshal(*v, &volumeResourceProperties) - if err != nil { - return err - } - vrd.VolumeResourceProperties = &volumeResourceProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vrd.Tags = tags - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vrd.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vrd.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vrd.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vrd.Type = &typeVar - } - } - } - - return nil -} - -// VolumeResourceDescriptionList a pageable list of volume resources. -type VolumeResourceDescriptionList struct { - autorest.Response `json:"-"` - // Value - One page of the list. - Value *[]VolumeResourceDescription `json:"value,omitempty"` - // NextLink - URI to fetch the next page of the list. - NextLink *string `json:"nextLink,omitempty"` -} - -// VolumeResourceDescriptionListIterator provides access to a complete listing of VolumeResourceDescription -// values. -type VolumeResourceDescriptionListIterator struct { - i int - page VolumeResourceDescriptionListPage -} - -// 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 *VolumeResourceDescriptionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumeResourceDescriptionListIterator.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 *VolumeResourceDescriptionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VolumeResourceDescriptionListIterator) 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 VolumeResourceDescriptionListIterator) Response() VolumeResourceDescriptionList { - 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 VolumeResourceDescriptionListIterator) Value() VolumeResourceDescription { - if !iter.page.NotDone() { - return VolumeResourceDescription{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VolumeResourceDescriptionListIterator type. -func NewVolumeResourceDescriptionListIterator(page VolumeResourceDescriptionListPage) VolumeResourceDescriptionListIterator { - return VolumeResourceDescriptionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vrdl VolumeResourceDescriptionList) IsEmpty() bool { - return vrdl.Value == nil || len(*vrdl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vrdl VolumeResourceDescriptionList) hasNextLink() bool { - return vrdl.NextLink != nil && len(*vrdl.NextLink) != 0 -} - -// volumeResourceDescriptionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vrdl VolumeResourceDescriptionList) volumeResourceDescriptionListPreparer(ctx context.Context) (*http.Request, error) { - if !vrdl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vrdl.NextLink))) -} - -// VolumeResourceDescriptionListPage contains a page of VolumeResourceDescription values. -type VolumeResourceDescriptionListPage struct { - fn func(context.Context, VolumeResourceDescriptionList) (VolumeResourceDescriptionList, error) - vrdl VolumeResourceDescriptionList -} - -// 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 *VolumeResourceDescriptionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumeResourceDescriptionListPage.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.vrdl) - if err != nil { - return err - } - page.vrdl = 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 *VolumeResourceDescriptionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VolumeResourceDescriptionListPage) NotDone() bool { - return !page.vrdl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VolumeResourceDescriptionListPage) Response() VolumeResourceDescriptionList { - return page.vrdl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VolumeResourceDescriptionListPage) Values() []VolumeResourceDescription { - if page.vrdl.IsEmpty() { - return nil - } - return *page.vrdl.Value -} - -// Creates a new instance of the VolumeResourceDescriptionListPage type. -func NewVolumeResourceDescriptionListPage(cur VolumeResourceDescriptionList, getNextPage func(context.Context, VolumeResourceDescriptionList) (VolumeResourceDescriptionList, error)) VolumeResourceDescriptionListPage { - return VolumeResourceDescriptionListPage{ - fn: getNextPage, - vrdl: cur, - } -} - -// VolumeResourceProperties this type describes properties of a volume resource. -type VolumeResourceProperties struct { - // ProvisioningState - READ-ONLY; State of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Description - User readable description of the volume. - Description *string `json:"description,omitempty"` - // Status - READ-ONLY; Status of the volume. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed' - Status ResourceStatus `json:"status,omitempty"` - // StatusDetails - READ-ONLY; Gives additional information about the current status of the volume. - StatusDetails *string `json:"statusDetails,omitempty"` - // Provider - Provider of the volume. - Provider *string `json:"provider,omitempty"` - // AzureFileParameters - This type describes a volume provided by an Azure Files file share. - AzureFileParameters *VolumeProviderParametersAzureFile `json:"azureFileParameters,omitempty"` -} - -// MarshalJSON is the custom marshaler for VolumeResourceProperties. -func (vrp VolumeResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vrp.Description != nil { - objectMap["description"] = vrp.Description - } - if vrp.Provider != nil { - objectMap["provider"] = vrp.Provider - } - if vrp.AzureFileParameters != nil { - objectMap["azureFileParameters"] = vrp.AzureFileParameters - } - return json.Marshal(objectMap) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/network.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/network.go deleted file mode 100644 index e7e5c1521722..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/network.go +++ /dev/null @@ -1,501 +0,0 @@ -package servicefabricmesh - -// 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" -) - -// NetworkClient is the service Fabric Mesh Management Client -type NetworkClient struct { - BaseClient -} - -// NewNetworkClient creates an instance of the NetworkClient client. -func NewNetworkClient(subscriptionID string) NetworkClient { - return NewNetworkClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewNetworkClientWithBaseURI creates an instance of the NetworkClient 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 NewNetworkClientWithBaseURI(baseURI string, subscriptionID string) NetworkClient { - return NetworkClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates a network resource with the specified name, description and properties. If a network resource with -// the same name exists, then it is updated with the specified description and properties. -// Parameters: -// resourceGroupName - azure resource group name -// networkResourceName - the identity of the network. -// networkResourceDescription - description for creating a Network resource. -func (client NetworkClient) Create(ctx context.Context, resourceGroupName string, networkResourceName string, networkResourceDescription NetworkResourceDescription) (result NetworkResourceDescription, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NetworkClient.Create") - 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: networkResourceDescription, - Constraints: []validation.Constraint{{Target: "networkResourceDescription.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("servicefabricmesh.NetworkClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, networkResourceName, networkResourceDescription) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client NetworkClient) CreatePreparer(ctx context.Context, resourceGroupName string, networkResourceName string, networkResourceDescription NetworkResourceDescription) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkResourceName": networkResourceName, - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/networks/{networkResourceName}", pathParameters), - autorest.WithJSON(networkResourceDescription), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client NetworkClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client NetworkClient) CreateResponder(resp *http.Response) (result NetworkResourceDescription, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the network resource identified by the name. -// Parameters: -// resourceGroupName - azure resource group name -// networkResourceName - the identity of the network. -func (client NetworkClient) Delete(ctx context.Context, resourceGroupName string, networkResourceName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NetworkClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client NetworkClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkResourceName": networkResourceName, - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/networks/{networkResourceName}", 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 NetworkClient) 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 NetworkClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the information about the network resource with the given name. The information include the description and -// other properties of the network. -// Parameters: -// resourceGroupName - azure resource group name -// networkResourceName - the identity of the network. -func (client NetworkClient) Get(ctx context.Context, resourceGroupName string, networkResourceName string) (result NetworkResourceDescription, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NetworkClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client NetworkClient) GetPreparer(ctx context.Context, resourceGroupName string, networkResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkResourceName": networkResourceName, - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/networks/{networkResourceName}", 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 NetworkClient) 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 NetworkClient) GetResponder(resp *http.Response) (result NetworkResourceDescription, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup gets the information about all network resources in a given resource group. The information -// include the description and other properties of the Network. -// Parameters: -// resourceGroupName - azure resource group name -func (client NetworkClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result NetworkResourceDescriptionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NetworkClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.nrdl.Response.Response != nil { - sc = result.nrdl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.nrdl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.nrdl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.nrdl.hasNextLink() && result.nrdl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client NetworkClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/networks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client NetworkClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client NetworkClient) ListByResourceGroupResponder(resp *http.Response) (result NetworkResourceDescriptionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client NetworkClient) listByResourceGroupNextResults(ctx context.Context, lastResults NetworkResourceDescriptionList) (result NetworkResourceDescriptionList, err error) { - req, err := lastResults.networkResourceDescriptionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client NetworkClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result NetworkResourceDescriptionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NetworkClient.ListByResourceGroup") - 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.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription gets the information about all network resources in a given resource group. The information -// include the description and other properties of the network. -func (client NetworkClient) ListBySubscription(ctx context.Context) (result NetworkResourceDescriptionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NetworkClient.ListBySubscription") - defer func() { - sc := -1 - if result.nrdl.Response.Response != nil { - sc = result.nrdl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.nrdl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.nrdl, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.nrdl.hasNextLink() && result.nrdl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client NetworkClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/networks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client NetworkClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client NetworkClient) ListBySubscriptionResponder(resp *http.Response) (result NetworkResourceDescriptionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client NetworkClient) listBySubscriptionNextResults(ctx context.Context, lastResults NetworkResourceDescriptionList) (result NetworkResourceDescriptionList, err error) { - req, err := lastResults.networkResourceDescriptionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.NetworkClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client NetworkClient) ListBySubscriptionComplete(ctx context.Context) (result NetworkResourceDescriptionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NetworkClient.ListBySubscription") - 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.ListBySubscription(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/operations.go deleted file mode 100644 index c205afd9c050..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/operations.go +++ /dev/null @@ -1,140 +0,0 @@ -package servicefabricmesh - -// 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/tracing" - "net/http" -) - -// OperationsClient is the service Fabric Mesh Management Client -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)} -} - -// List lists all the available operations provided by Service Fabric SeaBreeze resource provider. -func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.olr.Response.Response != nil { - sc = result.olr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.olr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.OperationsClient", "List", resp, "Failure sending request") - return - } - - result.olr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.OperationsClient", "List", resp, "Failure responding to request") - return - } - if result.olr.hasNextLink() && result.olr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.ServiceFabricMesh/operations"), - 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 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 OperationListResult, 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 OperationListResult) (result OperationListResult, err error) { - req, err := lastResults.operationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "servicefabricmesh.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, "servicefabricmesh.OperationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.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 OperationListResultIterator, 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 -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/secret.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/secret.go deleted file mode 100644 index f40a36fee1f5..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/secret.go +++ /dev/null @@ -1,501 +0,0 @@ -package servicefabricmesh - -// 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" -) - -// SecretClient is the service Fabric Mesh Management Client -type SecretClient struct { - BaseClient -} - -// NewSecretClient creates an instance of the SecretClient client. -func NewSecretClient(subscriptionID string) SecretClient { - return NewSecretClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSecretClientWithBaseURI creates an instance of the SecretClient 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 NewSecretClientWithBaseURI(baseURI string, subscriptionID string) SecretClient { - return SecretClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates a secret resource with the specified name, description and properties. If a secret resource with the -// same name exists, then it is updated with the specified description and properties. -// Parameters: -// resourceGroupName - azure resource group name -// secretResourceName - the name of the secret resource. -// secretResourceDescription - description for creating a secret resource. -func (client SecretClient) Create(ctx context.Context, resourceGroupName string, secretResourceName string, secretResourceDescription SecretResourceDescription) (result SecretResourceDescription, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretClient.Create") - 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: secretResourceDescription, - Constraints: []validation.Constraint{{Target: "secretResourceDescription.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("servicefabricmesh.SecretClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, secretResourceName, secretResourceDescription) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client SecretClient) CreatePreparer(ctx context.Context, resourceGroupName string, secretResourceName string, secretResourceDescription SecretResourceDescription) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "secretResourceName": secretResourceName, - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}", pathParameters), - autorest.WithJSON(secretResourceDescription), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client SecretClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client SecretClient) CreateResponder(resp *http.Response) (result SecretResourceDescription, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the secret resource identified by the name. -// Parameters: -// resourceGroupName - azure resource group name -// secretResourceName - the name of the secret resource. -func (client SecretClient) Delete(ctx context.Context, resourceGroupName string, secretResourceName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, secretResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SecretClient) DeletePreparer(ctx context.Context, resourceGroupName string, secretResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "secretResourceName": secretResourceName, - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}", 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 SecretClient) 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 SecretClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the information about the secret resource with the given name. The information include the description and -// other properties of the secret. -// Parameters: -// resourceGroupName - azure resource group name -// secretResourceName - the name of the secret resource. -func (client SecretClient) Get(ctx context.Context, resourceGroupName string, secretResourceName string) (result SecretResourceDescription, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, secretResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SecretClient) GetPreparer(ctx context.Context, resourceGroupName string, secretResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "secretResourceName": secretResourceName, - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}", 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 SecretClient) 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 SecretClient) GetResponder(resp *http.Response) (result SecretResourceDescription, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup gets the information about all secret resources in a given resource group. The information -// include the description and other properties of the Secret. -// Parameters: -// resourceGroupName - azure resource group name -func (client SecretClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SecretResourceDescriptionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.srdl.Response.Response != nil { - sc = result.srdl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.srdl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.srdl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.srdl.hasNextLink() && result.srdl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client SecretClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client SecretClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client SecretClient) ListByResourceGroupResponder(resp *http.Response) (result SecretResourceDescriptionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client SecretClient) listByResourceGroupNextResults(ctx context.Context, lastResults SecretResourceDescriptionList) (result SecretResourceDescriptionList, err error) { - req, err := lastResults.secretResourceDescriptionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecretClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SecretResourceDescriptionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretClient.ListByResourceGroup") - 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.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription gets the information about all secret resources in a given resource group. The information -// include the description and other properties of the secret. -func (client SecretClient) ListBySubscription(ctx context.Context) (result SecretResourceDescriptionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretClient.ListBySubscription") - defer func() { - sc := -1 - if result.srdl.Response.Response != nil { - sc = result.srdl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.srdl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.srdl, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.srdl.hasNextLink() && result.srdl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client SecretClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/secrets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client SecretClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client SecretClient) ListBySubscriptionResponder(resp *http.Response) (result SecretResourceDescriptionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client SecretClient) listBySubscriptionNextResults(ctx context.Context, lastResults SecretResourceDescriptionList) (result SecretResourceDescriptionList, err error) { - req, err := lastResults.secretResourceDescriptionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecretClient) ListBySubscriptionComplete(ctx context.Context) (result SecretResourceDescriptionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretClient.ListBySubscription") - 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.ListBySubscription(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/secretvalue.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/secretvalue.go deleted file mode 100644 index 9a8b2e63c050..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/secretvalue.go +++ /dev/null @@ -1,479 +0,0 @@ -package servicefabricmesh - -// 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" -) - -// SecretValueClient is the service Fabric Mesh Management Client -type SecretValueClient struct { - BaseClient -} - -// NewSecretValueClient creates an instance of the SecretValueClient client. -func NewSecretValueClient(subscriptionID string) SecretValueClient { - return NewSecretValueClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSecretValueClientWithBaseURI creates an instance of the SecretValueClient 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 NewSecretValueClientWithBaseURI(baseURI string, subscriptionID string) SecretValueClient { - return SecretValueClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates a new value of the specified secret resource. The name of the value is typically the version -// identifier. Once created the value cannot be changed. -// Parameters: -// resourceGroupName - azure resource group name -// secretResourceName - the name of the secret resource. -// secretValueResourceName - the name of the secret resource value which is typically the version identifier -// for the value. -// secretValueResourceDescription - description for creating a value of a secret resource. -func (client SecretValueClient) Create(ctx context.Context, resourceGroupName string, secretResourceName string, secretValueResourceName string, secretValueResourceDescription SecretValueResourceDescription) (result SecretValueResourceDescription, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretValueClient.Create") - 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: secretValueResourceDescription, - Constraints: []validation.Constraint{{Target: "secretValueResourceDescription.SecretValueResourceProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("servicefabricmesh.SecretValueClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, secretResourceName, secretValueResourceName, secretValueResourceDescription) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client SecretValueClient) CreatePreparer(ctx context.Context, resourceGroupName string, secretResourceName string, secretValueResourceName string, secretValueResourceDescription SecretValueResourceDescription) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "secretResourceName": secretResourceName, - "secretValueResourceName": secretValueResourceName, - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}/values/{secretValueResourceName}", pathParameters), - autorest.WithJSON(secretValueResourceDescription), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client SecretValueClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client SecretValueClient) CreateResponder(resp *http.Response) (result SecretValueResourceDescription, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the secret value resource identified by the name. The name of the resource is typically the version -// associated with that value. Deletion will fail if the specified value is in use. -// Parameters: -// resourceGroupName - azure resource group name -// secretResourceName - the name of the secret resource. -// secretValueResourceName - the name of the secret resource value which is typically the version identifier -// for the value. -func (client SecretValueClient) Delete(ctx context.Context, resourceGroupName string, secretResourceName string, secretValueResourceName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretValueClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, secretResourceName, secretValueResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SecretValueClient) DeletePreparer(ctx context.Context, resourceGroupName string, secretResourceName string, secretValueResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "secretResourceName": secretResourceName, - "secretValueResourceName": secretValueResourceName, - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}/values/{secretValueResourceName}", 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 SecretValueClient) 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 SecretValueClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get the information about the specified named secret value resources. The information does not include the -// actual value of the secret. -// Parameters: -// resourceGroupName - azure resource group name -// secretResourceName - the name of the secret resource. -// secretValueResourceName - the name of the secret resource value which is typically the version identifier -// for the value. -func (client SecretValueClient) Get(ctx context.Context, resourceGroupName string, secretResourceName string, secretValueResourceName string) (result SecretValueResourceDescription, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretValueClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, secretResourceName, secretValueResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SecretValueClient) GetPreparer(ctx context.Context, resourceGroupName string, secretResourceName string, secretValueResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "secretResourceName": secretResourceName, - "secretValueResourceName": secretValueResourceName, - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}/values/{secretValueResourceName}", 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 SecretValueClient) 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 SecretValueClient) GetResponder(resp *http.Response) (result SecretValueResourceDescription, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets information about all secret value resources of the specified secret resource. The information includes -// the names of the secret value resources, but not the actual values. -// Parameters: -// resourceGroupName - azure resource group name -// secretResourceName - the name of the secret resource. -func (client SecretValueClient) List(ctx context.Context, resourceGroupName string, secretResourceName string) (result SecretValueResourceDescriptionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretValueClient.List") - defer func() { - sc := -1 - if result.svrdl.Response.Response != nil { - sc = result.svrdl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, secretResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.svrdl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "List", resp, "Failure sending request") - return - } - - result.svrdl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "List", resp, "Failure responding to request") - return - } - if result.svrdl.hasNextLink() && result.svrdl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SecretValueClient) ListPreparer(ctx context.Context, resourceGroupName string, secretResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "secretResourceName": secretResourceName, - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}/values", 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 SecretValueClient) 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 SecretValueClient) ListResponder(resp *http.Response) (result SecretValueResourceDescriptionList, 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 SecretValueClient) listNextResults(ctx context.Context, lastResults SecretValueResourceDescriptionList) (result SecretValueResourceDescriptionList, err error) { - req, err := lastResults.secretValueResourceDescriptionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "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, "servicefabricmesh.SecretValueClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecretValueClient) ListComplete(ctx context.Context, resourceGroupName string, secretResourceName string) (result SecretValueResourceDescriptionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretValueClient.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, resourceGroupName, secretResourceName) - return -} - -// ListValue lists the decrypted value of the specified named value of the secret resource. This is a privileged -// operation. -// Parameters: -// resourceGroupName - azure resource group name -// secretResourceName - the name of the secret resource. -// secretValueResourceName - the name of the secret resource value which is typically the version identifier -// for the value. -func (client SecretValueClient) ListValue(ctx context.Context, resourceGroupName string, secretResourceName string, secretValueResourceName string) (result SecretValue, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecretValueClient.ListValue") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListValuePreparer(ctx, resourceGroupName, secretResourceName, secretValueResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "ListValue", nil, "Failure preparing request") - return - } - - resp, err := client.ListValueSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "ListValue", resp, "Failure sending request") - return - } - - result, err = client.ListValueResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.SecretValueClient", "ListValue", resp, "Failure responding to request") - return - } - - return -} - -// ListValuePreparer prepares the ListValue request. -func (client SecretValueClient) ListValuePreparer(ctx context.Context, resourceGroupName string, secretResourceName string, secretValueResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "secretResourceName": secretResourceName, - "secretValueResourceName": secretValueResourceName, - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}/values/{secretValueResourceName}/list_value", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListValueSender sends the ListValue request. The method will close the -// http.Response Body if it receives an error. -func (client SecretValueClient) ListValueSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListValueResponder handles the response to the ListValue request. The method always -// closes the http.Response Body. -func (client SecretValueClient) ListValueResponder(resp *http.Response) (result SecretValue, 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/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/service.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/service.go deleted file mode 100644 index 56bb84ea2c3c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/service.go +++ /dev/null @@ -1,229 +0,0 @@ -package servicefabricmesh - -// 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/tracing" - "net/http" -) - -// ServiceClient is the service Fabric Mesh Management Client -type ServiceClient struct { - BaseClient -} - -// NewServiceClient creates an instance of the ServiceClient client. -func NewServiceClient(subscriptionID string) ServiceClient { - return NewServiceClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServiceClientWithBaseURI creates an instance of the ServiceClient 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 NewServiceClientWithBaseURI(baseURI string, subscriptionID string) ServiceClient { - return ServiceClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets the information about the service resource with the given name. The information include the description and -// other properties of the service. -// Parameters: -// resourceGroupName - azure resource group name -// applicationResourceName - the identity of the application. -// serviceResourceName - the identity of the service. -func (client ServiceClient) Get(ctx context.Context, resourceGroupName string, applicationResourceName string, serviceResourceName string) (result ServiceResourceDescription, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, applicationResourceName, serviceResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ServiceClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.ServiceClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ServiceClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServiceClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationResourceName string, serviceResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationResourceName": applicationResourceName, - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceResourceName": serviceResourceName, - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationResourceName}/services/{serviceResourceName}", 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 ServiceClient) 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 ServiceClient) GetResponder(resp *http.Response) (result ServiceResourceDescription, 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 information about all services of an application resource. The information include the description and -// other properties of the Service. -// Parameters: -// resourceGroupName - azure resource group name -// applicationResourceName - the identity of the application. -func (client ServiceClient) List(ctx context.Context, resourceGroupName string, applicationResourceName string) (result ServiceResourceDescriptionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.List") - defer func() { - sc := -1 - if result.srdl.Response.Response != nil { - sc = result.srdl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, applicationResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ServiceClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.srdl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.ServiceClient", "List", resp, "Failure sending request") - return - } - - result.srdl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ServiceClient", "List", resp, "Failure responding to request") - return - } - if result.srdl.hasNextLink() && result.srdl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ServiceClient) ListPreparer(ctx context.Context, resourceGroupName string, applicationResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationResourceName": applicationResourceName, - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationResourceName}/services", 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 ServiceClient) 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 ServiceClient) ListResponder(resp *http.Response) (result ServiceResourceDescriptionList, 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 ServiceClient) listNextResults(ctx context.Context, lastResults ServiceResourceDescriptionList) (result ServiceResourceDescriptionList, err error) { - req, err := lastResults.serviceResourceDescriptionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "servicefabricmesh.ServiceClient", "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, "servicefabricmesh.ServiceClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ServiceClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServiceClient) ListComplete(ctx context.Context, resourceGroupName string, applicationResourceName string) (result ServiceResourceDescriptionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.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, resourceGroupName, applicationResourceName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/servicereplica.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/servicereplica.go deleted file mode 100644 index 83eab43d5119..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/servicereplica.go +++ /dev/null @@ -1,233 +0,0 @@ -package servicefabricmesh - -// 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/tracing" - "net/http" -) - -// ServiceReplicaClient is the service Fabric Mesh Management Client -type ServiceReplicaClient struct { - BaseClient -} - -// NewServiceReplicaClient creates an instance of the ServiceReplicaClient client. -func NewServiceReplicaClient(subscriptionID string) ServiceReplicaClient { - return NewServiceReplicaClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServiceReplicaClientWithBaseURI creates an instance of the ServiceReplicaClient 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 NewServiceReplicaClientWithBaseURI(baseURI string, subscriptionID string) ServiceReplicaClient { - return ServiceReplicaClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets the information about the service replica with the given name. The information include the description and -// other properties of the service replica. -// Parameters: -// resourceGroupName - azure resource group name -// applicationResourceName - the identity of the application. -// serviceResourceName - the identity of the service. -// replicaName - service Fabric replica name. -func (client ServiceReplicaClient) Get(ctx context.Context, resourceGroupName string, applicationResourceName string, serviceResourceName string, replicaName string) (result ServiceReplicaDescription, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceReplicaClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, applicationResourceName, serviceResourceName, replicaName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ServiceReplicaClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.ServiceReplicaClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ServiceReplicaClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServiceReplicaClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationResourceName string, serviceResourceName string, replicaName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationResourceName": applicationResourceName, - "replicaName": replicaName, - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceResourceName": serviceResourceName, - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationResourceName}/services/{serviceResourceName}/replicas/{replicaName}", 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 ServiceReplicaClient) 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 ServiceReplicaClient) GetResponder(resp *http.Response) (result ServiceReplicaDescription, 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 information about all replicas of a given service of an application. The information includes the -// runtime properties of the replica instance. -// Parameters: -// resourceGroupName - azure resource group name -// applicationResourceName - the identity of the application. -// serviceResourceName - the identity of the service. -func (client ServiceReplicaClient) List(ctx context.Context, resourceGroupName string, applicationResourceName string, serviceResourceName string) (result ServiceReplicaDescriptionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceReplicaClient.List") - defer func() { - sc := -1 - if result.srdl.Response.Response != nil { - sc = result.srdl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, applicationResourceName, serviceResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ServiceReplicaClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.srdl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.ServiceReplicaClient", "List", resp, "Failure sending request") - return - } - - result.srdl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ServiceReplicaClient", "List", resp, "Failure responding to request") - return - } - if result.srdl.hasNextLink() && result.srdl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ServiceReplicaClient) ListPreparer(ctx context.Context, resourceGroupName string, applicationResourceName string, serviceResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationResourceName": applicationResourceName, - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceResourceName": serviceResourceName, - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationResourceName}/services/{serviceResourceName}/replicas", 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 ServiceReplicaClient) 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 ServiceReplicaClient) ListResponder(resp *http.Response) (result ServiceReplicaDescriptionList, 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 ServiceReplicaClient) listNextResults(ctx context.Context, lastResults ServiceReplicaDescriptionList) (result ServiceReplicaDescriptionList, err error) { - req, err := lastResults.serviceReplicaDescriptionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "servicefabricmesh.ServiceReplicaClient", "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, "servicefabricmesh.ServiceReplicaClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.ServiceReplicaClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServiceReplicaClient) ListComplete(ctx context.Context, resourceGroupName string, applicationResourceName string, serviceResourceName string) (result ServiceReplicaDescriptionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceReplicaClient.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, resourceGroupName, applicationResourceName, serviceResourceName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/version.go deleted file mode 100644 index 6a1f24afaf74..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package servicefabricmesh - -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() + " servicefabricmesh/2018-09-01-preview" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/volume.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/volume.go deleted file mode 100644 index b2cfc9bf9875..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh/volume.go +++ /dev/null @@ -1,507 +0,0 @@ -package servicefabricmesh - -// 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" -) - -// VolumeClient is the service Fabric Mesh Management Client -type VolumeClient struct { - BaseClient -} - -// NewVolumeClient creates an instance of the VolumeClient client. -func NewVolumeClient(subscriptionID string) VolumeClient { - return NewVolumeClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVolumeClientWithBaseURI creates an instance of the VolumeClient 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 NewVolumeClientWithBaseURI(baseURI string, subscriptionID string) VolumeClient { - return VolumeClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates a volume resource with the specified name, description and properties. If a volume resource with the -// same name exists, then it is updated with the specified description and properties. -// Parameters: -// resourceGroupName - azure resource group name -// volumeResourceName - the identity of the volume. -// volumeResourceDescription - description for creating a Volume resource. -func (client VolumeClient) Create(ctx context.Context, resourceGroupName string, volumeResourceName string, volumeResourceDescription VolumeResourceDescription) (result VolumeResourceDescription, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumeClient.Create") - 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: volumeResourceDescription, - Constraints: []validation.Constraint{{Target: "volumeResourceDescription.VolumeResourceProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "volumeResourceDescription.VolumeResourceProperties.Provider", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "volumeResourceDescription.VolumeResourceProperties.AzureFileParameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "volumeResourceDescription.VolumeResourceProperties.AzureFileParameters.AccountName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "volumeResourceDescription.VolumeResourceProperties.AzureFileParameters.ShareName", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("servicefabricmesh.VolumeClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, volumeResourceName, volumeResourceDescription) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client VolumeClient) CreatePreparer(ctx context.Context, resourceGroupName string, volumeResourceName string, volumeResourceDescription VolumeResourceDescription) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeResourceName": volumeResourceName, - } - - const APIVersion = "2018-09-01-preview" - 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/volumes/{volumeResourceName}", pathParameters), - autorest.WithJSON(volumeResourceDescription), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client VolumeClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client VolumeClient) CreateResponder(resp *http.Response) (result VolumeResourceDescription, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the volume resource identified by the name. -// Parameters: -// resourceGroupName - azure resource group name -// volumeResourceName - the identity of the volume. -func (client VolumeClient) Delete(ctx context.Context, resourceGroupName string, volumeResourceName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumeClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, volumeResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VolumeClient) DeletePreparer(ctx context.Context, resourceGroupName string, volumeResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeResourceName": volumeResourceName, - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/volumes/{volumeResourceName}", 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 VolumeClient) 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 VolumeClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the information about the volume resource with the given name. The information include the description and -// other properties of the volume. -// Parameters: -// resourceGroupName - azure resource group name -// volumeResourceName - the identity of the volume. -func (client VolumeClient) Get(ctx context.Context, resourceGroupName string, volumeResourceName string) (result VolumeResourceDescription, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumeClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, volumeResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VolumeClient) GetPreparer(ctx context.Context, resourceGroupName string, volumeResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeResourceName": volumeResourceName, - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/volumes/{volumeResourceName}", 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 VolumeClient) 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 VolumeClient) GetResponder(resp *http.Response) (result VolumeResourceDescription, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup gets the information about all volume resources in a given resource group. The information -// include the description and other properties of the Volume. -// Parameters: -// resourceGroupName - azure resource group name -func (client VolumeClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result VolumeResourceDescriptionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumeClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.vrdl.Response.Response != nil { - sc = result.vrdl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.vrdl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.vrdl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.vrdl.hasNextLink() && result.vrdl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VolumeClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/volumes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VolumeClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VolumeClient) ListByResourceGroupResponder(resp *http.Response) (result VolumeResourceDescriptionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VolumeClient) listByResourceGroupNextResults(ctx context.Context, lastResults VolumeResourceDescriptionList) (result VolumeResourceDescriptionList, err error) { - req, err := lastResults.volumeResourceDescriptionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VolumeClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result VolumeResourceDescriptionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumeClient.ListByResourceGroup") - 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.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription gets the information about all volume resources in a given resource group. The information -// include the description and other properties of the volume. -func (client VolumeClient) ListBySubscription(ctx context.Context) (result VolumeResourceDescriptionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumeClient.ListBySubscription") - defer func() { - sc := -1 - if result.vrdl.Response.Response != nil { - sc = result.vrdl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.vrdl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.vrdl, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.vrdl.hasNextLink() && result.vrdl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client VolumeClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-09-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/volumes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client VolumeClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client VolumeClient) ListBySubscriptionResponder(resp *http.Response) (result VolumeResourceDescriptionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client VolumeClient) listBySubscriptionNextResults(ctx context.Context, lastResults VolumeResourceDescriptionList) (result VolumeResourceDescriptionList, err error) { - req, err := lastResults.volumeResourceDescriptionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "servicefabricmesh.VolumeClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client VolumeClient) ListBySubscriptionComplete(ctx context.Context) (result VolumeResourceDescriptionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumeClient.ListBySubscription") - 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.ListBySubscription(ctx) - return -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 049db55ff331..c642d6a7a0cc 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -25,7 +25,6 @@ github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafacto github.com/Azure/azure-sdk-for-go/services/datalake/store/2016-11-01/filesystem github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare -github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns @@ -81,7 +80,6 @@ github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2021-06-01-pre github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v3.0/security github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2021-09-01-preview/securityinsight github.com/Azure/azure-sdk-for-go/services/preview/servicebus/mgmt/2021-06-01-preview/servicebus -github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2018-06-01-preview/sql github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql