diff --git a/.gitignore b/.gitignore index 538ca41f..0b1f7724 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ _obj _test # Architecture specific extensions/prefixes -*.[568vq] +#*.[568vq] [568vq].out *.cgo1.go @@ -24,4 +24,4 @@ _testmain.go *.prof sshpiperd/example/sshpiperd_key* sshpiperd/snap -sshpiperd/sshpiperd \ No newline at end of file +sshpiperd/sshpiperd diff --git a/Gopkg.lock b/Gopkg.lock index 7a5d8f50..74f0bfd8 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -150,6 +150,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "edb8b25358032bc1f50a5c77ee8c783f9cd3098dc1e7d0efe3fc00a4fff8a3e4" + inputs-digest = "dbffb1a34f0f89a4b396f56587f2b9f66435734d8c213c7fccc789aab882b646" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index ea505b41..1add90e3 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -28,6 +28,10 @@ [[constraint]] version = "v1.9.1" name = "github.com/jinzhu/gorm" + +[[constraint]] + version = "v24.0.0" + name = "github.com/Azure/azure-sdk-for-go" [[constraint]] branch = "hack_global_ref" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go new file mode 100644 index 00000000..fc6dfc57 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go @@ -0,0 +1,1104 @@ +package graphrbac + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/to" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ApplicationsClient is the the Graph RBAC Management Client +type ApplicationsClient struct { + BaseClient +} + +// NewApplicationsClient creates an instance of the ApplicationsClient client. +func NewApplicationsClient(tenantID string) ApplicationsClient { + return NewApplicationsClientWithBaseURI(DefaultBaseURI, tenantID) +} + +// NewApplicationsClientWithBaseURI creates an instance of the ApplicationsClient client. +func NewApplicationsClientWithBaseURI(baseURI string, tenantID string) ApplicationsClient { + return ApplicationsClient{NewWithBaseURI(baseURI, tenantID)} +} + +// AddOwner add an owner to an application. +// Parameters: +// applicationObjectID - the object ID of the application to which to add the owner. +// parameters - the URL of the owner object, such as +// https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. +func (client ApplicationsClient) AddOwner(ctx context.Context, applicationObjectID string, parameters AddOwnerParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.AddOwner") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("graphrbac.ApplicationsClient", "AddOwner", err.Error()) + } + + req, err := client.AddOwnerPreparer(ctx, applicationObjectID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "AddOwner", nil, "Failure preparing request") + return + } + + resp, err := client.AddOwnerSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "AddOwner", resp, "Failure sending request") + return + } + + result, err = client.AddOwnerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "AddOwner", resp, "Failure responding to request") + } + + return +} + +// AddOwnerPreparer prepares the AddOwner request. +func (client ApplicationsClient) AddOwnerPreparer(ctx context.Context, applicationObjectID string, parameters AddOwnerParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationObjectId": autorest.Encode("path", applicationObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/applications/{applicationObjectId}/$links/owners", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddOwnerSender sends the AddOwner request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationsClient) AddOwnerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AddOwnerResponder handles the response to the AddOwner request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) AddOwnerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Create create a new application. +// Parameters: +// parameters - the parameters for creating an application. +func (client ApplicationsClient) Create(ctx context.Context, parameters ApplicationCreateParameters) (result Application, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.AvailableToOtherTenants", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.IdentifierUris", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("graphrbac.ApplicationsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ApplicationsClient) CreatePreparer(ctx context.Context, parameters ApplicationCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/applications", pathParameters), + autorest.WithJSON(parameters), + 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 ApplicationsClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) CreateResponder(resp *http.Response) (result Application, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete an application. +// Parameters: +// applicationObjectID - application object ID. +func (client ApplicationsClient) Delete(ctx context.Context, applicationObjectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, applicationObjectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ApplicationsClient) DeletePreparer(ctx context.Context, applicationObjectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationObjectId": autorest.Encode("path", applicationObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/applications/{applicationObjectId}", 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 ApplicationsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get an application by object ID. +// Parameters: +// applicationObjectID - application object ID. +func (client ApplicationsClient) Get(ctx context.Context, applicationObjectID string) (result Application, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.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, applicationObjectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ApplicationsClient) GetPreparer(ctx context.Context, applicationObjectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationObjectId": autorest.Encode("path", applicationObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/applications/{applicationObjectId}", 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 ApplicationsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) GetResponder(resp *http.Response) (result Application, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists applications by filter parameters. +// Parameters: +// filter - the filters to apply to the operation. +func (client ApplicationsClient) List(ctx context.Context, filter string) (result ApplicationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.List") + defer func() { + sc := -1 + if result.alr.Response.Response != nil { + sc = result.alr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult ApplicationListResult) (ApplicationListResult, error) { + if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { + return ApplicationListResult{}, nil + } + return client.ListNext(ctx, *lastResult.OdataNextLink) + } + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "List", resp, "Failure sending request") + return + } + + result.alr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ApplicationsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/applications", 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 ApplicationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, 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 ApplicationsClient) ListResponder(resp *http.Response) (result ApplicationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ApplicationsClient) ListComplete(ctx context.Context, filter string) (result ApplicationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.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, filter) + return +} + +// ListKeyCredentials get the keyCredentials associated with an application. +// Parameters: +// applicationObjectID - application object ID. +func (client ApplicationsClient) ListKeyCredentials(ctx context.Context, applicationObjectID string) (result KeyCredentialListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.ListKeyCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListKeyCredentialsPreparer(ctx, applicationObjectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListKeyCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeyCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListKeyCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListKeyCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListKeyCredentials", resp, "Failure responding to request") + } + + return +} + +// ListKeyCredentialsPreparer prepares the ListKeyCredentials request. +func (client ApplicationsClient) ListKeyCredentialsPreparer(ctx context.Context, applicationObjectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationObjectId": autorest.Encode("path", applicationObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/applications/{applicationObjectId}/keyCredentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeyCredentialsSender sends the ListKeyCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationsClient) ListKeyCredentialsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListKeyCredentialsResponder handles the response to the ListKeyCredentials request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) ListKeyCredentialsResponder(resp *http.Response) (result KeyCredentialListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNext gets a list of applications from the current tenant. +// Parameters: +// nextLink - next link for the list operation. +func (client ApplicationsClient) ListNext(ctx context.Context, nextLink string) (result ApplicationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.ListNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListNextPreparer(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListNext", nil, "Failure preparing request") + return + } + + resp, err := client.ListNextSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListNext", resp, "Failure sending request") + return + } + + result, err = client.ListNextResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListNext", resp, "Failure responding to request") + } + + return +} + +// ListNextPreparer prepares the ListNext request. +func (client ApplicationsClient) ListNextPreparer(ctx context.Context, nextLink string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nextLink": nextLink, + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/{nextLink}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListNextSender sends the ListNext request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationsClient) ListNextSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListNextResponder handles the response to the ListNext request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) ListNextResponder(resp *http.Response) (result ApplicationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListOwners the owners are a set of non-admin users who are allowed to modify this object. +// Parameters: +// applicationObjectID - the object ID of the application for which to get owners. +func (client ApplicationsClient) ListOwners(ctx context.Context, applicationObjectID string) (result DirectoryObjectListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.ListOwners") + defer func() { + sc := -1 + if result.dolr.Response.Response != nil { + sc = result.dolr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listOwnersNextResults + req, err := client.ListOwnersPreparer(ctx, applicationObjectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListOwners", nil, "Failure preparing request") + return + } + + resp, err := client.ListOwnersSender(req) + if err != nil { + result.dolr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListOwners", resp, "Failure sending request") + return + } + + result.dolr, err = client.ListOwnersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListOwners", resp, "Failure responding to request") + } + + return +} + +// ListOwnersPreparer prepares the ListOwners request. +func (client ApplicationsClient) ListOwnersPreparer(ctx context.Context, applicationObjectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationObjectId": autorest.Encode("path", applicationObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/applications/{applicationObjectId}/owners", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOwnersSender sends the ListOwners request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationsClient) ListOwnersSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListOwnersResponder handles the response to the ListOwners request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) ListOwnersResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOwnersNextResults retrieves the next set of results, if any. +func (client ApplicationsClient) listOwnersNextResults(ctx context.Context, lastResults DirectoryObjectListResult) (result DirectoryObjectListResult, err error) { + req, err := lastResults.directoryObjectListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "listOwnersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOwnersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "listOwnersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOwnersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "listOwnersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOwnersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ApplicationsClient) ListOwnersComplete(ctx context.Context, applicationObjectID string) (result DirectoryObjectListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.ListOwners") + 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.ListOwners(ctx, applicationObjectID) + return +} + +// ListPasswordCredentials get the passwordCredentials associated with an application. +// Parameters: +// applicationObjectID - application object ID. +func (client ApplicationsClient) ListPasswordCredentials(ctx context.Context, applicationObjectID string) (result PasswordCredentialListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.ListPasswordCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPasswordCredentialsPreparer(ctx, applicationObjectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListPasswordCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListPasswordCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListPasswordCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListPasswordCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListPasswordCredentials", resp, "Failure responding to request") + } + + return +} + +// ListPasswordCredentialsPreparer prepares the ListPasswordCredentials request. +func (client ApplicationsClient) ListPasswordCredentialsPreparer(ctx context.Context, applicationObjectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationObjectId": autorest.Encode("path", applicationObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/applications/{applicationObjectId}/passwordCredentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPasswordCredentialsSender sends the ListPasswordCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationsClient) ListPasswordCredentialsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListPasswordCredentialsResponder handles the response to the ListPasswordCredentials request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) ListPasswordCredentialsResponder(resp *http.Response) (result PasswordCredentialListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Patch update an existing application. +// Parameters: +// applicationObjectID - application object ID. +// parameters - parameters to update an existing application. +func (client ApplicationsClient) Patch(ctx context.Context, applicationObjectID string, parameters ApplicationUpdateParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.Patch") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PatchPreparer(ctx, applicationObjectID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Patch", nil, "Failure preparing request") + return + } + + resp, err := client.PatchSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Patch", resp, "Failure sending request") + return + } + + result, err = client.PatchResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "Patch", resp, "Failure responding to request") + } + + return +} + +// PatchPreparer prepares the Patch request. +func (client ApplicationsClient) PatchPreparer(ctx context.Context, applicationObjectID string, parameters ApplicationUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationObjectId": autorest.Encode("path", applicationObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/applications/{applicationObjectId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PatchSender sends the Patch request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationsClient) PatchSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// PatchResponder handles the response to the Patch request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RemoveOwner remove a member from owners. +// Parameters: +// applicationObjectID - the object ID of the application from which to remove the owner. +// ownerObjectID - owner object id +func (client ApplicationsClient) RemoveOwner(ctx context.Context, applicationObjectID string, ownerObjectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.RemoveOwner") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemoveOwnerPreparer(ctx, applicationObjectID, ownerObjectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "RemoveOwner", nil, "Failure preparing request") + return + } + + resp, err := client.RemoveOwnerSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "RemoveOwner", resp, "Failure sending request") + return + } + + result, err = client.RemoveOwnerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "RemoveOwner", resp, "Failure responding to request") + } + + return +} + +// RemoveOwnerPreparer prepares the RemoveOwner request. +func (client ApplicationsClient) RemoveOwnerPreparer(ctx context.Context, applicationObjectID string, ownerObjectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationObjectId": autorest.Encode("path", applicationObjectID), + "ownerObjectId": autorest.Encode("path", ownerObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/applications/{applicationObjectId}/$links/owners/{ownerObjectId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveOwnerSender sends the RemoveOwner request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationsClient) RemoveOwnerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RemoveOwnerResponder handles the response to the RemoveOwner request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) RemoveOwnerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// UpdateKeyCredentials update the keyCredentials associated with an application. +// Parameters: +// applicationObjectID - application object ID. +// parameters - parameters to update the keyCredentials of an existing application. +func (client ApplicationsClient) UpdateKeyCredentials(ctx context.Context, applicationObjectID string, parameters KeyCredentialsUpdateParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.UpdateKeyCredentials") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateKeyCredentialsPreparer(ctx, applicationObjectID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "UpdateKeyCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateKeyCredentialsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "UpdateKeyCredentials", resp, "Failure sending request") + return + } + + result, err = client.UpdateKeyCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "UpdateKeyCredentials", resp, "Failure responding to request") + } + + return +} + +// UpdateKeyCredentialsPreparer prepares the UpdateKeyCredentials request. +func (client ApplicationsClient) UpdateKeyCredentialsPreparer(ctx context.Context, applicationObjectID string, parameters KeyCredentialsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationObjectId": autorest.Encode("path", applicationObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/applications/{applicationObjectId}/keyCredentials", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateKeyCredentialsSender sends the UpdateKeyCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationsClient) UpdateKeyCredentialsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateKeyCredentialsResponder handles the response to the UpdateKeyCredentials request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) UpdateKeyCredentialsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// UpdatePasswordCredentials update passwordCredentials associated with an application. +// Parameters: +// applicationObjectID - application object ID. +// parameters - parameters to update passwordCredentials of an existing application. +func (client ApplicationsClient) UpdatePasswordCredentials(ctx context.Context, applicationObjectID string, parameters PasswordCredentialsUpdateParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.UpdatePasswordCredentials") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePasswordCredentialsPreparer(ctx, applicationObjectID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "UpdatePasswordCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.UpdatePasswordCredentialsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "UpdatePasswordCredentials", resp, "Failure sending request") + return + } + + result, err = client.UpdatePasswordCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "UpdatePasswordCredentials", resp, "Failure responding to request") + } + + return +} + +// UpdatePasswordCredentialsPreparer prepares the UpdatePasswordCredentials request. +func (client ApplicationsClient) UpdatePasswordCredentialsPreparer(ctx context.Context, applicationObjectID string, parameters PasswordCredentialsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationObjectId": autorest.Encode("path", applicationObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/applications/{applicationObjectId}/passwordCredentials", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdatePasswordCredentialsSender sends the UpdatePasswordCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationsClient) UpdatePasswordCredentialsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdatePasswordCredentialsResponder handles the response to the UpdatePasswordCredentials request. The method always +// closes the http.Response Body. +func (client ApplicationsClient) UpdatePasswordCredentialsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/client.go new file mode 100644 index 00000000..6f46fe18 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/client.go @@ -0,0 +1,51 @@ +// Package graphrbac implements the Azure ARM Graphrbac service API version 1.6. +// +// The Graph RBAC Management Client +package graphrbac + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Graphrbac + DefaultBaseURI = "https://graph.windows.net" +) + +// BaseClient is the base client for Graphrbac. +type BaseClient struct { + autorest.Client + BaseURI string + TenantID string +} + +// New creates an instance of the BaseClient client. +func New(tenantID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, tenantID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, tenantID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + TenantID: tenantID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/deletedapplications.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/deletedapplications.go new file mode 100644 index 00000000..1107dff9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/deletedapplications.go @@ -0,0 +1,365 @@ +package graphrbac + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DeletedApplicationsClient is the the Graph RBAC Management Client +type DeletedApplicationsClient struct { + BaseClient +} + +// NewDeletedApplicationsClient creates an instance of the DeletedApplicationsClient client. +func NewDeletedApplicationsClient(tenantID string) DeletedApplicationsClient { + return NewDeletedApplicationsClientWithBaseURI(DefaultBaseURI, tenantID) +} + +// NewDeletedApplicationsClientWithBaseURI creates an instance of the DeletedApplicationsClient client. +func NewDeletedApplicationsClientWithBaseURI(baseURI string, tenantID string) DeletedApplicationsClient { + return DeletedApplicationsClient{NewWithBaseURI(baseURI, tenantID)} +} + +// HardDelete hard-delete an application. +// Parameters: +// applicationObjectID - application object ID. +func (client DeletedApplicationsClient) HardDelete(ctx context.Context, applicationObjectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedApplicationsClient.HardDelete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.HardDeletePreparer(ctx, applicationObjectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "HardDelete", nil, "Failure preparing request") + return + } + + resp, err := client.HardDeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "HardDelete", resp, "Failure sending request") + return + } + + result, err = client.HardDeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "HardDelete", resp, "Failure responding to request") + } + + return +} + +// HardDeletePreparer prepares the HardDelete request. +func (client DeletedApplicationsClient) HardDeletePreparer(ctx context.Context, applicationObjectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationObjectId": autorest.Encode("path", applicationObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/deletedApplications/{applicationObjectId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// HardDeleteSender sends the HardDelete request. The method will close the +// http.Response Body if it receives an error. +func (client DeletedApplicationsClient) HardDeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// HardDeleteResponder handles the response to the HardDelete request. The method always +// closes the http.Response Body. +func (client DeletedApplicationsClient) HardDeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// List gets a list of deleted applications in the directory. +// Parameters: +// filter - the filter to apply to the operation. +func (client DeletedApplicationsClient) List(ctx context.Context, filter string) (result ApplicationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedApplicationsClient.List") + defer func() { + sc := -1 + if result.alr.Response.Response != nil { + sc = result.alr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult ApplicationListResult) (ApplicationListResult, error) { + if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { + return ApplicationListResult{}, nil + } + return client.ListNext(ctx, *lastResult.OdataNextLink) + } + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "List", resp, "Failure sending request") + return + } + + result.alr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DeletedApplicationsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/deletedApplications", 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 DeletedApplicationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, 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 DeletedApplicationsClient) ListResponder(resp *http.Response) (result ApplicationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client DeletedApplicationsClient) ListComplete(ctx context.Context, filter string) (result ApplicationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedApplicationsClient.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, filter) + return +} + +// ListNext gets a list of deleted applications in the directory. +// Parameters: +// nextLink - next link for the list operation. +func (client DeletedApplicationsClient) ListNext(ctx context.Context, nextLink string) (result ApplicationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedApplicationsClient.ListNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListNextPreparer(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "ListNext", nil, "Failure preparing request") + return + } + + resp, err := client.ListNextSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "ListNext", resp, "Failure sending request") + return + } + + result, err = client.ListNextResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "ListNext", resp, "Failure responding to request") + } + + return +} + +// ListNextPreparer prepares the ListNext request. +func (client DeletedApplicationsClient) ListNextPreparer(ctx context.Context, nextLink string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nextLink": nextLink, + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/{nextLink}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListNextSender sends the ListNext request. The method will close the +// http.Response Body if it receives an error. +func (client DeletedApplicationsClient) ListNextSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListNextResponder handles the response to the ListNext request. The method always +// closes the http.Response Body. +func (client DeletedApplicationsClient) ListNextResponder(resp *http.Response) (result ApplicationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Restore restores the deleted application in the directory. +// Parameters: +// objectID - application object ID. +func (client DeletedApplicationsClient) Restore(ctx context.Context, objectID string) (result Application, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedApplicationsClient.Restore") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestorePreparer(ctx, objectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "Restore", nil, "Failure preparing request") + return + } + + resp, err := client.RestoreSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "Restore", resp, "Failure sending request") + return + } + + result, err = client.RestoreResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "Restore", resp, "Failure responding to request") + } + + return +} + +// RestorePreparer prepares the Restore request. +func (client DeletedApplicationsClient) RestorePreparer(ctx context.Context, objectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/deletedApplications/{objectId}/restore", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreSender sends the Restore request. The method will close the +// http.Response Body if it receives an error. +func (client DeletedApplicationsClient) RestoreSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RestoreResponder handles the response to the Restore request. The method always +// closes the http.Response Body. +func (client DeletedApplicationsClient) RestoreResponder(resp *http.Response) (result Application, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/graphrbac/1.6/graphrbac/domains.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/domains.go new file mode 100644 index 00000000..e19a6fe0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/domains.go @@ -0,0 +1,193 @@ +package graphrbac + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// DomainsClient is the the Graph RBAC Management Client +type DomainsClient struct { + BaseClient +} + +// NewDomainsClient creates an instance of the DomainsClient client. +func NewDomainsClient(tenantID string) DomainsClient { + return NewDomainsClientWithBaseURI(DefaultBaseURI, tenantID) +} + +// NewDomainsClientWithBaseURI creates an instance of the DomainsClient client. +func NewDomainsClientWithBaseURI(baseURI string, tenantID string) DomainsClient { + return DomainsClient{NewWithBaseURI(baseURI, tenantID)} +} + +// Get gets a specific domain in the current tenant. +// Parameters: +// domainName - name of the domain. +func (client DomainsClient) Get(ctx context.Context, domainName string) (result Domain, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.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, domainName) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DomainsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.DomainsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DomainsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DomainsClient) GetPreparer(ctx context.Context, domainName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/domains/{domainName}", 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 DomainsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DomainsClient) GetResponder(resp *http.Response) (result Domain, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of domains for the current tenant. +// Parameters: +// filter - the filter to apply to the operation. +func (client DomainsClient) List(ctx context.Context, filter string) (result DomainListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DomainsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.DomainsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.DomainsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DomainsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/domains", 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 DomainsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, 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 DomainsClient) ListResponder(resp *http.Response) (result DomainListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/graphrbac/1.6/graphrbac/graphrbacapi/interfaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/graphrbacapi/interfaces.go new file mode 100644 index 00000000..a35cca93 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/graphrbacapi/interfaces.go @@ -0,0 +1,136 @@ +package graphrbacapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac" + "github.com/Azure/go-autorest/autorest" +) + +// SignedInUserClientAPI contains the set of methods on the SignedInUserClient type. +type SignedInUserClientAPI interface { + Get(ctx context.Context) (result graphrbac.User, err error) + ListOwnedObjects(ctx context.Context) (result graphrbac.DirectoryObjectListResultPage, err error) + ListOwnedObjectsNext(ctx context.Context, nextLink string) (result graphrbac.DirectoryObjectListResult, err error) +} + +var _ SignedInUserClientAPI = (*graphrbac.SignedInUserClient)(nil) + +// ApplicationsClientAPI contains the set of methods on the ApplicationsClient type. +type ApplicationsClientAPI interface { + AddOwner(ctx context.Context, applicationObjectID string, parameters graphrbac.AddOwnerParameters) (result autorest.Response, err error) + Create(ctx context.Context, parameters graphrbac.ApplicationCreateParameters) (result graphrbac.Application, err error) + Delete(ctx context.Context, applicationObjectID string) (result autorest.Response, err error) + Get(ctx context.Context, applicationObjectID string) (result graphrbac.Application, err error) + List(ctx context.Context, filter string) (result graphrbac.ApplicationListResultPage, err error) + ListKeyCredentials(ctx context.Context, applicationObjectID string) (result graphrbac.KeyCredentialListResult, err error) + ListNext(ctx context.Context, nextLink string) (result graphrbac.ApplicationListResult, err error) + ListOwners(ctx context.Context, applicationObjectID string) (result graphrbac.DirectoryObjectListResultPage, err error) + ListPasswordCredentials(ctx context.Context, applicationObjectID string) (result graphrbac.PasswordCredentialListResult, err error) + Patch(ctx context.Context, applicationObjectID string, parameters graphrbac.ApplicationUpdateParameters) (result autorest.Response, err error) + RemoveOwner(ctx context.Context, applicationObjectID string, ownerObjectID string) (result autorest.Response, err error) + UpdateKeyCredentials(ctx context.Context, applicationObjectID string, parameters graphrbac.KeyCredentialsUpdateParameters) (result autorest.Response, err error) + UpdatePasswordCredentials(ctx context.Context, applicationObjectID string, parameters graphrbac.PasswordCredentialsUpdateParameters) (result autorest.Response, err error) +} + +var _ ApplicationsClientAPI = (*graphrbac.ApplicationsClient)(nil) + +// DeletedApplicationsClientAPI contains the set of methods on the DeletedApplicationsClient type. +type DeletedApplicationsClientAPI interface { + HardDelete(ctx context.Context, applicationObjectID string) (result autorest.Response, err error) + List(ctx context.Context, filter string) (result graphrbac.ApplicationListResultPage, err error) + ListNext(ctx context.Context, nextLink string) (result graphrbac.ApplicationListResult, err error) + Restore(ctx context.Context, objectID string) (result graphrbac.Application, err error) +} + +var _ DeletedApplicationsClientAPI = (*graphrbac.DeletedApplicationsClient)(nil) + +// GroupsClientAPI contains the set of methods on the GroupsClient type. +type GroupsClientAPI interface { + AddMember(ctx context.Context, groupObjectID string, parameters graphrbac.GroupAddMemberParameters) (result autorest.Response, err error) + AddOwner(ctx context.Context, objectID string, parameters graphrbac.AddOwnerParameters) (result autorest.Response, err error) + Create(ctx context.Context, parameters graphrbac.GroupCreateParameters) (result graphrbac.ADGroup, err error) + Delete(ctx context.Context, objectID string) (result autorest.Response, err error) + Get(ctx context.Context, objectID string) (result graphrbac.ADGroup, err error) + GetGroupMembers(ctx context.Context, objectID string) (result graphrbac.DirectoryObjectListResultPage, err error) + GetGroupMembersNext(ctx context.Context, nextLink string) (result graphrbac.DirectoryObjectListResult, err error) + GetMemberGroups(ctx context.Context, objectID string, parameters graphrbac.GroupGetMemberGroupsParameters) (result graphrbac.GroupGetMemberGroupsResult, err error) + IsMemberOf(ctx context.Context, parameters graphrbac.CheckGroupMembershipParameters) (result graphrbac.CheckGroupMembershipResult, err error) + List(ctx context.Context, filter string) (result graphrbac.GroupListResultPage, err error) + ListNext(ctx context.Context, nextLink string) (result graphrbac.GroupListResult, err error) + ListOwners(ctx context.Context, objectID string) (result graphrbac.DirectoryObjectListResultPage, err error) + RemoveMember(ctx context.Context, groupObjectID string, memberObjectID string) (result autorest.Response, err error) + RemoveOwner(ctx context.Context, objectID string, ownerObjectID string) (result autorest.Response, err error) +} + +var _ GroupsClientAPI = (*graphrbac.GroupsClient)(nil) + +// ServicePrincipalsClientAPI contains the set of methods on the ServicePrincipalsClient type. +type ServicePrincipalsClientAPI interface { + Create(ctx context.Context, parameters graphrbac.ServicePrincipalCreateParameters) (result graphrbac.ServicePrincipal, err error) + Delete(ctx context.Context, objectID string) (result autorest.Response, err error) + Get(ctx context.Context, objectID string) (result graphrbac.ServicePrincipal, err error) + List(ctx context.Context, filter string) (result graphrbac.ServicePrincipalListResultPage, err error) + ListKeyCredentials(ctx context.Context, objectID string) (result graphrbac.KeyCredentialListResult, err error) + ListNext(ctx context.Context, nextLink string) (result graphrbac.ServicePrincipalListResult, err error) + ListOwners(ctx context.Context, objectID string) (result graphrbac.DirectoryObjectListResultPage, err error) + ListPasswordCredentials(ctx context.Context, objectID string) (result graphrbac.PasswordCredentialListResult, err error) + Update(ctx context.Context, objectID string, parameters graphrbac.ServicePrincipalUpdateParameters) (result autorest.Response, err error) + UpdateKeyCredentials(ctx context.Context, objectID string, parameters graphrbac.KeyCredentialsUpdateParameters) (result autorest.Response, err error) + UpdatePasswordCredentials(ctx context.Context, objectID string, parameters graphrbac.PasswordCredentialsUpdateParameters) (result autorest.Response, err error) +} + +var _ ServicePrincipalsClientAPI = (*graphrbac.ServicePrincipalsClient)(nil) + +// UsersClientAPI contains the set of methods on the UsersClient type. +type UsersClientAPI interface { + Create(ctx context.Context, parameters graphrbac.UserCreateParameters) (result graphrbac.User, err error) + Delete(ctx context.Context, upnOrObjectID string) (result autorest.Response, err error) + Get(ctx context.Context, upnOrObjectID string) (result graphrbac.User, err error) + GetMemberGroups(ctx context.Context, objectID string, parameters graphrbac.UserGetMemberGroupsParameters) (result graphrbac.UserGetMemberGroupsResult, err error) + List(ctx context.Context, filter string) (result graphrbac.UserListResultPage, err error) + ListNext(ctx context.Context, nextLink string) (result graphrbac.UserListResult, err error) + Update(ctx context.Context, upnOrObjectID string, parameters graphrbac.UserUpdateParameters) (result autorest.Response, err error) +} + +var _ UsersClientAPI = (*graphrbac.UsersClient)(nil) + +// ObjectsClientAPI contains the set of methods on the ObjectsClient type. +type ObjectsClientAPI interface { + GetObjectsByObjectIds(ctx context.Context, parameters graphrbac.GetObjectsParameters) (result graphrbac.DirectoryObjectListResultPage, err error) + GetObjectsByObjectIdsNext(ctx context.Context, nextLink string) (result graphrbac.DirectoryObjectListResult, err error) +} + +var _ ObjectsClientAPI = (*graphrbac.ObjectsClient)(nil) + +// DomainsClientAPI contains the set of methods on the DomainsClient type. +type DomainsClientAPI interface { + Get(ctx context.Context, domainName string) (result graphrbac.Domain, err error) + List(ctx context.Context, filter string) (result graphrbac.DomainListResult, err error) +} + +var _ DomainsClientAPI = (*graphrbac.DomainsClient)(nil) + +// OAuth2ClientAPI contains the set of methods on the OAuth2Client type. +type OAuth2ClientAPI interface { + Get(ctx context.Context, filter string) (result graphrbac.Permissions, err error) + Grant(ctx context.Context, body *graphrbac.Permissions) (result graphrbac.Permissions, err error) +} + +var _ OAuth2ClientAPI = (*graphrbac.OAuth2Client)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go new file mode 100644 index 00000000..3f0e2097 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go @@ -0,0 +1,1224 @@ +package graphrbac + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/to" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GroupsClient is the the Graph RBAC Management Client +type GroupsClient struct { + BaseClient +} + +// NewGroupsClient creates an instance of the GroupsClient client. +func NewGroupsClient(tenantID string) GroupsClient { + return NewGroupsClientWithBaseURI(DefaultBaseURI, tenantID) +} + +// NewGroupsClientWithBaseURI creates an instance of the GroupsClient client. +func NewGroupsClientWithBaseURI(baseURI string, tenantID string) GroupsClient { + return GroupsClient{NewWithBaseURI(baseURI, tenantID)} +} + +// AddMember add a member to a group. +// Parameters: +// groupObjectID - the object ID of the group to which to add the member. +// parameters - the URL of the member object, such as +// https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. +func (client GroupsClient) AddMember(ctx context.Context, groupObjectID string, parameters GroupAddMemberParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.AddMember") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("graphrbac.GroupsClient", "AddMember", err.Error()) + } + + req, err := client.AddMemberPreparer(ctx, groupObjectID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "AddMember", nil, "Failure preparing request") + return + } + + resp, err := client.AddMemberSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "AddMember", resp, "Failure sending request") + return + } + + result, err = client.AddMemberResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "AddMember", resp, "Failure responding to request") + } + + return +} + +// AddMemberPreparer prepares the AddMember request. +func (client GroupsClient) AddMemberPreparer(ctx context.Context, groupObjectID string, parameters GroupAddMemberParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupObjectId": autorest.Encode("path", groupObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/groups/{groupObjectId}/$links/members", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddMemberSender sends the AddMember request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) AddMemberSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AddMemberResponder handles the response to the AddMember request. The method always +// closes the http.Response Body. +func (client GroupsClient) AddMemberResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// AddOwner add an owner to a group. +// Parameters: +// objectID - the object ID of the application to which to add the owner. +// parameters - the URL of the owner object, such as +// https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. +func (client GroupsClient) AddOwner(ctx context.Context, objectID string, parameters AddOwnerParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.AddOwner") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("graphrbac.GroupsClient", "AddOwner", err.Error()) + } + + req, err := client.AddOwnerPreparer(ctx, objectID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "AddOwner", nil, "Failure preparing request") + return + } + + resp, err := client.AddOwnerSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "AddOwner", resp, "Failure sending request") + return + } + + result, err = client.AddOwnerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "AddOwner", resp, "Failure responding to request") + } + + return +} + +// AddOwnerPreparer prepares the AddOwner request. +func (client GroupsClient) AddOwnerPreparer(ctx context.Context, objectID string, parameters AddOwnerParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/groups/{objectId}/$links/owners", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddOwnerSender sends the AddOwner request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) AddOwnerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AddOwnerResponder handles the response to the AddOwner request. The method always +// closes the http.Response Body. +func (client GroupsClient) AddOwnerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Create create a group in the directory. +// Parameters: +// parameters - the parameters for the group to create. +func (client GroupsClient) Create(ctx context.Context, parameters GroupCreateParameters) (result ADGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.MailEnabled", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.MailNickname", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.SecurityEnabled", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("graphrbac.GroupsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client GroupsClient) CreatePreparer(ctx context.Context, parameters GroupCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/groups", pathParameters), + autorest.WithJSON(parameters), + 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 GroupsClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client GroupsClient) CreateResponder(resp *http.Response) (result ADGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a group from the directory. +// Parameters: +// objectID - the object ID of the group to delete. +func (client GroupsClient) Delete(ctx context.Context, objectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, objectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GroupsClient) DeletePreparer(ctx context.Context, objectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/groups/{objectId}", 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 GroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets group information from the directory. +// Parameters: +// objectID - the object ID of the user for which to get group information. +func (client GroupsClient) Get(ctx context.Context, objectID string) (result ADGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.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, objectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client GroupsClient) GetPreparer(ctx context.Context, objectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/groups/{objectId}", 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 GroupsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client GroupsClient) GetResponder(resp *http.Response) (result ADGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetGroupMembers gets the members of a group. +// Parameters: +// objectID - the object ID of the group whose members should be retrieved. +func (client GroupsClient) GetGroupMembers(ctx context.Context, objectID string) (result DirectoryObjectListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.GetGroupMembers") + defer func() { + sc := -1 + if result.dolr.Response.Response != nil { + sc = result.dolr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult DirectoryObjectListResult) (DirectoryObjectListResult, error) { + if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { + return DirectoryObjectListResult{}, nil + } + return client.GetGroupMembersNext(ctx, *lastResult.OdataNextLink) + } + req, err := client.GetGroupMembersPreparer(ctx, objectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "GetGroupMembers", nil, "Failure preparing request") + return + } + + resp, err := client.GetGroupMembersSender(req) + if err != nil { + result.dolr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "GetGroupMembers", resp, "Failure sending request") + return + } + + result.dolr, err = client.GetGroupMembersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "GetGroupMembers", resp, "Failure responding to request") + } + + return +} + +// GetGroupMembersPreparer prepares the GetGroupMembers request. +func (client GroupsClient) GetGroupMembersPreparer(ctx context.Context, objectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/groups/{objectId}/members", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetGroupMembersSender sends the GetGroupMembers request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) GetGroupMembersSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetGroupMembersResponder handles the response to the GetGroupMembers request. The method always +// closes the http.Response Body. +func (client GroupsClient) GetGroupMembersResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetGroupMembersComplete enumerates all values, automatically crossing page boundaries as required. +func (client GroupsClient) GetGroupMembersComplete(ctx context.Context, objectID string) (result DirectoryObjectListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.GetGroupMembers") + 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.GetGroupMembers(ctx, objectID) + return +} + +// GetGroupMembersNext gets the members of a group. +// Parameters: +// nextLink - next link for the list operation. +func (client GroupsClient) GetGroupMembersNext(ctx context.Context, nextLink string) (result DirectoryObjectListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.GetGroupMembersNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetGroupMembersNextPreparer(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "GetGroupMembersNext", nil, "Failure preparing request") + return + } + + resp, err := client.GetGroupMembersNextSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "GetGroupMembersNext", resp, "Failure sending request") + return + } + + result, err = client.GetGroupMembersNextResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "GetGroupMembersNext", resp, "Failure responding to request") + } + + return +} + +// GetGroupMembersNextPreparer prepares the GetGroupMembersNext request. +func (client GroupsClient) GetGroupMembersNextPreparer(ctx context.Context, nextLink string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nextLink": nextLink, + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/{nextLink}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetGroupMembersNextSender sends the GetGroupMembersNext request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) GetGroupMembersNextSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetGroupMembersNextResponder handles the response to the GetGroupMembersNext request. The method always +// closes the http.Response Body. +func (client GroupsClient) GetGroupMembersNextResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMemberGroups gets a collection of object IDs of groups of which the specified group is a member. +// Parameters: +// objectID - the object ID of the group for which to get group membership. +// parameters - group filtering parameters. +func (client GroupsClient) GetMemberGroups(ctx context.Context, objectID string, parameters GroupGetMemberGroupsParameters) (result GroupGetMemberGroupsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.GetMemberGroups") + 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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SecurityEnabledOnly", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("graphrbac.GroupsClient", "GetMemberGroups", err.Error()) + } + + req, err := client.GetMemberGroupsPreparer(ctx, objectID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "GetMemberGroups", nil, "Failure preparing request") + return + } + + resp, err := client.GetMemberGroupsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "GetMemberGroups", resp, "Failure sending request") + return + } + + result, err = client.GetMemberGroupsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "GetMemberGroups", resp, "Failure responding to request") + } + + return +} + +// GetMemberGroupsPreparer prepares the GetMemberGroups request. +func (client GroupsClient) GetMemberGroupsPreparer(ctx context.Context, objectID string, parameters GroupGetMemberGroupsParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/groups/{objectId}/getMemberGroups", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMemberGroupsSender sends the GetMemberGroups request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) GetMemberGroupsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetMemberGroupsResponder handles the response to the GetMemberGroups request. The method always +// closes the http.Response Body. +func (client GroupsClient) GetMemberGroupsResponder(resp *http.Response) (result GroupGetMemberGroupsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// IsMemberOf checks whether the specified user, group, contact, or service principal is a direct or transitive member +// of the specified group. +// Parameters: +// parameters - the check group membership parameters. +func (client GroupsClient) IsMemberOf(ctx context.Context, parameters CheckGroupMembershipParameters) (result CheckGroupMembershipResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.IsMemberOf") + 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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.GroupID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.MemberID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("graphrbac.GroupsClient", "IsMemberOf", err.Error()) + } + + req, err := client.IsMemberOfPreparer(ctx, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "IsMemberOf", nil, "Failure preparing request") + return + } + + resp, err := client.IsMemberOfSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "IsMemberOf", resp, "Failure sending request") + return + } + + result, err = client.IsMemberOfResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "IsMemberOf", resp, "Failure responding to request") + } + + return +} + +// IsMemberOfPreparer prepares the IsMemberOf request. +func (client GroupsClient) IsMemberOfPreparer(ctx context.Context, parameters CheckGroupMembershipParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/isMemberOf", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// IsMemberOfSender sends the IsMemberOf request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) IsMemberOfSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// IsMemberOfResponder handles the response to the IsMemberOf request. The method always +// closes the http.Response Body. +func (client GroupsClient) IsMemberOfResponder(resp *http.Response) (result CheckGroupMembershipResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets list of groups for the current tenant. +// Parameters: +// filter - the filter to apply to the operation. +func (client GroupsClient) List(ctx context.Context, filter string) (result GroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.List") + defer func() { + sc := -1 + if result.glr.Response.Response != nil { + sc = result.glr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult GroupListResult) (GroupListResult, error) { + if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { + return GroupListResult{}, nil + } + return client.ListNext(ctx, *lastResult.OdataNextLink) + } + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.glr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "List", resp, "Failure sending request") + return + } + + result.glr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client GroupsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/groups", 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 GroupsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, 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 GroupsClient) ListResponder(resp *http.Response) (result GroupListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client GroupsClient) ListComplete(ctx context.Context, filter string) (result GroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.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, filter) + return +} + +// ListNext gets a list of groups for the current tenant. +// Parameters: +// nextLink - next link for the list operation. +func (client GroupsClient) ListNext(ctx context.Context, nextLink string) (result GroupListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.ListNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListNextPreparer(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "ListNext", nil, "Failure preparing request") + return + } + + resp, err := client.ListNextSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "ListNext", resp, "Failure sending request") + return + } + + result, err = client.ListNextResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "ListNext", resp, "Failure responding to request") + } + + return +} + +// ListNextPreparer prepares the ListNext request. +func (client GroupsClient) ListNextPreparer(ctx context.Context, nextLink string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nextLink": nextLink, + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/{nextLink}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListNextSender sends the ListNext request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) ListNextSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListNextResponder handles the response to the ListNext request. The method always +// closes the http.Response Body. +func (client GroupsClient) ListNextResponder(resp *http.Response) (result GroupListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListOwners the owners are a set of non-admin users who are allowed to modify this object. +// Parameters: +// objectID - the object ID of the group for which to get owners. +func (client GroupsClient) ListOwners(ctx context.Context, objectID string) (result DirectoryObjectListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.ListOwners") + defer func() { + sc := -1 + if result.dolr.Response.Response != nil { + sc = result.dolr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listOwnersNextResults + req, err := client.ListOwnersPreparer(ctx, objectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "ListOwners", nil, "Failure preparing request") + return + } + + resp, err := client.ListOwnersSender(req) + if err != nil { + result.dolr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "ListOwners", resp, "Failure sending request") + return + } + + result.dolr, err = client.ListOwnersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "ListOwners", resp, "Failure responding to request") + } + + return +} + +// ListOwnersPreparer prepares the ListOwners request. +func (client GroupsClient) ListOwnersPreparer(ctx context.Context, objectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/groups/{objectId}/owners", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOwnersSender sends the ListOwners request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) ListOwnersSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListOwnersResponder handles the response to the ListOwners request. The method always +// closes the http.Response Body. +func (client GroupsClient) ListOwnersResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOwnersNextResults retrieves the next set of results, if any. +func (client GroupsClient) listOwnersNextResults(ctx context.Context, lastResults DirectoryObjectListResult) (result DirectoryObjectListResult, err error) { + req, err := lastResults.directoryObjectListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "listOwnersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOwnersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "listOwnersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOwnersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "listOwnersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOwnersComplete enumerates all values, automatically crossing page boundaries as required. +func (client GroupsClient) ListOwnersComplete(ctx context.Context, objectID string) (result DirectoryObjectListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.ListOwners") + 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.ListOwners(ctx, objectID) + return +} + +// RemoveMember remove a member from a group. +// Parameters: +// groupObjectID - the object ID of the group from which to remove the member. +// memberObjectID - member object id +func (client GroupsClient) RemoveMember(ctx context.Context, groupObjectID string, memberObjectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.RemoveMember") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemoveMemberPreparer(ctx, groupObjectID, memberObjectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "RemoveMember", nil, "Failure preparing request") + return + } + + resp, err := client.RemoveMemberSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "RemoveMember", resp, "Failure sending request") + return + } + + result, err = client.RemoveMemberResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "RemoveMember", resp, "Failure responding to request") + } + + return +} + +// RemoveMemberPreparer prepares the RemoveMember request. +func (client GroupsClient) RemoveMemberPreparer(ctx context.Context, groupObjectID string, memberObjectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupObjectId": autorest.Encode("path", groupObjectID), + "memberObjectId": autorest.Encode("path", memberObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/groups/{groupObjectId}/$links/members/{memberObjectId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveMemberSender sends the RemoveMember request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) RemoveMemberSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RemoveMemberResponder handles the response to the RemoveMember request. The method always +// closes the http.Response Body. +func (client GroupsClient) RemoveMemberResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RemoveOwner remove a member from owners. +// Parameters: +// objectID - the object ID of the group from which to remove the owner. +// ownerObjectID - owner object id +func (client GroupsClient) RemoveOwner(ctx context.Context, objectID string, ownerObjectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.RemoveOwner") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemoveOwnerPreparer(ctx, objectID, ownerObjectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "RemoveOwner", nil, "Failure preparing request") + return + } + + resp, err := client.RemoveOwnerSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "RemoveOwner", resp, "Failure sending request") + return + } + + result, err = client.RemoveOwnerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "RemoveOwner", resp, "Failure responding to request") + } + + return +} + +// RemoveOwnerPreparer prepares the RemoveOwner request. +func (client GroupsClient) RemoveOwnerPreparer(ctx context.Context, objectID string, ownerObjectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "ownerObjectId": autorest.Encode("path", ownerObjectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/groups/{objectId}/$links/owners/{ownerObjectId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveOwnerSender sends the RemoveOwner request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) RemoveOwnerSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RemoveOwnerResponder handles the response to the RemoveOwner request. The method always +// closes the http.Response Body. +func (client GroupsClient) RemoveOwnerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go new file mode 100644 index 00000000..66c76b8e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go @@ -0,0 +1,4514 @@ +package graphrbac + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/graphrbac/1.6/graphrbac" + +// ObjectType enumerates the values for object type. +type ObjectType string + +const ( + // ObjectTypeApplication ... + ObjectTypeApplication ObjectType = "Application" + // ObjectTypeDirectoryObject ... + ObjectTypeDirectoryObject ObjectType = "DirectoryObject" + // ObjectTypeGroup ... + ObjectTypeGroup ObjectType = "Group" + // ObjectTypeServicePrincipal ... + ObjectTypeServicePrincipal ObjectType = "ServicePrincipal" + // ObjectTypeUser ... + ObjectTypeUser ObjectType = "User" +) + +// PossibleObjectTypeValues returns an array of possible values for the ObjectType const type. +func PossibleObjectTypeValues() []ObjectType { + return []ObjectType{ObjectTypeApplication, ObjectTypeDirectoryObject, ObjectTypeGroup, ObjectTypeServicePrincipal, ObjectTypeUser} +} + +// UserType enumerates the values for user type. +type UserType string + +const ( + // Guest ... + Guest UserType = "Guest" + // Member ... + Member UserType = "Member" +) + +// PossibleUserTypeValues returns an array of possible values for the UserType const type. +func PossibleUserTypeValues() []UserType { + return []UserType{Guest, Member} +} + +// AddOwnerParameters request parameters for adding a owner to an application. +type AddOwnerParameters struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // URL - A owner object URL, such as "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd", where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and "f260bbc4-c254-447b-94cf-293b5ec434dd" is the objectId of the owner (user, application, servicePrincipal, group) to be added. + URL *string `json:"url,omitempty"` +} + +// MarshalJSON is the custom marshaler for AddOwnerParameters. +func (aop AddOwnerParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aop.URL != nil { + objectMap["url"] = aop.URL + } + for k, v := range aop.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AddOwnerParameters struct. +func (aop *AddOwnerParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if aop.AdditionalProperties == nil { + aop.AdditionalProperties = make(map[string]interface{}) + } + aop.AdditionalProperties[k] = additionalProperties + } + case "url": + if v != nil { + var URL string + err = json.Unmarshal(*v, &URL) + if err != nil { + return err + } + aop.URL = &URL + } + } + } + + return nil +} + +// ADGroup active Directory group information. +type ADGroup struct { + autorest.Response `json:"-"` + // DisplayName - The display name of the group. + DisplayName *string `json:"displayName,omitempty"` + // MailEnabled - Whether the group is mail-enabled. Must be false. This is because only pure security groups can be created using the Graph API. + MailEnabled *bool `json:"mailEnabled,omitempty"` + // MailNickname - The mail alias for the group. + MailNickname *string `json:"mailNickname,omitempty"` + // SecurityEnabled - Whether the group is security-enable. + SecurityEnabled *bool `json:"securityEnabled,omitempty"` + // Mail - The primary email address of the group. + Mail *string `json:"mail,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ObjectID - The object ID. + ObjectID *string `json:"objectId,omitempty"` + // DeletionTimestamp - The time at which the directory object was deleted. + DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ADGroup. +func (ag ADGroup) MarshalJSON() ([]byte, error) { + ag.ObjectType = ObjectTypeGroup + objectMap := make(map[string]interface{}) + if ag.DisplayName != nil { + objectMap["displayName"] = ag.DisplayName + } + if ag.MailEnabled != nil { + objectMap["mailEnabled"] = ag.MailEnabled + } + if ag.MailNickname != nil { + objectMap["mailNickname"] = ag.MailNickname + } + if ag.SecurityEnabled != nil { + objectMap["securityEnabled"] = ag.SecurityEnabled + } + if ag.Mail != nil { + objectMap["mail"] = ag.Mail + } + if ag.ObjectID != nil { + objectMap["objectId"] = ag.ObjectID + } + if ag.DeletionTimestamp != nil { + objectMap["deletionTimestamp"] = ag.DeletionTimestamp + } + if ag.ObjectType != "" { + objectMap["objectType"] = ag.ObjectType + } + for k, v := range ag.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsApplication is the BasicDirectoryObject implementation for ADGroup. +func (ag ADGroup) AsApplication() (*Application, bool) { + return nil, false +} + +// AsADGroup is the BasicDirectoryObject implementation for ADGroup. +func (ag ADGroup) AsADGroup() (*ADGroup, bool) { + return &ag, true +} + +// AsServicePrincipal is the BasicDirectoryObject implementation for ADGroup. +func (ag ADGroup) AsServicePrincipal() (*ServicePrincipal, bool) { + return nil, false +} + +// AsUser is the BasicDirectoryObject implementation for ADGroup. +func (ag ADGroup) AsUser() (*User, bool) { + return nil, false +} + +// AsDirectoryObject is the BasicDirectoryObject implementation for ADGroup. +func (ag ADGroup) AsDirectoryObject() (*DirectoryObject, bool) { + return nil, false +} + +// AsBasicDirectoryObject is the BasicDirectoryObject implementation for ADGroup. +func (ag ADGroup) AsBasicDirectoryObject() (BasicDirectoryObject, bool) { + return &ag, true +} + +// UnmarshalJSON is the custom unmarshaler for ADGroup struct. +func (ag *ADGroup) 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 "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + ag.DisplayName = &displayName + } + case "mailEnabled": + if v != nil { + var mailEnabled bool + err = json.Unmarshal(*v, &mailEnabled) + if err != nil { + return err + } + ag.MailEnabled = &mailEnabled + } + case "mailNickname": + if v != nil { + var mailNickname string + err = json.Unmarshal(*v, &mailNickname) + if err != nil { + return err + } + ag.MailNickname = &mailNickname + } + case "securityEnabled": + if v != nil { + var securityEnabled bool + err = json.Unmarshal(*v, &securityEnabled) + if err != nil { + return err + } + ag.SecurityEnabled = &securityEnabled + } + case "mail": + if v != nil { + var mailVar string + err = json.Unmarshal(*v, &mailVar) + if err != nil { + return err + } + ag.Mail = &mailVar + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ag.AdditionalProperties == nil { + ag.AdditionalProperties = make(map[string]interface{}) + } + ag.AdditionalProperties[k] = additionalProperties + } + case "objectId": + if v != nil { + var objectID string + err = json.Unmarshal(*v, &objectID) + if err != nil { + return err + } + ag.ObjectID = &objectID + } + case "deletionTimestamp": + if v != nil { + var deletionTimestamp date.Time + err = json.Unmarshal(*v, &deletionTimestamp) + if err != nil { + return err + } + ag.DeletionTimestamp = &deletionTimestamp + } + case "objectType": + if v != nil { + var objectType ObjectType + err = json.Unmarshal(*v, &objectType) + if err != nil { + return err + } + ag.ObjectType = objectType + } + } + } + + return nil +} + +// Application active Directory application information. +type Application struct { + autorest.Response `json:"-"` + // AppID - The application ID. + AppID *string `json:"appId,omitempty"` + // AppRoles - The collection of application roles that an application may declare. These roles can be assigned to users, groups or service principals. + AppRoles *[]AppRole `json:"appRoles,omitempty"` + // AppPermissions - The application permissions. + AppPermissions *[]string `json:"appPermissions,omitempty"` + // AvailableToOtherTenants - Whether the application is be available to other tenants. + AvailableToOtherTenants *bool `json:"availableToOtherTenants,omitempty"` + // DisplayName - The display name of the application. + DisplayName *string `json:"displayName,omitempty"` + // IdentifierUris - A collection of URIs for the application. + IdentifierUris *[]string `json:"identifierUris,omitempty"` + // ReplyUrls - A collection of reply URLs for the application. + ReplyUrls *[]string `json:"replyUrls,omitempty"` + // Homepage - The home page of the application. + Homepage *string `json:"homepage,omitempty"` + // Oauth2AllowImplicitFlow - Whether to allow implicit grant flow for OAuth2 + Oauth2AllowImplicitFlow *bool `json:"oauth2AllowImplicitFlow,omitempty"` + // RequiredResourceAccess - Specifies resources that this application requires access to and the set of OAuth permission scopes and application roles that it needs under each of those resources. This pre-configuration of required resource access drives the consent experience. + RequiredResourceAccess *[]RequiredResourceAccess `json:"requiredResourceAccess,omitempty"` + // KeyCredentials - A collection of KeyCredential objects. + KeyCredentials *[]KeyCredential `json:"keyCredentials,omitempty"` + // PasswordCredentials - A collection of PasswordCredential objects + PasswordCredentials *[]PasswordCredential `json:"passwordCredentials,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ObjectID - The object ID. + ObjectID *string `json:"objectId,omitempty"` + // DeletionTimestamp - The time at which the directory object was deleted. + DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for Application. +func (a Application) MarshalJSON() ([]byte, error) { + a.ObjectType = ObjectTypeApplication + objectMap := make(map[string]interface{}) + if a.AppID != nil { + objectMap["appId"] = a.AppID + } + if a.AppRoles != nil { + objectMap["appRoles"] = a.AppRoles + } + if a.AppPermissions != nil { + objectMap["appPermissions"] = a.AppPermissions + } + if a.AvailableToOtherTenants != nil { + objectMap["availableToOtherTenants"] = a.AvailableToOtherTenants + } + if a.DisplayName != nil { + objectMap["displayName"] = a.DisplayName + } + if a.IdentifierUris != nil { + objectMap["identifierUris"] = a.IdentifierUris + } + if a.ReplyUrls != nil { + objectMap["replyUrls"] = a.ReplyUrls + } + if a.Homepage != nil { + objectMap["homepage"] = a.Homepage + } + if a.Oauth2AllowImplicitFlow != nil { + objectMap["oauth2AllowImplicitFlow"] = a.Oauth2AllowImplicitFlow + } + if a.RequiredResourceAccess != nil { + objectMap["requiredResourceAccess"] = a.RequiredResourceAccess + } + if a.KeyCredentials != nil { + objectMap["keyCredentials"] = a.KeyCredentials + } + if a.PasswordCredentials != nil { + objectMap["passwordCredentials"] = a.PasswordCredentials + } + if a.ObjectID != nil { + objectMap["objectId"] = a.ObjectID + } + if a.DeletionTimestamp != nil { + objectMap["deletionTimestamp"] = a.DeletionTimestamp + } + if a.ObjectType != "" { + objectMap["objectType"] = a.ObjectType + } + for k, v := range a.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsApplication is the BasicDirectoryObject implementation for Application. +func (a Application) AsApplication() (*Application, bool) { + return &a, true +} + +// AsADGroup is the BasicDirectoryObject implementation for Application. +func (a Application) AsADGroup() (*ADGroup, bool) { + return nil, false +} + +// AsServicePrincipal is the BasicDirectoryObject implementation for Application. +func (a Application) AsServicePrincipal() (*ServicePrincipal, bool) { + return nil, false +} + +// AsUser is the BasicDirectoryObject implementation for Application. +func (a Application) AsUser() (*User, bool) { + return nil, false +} + +// AsDirectoryObject is the BasicDirectoryObject implementation for Application. +func (a Application) AsDirectoryObject() (*DirectoryObject, bool) { + return nil, false +} + +// AsBasicDirectoryObject is the BasicDirectoryObject implementation for Application. +func (a Application) AsBasicDirectoryObject() (BasicDirectoryObject, bool) { + return &a, true +} + +// UnmarshalJSON is the custom unmarshaler for Application struct. +func (a *Application) 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 "appId": + if v != nil { + var appID string + err = json.Unmarshal(*v, &appID) + if err != nil { + return err + } + a.AppID = &appID + } + case "appRoles": + if v != nil { + var appRoles []AppRole + err = json.Unmarshal(*v, &appRoles) + if err != nil { + return err + } + a.AppRoles = &appRoles + } + case "appPermissions": + if v != nil { + var appPermissions []string + err = json.Unmarshal(*v, &appPermissions) + if err != nil { + return err + } + a.AppPermissions = &appPermissions + } + case "availableToOtherTenants": + if v != nil { + var availableToOtherTenants bool + err = json.Unmarshal(*v, &availableToOtherTenants) + if err != nil { + return err + } + a.AvailableToOtherTenants = &availableToOtherTenants + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + a.DisplayName = &displayName + } + case "identifierUris": + if v != nil { + var identifierUris []string + err = json.Unmarshal(*v, &identifierUris) + if err != nil { + return err + } + a.IdentifierUris = &identifierUris + } + case "replyUrls": + if v != nil { + var replyUrls []string + err = json.Unmarshal(*v, &replyUrls) + if err != nil { + return err + } + a.ReplyUrls = &replyUrls + } + case "homepage": + if v != nil { + var homepage string + err = json.Unmarshal(*v, &homepage) + if err != nil { + return err + } + a.Homepage = &homepage + } + case "oauth2AllowImplicitFlow": + if v != nil { + var oauth2AllowImplicitFlow bool + err = json.Unmarshal(*v, &oauth2AllowImplicitFlow) + if err != nil { + return err + } + a.Oauth2AllowImplicitFlow = &oauth2AllowImplicitFlow + } + case "requiredResourceAccess": + if v != nil { + var requiredResourceAccess []RequiredResourceAccess + err = json.Unmarshal(*v, &requiredResourceAccess) + if err != nil { + return err + } + a.RequiredResourceAccess = &requiredResourceAccess + } + case "keyCredentials": + if v != nil { + var keyCredentials []KeyCredential + err = json.Unmarshal(*v, &keyCredentials) + if err != nil { + return err + } + a.KeyCredentials = &keyCredentials + } + case "passwordCredentials": + if v != nil { + var passwordCredentials []PasswordCredential + err = json.Unmarshal(*v, &passwordCredentials) + if err != nil { + return err + } + a.PasswordCredentials = &passwordCredentials + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[k] = additionalProperties + } + case "objectId": + if v != nil { + var objectID string + err = json.Unmarshal(*v, &objectID) + if err != nil { + return err + } + a.ObjectID = &objectID + } + case "deletionTimestamp": + if v != nil { + var deletionTimestamp date.Time + err = json.Unmarshal(*v, &deletionTimestamp) + if err != nil { + return err + } + a.DeletionTimestamp = &deletionTimestamp + } + case "objectType": + if v != nil { + var objectType ObjectType + err = json.Unmarshal(*v, &objectType) + if err != nil { + return err + } + a.ObjectType = objectType + } + } + } + + return nil +} + +// ApplicationCreateParameters request parameters for creating a new application. +type ApplicationCreateParameters struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // AppRoles - The collection of application roles that an application may declare. These roles can be assigned to users, groups or service principals. + AppRoles *[]AppRole `json:"appRoles,omitempty"` + // AvailableToOtherTenants - Whether the application is available to other tenants. + AvailableToOtherTenants *bool `json:"availableToOtherTenants,omitempty"` + // DisplayName - The display name of the application. + DisplayName *string `json:"displayName,omitempty"` + // Homepage - The home page of the application. + Homepage *string `json:"homepage,omitempty"` + // IdentifierUris - A collection of URIs for the application. + IdentifierUris *[]string `json:"identifierUris,omitempty"` + // ReplyUrls - A collection of reply URLs for the application. + ReplyUrls *[]string `json:"replyUrls,omitempty"` + // KeyCredentials - The list of KeyCredential objects. + KeyCredentials *[]KeyCredential `json:"keyCredentials,omitempty"` + // PasswordCredentials - The list of PasswordCredential objects. + PasswordCredentials *[]PasswordCredential `json:"passwordCredentials,omitempty"` + // Oauth2AllowImplicitFlow - Whether to allow implicit grant flow for OAuth2 + Oauth2AllowImplicitFlow *bool `json:"oauth2AllowImplicitFlow,omitempty"` + // RequiredResourceAccess - Specifies resources that this application requires access to and the set of OAuth permission scopes and application roles that it needs under each of those resources. This pre-configuration of required resource access drives the consent experience. + RequiredResourceAccess *[]RequiredResourceAccess `json:"requiredResourceAccess,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationCreateParameters. +func (acp ApplicationCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if acp.AppRoles != nil { + objectMap["appRoles"] = acp.AppRoles + } + if acp.AvailableToOtherTenants != nil { + objectMap["availableToOtherTenants"] = acp.AvailableToOtherTenants + } + if acp.DisplayName != nil { + objectMap["displayName"] = acp.DisplayName + } + if acp.Homepage != nil { + objectMap["homepage"] = acp.Homepage + } + if acp.IdentifierUris != nil { + objectMap["identifierUris"] = acp.IdentifierUris + } + if acp.ReplyUrls != nil { + objectMap["replyUrls"] = acp.ReplyUrls + } + if acp.KeyCredentials != nil { + objectMap["keyCredentials"] = acp.KeyCredentials + } + if acp.PasswordCredentials != nil { + objectMap["passwordCredentials"] = acp.PasswordCredentials + } + if acp.Oauth2AllowImplicitFlow != nil { + objectMap["oauth2AllowImplicitFlow"] = acp.Oauth2AllowImplicitFlow + } + if acp.RequiredResourceAccess != nil { + objectMap["requiredResourceAccess"] = acp.RequiredResourceAccess + } + for k, v := range acp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationCreateParameters struct. +func (acp *ApplicationCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if acp.AdditionalProperties == nil { + acp.AdditionalProperties = make(map[string]interface{}) + } + acp.AdditionalProperties[k] = additionalProperties + } + case "appRoles": + if v != nil { + var appRoles []AppRole + err = json.Unmarshal(*v, &appRoles) + if err != nil { + return err + } + acp.AppRoles = &appRoles + } + case "availableToOtherTenants": + if v != nil { + var availableToOtherTenants bool + err = json.Unmarshal(*v, &availableToOtherTenants) + if err != nil { + return err + } + acp.AvailableToOtherTenants = &availableToOtherTenants + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + acp.DisplayName = &displayName + } + case "homepage": + if v != nil { + var homepage string + err = json.Unmarshal(*v, &homepage) + if err != nil { + return err + } + acp.Homepage = &homepage + } + case "identifierUris": + if v != nil { + var identifierUris []string + err = json.Unmarshal(*v, &identifierUris) + if err != nil { + return err + } + acp.IdentifierUris = &identifierUris + } + case "replyUrls": + if v != nil { + var replyUrls []string + err = json.Unmarshal(*v, &replyUrls) + if err != nil { + return err + } + acp.ReplyUrls = &replyUrls + } + case "keyCredentials": + if v != nil { + var keyCredentials []KeyCredential + err = json.Unmarshal(*v, &keyCredentials) + if err != nil { + return err + } + acp.KeyCredentials = &keyCredentials + } + case "passwordCredentials": + if v != nil { + var passwordCredentials []PasswordCredential + err = json.Unmarshal(*v, &passwordCredentials) + if err != nil { + return err + } + acp.PasswordCredentials = &passwordCredentials + } + case "oauth2AllowImplicitFlow": + if v != nil { + var oauth2AllowImplicitFlow bool + err = json.Unmarshal(*v, &oauth2AllowImplicitFlow) + if err != nil { + return err + } + acp.Oauth2AllowImplicitFlow = &oauth2AllowImplicitFlow + } + case "requiredResourceAccess": + if v != nil { + var requiredResourceAccess []RequiredResourceAccess + err = json.Unmarshal(*v, &requiredResourceAccess) + if err != nil { + return err + } + acp.RequiredResourceAccess = &requiredResourceAccess + } + } + } + + return nil +} + +// ApplicationListResult application list operation result. +type ApplicationListResult struct { + autorest.Response `json:"-"` + // Value - A collection of applications. + Value *[]Application `json:"value,omitempty"` + // OdataNextLink - The URL to get the next set of results. + OdataNextLink *string `json:"odata.nextLink,omitempty"` +} + +// ApplicationListResultIterator provides access to a complete listing of Application values. +type ApplicationListResultIterator struct { + i int + page ApplicationListResultPage +} + +// 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 *ApplicationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationListResultIterator.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 *ApplicationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ApplicationListResultIterator) 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 ApplicationListResultIterator) Response() ApplicationListResult { + 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 ApplicationListResultIterator) Value() Application { + if !iter.page.NotDone() { + return Application{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ApplicationListResultIterator type. +func NewApplicationListResultIterator(page ApplicationListResultPage) ApplicationListResultIterator { + return ApplicationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (alr ApplicationListResult) IsEmpty() bool { + return alr.Value == nil || len(*alr.Value) == 0 +} + +// ApplicationListResultPage contains a page of Application values. +type ApplicationListResultPage struct { + fn func(context.Context, ApplicationListResult) (ApplicationListResult, error) + alr ApplicationListResult +} + +// 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 *ApplicationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.alr) + if err != nil { + return err + } + page.alr = next + 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 *ApplicationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ApplicationListResultPage) NotDone() bool { + return !page.alr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ApplicationListResultPage) Response() ApplicationListResult { + return page.alr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ApplicationListResultPage) Values() []Application { + if page.alr.IsEmpty() { + return nil + } + return *page.alr.Value +} + +// Creates a new instance of the ApplicationListResultPage type. +func NewApplicationListResultPage(getNextPage func(context.Context, ApplicationListResult) (ApplicationListResult, error)) ApplicationListResultPage { + return ApplicationListResultPage{fn: getNextPage} +} + +// ApplicationUpdateParameters request parameters for updating an existing application. +type ApplicationUpdateParameters struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // AppRoles - The collection of application roles that an application may declare. These roles can be assigned to users, groups or service principals. + AppRoles *[]AppRole `json:"appRoles,omitempty"` + // AvailableToOtherTenants - Whether the application is available to other tenants + AvailableToOtherTenants *bool `json:"availableToOtherTenants,omitempty"` + // DisplayName - The display name of the application. + DisplayName *string `json:"displayName,omitempty"` + // Homepage - The home page of the application. + Homepage *string `json:"homepage,omitempty"` + // IdentifierUris - A collection of URIs for the application. + IdentifierUris *[]string `json:"identifierUris,omitempty"` + // ReplyUrls - A collection of reply URLs for the application. + ReplyUrls *[]string `json:"replyUrls,omitempty"` + // KeyCredentials - The list of KeyCredential objects. + KeyCredentials *[]KeyCredential `json:"keyCredentials,omitempty"` + // PasswordCredentials - The list of PasswordCredential objects. + PasswordCredentials *[]PasswordCredential `json:"passwordCredentials,omitempty"` + // Oauth2AllowImplicitFlow - Whether to allow implicit grant flow for OAuth2 + Oauth2AllowImplicitFlow *bool `json:"oauth2AllowImplicitFlow,omitempty"` + // RequiredResourceAccess - Specifies resources that this application requires access to and the set of OAuth permission scopes and application roles that it needs under each of those resources. This pre-configuration of required resource access drives the consent experience. + RequiredResourceAccess *[]RequiredResourceAccess `json:"requiredResourceAccess,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationUpdateParameters. +func (aup ApplicationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aup.AppRoles != nil { + objectMap["appRoles"] = aup.AppRoles + } + if aup.AvailableToOtherTenants != nil { + objectMap["availableToOtherTenants"] = aup.AvailableToOtherTenants + } + if aup.DisplayName != nil { + objectMap["displayName"] = aup.DisplayName + } + if aup.Homepage != nil { + objectMap["homepage"] = aup.Homepage + } + if aup.IdentifierUris != nil { + objectMap["identifierUris"] = aup.IdentifierUris + } + if aup.ReplyUrls != nil { + objectMap["replyUrls"] = aup.ReplyUrls + } + if aup.KeyCredentials != nil { + objectMap["keyCredentials"] = aup.KeyCredentials + } + if aup.PasswordCredentials != nil { + objectMap["passwordCredentials"] = aup.PasswordCredentials + } + if aup.Oauth2AllowImplicitFlow != nil { + objectMap["oauth2AllowImplicitFlow"] = aup.Oauth2AllowImplicitFlow + } + if aup.RequiredResourceAccess != nil { + objectMap["requiredResourceAccess"] = aup.RequiredResourceAccess + } + for k, v := range aup.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationUpdateParameters struct. +func (aup *ApplicationUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if aup.AdditionalProperties == nil { + aup.AdditionalProperties = make(map[string]interface{}) + } + aup.AdditionalProperties[k] = additionalProperties + } + case "appRoles": + if v != nil { + var appRoles []AppRole + err = json.Unmarshal(*v, &appRoles) + if err != nil { + return err + } + aup.AppRoles = &appRoles + } + case "availableToOtherTenants": + if v != nil { + var availableToOtherTenants bool + err = json.Unmarshal(*v, &availableToOtherTenants) + if err != nil { + return err + } + aup.AvailableToOtherTenants = &availableToOtherTenants + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + aup.DisplayName = &displayName + } + case "homepage": + if v != nil { + var homepage string + err = json.Unmarshal(*v, &homepage) + if err != nil { + return err + } + aup.Homepage = &homepage + } + case "identifierUris": + if v != nil { + var identifierUris []string + err = json.Unmarshal(*v, &identifierUris) + if err != nil { + return err + } + aup.IdentifierUris = &identifierUris + } + case "replyUrls": + if v != nil { + var replyUrls []string + err = json.Unmarshal(*v, &replyUrls) + if err != nil { + return err + } + aup.ReplyUrls = &replyUrls + } + case "keyCredentials": + if v != nil { + var keyCredentials []KeyCredential + err = json.Unmarshal(*v, &keyCredentials) + if err != nil { + return err + } + aup.KeyCredentials = &keyCredentials + } + case "passwordCredentials": + if v != nil { + var passwordCredentials []PasswordCredential + err = json.Unmarshal(*v, &passwordCredentials) + if err != nil { + return err + } + aup.PasswordCredentials = &passwordCredentials + } + case "oauth2AllowImplicitFlow": + if v != nil { + var oauth2AllowImplicitFlow bool + err = json.Unmarshal(*v, &oauth2AllowImplicitFlow) + if err != nil { + return err + } + aup.Oauth2AllowImplicitFlow = &oauth2AllowImplicitFlow + } + case "requiredResourceAccess": + if v != nil { + var requiredResourceAccess []RequiredResourceAccess + err = json.Unmarshal(*v, &requiredResourceAccess) + if err != nil { + return err + } + aup.RequiredResourceAccess = &requiredResourceAccess + } + } + } + + return nil +} + +// AppRole ... +type AppRole struct { + // ID - Unique role identifier inside the appRoles collection. + ID *string `json:"id,omitempty"` + // AllowedMemberTypes - Specifies whether this app role definition can be assigned to users and groups by setting to 'User', or to other applications (that are accessing this application in daemon service scenarios) by setting to 'Application', or to both. + AllowedMemberTypes *[]string `json:"allowedMemberTypes,omitempty"` + // Description - Permission help text that appears in the admin app assignment and consent experiences. + Description *string `json:"description,omitempty"` + // DisplayName - Display name for the permission that appears in the admin consent and app assignment experiences. + DisplayName *string `json:"displayName,omitempty"` + // IsEnabled - When creating or updating a role definition, this must be set to true (which is the default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may be removed. + IsEnabled *bool `json:"isEnabled,omitempty"` + // Value - Specifies the value of the roles claim that the application should expect in the authentication and access tokens. + Value *string `json:"value,omitempty"` +} + +// CheckGroupMembershipParameters request parameters for IsMemberOf API call. +type CheckGroupMembershipParameters struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // GroupID - The object ID of the group to check. + GroupID *string `json:"groupId,omitempty"` + // MemberID - The object ID of the contact, group, user, or service principal to check for membership in the specified group. + MemberID *string `json:"memberId,omitempty"` +} + +// MarshalJSON is the custom marshaler for CheckGroupMembershipParameters. +func (cgmp CheckGroupMembershipParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cgmp.GroupID != nil { + objectMap["groupId"] = cgmp.GroupID + } + if cgmp.MemberID != nil { + objectMap["memberId"] = cgmp.MemberID + } + for k, v := range cgmp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CheckGroupMembershipParameters struct. +func (cgmp *CheckGroupMembershipParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if cgmp.AdditionalProperties == nil { + cgmp.AdditionalProperties = make(map[string]interface{}) + } + cgmp.AdditionalProperties[k] = additionalProperties + } + case "groupId": + if v != nil { + var groupID string + err = json.Unmarshal(*v, &groupID) + if err != nil { + return err + } + cgmp.GroupID = &groupID + } + case "memberId": + if v != nil { + var memberID string + err = json.Unmarshal(*v, &memberID) + if err != nil { + return err + } + cgmp.MemberID = &memberID + } + } + } + + return nil +} + +// CheckGroupMembershipResult server response for IsMemberOf API call +type CheckGroupMembershipResult struct { + autorest.Response `json:"-"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Value - True if the specified user, group, contact, or service principal has either direct or transitive membership in the specified group; otherwise, false. + Value *bool `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for CheckGroupMembershipResult. +func (cgmr CheckGroupMembershipResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cgmr.Value != nil { + objectMap["value"] = cgmr.Value + } + for k, v := range cgmr.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CheckGroupMembershipResult struct. +func (cgmr *CheckGroupMembershipResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if cgmr.AdditionalProperties == nil { + cgmr.AdditionalProperties = make(map[string]interface{}) + } + cgmr.AdditionalProperties[k] = additionalProperties + } + case "value": + if v != nil { + var value bool + err = json.Unmarshal(*v, &value) + if err != nil { + return err + } + cgmr.Value = &value + } + } + } + + return nil +} + +// BasicDirectoryObject represents an Azure Active Directory object. +type BasicDirectoryObject interface { + AsApplication() (*Application, bool) + AsADGroup() (*ADGroup, bool) + AsServicePrincipal() (*ServicePrincipal, bool) + AsUser() (*User, bool) + AsDirectoryObject() (*DirectoryObject, bool) +} + +// DirectoryObject represents an Azure Active Directory object. +type DirectoryObject struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ObjectID - The object ID. + ObjectID *string `json:"objectId,omitempty"` + // DeletionTimestamp - The time at which the directory object was deleted. + DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +func unmarshalBasicDirectoryObject(body []byte) (BasicDirectoryObject, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["objectType"] { + case string(ObjectTypeApplication): + var a Application + err := json.Unmarshal(body, &a) + return a, err + case string(ObjectTypeGroup): + var ag ADGroup + err := json.Unmarshal(body, &ag) + return ag, err + case string(ObjectTypeServicePrincipal): + var sp ServicePrincipal + err := json.Unmarshal(body, &sp) + return sp, err + case string(ObjectTypeUser): + var u User + err := json.Unmarshal(body, &u) + return u, err + default: + var do DirectoryObject + err := json.Unmarshal(body, &do) + return do, err + } +} +func unmarshalBasicDirectoryObjectArray(body []byte) ([]BasicDirectoryObject, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + doArray := make([]BasicDirectoryObject, len(rawMessages)) + + for index, rawMessage := range rawMessages { + do, err := unmarshalBasicDirectoryObject(*rawMessage) + if err != nil { + return nil, err + } + doArray[index] = do + } + return doArray, nil +} + +// MarshalJSON is the custom marshaler for DirectoryObject. +func (do DirectoryObject) MarshalJSON() ([]byte, error) { + do.ObjectType = ObjectTypeDirectoryObject + objectMap := make(map[string]interface{}) + if do.ObjectID != nil { + objectMap["objectId"] = do.ObjectID + } + if do.DeletionTimestamp != nil { + objectMap["deletionTimestamp"] = do.DeletionTimestamp + } + if do.ObjectType != "" { + objectMap["objectType"] = do.ObjectType + } + for k, v := range do.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsApplication is the BasicDirectoryObject implementation for DirectoryObject. +func (do DirectoryObject) AsApplication() (*Application, bool) { + return nil, false +} + +// AsADGroup is the BasicDirectoryObject implementation for DirectoryObject. +func (do DirectoryObject) AsADGroup() (*ADGroup, bool) { + return nil, false +} + +// AsServicePrincipal is the BasicDirectoryObject implementation for DirectoryObject. +func (do DirectoryObject) AsServicePrincipal() (*ServicePrincipal, bool) { + return nil, false +} + +// AsUser is the BasicDirectoryObject implementation for DirectoryObject. +func (do DirectoryObject) AsUser() (*User, bool) { + return nil, false +} + +// AsDirectoryObject is the BasicDirectoryObject implementation for DirectoryObject. +func (do DirectoryObject) AsDirectoryObject() (*DirectoryObject, bool) { + return &do, true +} + +// AsBasicDirectoryObject is the BasicDirectoryObject implementation for DirectoryObject. +func (do DirectoryObject) AsBasicDirectoryObject() (BasicDirectoryObject, bool) { + return &do, true +} + +// UnmarshalJSON is the custom unmarshaler for DirectoryObject struct. +func (do *DirectoryObject) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if do.AdditionalProperties == nil { + do.AdditionalProperties = make(map[string]interface{}) + } + do.AdditionalProperties[k] = additionalProperties + } + case "objectId": + if v != nil { + var objectID string + err = json.Unmarshal(*v, &objectID) + if err != nil { + return err + } + do.ObjectID = &objectID + } + case "deletionTimestamp": + if v != nil { + var deletionTimestamp date.Time + err = json.Unmarshal(*v, &deletionTimestamp) + if err != nil { + return err + } + do.DeletionTimestamp = &deletionTimestamp + } + case "objectType": + if v != nil { + var objectType ObjectType + err = json.Unmarshal(*v, &objectType) + if err != nil { + return err + } + do.ObjectType = objectType + } + } + } + + return nil +} + +// DirectoryObjectListResult directoryObject list operation result. +type DirectoryObjectListResult struct { + autorest.Response `json:"-"` + // Value - A collection of DirectoryObject. + Value *[]BasicDirectoryObject `json:"value,omitempty"` + // OdataNextLink - The URL to get the next set of results. + OdataNextLink *string `json:"odata.nextLink,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DirectoryObjectListResult struct. +func (dolr *DirectoryObjectListResult) 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 "value": + if v != nil { + value, err := unmarshalBasicDirectoryObjectArray(*v) + if err != nil { + return err + } + dolr.Value = &value + } + case "odata.nextLink": + if v != nil { + var odataNextLink string + err = json.Unmarshal(*v, &odataNextLink) + if err != nil { + return err + } + dolr.OdataNextLink = &odataNextLink + } + } + } + + return nil +} + +// DirectoryObjectListResultIterator provides access to a complete listing of DirectoryObject values. +type DirectoryObjectListResultIterator struct { + i int + page DirectoryObjectListResultPage +} + +// 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 *DirectoryObjectListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DirectoryObjectListResultIterator.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 *DirectoryObjectListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DirectoryObjectListResultIterator) 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 DirectoryObjectListResultIterator) Response() DirectoryObjectListResult { + 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 DirectoryObjectListResultIterator) Value() BasicDirectoryObject { + if !iter.page.NotDone() { + return DirectoryObject{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DirectoryObjectListResultIterator type. +func NewDirectoryObjectListResultIterator(page DirectoryObjectListResultPage) DirectoryObjectListResultIterator { + return DirectoryObjectListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dolr DirectoryObjectListResult) IsEmpty() bool { + return dolr.Value == nil || len(*dolr.Value) == 0 +} + +// directoryObjectListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dolr DirectoryObjectListResult) directoryObjectListResultPreparer(ctx context.Context) (*http.Request, error) { + if dolr.OdataNextLink == nil || len(to.String(dolr.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dolr.OdataNextLink))) +} + +// DirectoryObjectListResultPage contains a page of BasicDirectoryObject values. +type DirectoryObjectListResultPage struct { + fn func(context.Context, DirectoryObjectListResult) (DirectoryObjectListResult, error) + dolr DirectoryObjectListResult +} + +// 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 *DirectoryObjectListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DirectoryObjectListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.dolr) + if err != nil { + return err + } + page.dolr = next + 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 *DirectoryObjectListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DirectoryObjectListResultPage) NotDone() bool { + return !page.dolr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DirectoryObjectListResultPage) Response() DirectoryObjectListResult { + return page.dolr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DirectoryObjectListResultPage) Values() []BasicDirectoryObject { + if page.dolr.IsEmpty() { + return nil + } + return *page.dolr.Value +} + +// Creates a new instance of the DirectoryObjectListResultPage type. +func NewDirectoryObjectListResultPage(getNextPage func(context.Context, DirectoryObjectListResult) (DirectoryObjectListResult, error)) DirectoryObjectListResultPage { + return DirectoryObjectListResultPage{fn: getNextPage} +} + +// Domain active Directory Domain information. +type Domain struct { + autorest.Response `json:"-"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // AuthenticationType - the type of the authentication into the domain. + AuthenticationType *string `json:"authenticationType,omitempty"` + // IsDefault - if this is the default domain in the tenant. + IsDefault *bool `json:"isDefault,omitempty"` + // IsVerified - if this domain's ownership is verified. + IsVerified *bool `json:"isVerified,omitempty"` + // Name - the domain name. + Name *string `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for Domain. +func (d Domain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.AuthenticationType != nil { + objectMap["authenticationType"] = d.AuthenticationType + } + if d.IsDefault != nil { + objectMap["isDefault"] = d.IsDefault + } + if d.IsVerified != nil { + objectMap["isVerified"] = d.IsVerified + } + if d.Name != nil { + objectMap["name"] = d.Name + } + for k, v := range d.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Domain struct. +func (d *Domain) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if d.AdditionalProperties == nil { + d.AdditionalProperties = make(map[string]interface{}) + } + d.AdditionalProperties[k] = additionalProperties + } + case "authenticationType": + if v != nil { + var authenticationType string + err = json.Unmarshal(*v, &authenticationType) + if err != nil { + return err + } + d.AuthenticationType = &authenticationType + } + case "isDefault": + if v != nil { + var isDefault bool + err = json.Unmarshal(*v, &isDefault) + if err != nil { + return err + } + d.IsDefault = &isDefault + } + case "isVerified": + if v != nil { + var isVerified bool + err = json.Unmarshal(*v, &isVerified) + if err != nil { + return err + } + d.IsVerified = &isVerified + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + d.Name = &name + } + } + } + + return nil +} + +// DomainListResult server response for Get tenant domains API call. +type DomainListResult struct { + autorest.Response `json:"-"` + // Value - the list of domains. + Value *[]Domain `json:"value,omitempty"` +} + +// ErrorMessage active Directory error message. +type ErrorMessage struct { + // Message - Error message value. + Message *string `json:"value,omitempty"` +} + +// GetObjectsParameters request parameters for the GetObjectsByObjectIds API. +type GetObjectsParameters struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ObjectIds - The requested object IDs. + ObjectIds *[]string `json:"objectIds,omitempty"` + // Types - The requested object types. + Types *[]string `json:"types,omitempty"` + // IncludeDirectoryObjectReferences - If true, also searches for object IDs in the partner tenant. + IncludeDirectoryObjectReferences *bool `json:"includeDirectoryObjectReferences,omitempty"` +} + +// MarshalJSON is the custom marshaler for GetObjectsParameters. +func (gop GetObjectsParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gop.ObjectIds != nil { + objectMap["objectIds"] = gop.ObjectIds + } + if gop.Types != nil { + objectMap["types"] = gop.Types + } + if gop.IncludeDirectoryObjectReferences != nil { + objectMap["includeDirectoryObjectReferences"] = gop.IncludeDirectoryObjectReferences + } + for k, v := range gop.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GetObjectsParameters struct. +func (gop *GetObjectsParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if gop.AdditionalProperties == nil { + gop.AdditionalProperties = make(map[string]interface{}) + } + gop.AdditionalProperties[k] = additionalProperties + } + case "objectIds": + if v != nil { + var objectIds []string + err = json.Unmarshal(*v, &objectIds) + if err != nil { + return err + } + gop.ObjectIds = &objectIds + } + case "types": + if v != nil { + var typesVar []string + err = json.Unmarshal(*v, &typesVar) + if err != nil { + return err + } + gop.Types = &typesVar + } + case "includeDirectoryObjectReferences": + if v != nil { + var includeDirectoryObjectReferences bool + err = json.Unmarshal(*v, &includeDirectoryObjectReferences) + if err != nil { + return err + } + gop.IncludeDirectoryObjectReferences = &includeDirectoryObjectReferences + } + } + } + + return nil +} + +// GraphError active Directory error information. +type GraphError struct { + // OdataError - A Graph API error. + *OdataError `json:"odata.error,omitempty"` +} + +// MarshalJSON is the custom marshaler for GraphError. +func (ge GraphError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ge.OdataError != nil { + objectMap["odata.error"] = ge.OdataError + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GraphError struct. +func (ge *GraphError) 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 "odata.error": + if v != nil { + var odataError OdataError + err = json.Unmarshal(*v, &odataError) + if err != nil { + return err + } + ge.OdataError = &odataError + } + } + } + + return nil +} + +// GroupAddMemberParameters request parameters for adding a member to a group. +type GroupAddMemberParameters struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // URL - A member object URL, such as "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd", where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and "f260bbc4-c254-447b-94cf-293b5ec434dd" is the objectId of the member (user, application, servicePrincipal, group) to be added. + URL *string `json:"url,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupAddMemberParameters. +func (gamp GroupAddMemberParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gamp.URL != nil { + objectMap["url"] = gamp.URL + } + for k, v := range gamp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GroupAddMemberParameters struct. +func (gamp *GroupAddMemberParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if gamp.AdditionalProperties == nil { + gamp.AdditionalProperties = make(map[string]interface{}) + } + gamp.AdditionalProperties[k] = additionalProperties + } + case "url": + if v != nil { + var URL string + err = json.Unmarshal(*v, &URL) + if err != nil { + return err + } + gamp.URL = &URL + } + } + } + + return nil +} + +// GroupCreateParameters request parameters for creating a new group. +type GroupCreateParameters struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // DisplayName - Group display name + DisplayName *string `json:"displayName,omitempty"` + // MailEnabled - Whether the group is mail-enabled. Must be false. This is because only pure security groups can be created using the Graph API. + MailEnabled *bool `json:"mailEnabled,omitempty"` + // MailNickname - Mail nickname + MailNickname *string `json:"mailNickname,omitempty"` + // SecurityEnabled - Whether the group is a security group. Must be true. This is because only pure security groups can be created using the Graph API. + SecurityEnabled *bool `json:"securityEnabled,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupCreateParameters. +func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gcp.DisplayName != nil { + objectMap["displayName"] = gcp.DisplayName + } + if gcp.MailEnabled != nil { + objectMap["mailEnabled"] = gcp.MailEnabled + } + if gcp.MailNickname != nil { + objectMap["mailNickname"] = gcp.MailNickname + } + if gcp.SecurityEnabled != nil { + objectMap["securityEnabled"] = gcp.SecurityEnabled + } + for k, v := range gcp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct. +func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if gcp.AdditionalProperties == nil { + gcp.AdditionalProperties = make(map[string]interface{}) + } + gcp.AdditionalProperties[k] = additionalProperties + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + gcp.DisplayName = &displayName + } + case "mailEnabled": + if v != nil { + var mailEnabled bool + err = json.Unmarshal(*v, &mailEnabled) + if err != nil { + return err + } + gcp.MailEnabled = &mailEnabled + } + case "mailNickname": + if v != nil { + var mailNickname string + err = json.Unmarshal(*v, &mailNickname) + if err != nil { + return err + } + gcp.MailNickname = &mailNickname + } + case "securityEnabled": + if v != nil { + var securityEnabled bool + err = json.Unmarshal(*v, &securityEnabled) + if err != nil { + return err + } + gcp.SecurityEnabled = &securityEnabled + } + } + } + + return nil +} + +// GroupGetMemberGroupsParameters request parameters for GetMemberGroups API call. +type GroupGetMemberGroupsParameters struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SecurityEnabledOnly - If true, only membership in security-enabled groups should be checked. Otherwise, membership in all groups should be checked. + SecurityEnabledOnly *bool `json:"securityEnabledOnly,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupGetMemberGroupsParameters. +func (ggmgp GroupGetMemberGroupsParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ggmgp.SecurityEnabledOnly != nil { + objectMap["securityEnabledOnly"] = ggmgp.SecurityEnabledOnly + } + for k, v := range ggmgp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GroupGetMemberGroupsParameters struct. +func (ggmgp *GroupGetMemberGroupsParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ggmgp.AdditionalProperties == nil { + ggmgp.AdditionalProperties = make(map[string]interface{}) + } + ggmgp.AdditionalProperties[k] = additionalProperties + } + case "securityEnabledOnly": + if v != nil { + var securityEnabledOnly bool + err = json.Unmarshal(*v, &securityEnabledOnly) + if err != nil { + return err + } + ggmgp.SecurityEnabledOnly = &securityEnabledOnly + } + } + } + + return nil +} + +// GroupGetMemberGroupsResult server response for GetMemberGroups API call. +type GroupGetMemberGroupsResult struct { + autorest.Response `json:"-"` + // Value - A collection of group IDs of which the group is a member. + Value *[]string `json:"value,omitempty"` +} + +// GroupListResult server response for Get tenant groups API call +type GroupListResult struct { + autorest.Response `json:"-"` + // Value - A collection of Active Directory groups. + Value *[]ADGroup `json:"value,omitempty"` + // OdataNextLink - The URL to get the next set of results. + OdataNextLink *string `json:"odata.nextLink,omitempty"` +} + +// GroupListResultIterator provides access to a complete listing of ADGroup values. +type GroupListResultIterator struct { + i int + page GroupListResultPage +} + +// 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 *GroupListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupListResultIterator.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 *GroupListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter GroupListResultIterator) 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 GroupListResultIterator) Response() GroupListResult { + 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 GroupListResultIterator) Value() ADGroup { + if !iter.page.NotDone() { + return ADGroup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the GroupListResultIterator type. +func NewGroupListResultIterator(page GroupListResultPage) GroupListResultIterator { + return GroupListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (glr GroupListResult) IsEmpty() bool { + return glr.Value == nil || len(*glr.Value) == 0 +} + +// GroupListResultPage contains a page of ADGroup values. +type GroupListResultPage struct { + fn func(context.Context, GroupListResult) (GroupListResult, error) + glr GroupListResult +} + +// 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 *GroupListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.glr) + if err != nil { + return err + } + page.glr = next + 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 *GroupListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page GroupListResultPage) NotDone() bool { + return !page.glr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page GroupListResultPage) Response() GroupListResult { + return page.glr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page GroupListResultPage) Values() []ADGroup { + if page.glr.IsEmpty() { + return nil + } + return *page.glr.Value +} + +// Creates a new instance of the GroupListResultPage type. +func NewGroupListResultPage(getNextPage func(context.Context, GroupListResult) (GroupListResult, error)) GroupListResultPage { + return GroupListResultPage{fn: getNextPage} +} + +// KeyCredential active Directory Key Credential information. +type KeyCredential struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // StartDate - Start date. + StartDate *date.Time `json:"startDate,omitempty"` + // EndDate - End date. + EndDate *date.Time `json:"endDate,omitempty"` + // Value - Key value. + Value *string `json:"value,omitempty"` + // KeyID - Key ID. + KeyID *string `json:"keyId,omitempty"` + // Usage - Usage. Acceptable values are 'Verify' and 'Sign'. + Usage *string `json:"usage,omitempty"` + // Type - Type. Acceptable values are 'AsymmetricX509Cert' and 'Symmetric'. + Type *string `json:"type,omitempty"` + // CustomKeyIdentifier - Custom Key Identifier + CustomKeyIdentifier *string `json:"customKeyIdentifier,omitempty"` +} + +// MarshalJSON is the custom marshaler for KeyCredential. +func (kc KeyCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kc.StartDate != nil { + objectMap["startDate"] = kc.StartDate + } + if kc.EndDate != nil { + objectMap["endDate"] = kc.EndDate + } + if kc.Value != nil { + objectMap["value"] = kc.Value + } + if kc.KeyID != nil { + objectMap["keyId"] = kc.KeyID + } + if kc.Usage != nil { + objectMap["usage"] = kc.Usage + } + if kc.Type != nil { + objectMap["type"] = kc.Type + } + if kc.CustomKeyIdentifier != nil { + objectMap["customKeyIdentifier"] = kc.CustomKeyIdentifier + } + for k, v := range kc.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for KeyCredential struct. +func (kc *KeyCredential) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if kc.AdditionalProperties == nil { + kc.AdditionalProperties = make(map[string]interface{}) + } + kc.AdditionalProperties[k] = additionalProperties + } + case "startDate": + if v != nil { + var startDate date.Time + err = json.Unmarshal(*v, &startDate) + if err != nil { + return err + } + kc.StartDate = &startDate + } + case "endDate": + if v != nil { + var endDate date.Time + err = json.Unmarshal(*v, &endDate) + if err != nil { + return err + } + kc.EndDate = &endDate + } + case "value": + if v != nil { + var value string + err = json.Unmarshal(*v, &value) + if err != nil { + return err + } + kc.Value = &value + } + case "keyId": + if v != nil { + var keyID string + err = json.Unmarshal(*v, &keyID) + if err != nil { + return err + } + kc.KeyID = &keyID + } + case "usage": + if v != nil { + var usage string + err = json.Unmarshal(*v, &usage) + if err != nil { + return err + } + kc.Usage = &usage + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kc.Type = &typeVar + } + case "customKeyIdentifier": + if v != nil { + var customKeyIdentifier string + err = json.Unmarshal(*v, &customKeyIdentifier) + if err != nil { + return err + } + kc.CustomKeyIdentifier = &customKeyIdentifier + } + } + } + + return nil +} + +// KeyCredentialListResult keyCredential list operation result. +type KeyCredentialListResult struct { + autorest.Response `json:"-"` + // Value - A collection of KeyCredentials. + Value *[]KeyCredential `json:"value,omitempty"` +} + +// KeyCredentialsUpdateParameters request parameters for a KeyCredentials update operation +type KeyCredentialsUpdateParameters struct { + // Value - A collection of KeyCredentials. + Value *[]KeyCredential `json:"value,omitempty"` +} + +// OdataError active Directory OData error information. +type OdataError struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // ErrorMessage - Error Message. + *ErrorMessage `json:"message,omitempty"` +} + +// MarshalJSON is the custom marshaler for OdataError. +func (oe OdataError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oe.Code != nil { + objectMap["code"] = oe.Code + } + if oe.ErrorMessage != nil { + objectMap["message"] = oe.ErrorMessage + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OdataError struct. +func (oe *OdataError) 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 "code": + if v != nil { + var code string + err = json.Unmarshal(*v, &code) + if err != nil { + return err + } + oe.Code = &code + } + case "message": + if v != nil { + var errorMessage ErrorMessage + err = json.Unmarshal(*v, &errorMessage) + if err != nil { + return err + } + oe.ErrorMessage = &errorMessage + } + } + } + + return nil +} + +// PasswordCredential active Directory Password Credential information. +type PasswordCredential struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // StartDate - Start date. + StartDate *date.Time `json:"startDate,omitempty"` + // EndDate - End date. + EndDate *date.Time `json:"endDate,omitempty"` + // KeyID - Key ID. + KeyID *string `json:"keyId,omitempty"` + // Value - Key value. + Value *string `json:"value,omitempty"` + // CustomKeyIdentifier - Custom Key Identifier + CustomKeyIdentifier *[]byte `json:"customKeyIdentifier,omitempty"` +} + +// MarshalJSON is the custom marshaler for PasswordCredential. +func (pc PasswordCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.StartDate != nil { + objectMap["startDate"] = pc.StartDate + } + if pc.EndDate != nil { + objectMap["endDate"] = pc.EndDate + } + if pc.KeyID != nil { + objectMap["keyId"] = pc.KeyID + } + if pc.Value != nil { + objectMap["value"] = pc.Value + } + if pc.CustomKeyIdentifier != nil { + objectMap["customKeyIdentifier"] = pc.CustomKeyIdentifier + } + for k, v := range pc.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PasswordCredential struct. +func (pc *PasswordCredential) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if pc.AdditionalProperties == nil { + pc.AdditionalProperties = make(map[string]interface{}) + } + pc.AdditionalProperties[k] = additionalProperties + } + case "startDate": + if v != nil { + var startDate date.Time + err = json.Unmarshal(*v, &startDate) + if err != nil { + return err + } + pc.StartDate = &startDate + } + case "endDate": + if v != nil { + var endDate date.Time + err = json.Unmarshal(*v, &endDate) + if err != nil { + return err + } + pc.EndDate = &endDate + } + case "keyId": + if v != nil { + var keyID string + err = json.Unmarshal(*v, &keyID) + if err != nil { + return err + } + pc.KeyID = &keyID + } + case "value": + if v != nil { + var value string + err = json.Unmarshal(*v, &value) + if err != nil { + return err + } + pc.Value = &value + } + case "customKeyIdentifier": + if v != nil { + var customKeyIdentifier []byte + err = json.Unmarshal(*v, &customKeyIdentifier) + if err != nil { + return err + } + pc.CustomKeyIdentifier = &customKeyIdentifier + } + } + } + + return nil +} + +// PasswordCredentialListResult passwordCredential list operation result. +type PasswordCredentialListResult struct { + autorest.Response `json:"-"` + // Value - A collection of PasswordCredentials. + Value *[]PasswordCredential `json:"value,omitempty"` +} + +// PasswordCredentialsUpdateParameters request parameters for a PasswordCredentials update operation. +type PasswordCredentialsUpdateParameters struct { + // Value - A collection of PasswordCredentials. + Value *[]PasswordCredential `json:"value,omitempty"` +} + +// PasswordProfile the password profile associated with a user. +type PasswordProfile struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Password - Password + Password *string `json:"password,omitempty"` + // ForceChangePasswordNextLogin - Whether to force a password change on next login. + ForceChangePasswordNextLogin *bool `json:"forceChangePasswordNextLogin,omitempty"` +} + +// MarshalJSON is the custom marshaler for PasswordProfile. +func (pp PasswordProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pp.Password != nil { + objectMap["password"] = pp.Password + } + if pp.ForceChangePasswordNextLogin != nil { + objectMap["forceChangePasswordNextLogin"] = pp.ForceChangePasswordNextLogin + } + for k, v := range pp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PasswordProfile struct. +func (pp *PasswordProfile) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if pp.AdditionalProperties == nil { + pp.AdditionalProperties = make(map[string]interface{}) + } + pp.AdditionalProperties[k] = additionalProperties + } + case "password": + if v != nil { + var password string + err = json.Unmarshal(*v, &password) + if err != nil { + return err + } + pp.Password = &password + } + case "forceChangePasswordNextLogin": + if v != nil { + var forceChangePasswordNextLogin bool + err = json.Unmarshal(*v, &forceChangePasswordNextLogin) + if err != nil { + return err + } + pp.ForceChangePasswordNextLogin = &forceChangePasswordNextLogin + } + } + } + + return nil +} + +// Permissions ... +type Permissions struct { + autorest.Response `json:"-"` + // OdataType - Microsoft.DirectoryServices.OAuth2PermissionGrant + OdataType *string `json:"odata.type,omitempty"` + // ClientID - The objectId of the Service Principal associated with the app + ClientID *string `json:"clientId,omitempty"` + // ConsentType - Typically set to AllPrincipals + ConsentType *string `json:"consentType,omitempty"` + // PrincipalID - Set to null if AllPrincipals is set + PrincipalID interface{} `json:"principalId,omitempty"` + // ResourceID - Service Principal Id of the resource you want to grant + ResourceID *string `json:"resourceId,omitempty"` + // Scope - Typically set to user_impersonation + Scope *string `json:"scope,omitempty"` + // StartTime - Start time for TTL + StartTime *string `json:"startTime,omitempty"` + // ExpiryTime - Expiry time for TTL + ExpiryTime *string `json:"expiryTime,omitempty"` +} + +// RequiredResourceAccess specifies the set of OAuth 2.0 permission scopes and app roles under the +// specified resource that an application requires access to. The specified OAuth 2.0 permission scopes may +// be requested by client applications (through the requiredResourceAccess collection) when calling a +// resource application. The requiredResourceAccess property of the Application entity is a collection of +// RequiredResourceAccess. +type RequiredResourceAccess struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ResourceAccess - The list of OAuth2.0 permission scopes and app roles that the application requires from the specified resource. + ResourceAccess *[]ResourceAccess `json:"resourceAccess,omitempty"` + // ResourceAppID - The unique identifier for the resource that the application requires access to. This should be equal to the appId declared on the target resource application. + ResourceAppID *string `json:"resourceAppId,omitempty"` +} + +// MarshalJSON is the custom marshaler for RequiredResourceAccess. +func (rra RequiredResourceAccess) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rra.ResourceAccess != nil { + objectMap["resourceAccess"] = rra.ResourceAccess + } + if rra.ResourceAppID != nil { + objectMap["resourceAppId"] = rra.ResourceAppID + } + for k, v := range rra.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RequiredResourceAccess struct. +func (rra *RequiredResourceAccess) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if rra.AdditionalProperties == nil { + rra.AdditionalProperties = make(map[string]interface{}) + } + rra.AdditionalProperties[k] = additionalProperties + } + case "resourceAccess": + if v != nil { + var resourceAccess []ResourceAccess + err = json.Unmarshal(*v, &resourceAccess) + if err != nil { + return err + } + rra.ResourceAccess = &resourceAccess + } + case "resourceAppId": + if v != nil { + var resourceAppID string + err = json.Unmarshal(*v, &resourceAppID) + if err != nil { + return err + } + rra.ResourceAppID = &resourceAppID + } + } + } + + return nil +} + +// ResourceAccess specifies an OAuth 2.0 permission scope or an app role that an application requires. The +// resourceAccess property of the RequiredResourceAccess type is a collection of ResourceAccess. +type ResourceAccess struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ID - The unique identifier for one of the OAuth2Permission or AppRole instances that the resource application exposes. + ID *string `json:"id,omitempty"` + // Type - Specifies whether the id property references an OAuth2Permission or an AppRole. Possible values are "scope" or "role". + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceAccess. +func (ra ResourceAccess) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ra.ID != nil { + objectMap["id"] = ra.ID + } + if ra.Type != nil { + objectMap["type"] = ra.Type + } + for k, v := range ra.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ResourceAccess struct. +func (ra *ResourceAccess) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ra.AdditionalProperties == nil { + ra.AdditionalProperties = make(map[string]interface{}) + } + ra.AdditionalProperties[k] = additionalProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ra.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ra.Type = &typeVar + } + } + } + + return nil +} + +// ServicePrincipal active Directory service principal information. +type ServicePrincipal struct { + autorest.Response `json:"-"` + // DisplayName - The display name of the service principal. + DisplayName *string `json:"displayName,omitempty"` + // AppID - The application ID. + AppID *string `json:"appId,omitempty"` + // AppRoles - The collection of application roles that an application may declare. These roles can be assigned to users, groups or service principals. + AppRoles *[]AppRole `json:"appRoles,omitempty"` + // ServicePrincipalNames - A collection of service principal names. + ServicePrincipalNames *[]string `json:"servicePrincipalNames,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ObjectID - The object ID. + ObjectID *string `json:"objectId,omitempty"` + // DeletionTimestamp - The time at which the directory object was deleted. + DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServicePrincipal. +func (sp ServicePrincipal) MarshalJSON() ([]byte, error) { + sp.ObjectType = ObjectTypeServicePrincipal + objectMap := make(map[string]interface{}) + if sp.DisplayName != nil { + objectMap["displayName"] = sp.DisplayName + } + if sp.AppID != nil { + objectMap["appId"] = sp.AppID + } + if sp.AppRoles != nil { + objectMap["appRoles"] = sp.AppRoles + } + if sp.ServicePrincipalNames != nil { + objectMap["servicePrincipalNames"] = sp.ServicePrincipalNames + } + if sp.ObjectID != nil { + objectMap["objectId"] = sp.ObjectID + } + if sp.DeletionTimestamp != nil { + objectMap["deletionTimestamp"] = sp.DeletionTimestamp + } + if sp.ObjectType != "" { + objectMap["objectType"] = sp.ObjectType + } + for k, v := range sp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsApplication is the BasicDirectoryObject implementation for ServicePrincipal. +func (sp ServicePrincipal) AsApplication() (*Application, bool) { + return nil, false +} + +// AsADGroup is the BasicDirectoryObject implementation for ServicePrincipal. +func (sp ServicePrincipal) AsADGroup() (*ADGroup, bool) { + return nil, false +} + +// AsServicePrincipal is the BasicDirectoryObject implementation for ServicePrincipal. +func (sp ServicePrincipal) AsServicePrincipal() (*ServicePrincipal, bool) { + return &sp, true +} + +// AsUser is the BasicDirectoryObject implementation for ServicePrincipal. +func (sp ServicePrincipal) AsUser() (*User, bool) { + return nil, false +} + +// AsDirectoryObject is the BasicDirectoryObject implementation for ServicePrincipal. +func (sp ServicePrincipal) AsDirectoryObject() (*DirectoryObject, bool) { + return nil, false +} + +// AsBasicDirectoryObject is the BasicDirectoryObject implementation for ServicePrincipal. +func (sp ServicePrincipal) AsBasicDirectoryObject() (BasicDirectoryObject, bool) { + return &sp, true +} + +// UnmarshalJSON is the custom unmarshaler for ServicePrincipal struct. +func (sp *ServicePrincipal) 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 "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + sp.DisplayName = &displayName + } + case "appId": + if v != nil { + var appID string + err = json.Unmarshal(*v, &appID) + if err != nil { + return err + } + sp.AppID = &appID + } + case "appRoles": + if v != nil { + var appRoles []AppRole + err = json.Unmarshal(*v, &appRoles) + if err != nil { + return err + } + sp.AppRoles = &appRoles + } + case "servicePrincipalNames": + if v != nil { + var servicePrincipalNames []string + err = json.Unmarshal(*v, &servicePrincipalNames) + if err != nil { + return err + } + sp.ServicePrincipalNames = &servicePrincipalNames + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if sp.AdditionalProperties == nil { + sp.AdditionalProperties = make(map[string]interface{}) + } + sp.AdditionalProperties[k] = additionalProperties + } + case "objectId": + if v != nil { + var objectID string + err = json.Unmarshal(*v, &objectID) + if err != nil { + return err + } + sp.ObjectID = &objectID + } + case "deletionTimestamp": + if v != nil { + var deletionTimestamp date.Time + err = json.Unmarshal(*v, &deletionTimestamp) + if err != nil { + return err + } + sp.DeletionTimestamp = &deletionTimestamp + } + case "objectType": + if v != nil { + var objectType ObjectType + err = json.Unmarshal(*v, &objectType) + if err != nil { + return err + } + sp.ObjectType = objectType + } + } + } + + return nil +} + +// ServicePrincipalCreateParameters request parameters for creating a new service principal. +type ServicePrincipalCreateParameters struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // AccountEnabled - Whether the account is enabled + AccountEnabled *bool `json:"accountEnabled,omitempty"` + // AppID - application Id + AppID *string `json:"appId,omitempty"` + // AppRoleAssignmentRequired - Specifies whether an AppRoleAssignment to a user or group is required before Azure AD will issue a user or access token to the application. + AppRoleAssignmentRequired *bool `json:"appRoleAssignmentRequired,omitempty"` + // DisplayName - The display name for the service principal. + DisplayName *string `json:"displayName,omitempty"` + ErrorURL *string `json:"errorUrl,omitempty"` + // Homepage - The URL to the homepage of the associated application. + Homepage *string `json:"homepage,omitempty"` + // KeyCredentials - A collection of KeyCredential objects. + KeyCredentials *[]KeyCredential `json:"keyCredentials,omitempty"` + // PasswordCredentials - A collection of PasswordCredential objects + PasswordCredentials *[]PasswordCredential `json:"passwordCredentials,omitempty"` + // PublisherName - The display name of the tenant in which the associated application is specified. + PublisherName *string `json:"publisherName,omitempty"` + // ReplyUrls - A collection of reply URLs for the service principal. + ReplyUrls *[]string `json:"replyUrls,omitempty"` + SamlMetadataURL *string `json:"samlMetadataUrl,omitempty"` + // ServicePrincipalNames - A collection of service principal names. + ServicePrincipalNames *[]string `json:"servicePrincipalNames,omitempty"` + Tags *[]string `json:"tags,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServicePrincipalCreateParameters. +func (spcp ServicePrincipalCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spcp.AccountEnabled != nil { + objectMap["accountEnabled"] = spcp.AccountEnabled + } + if spcp.AppID != nil { + objectMap["appId"] = spcp.AppID + } + if spcp.AppRoleAssignmentRequired != nil { + objectMap["appRoleAssignmentRequired"] = spcp.AppRoleAssignmentRequired + } + if spcp.DisplayName != nil { + objectMap["displayName"] = spcp.DisplayName + } + if spcp.ErrorURL != nil { + objectMap["errorUrl"] = spcp.ErrorURL + } + if spcp.Homepage != nil { + objectMap["homepage"] = spcp.Homepage + } + if spcp.KeyCredentials != nil { + objectMap["keyCredentials"] = spcp.KeyCredentials + } + if spcp.PasswordCredentials != nil { + objectMap["passwordCredentials"] = spcp.PasswordCredentials + } + if spcp.PublisherName != nil { + objectMap["publisherName"] = spcp.PublisherName + } + if spcp.ReplyUrls != nil { + objectMap["replyUrls"] = spcp.ReplyUrls + } + if spcp.SamlMetadataURL != nil { + objectMap["samlMetadataUrl"] = spcp.SamlMetadataURL + } + if spcp.ServicePrincipalNames != nil { + objectMap["servicePrincipalNames"] = spcp.ServicePrincipalNames + } + if spcp.Tags != nil { + objectMap["tags"] = spcp.Tags + } + for k, v := range spcp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServicePrincipalCreateParameters struct. +func (spcp *ServicePrincipalCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if spcp.AdditionalProperties == nil { + spcp.AdditionalProperties = make(map[string]interface{}) + } + spcp.AdditionalProperties[k] = additionalProperties + } + case "accountEnabled": + if v != nil { + var accountEnabled bool + err = json.Unmarshal(*v, &accountEnabled) + if err != nil { + return err + } + spcp.AccountEnabled = &accountEnabled + } + case "appId": + if v != nil { + var appID string + err = json.Unmarshal(*v, &appID) + if err != nil { + return err + } + spcp.AppID = &appID + } + case "appRoleAssignmentRequired": + if v != nil { + var appRoleAssignmentRequired bool + err = json.Unmarshal(*v, &appRoleAssignmentRequired) + if err != nil { + return err + } + spcp.AppRoleAssignmentRequired = &appRoleAssignmentRequired + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + spcp.DisplayName = &displayName + } + case "errorUrl": + if v != nil { + var errorURL string + err = json.Unmarshal(*v, &errorURL) + if err != nil { + return err + } + spcp.ErrorURL = &errorURL + } + case "homepage": + if v != nil { + var homepage string + err = json.Unmarshal(*v, &homepage) + if err != nil { + return err + } + spcp.Homepage = &homepage + } + case "keyCredentials": + if v != nil { + var keyCredentials []KeyCredential + err = json.Unmarshal(*v, &keyCredentials) + if err != nil { + return err + } + spcp.KeyCredentials = &keyCredentials + } + case "passwordCredentials": + if v != nil { + var passwordCredentials []PasswordCredential + err = json.Unmarshal(*v, &passwordCredentials) + if err != nil { + return err + } + spcp.PasswordCredentials = &passwordCredentials + } + case "publisherName": + if v != nil { + var publisherName string + err = json.Unmarshal(*v, &publisherName) + if err != nil { + return err + } + spcp.PublisherName = &publisherName + } + case "replyUrls": + if v != nil { + var replyUrls []string + err = json.Unmarshal(*v, &replyUrls) + if err != nil { + return err + } + spcp.ReplyUrls = &replyUrls + } + case "samlMetadataUrl": + if v != nil { + var samlMetadataURL string + err = json.Unmarshal(*v, &samlMetadataURL) + if err != nil { + return err + } + spcp.SamlMetadataURL = &samlMetadataURL + } + case "servicePrincipalNames": + if v != nil { + var servicePrincipalNames []string + err = json.Unmarshal(*v, &servicePrincipalNames) + if err != nil { + return err + } + spcp.ServicePrincipalNames = &servicePrincipalNames + } + case "tags": + if v != nil { + var tags []string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + spcp.Tags = &tags + } + } + } + + return nil +} + +// ServicePrincipalListResult server response for get tenant service principals API call. +type ServicePrincipalListResult struct { + autorest.Response `json:"-"` + // Value - the list of service principals. + Value *[]ServicePrincipal `json:"value,omitempty"` + // OdataNextLink - the URL to get the next set of results. + OdataNextLink *string `json:"odata.nextLink,omitempty"` +} + +// ServicePrincipalListResultIterator provides access to a complete listing of ServicePrincipal values. +type ServicePrincipalListResultIterator struct { + i int + page ServicePrincipalListResultPage +} + +// 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 *ServicePrincipalListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalListResultIterator.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 *ServicePrincipalListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServicePrincipalListResultIterator) 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 ServicePrincipalListResultIterator) Response() ServicePrincipalListResult { + 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 ServicePrincipalListResultIterator) Value() ServicePrincipal { + if !iter.page.NotDone() { + return ServicePrincipal{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServicePrincipalListResultIterator type. +func NewServicePrincipalListResultIterator(page ServicePrincipalListResultPage) ServicePrincipalListResultIterator { + return ServicePrincipalListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (splr ServicePrincipalListResult) IsEmpty() bool { + return splr.Value == nil || len(*splr.Value) == 0 +} + +// ServicePrincipalListResultPage contains a page of ServicePrincipal values. +type ServicePrincipalListResultPage struct { + fn func(context.Context, ServicePrincipalListResult) (ServicePrincipalListResult, error) + splr ServicePrincipalListResult +} + +// 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 *ServicePrincipalListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.splr) + if err != nil { + return err + } + page.splr = next + 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 *ServicePrincipalListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServicePrincipalListResultPage) NotDone() bool { + return !page.splr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServicePrincipalListResultPage) Response() ServicePrincipalListResult { + return page.splr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServicePrincipalListResultPage) Values() []ServicePrincipal { + if page.splr.IsEmpty() { + return nil + } + return *page.splr.Value +} + +// Creates a new instance of the ServicePrincipalListResultPage type. +func NewServicePrincipalListResultPage(getNextPage func(context.Context, ServicePrincipalListResult) (ServicePrincipalListResult, error)) ServicePrincipalListResultPage { + return ServicePrincipalListResultPage{fn: getNextPage} +} + +// ServicePrincipalUpdateParameters request parameters for creating a new service principal. +type ServicePrincipalUpdateParameters struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // AccountEnabled - Whether the account is enabled + AccountEnabled *bool `json:"accountEnabled,omitempty"` + // AppID - application Id + AppID *string `json:"appId,omitempty"` + // AppRoleAssignmentRequired - Specifies whether an AppRoleAssignment to a user or group is required before Azure AD will issue a user or access token to the application. + AppRoleAssignmentRequired *bool `json:"appRoleAssignmentRequired,omitempty"` + // DisplayName - The display name for the service principal. + DisplayName *string `json:"displayName,omitempty"` + ErrorURL *string `json:"errorUrl,omitempty"` + // Homepage - The URL to the homepage of the associated application. + Homepage *string `json:"homepage,omitempty"` + // KeyCredentials - A collection of KeyCredential objects. + KeyCredentials *[]KeyCredential `json:"keyCredentials,omitempty"` + // PasswordCredentials - A collection of PasswordCredential objects + PasswordCredentials *[]PasswordCredential `json:"passwordCredentials,omitempty"` + // PublisherName - The display name of the tenant in which the associated application is specified. + PublisherName *string `json:"publisherName,omitempty"` + // ReplyUrls - A collection of reply URLs for the service principal. + ReplyUrls *[]string `json:"replyUrls,omitempty"` + SamlMetadataURL *string `json:"samlMetadataUrl,omitempty"` + // ServicePrincipalNames - A collection of service principal names. + ServicePrincipalNames *[]string `json:"servicePrincipalNames,omitempty"` + Tags *[]string `json:"tags,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServicePrincipalUpdateParameters. +func (spup ServicePrincipalUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spup.AccountEnabled != nil { + objectMap["accountEnabled"] = spup.AccountEnabled + } + if spup.AppID != nil { + objectMap["appId"] = spup.AppID + } + if spup.AppRoleAssignmentRequired != nil { + objectMap["appRoleAssignmentRequired"] = spup.AppRoleAssignmentRequired + } + if spup.DisplayName != nil { + objectMap["displayName"] = spup.DisplayName + } + if spup.ErrorURL != nil { + objectMap["errorUrl"] = spup.ErrorURL + } + if spup.Homepage != nil { + objectMap["homepage"] = spup.Homepage + } + if spup.KeyCredentials != nil { + objectMap["keyCredentials"] = spup.KeyCredentials + } + if spup.PasswordCredentials != nil { + objectMap["passwordCredentials"] = spup.PasswordCredentials + } + if spup.PublisherName != nil { + objectMap["publisherName"] = spup.PublisherName + } + if spup.ReplyUrls != nil { + objectMap["replyUrls"] = spup.ReplyUrls + } + if spup.SamlMetadataURL != nil { + objectMap["samlMetadataUrl"] = spup.SamlMetadataURL + } + if spup.ServicePrincipalNames != nil { + objectMap["servicePrincipalNames"] = spup.ServicePrincipalNames + } + if spup.Tags != nil { + objectMap["tags"] = spup.Tags + } + for k, v := range spup.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServicePrincipalUpdateParameters struct. +func (spup *ServicePrincipalUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if spup.AdditionalProperties == nil { + spup.AdditionalProperties = make(map[string]interface{}) + } + spup.AdditionalProperties[k] = additionalProperties + } + case "accountEnabled": + if v != nil { + var accountEnabled bool + err = json.Unmarshal(*v, &accountEnabled) + if err != nil { + return err + } + spup.AccountEnabled = &accountEnabled + } + case "appId": + if v != nil { + var appID string + err = json.Unmarshal(*v, &appID) + if err != nil { + return err + } + spup.AppID = &appID + } + case "appRoleAssignmentRequired": + if v != nil { + var appRoleAssignmentRequired bool + err = json.Unmarshal(*v, &appRoleAssignmentRequired) + if err != nil { + return err + } + spup.AppRoleAssignmentRequired = &appRoleAssignmentRequired + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + spup.DisplayName = &displayName + } + case "errorUrl": + if v != nil { + var errorURL string + err = json.Unmarshal(*v, &errorURL) + if err != nil { + return err + } + spup.ErrorURL = &errorURL + } + case "homepage": + if v != nil { + var homepage string + err = json.Unmarshal(*v, &homepage) + if err != nil { + return err + } + spup.Homepage = &homepage + } + case "keyCredentials": + if v != nil { + var keyCredentials []KeyCredential + err = json.Unmarshal(*v, &keyCredentials) + if err != nil { + return err + } + spup.KeyCredentials = &keyCredentials + } + case "passwordCredentials": + if v != nil { + var passwordCredentials []PasswordCredential + err = json.Unmarshal(*v, &passwordCredentials) + if err != nil { + return err + } + spup.PasswordCredentials = &passwordCredentials + } + case "publisherName": + if v != nil { + var publisherName string + err = json.Unmarshal(*v, &publisherName) + if err != nil { + return err + } + spup.PublisherName = &publisherName + } + case "replyUrls": + if v != nil { + var replyUrls []string + err = json.Unmarshal(*v, &replyUrls) + if err != nil { + return err + } + spup.ReplyUrls = &replyUrls + } + case "samlMetadataUrl": + if v != nil { + var samlMetadataURL string + err = json.Unmarshal(*v, &samlMetadataURL) + if err != nil { + return err + } + spup.SamlMetadataURL = &samlMetadataURL + } + case "servicePrincipalNames": + if v != nil { + var servicePrincipalNames []string + err = json.Unmarshal(*v, &servicePrincipalNames) + if err != nil { + return err + } + spup.ServicePrincipalNames = &servicePrincipalNames + } + case "tags": + if v != nil { + var tags []string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + spup.Tags = &tags + } + } + } + + return nil +} + +// SignInName contains information about a sign-in name of a local account user in an Azure Active +// Directory B2C tenant. +type SignInName struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Type - A string value that can be used to classify user sign-in types in your directory, such as 'emailAddress' or 'userName'. + Type *string `json:"type,omitempty"` + // Value - The sign-in used by the local account. Must be unique across the company/tenant. For example, 'johnc@example.com'. + Value *string `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SignInName. +func (sin SignInName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sin.Type != nil { + objectMap["type"] = sin.Type + } + if sin.Value != nil { + objectMap["value"] = sin.Value + } + for k, v := range sin.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SignInName struct. +func (sin *SignInName) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if sin.AdditionalProperties == nil { + sin.AdditionalProperties = make(map[string]interface{}) + } + sin.AdditionalProperties[k] = additionalProperties + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sin.Type = &typeVar + } + case "value": + if v != nil { + var value string + err = json.Unmarshal(*v, &value) + if err != nil { + return err + } + sin.Value = &value + } + } + } + + return nil +} + +// User active Directory user information. +type User struct { + autorest.Response `json:"-"` + // ImmutableID - This must be specified if you are using a federated domain for the user's userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active Directory user account with their Azure AD user object. + ImmutableID *string `json:"immutableId,omitempty"` + // UsageLocation - A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: "US", "JP", and "GB". + UsageLocation *string `json:"usageLocation,omitempty"` + // GivenName - The given name for the user. + GivenName *string `json:"givenName,omitempty"` + // Surname - The user's surname (family name or last name). + Surname *string `json:"surname,omitempty"` + // UserType - A string value that can be used to classify user types in your directory, such as 'Member' and 'Guest'. Possible values include: 'Member', 'Guest' + UserType UserType `json:"userType,omitempty"` + // AccountEnabled - Whether the account is enabled. + AccountEnabled *bool `json:"accountEnabled,omitempty"` + // DisplayName - The display name of the user. + DisplayName *string `json:"displayName,omitempty"` + // UserPrincipalName - The principal name of the user. + UserPrincipalName *string `json:"userPrincipalName,omitempty"` + // MailNickname - The mail alias for the user. + MailNickname *string `json:"mailNickname,omitempty"` + // Mail - The primary email address of the user. + Mail *string `json:"mail,omitempty"` + // SignInNames - The sign-in names of the user. + SignInNames *[]SignInName `json:"signInNames,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ObjectID - The object ID. + ObjectID *string `json:"objectId,omitempty"` + // DeletionTimestamp - The time at which the directory object was deleted. + DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser' + ObjectType ObjectType `json:"objectType,omitempty"` +} + +// MarshalJSON is the custom marshaler for User. +func (u User) MarshalJSON() ([]byte, error) { + u.ObjectType = ObjectTypeUser + objectMap := make(map[string]interface{}) + if u.ImmutableID != nil { + objectMap["immutableId"] = u.ImmutableID + } + if u.UsageLocation != nil { + objectMap["usageLocation"] = u.UsageLocation + } + if u.GivenName != nil { + objectMap["givenName"] = u.GivenName + } + if u.Surname != nil { + objectMap["surname"] = u.Surname + } + if u.UserType != "" { + objectMap["userType"] = u.UserType + } + if u.AccountEnabled != nil { + objectMap["accountEnabled"] = u.AccountEnabled + } + if u.DisplayName != nil { + objectMap["displayName"] = u.DisplayName + } + if u.UserPrincipalName != nil { + objectMap["userPrincipalName"] = u.UserPrincipalName + } + if u.MailNickname != nil { + objectMap["mailNickname"] = u.MailNickname + } + if u.Mail != nil { + objectMap["mail"] = u.Mail + } + if u.SignInNames != nil { + objectMap["signInNames"] = u.SignInNames + } + if u.ObjectID != nil { + objectMap["objectId"] = u.ObjectID + } + if u.DeletionTimestamp != nil { + objectMap["deletionTimestamp"] = u.DeletionTimestamp + } + if u.ObjectType != "" { + objectMap["objectType"] = u.ObjectType + } + for k, v := range u.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsApplication is the BasicDirectoryObject implementation for User. +func (u User) AsApplication() (*Application, bool) { + return nil, false +} + +// AsADGroup is the BasicDirectoryObject implementation for User. +func (u User) AsADGroup() (*ADGroup, bool) { + return nil, false +} + +// AsServicePrincipal is the BasicDirectoryObject implementation for User. +func (u User) AsServicePrincipal() (*ServicePrincipal, bool) { + return nil, false +} + +// AsUser is the BasicDirectoryObject implementation for User. +func (u User) AsUser() (*User, bool) { + return &u, true +} + +// AsDirectoryObject is the BasicDirectoryObject implementation for User. +func (u User) AsDirectoryObject() (*DirectoryObject, bool) { + return nil, false +} + +// AsBasicDirectoryObject is the BasicDirectoryObject implementation for User. +func (u User) AsBasicDirectoryObject() (BasicDirectoryObject, bool) { + return &u, true +} + +// UnmarshalJSON is the custom unmarshaler for User struct. +func (u *User) 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 "immutableId": + if v != nil { + var immutableID string + err = json.Unmarshal(*v, &immutableID) + if err != nil { + return err + } + u.ImmutableID = &immutableID + } + case "usageLocation": + if v != nil { + var usageLocation string + err = json.Unmarshal(*v, &usageLocation) + if err != nil { + return err + } + u.UsageLocation = &usageLocation + } + case "givenName": + if v != nil { + var givenName string + err = json.Unmarshal(*v, &givenName) + if err != nil { + return err + } + u.GivenName = &givenName + } + case "surname": + if v != nil { + var surname string + err = json.Unmarshal(*v, &surname) + if err != nil { + return err + } + u.Surname = &surname + } + case "userType": + if v != nil { + var userType UserType + err = json.Unmarshal(*v, &userType) + if err != nil { + return err + } + u.UserType = userType + } + case "accountEnabled": + if v != nil { + var accountEnabled bool + err = json.Unmarshal(*v, &accountEnabled) + if err != nil { + return err + } + u.AccountEnabled = &accountEnabled + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + u.DisplayName = &displayName + } + case "userPrincipalName": + if v != nil { + var userPrincipalName string + err = json.Unmarshal(*v, &userPrincipalName) + if err != nil { + return err + } + u.UserPrincipalName = &userPrincipalName + } + case "mailNickname": + if v != nil { + var mailNickname string + err = json.Unmarshal(*v, &mailNickname) + if err != nil { + return err + } + u.MailNickname = &mailNickname + } + case "mail": + if v != nil { + var mailVar string + err = json.Unmarshal(*v, &mailVar) + if err != nil { + return err + } + u.Mail = &mailVar + } + case "signInNames": + if v != nil { + var signInNames []SignInName + err = json.Unmarshal(*v, &signInNames) + if err != nil { + return err + } + u.SignInNames = &signInNames + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if u.AdditionalProperties == nil { + u.AdditionalProperties = make(map[string]interface{}) + } + u.AdditionalProperties[k] = additionalProperties + } + case "objectId": + if v != nil { + var objectID string + err = json.Unmarshal(*v, &objectID) + if err != nil { + return err + } + u.ObjectID = &objectID + } + case "deletionTimestamp": + if v != nil { + var deletionTimestamp date.Time + err = json.Unmarshal(*v, &deletionTimestamp) + if err != nil { + return err + } + u.DeletionTimestamp = &deletionTimestamp + } + case "objectType": + if v != nil { + var objectType ObjectType + err = json.Unmarshal(*v, &objectType) + if err != nil { + return err + } + u.ObjectType = objectType + } + } + } + + return nil +} + +// UserBase ... +type UserBase struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ImmutableID - This must be specified if you are using a federated domain for the user's userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active Directory user account with their Azure AD user object. + ImmutableID *string `json:"immutableId,omitempty"` + // UsageLocation - A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: "US", "JP", and "GB". + UsageLocation *string `json:"usageLocation,omitempty"` + // GivenName - The given name for the user. + GivenName *string `json:"givenName,omitempty"` + // Surname - The user's surname (family name or last name). + Surname *string `json:"surname,omitempty"` + // UserType - A string value that can be used to classify user types in your directory, such as 'Member' and 'Guest'. Possible values include: 'Member', 'Guest' + UserType UserType `json:"userType,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserBase. +func (ub UserBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ub.ImmutableID != nil { + objectMap["immutableId"] = ub.ImmutableID + } + if ub.UsageLocation != nil { + objectMap["usageLocation"] = ub.UsageLocation + } + if ub.GivenName != nil { + objectMap["givenName"] = ub.GivenName + } + if ub.Surname != nil { + objectMap["surname"] = ub.Surname + } + if ub.UserType != "" { + objectMap["userType"] = ub.UserType + } + for k, v := range ub.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UserBase struct. +func (ub *UserBase) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ub.AdditionalProperties == nil { + ub.AdditionalProperties = make(map[string]interface{}) + } + ub.AdditionalProperties[k] = additionalProperties + } + case "immutableId": + if v != nil { + var immutableID string + err = json.Unmarshal(*v, &immutableID) + if err != nil { + return err + } + ub.ImmutableID = &immutableID + } + case "usageLocation": + if v != nil { + var usageLocation string + err = json.Unmarshal(*v, &usageLocation) + if err != nil { + return err + } + ub.UsageLocation = &usageLocation + } + case "givenName": + if v != nil { + var givenName string + err = json.Unmarshal(*v, &givenName) + if err != nil { + return err + } + ub.GivenName = &givenName + } + case "surname": + if v != nil { + var surname string + err = json.Unmarshal(*v, &surname) + if err != nil { + return err + } + ub.Surname = &surname + } + case "userType": + if v != nil { + var userType UserType + err = json.Unmarshal(*v, &userType) + if err != nil { + return err + } + ub.UserType = userType + } + } + } + + return nil +} + +// UserCreateParameters request parameters for creating a new work or school account user. +type UserCreateParameters struct { + // AccountEnabled - Whether the account is enabled. + AccountEnabled *bool `json:"accountEnabled,omitempty"` + // DisplayName - The display name of the user. + DisplayName *string `json:"displayName,omitempty"` + // PasswordProfile - Password Profile + PasswordProfile *PasswordProfile `json:"passwordProfile,omitempty"` + // UserPrincipalName - The user principal name (someuser@contoso.com). It must contain one of the verified domains for the tenant. + UserPrincipalName *string `json:"userPrincipalName,omitempty"` + // MailNickname - The mail alias for the user. + MailNickname *string `json:"mailNickname,omitempty"` + // Mail - The primary email address of the user. + Mail *string `json:"mail,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ImmutableID - This must be specified if you are using a federated domain for the user's userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active Directory user account with their Azure AD user object. + ImmutableID *string `json:"immutableId,omitempty"` + // UsageLocation - A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: "US", "JP", and "GB". + UsageLocation *string `json:"usageLocation,omitempty"` + // GivenName - The given name for the user. + GivenName *string `json:"givenName,omitempty"` + // Surname - The user's surname (family name or last name). + Surname *string `json:"surname,omitempty"` + // UserType - A string value that can be used to classify user types in your directory, such as 'Member' and 'Guest'. Possible values include: 'Member', 'Guest' + UserType UserType `json:"userType,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserCreateParameters. +func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ucp.AccountEnabled != nil { + objectMap["accountEnabled"] = ucp.AccountEnabled + } + if ucp.DisplayName != nil { + objectMap["displayName"] = ucp.DisplayName + } + if ucp.PasswordProfile != nil { + objectMap["passwordProfile"] = ucp.PasswordProfile + } + if ucp.UserPrincipalName != nil { + objectMap["userPrincipalName"] = ucp.UserPrincipalName + } + if ucp.MailNickname != nil { + objectMap["mailNickname"] = ucp.MailNickname + } + if ucp.Mail != nil { + objectMap["mail"] = ucp.Mail + } + if ucp.ImmutableID != nil { + objectMap["immutableId"] = ucp.ImmutableID + } + if ucp.UsageLocation != nil { + objectMap["usageLocation"] = ucp.UsageLocation + } + if ucp.GivenName != nil { + objectMap["givenName"] = ucp.GivenName + } + if ucp.Surname != nil { + objectMap["surname"] = ucp.Surname + } + if ucp.UserType != "" { + objectMap["userType"] = ucp.UserType + } + for k, v := range ucp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UserCreateParameters struct. +func (ucp *UserCreateParameters) 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 "accountEnabled": + if v != nil { + var accountEnabled bool + err = json.Unmarshal(*v, &accountEnabled) + if err != nil { + return err + } + ucp.AccountEnabled = &accountEnabled + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + ucp.DisplayName = &displayName + } + case "passwordProfile": + if v != nil { + var passwordProfile PasswordProfile + err = json.Unmarshal(*v, &passwordProfile) + if err != nil { + return err + } + ucp.PasswordProfile = &passwordProfile + } + case "userPrincipalName": + if v != nil { + var userPrincipalName string + err = json.Unmarshal(*v, &userPrincipalName) + if err != nil { + return err + } + ucp.UserPrincipalName = &userPrincipalName + } + case "mailNickname": + if v != nil { + var mailNickname string + err = json.Unmarshal(*v, &mailNickname) + if err != nil { + return err + } + ucp.MailNickname = &mailNickname + } + case "mail": + if v != nil { + var mailVar string + err = json.Unmarshal(*v, &mailVar) + if err != nil { + return err + } + ucp.Mail = &mailVar + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ucp.AdditionalProperties == nil { + ucp.AdditionalProperties = make(map[string]interface{}) + } + ucp.AdditionalProperties[k] = additionalProperties + } + case "immutableId": + if v != nil { + var immutableID string + err = json.Unmarshal(*v, &immutableID) + if err != nil { + return err + } + ucp.ImmutableID = &immutableID + } + case "usageLocation": + if v != nil { + var usageLocation string + err = json.Unmarshal(*v, &usageLocation) + if err != nil { + return err + } + ucp.UsageLocation = &usageLocation + } + case "givenName": + if v != nil { + var givenName string + err = json.Unmarshal(*v, &givenName) + if err != nil { + return err + } + ucp.GivenName = &givenName + } + case "surname": + if v != nil { + var surname string + err = json.Unmarshal(*v, &surname) + if err != nil { + return err + } + ucp.Surname = &surname + } + case "userType": + if v != nil { + var userType UserType + err = json.Unmarshal(*v, &userType) + if err != nil { + return err + } + ucp.UserType = userType + } + } + } + + return nil +} + +// UserGetMemberGroupsParameters request parameters for GetMemberGroups API call. +type UserGetMemberGroupsParameters struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SecurityEnabledOnly - If true, only membership in security-enabled groups should be checked. Otherwise, membership in all groups should be checked. + SecurityEnabledOnly *bool `json:"securityEnabledOnly,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserGetMemberGroupsParameters. +func (ugmgp UserGetMemberGroupsParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ugmgp.SecurityEnabledOnly != nil { + objectMap["securityEnabledOnly"] = ugmgp.SecurityEnabledOnly + } + for k, v := range ugmgp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UserGetMemberGroupsParameters struct. +func (ugmgp *UserGetMemberGroupsParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ugmgp.AdditionalProperties == nil { + ugmgp.AdditionalProperties = make(map[string]interface{}) + } + ugmgp.AdditionalProperties[k] = additionalProperties + } + case "securityEnabledOnly": + if v != nil { + var securityEnabledOnly bool + err = json.Unmarshal(*v, &securityEnabledOnly) + if err != nil { + return err + } + ugmgp.SecurityEnabledOnly = &securityEnabledOnly + } + } + } + + return nil +} + +// UserGetMemberGroupsResult server response for GetMemberGroups API call. +type UserGetMemberGroupsResult struct { + autorest.Response `json:"-"` + // Value - A collection of group IDs of which the user is a member. + Value *[]string `json:"value,omitempty"` +} + +// UserListResult server response for Get tenant users API call. +type UserListResult struct { + autorest.Response `json:"-"` + // Value - the list of users. + Value *[]User `json:"value,omitempty"` + // OdataNextLink - The URL to get the next set of results. + OdataNextLink *string `json:"odata.nextLink,omitempty"` +} + +// UserListResultIterator provides access to a complete listing of User values. +type UserListResultIterator struct { + i int + page UserListResultPage +} + +// 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 *UserListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserListResultIterator.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 *UserListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter UserListResultIterator) 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 UserListResultIterator) Response() UserListResult { + 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 UserListResultIterator) Value() User { + if !iter.page.NotDone() { + return User{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the UserListResultIterator type. +func NewUserListResultIterator(page UserListResultPage) UserListResultIterator { + return UserListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ulr UserListResult) IsEmpty() bool { + return ulr.Value == nil || len(*ulr.Value) == 0 +} + +// UserListResultPage contains a page of User values. +type UserListResultPage struct { + fn func(context.Context, UserListResult) (UserListResult, error) + ulr UserListResult +} + +// 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 *UserListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ulr) + if err != nil { + return err + } + page.ulr = next + 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 *UserListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page UserListResultPage) NotDone() bool { + return !page.ulr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page UserListResultPage) Response() UserListResult { + return page.ulr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page UserListResultPage) Values() []User { + if page.ulr.IsEmpty() { + return nil + } + return *page.ulr.Value +} + +// Creates a new instance of the UserListResultPage type. +func NewUserListResultPage(getNextPage func(context.Context, UserListResult) (UserListResult, error)) UserListResultPage { + return UserListResultPage{fn: getNextPage} +} + +// UserUpdateParameters request parameters for updating an existing work or school account user. +type UserUpdateParameters struct { + // AccountEnabled - Whether the account is enabled. + AccountEnabled *bool `json:"accountEnabled,omitempty"` + // DisplayName - The display name of the user. + DisplayName *string `json:"displayName,omitempty"` + // PasswordProfile - The password profile of the user. + PasswordProfile *PasswordProfile `json:"passwordProfile,omitempty"` + // UserPrincipalName - The user principal name (someuser@contoso.com). It must contain one of the verified domains for the tenant. + UserPrincipalName *string `json:"userPrincipalName,omitempty"` + // MailNickname - The mail alias for the user. + MailNickname *string `json:"mailNickname,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ImmutableID - This must be specified if you are using a federated domain for the user's userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active Directory user account with their Azure AD user object. + ImmutableID *string `json:"immutableId,omitempty"` + // UsageLocation - A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: "US", "JP", and "GB". + UsageLocation *string `json:"usageLocation,omitempty"` + // GivenName - The given name for the user. + GivenName *string `json:"givenName,omitempty"` + // Surname - The user's surname (family name or last name). + Surname *string `json:"surname,omitempty"` + // UserType - A string value that can be used to classify user types in your directory, such as 'Member' and 'Guest'. Possible values include: 'Member', 'Guest' + UserType UserType `json:"userType,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserUpdateParameters. +func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if uup.AccountEnabled != nil { + objectMap["accountEnabled"] = uup.AccountEnabled + } + if uup.DisplayName != nil { + objectMap["displayName"] = uup.DisplayName + } + if uup.PasswordProfile != nil { + objectMap["passwordProfile"] = uup.PasswordProfile + } + if uup.UserPrincipalName != nil { + objectMap["userPrincipalName"] = uup.UserPrincipalName + } + if uup.MailNickname != nil { + objectMap["mailNickname"] = uup.MailNickname + } + if uup.ImmutableID != nil { + objectMap["immutableId"] = uup.ImmutableID + } + if uup.UsageLocation != nil { + objectMap["usageLocation"] = uup.UsageLocation + } + if uup.GivenName != nil { + objectMap["givenName"] = uup.GivenName + } + if uup.Surname != nil { + objectMap["surname"] = uup.Surname + } + if uup.UserType != "" { + objectMap["userType"] = uup.UserType + } + for k, v := range uup.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UserUpdateParameters struct. +func (uup *UserUpdateParameters) 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 "accountEnabled": + if v != nil { + var accountEnabled bool + err = json.Unmarshal(*v, &accountEnabled) + if err != nil { + return err + } + uup.AccountEnabled = &accountEnabled + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + uup.DisplayName = &displayName + } + case "passwordProfile": + if v != nil { + var passwordProfile PasswordProfile + err = json.Unmarshal(*v, &passwordProfile) + if err != nil { + return err + } + uup.PasswordProfile = &passwordProfile + } + case "userPrincipalName": + if v != nil { + var userPrincipalName string + err = json.Unmarshal(*v, &userPrincipalName) + if err != nil { + return err + } + uup.UserPrincipalName = &userPrincipalName + } + case "mailNickname": + if v != nil { + var mailNickname string + err = json.Unmarshal(*v, &mailNickname) + if err != nil { + return err + } + uup.MailNickname = &mailNickname + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if uup.AdditionalProperties == nil { + uup.AdditionalProperties = make(map[string]interface{}) + } + uup.AdditionalProperties[k] = additionalProperties + } + case "immutableId": + if v != nil { + var immutableID string + err = json.Unmarshal(*v, &immutableID) + if err != nil { + return err + } + uup.ImmutableID = &immutableID + } + case "usageLocation": + if v != nil { + var usageLocation string + err = json.Unmarshal(*v, &usageLocation) + if err != nil { + return err + } + uup.UsageLocation = &usageLocation + } + case "givenName": + if v != nil { + var givenName string + err = json.Unmarshal(*v, &givenName) + if err != nil { + return err + } + uup.GivenName = &givenName + } + case "surname": + if v != nil { + var surname string + err = json.Unmarshal(*v, &surname) + if err != nil { + return err + } + uup.Surname = &surname + } + case "userType": + if v != nil { + var userType UserType + err = json.Unmarshal(*v, &userType) + if err != nil { + return err + } + uup.UserType = userType + } + } + } + + return nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/oauth2.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/oauth2.go new file mode 100644 index 00000000..97e79c76 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/oauth2.go @@ -0,0 +1,197 @@ +package graphrbac + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// OAuth2Client is the the Graph RBAC Management Client +type OAuth2Client struct { + BaseClient +} + +// NewOAuth2Client creates an instance of the OAuth2Client client. +func NewOAuth2Client(tenantID string) OAuth2Client { + return NewOAuth2ClientWithBaseURI(DefaultBaseURI, tenantID) +} + +// NewOAuth2ClientWithBaseURI creates an instance of the OAuth2Client client. +func NewOAuth2ClientWithBaseURI(baseURI string, tenantID string) OAuth2Client { + return OAuth2Client{NewWithBaseURI(baseURI, tenantID)} +} + +// Get queries OAuth2 permissions for the relevant SP ObjectId of an app. +// Parameters: +// filter - this is the Service Principal ObjectId associated with the app +func (client OAuth2Client) Get(ctx context.Context, filter string) (result Permissions, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OAuth2Client.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, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.OAuth2Client", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.OAuth2Client", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.OAuth2Client", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OAuth2Client) GetPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/oauth2PermissionGrants", 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 OAuth2Client) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client OAuth2Client) GetResponder(resp *http.Response) (result Permissions, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Grant grants OAuth2 permissions for the relevant resource Ids of an app. +// Parameters: +// body - the relevant app Service Principal Object Id and the Service Principal Object Id you want to grant. +func (client OAuth2Client) Grant(ctx context.Context, body *Permissions) (result Permissions, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OAuth2Client.Grant") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GrantPreparer(ctx, body) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.OAuth2Client", "Grant", nil, "Failure preparing request") + return + } + + resp, err := client.GrantSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.OAuth2Client", "Grant", resp, "Failure sending request") + return + } + + result, err = client.GrantResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.OAuth2Client", "Grant", resp, "Failure responding to request") + } + + return +} + +// GrantPreparer prepares the Grant request. +func (client OAuth2Client) GrantPreparer(ctx context.Context, body *Permissions) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/oauth2PermissionGrants", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if body != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(body)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GrantSender sends the Grant request. The method will close the +// http.Response Body if it receives an error. +func (client OAuth2Client) GrantSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GrantResponder handles the response to the Grant request. The method always +// closes the http.Response Body. +func (client OAuth2Client) GrantResponder(resp *http.Response) (result Permissions, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/graphrbac/1.6/graphrbac/objects.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/objects.go new file mode 100644 index 00000000..04d3cc63 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/objects.go @@ -0,0 +1,216 @@ +package graphrbac + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ObjectsClient is the the Graph RBAC Management Client +type ObjectsClient struct { + BaseClient +} + +// NewObjectsClient creates an instance of the ObjectsClient client. +func NewObjectsClient(tenantID string) ObjectsClient { + return NewObjectsClientWithBaseURI(DefaultBaseURI, tenantID) +} + +// NewObjectsClientWithBaseURI creates an instance of the ObjectsClient client. +func NewObjectsClientWithBaseURI(baseURI string, tenantID string) ObjectsClient { + return ObjectsClient{NewWithBaseURI(baseURI, tenantID)} +} + +// GetObjectsByObjectIds gets the directory objects specified in a list of object IDs. You can also specify which +// resource collections (users, groups, etc.) should be searched by specifying the optional types parameter. +// Parameters: +// parameters - objects filtering parameters. +func (client ObjectsClient) GetObjectsByObjectIds(ctx context.Context, parameters GetObjectsParameters) (result DirectoryObjectListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ObjectsClient.GetObjectsByObjectIds") + defer func() { + sc := -1 + if result.dolr.Response.Response != nil { + sc = result.dolr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult DirectoryObjectListResult) (DirectoryObjectListResult, error) { + if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { + return DirectoryObjectListResult{}, nil + } + return client.GetObjectsByObjectIdsNext(ctx, *lastResult.OdataNextLink) + } + req, err := client.GetObjectsByObjectIdsPreparer(ctx, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ObjectsClient", "GetObjectsByObjectIds", nil, "Failure preparing request") + return + } + + resp, err := client.GetObjectsByObjectIdsSender(req) + if err != nil { + result.dolr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ObjectsClient", "GetObjectsByObjectIds", resp, "Failure sending request") + return + } + + result.dolr, err = client.GetObjectsByObjectIdsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ObjectsClient", "GetObjectsByObjectIds", resp, "Failure responding to request") + } + + return +} + +// GetObjectsByObjectIdsPreparer prepares the GetObjectsByObjectIds request. +func (client ObjectsClient) GetObjectsByObjectIdsPreparer(ctx context.Context, parameters GetObjectsParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/getObjectsByObjectIds", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetObjectsByObjectIdsSender sends the GetObjectsByObjectIds request. The method will close the +// http.Response Body if it receives an error. +func (client ObjectsClient) GetObjectsByObjectIdsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetObjectsByObjectIdsResponder handles the response to the GetObjectsByObjectIds request. The method always +// closes the http.Response Body. +func (client ObjectsClient) GetObjectsByObjectIdsResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetObjectsByObjectIdsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ObjectsClient) GetObjectsByObjectIdsComplete(ctx context.Context, parameters GetObjectsParameters) (result DirectoryObjectListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ObjectsClient.GetObjectsByObjectIds") + 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.GetObjectsByObjectIds(ctx, parameters) + return +} + +// GetObjectsByObjectIdsNext gets AD group membership for the specified AD object IDs. +// Parameters: +// nextLink - next link for the list operation. +func (client ObjectsClient) GetObjectsByObjectIdsNext(ctx context.Context, nextLink string) (result DirectoryObjectListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ObjectsClient.GetObjectsByObjectIdsNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetObjectsByObjectIdsNextPreparer(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ObjectsClient", "GetObjectsByObjectIdsNext", nil, "Failure preparing request") + return + } + + resp, err := client.GetObjectsByObjectIdsNextSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ObjectsClient", "GetObjectsByObjectIdsNext", resp, "Failure sending request") + return + } + + result, err = client.GetObjectsByObjectIdsNextResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ObjectsClient", "GetObjectsByObjectIdsNext", resp, "Failure responding to request") + } + + return +} + +// GetObjectsByObjectIdsNextPreparer prepares the GetObjectsByObjectIdsNext request. +func (client ObjectsClient) GetObjectsByObjectIdsNextPreparer(ctx context.Context, nextLink string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nextLink": nextLink, + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/{nextLink}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetObjectsByObjectIdsNextSender sends the GetObjectsByObjectIdsNext request. The method will close the +// http.Response Body if it receives an error. +func (client ObjectsClient) GetObjectsByObjectIdsNextSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetObjectsByObjectIdsNextResponder handles the response to the GetObjectsByObjectIdsNext request. The method always +// closes the http.Response Body. +func (client ObjectsClient) GetObjectsByObjectIdsNextResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/graphrbac/1.6/graphrbac/serviceprincipals.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/serviceprincipals.go new file mode 100644 index 00000000..bca9e9ed --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/serviceprincipals.go @@ -0,0 +1,942 @@ +package graphrbac + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/to" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ServicePrincipalsClient is the the Graph RBAC Management Client +type ServicePrincipalsClient struct { + BaseClient +} + +// NewServicePrincipalsClient creates an instance of the ServicePrincipalsClient client. +func NewServicePrincipalsClient(tenantID string) ServicePrincipalsClient { + return NewServicePrincipalsClientWithBaseURI(DefaultBaseURI, tenantID) +} + +// NewServicePrincipalsClientWithBaseURI creates an instance of the ServicePrincipalsClient client. +func NewServicePrincipalsClientWithBaseURI(baseURI string, tenantID string) ServicePrincipalsClient { + return ServicePrincipalsClient{NewWithBaseURI(baseURI, tenantID)} +} + +// Create creates a service principal in the directory. +// Parameters: +// parameters - parameters to create a service principal. +func (client ServicePrincipalsClient) Create(ctx context.Context, parameters ServicePrincipalCreateParameters) (result ServicePrincipal, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.AppID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("graphrbac.ServicePrincipalsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ServicePrincipalsClient) CreatePreparer(ctx context.Context, parameters ServicePrincipalCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/servicePrincipals", pathParameters), + autorest.WithJSON(parameters), + 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 ServicePrincipalsClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ServicePrincipalsClient) CreateResponder(resp *http.Response) (result ServicePrincipal, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a service principal from the directory. +// Parameters: +// objectID - the object ID of the service principal to delete. +func (client ServicePrincipalsClient) Delete(ctx context.Context, objectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, objectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ServicePrincipalsClient) DeletePreparer(ctx context.Context, objectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/servicePrincipals/{objectId}", 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 ServicePrincipalsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ServicePrincipalsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets service principal information from the directory. Query by objectId or pass a filter to query by appId +// Parameters: +// objectID - the object ID of the service principal to get. +func (client ServicePrincipalsClient) Get(ctx context.Context, objectID string) (result ServicePrincipal, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.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, objectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServicePrincipalsClient) GetPreparer(ctx context.Context, objectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/servicePrincipals/{objectId}", 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 ServicePrincipalsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ServicePrincipalsClient) GetResponder(resp *http.Response) (result ServicePrincipal, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of service principals from the current tenant. +// Parameters: +// filter - the filter to apply to the operation. +func (client ServicePrincipalsClient) List(ctx context.Context, filter string) (result ServicePrincipalListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.List") + defer func() { + sc := -1 + if result.splr.Response.Response != nil { + sc = result.splr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult ServicePrincipalListResult) (ServicePrincipalListResult, error) { + if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { + return ServicePrincipalListResult{}, nil + } + return client.ListNext(ctx, *lastResult.OdataNextLink) + } + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.splr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "List", resp, "Failure sending request") + return + } + + result.splr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ServicePrincipalsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/servicePrincipals", 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 ServicePrincipalsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, 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 ServicePrincipalsClient) ListResponder(resp *http.Response) (result ServicePrincipalListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServicePrincipalsClient) ListComplete(ctx context.Context, filter string) (result ServicePrincipalListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.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, filter) + return +} + +// ListKeyCredentials get the keyCredentials associated with the specified service principal. +// Parameters: +// objectID - the object ID of the service principal for which to get keyCredentials. +func (client ServicePrincipalsClient) ListKeyCredentials(ctx context.Context, objectID string) (result KeyCredentialListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.ListKeyCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListKeyCredentialsPreparer(ctx, objectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListKeyCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeyCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListKeyCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListKeyCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListKeyCredentials", resp, "Failure responding to request") + } + + return +} + +// ListKeyCredentialsPreparer prepares the ListKeyCredentials request. +func (client ServicePrincipalsClient) ListKeyCredentialsPreparer(ctx context.Context, objectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/servicePrincipals/{objectId}/keyCredentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeyCredentialsSender sends the ListKeyCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ServicePrincipalsClient) ListKeyCredentialsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListKeyCredentialsResponder handles the response to the ListKeyCredentials request. The method always +// closes the http.Response Body. +func (client ServicePrincipalsClient) ListKeyCredentialsResponder(resp *http.Response) (result KeyCredentialListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNext gets a list of service principals from the current tenant. +// Parameters: +// nextLink - next link for the list operation. +func (client ServicePrincipalsClient) ListNext(ctx context.Context, nextLink string) (result ServicePrincipalListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.ListNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListNextPreparer(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListNext", nil, "Failure preparing request") + return + } + + resp, err := client.ListNextSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListNext", resp, "Failure sending request") + return + } + + result, err = client.ListNextResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListNext", resp, "Failure responding to request") + } + + return +} + +// ListNextPreparer prepares the ListNext request. +func (client ServicePrincipalsClient) ListNextPreparer(ctx context.Context, nextLink string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nextLink": nextLink, + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/{nextLink}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListNextSender sends the ListNext request. The method will close the +// http.Response Body if it receives an error. +func (client ServicePrincipalsClient) ListNextSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListNextResponder handles the response to the ListNext request. The method always +// closes the http.Response Body. +func (client ServicePrincipalsClient) ListNextResponder(resp *http.Response) (result ServicePrincipalListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListOwners the owners are a set of non-admin users who are allowed to modify this object. +// Parameters: +// objectID - the object ID of the service principal for which to get owners. +func (client ServicePrincipalsClient) ListOwners(ctx context.Context, objectID string) (result DirectoryObjectListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.ListOwners") + defer func() { + sc := -1 + if result.dolr.Response.Response != nil { + sc = result.dolr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listOwnersNextResults + req, err := client.ListOwnersPreparer(ctx, objectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListOwners", nil, "Failure preparing request") + return + } + + resp, err := client.ListOwnersSender(req) + if err != nil { + result.dolr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListOwners", resp, "Failure sending request") + return + } + + result.dolr, err = client.ListOwnersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListOwners", resp, "Failure responding to request") + } + + return +} + +// ListOwnersPreparer prepares the ListOwners request. +func (client ServicePrincipalsClient) ListOwnersPreparer(ctx context.Context, objectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/servicePrincipals/{objectId}/owners", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOwnersSender sends the ListOwners request. The method will close the +// http.Response Body if it receives an error. +func (client ServicePrincipalsClient) ListOwnersSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListOwnersResponder handles the response to the ListOwners request. The method always +// closes the http.Response Body. +func (client ServicePrincipalsClient) ListOwnersResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOwnersNextResults retrieves the next set of results, if any. +func (client ServicePrincipalsClient) listOwnersNextResults(ctx context.Context, lastResults DirectoryObjectListResult) (result DirectoryObjectListResult, err error) { + req, err := lastResults.directoryObjectListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "listOwnersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOwnersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "listOwnersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOwnersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "listOwnersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOwnersComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServicePrincipalsClient) ListOwnersComplete(ctx context.Context, objectID string) (result DirectoryObjectListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.ListOwners") + 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.ListOwners(ctx, objectID) + return +} + +// ListPasswordCredentials gets the passwordCredentials associated with a service principal. +// Parameters: +// objectID - the object ID of the service principal. +func (client ServicePrincipalsClient) ListPasswordCredentials(ctx context.Context, objectID string) (result PasswordCredentialListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.ListPasswordCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPasswordCredentialsPreparer(ctx, objectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListPasswordCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListPasswordCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListPasswordCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListPasswordCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListPasswordCredentials", resp, "Failure responding to request") + } + + return +} + +// ListPasswordCredentialsPreparer prepares the ListPasswordCredentials request. +func (client ServicePrincipalsClient) ListPasswordCredentialsPreparer(ctx context.Context, objectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/servicePrincipals/{objectId}/passwordCredentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPasswordCredentialsSender sends the ListPasswordCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ServicePrincipalsClient) ListPasswordCredentialsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListPasswordCredentialsResponder handles the response to the ListPasswordCredentials request. The method always +// closes the http.Response Body. +func (client ServicePrincipalsClient) ListPasswordCredentialsResponder(resp *http.Response) (result PasswordCredentialListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a service principal in the directory. +// Parameters: +// objectID - the object ID of the service principal to delete. +// parameters - parameters to update a service principal. +func (client ServicePrincipalsClient) Update(ctx context.Context, objectID string, parameters ServicePrincipalUpdateParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.Update") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, objectID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ServicePrincipalsClient) UpdatePreparer(ctx context.Context, objectID string, parameters ServicePrincipalUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/servicePrincipals/{objectId}", pathParameters), + autorest.WithJSON(parameters), + 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 ServicePrincipalsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ServicePrincipalsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// UpdateKeyCredentials update the keyCredentials associated with a service principal. +// Parameters: +// objectID - the object ID for which to get service principal information. +// parameters - parameters to update the keyCredentials of an existing service principal. +func (client ServicePrincipalsClient) UpdateKeyCredentials(ctx context.Context, objectID string, parameters KeyCredentialsUpdateParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.UpdateKeyCredentials") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateKeyCredentialsPreparer(ctx, objectID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "UpdateKeyCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateKeyCredentialsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "UpdateKeyCredentials", resp, "Failure sending request") + return + } + + result, err = client.UpdateKeyCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "UpdateKeyCredentials", resp, "Failure responding to request") + } + + return +} + +// UpdateKeyCredentialsPreparer prepares the UpdateKeyCredentials request. +func (client ServicePrincipalsClient) UpdateKeyCredentialsPreparer(ctx context.Context, objectID string, parameters KeyCredentialsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/servicePrincipals/{objectId}/keyCredentials", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateKeyCredentialsSender sends the UpdateKeyCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ServicePrincipalsClient) UpdateKeyCredentialsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateKeyCredentialsResponder handles the response to the UpdateKeyCredentials request. The method always +// closes the http.Response Body. +func (client ServicePrincipalsClient) UpdateKeyCredentialsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// UpdatePasswordCredentials updates the passwordCredentials associated with a service principal. +// Parameters: +// objectID - the object ID of the service principal. +// parameters - parameters to update the passwordCredentials of an existing service principal. +func (client ServicePrincipalsClient) UpdatePasswordCredentials(ctx context.Context, objectID string, parameters PasswordCredentialsUpdateParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrincipalsClient.UpdatePasswordCredentials") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePasswordCredentialsPreparer(ctx, objectID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "UpdatePasswordCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.UpdatePasswordCredentialsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "UpdatePasswordCredentials", resp, "Failure sending request") + return + } + + result, err = client.UpdatePasswordCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "UpdatePasswordCredentials", resp, "Failure responding to request") + } + + return +} + +// UpdatePasswordCredentialsPreparer prepares the UpdatePasswordCredentials request. +func (client ServicePrincipalsClient) UpdatePasswordCredentialsPreparer(ctx context.Context, objectID string, parameters PasswordCredentialsUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/servicePrincipals/{objectId}/passwordCredentials", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdatePasswordCredentialsSender sends the UpdatePasswordCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ServicePrincipalsClient) UpdatePasswordCredentialsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdatePasswordCredentialsResponder handles the response to the UpdatePasswordCredentials request. The method always +// closes the http.Response Body. +func (client ServicePrincipalsClient) UpdatePasswordCredentialsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/signedinuser.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/signedinuser.go new file mode 100644 index 00000000..3b89fca3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/signedinuser.go @@ -0,0 +1,283 @@ +package graphrbac + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SignedInUserClient is the the Graph RBAC Management Client +type SignedInUserClient struct { + BaseClient +} + +// NewSignedInUserClient creates an instance of the SignedInUserClient client. +func NewSignedInUserClient(tenantID string) SignedInUserClient { + return NewSignedInUserClientWithBaseURI(DefaultBaseURI, tenantID) +} + +// NewSignedInUserClientWithBaseURI creates an instance of the SignedInUserClient client. +func NewSignedInUserClientWithBaseURI(baseURI string, tenantID string) SignedInUserClient { + return SignedInUserClient{NewWithBaseURI(baseURI, tenantID)} +} + +// Get gets the details for the currently logged-in user. +func (client SignedInUserClient) Get(ctx context.Context) (result User, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SignedInUserClient.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) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SignedInUserClient) GetPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/me", 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 SignedInUserClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SignedInUserClient) GetResponder(resp *http.Response) (result User, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListOwnedObjects get the list of directory objects that are owned by the user. +func (client SignedInUserClient) ListOwnedObjects(ctx context.Context) (result DirectoryObjectListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SignedInUserClient.ListOwnedObjects") + defer func() { + sc := -1 + if result.dolr.Response.Response != nil { + sc = result.dolr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult DirectoryObjectListResult) (DirectoryObjectListResult, error) { + if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { + return DirectoryObjectListResult{}, nil + } + return client.ListOwnedObjectsNext(ctx, *lastResult.OdataNextLink) + } + req, err := client.ListOwnedObjectsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "ListOwnedObjects", nil, "Failure preparing request") + return + } + + resp, err := client.ListOwnedObjectsSender(req) + if err != nil { + result.dolr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "ListOwnedObjects", resp, "Failure sending request") + return + } + + result.dolr, err = client.ListOwnedObjectsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "ListOwnedObjects", resp, "Failure responding to request") + } + + return +} + +// ListOwnedObjectsPreparer prepares the ListOwnedObjects request. +func (client SignedInUserClient) ListOwnedObjectsPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/me/ownedObjects", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOwnedObjectsSender sends the ListOwnedObjects request. The method will close the +// http.Response Body if it receives an error. +func (client SignedInUserClient) ListOwnedObjectsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListOwnedObjectsResponder handles the response to the ListOwnedObjects request. The method always +// closes the http.Response Body. +func (client SignedInUserClient) ListOwnedObjectsResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListOwnedObjectsComplete enumerates all values, automatically crossing page boundaries as required. +func (client SignedInUserClient) ListOwnedObjectsComplete(ctx context.Context) (result DirectoryObjectListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SignedInUserClient.ListOwnedObjects") + 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.ListOwnedObjects(ctx) + return +} + +// ListOwnedObjectsNext get the list of directory objects that are owned by the user. +// Parameters: +// nextLink - next link for the list operation. +func (client SignedInUserClient) ListOwnedObjectsNext(ctx context.Context, nextLink string) (result DirectoryObjectListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SignedInUserClient.ListOwnedObjectsNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListOwnedObjectsNextPreparer(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "ListOwnedObjectsNext", nil, "Failure preparing request") + return + } + + resp, err := client.ListOwnedObjectsNextSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "ListOwnedObjectsNext", resp, "Failure sending request") + return + } + + result, err = client.ListOwnedObjectsNextResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "ListOwnedObjectsNext", resp, "Failure responding to request") + } + + return +} + +// ListOwnedObjectsNextPreparer prepares the ListOwnedObjectsNext request. +func (client SignedInUserClient) ListOwnedObjectsNextPreparer(ctx context.Context, nextLink string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nextLink": nextLink, + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/{nextLink}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOwnedObjectsNextSender sends the ListOwnedObjectsNext request. The method will close the +// http.Response Body if it receives an error. +func (client SignedInUserClient) ListOwnedObjectsNextSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListOwnedObjectsNextResponder handles the response to the ListOwnedObjectsNext request. The method always +// closes the http.Response Body. +func (client SignedInUserClient) ListOwnedObjectsNextResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/graphrbac/1.6/graphrbac/users.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/users.go new file mode 100644 index 00000000..a2ef210a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/users.go @@ -0,0 +1,614 @@ +package graphrbac + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/to" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// UsersClient is the the Graph RBAC Management Client +type UsersClient struct { + BaseClient +} + +// NewUsersClient creates an instance of the UsersClient client. +func NewUsersClient(tenantID string) UsersClient { + return NewUsersClientWithBaseURI(DefaultBaseURI, tenantID) +} + +// NewUsersClientWithBaseURI creates an instance of the UsersClient client. +func NewUsersClientWithBaseURI(baseURI string, tenantID string) UsersClient { + return UsersClient{NewWithBaseURI(baseURI, tenantID)} +} + +// Create create a new user. +// Parameters: +// parameters - parameters to create a user. +func (client UsersClient) Create(ctx context.Context, parameters UserCreateParameters) (result User, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.AccountEnabled", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.PasswordProfile", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.PasswordProfile.Password", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.UserPrincipalName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.MailNickname", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("graphrbac.UsersClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client UsersClient) CreatePreparer(ctx context.Context, parameters UserCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/users", pathParameters), + autorest.WithJSON(parameters), + 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 UsersClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client UsersClient) CreateResponder(resp *http.Response) (result User, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a user. +// Parameters: +// upnOrObjectID - the object ID or principal name of the user to delete. +func (client UsersClient) Delete(ctx context.Context, upnOrObjectID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, upnOrObjectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client UsersClient) DeletePreparer(ctx context.Context, upnOrObjectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + "upnOrObjectId": autorest.Encode("path", upnOrObjectID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/users/{upnOrObjectId}", 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 UsersClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client UsersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets user information from the directory. +// Parameters: +// upnOrObjectID - the object ID or principal name of the user for which to get information. +func (client UsersClient) Get(ctx context.Context, upnOrObjectID string) (result User, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.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, upnOrObjectID) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client UsersClient) GetPreparer(ctx context.Context, upnOrObjectID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + "upnOrObjectId": autorest.Encode("path", upnOrObjectID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/users/{upnOrObjectId}", 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 UsersClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client UsersClient) GetResponder(resp *http.Response) (result User, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMemberGroups gets a collection that contains the object IDs of the groups of which the user is a member. +// Parameters: +// objectID - the object ID of the user for which to get group membership. +// parameters - user filtering parameters. +func (client UsersClient) GetMemberGroups(ctx context.Context, objectID string, parameters UserGetMemberGroupsParameters) (result UserGetMemberGroupsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.GetMemberGroups") + 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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SecurityEnabledOnly", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("graphrbac.UsersClient", "GetMemberGroups", err.Error()) + } + + req, err := client.GetMemberGroupsPreparer(ctx, objectID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "GetMemberGroups", nil, "Failure preparing request") + return + } + + resp, err := client.GetMemberGroupsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "GetMemberGroups", resp, "Failure sending request") + return + } + + result, err = client.GetMemberGroupsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "GetMemberGroups", resp, "Failure responding to request") + } + + return +} + +// GetMemberGroupsPreparer prepares the GetMemberGroups request. +func (client UsersClient) GetMemberGroupsPreparer(ctx context.Context, objectID string, parameters UserGetMemberGroupsParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "objectId": autorest.Encode("path", objectID), + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/users/{objectId}/getMemberGroups", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMemberGroupsSender sends the GetMemberGroups request. The method will close the +// http.Response Body if it receives an error. +func (client UsersClient) GetMemberGroupsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetMemberGroupsResponder handles the response to the GetMemberGroups request. The method always +// closes the http.Response Body. +func (client UsersClient) GetMemberGroupsResponder(resp *http.Response) (result UserGetMemberGroupsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets list of users for the current tenant. +// Parameters: +// filter - the filter to apply to the operation. +func (client UsersClient) List(ctx context.Context, filter string) (result UserListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.List") + defer func() { + sc := -1 + if result.ulr.Response.Response != nil { + sc = result.ulr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = func(ctx context.Context, lastResult UserListResult) (UserListResult, error) { + if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 { + return UserListResult{}, nil + } + return client.ListNext(ctx, *lastResult.OdataNextLink) + } + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ulr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "List", resp, "Failure sending request") + return + } + + result.ulr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client UsersClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/users", 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 UsersClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, 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 UsersClient) ListResponder(resp *http.Response) (result UserListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsersClient) ListComplete(ctx context.Context, filter string) (result UserListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.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, filter) + return +} + +// ListNext gets a list of users for the current tenant. +// Parameters: +// nextLink - next link for the list operation. +func (client UsersClient) ListNext(ctx context.Context, nextLink string) (result UserListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.ListNext") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListNextPreparer(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "ListNext", nil, "Failure preparing request") + return + } + + resp, err := client.ListNextSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "ListNext", resp, "Failure sending request") + return + } + + result, err = client.ListNextResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "ListNext", resp, "Failure responding to request") + } + + return +} + +// ListNextPreparer prepares the ListNext request. +func (client UsersClient) ListNextPreparer(ctx context.Context, nextLink string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nextLink": nextLink, + "tenantID": autorest.Encode("path", client.TenantID), + } + + const APIVersion = "1.6" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{tenantID}/{nextLink}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListNextSender sends the ListNext request. The method will close the +// http.Response Body if it receives an error. +func (client UsersClient) ListNextSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListNextResponder handles the response to the ListNext request. The method always +// closes the http.Response Body. +func (client UsersClient) ListNextResponder(resp *http.Response) (result UserListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a user. +// Parameters: +// upnOrObjectID - the object ID or principal name of the user to update. +// parameters - parameters to update an existing user. +func (client UsersClient) Update(ctx context.Context, upnOrObjectID string, parameters UserUpdateParameters) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Update") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, upnOrObjectID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client UsersClient) UpdatePreparer(ctx context.Context, upnOrObjectID string, parameters UserUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "tenantID": autorest.Encode("path", client.TenantID), + "upnOrObjectId": autorest.Encode("path", upnOrObjectID), + } + + const APIVersion = "1.6" + 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("/{tenantID}/users/{upnOrObjectId}", pathParameters), + autorest.WithJSON(parameters), + 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 UsersClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client UsersClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/version.go new file mode 100644 index 00000000..b8397dc9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/version.go @@ -0,0 +1,30 @@ +package graphrbac + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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.Number + " graphrbac/1.6" +} + +// 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/servicefabric/5.6/servicefabric/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/5.6/servicefabric/client.go new file mode 100644 index 00000000..1ec7c93c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/5.6/servicefabric/client.go @@ -0,0 +1,11213 @@ +// Package servicefabric implements the Azure ARM Servicefabric service API version 5.6.*. +// +// Service Fabric REST Client APIs allows management of Service Fabric clusters, applications and services. +package servicefabric + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/satori/go.uuid" + "net/http" +) + +const ( + // DefaultBaseURI is the default URI used for the service Servicefabric + DefaultBaseURI = "http://localhost:19080" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BaseClient is the base client for Servicefabric. +type BaseClient struct { + autorest.Client + BaseURI string +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// New creates an instance of the BaseClient client. +func New() BaseClient { + return NewWithBaseURI(DefaultBaseURI) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + } +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CancelOperation the following is a list of APIs that start fault operations that may be cancelled using +// CancelOperation - +// - StartDataLoss +// - StartQuorumLoss +// - StartPartitionRestart +// - StartNodeTransition +// +// If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up. If force is +// true, the command will be aborted, and some internal state +// may be left behind. Specifying force as true should be used with care. Calling this API with force set to true is +// not allowed until this API has already +// been called on the same test command with force set to false first, or unless the test command already has an +// OperationState of OperationState.RollingBack. +// Clarification: OperationState.RollingBack means that the system will/is be cleaning up internal system state caused +// by executing the command. It will not restore data if the +// test command was to cause data loss. For example, if you call StartDataLoss then call this API, the system will +// only clean up internal state from running the command. +// It will not restore the target partition's data, if the command progressed far enough to cause data loss. +// +// Important note: if this API is invoked with force==true, internal state may be left behind. +// Parameters: +// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress +// API +// force - indicates whether to gracefully rollback and clean up internal system state modified by executing +// the user-induced operation. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) CancelOperation(ctx context.Context, operationID uuid.UUID, force bool, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "CancelOperation", err.Error()) + } + + req, err := client.CancelOperationPreparer(ctx, operationID, force, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", nil, "Failure preparing request") + return + } + + resp, err := client.CancelOperationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", resp, "Failure sending request") + return + } + + result, err = client.CancelOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CancelOperationPreparer prepares the CancelOperation request. +func (client BaseClient) CancelOperationPreparer(ctx context.Context, operationID uuid.UUID, force bool, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "Force": autorest.Encode("query", force), + "OperationId": autorest.Encode("query", operationID), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/Faults/$/Cancel"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CancelOperationSender sends the CancelOperation request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CancelOperationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CancelOperationResponder handles the response to the CancelOperation request. The method always +// closes the http.Response Body. +func (client BaseClient) CancelOperationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CopyImageStoreContent copies the image store content from the source image store relative path to the destination +// image store relative path. +// Parameters: +// imageStoreCopyDescription - describes the copy description for the image store. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) CopyImageStoreContent(ctx context.Context, imageStoreCopyDescription ImageStoreCopyDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageStoreCopyDescription, + Constraints: []validation.Constraint{{Target: "imageStoreCopyDescription.RemoteSource", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "imageStoreCopyDescription.RemoteDestination", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "CopyImageStoreContent", err.Error()) + } + + req, err := client.CopyImageStoreContentPreparer(ctx, imageStoreCopyDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", nil, "Failure preparing request") + return + } + + resp, err := client.CopyImageStoreContentSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", resp, "Failure sending request") + return + } + + result, err = client.CopyImageStoreContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CopyImageStoreContentPreparer prepares the CopyImageStoreContent request. +func (client BaseClient) CopyImageStoreContentPreparer(ctx context.Context, imageStoreCopyDescription ImageStoreCopyDescription, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/ImageStore/$/Copy"), + autorest.WithJSON(imageStoreCopyDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CopyImageStoreContentSender sends the CopyImageStoreContent request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CopyImageStoreContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CopyImageStoreContentResponder handles the response to the CopyImageStoreContent request. The method always +// closes the http.Response Body. +func (client BaseClient) CopyImageStoreContentResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateApplication creates a Service Fabric application using the specified description. +// Parameters: +// applicationDescription - describes the application to be created. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) CreateApplication(ctx context.Context, applicationDescription ApplicationDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: applicationDescription, + Constraints: []validation.Constraint{{Target: "applicationDescription.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "applicationDescription.TypeName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "applicationDescription.TypeVersion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "applicationDescription.ApplicationCapacity", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MinimumNodes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MinimumNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, + {Target: "applicationDescription.ApplicationCapacity.MaximumNodes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MaximumNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, + }}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "CreateApplication", err.Error()) + } + + req, err := client.CreateApplicationPreparer(ctx, applicationDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", nil, "Failure preparing request") + return + } + + resp, err := client.CreateApplicationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", resp, "Failure sending request") + return + } + + result, err = client.CreateApplicationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateApplicationPreparer prepares the CreateApplication request. +func (client BaseClient) CreateApplicationPreparer(ctx context.Context, applicationDescription ApplicationDescription, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/Applications/$/Create"), + autorest.WithJSON(applicationDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateApplicationSender sends the CreateApplication request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CreateApplicationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateApplicationResponder handles the response to the CreateApplication request. The method always +// closes the http.Response Body. +func (client BaseClient) CreateApplicationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateComposeApplication creates a Service Fabric compose application. +// Parameters: +// createComposeApplicationDescription - describes the compose application that needs to be created. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) CreateComposeApplication(ctx context.Context, createComposeApplicationDescription CreateComposeApplicationDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: createComposeApplicationDescription, + Constraints: []validation.Constraint{{Target: "createComposeApplicationDescription.ApplicationName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "createComposeApplicationDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "CreateComposeApplication", err.Error()) + } + + req, err := client.CreateComposeApplicationPreparer(ctx, createComposeApplicationDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeApplication", nil, "Failure preparing request") + return + } + + resp, err := client.CreateComposeApplicationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeApplication", resp, "Failure sending request") + return + } + + result, err = client.CreateComposeApplicationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeApplication", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateComposeApplicationPreparer prepares the CreateComposeApplication request. +func (client BaseClient) CreateComposeApplicationPreparer(ctx context.Context, createComposeApplicationDescription CreateComposeApplicationDescription, timeout *int64) (*http.Request, error) { + const APIVersion = "4.0-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/ComposeDeployments/$/Create"), + autorest.WithJSON(createComposeApplicationDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateComposeApplicationSender sends the CreateComposeApplication request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CreateComposeApplicationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateComposeApplicationResponder handles the response to the CreateComposeApplication request. The method always +// closes the http.Response Body. +func (client BaseClient) CreateComposeApplicationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateService creates the specified service. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// serviceDescription - the configuration for the service. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) CreateService(ctx context.Context, applicationID string, serviceDescription BasicServiceDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceDescription, + Constraints: []validation.Constraint{{Target: "serviceDescription.ServiceName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "serviceDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "serviceDescription.PartitionDescription", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "CreateService", err.Error()) + } + + req, err := client.CreateServicePreparer(ctx, applicationID, serviceDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", nil, "Failure preparing request") + return + } + + resp, err := client.CreateServiceSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", resp, "Failure sending request") + return + } + + result, err = client.CreateServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateServicePreparer prepares the CreateService request. +func (client BaseClient) CreateServicePreparer(ctx context.Context, applicationID string, serviceDescription BasicServiceDescription, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/$/Create", pathParameters), + autorest.WithJSON(serviceDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateServiceSender sends the CreateService request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CreateServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateServiceResponder handles the response to the CreateService request. The method always +// closes the http.Response Body. +func (client BaseClient) CreateServiceResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateServiceFromTemplate creates a Service Fabric service from the service template defined in the application +// manifest. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// serviceFromTemplateDescription - describes the service that needs to be created from the template defined in +// the application manifest. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) CreateServiceFromTemplate(ctx context.Context, applicationID string, serviceFromTemplateDescription ServiceFromTemplateDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceFromTemplateDescription, + Constraints: []validation.Constraint{{Target: "serviceFromTemplateDescription.ApplicationName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "serviceFromTemplateDescription.ServiceName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "serviceFromTemplateDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "CreateServiceFromTemplate", err.Error()) + } + + req, err := client.CreateServiceFromTemplatePreparer(ctx, applicationID, serviceFromTemplateDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateServiceFromTemplateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", resp, "Failure sending request") + return + } + + result, err = client.CreateServiceFromTemplateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateServiceFromTemplatePreparer prepares the CreateServiceFromTemplate request. +func (client BaseClient) CreateServiceFromTemplatePreparer(ctx context.Context, applicationID string, serviceFromTemplateDescription ServiceFromTemplateDescription, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/$/CreateFromTemplate", pathParameters), + autorest.WithJSON(serviceFromTemplateDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateServiceFromTemplateSender sends the CreateServiceFromTemplate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CreateServiceFromTemplateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateServiceFromTemplateResponder handles the response to the CreateServiceFromTemplate request. The method always +// closes the http.Response Body. +func (client BaseClient) CreateServiceFromTemplateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeleteApplication deletes an existing Service Fabric application. An application must be created before it can be +// deleted. Deleting an application will delete all services that are part of that application. By default Service +// Fabric will try to close service replicas in a graceful manner and then delete the service. However if service is +// having issues closing the replica gracefully, the delete operation may take a long time or get stuck. Use the +// optional ForceRemove flag to skip the graceful close sequence and forcefully delete the application and all of the +// its services. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful +// shutdown sequence. This parameter can be used to forcefully delete an application or service for which +// delete is timing out due to issues in the service code that prevents graceful close of replicas. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) DeleteApplication(ctx context.Context, applicationID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "DeleteApplication", err.Error()) + } + + req, err := client.DeleteApplicationPreparer(ctx, applicationID, forceRemove, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteApplicationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", resp, "Failure sending request") + return + } + + result, err = client.DeleteApplicationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeleteApplicationPreparer prepares the DeleteApplication request. +func (client BaseClient) DeleteApplicationPreparer(ctx context.Context, applicationID string, forceRemove *bool, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if forceRemove != nil { + queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Applications/{applicationId}/$/Delete", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeleteApplicationSender sends the DeleteApplication request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteApplicationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeleteApplicationResponder handles the response to the DeleteApplication request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteApplicationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeleteImageStoreContent deletes existing image store content being found within the given image store relative path. +// This can be used to delete uploaded application packages once they are provisioned. +// Parameters: +// contentPath - relative path to file or folder in the image store from its root. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) DeleteImageStoreContent(ctx context.Context, contentPath string, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreContent", err.Error()) + } + + req, err := client.DeleteImageStoreContentPreparer(ctx, contentPath, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteImageStoreContentSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", resp, "Failure sending request") + return + } + + result, err = client.DeleteImageStoreContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeleteImageStoreContentPreparer prepares the DeleteImageStoreContent request. +func (client BaseClient) DeleteImageStoreContentPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "contentPath": autorest.Encode("path", contentPath), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeleteImageStoreContentSender sends the DeleteImageStoreContent request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteImageStoreContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeleteImageStoreContentResponder handles the response to the DeleteImageStoreContent request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteImageStoreContentResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeleteService deletes an existing Service Fabric service. A service must be created before it can be deleted. By +// default Service Fabric will try to close service replicas in a graceful manner and then delete the service. However +// if service is having issues closing the replica gracefully, the delete operation may take a long time or get stuck. +// Use the optional ForceRemove flag to skip the graceful close sequence and forcefully delete the service. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful +// shutdown sequence. This parameter can be used to forcefully delete an application or service for which +// delete is timing out due to issues in the service code that prevents graceful close of replicas. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) DeleteService(ctx context.Context, serviceID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "DeleteService", err.Error()) + } + + req, err := client.DeleteServicePreparer(ctx, serviceID, forceRemove, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteServiceSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", resp, "Failure sending request") + return + } + + result, err = client.DeleteServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeleteServicePreparer prepares the DeleteService request. +func (client BaseClient) DeleteServicePreparer(ctx context.Context, serviceID string, forceRemove *bool, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if forceRemove != nil { + queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Services/{serviceId}/$/Delete", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeleteServiceSender sends the DeleteService request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeleteServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeleteServiceResponder handles the response to the DeleteService request. The method always +// closes the http.Response Body. +func (client BaseClient) DeleteServiceResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServicePackageToNode downloads packages associated with specified service manifest to image cache on +// specified node. +// Parameters: +// nodeName - the name of the node. +// deployServicePackageToNodeDescription - describes information for deploying a service package to a Service +// Fabric node. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) DeployedServicePackageToNode(ctx context.Context, nodeName string, deployServicePackageToNodeDescription DeployServicePackageToNodeDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: deployServicePackageToNodeDescription, + Constraints: []validation.Constraint{{Target: "deployServicePackageToNodeDescription.ServiceManifestName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "deployServicePackageToNodeDescription.ApplicationTypeName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "deployServicePackageToNodeDescription.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "deployServicePackageToNodeDescription.NodeName", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "DeployedServicePackageToNode", err.Error()) + } + + req, err := client.DeployedServicePackageToNodePreparer(ctx, nodeName, deployServicePackageToNodeDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployedServicePackageToNode", nil, "Failure preparing request") + return + } + + resp, err := client.DeployedServicePackageToNodeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployedServicePackageToNode", resp, "Failure sending request") + return + } + + result, err = client.DeployedServicePackageToNodeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployedServicePackageToNode", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServicePackageToNodePreparer prepares the DeployedServicePackageToNode request. +func (client BaseClient) DeployedServicePackageToNodePreparer(ctx context.Context, nodeName string, deployServicePackageToNodeDescription DeployServicePackageToNodeDescription, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/DeployServicePackage", pathParameters), + autorest.WithJSON(deployServicePackageToNodeDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServicePackageToNodeSender sends the DeployedServicePackageToNode request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DeployedServicePackageToNodeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServicePackageToNodeResponder handles the response to the DeployedServicePackageToNode request. The method always +// closes the http.Response Body. +func (client BaseClient) DeployedServicePackageToNodeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DisableNode deactivate a Service Fabric cluster node with the specified deactivation intent. Once the deactivation +// is in progress, the deactivation intent can be increased, but not decreased (for example, a node which is was +// deactivated with the Pause intent can be deactivated further with Restart, but not the other way around. Nodes may +// be reactivated using the Activate a node operation any time after they are deactivated. If the deactivation is not +// complete this will cancel the deactivation. A node which goes down and comes back up while deactivated will still +// need to be reactivated before services will be placed on that node. +// Parameters: +// nodeName - the name of the node. +// deactivationIntentDescription - describes the intent or reason for deactivating the node. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) DisableNode(ctx context.Context, nodeName string, deactivationIntentDescription DeactivationIntentDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "DisableNode", err.Error()) + } + + req, err := client.DisableNodePreparer(ctx, nodeName, deactivationIntentDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", nil, "Failure preparing request") + return + } + + resp, err := client.DisableNodeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", resp, "Failure sending request") + return + } + + result, err = client.DisableNodeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DisableNodePreparer prepares the DisableNode request. +func (client BaseClient) DisableNodePreparer(ctx context.Context, nodeName string, deactivationIntentDescription DeactivationIntentDescription, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/Deactivate", pathParameters), + autorest.WithJSON(deactivationIntentDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DisableNodeSender sends the DisableNode request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DisableNodeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DisableNodeResponder handles the response to the DisableNode request. The method always +// closes the http.Response Body. +func (client BaseClient) DisableNodeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// EnableNode activates a Service Fabric cluster node which is currently deactivated. Once activated, the node will +// again become a viable target for placing new replicas, and any deactivated replicas remaining on the node will be +// reactivated. +// Parameters: +// nodeName - the name of the node. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) EnableNode(ctx context.Context, nodeName string, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "EnableNode", err.Error()) + } + + req, err := client.EnableNodePreparer(ctx, nodeName, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", nil, "Failure preparing request") + return + } + + resp, err := client.EnableNodeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", resp, "Failure sending request") + return + } + + result, err = client.EnableNodeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// EnableNodePreparer prepares the EnableNode request. +func (client BaseClient) EnableNodePreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/Activate", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// EnableNodeSender sends the EnableNode request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) EnableNodeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// EnableNodeResponder handles the response to the EnableNode request. The method always +// closes the http.Response Body. +func (client BaseClient) EnableNodeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetAadMetadata gets the Azure Active Directory metadata used for secured connection to cluster. +// This API is not supposed to be called separately. It provides information needed to set up an Azure Active Directory +// secured connection with a Service Fabric cluster. +// Parameters: +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetAadMetadata(ctx context.Context, timeout *int64) (result AadMetadataObject, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetAadMetadata", err.Error()) + } + + req, err := client.GetAadMetadataPreparer(ctx, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", nil, "Failure preparing request") + return + } + + resp, err := client.GetAadMetadataSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", resp, "Failure sending request") + return + } + + result, err = client.GetAadMetadataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetAadMetadataPreparer prepares the GetAadMetadata request. +func (client BaseClient) GetAadMetadataPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { + const APIVersion = "1.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/$/GetAadMetadata"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetAadMetadataSender sends the GetAadMetadata request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetAadMetadataSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetAadMetadataResponder handles the response to the GetAadMetadata request. The method always +// closes the http.Response Body. +func (client BaseClient) GetAadMetadataResponder(resp *http.Response) (result AadMetadataObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationHealth returns the heath state of the service fabric application. The response reports either Ok, +// Error or Warning health state. If the entity is not found in the helath store, it will return Error. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// deployedApplicationsHealthStateFilter - allows filtering of the deployed applications health state objects +// returned in the result of application health query based on their health state. +// The possible values for this parameter include integer value of one of the following health states. Only +// deployed applications that match the filter will be returned.\ +// All deployed applications are used to evaluate the aggregated health state. If not specified, all entries +// are returned. +// The state values are flag based enumeration, so the value could be a combination of these value obtained +// using bitwise 'OR' operator. +// For example, if the provided value is 6 then health state of deployed applications with HealthState value of +// OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// servicesHealthStateFilter - allows filtering of the services health state objects returned in the result of +// services health query based on their health state. +// The possible values for this parameter include integer value of one of the following health states. +// Only services that match the filter are returned. All services are used to evaluate the aggregated health +// state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value +// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of services +// with HealthState value of OK (2) and Warning (4) will be returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn�t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetApplicationHealth(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, timeout *int64) (result ApplicationHealth, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealth", err.Error()) + } + + req, err := client.GetApplicationHealthPreparer(ctx, applicationID, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", nil, "Failure preparing request") + return + } + + resp, err := client.GetApplicationHealthSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", resp, "Failure sending request") + return + } + + result, err = client.GetApplicationHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationHealthPreparer prepares the GetApplicationHealth request. +func (client BaseClient) GetApplicationHealthPreparer(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if deployedApplicationsHealthStateFilter != nil { + queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", *deployedApplicationsHealthStateFilter) + } else { + queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", 0) + } + if servicesHealthStateFilter != nil { + queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", *servicesHealthStateFilter) + } else { + queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Applications/{applicationId}/$/GetHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationHealthSender sends the GetApplicationHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetApplicationHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationHealthResponder handles the response to the GetApplicationHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) GetApplicationHealthResponder(resp *http.Response) (result ApplicationHealth, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationHealthUsingPolicy gets the health of a Service Fabric application. Use EventsHealthStateFilter to +// filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicies to +// override the health policies used to evaluate the health. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// deployedApplicationsHealthStateFilter - allows filtering of the deployed applications health state objects +// returned in the result of application health query based on their health state. +// The possible values for this parameter include integer value of one of the following health states. Only +// deployed applications that match the filter will be returned.\ +// All deployed applications are used to evaluate the aggregated health state. If not specified, all entries +// are returned. +// The state values are flag based enumeration, so the value could be a combination of these value obtained +// using bitwise 'OR' operator. +// For example, if the provided value is 6 then health state of deployed applications with HealthState value of +// OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// servicesHealthStateFilter - allows filtering of the services health state objects returned in the result of +// services health query based on their health state. +// The possible values for this parameter include integer value of one of the following health states. +// Only services that match the filter are returned. All services are used to evaluate the aggregated health +// state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value +// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of services +// with HealthState value of OK (2) and Warning (4) will be returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn�t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one +// of its children. +// If not present, the health evaluation uses the health policy from application manifest or the default health +// policy. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetApplicationHealthUsingPolicy(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result ApplicationHealth, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", err.Error()) + } + + req, err := client.GetApplicationHealthUsingPolicyPreparer(ctx, applicationID, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, applicationHealthPolicy, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", nil, "Failure preparing request") + return + } + + resp, err := client.GetApplicationHealthUsingPolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", resp, "Failure sending request") + return + } + + result, err = client.GetApplicationHealthUsingPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationHealthUsingPolicyPreparer prepares the GetApplicationHealthUsingPolicy request. +func (client BaseClient) GetApplicationHealthUsingPolicyPreparer(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if deployedApplicationsHealthStateFilter != nil { + queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", *deployedApplicationsHealthStateFilter) + } else { + queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", 0) + } + if servicesHealthStateFilter != nil { + queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", *servicesHealthStateFilter) + } else { + queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Applications/{applicationId}/$/GetHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if applicationHealthPolicy != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(applicationHealthPolicy)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationHealthUsingPolicySender sends the GetApplicationHealthUsingPolicy request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetApplicationHealthUsingPolicySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationHealthUsingPolicyResponder handles the response to the GetApplicationHealthUsingPolicy request. The method always +// closes the http.Response Body. +func (client BaseClient) GetApplicationHealthUsingPolicyResponder(resp *http.Response) (result ApplicationHealth, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationInfo returns the information about the application that was created or in the process of being created +// in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the +// name, type, status, parameters and other details about the application. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from +// the result. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetApplicationInfo(ctx context.Context, applicationID string, excludeApplicationParameters *bool, timeout *int64) (result ApplicationInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfo", err.Error()) + } + + req, err := client.GetApplicationInfoPreparer(ctx, applicationID, excludeApplicationParameters, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", nil, "Failure preparing request") + return + } + + resp, err := client.GetApplicationInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", resp, "Failure sending request") + return + } + + result, err = client.GetApplicationInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationInfoPreparer prepares the GetApplicationInfo request. +func (client BaseClient) GetApplicationInfoPreparer(ctx context.Context, applicationID string, excludeApplicationParameters *bool, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if excludeApplicationParameters != nil { + queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters) + } else { + queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Applications/{applicationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationInfoSender sends the GetApplicationInfo request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetApplicationInfoSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationInfoResponder handles the response to the GetApplicationInfo request. The method always +// closes the http.Response Body. +func (client BaseClient) GetApplicationInfoResponder(resp *http.Response) (result ApplicationInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationInfoList gets the information about the applications that were created or in the process of being +// created in the Service Fabric cluster and match filters specified as the parameter. The response includes the name, +// type, status, parameters and other details about the application. If the applications do not fit in a page, one page +// of results is returned as well as a continuation token which can be used to get the next page. +// Parameters: +// applicationTypeName - the application type name used to filter the applications to query for. This value +// should not contain the application type version. +// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from +// the result. +// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation +// token with a non empty value is included in the response of the API when the results from the system do not +// fit in a single response. When this value is passed to the next API call, the API returns next set of +// results. If there are no further results then the continuation token does not contain a value. The value of +// this parameter should not be URL encoded. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetApplicationInfoList(ctx context.Context, applicationTypeName string, excludeApplicationParameters *bool, continuationToken string, timeout *int64) (result PagedApplicationInfoList, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfoList", err.Error()) + } + + req, err := client.GetApplicationInfoListPreparer(ctx, applicationTypeName, excludeApplicationParameters, continuationToken, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", nil, "Failure preparing request") + return + } + + resp, err := client.GetApplicationInfoListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", resp, "Failure sending request") + return + } + + result, err = client.GetApplicationInfoListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationInfoListPreparer prepares the GetApplicationInfoList request. +func (client BaseClient) GetApplicationInfoListPreparer(ctx context.Context, applicationTypeName string, excludeApplicationParameters *bool, continuationToken string, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(applicationTypeName) > 0 { + queryParameters["ApplicationTypeName"] = autorest.Encode("query", applicationTypeName) + } + if excludeApplicationParameters != nil { + queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters) + } else { + queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false) + } + if len(continuationToken) > 0 { + queryParameters["ContinuationToken"] = continuationToken + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/Applications"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationInfoListSender sends the GetApplicationInfoList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetApplicationInfoListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationInfoListResponder handles the response to the GetApplicationInfoList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetApplicationInfoListResponder(resp *http.Response) (result PagedApplicationInfoList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationManifest gets the manifest describing an application type. The response contains the application +// manifest XML as a string. +// Parameters: +// applicationTypeName - the name of the application type. +// applicationTypeVersion - the version of the application type. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetApplicationManifest(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (result ApplicationTypeManifest, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetApplicationManifest", err.Error()) + } + + req, err := client.GetApplicationManifestPreparer(ctx, applicationTypeName, applicationTypeVersion, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", nil, "Failure preparing request") + return + } + + resp, err := client.GetApplicationManifestSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", resp, "Failure sending request") + return + } + + result, err = client.GetApplicationManifestResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationManifestPreparer prepares the GetApplicationManifest request. +func (client BaseClient) GetApplicationManifestPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationTypeName": autorest.Encode("path", applicationTypeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetApplicationManifest", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationManifestSender sends the GetApplicationManifest request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetApplicationManifestSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationManifestResponder handles the response to the GetApplicationManifest request. The method always +// closes the http.Response Body. +func (client BaseClient) GetApplicationManifestResponder(resp *http.Response) (result ApplicationTypeManifest, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationNameInfo the GetApplicationName endpoint returns the name of the application for the specified +// service. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetApplicationNameInfo(ctx context.Context, serviceID string, timeout *int64) (result ApplicationNameInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetApplicationNameInfo", err.Error()) + } + + req, err := client.GetApplicationNameInfoPreparer(ctx, serviceID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", nil, "Failure preparing request") + return + } + + resp, err := client.GetApplicationNameInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", resp, "Failure sending request") + return + } + + result, err = client.GetApplicationNameInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationNameInfoPreparer prepares the GetApplicationNameInfo request. +func (client BaseClient) GetApplicationNameInfoPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Services/{serviceId}/$/GetApplicationName", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationNameInfoSender sends the GetApplicationNameInfo request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetApplicationNameInfoSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationNameInfoResponder handles the response to the GetApplicationNameInfo request. The method always +// closes the http.Response Body. +func (client BaseClient) GetApplicationNameInfoResponder(resp *http.Response) (result ApplicationNameInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationTypeInfoList returns the information about the application types that are provisioned or in the +// process of being provisioned in the Service Fabric cluster. Each version of an application type is returned as one +// application type. The response includes the name, version, status and other details about the application type. This +// is a paged query, meaning that if not all of the application types fit in a page, one page of results is returned as +// well as a continuation token which can be used to get the next page. For example, if there are 10 application types +// but a page only fits the first 3 application types, or if max results is set to 3, then 3 is returned. To access the +// rest of the results, retrieve subsequent pages by using the returned continuation token in the next query. An empty +// continuation token is returned if there are no subsequent pages. +// Parameters: +// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from +// the result. +// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation +// token with a non empty value is included in the response of the API when the results from the system do not +// fit in a single response. When this value is passed to the next API call, the API returns next set of +// results. If there are no further results then the continuation token does not contain a value. The value of +// this parameter should not be URL encoded. +// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter +// defines the upper bound on the number of results returned. The results returned can be less than the +// specified maximum results if they do not fit in the message as per the max message size restrictions defined +// in the configuration. If this parameter is zero or not specified, the paged queries includes as much results +// as possible that fit in the return message. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetApplicationTypeInfoList(ctx context.Context, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationTypeInfoList, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxResults, + Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoList", err.Error()) + } + + req, err := client.GetApplicationTypeInfoListPreparer(ctx, excludeApplicationParameters, continuationToken, maxResults, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", nil, "Failure preparing request") + return + } + + resp, err := client.GetApplicationTypeInfoListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", resp, "Failure sending request") + return + } + + result, err = client.GetApplicationTypeInfoListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationTypeInfoListPreparer prepares the GetApplicationTypeInfoList request. +func (client BaseClient) GetApplicationTypeInfoListPreparer(ctx context.Context, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { + const APIVersion = "4.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if excludeApplicationParameters != nil { + queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters) + } else { + queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false) + } + if len(continuationToken) > 0 { + queryParameters["ContinuationToken"] = continuationToken + } + if maxResults != nil { + queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) + } else { + queryParameters["MaxResults"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/ApplicationTypes"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationTypeInfoListSender sends the GetApplicationTypeInfoList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetApplicationTypeInfoListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationTypeInfoListResponder handles the response to the GetApplicationTypeInfoList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetApplicationTypeInfoListResponder(resp *http.Response) (result PagedApplicationTypeInfoList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationTypeInfoListByName returns the information about the application types that are provisioned or in the +// process of being provisioned in the Service Fabric cluster. These results are of application types whose name match +// exactly the one specified as the parameter, and which comply with the given query parameters. All versions of the +// application type matching the application type name are returned, with each version returned as one application +// type. The response includes the name, version, status and other details about the application type. This is a paged +// query, meaning that if not all of the application types fit in a page, one page of results is returned as well as a +// continuation token which can be used to get the next page. For example, if there are 10 application types but a page +// only fits the first 3 application types, or if max results is set to 3, then 3 is returned. To access the rest of +// the results, retrieve subsequent pages by using the returned continuation token in the next query. An empty +// continuation token is returned if there are no subsequent pages. +// Parameters: +// applicationTypeName - the name of the application type. +// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from +// the result. +// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation +// token with a non empty value is included in the response of the API when the results from the system do not +// fit in a single response. When this value is passed to the next API call, the API returns next set of +// results. If there are no further results then the continuation token does not contain a value. The value of +// this parameter should not be URL encoded. +// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter +// defines the upper bound on the number of results returned. The results returned can be less than the +// specified maximum results if they do not fit in the message as per the max message size restrictions defined +// in the configuration. If this parameter is zero or not specified, the paged queries includes as much results +// as possible that fit in the return message. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetApplicationTypeInfoListByName(ctx context.Context, applicationTypeName string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationTypeInfoList, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxResults, + Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoListByName", err.Error()) + } + + req, err := client.GetApplicationTypeInfoListByNamePreparer(ctx, applicationTypeName, excludeApplicationParameters, continuationToken, maxResults, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", nil, "Failure preparing request") + return + } + + resp, err := client.GetApplicationTypeInfoListByNameSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", resp, "Failure sending request") + return + } + + result, err = client.GetApplicationTypeInfoListByNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationTypeInfoListByNamePreparer prepares the GetApplicationTypeInfoListByName request. +func (client BaseClient) GetApplicationTypeInfoListByNamePreparer(ctx context.Context, applicationTypeName string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationTypeName": autorest.Encode("path", applicationTypeName), + } + + const APIVersion = "4.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if excludeApplicationParameters != nil { + queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters) + } else { + queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false) + } + if len(continuationToken) > 0 { + queryParameters["ContinuationToken"] = continuationToken + } + if maxResults != nil { + queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) + } else { + queryParameters["MaxResults"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationTypeInfoListByNameSender sends the GetApplicationTypeInfoListByName request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetApplicationTypeInfoListByNameSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationTypeInfoListByNameResponder handles the response to the GetApplicationTypeInfoListByName request. The method always +// closes the http.Response Body. +func (client BaseClient) GetApplicationTypeInfoListByNameResponder(resp *http.Response) (result PagedApplicationTypeInfoList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationUpgrade returns information about the state of the latest application upgrade along with details to +// aid debugging application health issues. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetApplicationUpgrade(ctx context.Context, applicationID string, timeout *int64) (result ApplicationUpgradeProgressInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetApplicationUpgrade", err.Error()) + } + + req, err := client.GetApplicationUpgradePreparer(ctx, applicationID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", nil, "Failure preparing request") + return + } + + resp, err := client.GetApplicationUpgradeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", resp, "Failure sending request") + return + } + + result, err = client.GetApplicationUpgradeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationUpgradePreparer prepares the GetApplicationUpgrade request. +func (client BaseClient) GetApplicationUpgradePreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Applications/{applicationId}/$/GetUpgradeProgress", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationUpgradeSender sends the GetApplicationUpgrade request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetApplicationUpgradeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetApplicationUpgradeResponder handles the response to the GetApplicationUpgrade request. The method always +// closes the http.Response Body. +func (client BaseClient) GetApplicationUpgradeResponder(resp *http.Response) (result ApplicationUpgradeProgressInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetChaosReport you can either specify the ContinuationToken to get the next segment of the Chaos report or you can +// specify the time-range +// through StartTimeUtc and EndTimeUtc, but you cannot specify both the ContinuationToken and the time-range in the +// same call. +// When there are more than 100 Chaos events, the Chaos report is returned in segments where a segment contains no more +// than 100 Chaos events. +// Parameters: +// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation +// token with a non empty value is included in the response of the API when the results from the system do not +// fit in a single response. When this value is passed to the next API call, the API returns next set of +// results. If there are no further results then the continuation token does not contain a value. The value of +// this parameter should not be URL encoded. +// startTimeUtc - the count of ticks representing the start time of the time range for which a Chaos report is +// to be generated. Please consult [DateTime.Ticks +// Property](https://msdn.microsoft.com/en-us/library/system.datetime.ticks%28v=vs.110%29) for details about +// tick. +// endTimeUtc - the count of ticks representing the end time of the time range for which a Chaos report is to +// be generated. Please consult [DateTime.Ticks +// Property](https://msdn.microsoft.com/en-us/library/system.datetime.ticks%28v=vs.110%29) for details about +// tick. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetChaosReport(ctx context.Context, continuationToken string, startTimeUtc string, endTimeUtc string, timeout *int64) (result ChaosReport, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetChaosReport", err.Error()) + } + + req, err := client.GetChaosReportPreparer(ctx, continuationToken, startTimeUtc, endTimeUtc, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosReport", nil, "Failure preparing request") + return + } + + resp, err := client.GetChaosReportSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosReport", resp, "Failure sending request") + return + } + + result, err = client.GetChaosReportResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosReport", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetChaosReportPreparer prepares the GetChaosReport request. +func (client BaseClient) GetChaosReportPreparer(ctx context.Context, continuationToken string, startTimeUtc string, endTimeUtc string, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(continuationToken) > 0 { + queryParameters["ContinuationToken"] = continuationToken + } + if len(startTimeUtc) > 0 { + queryParameters["StartTimeUtc"] = autorest.Encode("query", startTimeUtc) + } + if len(endTimeUtc) > 0 { + queryParameters["EndTimeUtc"] = autorest.Encode("query", endTimeUtc) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/Tools/Chaos/$/Report"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetChaosReportSender sends the GetChaosReport request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetChaosReportSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetChaosReportResponder handles the response to the GetChaosReport request. The method always +// closes the http.Response Body. +func (client BaseClient) GetChaosReportResponder(resp *http.Response) (result ChaosReport, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealth gets the health of a Service Fabric cluster. +// Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health +// state. +// Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and +// applications returned based on their aggregated health state. +// Parameters: +// nodesHealthStateFilter - allows filtering of the node health state objects returned in the result of cluster +// health query +// based on their health state. The possible values for this parameter include integer value of one of the +// following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the +// aggregated health state. +// If not specified, all entries are returned. +// The state values are flag based enumeration, so the value could be a combination of these values obtained +// using bitwise 'OR' operator. +// For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and +// Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// applicationsHealthStateFilter - allows filtering of the application health state objects returned in the +// result of cluster health +// query based on their health state. +// The possible values for this parameter include integer value obtained from members or bitwise operations +// on members of HealthStateFilter enumeration. Only applications that match the filter are returned. +// All applications are used to evaluate the aggregated health state. If not specified, all entries are +// returned. +// The state values are flag based enumeration, so the value could be a combination of these values obtained +// using bitwise 'OR' operator. +// For example, if the provided value is 6 then health state of applications with HealthState value of OK (2) +// and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetClusterHealth(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, timeout *int64) (result ClusterHealth, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealth", err.Error()) + } + + req, err := client.GetClusterHealthPreparer(ctx, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", nil, "Failure preparing request") + return + } + + resp, err := client.GetClusterHealthSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", resp, "Failure sending request") + return + } + + result, err = client.GetClusterHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthPreparer prepares the GetClusterHealth request. +func (client BaseClient) GetClusterHealthPreparer(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if nodesHealthStateFilter != nil { + queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", *nodesHealthStateFilter) + } else { + queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", 0) + } + if applicationsHealthStateFilter != nil { + queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", *applicationsHealthStateFilter) + } else { + queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", 0) + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/$/GetClusterHealth"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthSender sends the GetClusterHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetClusterHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthResponder handles the response to the GetClusterHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) GetClusterHealthResponder(resp *http.Response) (result ClusterHealth, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthChunk gets the health of a Service Fabric cluster using health chunks. Includes the aggregated +// health state of the cluster, but none of the cluster entities. +// To expand the cluster health and get the health state of all or some of the entities, use the POST URI and specify +// the cluster health chunk query description. +// Parameters: +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetClusterHealthChunk(ctx context.Context, timeout *int64) (result ClusterHealthChunk, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunk", err.Error()) + } + + req, err := client.GetClusterHealthChunkPreparer(ctx, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", nil, "Failure preparing request") + return + } + + resp, err := client.GetClusterHealthChunkSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", resp, "Failure sending request") + return + } + + result, err = client.GetClusterHealthChunkResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthChunkPreparer prepares the GetClusterHealthChunk request. +func (client BaseClient) GetClusterHealthChunkPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/$/GetClusterHealthChunk"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthChunkSender sends the GetClusterHealthChunk request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetClusterHealthChunkSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthChunkResponder handles the response to the GetClusterHealthChunk request. The method always +// closes the http.Response Body. +func (client BaseClient) GetClusterHealthChunkResponder(resp *http.Response) (result ClusterHealthChunk, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthChunkUsingPolicyAndAdvancedFilters gets the health of a Service Fabric cluster using health chunks. +// The health evaluation is done based on the input cluster health chunk query description. +// The query description allows users to specify health policies for evaluating the cluster and its children. +// Users can specify very flexible filters to select which cluster entities to return. The selection can be done based +// on the entities health state and based on the hierarchy. +// The query can return multi-level children of the entities based on the specified filters. For example, it can return +// one application with a specified name, and for this application, return +// only services that are in Error or Warning, and all partitions and replicas for one of these services. +// Parameters: +// clusterHealthChunkQueryDescription - describes the cluster and application health policies used to evaluate +// the cluster health and the filters to select which cluster entities to be returned. +// If the cluster health policy is present, it is used to evaluate the cluster events and the cluster nodes. If +// not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the +// default cluster health policy. +// By default, each application is evaluated using its specific application health policy, defined in the +// application manifest, or the default health policy, if no policy is defined in manifest. +// If the application health policy map is specified, and it has an entry for an application, the specified +// application health policy +// is used to evaluate the application health. +// Users can specify very flexible filters to select which cluster entities to include in response. The +// selection can be done based on the entities health state and based on the hierarchy. +// The query can return multi-level children of the entities based on the specified filters. For example, it +// can return one application with a specified name, and for this application, return +// only services that are in Error or Warning, and all partitions and replicas for one of these services. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFilters(ctx context.Context, clusterHealthChunkQueryDescription *ClusterHealthChunkQueryDescription, timeout *int64) (result ClusterHealthChunk, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", err.Error()) + } + + req, err := client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer(ctx, clusterHealthChunkQueryDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", nil, "Failure preparing request") + return + } + + resp, err := client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", resp, "Failure sending request") + return + } + + result, err = client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer prepares the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. +func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer(ctx context.Context, clusterHealthChunkQueryDescription *ClusterHealthChunkQueryDescription, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/$/GetClusterHealthChunk"), + autorest.WithQueryParameters(queryParameters)) + if clusterHealthChunkQueryDescription != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(clusterHealthChunkQueryDescription)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender sends the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder handles the response to the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. The method always +// closes the http.Response Body. +func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder(resp *http.Response) (result ClusterHealthChunk, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthUsingPolicy gets the health of a Service Fabric cluster. +// Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health +// state. +// Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and +// applications returned based on their aggregated health state. +// Use ClusterHealthPolicies to override the health policies used to evaluate the health. +// Parameters: +// nodesHealthStateFilter - allows filtering of the node health state objects returned in the result of cluster +// health query +// based on their health state. The possible values for this parameter include integer value of one of the +// following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the +// aggregated health state. +// If not specified, all entries are returned. +// The state values are flag based enumeration, so the value could be a combination of these values obtained +// using bitwise 'OR' operator. +// For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and +// Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// applicationsHealthStateFilter - allows filtering of the application health state objects returned in the +// result of cluster health +// query based on their health state. +// The possible values for this parameter include integer value obtained from members or bitwise operations +// on members of HealthStateFilter enumeration. Only applications that match the filter are returned. +// All applications are used to evaluate the aggregated health state. If not specified, all entries are +// returned. +// The state values are flag based enumeration, so the value could be a combination of these values obtained +// using bitwise 'OR' operator. +// For example, if the provided value is 6 then health state of applications with HealthState value of OK (2) +// and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// clusterHealthPolicies - describes the health policies used to evaluate the cluster health. +// If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the +// default cluster health policy. +// By default, each application is evaluated using its specific application health policy, defined in the +// application manifest, or the default health policy, if no policy is defined in manifest. +// If the application health policy map is specified, and it has an entry for an application, the specified +// application health policy +// is used to evaluate the application health. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetClusterHealthUsingPolicy(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, clusterHealthPolicies *ClusterHealthPolicies, timeout *int64) (result ClusterHealth, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthUsingPolicy", err.Error()) + } + + req, err := client.GetClusterHealthUsingPolicyPreparer(ctx, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, clusterHealthPolicies, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", nil, "Failure preparing request") + return + } + + resp, err := client.GetClusterHealthUsingPolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", resp, "Failure sending request") + return + } + + result, err = client.GetClusterHealthUsingPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthUsingPolicyPreparer prepares the GetClusterHealthUsingPolicy request. +func (client BaseClient) GetClusterHealthUsingPolicyPreparer(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, clusterHealthPolicies *ClusterHealthPolicies, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if nodesHealthStateFilter != nil { + queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", *nodesHealthStateFilter) + } else { + queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", 0) + } + if applicationsHealthStateFilter != nil { + queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", *applicationsHealthStateFilter) + } else { + queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", 0) + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/$/GetClusterHealth"), + autorest.WithQueryParameters(queryParameters)) + if clusterHealthPolicies != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(clusterHealthPolicies)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthUsingPolicySender sends the GetClusterHealthUsingPolicy request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetClusterHealthUsingPolicySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterHealthUsingPolicyResponder handles the response to the GetClusterHealthUsingPolicy request. The method always +// closes the http.Response Body. +func (client BaseClient) GetClusterHealthUsingPolicyResponder(resp *http.Response) (result ClusterHealth, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterManifest get the Service Fabric cluster manifest. The cluster manifest contains properties of the cluster +// that include different node types on the cluster, +// security configurations, fault and upgrade domain topologies etc. +// +// These properties are specified as part of the ClusterConfig.JSON file while deploying a stand alone cluster. +// However, most of the information in the cluster manifest +// is generated internally by service fabric during cluster deployment in other deployment scenarios (for e.g when +// using azuer portal). +// +// The contents of the cluster manifest are for informational purposes only and users are not expected to take a +// dependency on the format of the file contents or its interpretation. +// Parameters: +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetClusterManifest(ctx context.Context, timeout *int64) (result ClusterManifest, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetClusterManifest", err.Error()) + } + + req, err := client.GetClusterManifestPreparer(ctx, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", nil, "Failure preparing request") + return + } + + resp, err := client.GetClusterManifestSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", resp, "Failure sending request") + return + } + + result, err = client.GetClusterManifestResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterManifestPreparer prepares the GetClusterManifest request. +func (client BaseClient) GetClusterManifestPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/$/GetClusterManifest"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterManifestSender sends the GetClusterManifest request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetClusterManifestSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterManifestResponder handles the response to the GetClusterManifest request. The method always +// closes the http.Response Body. +func (client BaseClient) GetClusterManifestResponder(resp *http.Response) (result ClusterManifest, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterUpgradeProgress gets the current progress of the ongoing cluster upgrade. If no upgrade is currently in +// progress, gets the last state of the previous cluster upgrade. +// Parameters: +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetClusterUpgradeProgress(ctx context.Context, timeout *int64) (result ClusterUpgradeProgressObject, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetClusterUpgradeProgress", err.Error()) + } + + req, err := client.GetClusterUpgradeProgressPreparer(ctx, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", nil, "Failure preparing request") + return + } + + resp, err := client.GetClusterUpgradeProgressSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", resp, "Failure sending request") + return + } + + result, err = client.GetClusterUpgradeProgressResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterUpgradeProgressPreparer prepares the GetClusterUpgradeProgress request. +func (client BaseClient) GetClusterUpgradeProgressPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/$/GetUpgradeProgress"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterUpgradeProgressSender sends the GetClusterUpgradeProgress request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetClusterUpgradeProgressSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetClusterUpgradeProgressResponder handles the response to the GetClusterUpgradeProgress request. The method always +// closes the http.Response Body. +func (client BaseClient) GetClusterUpgradeProgressResponder(resp *http.Response) (result ClusterUpgradeProgressObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetComposeApplicationStatus returns the status of compose application that was created or in the process of being +// created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response +// includes the name, status and other details about the application. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetComposeApplicationStatus(ctx context.Context, applicationID string, timeout *int64) (result ComposeApplicationStatusInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetComposeApplicationStatus", err.Error()) + } + + req, err := client.GetComposeApplicationStatusPreparer(ctx, applicationID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeApplicationStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetComposeApplicationStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeApplicationStatus", resp, "Failure sending request") + return + } + + result, err = client.GetComposeApplicationStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeApplicationStatus", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetComposeApplicationStatusPreparer prepares the GetComposeApplicationStatus request. +func (client BaseClient) GetComposeApplicationStatusPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "4.0-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/ComposeDeployments/{applicationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetComposeApplicationStatusSender sends the GetComposeApplicationStatus request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetComposeApplicationStatusSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetComposeApplicationStatusResponder handles the response to the GetComposeApplicationStatus request. The method always +// closes the http.Response Body. +func (client BaseClient) GetComposeApplicationStatusResponder(resp *http.Response) (result ComposeApplicationStatusInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetComposeApplicationStatusList gets the status about the compose applications that were created or in the process +// of being created in the Service Fabric cluster. The response includes the name, status and other details about the +// compose application. If the applications do not fit in a page, one page of results is returned as well as a +// continuation token which can be used to get the next page. +// Parameters: +// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation +// token with a non empty value is included in the response of the API when the results from the system do not +// fit in a single response. When this value is passed to the next API call, the API returns next set of +// results. If there are no further results then the continuation token does not contain a value. The value of +// this parameter should not be URL encoded. +// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter +// defines the upper bound on the number of results returned. The results returned can be less than the +// specified maximum results if they do not fit in the message as per the max message size restrictions defined +// in the configuration. If this parameter is zero or not specified, the paged queries includes as much results +// as possible that fit in the return message. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetComposeApplicationStatusList(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (result PagedComposeApplicationStatusInfoList, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: maxResults, + Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetComposeApplicationStatusList", err.Error()) + } + + req, err := client.GetComposeApplicationStatusListPreparer(ctx, continuationToken, maxResults, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeApplicationStatusList", nil, "Failure preparing request") + return + } + + resp, err := client.GetComposeApplicationStatusListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeApplicationStatusList", resp, "Failure sending request") + return + } + + result, err = client.GetComposeApplicationStatusListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeApplicationStatusList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetComposeApplicationStatusListPreparer prepares the GetComposeApplicationStatusList request. +func (client BaseClient) GetComposeApplicationStatusListPreparer(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { + const APIVersion = "4.0-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(continuationToken) > 0 { + queryParameters["ContinuationToken"] = continuationToken + } + if maxResults != nil { + queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) + } else { + queryParameters["MaxResults"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/ComposeDeployments"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetComposeApplicationStatusListSender sends the GetComposeApplicationStatusList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetComposeApplicationStatusListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetComposeApplicationStatusListResponder handles the response to the GetComposeApplicationStatusList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetComposeApplicationStatusListResponder(resp *http.Response) (result PagedComposeApplicationStatusInfoList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDataLossProgress gets the progress of a data loss operation started with StartDataLoss, using the OperationId. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// partitionID - the identity of the partition. +// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress +// API +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetDataLossProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionDataLossProgress, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetDataLossProgress", err.Error()) + } + + req, err := client.GetDataLossProgressPreparer(ctx, serviceID, partitionID, operationID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", nil, "Failure preparing request") + return + } + + resp, err := client.GetDataLossProgressSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", resp, "Failure sending request") + return + } + + result, err = client.GetDataLossProgressResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDataLossProgressPreparer prepares the GetDataLossProgress request. +func (client BaseClient) GetDataLossProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "OperationId": autorest.Encode("query", operationID), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetDataLossProgress", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDataLossProgressSender sends the GetDataLossProgress request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDataLossProgressSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDataLossProgressResponder handles the response to the GetDataLossProgress request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDataLossProgressResponder(resp *http.Response) (result PartitionDataLossProgress, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationHealth gets the information about health of an application deployed on a Service Fabric node. +// Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed +// application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for +// DeployedServicePackageHealth children based on health state. +// Parameters: +// nodeName - the name of the node. +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// deployedServicePackagesHealthStateFilter - allows filtering of the deployed service package health state +// objects returned in the result of deployed application health query based on their health state. +// The possible values for this parameter include integer value of one of the following health states. +// Only deployed service packages that match the filter are returned. All deployed service packages are used to +// evaluate the aggregated health state of the deployed application. +// If not specified, all entries are returned. +// The state values are flag based enumeration, so the value can be a combination of these value obtained using +// bitwise 'OR' operator. +// For example, if the provided value is 6 then health state of service packages with HealthState value of OK +// (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetDeployedApplicationHealth(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, timeout *int64) (result DeployedApplicationHealth, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealth", err.Error()) + } + + req, err := client.GetDeployedApplicationHealthPreparer(ctx, nodeName, applicationID, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeployedApplicationHealthSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", resp, "Failure sending request") + return + } + + result, err = client.GetDeployedApplicationHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationHealthPreparer prepares the GetDeployedApplicationHealth request. +func (client BaseClient) GetDeployedApplicationHealthPreparer(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if deployedServicePackagesHealthStateFilter != nil { + queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", *deployedServicePackagesHealthStateFilter) + } else { + queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationHealthSender sends the GetDeployedApplicationHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeployedApplicationHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationHealthResponder handles the response to the GetDeployedApplicationHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeployedApplicationHealthResponder(resp *http.Response) (result DeployedApplicationHealth, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationHealthUsingPolicy gets the information about health of an application deployed on a Service +// Fabric node using the specified policy. Use EventsHealthStateFilter to optionally filter for the collection of +// HealthEvent objects reported on the deployed application based on health state. Use +// DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on +// health state. Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. +// This API only uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored +// while evaluating the health of the deployed application. +// Parameters: +// nodeName - the name of the node. +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// deployedServicePackagesHealthStateFilter - allows filtering of the deployed service package health state +// objects returned in the result of deployed application health query based on their health state. +// The possible values for this parameter include integer value of one of the following health states. +// Only deployed service packages that match the filter are returned. All deployed service packages are used to +// evaluate the aggregated health state of the deployed application. +// If not specified, all entries are returned. +// The state values are flag based enumeration, so the value can be a combination of these value obtained using +// bitwise 'OR' operator. +// For example, if the provided value is 6 then health state of service packages with HealthState value of OK +// (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one +// of its children. +// If not present, the health evaluation uses the health policy from application manifest or the default health +// policy. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetDeployedApplicationHealthUsingPolicy(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result DeployedApplicationHealth, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", err.Error()) + } + + req, err := client.GetDeployedApplicationHealthUsingPolicyPreparer(ctx, nodeName, applicationID, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, applicationHealthPolicy, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeployedApplicationHealthUsingPolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", resp, "Failure sending request") + return + } + + result, err = client.GetDeployedApplicationHealthUsingPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationHealthUsingPolicyPreparer prepares the GetDeployedApplicationHealthUsingPolicy request. +func (client BaseClient) GetDeployedApplicationHealthUsingPolicyPreparer(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if deployedServicePackagesHealthStateFilter != nil { + queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", *deployedServicePackagesHealthStateFilter) + } else { + queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if applicationHealthPolicy != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(applicationHealthPolicy)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationHealthUsingPolicySender sends the GetDeployedApplicationHealthUsingPolicy request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeployedApplicationHealthUsingPolicySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationHealthUsingPolicyResponder handles the response to the GetDeployedApplicationHealthUsingPolicy request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeployedApplicationHealthUsingPolicyResponder(resp *http.Response) (result DeployedApplicationHealth, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationInfo gets the information about an application deployed on a Service Fabric node. +// Parameters: +// nodeName - the name of the node. +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetDeployedApplicationInfo(ctx context.Context, nodeName string, applicationID string, timeout *int64) (result DeployedApplicationInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfo", err.Error()) + } + + req, err := client.GetDeployedApplicationInfoPreparer(ctx, nodeName, applicationID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeployedApplicationInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", resp, "Failure sending request") + return + } + + result, err = client.GetDeployedApplicationInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationInfoPreparer prepares the GetDeployedApplicationInfo request. +func (client BaseClient) GetDeployedApplicationInfoPreparer(ctx context.Context, nodeName string, applicationID string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationInfoSender sends the GetDeployedApplicationInfo request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeployedApplicationInfoSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationInfoResponder handles the response to the GetDeployedApplicationInfo request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeployedApplicationInfoResponder(resp *http.Response) (result DeployedApplicationInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationInfoList gets the list of applications deployed on a Service Fabric node. +// Parameters: +// nodeName - the name of the node. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetDeployedApplicationInfoList(ctx context.Context, nodeName string, timeout *int64) (result ListDeployedApplicationInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfoList", err.Error()) + } + + req, err := client.GetDeployedApplicationInfoListPreparer(ctx, nodeName, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeployedApplicationInfoListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", resp, "Failure sending request") + return + } + + result, err = client.GetDeployedApplicationInfoListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationInfoListPreparer prepares the GetDeployedApplicationInfoList request. +func (client BaseClient) GetDeployedApplicationInfoListPreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationInfoListSender sends the GetDeployedApplicationInfoList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeployedApplicationInfoListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedApplicationInfoListResponder handles the response to the GetDeployedApplicationInfoList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeployedApplicationInfoListResponder(resp *http.Response) (result ListDeployedApplicationInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedCodePackageInfoList gets the list of code packages deployed on a Service Fabric node for the given +// application. +// Parameters: +// nodeName - the name of the node. +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// serviceManifestName - the name of a service manifest registered as part of an application type in a Service +// Fabric cluster. +// codePackageName - the name of code package specified in service manifest registered as part of an +// application type in a Service Fabric cluster. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetDeployedCodePackageInfoList(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, timeout *int64) (result ListDeployedCodePackageInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetDeployedCodePackageInfoList", err.Error()) + } + + req, err := client.GetDeployedCodePackageInfoListPreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeployedCodePackageInfoListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", resp, "Failure sending request") + return + } + + result, err = client.GetDeployedCodePackageInfoListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedCodePackageInfoListPreparer prepares the GetDeployedCodePackageInfoList request. +func (client BaseClient) GetDeployedCodePackageInfoListPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(serviceManifestName) > 0 { + queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName) + } + if len(codePackageName) > 0 { + queryParameters["CodePackageName"] = autorest.Encode("query", codePackageName) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedCodePackageInfoListSender sends the GetDeployedCodePackageInfoList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeployedCodePackageInfoListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedCodePackageInfoListResponder handles the response to the GetDeployedCodePackageInfoList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeployedCodePackageInfoListResponder(resp *http.Response) (result ListDeployedCodePackageInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageHealth gets the information about health of service package for a specific application +// deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of +// HealthEvent objects reported on the deployed service package based on health state. +// Parameters: +// nodeName - the name of the node. +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// servicePackageName - the name of the service package. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetDeployedServicePackageHealth(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, timeout *int64) (result DeployedServicePackageHealth, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealth", err.Error()) + } + + req, err := client.GetDeployedServicePackageHealthPreparer(ctx, nodeName, applicationID, servicePackageName, eventsHealthStateFilter, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeployedServicePackageHealthSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", resp, "Failure sending request") + return + } + + result, err = client.GetDeployedServicePackageHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageHealthPreparer prepares the GetDeployedServicePackageHealth request. +func (client BaseClient) GetDeployedServicePackageHealthPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "nodeName": autorest.Encode("path", nodeName), + "servicePackageName": servicePackageName, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/GetHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageHealthSender sends the GetDeployedServicePackageHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeployedServicePackageHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageHealthResponder handles the response to the GetDeployedServicePackageHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeployedServicePackageHealthResponder(resp *http.Response) (result DeployedServicePackageHealth, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageHealthUsingPolicy gets the information about health of an service package for a specific +// application deployed on a Service Fabric node. using the specified policy. Use EventsHealthStateFilter to optionally +// filter for the collection of HealthEvent objects reported on the deployed service package based on health state. Use +// ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only uses +// 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while evaluating +// the health of the deployed service package. +// Parameters: +// nodeName - the name of the node. +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// servicePackageName - the name of the service package. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one +// of its children. +// If not present, the health evaluation uses the health policy from application manifest or the default health +// policy. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetDeployedServicePackageHealthUsingPolicy(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result DeployedServicePackageHealth, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", err.Error()) + } + + req, err := client.GetDeployedServicePackageHealthUsingPolicyPreparer(ctx, nodeName, applicationID, servicePackageName, eventsHealthStateFilter, applicationHealthPolicy, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeployedServicePackageHealthUsingPolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", resp, "Failure sending request") + return + } + + result, err = client.GetDeployedServicePackageHealthUsingPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageHealthUsingPolicyPreparer prepares the GetDeployedServicePackageHealthUsingPolicy request. +func (client BaseClient) GetDeployedServicePackageHealthUsingPolicyPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "nodeName": autorest.Encode("path", nodeName), + "servicePackageName": servicePackageName, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/GetHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if applicationHealthPolicy != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(applicationHealthPolicy)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageHealthUsingPolicySender sends the GetDeployedServicePackageHealthUsingPolicy request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeployedServicePackageHealthUsingPolicySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageHealthUsingPolicyResponder handles the response to the GetDeployedServicePackageHealthUsingPolicy request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeployedServicePackageHealthUsingPolicyResponder(resp *http.Response) (result DeployedServicePackageHealth, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageInfoList returns the information about the service packages deployed on a Service Fabric +// node for the given application. +// Parameters: +// nodeName - the name of the node. +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetDeployedServicePackageInfoList(ctx context.Context, nodeName string, applicationID string, timeout *int64) (result ListDeployedServicePackageInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoList", err.Error()) + } + + req, err := client.GetDeployedServicePackageInfoListPreparer(ctx, nodeName, applicationID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeployedServicePackageInfoListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", resp, "Failure sending request") + return + } + + result, err = client.GetDeployedServicePackageInfoListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageInfoListPreparer prepares the GetDeployedServicePackageInfoList request. +func (client BaseClient) GetDeployedServicePackageInfoListPreparer(ctx context.Context, nodeName string, applicationID string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageInfoListSender sends the GetDeployedServicePackageInfoList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeployedServicePackageInfoListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageInfoListResponder handles the response to the GetDeployedServicePackageInfoList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeployedServicePackageInfoListResponder(resp *http.Response) (result ListDeployedServicePackageInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageInfoListByName returns the information about the service packages deployed on a Service +// Fabric node for the given application. These results are of service packages whose name match exactly the service +// package name specified as the parameter. +// Parameters: +// nodeName - the name of the node. +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// servicePackageName - the name of the service package. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetDeployedServicePackageInfoListByName(ctx context.Context, nodeName string, applicationID string, servicePackageName string, timeout *int64) (result ListDeployedServicePackageInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", err.Error()) + } + + req, err := client.GetDeployedServicePackageInfoListByNamePreparer(ctx, nodeName, applicationID, servicePackageName, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeployedServicePackageInfoListByNameSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", resp, "Failure sending request") + return + } + + result, err = client.GetDeployedServicePackageInfoListByNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageInfoListByNamePreparer prepares the GetDeployedServicePackageInfoListByName request. +func (client BaseClient) GetDeployedServicePackageInfoListByNamePreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "nodeName": autorest.Encode("path", nodeName), + "servicePackageName": servicePackageName, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageInfoListByNameSender sends the GetDeployedServicePackageInfoListByName request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeployedServicePackageInfoListByNameSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServicePackageInfoListByNameResponder handles the response to the GetDeployedServicePackageInfoListByName request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeployedServicePackageInfoListByNameResponder(resp *http.Response) (result ListDeployedServicePackageInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceReplicaDetailInfo gets the details of the replica deployed on a Service Fabric node. The +// information include service kind, service name, current service operation, current service operation start date +// time, partition id, replica/instance id, reported load and other information. +// Parameters: +// nodeName - the name of the node. +// partitionID - the identity of the partition. +// replicaID - the identifier of the replica. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetDeployedServiceReplicaDetailInfo(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (result DeployedServiceReplicaDetailInfoModel, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", err.Error()) + } + + req, err := client.GetDeployedServiceReplicaDetailInfoPreparer(ctx, nodeName, partitionID, replicaID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeployedServiceReplicaDetailInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", resp, "Failure sending request") + return + } + + result, err = client.GetDeployedServiceReplicaDetailInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceReplicaDetailInfoPreparer prepares the GetDeployedServiceReplicaDetailInfo request. +func (client BaseClient) GetDeployedServiceReplicaDetailInfoPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + "partitionId": partitionID, + "replicaId": replicaID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetDetail", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceReplicaDetailInfoSender sends the GetDeployedServiceReplicaDetailInfo request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeployedServiceReplicaDetailInfoSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceReplicaDetailInfoResponder handles the response to the GetDeployedServiceReplicaDetailInfo request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeployedServiceReplicaDetailInfoResponder(resp *http.Response) (result DeployedServiceReplicaDetailInfoModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceReplicaInfoList gets the list containing the information about replicas deployed on a Service +// Fabric node. The information include partition id, replica id, status of the replica, name of the service, name of +// the service type and other information. Use PartitionId or ServiceManifestName query parameters to return +// information about the deployed replicas matching the specified values for those parameters. +// Parameters: +// nodeName - the name of the node. +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// partitionID - the identity of the partition. +// serviceManifestName - the name of a service manifest registered as part of an application type in a Service +// Fabric cluster. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetDeployedServiceReplicaInfoList(ctx context.Context, nodeName string, applicationID string, partitionID *uuid.UUID, serviceManifestName string, timeout *int64) (result ListDeployedServiceReplicaInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", err.Error()) + } + + req, err := client.GetDeployedServiceReplicaInfoListPreparer(ctx, nodeName, applicationID, partitionID, serviceManifestName, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeployedServiceReplicaInfoListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", resp, "Failure sending request") + return + } + + result, err = client.GetDeployedServiceReplicaInfoListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceReplicaInfoListPreparer prepares the GetDeployedServiceReplicaInfoList request. +func (client BaseClient) GetDeployedServiceReplicaInfoListPreparer(ctx context.Context, nodeName string, applicationID string, partitionID *uuid.UUID, serviceManifestName string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if partitionID != nil { + queryParameters["PartitionId"] = autorest.Encode("query", *partitionID) + } + if len(serviceManifestName) > 0 { + queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetReplicas", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceReplicaInfoListSender sends the GetDeployedServiceReplicaInfoList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeployedServiceReplicaInfoListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceReplicaInfoListResponder handles the response to the GetDeployedServiceReplicaInfoList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeployedServiceReplicaInfoListResponder(resp *http.Response) (result ListDeployedServiceReplicaInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceTypeInfoByName gets the information about a specified service type of the application deployed on +// a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the +// code package that registered it and activation id of the service package. +// Parameters: +// nodeName - the name of the node. +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// serviceTypeName - specifies the name of a Service Fabric service type. +// serviceManifestName - the name of the service manifest to filter the list of deployed service type +// information. If specified, the response will only contain the information about service types that are +// defined in this service manifest. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetDeployedServiceTypeInfoByName(ctx context.Context, nodeName string, applicationID string, serviceTypeName string, serviceManifestName string, timeout *int64) (result DeployedServiceTypeInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", err.Error()) + } + + req, err := client.GetDeployedServiceTypeInfoByNamePreparer(ctx, nodeName, applicationID, serviceTypeName, serviceManifestName, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeployedServiceTypeInfoByNameSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", resp, "Failure sending request") + return + } + + result, err = client.GetDeployedServiceTypeInfoByNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceTypeInfoByNamePreparer prepares the GetDeployedServiceTypeInfoByName request. +func (client BaseClient) GetDeployedServiceTypeInfoByNamePreparer(ctx context.Context, nodeName string, applicationID string, serviceTypeName string, serviceManifestName string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "nodeName": autorest.Encode("path", nodeName), + "serviceTypeName": serviceTypeName, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(serviceManifestName) > 0 { + queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes/{serviceTypeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceTypeInfoByNameSender sends the GetDeployedServiceTypeInfoByName request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeployedServiceTypeInfoByNameSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceTypeInfoByNameResponder handles the response to the GetDeployedServiceTypeInfoByName request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeployedServiceTypeInfoByNameResponder(resp *http.Response) (result DeployedServiceTypeInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceTypeInfoList gets the list containing the information about service types from the applications +// deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration +// status, the code package that registered it and activation id of the service package. +// Parameters: +// nodeName - the name of the node. +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// serviceManifestName - the name of the service manifest to filter the list of deployed service type +// information. If specified, the response will only contain the information about service types that are +// defined in this service manifest. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetDeployedServiceTypeInfoList(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, timeout *int64) (result ListDeployedServiceTypeInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", err.Error()) + } + + req, err := client.GetDeployedServiceTypeInfoListPreparer(ctx, nodeName, applicationID, serviceManifestName, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeployedServiceTypeInfoListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", resp, "Failure sending request") + return + } + + result, err = client.GetDeployedServiceTypeInfoListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceTypeInfoListPreparer prepares the GetDeployedServiceTypeInfoList request. +func (client BaseClient) GetDeployedServiceTypeInfoListPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(serviceManifestName) > 0 { + queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceTypeInfoListSender sends the GetDeployedServiceTypeInfoList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetDeployedServiceTypeInfoListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetDeployedServiceTypeInfoListResponder handles the response to the GetDeployedServiceTypeInfoList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetDeployedServiceTypeInfoListResponder(resp *http.Response) (result ListDeployedServiceTypeInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetFaultOperationList gets the a list of user-induced fault operations filtered by provided input. +// Parameters: +// typeFilter - used to filter on OperationType for user-induced operations. +// 65535 - select all +// 1 - select PartitionDataLoss. +// 2 - select PartitionQuorumLoss. +// 4 - select PartitionRestart. +// 8 - select NodeTransition. +// stateFilter - used to filter on OperationState's for user-induced operations. +// 65535 - select All +// 1 - select Running +// 2 - select RollingBack +// 8 - select Completed +// 16 - select Faulted +// 32 - select Cancelled +// 64 - select ForceCancelled +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetFaultOperationList(ctx context.Context, typeFilter int32, stateFilter int32, timeout *int64) (result ListOperationStatus, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetFaultOperationList", err.Error()) + } + + req, err := client.GetFaultOperationListPreparer(ctx, typeFilter, stateFilter, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", nil, "Failure preparing request") + return + } + + resp, err := client.GetFaultOperationListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", resp, "Failure sending request") + return + } + + result, err = client.GetFaultOperationListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetFaultOperationListPreparer prepares the GetFaultOperationList request. +func (client BaseClient) GetFaultOperationListPreparer(ctx context.Context, typeFilter int32, stateFilter int32, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "StateFilter": autorest.Encode("query", stateFilter), + "TypeFilter": autorest.Encode("query", typeFilter), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/Faults/"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetFaultOperationListSender sends the GetFaultOperationList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetFaultOperationListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetFaultOperationListResponder handles the response to the GetFaultOperationList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetFaultOperationListResponder(resp *http.Response) (result ListOperationStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetImageStoreContent returns the information about the image store content at the specified contentPath relative to +// the root of the image store. +// Parameters: +// contentPath - relative path to file or folder in the image store from its root. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetImageStoreContent(ctx context.Context, contentPath string, timeout *int64) (result ImageStoreContent, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreContent", err.Error()) + } + + req, err := client.GetImageStoreContentPreparer(ctx, contentPath, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetImageStoreContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", resp, "Failure sending request") + return + } + + result, err = client.GetImageStoreContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetImageStoreContentPreparer prepares the GetImageStoreContent request. +func (client BaseClient) GetImageStoreContentPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "contentPath": autorest.Encode("path", contentPath), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetImageStoreContentSender sends the GetImageStoreContent request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetImageStoreContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetImageStoreContentResponder handles the response to the GetImageStoreContent request. The method always +// closes the http.Response Body. +func (client BaseClient) GetImageStoreContentResponder(resp *http.Response) (result ImageStoreContent, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetImageStoreRootContent returns the information about the image store content at the root of the image store. +// Parameters: +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetImageStoreRootContent(ctx context.Context, timeout *int64) (result ImageStoreContent, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreRootContent", err.Error()) + } + + req, err := client.GetImageStoreRootContentPreparer(ctx, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetImageStoreRootContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", resp, "Failure sending request") + return + } + + result, err = client.GetImageStoreRootContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetImageStoreRootContentPreparer prepares the GetImageStoreRootContent request. +func (client BaseClient) GetImageStoreRootContentPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/ImageStore"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetImageStoreRootContentSender sends the GetImageStoreRootContent request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetImageStoreRootContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetImageStoreRootContentResponder handles the response to the GetImageStoreRootContent request. The method always +// closes the http.Response Body. +func (client BaseClient) GetImageStoreRootContentResponder(resp *http.Response) (result ImageStoreContent, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeHealth gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of +// health events reported on the node based on the health state. If the node that you specify by name does not exist in +// the health store, this returns an error. +// Parameters: +// nodeName - the name of the node. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetNodeHealth(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, timeout *int64) (result NodeHealth, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealth", err.Error()) + } + + req, err := client.GetNodeHealthPreparer(ctx, nodeName, eventsHealthStateFilter, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", nil, "Failure preparing request") + return + } + + resp, err := client.GetNodeHealthSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", resp, "Failure sending request") + return + } + + result, err = client.GetNodeHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeHealthPreparer prepares the GetNodeHealth request. +func (client BaseClient) GetNodeHealthPreparer(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeHealthSender sends the GetNodeHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetNodeHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeHealthResponder handles the response to the GetNodeHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) GetNodeHealthResponder(resp *http.Response) (result NodeHealth, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeHealthUsingPolicy gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the +// collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body +// to override the health policies used to evaluate the health. If the node that you specify by name does not exist in +// the health store, this returns an error. +// Parameters: +// nodeName - the name of the node. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// clusterHealthPolicy - describes the health policies used to evaluate the health of a cluster or node. If not +// present, the health evaluation uses the health policy from cluster manifest or the default health policy. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetNodeHealthUsingPolicy(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, clusterHealthPolicy *ClusterHealthPolicy, timeout *int64) (result NodeHealth, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealthUsingPolicy", err.Error()) + } + + req, err := client.GetNodeHealthUsingPolicyPreparer(ctx, nodeName, eventsHealthStateFilter, clusterHealthPolicy, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", nil, "Failure preparing request") + return + } + + resp, err := client.GetNodeHealthUsingPolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", resp, "Failure sending request") + return + } + + result, err = client.GetNodeHealthUsingPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeHealthUsingPolicyPreparer prepares the GetNodeHealthUsingPolicy request. +func (client BaseClient) GetNodeHealthUsingPolicyPreparer(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, clusterHealthPolicy *ClusterHealthPolicy, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if clusterHealthPolicy != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(clusterHealthPolicy)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeHealthUsingPolicySender sends the GetNodeHealthUsingPolicy request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetNodeHealthUsingPolicySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeHealthUsingPolicyResponder handles the response to the GetNodeHealthUsingPolicy request. The method always +// closes the http.Response Body. +func (client BaseClient) GetNodeHealthUsingPolicyResponder(resp *http.Response) (result NodeHealth, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeInfo gets the information about a specific node in the Service Fabric Cluster.The respons include the name, +// status, id, health, uptime and other details about the node. +// Parameters: +// nodeName - the name of the node. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetNodeInfo(ctx context.Context, nodeName string, timeout *int64) (result NodeInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfo", err.Error()) + } + + req, err := client.GetNodeInfoPreparer(ctx, nodeName, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", nil, "Failure preparing request") + return + } + + resp, err := client.GetNodeInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", resp, "Failure sending request") + return + } + + result, err = client.GetNodeInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeInfoPreparer prepares the GetNodeInfo request. +func (client BaseClient) GetNodeInfoPreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeInfoSender sends the GetNodeInfo request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetNodeInfoSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeInfoResponder handles the response to the GetNodeInfo request. The method always +// closes the http.Response Body. +func (client BaseClient) GetNodeInfoResponder(resp *http.Response) (result NodeInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeInfoList the Nodes endpoint returns information about the nodes in the Service Fabric Cluster. The respons +// include the name, status, id, health, uptime and other details about the node. +// Parameters: +// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation +// token with a non empty value is included in the response of the API when the results from the system do not +// fit in a single response. When this value is passed to the next API call, the API returns next set of +// results. If there are no further results then the continuation token does not contain a value. The value of +// this parameter should not be URL encoded. +// nodeStatusFilter - allows filtering the nodes based on the NodeStatus. Only the nodes that are matching the +// specified filter value will be returned. The filter value can be one of the following. +// +// - default - This filter value will match all of the nodes excepts the ones with with status as Unknown or +// Removed. +// - all - This filter value will match all of the nodes. +// - up - This filter value will match nodes that are Up. +// - down - This filter value will match nodes that are Down. +// - enabling - This filter value will match nodes that are in the process of being enabled with status as +// Enabling. +// - disabling - This filter value will match nodes that are in the process of being disabled with status as +// Disabling. +// - disabled - This filter value will match nodes that are Disabled. +// - unknown - This filter value will match nodes whose status is Unknown. A node would be in Unknown state if +// Service Fabric does not have authoritative information about that node. This can happen if the system learns +// about a node at runtime. +// - removed - This filter value will match nodes whose status is Removed. These are the nodes that are removed +// from the cluster using the RemoveNodeState API. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetNodeInfoList(ctx context.Context, continuationToken string, nodeStatusFilter string, timeout *int64) (result PagedNodeInfoList, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfoList", err.Error()) + } + + req, err := client.GetNodeInfoListPreparer(ctx, continuationToken, nodeStatusFilter, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", nil, "Failure preparing request") + return + } + + resp, err := client.GetNodeInfoListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", resp, "Failure sending request") + return + } + + result, err = client.GetNodeInfoListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeInfoListPreparer prepares the GetNodeInfoList request. +func (client BaseClient) GetNodeInfoListPreparer(ctx context.Context, continuationToken string, nodeStatusFilter string, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(continuationToken) > 0 { + queryParameters["ContinuationToken"] = continuationToken + } + if len(string(nodeStatusFilter)) > 0 { + queryParameters["NodeStatusFilter"] = autorest.Encode("query", nodeStatusFilter) + } else { + queryParameters["NodeStatusFilter"] = autorest.Encode("query", "default") + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/Nodes"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeInfoListSender sends the GetNodeInfoList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetNodeInfoListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeInfoListResponder handles the response to the GetNodeInfoList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetNodeInfoListResponder(resp *http.Response) (result PagedNodeInfoList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeLoadInfo gets the load information of a Service Fabric node. +// Parameters: +// nodeName - the name of the node. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetNodeLoadInfo(ctx context.Context, nodeName string, timeout *int64) (result NodeLoadInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetNodeLoadInfo", err.Error()) + } + + req, err := client.GetNodeLoadInfoPreparer(ctx, nodeName, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", nil, "Failure preparing request") + return + } + + resp, err := client.GetNodeLoadInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", resp, "Failure sending request") + return + } + + result, err = client.GetNodeLoadInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeLoadInfoPreparer prepares the GetNodeLoadInfo request. +func (client BaseClient) GetNodeLoadInfoPreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetLoadInformation", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeLoadInfoSender sends the GetNodeLoadInfo request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetNodeLoadInfoSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeLoadInfoResponder handles the response to the GetNodeLoadInfo request. The method always +// closes the http.Response Body. +func (client BaseClient) GetNodeLoadInfoResponder(resp *http.Response) (result NodeLoadInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeTransitionProgress gets the progress of an operation started with StartNodeTransition using the provided +// OperationId. +// Parameters: +// nodeName - the name of the node. +// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress +// API +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetNodeTransitionProgress(ctx context.Context, nodeName string, operationID uuid.UUID, timeout *int64) (result NodeTransitionProgress, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetNodeTransitionProgress", err.Error()) + } + + req, err := client.GetNodeTransitionProgressPreparer(ctx, nodeName, operationID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", nil, "Failure preparing request") + return + } + + resp, err := client.GetNodeTransitionProgressSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", resp, "Failure sending request") + return + } + + result, err = client.GetNodeTransitionProgressResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeTransitionProgressPreparer prepares the GetNodeTransitionProgress request. +func (client BaseClient) GetNodeTransitionProgressPreparer(ctx context.Context, nodeName string, operationID uuid.UUID, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "OperationId": autorest.Encode("query", operationID), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Faults/Nodes/{nodeName}/$/GetTransitionProgress", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeTransitionProgressSender sends the GetNodeTransitionProgress request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetNodeTransitionProgressSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetNodeTransitionProgressResponder handles the response to the GetNodeTransitionProgress request. The method always +// closes the http.Response Body. +func (client BaseClient) GetNodeTransitionProgressResponder(resp *http.Response) (result NodeTransitionProgress, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionHealth gets the health information of the specified partition. +// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health +// state. +// Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. +// If you specify a partition that does not exist in the health store, this cmdlet returns an error. +// Parameters: +// partitionID - the identity of the partition. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// replicasHealthStateFilter - allows filtering the collection of ReplicaHealthState objects on the partition. +// The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only replicas +// that match the filter will be returned. All replicas will be used to evaluate the aggregated health state. +// If not specified, all entries will be returned.The state values are flag based enumeration, so the value +// could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided +// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) will be returned. The +// possible values for this parameter include integer value of one of the following health states. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetPartitionHealth(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, timeout *int64) (result PartitionHealth, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealth", err.Error()) + } + + req, err := client.GetPartitionHealthPreparer(ctx, partitionID, eventsHealthStateFilter, replicasHealthStateFilter, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", nil, "Failure preparing request") + return + } + + resp, err := client.GetPartitionHealthSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", resp, "Failure sending request") + return + } + + result, err = client.GetPartitionHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionHealthPreparer prepares the GetPartitionHealth request. +func (client BaseClient) GetPartitionHealthPreparer(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if replicasHealthStateFilter != nil { + queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", *replicasHealthStateFilter) + } else { + queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Partitions/{partitionId}/$/GetHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionHealthSender sends the GetPartitionHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetPartitionHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionHealthResponder handles the response to the GetPartitionHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) GetPartitionHealthResponder(resp *http.Response) (result PartitionHealth, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionHealthUsingPolicy gets the health information of the specified partition. +// If the application health policy is specified, the health evaluation uses it to get the aggregated health state. +// If the policy is not specified, the health evaluation uses the application health policy defined in the application +// manifest, or the default health policy, if no policy is defined in the manifest. +// Use EventsHealthStateFilter to filter the collection of health events reported on the partition based on the health +// state. +// Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. Use +// ApplicationHealthPolicy in the POST body to override the health policies used to evaluate the health. +// If you specify a partition that does not exist in the health store, this cmdlet returns an error. +// Parameters: +// partitionID - the identity of the partition. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// replicasHealthStateFilter - allows filtering the collection of ReplicaHealthState objects on the partition. +// The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only replicas +// that match the filter will be returned. All replicas will be used to evaluate the aggregated health state. +// If not specified, all entries will be returned.The state values are flag based enumeration, so the value +// could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided +// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) will be returned. The +// possible values for this parameter include integer value of one of the following health states. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one +// of its children. +// If not present, the health evaluation uses the health policy from application manifest or the default health +// policy. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetPartitionHealthUsingPolicy(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result PartitionHealth, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", err.Error()) + } + + req, err := client.GetPartitionHealthUsingPolicyPreparer(ctx, partitionID, eventsHealthStateFilter, replicasHealthStateFilter, applicationHealthPolicy, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", nil, "Failure preparing request") + return + } + + resp, err := client.GetPartitionHealthUsingPolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", resp, "Failure sending request") + return + } + + result, err = client.GetPartitionHealthUsingPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionHealthUsingPolicyPreparer prepares the GetPartitionHealthUsingPolicy request. +func (client BaseClient) GetPartitionHealthUsingPolicyPreparer(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if replicasHealthStateFilter != nil { + queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", *replicasHealthStateFilter) + } else { + queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Partitions/{partitionId}/$/GetHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if applicationHealthPolicy != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(applicationHealthPolicy)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionHealthUsingPolicySender sends the GetPartitionHealthUsingPolicy request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetPartitionHealthUsingPolicySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionHealthUsingPolicyResponder handles the response to the GetPartitionHealthUsingPolicy request. The method always +// closes the http.Response Body. +func (client BaseClient) GetPartitionHealthUsingPolicyResponder(resp *http.Response) (result PartitionHealth, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionInfo the Partitions endpoint returns information about the specified partition. The response include the +// partition id, partitioning scheme information, keys supported by the partition, status, health and other details +// about the partition. +// Parameters: +// partitionID - the identity of the partition. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetPartitionInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result ServicePartitionInfoModel, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfo", err.Error()) + } + + req, err := client.GetPartitionInfoPreparer(ctx, partitionID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", nil, "Failure preparing request") + return + } + + resp, err := client.GetPartitionInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", resp, "Failure sending request") + return + } + + result, err = client.GetPartitionInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionInfoPreparer prepares the GetPartitionInfo request. +func (client BaseClient) GetPartitionInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Partitions/{partitionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionInfoSender sends the GetPartitionInfo request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetPartitionInfoSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionInfoResponder handles the response to the GetPartitionInfo request. The method always +// closes the http.Response Body. +func (client BaseClient) GetPartitionInfoResponder(resp *http.Response) (result ServicePartitionInfoModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionInfoList gets the list of partitions of a Service Fabric service. The response include the partition id, +// partitioning scheme information, keys supported by the partition, status, health and other details about the +// partition. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation +// token with a non empty value is included in the response of the API when the results from the system do not +// fit in a single response. When this value is passed to the next API call, the API returns next set of +// results. If there are no further results then the continuation token does not contain a value. The value of +// this parameter should not be URL encoded. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetPartitionInfoList(ctx context.Context, serviceID string, continuationToken string, timeout *int64) (result PagedServicePartitionInfoList, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfoList", err.Error()) + } + + req, err := client.GetPartitionInfoListPreparer(ctx, serviceID, continuationToken, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", nil, "Failure preparing request") + return + } + + resp, err := client.GetPartitionInfoListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", resp, "Failure sending request") + return + } + + result, err = client.GetPartitionInfoListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionInfoListPreparer prepares the GetPartitionInfoList request. +func (client BaseClient) GetPartitionInfoListPreparer(ctx context.Context, serviceID string, continuationToken string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(continuationToken) > 0 { + queryParameters["ContinuationToken"] = continuationToken + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Services/{serviceId}/$/GetPartitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionInfoListSender sends the GetPartitionInfoList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetPartitionInfoListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionInfoListResponder handles the response to the GetPartitionInfoList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetPartitionInfoListResponder(resp *http.Response) (result PagedServicePartitionInfoList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionLoadInformation returns information about the specified partition. +// The response includes a list of load information. +// Each information includes load metric name, value and last reported time in UTC. +// Parameters: +// partitionID - the identity of the partition. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetPartitionLoadInformation(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result PartitionLoadInformation, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetPartitionLoadInformation", err.Error()) + } + + req, err := client.GetPartitionLoadInformationPreparer(ctx, partitionID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", nil, "Failure preparing request") + return + } + + resp, err := client.GetPartitionLoadInformationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", resp, "Failure sending request") + return + } + + result, err = client.GetPartitionLoadInformationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionLoadInformationPreparer prepares the GetPartitionLoadInformation request. +func (client BaseClient) GetPartitionLoadInformationPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Partitions/{partitionId}/$/GetLoadInformation", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionLoadInformationSender sends the GetPartitionLoadInformation request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetPartitionLoadInformationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionLoadInformationResponder handles the response to the GetPartitionLoadInformation request. The method always +// closes the http.Response Body. +func (client BaseClient) GetPartitionLoadInformationResponder(resp *http.Response) (result PartitionLoadInformation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionRestartProgress gets the progress of a PartitionRestart started with StartPartitionRestart using the +// provided OperationId. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// partitionID - the identity of the partition. +// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress +// API +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetPartitionRestartProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionRestartProgress, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestartProgress", err.Error()) + } + + req, err := client.GetPartitionRestartProgressPreparer(ctx, serviceID, partitionID, operationID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", nil, "Failure preparing request") + return + } + + resp, err := client.GetPartitionRestartProgressSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", resp, "Failure sending request") + return + } + + result, err = client.GetPartitionRestartProgressResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionRestartProgressPreparer prepares the GetPartitionRestartProgress request. +func (client BaseClient) GetPartitionRestartProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "OperationId": autorest.Encode("query", operationID), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetRestartProgress", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionRestartProgressSender sends the GetPartitionRestartProgress request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetPartitionRestartProgressSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetPartitionRestartProgressResponder handles the response to the GetPartitionRestartProgress request. The method always +// closes the http.Response Body. +func (client BaseClient) GetPartitionRestartProgressResponder(resp *http.Response) (result PartitionRestartProgress, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetProvisionedFabricCodeVersionInfoList gets a list of information about fabric code versions that are provisioned +// in the cluster. The parameter CodeVersion can be used to optionally filter the output to only that particular +// version. +// Parameters: +// codeVersion - the product version of Service Fabric. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetProvisionedFabricCodeVersionInfoList(ctx context.Context, codeVersion string, timeout *int64) (result ListFabricCodeVersionInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", err.Error()) + } + + req, err := client.GetProvisionedFabricCodeVersionInfoListPreparer(ctx, codeVersion, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", nil, "Failure preparing request") + return + } + + resp, err := client.GetProvisionedFabricCodeVersionInfoListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", resp, "Failure sending request") + return + } + + result, err = client.GetProvisionedFabricCodeVersionInfoListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetProvisionedFabricCodeVersionInfoListPreparer prepares the GetProvisionedFabricCodeVersionInfoList request. +func (client BaseClient) GetProvisionedFabricCodeVersionInfoListPreparer(ctx context.Context, codeVersion string, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(codeVersion) > 0 { + queryParameters["CodeVersion"] = autorest.Encode("query", codeVersion) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/$/GetProvisionedCodeVersions"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetProvisionedFabricCodeVersionInfoListSender sends the GetProvisionedFabricCodeVersionInfoList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetProvisionedFabricCodeVersionInfoListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetProvisionedFabricCodeVersionInfoListResponder handles the response to the GetProvisionedFabricCodeVersionInfoList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetProvisionedFabricCodeVersionInfoListResponder(resp *http.Response) (result ListFabricCodeVersionInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetProvisionedFabricConfigVersionInfoList gets a list of information about fabric config versions that are +// provisioned in the cluster. The parameter ConfigVersion can be used to optionally filter the output to only that +// particular version. +// Parameters: +// configVersion - the config version of Service Fabric. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetProvisionedFabricConfigVersionInfoList(ctx context.Context, configVersion string, timeout *int64) (result ListFabricConfigVersionInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", err.Error()) + } + + req, err := client.GetProvisionedFabricConfigVersionInfoListPreparer(ctx, configVersion, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", nil, "Failure preparing request") + return + } + + resp, err := client.GetProvisionedFabricConfigVersionInfoListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", resp, "Failure sending request") + return + } + + result, err = client.GetProvisionedFabricConfigVersionInfoListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetProvisionedFabricConfigVersionInfoListPreparer prepares the GetProvisionedFabricConfigVersionInfoList request. +func (client BaseClient) GetProvisionedFabricConfigVersionInfoListPreparer(ctx context.Context, configVersion string, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(configVersion) > 0 { + queryParameters["ConfigVersion"] = autorest.Encode("query", configVersion) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/$/GetProvisionedConfigVersions"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetProvisionedFabricConfigVersionInfoListSender sends the GetProvisionedFabricConfigVersionInfoList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetProvisionedFabricConfigVersionInfoListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetProvisionedFabricConfigVersionInfoListResponder handles the response to the GetProvisionedFabricConfigVersionInfoList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetProvisionedFabricConfigVersionInfoListResponder(resp *http.Response) (result ListFabricConfigVersionInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetQuorumLossProgress gets the progress of a quorum loss operation started with StartQuorumLoss, using the provided +// OperationId. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// partitionID - the identity of the partition. +// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress +// API +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetQuorumLossProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionQuorumLossProgress, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetQuorumLossProgress", err.Error()) + } + + req, err := client.GetQuorumLossProgressPreparer(ctx, serviceID, partitionID, operationID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", nil, "Failure preparing request") + return + } + + resp, err := client.GetQuorumLossProgressSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", resp, "Failure sending request") + return + } + + result, err = client.GetQuorumLossProgressResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetQuorumLossProgressPreparer prepares the GetQuorumLossProgress request. +func (client BaseClient) GetQuorumLossProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "OperationId": autorest.Encode("query", operationID), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetQuorumLossProgress", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetQuorumLossProgressSender sends the GetQuorumLossProgress request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetQuorumLossProgressSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetQuorumLossProgressResponder handles the response to the GetQuorumLossProgress request. The method always +// closes the http.Response Body. +func (client BaseClient) GetQuorumLossProgressResponder(resp *http.Response) (result PartitionQuorumLossProgress, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaHealth gets the health of a Service Fabric replica. +// Use EventsHealthStateFilter to filter the collection of health events reported on the replica based on the health +// state. +// Parameters: +// partitionID - the identity of the partition. +// replicaID - the identifier of the replica. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetReplicaHealth(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, timeout *int64) (result ReplicaHealthModel, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealth", err.Error()) + } + + req, err := client.GetReplicaHealthPreparer(ctx, partitionID, replicaID, eventsHealthStateFilter, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", nil, "Failure preparing request") + return + } + + resp, err := client.GetReplicaHealthSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", resp, "Failure sending request") + return + } + + result, err = client.GetReplicaHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaHealthPreparer prepares the GetReplicaHealth request. +func (client BaseClient) GetReplicaHealthPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + "replicaId": replicaID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaHealthSender sends the GetReplicaHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetReplicaHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaHealthResponder handles the response to the GetReplicaHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) GetReplicaHealthResponder(resp *http.Response) (result ReplicaHealthModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaHealthUsingPolicy gets the health of a Service Fabric stateful service replica or stateless service +// instance. +// Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health +// state. +// Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only +// uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while +// evaluating the health of the replica. +// Parameters: +// partitionID - the identity of the partition. +// replicaID - the identifier of the replica. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one +// of its children. +// If not present, the health evaluation uses the health policy from application manifest or the default health +// policy. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetReplicaHealthUsingPolicy(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result ReplicaHealthModel, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", err.Error()) + } + + req, err := client.GetReplicaHealthUsingPolicyPreparer(ctx, partitionID, replicaID, eventsHealthStateFilter, applicationHealthPolicy, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", nil, "Failure preparing request") + return + } + + resp, err := client.GetReplicaHealthUsingPolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", resp, "Failure sending request") + return + } + + result, err = client.GetReplicaHealthUsingPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaHealthUsingPolicyPreparer prepares the GetReplicaHealthUsingPolicy request. +func (client BaseClient) GetReplicaHealthUsingPolicyPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + "replicaId": replicaID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if applicationHealthPolicy != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(applicationHealthPolicy)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaHealthUsingPolicySender sends the GetReplicaHealthUsingPolicy request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetReplicaHealthUsingPolicySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaHealthUsingPolicyResponder handles the response to the GetReplicaHealthUsingPolicy request. The method always +// closes the http.Response Body. +func (client BaseClient) GetReplicaHealthUsingPolicyResponder(resp *http.Response) (result ReplicaHealthModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaInfo the respons include the id, role, status, health, node name, uptime, and other details about the +// replica. +// Parameters: +// partitionID - the identity of the partition. +// replicaID - the identifier of the replica. +// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation +// token with a non empty value is included in the response of the API when the results from the system do not +// fit in a single response. When this value is passed to the next API call, the API returns next set of +// results. If there are no further results then the continuation token does not contain a value. The value of +// this parameter should not be URL encoded. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetReplicaInfo(ctx context.Context, partitionID uuid.UUID, replicaID string, continuationToken string, timeout *int64) (result ReplicaInfoModel, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfo", err.Error()) + } + + req, err := client.GetReplicaInfoPreparer(ctx, partitionID, replicaID, continuationToken, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", nil, "Failure preparing request") + return + } + + resp, err := client.GetReplicaInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", resp, "Failure sending request") + return + } + + result, err = client.GetReplicaInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaInfoPreparer prepares the GetReplicaInfo request. +func (client BaseClient) GetReplicaInfoPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, continuationToken string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + "replicaId": replicaID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(continuationToken) > 0 { + queryParameters["ContinuationToken"] = continuationToken + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaInfoSender sends the GetReplicaInfo request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetReplicaInfoSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaInfoResponder handles the response to the GetReplicaInfo request. The method always +// closes the http.Response Body. +func (client BaseClient) GetReplicaInfoResponder(resp *http.Response) (result ReplicaInfoModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaInfoList the GetReplicas endpoint returns information about the replicas of the specified partition. The +// respons include the id, role, status, health, node name, uptime, and other details about the replica. +// Parameters: +// partitionID - the identity of the partition. +// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation +// token with a non empty value is included in the response of the API when the results from the system do not +// fit in a single response. When this value is passed to the next API call, the API returns next set of +// results. If there are no further results then the continuation token does not contain a value. The value of +// this parameter should not be URL encoded. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetReplicaInfoList(ctx context.Context, partitionID uuid.UUID, continuationToken string, timeout *int64) (result PagedReplicaInfoList, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfoList", err.Error()) + } + + req, err := client.GetReplicaInfoListPreparer(ctx, partitionID, continuationToken, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", nil, "Failure preparing request") + return + } + + resp, err := client.GetReplicaInfoListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", resp, "Failure sending request") + return + } + + result, err = client.GetReplicaInfoListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaInfoListPreparer prepares the GetReplicaInfoList request. +func (client BaseClient) GetReplicaInfoListPreparer(ctx context.Context, partitionID uuid.UUID, continuationToken string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(continuationToken) > 0 { + queryParameters["ContinuationToken"] = continuationToken + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaInfoListSender sends the GetReplicaInfoList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetReplicaInfoListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetReplicaInfoListResponder handles the response to the GetReplicaInfoList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetReplicaInfoListResponder(resp *http.Response) (result PagedReplicaInfoList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceDescription gets the description of an existing Service Fabric service. A service must be created before +// its description can be obtained. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetServiceDescription(ctx context.Context, serviceID string, timeout *int64) (result ServiceDescriptionModel, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetServiceDescription", err.Error()) + } + + req, err := client.GetServiceDescriptionPreparer(ctx, serviceID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceDescriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", resp, "Failure sending request") + return + } + + result, err = client.GetServiceDescriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceDescriptionPreparer prepares the GetServiceDescription request. +func (client BaseClient) GetServiceDescriptionPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Services/{serviceId}/$/GetDescription", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceDescriptionSender sends the GetServiceDescription request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetServiceDescriptionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceDescriptionResponder handles the response to the GetServiceDescription request. The method always +// closes the http.Response Body. +func (client BaseClient) GetServiceDescriptionResponder(resp *http.Response) (result ServiceDescriptionModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceHealth gets the health information of the specified service. +// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health +// state. +// Use PartitionsHealthStateFilter to filter the collection of partitions returned. +// If you specify a service that does not exist in the health store, this cmdlet returns an error. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// partitionsHealthStateFilter - allows filtering of the partitions health state objects returned in the result +// of service health query based on their health state. +// The possible values for this parameter include integer value of one of the following health states. +// Only partitions that match the filter are returned. All partitions are used to evaluate the aggregated +// health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value +// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of +// partitions with HealthState value of OK (2) and Warning (4) will be returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetServiceHealth(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, timeout *int64) (result ServiceHealth, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealth", err.Error()) + } + + req, err := client.GetServiceHealthPreparer(ctx, serviceID, eventsHealthStateFilter, partitionsHealthStateFilter, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceHealthSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", resp, "Failure sending request") + return + } + + result, err = client.GetServiceHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceHealthPreparer prepares the GetServiceHealth request. +func (client BaseClient) GetServiceHealthPreparer(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if partitionsHealthStateFilter != nil { + queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", *partitionsHealthStateFilter) + } else { + queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Services/{serviceId}/$/GetHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceHealthSender sends the GetServiceHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetServiceHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceHealthResponder handles the response to the GetServiceHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) GetServiceHealthResponder(resp *http.Response) (result ServiceHealth, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceHealthUsingPolicy gets the health information of the specified service. +// If the application health policy is specified, the health evaluation uses it to get the aggregated health state. +// If the policy is not specified, the health evaluation uses the application health policy defined in the application +// manifest, or the default health policy, if no policy is defined in the manifest. +// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health +// state. +// Use PartitionsHealthStateFilter to filter the collection of partitions returned. +// If you specify a service that does not exist in the health store, this cmdlet returns an error. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health +// state. +// The possible values for this parameter include integer value of one of the following health states. +// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is +// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// partitionsHealthStateFilter - allows filtering of the partitions health state objects returned in the result +// of service health query based on their health state. +// The possible values for this parameter include integer value of one of the following health states. +// Only partitions that match the filter are returned. All partitions are used to evaluate the aggregated +// health state. +// If not specified, all entries are returned. The state values are flag based enumeration, so the value could +// be a combination of these value +// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of +// partitions with HealthState value of OK (2) and Warning (4) will be returned. +// +// - Default - Default value. Matches any HealthState. The value is zero. +// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given +// collection of states. The value is 1. +// - Ok - Filter that matches input with HealthState value Ok. The value is 2. +// - Warning - Filter that matches input with HealthState value Warning. The value is 4. +// - Error - Filter that matches input with HealthState value Error. The value is 8. +// - All - Filter that matches input with any HealthState value. The value is 65535. +// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one +// of its children. +// If not present, the health evaluation uses the health policy from application manifest or the default health +// policy. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetServiceHealthUsingPolicy(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result ServiceHealth, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealthUsingPolicy", err.Error()) + } + + req, err := client.GetServiceHealthUsingPolicyPreparer(ctx, serviceID, eventsHealthStateFilter, partitionsHealthStateFilter, applicationHealthPolicy, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceHealthUsingPolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", resp, "Failure sending request") + return + } + + result, err = client.GetServiceHealthUsingPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceHealthUsingPolicyPreparer prepares the GetServiceHealthUsingPolicy request. +func (client BaseClient) GetServiceHealthUsingPolicyPreparer(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if eventsHealthStateFilter != nil { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) + } else { + queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) + } + if partitionsHealthStateFilter != nil { + queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", *partitionsHealthStateFilter) + } else { + queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", 0) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Services/{serviceId}/$/GetHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if applicationHealthPolicy != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(applicationHealthPolicy)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceHealthUsingPolicySender sends the GetServiceHealthUsingPolicy request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetServiceHealthUsingPolicySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceHealthUsingPolicyResponder handles the response to the GetServiceHealthUsingPolicy request. The method always +// closes the http.Response Body. +func (client BaseClient) GetServiceHealthUsingPolicyResponder(resp *http.Response) (result ServiceHealth, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceInfo returns the information about specified service belonging to the specified Service Fabric +// application. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetServiceInfo(ctx context.Context, applicationID string, serviceID string, timeout *int64) (result ServiceInfoModel, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfo", err.Error()) + } + + req, err := client.GetServiceInfoPreparer(ctx, applicationID, serviceID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", resp, "Failure sending request") + return + } + + result, err = client.GetServiceInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceInfoPreparer prepares the GetServiceInfo request. +func (client BaseClient) GetServiceInfoPreparer(ctx context.Context, applicationID string, serviceID string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/{serviceId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceInfoSender sends the GetServiceInfo request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetServiceInfoSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceInfoResponder handles the response to the GetServiceInfo request. The method always +// closes the http.Response Body. +func (client BaseClient) GetServiceInfoResponder(resp *http.Response) (result ServiceInfoModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceInfoList returns the information about all services belonging to the application specified by the +// application id. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// serviceTypeName - the service type name used to filter the services to query for. +// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation +// token with a non empty value is included in the response of the API when the results from the system do not +// fit in a single response. When this value is passed to the next API call, the API returns next set of +// results. If there are no further results then the continuation token does not contain a value. The value of +// this parameter should not be URL encoded. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetServiceInfoList(ctx context.Context, applicationID string, serviceTypeName string, continuationToken string, timeout *int64) (result PagedServiceInfoList, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfoList", err.Error()) + } + + req, err := client.GetServiceInfoListPreparer(ctx, applicationID, serviceTypeName, continuationToken, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceInfoListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", resp, "Failure sending request") + return + } + + result, err = client.GetServiceInfoListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceInfoListPreparer prepares the GetServiceInfoList request. +func (client BaseClient) GetServiceInfoListPreparer(ctx context.Context, applicationID string, serviceTypeName string, continuationToken string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(serviceTypeName) > 0 { + queryParameters["ServiceTypeName"] = autorest.Encode("query", serviceTypeName) + } + if len(continuationToken) > 0 { + queryParameters["ContinuationToken"] = continuationToken + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceInfoListSender sends the GetServiceInfoList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetServiceInfoListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceInfoListResponder handles the response to the GetServiceInfoList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetServiceInfoListResponder(resp *http.Response) (result PagedServiceInfoList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceManifest gets the manifest describing a service type. The response contains the service manifest XML as a +// string. +// Parameters: +// applicationTypeName - the name of the application type. +// applicationTypeVersion - the version of the application type. +// serviceManifestName - the name of a service manifest registered as part of an application type in a Service +// Fabric cluster. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetServiceManifest(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceManifestName string, timeout *int64) (result ServiceTypeManifest, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetServiceManifest", err.Error()) + } + + req, err := client.GetServiceManifestPreparer(ctx, applicationTypeName, applicationTypeVersion, serviceManifestName, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceManifestSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", resp, "Failure sending request") + return + } + + result, err = client.GetServiceManifestResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceManifestPreparer prepares the GetServiceManifest request. +func (client BaseClient) GetServiceManifestPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceManifestName string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationTypeName": autorest.Encode("path", applicationTypeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion), + "ServiceManifestName": autorest.Encode("query", serviceManifestName), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceManifest", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceManifestSender sends the GetServiceManifest request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetServiceManifestSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceManifestResponder handles the response to the GetServiceManifest request. The method always +// closes the http.Response Body. +func (client BaseClient) GetServiceManifestResponder(resp *http.Response) (result ServiceTypeManifest, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceNameInfo the GetServiceName endpoint returns the name of the service for the specified partition. +// Parameters: +// partitionID - the identity of the partition. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetServiceNameInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result ServiceNameInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetServiceNameInfo", err.Error()) + } + + req, err := client.GetServiceNameInfoPreparer(ctx, partitionID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceNameInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", resp, "Failure sending request") + return + } + + result, err = client.GetServiceNameInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceNameInfoPreparer prepares the GetServiceNameInfo request. +func (client BaseClient) GetServiceNameInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Partitions/{partitionId}/$/GetServiceName", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceNameInfoSender sends the GetServiceNameInfo request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetServiceNameInfoSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceNameInfoResponder handles the response to the GetServiceNameInfo request. The method always +// closes the http.Response Body. +func (client BaseClient) GetServiceNameInfoResponder(resp *http.Response) (result ServiceNameInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceTypeInfoList gets the list containing the information about service types that are supported by a +// provisioned application type in a Service Fabric cluster. The response includes the name of the service type, the +// name and version of the service manifest the type is defined in, kind (stateless or stateless) of the service type +// and other information about it. +// Parameters: +// applicationTypeName - the name of the application type. +// applicationTypeVersion - the version of the application type. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) GetServiceTypeInfoList(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (result ListServiceTypeInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoList", err.Error()) + } + + req, err := client.GetServiceTypeInfoListPreparer(ctx, applicationTypeName, applicationTypeVersion, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", nil, "Failure preparing request") + return + } + + resp, err := client.GetServiceTypeInfoListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", resp, "Failure sending request") + return + } + + result, err = client.GetServiceTypeInfoListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceTypeInfoListPreparer prepares the GetServiceTypeInfoList request. +func (client BaseClient) GetServiceTypeInfoListPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationTypeName": autorest.Encode("path", applicationTypeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceTypes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceTypeInfoListSender sends the GetServiceTypeInfoList request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetServiceTypeInfoListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// GetServiceTypeInfoListResponder handles the response to the GetServiceTypeInfoList request. The method always +// closes the http.Response Body. +func (client BaseClient) GetServiceTypeInfoListResponder(resp *http.Response) (result ListServiceTypeInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// InvokeInfrastructureCommand for clusters that have one or more instances of the Infrastructure Service configured, +// this API provides a way to send infrastructure-specific commands to a particular +// instance of the Infrastructure Service. +// +// Available commands and their corresponding response formats vary depending upon +// the infrastructure on which the cluster is running. +// +// This API supports the Service Fabric platform; it is not meant to be used directly from your code. +// Parameters: +// command - the text of the command to be invoked. The content of the command is infrastructure-specific. +// serviceID - the identity of the infrastructure service. This is the full name of the infrastructure service +// without the 'fabric:' URI scheme. This parameter required only for the cluster that have more than one +// instance of infrastructure service running. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) InvokeInfrastructureCommand(ctx context.Context, command string, serviceID string, timeout *int64) (result ReadCloser, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureCommand", err.Error()) + } + + req, err := client.InvokeInfrastructureCommandPreparer(ctx, command, serviceID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", nil, "Failure preparing request") + return + } + + resp, err := client.InvokeInfrastructureCommandSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", resp, "Failure sending request") + return + } + + result, err = client.InvokeInfrastructureCommandResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// InvokeInfrastructureCommandPreparer prepares the InvokeInfrastructureCommand request. +func (client BaseClient) InvokeInfrastructureCommandPreparer(ctx context.Context, command string, serviceID string, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "Command": autorest.Encode("query", command), + } + if len(serviceID) > 0 { + queryParameters["ServiceId"] = autorest.Encode("query", serviceID) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/$/InvokeInfrastructureCommand"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// InvokeInfrastructureCommandSender sends the InvokeInfrastructureCommand request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) InvokeInfrastructureCommandSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// InvokeInfrastructureCommandResponder handles the response to the InvokeInfrastructureCommand request. The method always +// closes the http.Response Body. +func (client BaseClient) InvokeInfrastructureCommandResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// InvokeInfrastructureQuery for clusters that have one or more instances of the Infrastructure Service configured, +// this API provides a way to send infrastructure-specific queries to a particular +// instance of the Infrastructure Service. +// +// Available commands and their corresponding response formats vary depending upon +// the infrastructure on which the cluster is running. +// +// This API supports the Service Fabric platform; it is not meant to be used directly from your code. +// Parameters: +// command - the text of the command to be invoked. The content of the command is infrastructure-specific. +// serviceID - the identity of the infrastructure service. This is the full name of the infrastructure service +// without the 'fabric:' URI scheme. This parameter required only for the cluster that have more than one +// instance of infrastructure service running. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) InvokeInfrastructureQuery(ctx context.Context, command string, serviceID string, timeout *int64) (result ReadCloser, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureQuery", err.Error()) + } + + req, err := client.InvokeInfrastructureQueryPreparer(ctx, command, serviceID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", nil, "Failure preparing request") + return + } + + resp, err := client.InvokeInfrastructureQuerySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", resp, "Failure sending request") + return + } + + result, err = client.InvokeInfrastructureQueryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// InvokeInfrastructureQueryPreparer prepares the InvokeInfrastructureQuery request. +func (client BaseClient) InvokeInfrastructureQueryPreparer(ctx context.Context, command string, serviceID string, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "Command": autorest.Encode("query", command), + } + if len(serviceID) > 0 { + queryParameters["ServiceId"] = autorest.Encode("query", serviceID) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/$/InvokeInfrastructureQuery"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// InvokeInfrastructureQuerySender sends the InvokeInfrastructureQuery request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) InvokeInfrastructureQuerySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// InvokeInfrastructureQueryResponder handles the response to the InvokeInfrastructureQuery request. The method always +// closes the http.Response Body. +func (client BaseClient) InvokeInfrastructureQueryResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ProvisionApplicationType provisions or registers a Service Fabric application type with the cluster. This is +// required before any new applications can be instantiated. +// Parameters: +// applicationTypeImageStorePath - the relative path for the application package in the image store specified +// during the prior copy operation. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) ProvisionApplicationType(ctx context.Context, applicationTypeImageStorePath ApplicationTypeImageStorePath, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: applicationTypeImageStorePath, + Constraints: []validation.Constraint{{Target: "applicationTypeImageStorePath.ApplicationTypeBuildPath", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "ProvisionApplicationType", err.Error()) + } + + req, err := client.ProvisionApplicationTypePreparer(ctx, applicationTypeImageStorePath, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", nil, "Failure preparing request") + return + } + + resp, err := client.ProvisionApplicationTypeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", resp, "Failure sending request") + return + } + + result, err = client.ProvisionApplicationTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ProvisionApplicationTypePreparer prepares the ProvisionApplicationType request. +func (client BaseClient) ProvisionApplicationTypePreparer(ctx context.Context, applicationTypeImageStorePath ApplicationTypeImageStorePath, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/ApplicationTypes/$/Provision"), + autorest.WithJSON(applicationTypeImageStorePath), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ProvisionApplicationTypeSender sends the ProvisionApplicationType request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ProvisionApplicationTypeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ProvisionApplicationTypeResponder handles the response to the ProvisionApplicationType request. The method always +// closes the http.Response Body. +func (client BaseClient) ProvisionApplicationTypeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverAllPartitions indicates to the Service Fabric cluster that it should attempt to recover any services +// (including system services) which are currently stuck in quorum loss. This operation should only be performed if it +// is known that the replicas that are down cannot be recovered. Incorrect use of this API can cause potential data +// loss. +// Parameters: +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) RecoverAllPartitions(ctx context.Context, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "RecoverAllPartitions", err.Error()) + } + + req, err := client.RecoverAllPartitionsPreparer(ctx, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", nil, "Failure preparing request") + return + } + + resp, err := client.RecoverAllPartitionsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", resp, "Failure sending request") + return + } + + result, err = client.RecoverAllPartitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverAllPartitionsPreparer prepares the RecoverAllPartitions request. +func (client BaseClient) RecoverAllPartitionsPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/$/RecoverAllPartitions"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverAllPartitionsSender sends the RecoverAllPartitions request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecoverAllPartitionsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverAllPartitionsResponder handles the response to the RecoverAllPartitions request. The method always +// closes the http.Response Body. +func (client BaseClient) RecoverAllPartitionsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverPartition indicates to the Service Fabric cluster that it should attempt to recover a specific partition +// which is currently stuck in quorum loss. This operation should only be performed if it is known that the replicas +// that are down cannot be recovered. Incorrect use of this API can cause potential data loss. +// Parameters: +// partitionID - the identity of the partition. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) RecoverPartition(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "RecoverPartition", err.Error()) + } + + req, err := client.RecoverPartitionPreparer(ctx, partitionID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", nil, "Failure preparing request") + return + } + + resp, err := client.RecoverPartitionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", resp, "Failure sending request") + return + } + + result, err = client.RecoverPartitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverPartitionPreparer prepares the RecoverPartition request. +func (client BaseClient) RecoverPartitionPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Partitions/{partitionId}/$/Recover", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverPartitionSender sends the RecoverPartition request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecoverPartitionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverPartitionResponder handles the response to the RecoverPartition request. The method always +// closes the http.Response Body. +func (client BaseClient) RecoverPartitionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverServicePartitions indicates to the Service Fabric cluster that it should attempt to recover the specified +// service which is currently stuck in quorum loss. This operation should only be performed if it is known that the +// replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) RecoverServicePartitions(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "RecoverServicePartitions", err.Error()) + } + + req, err := client.RecoverServicePartitionsPreparer(ctx, serviceID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", nil, "Failure preparing request") + return + } + + resp, err := client.RecoverServicePartitionsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", resp, "Failure sending request") + return + } + + result, err = client.RecoverServicePartitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverServicePartitionsPreparer prepares the RecoverServicePartitions request. +func (client BaseClient) RecoverServicePartitionsPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Services/$/{serviceId}/$/GetPartitions/$/Recover", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverServicePartitionsSender sends the RecoverServicePartitions request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecoverServicePartitionsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverServicePartitionsResponder handles the response to the RecoverServicePartitions request. The method always +// closes the http.Response Body. +func (client BaseClient) RecoverServicePartitionsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverSystemPartitions indicates to the Service Fabric cluster that it should attempt to recover the system +// services which are currently stuck in quorum loss. This operation should only be performed if it is known that the +// replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss. +// Parameters: +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) RecoverSystemPartitions(ctx context.Context, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "RecoverSystemPartitions", err.Error()) + } + + req, err := client.RecoverSystemPartitionsPreparer(ctx, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", nil, "Failure preparing request") + return + } + + resp, err := client.RecoverSystemPartitionsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", resp, "Failure sending request") + return + } + + result, err = client.RecoverSystemPartitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverSystemPartitionsPreparer prepares the RecoverSystemPartitions request. +func (client BaseClient) RecoverSystemPartitionsPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/$/RecoverSystemPartitions"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverSystemPartitionsSender sends the RecoverSystemPartitions request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecoverSystemPartitionsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RecoverSystemPartitionsResponder handles the response to the RecoverSystemPartitions request. The method always +// closes the http.Response Body. +func (client BaseClient) RecoverSystemPartitionsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoveComposeApplication deletes an existing Service Fabric compose application. An application must be created +// before it can be deleted. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) RemoveComposeApplication(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "RemoveComposeApplication", err.Error()) + } + + req, err := client.RemoveComposeApplicationPreparer(ctx, applicationID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeApplication", nil, "Failure preparing request") + return + } + + resp, err := client.RemoveComposeApplicationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeApplication", resp, "Failure sending request") + return + } + + result, err = client.RemoveComposeApplicationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeApplication", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoveComposeApplicationPreparer prepares the RemoveComposeApplication request. +func (client BaseClient) RemoveComposeApplicationPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "4.0-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/ComposeDeployments/{applicationId}/$/Delete", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoveComposeApplicationSender sends the RemoveComposeApplication request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RemoveComposeApplicationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoveComposeApplicationResponder handles the response to the RemoveComposeApplication request. The method always +// closes the http.Response Body. +func (client BaseClient) RemoveComposeApplicationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoveNodeState notifies Service Fabric that the persisted state on a node has been permanently removed or lost. +// This implies that it is not possible to recover the persisted state of that node. This generally happens if a hard +// disk has been wiped clean, or if a hard disk crashes. The node has to be down for this operation to be successful. +// This operation lets Service Fabric know that the replicas on that node no longer exist, and that Service Fabric +// should stop waiting for those replicas to come back up. Do not run this cmdlet if the state on the node has not been +// removed and the node can comes back up with its state intact. +// Parameters: +// nodeName - the name of the node. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) RemoveNodeState(ctx context.Context, nodeName string, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "RemoveNodeState", err.Error()) + } + + req, err := client.RemoveNodeStatePreparer(ctx, nodeName, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", nil, "Failure preparing request") + return + } + + resp, err := client.RemoveNodeStateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", resp, "Failure sending request") + return + } + + result, err = client.RemoveNodeStateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoveNodeStatePreparer prepares the RemoveNodeState request. +func (client BaseClient) RemoveNodeStatePreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/RemoveNodeState", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoveNodeStateSender sends the RemoveNodeState request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RemoveNodeStateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoveNodeStateResponder handles the response to the RemoveNodeState request. The method always +// closes the http.Response Body. +func (client BaseClient) RemoveNodeStateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoveReplica this API simulates a Service Fabric replica failure by removing a replica from a Service Fabric +// cluster. The removal closes the replica, transitions the replica to the role None, and then removes all of the state +// information of the replica from the cluster. This API tests the replica state removal path, and simulates the report +// fault permanent path through client APIs. Warning - There are no safety checks performed when this API is used. +// Incorrect use of this API can lead to data loss for stateful services.In addition, the forceRemove flag impacts all +// other replicas hosted in the same process. +// Parameters: +// nodeName - the name of the node. +// partitionID - the identity of the partition. +// replicaID - the identifier of the replica. +// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful +// shutdown sequence. This parameter can be used to forcefully delete an application or service for which +// delete is timing out due to issues in the service code that prevents graceful close of replicas. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) RemoveReplica(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "RemoveReplica", err.Error()) + } + + req, err := client.RemoveReplicaPreparer(ctx, nodeName, partitionID, replicaID, forceRemove, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", nil, "Failure preparing request") + return + } + + resp, err := client.RemoveReplicaSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", resp, "Failure sending request") + return + } + + result, err = client.RemoveReplicaResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoveReplicaPreparer prepares the RemoveReplica request. +func (client BaseClient) RemoveReplicaPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, forceRemove *bool, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + "partitionId": partitionID, + "replicaId": replicaID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if forceRemove != nil { + queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove) + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Delete", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoveReplicaSender sends the RemoveReplica request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RemoveReplicaSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoveReplicaResponder handles the response to the RemoveReplica request. The method always +// closes the http.Response Body. +func (client BaseClient) RemoveReplicaResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportApplicationHealth reports health state of the specified Service Fabric application. The report must contain +// the information about the source of the health report and property on which it is reported. +// The report is sent to a Service Fabric gateway Application, which forwards to the health store. +// The report may be accepted by the gateway, but rejected by the health store after extra validation. +// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. +// To see whether the report was applied in the health store, run GetApplicationHealth and check that the report +// appears in the HealthEvents section. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// healthInformation - describes the health information for the health report. This information needs to be +// present in all of the health reports sent to the health manager. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) ReportApplicationHealth(ctx context.Context, applicationID string, healthInformation HealthInformation, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: healthInformation, + Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "ReportApplicationHealth", err.Error()) + } + + req, err := client.ReportApplicationHealthPreparer(ctx, applicationID, healthInformation, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", nil, "Failure preparing request") + return + } + + resp, err := client.ReportApplicationHealthSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", resp, "Failure sending request") + return + } + + result, err = client.ReportApplicationHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportApplicationHealthPreparer prepares the ReportApplicationHealth request. +func (client BaseClient) ReportApplicationHealthPreparer(ctx context.Context, applicationID string, healthInformation HealthInformation, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Applications/{applicationId}/$/ReportHealth", pathParameters), + autorest.WithJSON(healthInformation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportApplicationHealthSender sends the ReportApplicationHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ReportApplicationHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportApplicationHealthResponder handles the response to the ReportApplicationHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) ReportApplicationHealthResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportClusterHealth sends a health report on a Service Fabric cluster. The report must contain the information about +// the source of the health report and property on which it is reported. +// The report is sent to a Service Fabric gateway node, which forwards to the health store. +// The report may be accepted by the gateway, but rejected by the health store after extra validation. +// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. +// To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in +// the HealthEvents section. +// Parameters: +// healthInformation - describes the health information for the health report. This information needs to be +// present in all of the health reports sent to the health manager. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) ReportClusterHealth(ctx context.Context, healthInformation HealthInformation, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: healthInformation, + Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "ReportClusterHealth", err.Error()) + } + + req, err := client.ReportClusterHealthPreparer(ctx, healthInformation, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", nil, "Failure preparing request") + return + } + + resp, err := client.ReportClusterHealthSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", resp, "Failure sending request") + return + } + + result, err = client.ReportClusterHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportClusterHealthPreparer prepares the ReportClusterHealth request. +func (client BaseClient) ReportClusterHealthPreparer(ctx context.Context, healthInformation HealthInformation, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/$/ReportClusterHealth"), + autorest.WithJSON(healthInformation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportClusterHealthSender sends the ReportClusterHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ReportClusterHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportClusterHealthResponder handles the response to the ReportClusterHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) ReportClusterHealthResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportDeployedApplicationHealth reports health state of the application deployed on a Service Fabric node. The +// report must contain the information about the source of the health report and property on which it is reported. +// The report is sent to a Service Fabric gateway Service, which forwards to the health store. +// The report may be accepted by the gateway, but rejected by the health store after extra validation. +// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. +// To see whether the report was applied in the health store, get deployed application health and check that the report +// appears in the HealthEvents section. +// Parameters: +// nodeName - the name of the node. +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// healthInformation - describes the health information for the health report. This information needs to be +// present in all of the health reports sent to the health manager. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) ReportDeployedApplicationHealth(ctx context.Context, nodeName string, applicationID string, healthInformation HealthInformation, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: healthInformation, + Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedApplicationHealth", err.Error()) + } + + req, err := client.ReportDeployedApplicationHealthPreparer(ctx, nodeName, applicationID, healthInformation, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", nil, "Failure preparing request") + return + } + + resp, err := client.ReportDeployedApplicationHealthSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", resp, "Failure sending request") + return + } + + result, err = client.ReportDeployedApplicationHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportDeployedApplicationHealthPreparer prepares the ReportDeployedApplicationHealth request. +func (client BaseClient) ReportDeployedApplicationHealthPreparer(ctx context.Context, nodeName string, applicationID string, healthInformation HealthInformation, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/ReportHealth", pathParameters), + autorest.WithJSON(healthInformation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportDeployedApplicationHealthSender sends the ReportDeployedApplicationHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ReportDeployedApplicationHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportDeployedApplicationHealthResponder handles the response to the ReportDeployedApplicationHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) ReportDeployedApplicationHealthResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportDeployedServicePackageHealth reports health state of the service package of the application deployed on a +// Service Fabric node. The report must contain the information about the source of the health report and property on +// which it is reported. +// The report is sent to a Service Fabric gateway Service, which forwards to the health store. +// The report may be accepted by the gateway, but rejected by the health store after extra validation. +// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. +// To see whether the report was applied in the health store, get deployed service package health and check that the +// report appears in the HealthEvents section. +// Parameters: +// nodeName - the name of the node. +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// servicePackageName - the name of the service package. +// healthInformation - describes the health information for the health report. This information needs to be +// present in all of the health reports sent to the health manager. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) ReportDeployedServicePackageHealth(ctx context.Context, nodeName string, applicationID string, servicePackageName string, healthInformation HealthInformation, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: healthInformation, + Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedServicePackageHealth", err.Error()) + } + + req, err := client.ReportDeployedServicePackageHealthPreparer(ctx, nodeName, applicationID, servicePackageName, healthInformation, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", nil, "Failure preparing request") + return + } + + resp, err := client.ReportDeployedServicePackageHealthSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", resp, "Failure sending request") + return + } + + result, err = client.ReportDeployedServicePackageHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportDeployedServicePackageHealthPreparer prepares the ReportDeployedServicePackageHealth request. +func (client BaseClient) ReportDeployedServicePackageHealthPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, healthInformation HealthInformation, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "nodeName": autorest.Encode("path", nodeName), + "servicePackageName": servicePackageName, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/ReportHealth", pathParameters), + autorest.WithJSON(healthInformation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportDeployedServicePackageHealthSender sends the ReportDeployedServicePackageHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ReportDeployedServicePackageHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportDeployedServicePackageHealthResponder handles the response to the ReportDeployedServicePackageHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) ReportDeployedServicePackageHealthResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportNodeHealth reports health state of the specified Service Fabric node. The report must contain the information +// about the source of the health report and property on which it is reported. +// The report is sent to a Service Fabric gateway node, which forwards to the health store. +// The report may be accepted by the gateway, but rejected by the health store after extra validation. +// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. +// To see whether the report was applied in the health store, run GetNodeHealth and check that the report appears in +// the HealthEvents section. +// Parameters: +// nodeName - the name of the node. +// healthInformation - describes the health information for the health report. This information needs to be +// present in all of the health reports sent to the health manager. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) ReportNodeHealth(ctx context.Context, nodeName string, healthInformation HealthInformation, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: healthInformation, + Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "ReportNodeHealth", err.Error()) + } + + req, err := client.ReportNodeHealthPreparer(ctx, nodeName, healthInformation, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", nil, "Failure preparing request") + return + } + + resp, err := client.ReportNodeHealthSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", resp, "Failure sending request") + return + } + + result, err = client.ReportNodeHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportNodeHealthPreparer prepares the ReportNodeHealth request. +func (client BaseClient) ReportNodeHealthPreparer(ctx context.Context, nodeName string, healthInformation HealthInformation, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/ReportHealth", pathParameters), + autorest.WithJSON(healthInformation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportNodeHealthSender sends the ReportNodeHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ReportNodeHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportNodeHealthResponder handles the response to the ReportNodeHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) ReportNodeHealthResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportPartitionHealth reports health state of the specified Service Fabric partition. The report must contain the +// information about the source of the health report and property on which it is reported. +// The report is sent to a Service Fabric gateway Partition, which forwards to the health store. +// The report may be accepted by the gateway, but rejected by the health store after extra validation. +// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. +// To see whether the report was applied in the health store, run GetPartitionHealth and check that the report appears +// in the HealthEvents section. +// Parameters: +// partitionID - the identity of the partition. +// healthInformation - describes the health information for the health report. This information needs to be +// present in all of the health reports sent to the health manager. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) ReportPartitionHealth(ctx context.Context, partitionID uuid.UUID, healthInformation HealthInformation, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: healthInformation, + Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "ReportPartitionHealth", err.Error()) + } + + req, err := client.ReportPartitionHealthPreparer(ctx, partitionID, healthInformation, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", nil, "Failure preparing request") + return + } + + resp, err := client.ReportPartitionHealthSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", resp, "Failure sending request") + return + } + + result, err = client.ReportPartitionHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportPartitionHealthPreparer prepares the ReportPartitionHealth request. +func (client BaseClient) ReportPartitionHealthPreparer(ctx context.Context, partitionID uuid.UUID, healthInformation HealthInformation, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Partitions/{partitionId}/$/ReportHealth", pathParameters), + autorest.WithJSON(healthInformation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportPartitionHealthSender sends the ReportPartitionHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ReportPartitionHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportPartitionHealthResponder handles the response to the ReportPartitionHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) ReportPartitionHealthResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportReplicaHealth reports health state of the specified Service Fabric replica. The report must contain the +// information about the source of the health report and property on which it is reported. +// The report is sent to a Service Fabric gateway Replica, which forwards to the health store. +// The report may be accepted by the gateway, but rejected by the health store after extra validation. +// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. +// To see whether the report was applied in the health store, run GetReplicaHealth and check that the report appears in +// the HealthEvents section. +// Parameters: +// partitionID - the identity of the partition. +// replicaID - the identifier of the replica. +// serviceKind - the kind of service replica (Stateless or Stateful) for which the health is being reported. +// Following are the possible values. +// - Stateless - Does not use Service Fabric to make its state highly available or reliable. The value is 1 +// - Stateful - Uses Service Fabric to make its state or part of its state highly available and reliable. The +// value is 2. +// healthInformation - describes the health information for the health report. This information needs to be +// present in all of the health reports sent to the health manager. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) ReportReplicaHealth(ctx context.Context, partitionID uuid.UUID, replicaID string, serviceKind string, healthInformation HealthInformation, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: healthInformation, + Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "ReportReplicaHealth", err.Error()) + } + + req, err := client.ReportReplicaHealthPreparer(ctx, partitionID, replicaID, serviceKind, healthInformation, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", nil, "Failure preparing request") + return + } + + resp, err := client.ReportReplicaHealthSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", resp, "Failure sending request") + return + } + + result, err = client.ReportReplicaHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportReplicaHealthPreparer prepares the ReportReplicaHealth request. +func (client BaseClient) ReportReplicaHealthPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, serviceKind string, healthInformation HealthInformation, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + "replicaId": replicaID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "ServiceKind": autorest.Encode("query", serviceKind), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/ReportHealth", pathParameters), + autorest.WithJSON(healthInformation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportReplicaHealthSender sends the ReportReplicaHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ReportReplicaHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportReplicaHealthResponder handles the response to the ReportReplicaHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) ReportReplicaHealthResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportServiceHealth reports health state of the specified Service Fabric service. The report must contain the +// information about the source of the health report and property on which it is reported. +// The report is sent to a Service Fabric gateway Service, which forwards to the health store. +// The report may be accepted by the gateway, but rejected by the health store after extra validation. +// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. +// To see whether the report was applied in the health store, run GetServiceHealth and check that the report appears in +// the HealthEvents section. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// healthInformation - describes the health information for the health report. This information needs to be +// present in all of the health reports sent to the health manager. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) ReportServiceHealth(ctx context.Context, serviceID string, healthInformation HealthInformation, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: healthInformation, + Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "ReportServiceHealth", err.Error()) + } + + req, err := client.ReportServiceHealthPreparer(ctx, serviceID, healthInformation, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", nil, "Failure preparing request") + return + } + + resp, err := client.ReportServiceHealthSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", resp, "Failure sending request") + return + } + + result, err = client.ReportServiceHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportServiceHealthPreparer prepares the ReportServiceHealth request. +func (client BaseClient) ReportServiceHealthPreparer(ctx context.Context, serviceID string, healthInformation HealthInformation, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Services/{serviceId}/$/ReportHealth", pathParameters), + autorest.WithJSON(healthInformation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportServiceHealthSender sends the ReportServiceHealth request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ReportServiceHealthSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReportServiceHealthResponder handles the response to the ReportServiceHealth request. The method always +// closes the http.Response Body. +func (client BaseClient) ReportServiceHealthResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResetPartitionLoad resets the current load of a Service Fabric partition to the default load for the service. +// Parameters: +// partitionID - the identity of the partition. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) ResetPartitionLoad(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "ResetPartitionLoad", err.Error()) + } + + req, err := client.ResetPartitionLoadPreparer(ctx, partitionID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", nil, "Failure preparing request") + return + } + + resp, err := client.ResetPartitionLoadSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", resp, "Failure sending request") + return + } + + result, err = client.ResetPartitionLoadResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResetPartitionLoadPreparer prepares the ResetPartitionLoad request. +func (client BaseClient) ResetPartitionLoadPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Partitions/{partitionId}/$/ResetLoad", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResetPartitionLoadSender sends the ResetPartitionLoad request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ResetPartitionLoadSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResetPartitionLoadResponder handles the response to the ResetPartitionLoad request. The method always +// closes the http.Response Body. +func (client BaseClient) ResetPartitionLoadResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResolveService resolve a Service Fabric service partition, to get the endpoints of the service replicas. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// partitionKeyType - key type for the partition. This parameter is required if the partition scheme for the +// service is Int64Range or Named. The possible values are following. +// - None (1) - Indicates that the the PartitionKeyValue parameter is not specified. This is valid for the +// partitions with partitioning scheme as Singleton. This is the default value. The value is 1. +// - Int64Range (2) - Indicates that the the PartitionKeyValue parameter is an int64 partition key. This is +// valid for the partitions with partitioning scheme as Int64Range. The value is 2. +// - Named (3) - Indicates that the the PartitionKeyValue parameter is a name of the partition. This is valid +// for the partitions with partitioning scheme as Named. The value is 3. +// partitionKeyValue - partition key. This is required if the partition scheme for the service is Int64Range or +// Named. +// previousRspVersion - the value in the Version field of the response that was received previously. This is +// required if the user knows that the result that was got previously is stale. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) ResolveService(ctx context.Context, serviceID string, partitionKeyType *int32, partitionKeyValue string, previousRspVersion string, timeout *int64) (result ResolvedServicePartition, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "ResolveService", err.Error()) + } + + req, err := client.ResolveServicePreparer(ctx, serviceID, partitionKeyType, partitionKeyValue, previousRspVersion, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", nil, "Failure preparing request") + return + } + + resp, err := client.ResolveServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", resp, "Failure sending request") + return + } + + result, err = client.ResolveServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResolveServicePreparer prepares the ResolveService request. +func (client BaseClient) ResolveServicePreparer(ctx context.Context, serviceID string, partitionKeyType *int32, partitionKeyValue string, previousRspVersion string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if partitionKeyType != nil { + queryParameters["PartitionKeyType"] = autorest.Encode("query", *partitionKeyType) + } + if len(partitionKeyValue) > 0 { + queryParameters["PartitionKeyValue"] = partitionKeyValue + } + if len(previousRspVersion) > 0 { + queryParameters["PreviousRspVersion"] = previousRspVersion + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Services/{serviceId}/$/ResolvePartition", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResolveServiceSender sends the ResolveService request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ResolveServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResolveServiceResponder handles the response to the ResolveService request. The method always +// closes the http.Response Body. +func (client BaseClient) ResolveServiceResponder(resp *http.Response) (result ResolvedServicePartition, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartDeployedCodePackage restarts a code package deployed on a Service Fabric node in a cluster. This aborts the +// code package process, which will restart all the user service replicas hosted in that process. +// Parameters: +// nodeName - the name of the node. +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// restartDeployedCodePackageDescription - describes the deployed code package on Service Fabric node to +// restart. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) RestartDeployedCodePackage(ctx context.Context, nodeName string, applicationID string, restartDeployedCodePackageDescription RestartDeployedCodePackageDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "RestartDeployedCodePackage", err.Error()) + } + + req, err := client.RestartDeployedCodePackagePreparer(ctx, nodeName, applicationID, restartDeployedCodePackageDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", nil, "Failure preparing request") + return + } + + resp, err := client.RestartDeployedCodePackageSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", resp, "Failure sending request") + return + } + + result, err = client.RestartDeployedCodePackageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartDeployedCodePackagePreparer prepares the RestartDeployedCodePackage request. +func (client BaseClient) RestartDeployedCodePackagePreparer(ctx context.Context, nodeName string, applicationID string, restartDeployedCodePackageDescription RestartDeployedCodePackageDescription, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/Restart", pathParameters), + autorest.WithJSON(restartDeployedCodePackageDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartDeployedCodePackageSender sends the RestartDeployedCodePackage request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RestartDeployedCodePackageSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartDeployedCodePackageResponder handles the response to the RestartDeployedCodePackage request. The method always +// closes the http.Response Body. +func (client BaseClient) RestartDeployedCodePackageResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartNode restarts a Service Fabric cluster node that is already started. +// Parameters: +// nodeName - the name of the node. +// restartNodeDescription - the instance of the node to be restarted and a flag indicating the need to take +// dump of the fabric process. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) RestartNode(ctx context.Context, nodeName string, restartNodeDescription RestartNodeDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: restartNodeDescription, + Constraints: []validation.Constraint{{Target: "restartNodeDescription.NodeInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "RestartNode", err.Error()) + } + + req, err := client.RestartNodePreparer(ctx, nodeName, restartNodeDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", nil, "Failure preparing request") + return + } + + resp, err := client.RestartNodeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", resp, "Failure sending request") + return + } + + result, err = client.RestartNodeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartNodePreparer prepares the RestartNode request. +func (client BaseClient) RestartNodePreparer(ctx context.Context, nodeName string, restartNodeDescription RestartNodeDescription, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/Restart", pathParameters), + autorest.WithJSON(restartNodeDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartNodeSender sends the RestartNode request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RestartNodeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartNodeResponder handles the response to the RestartNode request. The method always +// closes the http.Response Body. +func (client BaseClient) RestartNodeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartReplica restarts a service replica of a persisted service running on a node. Warning - There are no safety +// checks performed when this API is used. Incorrect use of this API can lead to availability loss for stateful +// services. +// Parameters: +// nodeName - the name of the node. +// partitionID - the identity of the partition. +// replicaID - the identifier of the replica. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) RestartReplica(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "RestartReplica", err.Error()) + } + + req, err := client.RestartReplicaPreparer(ctx, nodeName, partitionID, replicaID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", nil, "Failure preparing request") + return + } + + resp, err := client.RestartReplicaSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", resp, "Failure sending request") + return + } + + result, err = client.RestartReplicaResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartReplicaPreparer prepares the RestartReplica request. +func (client BaseClient) RestartReplicaPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + "partitionId": partitionID, + "replicaId": replicaID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartReplicaSender sends the RestartReplica request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RestartReplicaSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartReplicaResponder handles the response to the RestartReplica request. The method always +// closes the http.Response Body. +func (client BaseClient) RestartReplicaResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResumeApplicationUpgrade resumes an unmonitored manual Service Fabric application upgrade. Service Fabric upgrades +// one upgrade domain at a time. For unmonitored manual upgrades, after Service Fabric finishes an upgrade domain, it +// waits for you to call this API before proceeding to the next upgrade domain. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// resumeApplicationUpgradeDescription - describes the parameters for resuming an application upgrade. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) ResumeApplicationUpgrade(ctx context.Context, applicationID string, resumeApplicationUpgradeDescription ResumeApplicationUpgradeDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resumeApplicationUpgradeDescription, + Constraints: []validation.Constraint{{Target: "resumeApplicationUpgradeDescription.UpgradeDomainName", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationUpgrade", err.Error()) + } + + req, err := client.ResumeApplicationUpgradePreparer(ctx, applicationID, resumeApplicationUpgradeDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", nil, "Failure preparing request") + return + } + + resp, err := client.ResumeApplicationUpgradeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", resp, "Failure sending request") + return + } + + result, err = client.ResumeApplicationUpgradeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResumeApplicationUpgradePreparer prepares the ResumeApplicationUpgrade request. +func (client BaseClient) ResumeApplicationUpgradePreparer(ctx context.Context, applicationID string, resumeApplicationUpgradeDescription ResumeApplicationUpgradeDescription, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Applications/{applicationId}/$/MoveToNextUpgradeDomain", pathParameters), + autorest.WithJSON(resumeApplicationUpgradeDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResumeApplicationUpgradeSender sends the ResumeApplicationUpgrade request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ResumeApplicationUpgradeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResumeApplicationUpgradeResponder handles the response to the ResumeApplicationUpgrade request. The method always +// closes the http.Response Body. +func (client BaseClient) ResumeApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RollbackApplicationUpgrade starts rolling back the current application upgrade to the previous version. This API can +// only be used to rollback the current in-progress upgrade that is rolling forward to new version. If the application +// is not currently being upgraded use StartApplicationUpgrade API to upgrade it to desired version including rolling +// back to a previous version. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) RollbackApplicationUpgrade(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "RollbackApplicationUpgrade", err.Error()) + } + + req, err := client.RollbackApplicationUpgradePreparer(ctx, applicationID, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", nil, "Failure preparing request") + return + } + + resp, err := client.RollbackApplicationUpgradeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", resp, "Failure sending request") + return + } + + result, err = client.RollbackApplicationUpgradeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RollbackApplicationUpgradePreparer prepares the RollbackApplicationUpgrade request. +func (client BaseClient) RollbackApplicationUpgradePreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Applications/{applicationId}/$/RollbackUpgrade", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RollbackApplicationUpgradeSender sends the RollbackApplicationUpgrade request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RollbackApplicationUpgradeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RollbackApplicationUpgradeResponder handles the response to the RollbackApplicationUpgrade request. The method always +// closes the http.Response Body. +func (client BaseClient) RollbackApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartApplicationUpgrade validates the supplied application upgrade parameters and starts upgrading the application +// if the parameters are valid. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// applicationUpgradeDescription - describes the parameters for an application upgrade. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) StartApplicationUpgrade(ctx context.Context, applicationID string, applicationUpgradeDescription ApplicationUpgradeDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: applicationUpgradeDescription, + Constraints: []validation.Constraint{{Target: "applicationUpgradeDescription.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "applicationUpgradeDescription.TargetApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "applicationUpgradeDescription.Parameters", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "StartApplicationUpgrade", err.Error()) + } + + req, err := client.StartApplicationUpgradePreparer(ctx, applicationID, applicationUpgradeDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", nil, "Failure preparing request") + return + } + + resp, err := client.StartApplicationUpgradeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", resp, "Failure sending request") + return + } + + result, err = client.StartApplicationUpgradeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartApplicationUpgradePreparer prepares the StartApplicationUpgrade request. +func (client BaseClient) StartApplicationUpgradePreparer(ctx context.Context, applicationID string, applicationUpgradeDescription ApplicationUpgradeDescription, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Applications/{applicationId}/$/Upgrade", pathParameters), + autorest.WithJSON(applicationUpgradeDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartApplicationUpgradeSender sends the StartApplicationUpgrade request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) StartApplicationUpgradeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartApplicationUpgradeResponder handles the response to the StartApplicationUpgrade request. The method always +// closes the http.Response Body. +func (client BaseClient) StartApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartChaos if Chaos is not already running in the cluster, it starts Chaos with the passed in Chaos parameters. +// If Chaos is already running when this call is made, the call fails with the error code +// FABRIC_E_CHAOS_ALREADY_RUNNING. +// Please refer to the article [Induce controlled Chaos in Service Fabric +// clusters](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-controlled-chaos) for more details. +// Parameters: +// chaosParameters - describes all the parameters to configure a Chaos run. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) StartChaos(ctx context.Context, chaosParameters ChaosParameters, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: chaosParameters, + Constraints: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}, + {Target: "chaosParameters.MaxConcurrentFaults", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}, + {Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}, + {Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "StartChaos", err.Error()) + } + + req, err := client.StartChaosPreparer(ctx, chaosParameters, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", nil, "Failure preparing request") + return + } + + resp, err := client.StartChaosSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", resp, "Failure sending request") + return + } + + result, err = client.StartChaosResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartChaosPreparer prepares the StartChaos request. +func (client BaseClient) StartChaosPreparer(ctx context.Context, chaosParameters ChaosParameters, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/Tools/Chaos/$/Start"), + autorest.WithJSON(chaosParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartChaosSender sends the StartChaos request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) StartChaosSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartChaosResponder handles the response to the StartChaos request. The method always +// closes the http.Response Body. +func (client BaseClient) StartChaosResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartDataLoss this API will induce data loss for the specified partition. It will trigger a call to the OnDataLoss +// API of the partition. +// Actual data loss will depend on the specified DataLossMode +// PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is triggered for the partition but actual +// data loss depends on the presence of in-flight replication. +// FullDataLoss - All replicas are removed hence all data is lost and OnDataLoss is triggered. +// +// This API should only be called with a stateful service as the target. +// +// Calling this API with a system service as the target is not advised. +// +// Note: Once this API has been called, it cannot be reversed. Calling CancelOperation will only stop execution and +// clean up internal system state. +// It will not restore data if the command has progressed far enough to cause data loss. +// +// Call the GetDataLossProgress API with the same OperationId to return information on the operation started with this +// API. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// partitionID - the identity of the partition. +// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress +// API +// dataLossMode - this enum is passed to the StartDataLoss API to indicate what type of data loss to induce. +// - Invalid - Reserved. Do not pass into API. +// - PartialDataLoss - PartialDataLoss option will cause a quorum of replicas to go down, triggering an +// OnDataLoss event in the system for the given partition. +// - FullDataLoss - FullDataLoss option will drop all the replicas which means that all the data will be lost. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) StartDataLoss(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, dataLossMode string, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "StartDataLoss", err.Error()) + } + + req, err := client.StartDataLossPreparer(ctx, serviceID, partitionID, operationID, dataLossMode, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", nil, "Failure preparing request") + return + } + + resp, err := client.StartDataLossSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", resp, "Failure sending request") + return + } + + result, err = client.StartDataLossResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartDataLossPreparer prepares the StartDataLoss request. +func (client BaseClient) StartDataLossPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, dataLossMode string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "DataLossMode": autorest.Encode("query", dataLossMode), + "OperationId": autorest.Encode("query", operationID), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartDataLoss", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartDataLossSender sends the StartDataLoss request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) StartDataLossSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartDataLossResponder handles the response to the StartDataLoss request. The method always +// closes the http.Response Body. +func (client BaseClient) StartDataLossResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartNode starts a Service Fabric cluster node that is already stopped. +// Parameters: +// nodeName - the name of the node. +// startNodeDescription - the instance id of the stopped node that needs to be started. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) StartNode(ctx context.Context, nodeName string, startNodeDescription StartNodeDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: startNodeDescription, + Constraints: []validation.Constraint{{Target: "startNodeDescription.NodeInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "StartNode", err.Error()) + } + + req, err := client.StartNodePreparer(ctx, nodeName, startNodeDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNode", nil, "Failure preparing request") + return + } + + resp, err := client.StartNodeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNode", resp, "Failure sending request") + return + } + + result, err = client.StartNodeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNode", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartNodePreparer prepares the StartNode request. +func (client BaseClient) StartNodePreparer(ctx context.Context, nodeName string, startNodeDescription StartNodeDescription, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/Start", pathParameters), + autorest.WithJSON(startNodeDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartNodeSender sends the StartNode request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) StartNodeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartNodeResponder handles the response to the StartNode request. The method always +// closes the http.Response Body. +func (client BaseClient) StartNodeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartNodeTransition starts or stops a cluster node. A cluster node is a process, not the OS instance itself. To +// start a node, pass in "Start" for the NodeTransitionType parameter. +// To stop a node, pass in "Stop" for the NodeTransitionType parameter. This API starts the operation - when the API +// returns the node may not have finished transitioning yet. +// Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation. +// Parameters: +// nodeName - the name of the node. +// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress +// API +// nodeTransitionType - indicates the type of transition to perform. NodeTransitionType.Start will start a +// stopped node. NodeTransitionType.Stop will stop a node that is up. +// - Invalid - Reserved. Do not pass into API. +// - Start - Transition a stopped node to up. +// - Stop - Transition an up node to stopped. +// nodeInstanceID - the node instance ID of the target node. This can be determined through GetNodeInfo API. +// stopDurationInSeconds - the duration, in seconds, to keep the node stopped. The minimum value is 600, the +// maximum is 14400. After this time expires, the node will automatically come back up. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) StartNodeTransition(ctx context.Context, nodeName string, operationID uuid.UUID, nodeTransitionType string, nodeInstanceID string, stopDurationInSeconds int32, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: stopDurationInSeconds, + Constraints: []validation.Constraint{{Target: "stopDurationInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "StartNodeTransition", err.Error()) + } + + req, err := client.StartNodeTransitionPreparer(ctx, nodeName, operationID, nodeTransitionType, nodeInstanceID, stopDurationInSeconds, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", nil, "Failure preparing request") + return + } + + resp, err := client.StartNodeTransitionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", resp, "Failure sending request") + return + } + + result, err = client.StartNodeTransitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartNodeTransitionPreparer prepares the StartNodeTransition request. +func (client BaseClient) StartNodeTransitionPreparer(ctx context.Context, nodeName string, operationID uuid.UUID, nodeTransitionType string, nodeInstanceID string, stopDurationInSeconds int32, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "NodeInstanceId": autorest.Encode("query", nodeInstanceID), + "NodeTransitionType": autorest.Encode("query", nodeTransitionType), + "OperationId": autorest.Encode("query", operationID), + "StopDurationInSeconds": autorest.Encode("query", stopDurationInSeconds), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Faults/Nodes/{nodeName}/$/StartTransition/", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartNodeTransitionSender sends the StartNodeTransition request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) StartNodeTransitionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartNodeTransitionResponder handles the response to the StartNodeTransition request. The method always +// closes the http.Response Body. +func (client BaseClient) StartNodeTransitionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartPartitionRestart this API is useful for testing failover. +// +// If used to target a stateless service partition, RestartPartitionMode must be AllReplicasOrInstances. +// +// Call the GetPartitionRestartProgress API using the same OperationId to get the progress. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// partitionID - the identity of the partition. +// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress +// API +// restartPartitionMode - - Invalid - Reserved. Do not pass into API. +// - AllReplicasOrInstances - All replicas or instances in the partition are restarted at once. +// - OnlyActiveSecondaries - Only the secondary replicas are restarted. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) StartPartitionRestart(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, restartPartitionMode string, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "StartPartitionRestart", err.Error()) + } + + req, err := client.StartPartitionRestartPreparer(ctx, serviceID, partitionID, operationID, restartPartitionMode, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", nil, "Failure preparing request") + return + } + + resp, err := client.StartPartitionRestartSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", resp, "Failure sending request") + return + } + + result, err = client.StartPartitionRestartResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartPartitionRestartPreparer prepares the StartPartitionRestart request. +func (client BaseClient) StartPartitionRestartPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, restartPartitionMode string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "OperationId": autorest.Encode("query", operationID), + "RestartPartitionMode": autorest.Encode("query", restartPartitionMode), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartRestart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartPartitionRestartSender sends the StartPartitionRestart request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) StartPartitionRestartSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartPartitionRestartResponder handles the response to the StartPartitionRestart request. The method always +// closes the http.Response Body. +func (client BaseClient) StartPartitionRestartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartQuorumLoss induces quorum loss for a given stateful service partition. This API is useful for a temporary +// quorum loss situation on your service. +// +// Call the GetQuorumLossProgress API with the same OperationId to return information on the operation started with +// this API. +// +// This can only be called on stateful persisted (HasPersistedState==true) services. Do not use this API on stateless +// services or stateful in-memory only services. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// partitionID - the identity of the partition. +// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress +// API +// quorumLossMode - this enum is passed to the StartQuorumLoss API to indicate what type of quorum loss to +// induce. +// - Invalid - Reserved. Do not pass into API. +// - QuorumReplicas - Partial Quorum loss mode : Minimum number of replicas for a partition will be down that +// will cause a quorum loss. +// - AllReplicas- Full Quorum loss mode : All replicas for a partition will be down that will cause a quorum +// loss. +// quorumLossDuration - the amount of time for which the partition will be kept in quorum loss. This must be +// specified in seconds. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) StartQuorumLoss(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, quorumLossMode string, quorumLossDuration int32, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "StartQuorumLoss", err.Error()) + } + + req, err := client.StartQuorumLossPreparer(ctx, serviceID, partitionID, operationID, quorumLossMode, quorumLossDuration, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", nil, "Failure preparing request") + return + } + + resp, err := client.StartQuorumLossSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", resp, "Failure sending request") + return + } + + result, err = client.StartQuorumLossResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartQuorumLossPreparer prepares the StartQuorumLoss request. +func (client BaseClient) StartQuorumLossPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, quorumLossMode string, quorumLossDuration int32, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "partitionId": partitionID, + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "OperationId": autorest.Encode("query", operationID), + "QuorumLossDuration": autorest.Encode("query", quorumLossDuration), + "QuorumLossMode": autorest.Encode("query", quorumLossMode), + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartQuorumLoss", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartQuorumLossSender sends the StartQuorumLoss request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) StartQuorumLossSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartQuorumLossResponder handles the response to the StartQuorumLoss request. The method always +// closes the http.Response Body. +func (client BaseClient) StartQuorumLossResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StopChaos stops Chaos from scheduling further faults; but, the in-flight faults are not affected. +// Parameters: +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) StopChaos(ctx context.Context, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "StopChaos", err.Error()) + } + + req, err := client.StopChaosPreparer(ctx, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", nil, "Failure preparing request") + return + } + + resp, err := client.StopChaosSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", resp, "Failure sending request") + return + } + + result, err = client.StopChaosResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StopChaosPreparer prepares the StopChaos request. +func (client BaseClient) StopChaosPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/Tools/Chaos/$/Stop"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StopChaosSender sends the StopChaos request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) StopChaosSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StopChaosResponder handles the response to the StopChaos request. The method always +// closes the http.Response Body. +func (client BaseClient) StopChaosResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StopNode stops a Service Fabric cluster node that is in a started state. The node will stay down until start node is +// called. +// Parameters: +// nodeName - the name of the node. +// stopNodeDescription - the instance id of the stopped node that needs to be stopped. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) StopNode(ctx context.Context, nodeName string, stopNodeDescription StopNodeDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: stopNodeDescription, + Constraints: []validation.Constraint{{Target: "stopNodeDescription.NodeInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "StopNode", err.Error()) + } + + req, err := client.StopNodePreparer(ctx, nodeName, stopNodeDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopNode", nil, "Failure preparing request") + return + } + + resp, err := client.StopNodeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopNode", resp, "Failure sending request") + return + } + + result, err = client.StopNodeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopNode", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StopNodePreparer prepares the StopNode request. +func (client BaseClient) StopNodePreparer(ctx context.Context, nodeName string, stopNodeDescription StopNodeDescription, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "nodeName": autorest.Encode("path", nodeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Nodes/{nodeName}/$/Stop", pathParameters), + autorest.WithJSON(stopNodeDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StopNodeSender sends the StopNode request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) StopNodeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StopNodeResponder handles the response to the StopNode request. The method always +// closes the http.Response Body. +func (client BaseClient) StopNodeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnprovisionApplicationType removes or unregisters a Service Fabric application type from the cluster. This operation +// can only be performed if all application instance of the application type has been deleted. Once the application +// type is unregistered, no new application instance can be created for this particular application type. +// Parameters: +// applicationTypeName - the name of the application type. +// applicationTypeImageStoreVersion - the version of the application type in the image store. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) UnprovisionApplicationType(ctx context.Context, applicationTypeName string, applicationTypeImageStoreVersion ApplicationTypeImageStoreVersion, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: applicationTypeImageStoreVersion, + Constraints: []validation.Constraint{{Target: "applicationTypeImageStoreVersion.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "UnprovisionApplicationType", err.Error()) + } + + req, err := client.UnprovisionApplicationTypePreparer(ctx, applicationTypeName, applicationTypeImageStoreVersion, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", nil, "Failure preparing request") + return + } + + resp, err := client.UnprovisionApplicationTypeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", resp, "Failure sending request") + return + } + + result, err = client.UnprovisionApplicationTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnprovisionApplicationTypePreparer prepares the UnprovisionApplicationType request. +func (client BaseClient) UnprovisionApplicationTypePreparer(ctx context.Context, applicationTypeName string, applicationTypeImageStoreVersion ApplicationTypeImageStoreVersion, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationTypeName": autorest.Encode("path", applicationTypeName), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/Unprovision", pathParameters), + autorest.WithJSON(applicationTypeImageStoreVersion), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnprovisionApplicationTypeSender sends the UnprovisionApplicationType request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UnprovisionApplicationTypeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnprovisionApplicationTypeResponder handles the response to the UnprovisionApplicationType request. The method always +// closes the http.Response Body. +func (client BaseClient) UnprovisionApplicationTypeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpdateApplicationUpgrade updates the parameters of an ongoing application upgrade from the ones specified at the +// time of starting the application upgrade. This may be required to mitigate stuck application upgrades due to +// incorrect parameters or issues in the application to make progress. +// Parameters: +// applicationID - the identity of the application. This is typically the full name of the application without +// the 'fabric:' URI scheme. +// applicationUpgradeUpdateDescription - describes the parameters for updating an existing application upgrade. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) UpdateApplicationUpgrade(ctx context.Context, applicationID string, applicationUpgradeUpdateDescription ApplicationUpgradeUpdateDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: applicationUpgradeUpdateDescription, + Constraints: []validation.Constraint{{Target: "applicationUpgradeUpdateDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "UpdateApplicationUpgrade", err.Error()) + } + + req, err := client.UpdateApplicationUpgradePreparer(ctx, applicationID, applicationUpgradeUpdateDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateApplicationUpgradeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", resp, "Failure sending request") + return + } + + result, err = client.UpdateApplicationUpgradeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpdateApplicationUpgradePreparer prepares the UpdateApplicationUpgrade request. +func (client BaseClient) UpdateApplicationUpgradePreparer(ctx context.Context, applicationID string, applicationUpgradeUpdateDescription ApplicationUpgradeUpdateDescription, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationId": applicationID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Applications/{applicationId}/$/UpdateUpgrade", pathParameters), + autorest.WithJSON(applicationUpgradeUpdateDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpdateApplicationUpgradeSender sends the UpdateApplicationUpgrade request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdateApplicationUpgradeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpdateApplicationUpgradeResponder handles the response to the UpdateApplicationUpgrade request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdateApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpdateService updates the specified service using the given update description. +// Parameters: +// serviceID - the identity of the service. This is typically the full name of the service without the +// 'fabric:' URI scheme. +// serviceUpdateDescription - the updated configuration for the service. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) UpdateService(ctx context.Context, serviceID string, serviceUpdateDescription BasicServiceUpdateDescription, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "UpdateService", err.Error()) + } + + req, err := client.UpdateServicePreparer(ctx, serviceID, serviceUpdateDescription, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateServiceSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", resp, "Failure sending request") + return + } + + result, err = client.UpdateServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpdateServicePreparer prepares the UpdateService request. +func (client BaseClient) UpdateServicePreparer(ctx context.Context, serviceID string, serviceUpdateDescription BasicServiceUpdateDescription, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "serviceId": serviceID, + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Services/{serviceId}/$/Update", pathParameters), + autorest.WithJSON(serviceUpdateDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpdateServiceSender sends the UpdateService request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdateServiceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpdateServiceResponder handles the response to the UpdateService request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdateServiceResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UploadFile uploads contents of the file to the image store. Use this API if the file is small enough to upload again +// if the connection fails. The file's data needs to be added to the request body. The contents will be uploaded to the +// specified path. +// Parameters: +// contentPath - relative path to file or folder in the image store from its root. +// timeout - the server timeout for performing the operation in seconds. This specifies the time duration that +// the client is willing to wait for the requested operation to complete. The default value for this parameter +// is 60 seconds. +func (client BaseClient) UploadFile(ctx context.Context, contentPath string, timeout *int64) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: timeout, + Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("servicefabric.BaseClient", "UploadFile", err.Error()) + } + + req, err := client.UploadFilePreparer(ctx, contentPath, timeout) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", nil, "Failure preparing request") + return + } + + resp, err := client.UploadFileSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", resp, "Failure sending request") + return + } + + result, err = client.UploadFileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", resp, "Failure responding to request") + } + + return +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UploadFilePreparer prepares the UploadFile request. +func (client BaseClient) UploadFilePreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "contentPath": autorest.Encode("path", contentPath), + } + + const APIVersion = "3.0" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if timeout != nil { + queryParameters["timeout"] = autorest.Encode("query", *timeout) + } else { + queryParameters["timeout"] = autorest.Encode("query", 60) + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UploadFileSender sends the UploadFile request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UploadFileSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UploadFileResponder handles the response to the UploadFile request. The method always +// closes the http.Response Body. +func (client BaseClient) UploadFileResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/5.6/servicefabric/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/5.6/servicefabric/models.go new file mode 100644 index 00000000..1195040e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/5.6/servicefabric/models.go @@ -0,0 +1,16012 @@ +package servicefabric + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/satori/go.uuid" + "io" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AggregatedHealthState enumerates the values for aggregated health state. +type AggregatedHealthState string + +const ( + // Error ... + Error AggregatedHealthState = "Error" + // Invalid ... + Invalid AggregatedHealthState = "Invalid" + // Ok ... + Ok AggregatedHealthState = "Ok" + // Unknown ... + Unknown AggregatedHealthState = "Unknown" + // Warning ... + Warning AggregatedHealthState = "Warning" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleAggregatedHealthStateValues returns an array of possible values for the AggregatedHealthState const type. +func PossibleAggregatedHealthStateValues() []AggregatedHealthState { + return []AggregatedHealthState{Error, Invalid, Ok, Unknown, Warning} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AggregatedHealthState1 enumerates the values for aggregated health state 1. +type AggregatedHealthState1 string + +const ( + // AggregatedHealthState1Error ... + AggregatedHealthState1Error AggregatedHealthState1 = "Error" + // AggregatedHealthState1Invalid ... + AggregatedHealthState1Invalid AggregatedHealthState1 = "Invalid" + // AggregatedHealthState1Ok ... + AggregatedHealthState1Ok AggregatedHealthState1 = "Ok" + // AggregatedHealthState1Unknown ... + AggregatedHealthState1Unknown AggregatedHealthState1 = "Unknown" + // AggregatedHealthState1Warning ... + AggregatedHealthState1Warning AggregatedHealthState1 = "Warning" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleAggregatedHealthState1Values returns an array of possible values for the AggregatedHealthState1 const type. +func PossibleAggregatedHealthState1Values() []AggregatedHealthState1 { + return []AggregatedHealthState1{AggregatedHealthState1Error, AggregatedHealthState1Invalid, AggregatedHealthState1Ok, AggregatedHealthState1Unknown, AggregatedHealthState1Warning} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AggregatedHealthState2 enumerates the values for aggregated health state 2. +type AggregatedHealthState2 string + +const ( + // AggregatedHealthState2Error ... + AggregatedHealthState2Error AggregatedHealthState2 = "Error" + // AggregatedHealthState2Invalid ... + AggregatedHealthState2Invalid AggregatedHealthState2 = "Invalid" + // AggregatedHealthState2Ok ... + AggregatedHealthState2Ok AggregatedHealthState2 = "Ok" + // AggregatedHealthState2Unknown ... + AggregatedHealthState2Unknown AggregatedHealthState2 = "Unknown" + // AggregatedHealthState2Warning ... + AggregatedHealthState2Warning AggregatedHealthState2 = "Warning" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleAggregatedHealthState2Values returns an array of possible values for the AggregatedHealthState2 const type. +func PossibleAggregatedHealthState2Values() []AggregatedHealthState2 { + return []AggregatedHealthState2{AggregatedHealthState2Error, AggregatedHealthState2Invalid, AggregatedHealthState2Ok, AggregatedHealthState2Unknown, AggregatedHealthState2Warning} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Code enumerates the values for code. +type Code string + +const ( + // EABORT ... + EABORT Code = "E_ABORT" + // FABRICEAPPLICATIONALREADYEXISTS ... + FABRICEAPPLICATIONALREADYEXISTS Code = "FABRIC_E_APPLICATION_ALREADY_EXISTS" + // FABRICEAPPLICATIONALREADYINTARGETVERSION ... + FABRICEAPPLICATIONALREADYINTARGETVERSION Code = "FABRIC_E_APPLICATION_ALREADY_IN_TARGET_VERSION" + // FABRICEAPPLICATIONNOTFOUND ... + FABRICEAPPLICATIONNOTFOUND Code = "FABRIC_E_APPLICATION_NOT_FOUND" + // FABRICEAPPLICATIONNOTUPGRADING ... + FABRICEAPPLICATIONNOTUPGRADING Code = "FABRIC_E_APPLICATION_NOT_UPGRADING" + // FABRICEAPPLICATIONTYPEALREADYEXISTS ... + FABRICEAPPLICATIONTYPEALREADYEXISTS Code = "FABRIC_E_APPLICATION_TYPE_ALREADY_EXISTS" + // FABRICEAPPLICATIONTYPEINUSE ... + FABRICEAPPLICATIONTYPEINUSE Code = "FABRIC_E_APPLICATION_TYPE_IN_USE" + // FABRICEAPPLICATIONTYPENOTFOUND ... + FABRICEAPPLICATIONTYPENOTFOUND Code = "FABRIC_E_APPLICATION_TYPE_NOT_FOUND" + // FABRICEAPPLICATIONTYPEPROVISIONINPROGRESS ... + FABRICEAPPLICATIONTYPEPROVISIONINPROGRESS Code = "FABRIC_E_APPLICATION_TYPE_PROVISION_IN_PROGRESS" + // FABRICEAPPLICATIONUPGRADEINPROGRESS ... + FABRICEAPPLICATIONUPGRADEINPROGRESS Code = "FABRIC_E_APPLICATION_UPGRADE_IN_PROGRESS" + // FABRICEAPPLICATIONUPGRADEVALIDATIONERROR ... + FABRICEAPPLICATIONUPGRADEVALIDATIONERROR Code = "FABRIC_E_APPLICATION_UPGRADE_VALIDATION_ERROR" + // FABRICECOMMUNICATIONERROR ... + FABRICECOMMUNICATIONERROR Code = "FABRIC_E_COMMUNICATION_ERROR" + // FABRICECONFIGURATIONPARAMETERNOTFOUND ... + FABRICECONFIGURATIONPARAMETERNOTFOUND Code = "FABRIC_E_CONFIGURATION_PARAMETER_NOT_FOUND" + // FABRICECONFIGURATIONSECTIONNOTFOUND ... + FABRICECONFIGURATIONSECTIONNOTFOUND Code = "FABRIC_E_CONFIGURATION_SECTION_NOT_FOUND" + // FABRICEDIRECTORYNOTFOUND ... + FABRICEDIRECTORYNOTFOUND Code = "FABRIC_E_DIRECTORY_NOT_FOUND" + // FABRICEENUMERATIONCOMPLETED ... + FABRICEENUMERATIONCOMPLETED Code = "FABRIC_E_ENUMERATION_COMPLETED" + // FABRICEFABRICALREADYINTARGETVERSION ... + FABRICEFABRICALREADYINTARGETVERSION Code = "FABRIC_E_FABRIC_ALREADY_IN_TARGET_VERSION" + // FABRICEFABRICNOTUPGRADING ... + FABRICEFABRICNOTUPGRADING Code = "FABRIC_E_FABRIC_NOT_UPGRADING" + // FABRICEFABRICUPGRADEINPROGRESS ... + FABRICEFABRICUPGRADEINPROGRESS Code = "FABRIC_E_FABRIC_UPGRADE_IN_PROGRESS" + // FABRICEFABRICUPGRADEVALIDATIONERROR ... + FABRICEFABRICUPGRADEVALIDATIONERROR Code = "FABRIC_E_FABRIC_UPGRADE_VALIDATION_ERROR" + // FABRICEFABRICVERSIONALREADYEXISTS ... + FABRICEFABRICVERSIONALREADYEXISTS Code = "FABRIC_E_FABRIC_VERSION_ALREADY_EXISTS" + // FABRICEFABRICVERSIONINUSE ... + FABRICEFABRICVERSIONINUSE Code = "FABRIC_E_FABRIC_VERSION_IN_USE" + // FABRICEFABRICVERSIONNOTFOUND ... + FABRICEFABRICVERSIONNOTFOUND Code = "FABRIC_E_FABRIC_VERSION_NOT_FOUND" + // FABRICEFILENOTFOUND ... + FABRICEFILENOTFOUND Code = "FABRIC_E_FILE_NOT_FOUND" + // FABRICEHEALTHENTITYNOTFOUND ... + FABRICEHEALTHENTITYNOTFOUND Code = "FABRIC_E_HEALTH_ENTITY_NOT_FOUND" + // FABRICEHEALTHSTALEREPORT ... + FABRICEHEALTHSTALEREPORT Code = "FABRIC_E_HEALTH_STALE_REPORT" + // FABRICEIMAGEBUILDERVALIDATIONERROR ... + FABRICEIMAGEBUILDERVALIDATIONERROR Code = "FABRIC_E_IMAGEBUILDER_VALIDATION_ERROR" + // FABRICEINSTANCEIDMISMATCH ... + FABRICEINSTANCEIDMISMATCH Code = "FABRIC_E_INSTANCE_ID_MISMATCH" + // FABRICEINVALIDADDRESS ... + FABRICEINVALIDADDRESS Code = "FABRIC_E_INVALID_ADDRESS" + // FABRICEINVALIDATOMICGROUP ... + FABRICEINVALIDATOMICGROUP Code = "FABRIC_E_INVALID_ATOMIC_GROUP" + // FABRICEINVALIDCONFIGURATION ... + FABRICEINVALIDCONFIGURATION Code = "FABRIC_E_INVALID_CONFIGURATION" + // FABRICEINVALIDNAMEURI ... + FABRICEINVALIDNAMEURI Code = "FABRIC_E_INVALID_NAME_URI" + // FABRICEINVALIDPARTITIONKEY ... + FABRICEINVALIDPARTITIONKEY Code = "FABRIC_E_INVALID_PARTITION_KEY" + // FABRICEKEYNOTFOUND ... + FABRICEKEYNOTFOUND Code = "FABRIC_E_KEY_NOT_FOUND" + // FABRICEKEYTOOLARGE ... + FABRICEKEYTOOLARGE Code = "FABRIC_E_KEY_TOO_LARGE" + // FABRICENAMEALREADYEXISTS ... + FABRICENAMEALREADYEXISTS Code = "FABRIC_E_NAME_ALREADY_EXISTS" + // FABRICENAMEDOESNOTEXIST ... + FABRICENAMEDOESNOTEXIST Code = "FABRIC_E_NAME_DOES_NOT_EXIST" + // FABRICENAMENOTEMPTY ... + FABRICENAMENOTEMPTY Code = "FABRIC_E_NAME_NOT_EMPTY" + // FABRICENODEHASNOTSTOPPEDYET ... + FABRICENODEHASNOTSTOPPEDYET Code = "FABRIC_E_NODE_HAS_NOT_STOPPED_YET" + // FABRICENODEISUP ... + FABRICENODEISUP Code = "FABRIC_E_NODE_IS_UP" + // FABRICENODENOTFOUND ... + FABRICENODENOTFOUND Code = "FABRIC_E_NODE_NOT_FOUND" + // FABRICENOTPRIMARY ... + FABRICENOTPRIMARY Code = "FABRIC_E_NOT_PRIMARY" + // FABRICENOTREADY ... + FABRICENOTREADY Code = "FABRIC_E_NOT_READY" + // FABRICENOWRITEQUORUM ... + FABRICENOWRITEQUORUM Code = "FABRIC_E_NO_WRITE_QUORUM" + // FABRICEOPERATIONNOTCOMPLETE ... + FABRICEOPERATIONNOTCOMPLETE Code = "FABRIC_E_OPERATION_NOT_COMPLETE" + // FABRICEPARTITIONNOTFOUND ... + FABRICEPARTITIONNOTFOUND Code = "FABRIC_E_PARTITION_NOT_FOUND" + // FABRICEPATHTOOLONG ... + FABRICEPATHTOOLONG Code = "FABRIC_E_PATH_TOO_LONG" + // FABRICEPROPERTYCHECKFAILED ... + FABRICEPROPERTYCHECKFAILED Code = "FABRIC_E_PROPERTY_CHECK_FAILED" + // FABRICEPROPERTYDOESNOTEXIST ... + FABRICEPROPERTYDOESNOTEXIST Code = "FABRIC_E_PROPERTY_DOES_NOT_EXIST" + // FABRICERECONFIGURATIONPENDING ... + FABRICERECONFIGURATIONPENDING Code = "FABRIC_E_RECONFIGURATION_PENDING" + // FABRICEREPLICADOESNOTEXIST ... + FABRICEREPLICADOESNOTEXIST Code = "FABRIC_E_REPLICA_DOES_NOT_EXIST" + // FABRICESEQUENCENUMBERCHECKFAILED ... + FABRICESEQUENCENUMBERCHECKFAILED Code = "FABRIC_E_SEQUENCE_NUMBER_CHECK_FAILED" + // FABRICESERVICEAFFINITYCHAINNOTSUPPORTED ... + FABRICESERVICEAFFINITYCHAINNOTSUPPORTED Code = "FABRIC_E_SERVICE_AFFINITY_CHAIN_NOT_SUPPORTED" + // FABRICESERVICEALREADYEXISTS ... + FABRICESERVICEALREADYEXISTS Code = "FABRIC_E_SERVICE_ALREADY_EXISTS" + // FABRICESERVICEDOESNOTEXIST ... + FABRICESERVICEDOESNOTEXIST Code = "FABRIC_E_SERVICE_DOES_NOT_EXIST" + // FABRICESERVICEGROUPALREADYEXISTS ... + FABRICESERVICEGROUPALREADYEXISTS Code = "FABRIC_E_SERVICE_GROUP_ALREADY_EXISTS" + // FABRICESERVICEGROUPDOESNOTEXIST ... + FABRICESERVICEGROUPDOESNOTEXIST Code = "FABRIC_E_SERVICE_GROUP_DOES_NOT_EXIST" + // FABRICESERVICEMANIFESTNOTFOUND ... + FABRICESERVICEMANIFESTNOTFOUND Code = "FABRIC_E_SERVICE_MANIFEST_NOT_FOUND" + // FABRICESERVICEMETADATAMISMATCH ... + FABRICESERVICEMETADATAMISMATCH Code = "FABRIC_E_SERVICE_METADATA_MISMATCH" + // FABRICESERVICEOFFLINE ... + FABRICESERVICEOFFLINE Code = "FABRIC_E_SERVICE_OFFLINE" + // FABRICESERVICETYPEMISMATCH ... + FABRICESERVICETYPEMISMATCH Code = "FABRIC_E_SERVICE_TYPE_MISMATCH" + // FABRICESERVICETYPENOTFOUND ... + FABRICESERVICETYPENOTFOUND Code = "FABRIC_E_SERVICE_TYPE_NOT_FOUND" + // FABRICESERVICETYPETEMPLATENOTFOUND ... + FABRICESERVICETYPETEMPLATENOTFOUND Code = "FABRIC_E_SERVICE_TYPE_TEMPLATE_NOT_FOUND" + // FABRICETIMEOUT ... + FABRICETIMEOUT Code = "FABRIC_E_TIMEOUT" + // FABRICEVALUEEMPTY ... + FABRICEVALUEEMPTY Code = "FABRIC_E_VALUE_EMPTY" + // FABRICEVALUETOOLARGE ... + FABRICEVALUETOOLARGE Code = "FABRIC_E_VALUE_TOO_LARGE" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleCodeValues returns an array of possible values for the Code const type. +func PossibleCodeValues() []Code { + return []Code{EABORT, FABRICEAPPLICATIONALREADYEXISTS, FABRICEAPPLICATIONALREADYINTARGETVERSION, FABRICEAPPLICATIONNOTFOUND, FABRICEAPPLICATIONNOTUPGRADING, FABRICEAPPLICATIONTYPEALREADYEXISTS, FABRICEAPPLICATIONTYPEINUSE, FABRICEAPPLICATIONTYPENOTFOUND, FABRICEAPPLICATIONTYPEPROVISIONINPROGRESS, FABRICEAPPLICATIONUPGRADEINPROGRESS, FABRICEAPPLICATIONUPGRADEVALIDATIONERROR, FABRICECOMMUNICATIONERROR, FABRICECONFIGURATIONPARAMETERNOTFOUND, FABRICECONFIGURATIONSECTIONNOTFOUND, FABRICEDIRECTORYNOTFOUND, FABRICEENUMERATIONCOMPLETED, FABRICEFABRICALREADYINTARGETVERSION, FABRICEFABRICNOTUPGRADING, FABRICEFABRICUPGRADEINPROGRESS, FABRICEFABRICUPGRADEVALIDATIONERROR, FABRICEFABRICVERSIONALREADYEXISTS, FABRICEFABRICVERSIONINUSE, FABRICEFABRICVERSIONNOTFOUND, FABRICEFILENOTFOUND, FABRICEHEALTHENTITYNOTFOUND, FABRICEHEALTHSTALEREPORT, FABRICEIMAGEBUILDERVALIDATIONERROR, FABRICEINSTANCEIDMISMATCH, FABRICEINVALIDADDRESS, FABRICEINVALIDATOMICGROUP, FABRICEINVALIDCONFIGURATION, FABRICEINVALIDNAMEURI, FABRICEINVALIDPARTITIONKEY, FABRICEKEYNOTFOUND, FABRICEKEYTOOLARGE, FABRICENAMEALREADYEXISTS, FABRICENAMEDOESNOTEXIST, FABRICENAMENOTEMPTY, FABRICENODEHASNOTSTOPPEDYET, FABRICENODEISUP, FABRICENODENOTFOUND, FABRICENOTPRIMARY, FABRICENOTREADY, FABRICENOWRITEQUORUM, FABRICEOPERATIONNOTCOMPLETE, FABRICEPARTITIONNOTFOUND, FABRICEPATHTOOLONG, FABRICEPROPERTYCHECKFAILED, FABRICEPROPERTYDOESNOTEXIST, FABRICERECONFIGURATIONPENDING, FABRICEREPLICADOESNOTEXIST, FABRICESEQUENCENUMBERCHECKFAILED, FABRICESERVICEAFFINITYCHAINNOTSUPPORTED, FABRICESERVICEALREADYEXISTS, FABRICESERVICEDOESNOTEXIST, FABRICESERVICEGROUPALREADYEXISTS, FABRICESERVICEGROUPDOESNOTEXIST, FABRICESERVICEMANIFESTNOTFOUND, FABRICESERVICEMETADATAMISMATCH, FABRICESERVICEOFFLINE, FABRICESERVICETYPEMISMATCH, FABRICESERVICETYPENOTFOUND, FABRICESERVICETYPETEMPLATENOTFOUND, FABRICETIMEOUT, FABRICEVALUEEMPTY, FABRICEVALUETOOLARGE} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateFabricDump enumerates the values for create fabric dump. +type CreateFabricDump string + +const ( + // False ... + False CreateFabricDump = "False" + // True ... + True CreateFabricDump = "True" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleCreateFabricDumpValues returns an array of possible values for the CreateFabricDump const type. +func PossibleCreateFabricDumpValues() []CreateFabricDump { + return []CreateFabricDump{False, True} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CurrentReplicatorOperation enumerates the values for current replicator operation. +type CurrentReplicatorOperation string + +const ( + // CurrentReplicatorOperationAbort ... + CurrentReplicatorOperationAbort CurrentReplicatorOperation = "Abort" + // CurrentReplicatorOperationBuild ... + CurrentReplicatorOperationBuild CurrentReplicatorOperation = "Build" + // CurrentReplicatorOperationChangeRole ... + CurrentReplicatorOperationChangeRole CurrentReplicatorOperation = "ChangeRole" + // CurrentReplicatorOperationClose ... + CurrentReplicatorOperationClose CurrentReplicatorOperation = "Close" + // CurrentReplicatorOperationInvalid ... + CurrentReplicatorOperationInvalid CurrentReplicatorOperation = "Invalid" + // CurrentReplicatorOperationNone ... + CurrentReplicatorOperationNone CurrentReplicatorOperation = "None" + // CurrentReplicatorOperationOnDataLoss ... + CurrentReplicatorOperationOnDataLoss CurrentReplicatorOperation = "OnDataLoss" + // CurrentReplicatorOperationOpen ... + CurrentReplicatorOperationOpen CurrentReplicatorOperation = "Open" + // CurrentReplicatorOperationUpdateEpoch ... + CurrentReplicatorOperationUpdateEpoch CurrentReplicatorOperation = "UpdateEpoch" + // CurrentReplicatorOperationWaitForCatchup ... + CurrentReplicatorOperationWaitForCatchup CurrentReplicatorOperation = "WaitForCatchup" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleCurrentReplicatorOperationValues returns an array of possible values for the CurrentReplicatorOperation const type. +func PossibleCurrentReplicatorOperationValues() []CurrentReplicatorOperation { + return []CurrentReplicatorOperation{CurrentReplicatorOperationAbort, CurrentReplicatorOperationBuild, CurrentReplicatorOperationChangeRole, CurrentReplicatorOperationClose, CurrentReplicatorOperationInvalid, CurrentReplicatorOperationNone, CurrentReplicatorOperationOnDataLoss, CurrentReplicatorOperationOpen, CurrentReplicatorOperationUpdateEpoch, CurrentReplicatorOperationWaitForCatchup} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CurrentServiceOperation enumerates the values for current service operation. +type CurrentServiceOperation string + +const ( + // CurrentServiceOperationAbort ... + CurrentServiceOperationAbort CurrentServiceOperation = "Abort" + // CurrentServiceOperationChangeRole ... + CurrentServiceOperationChangeRole CurrentServiceOperation = "ChangeRole" + // CurrentServiceOperationClose ... + CurrentServiceOperationClose CurrentServiceOperation = "Close" + // CurrentServiceOperationNone ... + CurrentServiceOperationNone CurrentServiceOperation = "None" + // CurrentServiceOperationOpen ... + CurrentServiceOperationOpen CurrentServiceOperation = "Open" + // CurrentServiceOperationUnknown ... + CurrentServiceOperationUnknown CurrentServiceOperation = "Unknown" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleCurrentServiceOperationValues returns an array of possible values for the CurrentServiceOperation const type. +func PossibleCurrentServiceOperationValues() []CurrentServiceOperation { + return []CurrentServiceOperation{CurrentServiceOperationAbort, CurrentServiceOperationChangeRole, CurrentServiceOperationClose, CurrentServiceOperationNone, CurrentServiceOperationOpen, CurrentServiceOperationUnknown} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeactivationIntent enumerates the values for deactivation intent. +type DeactivationIntent string + +const ( + // Pause ... + Pause DeactivationIntent = "Pause" + // RemoveData ... + RemoveData DeactivationIntent = "RemoveData" + // Restart ... + Restart DeactivationIntent = "Restart" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleDeactivationIntentValues returns an array of possible values for the DeactivationIntent const type. +func PossibleDeactivationIntentValues() []DeactivationIntent { + return []DeactivationIntent{Pause, RemoveData, Restart} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DefaultMoveCost enumerates the values for default move cost. +type DefaultMoveCost string + +const ( + // High ... + High DefaultMoveCost = "High" + // Low ... + Low DefaultMoveCost = "Low" + // Medium ... + Medium DefaultMoveCost = "Medium" + // Zero ... + Zero DefaultMoveCost = "Zero" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleDefaultMoveCostValues returns an array of possible values for the DefaultMoveCost const type. +func PossibleDefaultMoveCostValues() []DefaultMoveCost { + return []DefaultMoveCost{High, Low, Medium, Zero} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DefaultMoveCost1 enumerates the values for default move cost 1. +type DefaultMoveCost1 string + +const ( + // DefaultMoveCost1High ... + DefaultMoveCost1High DefaultMoveCost1 = "High" + // DefaultMoveCost1Low ... + DefaultMoveCost1Low DefaultMoveCost1 = "Low" + // DefaultMoveCost1Medium ... + DefaultMoveCost1Medium DefaultMoveCost1 = "Medium" + // DefaultMoveCost1Zero ... + DefaultMoveCost1Zero DefaultMoveCost1 = "Zero" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleDefaultMoveCost1Values returns an array of possible values for the DefaultMoveCost1 const type. +func PossibleDefaultMoveCost1Values() []DefaultMoveCost1 { + return []DefaultMoveCost1{DefaultMoveCost1High, DefaultMoveCost1Low, DefaultMoveCost1Medium, DefaultMoveCost1Zero} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// FailureAction enumerates the values for failure action. +type FailureAction string + +const ( + // FailureActionInvalid ... + FailureActionInvalid FailureAction = "Invalid" + // FailureActionManual ... + FailureActionManual FailureAction = "Manual" + // FailureActionRollback ... + FailureActionRollback FailureAction = "Rollback" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleFailureActionValues returns an array of possible values for the FailureAction const type. +func PossibleFailureActionValues() []FailureAction { + return []FailureAction{FailureActionInvalid, FailureActionManual, FailureActionRollback} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// FailureAction1 enumerates the values for failure action 1. +type FailureAction1 string + +const ( + // FailureAction1Invalid ... + FailureAction1Invalid FailureAction1 = "Invalid" + // FailureAction1Manual ... + FailureAction1Manual FailureAction1 = "Manual" + // FailureAction1Rollback ... + FailureAction1Rollback FailureAction1 = "Rollback" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleFailureAction1Values returns an array of possible values for the FailureAction1 const type. +func PossibleFailureAction1Values() []FailureAction1 { + return []FailureAction1{FailureAction1Invalid, FailureAction1Manual, FailureAction1Rollback} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// FailureReason enumerates the values for failure reason. +type FailureReason string + +const ( + // HealthCheck ... + HealthCheck FailureReason = "HealthCheck" + // Interrupted ... + Interrupted FailureReason = "Interrupted" + // None ... + None FailureReason = "None" + // UpgradeDomainTimeout ... + UpgradeDomainTimeout FailureReason = "UpgradeDomainTimeout" + // UpgradeTimeout ... + UpgradeTimeout FailureReason = "UpgradeTimeout" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleFailureReasonValues returns an array of possible values for the FailureReason const type. +func PossibleFailureReasonValues() []FailureReason { + return []FailureReason{HealthCheck, Interrupted, None, UpgradeDomainTimeout, UpgradeTimeout} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// FailureReason1 enumerates the values for failure reason 1. +type FailureReason1 string + +const ( + // FailureReason1HealthCheck ... + FailureReason1HealthCheck FailureReason1 = "HealthCheck" + // FailureReason1Interrupted ... + FailureReason1Interrupted FailureReason1 = "Interrupted" + // FailureReason1None ... + FailureReason1None FailureReason1 = "None" + // FailureReason1UpgradeDomainTimeout ... + FailureReason1UpgradeDomainTimeout FailureReason1 = "UpgradeDomainTimeout" + // FailureReason1UpgradeTimeout ... + FailureReason1UpgradeTimeout FailureReason1 = "UpgradeTimeout" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleFailureReason1Values returns an array of possible values for the FailureReason1 const type. +func PossibleFailureReason1Values() []FailureReason1 { + return []FailureReason1{FailureReason1HealthCheck, FailureReason1Interrupted, FailureReason1None, FailureReason1UpgradeDomainTimeout, FailureReason1UpgradeTimeout} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// HealthState enumerates the values for health state. +type HealthState string + +const ( + // HealthStateError ... + HealthStateError HealthState = "Error" + // HealthStateInvalid ... + HealthStateInvalid HealthState = "Invalid" + // HealthStateOk ... + HealthStateOk HealthState = "Ok" + // HealthStateUnknown ... + HealthStateUnknown HealthState = "Unknown" + // HealthStateWarning ... + HealthStateWarning HealthState = "Warning" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleHealthStateValues returns an array of possible values for the HealthState const type. +func PossibleHealthStateValues() []HealthState { + return []HealthState{HealthStateError, HealthStateInvalid, HealthStateOk, HealthStateUnknown, HealthStateWarning} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// HealthState1 enumerates the values for health state 1. +type HealthState1 string + +const ( + // HealthState1Error ... + HealthState1Error HealthState1 = "Error" + // HealthState1Invalid ... + HealthState1Invalid HealthState1 = "Invalid" + // HealthState1Ok ... + HealthState1Ok HealthState1 = "Ok" + // HealthState1Unknown ... + HealthState1Unknown HealthState1 = "Unknown" + // HealthState1Warning ... + HealthState1Warning HealthState1 = "Warning" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleHealthState1Values returns an array of possible values for the HealthState1 const type. +func PossibleHealthState1Values() []HealthState1 { + return []HealthState1{HealthState1Error, HealthState1Invalid, HealthState1Ok, HealthState1Unknown, HealthState1Warning} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// HealthState2 enumerates the values for health state 2. +type HealthState2 string + +const ( + // HealthState2Error ... + HealthState2Error HealthState2 = "Error" + // HealthState2Invalid ... + HealthState2Invalid HealthState2 = "Invalid" + // HealthState2Ok ... + HealthState2Ok HealthState2 = "Ok" + // HealthState2Unknown ... + HealthState2Unknown HealthState2 = "Unknown" + // HealthState2Warning ... + HealthState2Warning HealthState2 = "Warning" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleHealthState2Values returns an array of possible values for the HealthState2 const type. +func PossibleHealthState2Values() []HealthState2 { + return []HealthState2{HealthState2Error, HealthState2Invalid, HealthState2Ok, HealthState2Unknown, HealthState2Warning} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// HealthState3 enumerates the values for health state 3. +type HealthState3 string + +const ( + // HealthState3Error ... + HealthState3Error HealthState3 = "Error" + // HealthState3Invalid ... + HealthState3Invalid HealthState3 = "Invalid" + // HealthState3Ok ... + HealthState3Ok HealthState3 = "Ok" + // HealthState3Unknown ... + HealthState3Unknown HealthState3 = "Unknown" + // HealthState3Warning ... + HealthState3Warning HealthState3 = "Warning" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleHealthState3Values returns an array of possible values for the HealthState3 const type. +func PossibleHealthState3Values() []HealthState3 { + return []HealthState3{HealthState3Error, HealthState3Invalid, HealthState3Ok, HealthState3Unknown, HealthState3Warning} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// HealthState4 enumerates the values for health state 4. +type HealthState4 string + +const ( + // HealthState4Error ... + HealthState4Error HealthState4 = "Error" + // HealthState4Invalid ... + HealthState4Invalid HealthState4 = "Invalid" + // HealthState4Ok ... + HealthState4Ok HealthState4 = "Ok" + // HealthState4Unknown ... + HealthState4Unknown HealthState4 = "Unknown" + // HealthState4Warning ... + HealthState4Warning HealthState4 = "Warning" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleHealthState4Values returns an array of possible values for the HealthState4 const type. +func PossibleHealthState4Values() []HealthState4 { + return []HealthState4{HealthState4Error, HealthState4Invalid, HealthState4Ok, HealthState4Unknown, HealthState4Warning} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// HealthState5 enumerates the values for health state 5. +type HealthState5 string + +const ( + // HealthState5Error ... + HealthState5Error HealthState5 = "Error" + // HealthState5Invalid ... + HealthState5Invalid HealthState5 = "Invalid" + // HealthState5Ok ... + HealthState5Ok HealthState5 = "Ok" + // HealthState5Unknown ... + HealthState5Unknown HealthState5 = "Unknown" + // HealthState5Warning ... + HealthState5Warning HealthState5 = "Warning" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleHealthState5Values returns an array of possible values for the HealthState5 const type. +func PossibleHealthState5Values() []HealthState5 { + return []HealthState5{HealthState5Error, HealthState5Invalid, HealthState5Ok, HealthState5Unknown, HealthState5Warning} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// HealthState6 enumerates the values for health state 6. +type HealthState6 string + +const ( + // HealthState6Error ... + HealthState6Error HealthState6 = "Error" + // HealthState6Invalid ... + HealthState6Invalid HealthState6 = "Invalid" + // HealthState6Ok ... + HealthState6Ok HealthState6 = "Ok" + // HealthState6Unknown ... + HealthState6Unknown HealthState6 = "Unknown" + // HealthState6Warning ... + HealthState6Warning HealthState6 = "Warning" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleHealthState6Values returns an array of possible values for the HealthState6 const type. +func PossibleHealthState6Values() []HealthState6 { + return []HealthState6{HealthState6Error, HealthState6Invalid, HealthState6Ok, HealthState6Unknown, HealthState6Warning} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// HealthState7 enumerates the values for health state 7. +type HealthState7 string + +const ( + // HealthState7Error ... + HealthState7Error HealthState7 = "Error" + // HealthState7Invalid ... + HealthState7Invalid HealthState7 = "Invalid" + // HealthState7Ok ... + HealthState7Ok HealthState7 = "Ok" + // HealthState7Unknown ... + HealthState7Unknown HealthState7 = "Unknown" + // HealthState7Warning ... + HealthState7Warning HealthState7 = "Warning" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleHealthState7Values returns an array of possible values for the HealthState7 const type. +func PossibleHealthState7Values() []HealthState7 { + return []HealthState7{HealthState7Error, HealthState7Invalid, HealthState7Ok, HealthState7Unknown, HealthState7Warning} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// HostIsolationMode enumerates the values for host isolation mode. +type HostIsolationMode string + +const ( + // HostIsolationModeHyperV ... + HostIsolationModeHyperV HostIsolationMode = "HyperV" + // HostIsolationModeNone ... + HostIsolationModeNone HostIsolationMode = "None" + // HostIsolationModeProcess ... + HostIsolationModeProcess HostIsolationMode = "Process" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleHostIsolationModeValues returns an array of possible values for the HostIsolationMode const type. +func PossibleHostIsolationModeValues() []HostIsolationMode { + return []HostIsolationMode{HostIsolationModeHyperV, HostIsolationModeNone, HostIsolationModeProcess} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// HostType enumerates the values for host type. +type HostType string + +const ( + // HostTypeContainerHost ... + HostTypeContainerHost HostType = "ContainerHost" + // HostTypeExeHost ... + HostTypeExeHost HostType = "ExeHost" + // HostTypeInvalid ... + HostTypeInvalid HostType = "Invalid" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleHostTypeValues returns an array of possible values for the HostType const type. +func PossibleHostTypeValues() []HostType { + return []HostType{HostTypeContainerHost, HostTypeExeHost, HostTypeInvalid} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindInvalid ... + KindInvalid Kind = "Invalid" + // KindStatefulPrimary ... + KindStatefulPrimary Kind = "StatefulPrimary" + // KindStatefulSecondary ... + KindStatefulSecondary Kind = "StatefulSecondary" + // KindStateless ... + KindStateless Kind = "Stateless" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindInvalid, KindStatefulPrimary, KindStatefulSecondary, KindStateless} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// KindBasicChaosEvent enumerates the values for kind basic chaos event. +type KindBasicChaosEvent string + +const ( + // KindChaosEvent ... + KindChaosEvent KindBasicChaosEvent = "ChaosEvent" + // KindExecutingFaults ... + KindExecutingFaults KindBasicChaosEvent = "ExecutingFaults" + // KindStarted ... + KindStarted KindBasicChaosEvent = "Started" + // KindStopped ... + KindStopped KindBasicChaosEvent = "Stopped" + // KindTestError ... + KindTestError KindBasicChaosEvent = "TestError" + // KindValidationFailed ... + KindValidationFailed KindBasicChaosEvent = "ValidationFailed" + // KindWaiting ... + KindWaiting KindBasicChaosEvent = "Waiting" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleKindBasicChaosEventValues returns an array of possible values for the KindBasicChaosEvent const type. +func PossibleKindBasicChaosEventValues() []KindBasicChaosEvent { + return []KindBasicChaosEvent{KindChaosEvent, KindExecutingFaults, KindStarted, KindStopped, KindTestError, KindValidationFailed, KindWaiting} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// KindBasicHealthEvaluation enumerates the values for kind basic health evaluation. +type KindBasicHealthEvaluation string + +const ( + // KindApplication ... + KindApplication KindBasicHealthEvaluation = "Application" + // KindApplications ... + KindApplications KindBasicHealthEvaluation = "Applications" + // KindApplicationTypeApplications ... + KindApplicationTypeApplications KindBasicHealthEvaluation = "ApplicationTypeApplications" + // KindDeltaNodesCheck ... + KindDeltaNodesCheck KindBasicHealthEvaluation = "DeltaNodesCheck" + // KindDeployedApplication ... + KindDeployedApplication KindBasicHealthEvaluation = "DeployedApplication" + // KindDeployedApplications ... + KindDeployedApplications KindBasicHealthEvaluation = "DeployedApplications" + // KindDeployedServicePackage ... + KindDeployedServicePackage KindBasicHealthEvaluation = "DeployedServicePackage" + // KindDeployedServicePackages ... + KindDeployedServicePackages KindBasicHealthEvaluation = "DeployedServicePackages" + // KindEvent ... + KindEvent KindBasicHealthEvaluation = "Event" + // KindHealthEvaluation ... + KindHealthEvaluation KindBasicHealthEvaluation = "HealthEvaluation" + // KindNode ... + KindNode KindBasicHealthEvaluation = "Node" + // KindNodes ... + KindNodes KindBasicHealthEvaluation = "Nodes" + // KindPartition ... + KindPartition KindBasicHealthEvaluation = "Partition" + // KindPartitions ... + KindPartitions KindBasicHealthEvaluation = "Partitions" + // KindReplica ... + KindReplica KindBasicHealthEvaluation = "Replica" + // KindReplicas ... + KindReplicas KindBasicHealthEvaluation = "Replicas" + // KindService ... + KindService KindBasicHealthEvaluation = "Service" + // KindServices ... + KindServices KindBasicHealthEvaluation = "Services" + // KindSystemApplication ... + KindSystemApplication KindBasicHealthEvaluation = "SystemApplication" + // KindUpgradeDomainDeltaNodesCheck ... + KindUpgradeDomainDeltaNodesCheck KindBasicHealthEvaluation = "UpgradeDomainDeltaNodesCheck" + // KindUpgradeDomainNodes ... + KindUpgradeDomainNodes KindBasicHealthEvaluation = "UpgradeDomainNodes" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleKindBasicHealthEvaluationValues returns an array of possible values for the KindBasicHealthEvaluation const type. +func PossibleKindBasicHealthEvaluationValues() []KindBasicHealthEvaluation { + return []KindBasicHealthEvaluation{KindApplication, KindApplications, KindApplicationTypeApplications, KindDeltaNodesCheck, KindDeployedApplication, KindDeployedApplications, KindDeployedServicePackage, KindDeployedServicePackages, KindEvent, KindHealthEvaluation, KindNode, KindNodes, KindPartition, KindPartitions, KindReplica, KindReplicas, KindService, KindServices, KindSystemApplication, KindUpgradeDomainDeltaNodesCheck, KindUpgradeDomainNodes} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// KindBasicReplicaStatusBase enumerates the values for kind basic replica status base. +type KindBasicReplicaStatusBase string + +const ( + // KindKeyValueStore ... + KindKeyValueStore KindBasicReplicaStatusBase = "KeyValueStore" + // KindReplicaStatusBase ... + KindReplicaStatusBase KindBasicReplicaStatusBase = "ReplicaStatusBase" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleKindBasicReplicaStatusBaseValues returns an array of possible values for the KindBasicReplicaStatusBase const type. +func PossibleKindBasicReplicaStatusBaseValues() []KindBasicReplicaStatusBase { + return []KindBasicReplicaStatusBase{KindKeyValueStore, KindReplicaStatusBase} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// KindBasicReplicatorStatus enumerates the values for kind basic replicator status. +type KindBasicReplicatorStatus string + +const ( + // KindActiveSecondary ... + KindActiveSecondary KindBasicReplicatorStatus = "ActiveSecondary" + // KindIdleSecondary ... + KindIdleSecondary KindBasicReplicatorStatus = "IdleSecondary" + // KindPrimary ... + KindPrimary KindBasicReplicatorStatus = "Primary" + // KindReplicatorStatus ... + KindReplicatorStatus KindBasicReplicatorStatus = "ReplicatorStatus" + // KindSecondaryReplicatorStatus ... + KindSecondaryReplicatorStatus KindBasicReplicatorStatus = "SecondaryReplicatorStatus" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleKindBasicReplicatorStatusValues returns an array of possible values for the KindBasicReplicatorStatus const type. +func PossibleKindBasicReplicatorStatusValues() []KindBasicReplicatorStatus { + return []KindBasicReplicatorStatus{KindActiveSecondary, KindIdleSecondary, KindPrimary, KindReplicatorStatus, KindSecondaryReplicatorStatus} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// KindBasicSafetyCheck enumerates the values for kind basic safety check. +type KindBasicSafetyCheck string + +const ( + // KindEnsureAvailability ... + KindEnsureAvailability KindBasicSafetyCheck = "EnsureAvailability" + // KindEnsurePartitionQuorum ... + KindEnsurePartitionQuorum KindBasicSafetyCheck = "EnsurePartitionQuorum" + // KindEnsureSeedNodeQuorum ... + KindEnsureSeedNodeQuorum KindBasicSafetyCheck = "EnsureSeedNodeQuorum" + // KindPartitionSafetyCheck ... + KindPartitionSafetyCheck KindBasicSafetyCheck = "PartitionSafetyCheck" + // KindSafetyCheck ... + KindSafetyCheck KindBasicSafetyCheck = "SafetyCheck" + // KindWaitForInbuildReplica ... + KindWaitForInbuildReplica KindBasicSafetyCheck = "WaitForInbuildReplica" + // KindWaitForPrimaryPlacement ... + KindWaitForPrimaryPlacement KindBasicSafetyCheck = "WaitForPrimaryPlacement" + // KindWaitForPrimarySwap ... + KindWaitForPrimarySwap KindBasicSafetyCheck = "WaitForPrimarySwap" + // KindWaitForReconfiguration ... + KindWaitForReconfiguration KindBasicSafetyCheck = "WaitForReconfiguration" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleKindBasicSafetyCheckValues returns an array of possible values for the KindBasicSafetyCheck const type. +func PossibleKindBasicSafetyCheckValues() []KindBasicSafetyCheck { + return []KindBasicSafetyCheck{KindEnsureAvailability, KindEnsurePartitionQuorum, KindEnsureSeedNodeQuorum, KindPartitionSafetyCheck, KindSafetyCheck, KindWaitForInbuildReplica, KindWaitForPrimaryPlacement, KindWaitForPrimarySwap, KindWaitForReconfiguration} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// KindBasicServiceTypeDescription enumerates the values for kind basic service type description. +type KindBasicServiceTypeDescription string + +const ( + // KindServiceTypeDescription ... + KindServiceTypeDescription KindBasicServiceTypeDescription = "ServiceTypeDescription" + // KindStateful ... + KindStateful KindBasicServiceTypeDescription = "Stateful" + // KindStateless1 ... + KindStateless1 KindBasicServiceTypeDescription = "Stateless" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleKindBasicServiceTypeDescriptionValues returns an array of possible values for the KindBasicServiceTypeDescription const type. +func PossibleKindBasicServiceTypeDescriptionValues() []KindBasicServiceTypeDescription { + return []KindBasicServiceTypeDescription{KindServiceTypeDescription, KindStateful, KindStateless1} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeDeactivationIntent enumerates the values for node deactivation intent. +type NodeDeactivationIntent string + +const ( + // NodeDeactivationIntentInvalid ... + NodeDeactivationIntentInvalid NodeDeactivationIntent = "Invalid" + // NodeDeactivationIntentPause ... + NodeDeactivationIntentPause NodeDeactivationIntent = "Pause" + // NodeDeactivationIntentRemoveData ... + NodeDeactivationIntentRemoveData NodeDeactivationIntent = "RemoveData" + // NodeDeactivationIntentRemoveNode ... + NodeDeactivationIntentRemoveNode NodeDeactivationIntent = "RemoveNode" + // NodeDeactivationIntentRestart ... + NodeDeactivationIntentRestart NodeDeactivationIntent = "Restart" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleNodeDeactivationIntentValues returns an array of possible values for the NodeDeactivationIntent const type. +func PossibleNodeDeactivationIntentValues() []NodeDeactivationIntent { + return []NodeDeactivationIntent{NodeDeactivationIntentInvalid, NodeDeactivationIntentPause, NodeDeactivationIntentRemoveData, NodeDeactivationIntentRemoveNode, NodeDeactivationIntentRestart} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeDeactivationIntent1 enumerates the values for node deactivation intent 1. +type NodeDeactivationIntent1 string + +const ( + // NodeDeactivationIntent1Invalid ... + NodeDeactivationIntent1Invalid NodeDeactivationIntent1 = "Invalid" + // NodeDeactivationIntent1Pause ... + NodeDeactivationIntent1Pause NodeDeactivationIntent1 = "Pause" + // NodeDeactivationIntent1RemoveData ... + NodeDeactivationIntent1RemoveData NodeDeactivationIntent1 = "RemoveData" + // NodeDeactivationIntent1RemoveNode ... + NodeDeactivationIntent1RemoveNode NodeDeactivationIntent1 = "RemoveNode" + // NodeDeactivationIntent1Restart ... + NodeDeactivationIntent1Restart NodeDeactivationIntent1 = "Restart" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleNodeDeactivationIntent1Values returns an array of possible values for the NodeDeactivationIntent1 const type. +func PossibleNodeDeactivationIntent1Values() []NodeDeactivationIntent1 { + return []NodeDeactivationIntent1{NodeDeactivationIntent1Invalid, NodeDeactivationIntent1Pause, NodeDeactivationIntent1RemoveData, NodeDeactivationIntent1RemoveNode, NodeDeactivationIntent1Restart} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeDeactivationStatus enumerates the values for node deactivation status. +type NodeDeactivationStatus string + +const ( + // NodeDeactivationStatusCompleted ... + NodeDeactivationStatusCompleted NodeDeactivationStatus = "Completed" + // NodeDeactivationStatusNone ... + NodeDeactivationStatusNone NodeDeactivationStatus = "None" + // NodeDeactivationStatusSafetyCheckComplete ... + NodeDeactivationStatusSafetyCheckComplete NodeDeactivationStatus = "SafetyCheckComplete" + // NodeDeactivationStatusSafetyCheckInProgress ... + NodeDeactivationStatusSafetyCheckInProgress NodeDeactivationStatus = "SafetyCheckInProgress" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleNodeDeactivationStatusValues returns an array of possible values for the NodeDeactivationStatus const type. +func PossibleNodeDeactivationStatusValues() []NodeDeactivationStatus { + return []NodeDeactivationStatus{NodeDeactivationStatusCompleted, NodeDeactivationStatusNone, NodeDeactivationStatusSafetyCheckComplete, NodeDeactivationStatusSafetyCheckInProgress} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeDeactivationTaskType enumerates the values for node deactivation task type. +type NodeDeactivationTaskType string + +const ( + // NodeDeactivationTaskTypeClient ... + NodeDeactivationTaskTypeClient NodeDeactivationTaskType = "Client" + // NodeDeactivationTaskTypeInfrastructure ... + NodeDeactivationTaskTypeInfrastructure NodeDeactivationTaskType = "Infrastructure" + // NodeDeactivationTaskTypeInvalid ... + NodeDeactivationTaskTypeInvalid NodeDeactivationTaskType = "Invalid" + // NodeDeactivationTaskTypeRepair ... + NodeDeactivationTaskTypeRepair NodeDeactivationTaskType = "Repair" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleNodeDeactivationTaskTypeValues returns an array of possible values for the NodeDeactivationTaskType const type. +func PossibleNodeDeactivationTaskTypeValues() []NodeDeactivationTaskType { + return []NodeDeactivationTaskType{NodeDeactivationTaskTypeClient, NodeDeactivationTaskTypeInfrastructure, NodeDeactivationTaskTypeInvalid, NodeDeactivationTaskTypeRepair} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeStatus enumerates the values for node status. +type NodeStatus string + +const ( + // NodeStatusDisabled ... + NodeStatusDisabled NodeStatus = "Disabled" + // NodeStatusDisabling ... + NodeStatusDisabling NodeStatus = "Disabling" + // NodeStatusDown ... + NodeStatusDown NodeStatus = "Down" + // NodeStatusEnabling ... + NodeStatusEnabling NodeStatus = "Enabling" + // NodeStatusInvalid ... + NodeStatusInvalid NodeStatus = "Invalid" + // NodeStatusRemoved ... + NodeStatusRemoved NodeStatus = "Removed" + // NodeStatusUnknown ... + NodeStatusUnknown NodeStatus = "Unknown" + // NodeStatusUp ... + NodeStatusUp NodeStatus = "Up" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleNodeStatusValues returns an array of possible values for the NodeStatus const type. +func PossibleNodeStatusValues() []NodeStatus { + return []NodeStatus{NodeStatusDisabled, NodeStatusDisabling, NodeStatusDown, NodeStatusEnabling, NodeStatusInvalid, NodeStatusRemoved, NodeStatusUnknown, NodeStatusUp} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PackageSharingScope enumerates the values for package sharing scope. +type PackageSharingScope string + +const ( + // PackageSharingScopeAll ... + PackageSharingScopeAll PackageSharingScope = "All" + // PackageSharingScopeCode ... + PackageSharingScopeCode PackageSharingScope = "Code" + // PackageSharingScopeConfig ... + PackageSharingScopeConfig PackageSharingScope = "Config" + // PackageSharingScopeData ... + PackageSharingScopeData PackageSharingScope = "Data" + // PackageSharingScopeNone ... + PackageSharingScopeNone PackageSharingScope = "None" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossiblePackageSharingScopeValues returns an array of possible values for the PackageSharingScope const type. +func PossiblePackageSharingScopeValues() []PackageSharingScope { + return []PackageSharingScope{PackageSharingScopeAll, PackageSharingScopeCode, PackageSharingScopeConfig, PackageSharingScopeData, PackageSharingScopeNone} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionScheme enumerates the values for partition scheme. +type PartitionScheme string + +const ( + // PartitionSchemeNamed ... + PartitionSchemeNamed PartitionScheme = "Named" + // PartitionSchemePartitionSchemeDescription ... + PartitionSchemePartitionSchemeDescription PartitionScheme = "PartitionSchemeDescription" + // PartitionSchemeSingleton ... + PartitionSchemeSingleton PartitionScheme = "Singleton" + // PartitionSchemeUniformInt64Range ... + PartitionSchemeUniformInt64Range PartitionScheme = "UniformInt64Range" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossiblePartitionSchemeValues returns an array of possible values for the PartitionScheme const type. +func PossiblePartitionSchemeValues() []PartitionScheme { + return []PartitionScheme{PartitionSchemeNamed, PartitionSchemePartitionSchemeDescription, PartitionSchemeSingleton, PartitionSchemeUniformInt64Range} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionStatus enumerates the values for partition status. +type PartitionStatus string + +const ( + // PartitionStatusDeleting ... + PartitionStatusDeleting PartitionStatus = "Deleting" + // PartitionStatusInQuorumLoss ... + PartitionStatusInQuorumLoss PartitionStatus = "InQuorumLoss" + // PartitionStatusInvalid ... + PartitionStatusInvalid PartitionStatus = "Invalid" + // PartitionStatusNotReady ... + PartitionStatusNotReady PartitionStatus = "NotReady" + // PartitionStatusReady ... + PartitionStatusReady PartitionStatus = "Ready" + // PartitionStatusReconfiguring ... + PartitionStatusReconfiguring PartitionStatus = "Reconfiguring" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossiblePartitionStatusValues returns an array of possible values for the PartitionStatus const type. +func PossiblePartitionStatusValues() []PartitionStatus { + return []PartitionStatus{PartitionStatusDeleting, PartitionStatusInQuorumLoss, PartitionStatusInvalid, PartitionStatusNotReady, PartitionStatusReady, PartitionStatusReconfiguring} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReadStatus enumerates the values for read status. +type ReadStatus string + +const ( + // ReadStatusGranted ... + ReadStatusGranted ReadStatus = "Granted" + // ReadStatusInvalid ... + ReadStatusInvalid ReadStatus = "Invalid" + // ReadStatusNotPrimary ... + ReadStatusNotPrimary ReadStatus = "NotPrimary" + // ReadStatusNoWriteQuorum ... + ReadStatusNoWriteQuorum ReadStatus = "NoWriteQuorum" + // ReadStatusReconfigurationPending ... + ReadStatusReconfigurationPending ReadStatus = "ReconfigurationPending" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleReadStatusValues returns an array of possible values for the ReadStatus const type. +func PossibleReadStatusValues() []ReadStatus { + return []ReadStatus{ReadStatusGranted, ReadStatusInvalid, ReadStatusNotPrimary, ReadStatusNoWriteQuorum, ReadStatusReconfigurationPending} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicaRole enumerates the values for replica role. +type ReplicaRole string + +const ( + // ReplicaRoleActiveSecondary ... + ReplicaRoleActiveSecondary ReplicaRole = "ActiveSecondary" + // ReplicaRoleIdleSecondary ... + ReplicaRoleIdleSecondary ReplicaRole = "IdleSecondary" + // ReplicaRoleNone ... + ReplicaRoleNone ReplicaRole = "None" + // ReplicaRolePrimary ... + ReplicaRolePrimary ReplicaRole = "Primary" + // ReplicaRoleUnknown ... + ReplicaRoleUnknown ReplicaRole = "Unknown" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleReplicaRoleValues returns an array of possible values for the ReplicaRole const type. +func PossibleReplicaRoleValues() []ReplicaRole { + return []ReplicaRole{ReplicaRoleActiveSecondary, ReplicaRoleIdleSecondary, ReplicaRoleNone, ReplicaRolePrimary, ReplicaRoleUnknown} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicaRole1 enumerates the values for replica role 1. +type ReplicaRole1 string + +const ( + // ReplicaRole1ActiveSecondary ... + ReplicaRole1ActiveSecondary ReplicaRole1 = "ActiveSecondary" + // ReplicaRole1IdleSecondary ... + ReplicaRole1IdleSecondary ReplicaRole1 = "IdleSecondary" + // ReplicaRole1None ... + ReplicaRole1None ReplicaRole1 = "None" + // ReplicaRole1Primary ... + ReplicaRole1Primary ReplicaRole1 = "Primary" + // ReplicaRole1Unknown ... + ReplicaRole1Unknown ReplicaRole1 = "Unknown" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleReplicaRole1Values returns an array of possible values for the ReplicaRole1 const type. +func PossibleReplicaRole1Values() []ReplicaRole1 { + return []ReplicaRole1{ReplicaRole1ActiveSecondary, ReplicaRole1IdleSecondary, ReplicaRole1None, ReplicaRole1Primary, ReplicaRole1Unknown} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicaStatus enumerates the values for replica status. +type ReplicaStatus string + +const ( + // ReplicaStatusDown ... + ReplicaStatusDown ReplicaStatus = "Down" + // ReplicaStatusDropped ... + ReplicaStatusDropped ReplicaStatus = "Dropped" + // ReplicaStatusInBuild ... + ReplicaStatusInBuild ReplicaStatus = "InBuild" + // ReplicaStatusInvalid ... + ReplicaStatusInvalid ReplicaStatus = "Invalid" + // ReplicaStatusReady ... + ReplicaStatusReady ReplicaStatus = "Ready" + // ReplicaStatusStandby ... + ReplicaStatusStandby ReplicaStatus = "Standby" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleReplicaStatusValues returns an array of possible values for the ReplicaStatus const type. +func PossibleReplicaStatusValues() []ReplicaStatus { + return []ReplicaStatus{ReplicaStatusDown, ReplicaStatusDropped, ReplicaStatusInBuild, ReplicaStatusInvalid, ReplicaStatusReady, ReplicaStatusStandby} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicaStatus1 enumerates the values for replica status 1. +type ReplicaStatus1 string + +const ( + // ReplicaStatus1Down ... + ReplicaStatus1Down ReplicaStatus1 = "Down" + // ReplicaStatus1Dropped ... + ReplicaStatus1Dropped ReplicaStatus1 = "Dropped" + // ReplicaStatus1InBuild ... + ReplicaStatus1InBuild ReplicaStatus1 = "InBuild" + // ReplicaStatus1Invalid ... + ReplicaStatus1Invalid ReplicaStatus1 = "Invalid" + // ReplicaStatus1Ready ... + ReplicaStatus1Ready ReplicaStatus1 = "Ready" + // ReplicaStatus1Standby ... + ReplicaStatus1Standby ReplicaStatus1 = "Standby" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleReplicaStatus1Values returns an array of possible values for the ReplicaStatus1 const type. +func PossibleReplicaStatus1Values() []ReplicaStatus1 { + return []ReplicaStatus1{ReplicaStatus1Down, ReplicaStatus1Dropped, ReplicaStatus1InBuild, ReplicaStatus1Invalid, ReplicaStatus1Ready, ReplicaStatus1Standby} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RollingUpgradeMode enumerates the values for rolling upgrade mode. +type RollingUpgradeMode string + +const ( + // RollingUpgradeModeInvalid ... + RollingUpgradeModeInvalid RollingUpgradeMode = "Invalid" + // RollingUpgradeModeMonitored ... + RollingUpgradeModeMonitored RollingUpgradeMode = "Monitored" + // RollingUpgradeModeUnmonitoredAuto ... + RollingUpgradeModeUnmonitoredAuto RollingUpgradeMode = "UnmonitoredAuto" + // RollingUpgradeModeUnmonitoredManual ... + RollingUpgradeModeUnmonitoredManual RollingUpgradeMode = "UnmonitoredManual" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleRollingUpgradeModeValues returns an array of possible values for the RollingUpgradeMode const type. +func PossibleRollingUpgradeModeValues() []RollingUpgradeMode { + return []RollingUpgradeMode{RollingUpgradeModeInvalid, RollingUpgradeModeMonitored, RollingUpgradeModeUnmonitoredAuto, RollingUpgradeModeUnmonitoredManual} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RollingUpgradeMode1 enumerates the values for rolling upgrade mode 1. +type RollingUpgradeMode1 string + +const ( + // RollingUpgradeMode1Invalid ... + RollingUpgradeMode1Invalid RollingUpgradeMode1 = "Invalid" + // RollingUpgradeMode1Monitored ... + RollingUpgradeMode1Monitored RollingUpgradeMode1 = "Monitored" + // RollingUpgradeMode1UnmonitoredAuto ... + RollingUpgradeMode1UnmonitoredAuto RollingUpgradeMode1 = "UnmonitoredAuto" + // RollingUpgradeMode1UnmonitoredManual ... + RollingUpgradeMode1UnmonitoredManual RollingUpgradeMode1 = "UnmonitoredManual" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleRollingUpgradeMode1Values returns an array of possible values for the RollingUpgradeMode1 const type. +func PossibleRollingUpgradeMode1Values() []RollingUpgradeMode1 { + return []RollingUpgradeMode1{RollingUpgradeMode1Invalid, RollingUpgradeMode1Monitored, RollingUpgradeMode1UnmonitoredAuto, RollingUpgradeMode1UnmonitoredManual} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RollingUpgradeMode2 enumerates the values for rolling upgrade mode 2. +type RollingUpgradeMode2 string + +const ( + // RollingUpgradeMode2Invalid ... + RollingUpgradeMode2Invalid RollingUpgradeMode2 = "Invalid" + // RollingUpgradeMode2Monitored ... + RollingUpgradeMode2Monitored RollingUpgradeMode2 = "Monitored" + // RollingUpgradeMode2UnmonitoredAuto ... + RollingUpgradeMode2UnmonitoredAuto RollingUpgradeMode2 = "UnmonitoredAuto" + // RollingUpgradeMode2UnmonitoredManual ... + RollingUpgradeMode2UnmonitoredManual RollingUpgradeMode2 = "UnmonitoredManual" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleRollingUpgradeMode2Values returns an array of possible values for the RollingUpgradeMode2 const type. +func PossibleRollingUpgradeMode2Values() []RollingUpgradeMode2 { + return []RollingUpgradeMode2{RollingUpgradeMode2Invalid, RollingUpgradeMode2Monitored, RollingUpgradeMode2UnmonitoredAuto, RollingUpgradeMode2UnmonitoredManual} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RollingUpgradeMode3 enumerates the values for rolling upgrade mode 3. +type RollingUpgradeMode3 string + +const ( + // RollingUpgradeMode3Invalid ... + RollingUpgradeMode3Invalid RollingUpgradeMode3 = "Invalid" + // RollingUpgradeMode3Monitored ... + RollingUpgradeMode3Monitored RollingUpgradeMode3 = "Monitored" + // RollingUpgradeMode3UnmonitoredAuto ... + RollingUpgradeMode3UnmonitoredAuto RollingUpgradeMode3 = "UnmonitoredAuto" + // RollingUpgradeMode3UnmonitoredManual ... + RollingUpgradeMode3UnmonitoredManual RollingUpgradeMode3 = "UnmonitoredManual" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleRollingUpgradeMode3Values returns an array of possible values for the RollingUpgradeMode3 const type. +func PossibleRollingUpgradeMode3Values() []RollingUpgradeMode3 { + return []RollingUpgradeMode3{RollingUpgradeMode3Invalid, RollingUpgradeMode3Monitored, RollingUpgradeMode3UnmonitoredAuto, RollingUpgradeMode3UnmonitoredManual} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RollingUpgradeMode4 enumerates the values for rolling upgrade mode 4. +type RollingUpgradeMode4 string + +const ( + // RollingUpgradeMode4Invalid ... + RollingUpgradeMode4Invalid RollingUpgradeMode4 = "Invalid" + // RollingUpgradeMode4Monitored ... + RollingUpgradeMode4Monitored RollingUpgradeMode4 = "Monitored" + // RollingUpgradeMode4UnmonitoredAuto ... + RollingUpgradeMode4UnmonitoredAuto RollingUpgradeMode4 = "UnmonitoredAuto" + // RollingUpgradeMode4UnmonitoredManual ... + RollingUpgradeMode4UnmonitoredManual RollingUpgradeMode4 = "UnmonitoredManual" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleRollingUpgradeMode4Values returns an array of possible values for the RollingUpgradeMode4 const type. +func PossibleRollingUpgradeMode4Values() []RollingUpgradeMode4 { + return []RollingUpgradeMode4{RollingUpgradeMode4Invalid, RollingUpgradeMode4Monitored, RollingUpgradeMode4UnmonitoredAuto, RollingUpgradeMode4UnmonitoredManual} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Scheme enumerates the values for scheme. +type Scheme string + +const ( + // SchemeAffinity ... + SchemeAffinity Scheme = "Affinity" + // SchemeAlignedAffinity ... + SchemeAlignedAffinity Scheme = "AlignedAffinity" + // SchemeInvalid ... + SchemeInvalid Scheme = "Invalid" + // SchemeNonAlignedAffinity ... + SchemeNonAlignedAffinity Scheme = "NonAlignedAffinity" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleSchemeValues returns an array of possible values for the Scheme const type. +func PossibleSchemeValues() []Scheme { + return []Scheme{SchemeAffinity, SchemeAlignedAffinity, SchemeInvalid, SchemeNonAlignedAffinity} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceKind enumerates the values for service kind. +type ServiceKind string + +const ( + // ServiceKindDeployedServiceReplicaInfo ... + ServiceKindDeployedServiceReplicaInfo ServiceKind = "DeployedServiceReplicaInfo" + // ServiceKindStateful ... + ServiceKindStateful ServiceKind = "Stateful" + // ServiceKindStateless ... + ServiceKindStateless ServiceKind = "Stateless" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleServiceKindValues returns an array of possible values for the ServiceKind const type. +func PossibleServiceKindValues() []ServiceKind { + return []ServiceKind{ServiceKindDeployedServiceReplicaInfo, ServiceKindStateful, ServiceKindStateless} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceKindBasicDeployedServiceReplicaDetailInfo enumerates the values for service kind basic deployed +// service replica detail info. +type ServiceKindBasicDeployedServiceReplicaDetailInfo string + +const ( + // ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindDeployedServiceReplicaDetailInfo ... + ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindDeployedServiceReplicaDetailInfo ServiceKindBasicDeployedServiceReplicaDetailInfo = "DeployedServiceReplicaDetailInfo" + // ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateful ... + ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateful ServiceKindBasicDeployedServiceReplicaDetailInfo = "Stateful" + // ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateless ... + ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateless ServiceKindBasicDeployedServiceReplicaDetailInfo = "Stateless" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleServiceKindBasicDeployedServiceReplicaDetailInfoValues returns an array of possible values for the ServiceKindBasicDeployedServiceReplicaDetailInfo const type. +func PossibleServiceKindBasicDeployedServiceReplicaDetailInfoValues() []ServiceKindBasicDeployedServiceReplicaDetailInfo { + return []ServiceKindBasicDeployedServiceReplicaDetailInfo{ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindDeployedServiceReplicaDetailInfo, ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateful, ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateless} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceKindBasicReplicaHealth enumerates the values for service kind basic replica health. +type ServiceKindBasicReplicaHealth string + +const ( + // ServiceKindBasicReplicaHealthServiceKindReplicaHealth ... + ServiceKindBasicReplicaHealthServiceKindReplicaHealth ServiceKindBasicReplicaHealth = "ReplicaHealth" + // ServiceKindBasicReplicaHealthServiceKindStateful ... + ServiceKindBasicReplicaHealthServiceKindStateful ServiceKindBasicReplicaHealth = "Stateful" + // ServiceKindBasicReplicaHealthServiceKindStateless ... + ServiceKindBasicReplicaHealthServiceKindStateless ServiceKindBasicReplicaHealth = "Stateless" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleServiceKindBasicReplicaHealthValues returns an array of possible values for the ServiceKindBasicReplicaHealth const type. +func PossibleServiceKindBasicReplicaHealthValues() []ServiceKindBasicReplicaHealth { + return []ServiceKindBasicReplicaHealth{ServiceKindBasicReplicaHealthServiceKindReplicaHealth, ServiceKindBasicReplicaHealthServiceKindStateful, ServiceKindBasicReplicaHealthServiceKindStateless} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceKindBasicReplicaHealthState enumerates the values for service kind basic replica health state. +type ServiceKindBasicReplicaHealthState string + +const ( + // ServiceKindBasicReplicaHealthStateServiceKindReplicaHealthState ... + ServiceKindBasicReplicaHealthStateServiceKindReplicaHealthState ServiceKindBasicReplicaHealthState = "ReplicaHealthState" + // ServiceKindBasicReplicaHealthStateServiceKindStateful ... + ServiceKindBasicReplicaHealthStateServiceKindStateful ServiceKindBasicReplicaHealthState = "Stateful" + // ServiceKindBasicReplicaHealthStateServiceKindStateless ... + ServiceKindBasicReplicaHealthStateServiceKindStateless ServiceKindBasicReplicaHealthState = "Stateless" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleServiceKindBasicReplicaHealthStateValues returns an array of possible values for the ServiceKindBasicReplicaHealthState const type. +func PossibleServiceKindBasicReplicaHealthStateValues() []ServiceKindBasicReplicaHealthState { + return []ServiceKindBasicReplicaHealthState{ServiceKindBasicReplicaHealthStateServiceKindReplicaHealthState, ServiceKindBasicReplicaHealthStateServiceKindStateful, ServiceKindBasicReplicaHealthStateServiceKindStateless} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceKindBasicReplicaInfo enumerates the values for service kind basic replica info. +type ServiceKindBasicReplicaInfo string + +const ( + // ServiceKindBasicReplicaInfoServiceKindReplicaInfo ... + ServiceKindBasicReplicaInfoServiceKindReplicaInfo ServiceKindBasicReplicaInfo = "ReplicaInfo" + // ServiceKindBasicReplicaInfoServiceKindStateful ... + ServiceKindBasicReplicaInfoServiceKindStateful ServiceKindBasicReplicaInfo = "Stateful" + // ServiceKindBasicReplicaInfoServiceKindStateless ... + ServiceKindBasicReplicaInfoServiceKindStateless ServiceKindBasicReplicaInfo = "Stateless" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleServiceKindBasicReplicaInfoValues returns an array of possible values for the ServiceKindBasicReplicaInfo const type. +func PossibleServiceKindBasicReplicaInfoValues() []ServiceKindBasicReplicaInfo { + return []ServiceKindBasicReplicaInfo{ServiceKindBasicReplicaInfoServiceKindReplicaInfo, ServiceKindBasicReplicaInfoServiceKindStateful, ServiceKindBasicReplicaInfoServiceKindStateless} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceKindBasicServiceDescription enumerates the values for service kind basic service description. +type ServiceKindBasicServiceDescription string + +const ( + // ServiceKindBasicServiceDescriptionServiceKindServiceDescription ... + ServiceKindBasicServiceDescriptionServiceKindServiceDescription ServiceKindBasicServiceDescription = "ServiceDescription" + // ServiceKindBasicServiceDescriptionServiceKindStateful ... + ServiceKindBasicServiceDescriptionServiceKindStateful ServiceKindBasicServiceDescription = "Stateful" + // ServiceKindBasicServiceDescriptionServiceKindStateless ... + ServiceKindBasicServiceDescriptionServiceKindStateless ServiceKindBasicServiceDescription = "Stateless" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleServiceKindBasicServiceDescriptionValues returns an array of possible values for the ServiceKindBasicServiceDescription const type. +func PossibleServiceKindBasicServiceDescriptionValues() []ServiceKindBasicServiceDescription { + return []ServiceKindBasicServiceDescription{ServiceKindBasicServiceDescriptionServiceKindServiceDescription, ServiceKindBasicServiceDescriptionServiceKindStateful, ServiceKindBasicServiceDescriptionServiceKindStateless} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceKindBasicServiceInfo enumerates the values for service kind basic service info. +type ServiceKindBasicServiceInfo string + +const ( + // ServiceKindBasicServiceInfoServiceKindServiceInfo ... + ServiceKindBasicServiceInfoServiceKindServiceInfo ServiceKindBasicServiceInfo = "ServiceInfo" + // ServiceKindBasicServiceInfoServiceKindStateful ... + ServiceKindBasicServiceInfoServiceKindStateful ServiceKindBasicServiceInfo = "Stateful" + // ServiceKindBasicServiceInfoServiceKindStateless ... + ServiceKindBasicServiceInfoServiceKindStateless ServiceKindBasicServiceInfo = "Stateless" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleServiceKindBasicServiceInfoValues returns an array of possible values for the ServiceKindBasicServiceInfo const type. +func PossibleServiceKindBasicServiceInfoValues() []ServiceKindBasicServiceInfo { + return []ServiceKindBasicServiceInfo{ServiceKindBasicServiceInfoServiceKindServiceInfo, ServiceKindBasicServiceInfoServiceKindStateful, ServiceKindBasicServiceInfoServiceKindStateless} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceKindBasicServicePartitionInfo enumerates the values for service kind basic service partition info. +type ServiceKindBasicServicePartitionInfo string + +const ( + // ServiceKindBasicServicePartitionInfoServiceKindServicePartitionInfo ... + ServiceKindBasicServicePartitionInfoServiceKindServicePartitionInfo ServiceKindBasicServicePartitionInfo = "ServicePartitionInfo" + // ServiceKindBasicServicePartitionInfoServiceKindStateful ... + ServiceKindBasicServicePartitionInfoServiceKindStateful ServiceKindBasicServicePartitionInfo = "Stateful" + // ServiceKindBasicServicePartitionInfoServiceKindStateless ... + ServiceKindBasicServicePartitionInfoServiceKindStateless ServiceKindBasicServicePartitionInfo = "Stateless" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleServiceKindBasicServicePartitionInfoValues returns an array of possible values for the ServiceKindBasicServicePartitionInfo const type. +func PossibleServiceKindBasicServicePartitionInfoValues() []ServiceKindBasicServicePartitionInfo { + return []ServiceKindBasicServicePartitionInfo{ServiceKindBasicServicePartitionInfoServiceKindServicePartitionInfo, ServiceKindBasicServicePartitionInfoServiceKindStateful, ServiceKindBasicServicePartitionInfoServiceKindStateless} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceKindBasicServiceUpdateDescription enumerates the values for service kind basic service update +// description. +type ServiceKindBasicServiceUpdateDescription string + +const ( + // ServiceKindBasicServiceUpdateDescriptionServiceKindServiceUpdateDescription ... + ServiceKindBasicServiceUpdateDescriptionServiceKindServiceUpdateDescription ServiceKindBasicServiceUpdateDescription = "ServiceUpdateDescription" + // ServiceKindBasicServiceUpdateDescriptionServiceKindStateful ... + ServiceKindBasicServiceUpdateDescriptionServiceKindStateful ServiceKindBasicServiceUpdateDescription = "Stateful" + // ServiceKindBasicServiceUpdateDescriptionServiceKindStateless ... + ServiceKindBasicServiceUpdateDescriptionServiceKindStateless ServiceKindBasicServiceUpdateDescription = "Stateless" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleServiceKindBasicServiceUpdateDescriptionValues returns an array of possible values for the ServiceKindBasicServiceUpdateDescription const type. +func PossibleServiceKindBasicServiceUpdateDescriptionValues() []ServiceKindBasicServiceUpdateDescription { + return []ServiceKindBasicServiceUpdateDescription{ServiceKindBasicServiceUpdateDescriptionServiceKindServiceUpdateDescription, ServiceKindBasicServiceUpdateDescriptionServiceKindStateful, ServiceKindBasicServiceUpdateDescriptionServiceKindStateless} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServicePackageActivationMode enumerates the values for service package activation mode. +type ServicePackageActivationMode string + +const ( + // ExclusiveProcess ... + ExclusiveProcess ServicePackageActivationMode = "ExclusiveProcess" + // SharedProcess ... + SharedProcess ServicePackageActivationMode = "SharedProcess" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleServicePackageActivationModeValues returns an array of possible values for the ServicePackageActivationMode const type. +func PossibleServicePackageActivationModeValues() []ServicePackageActivationMode { + return []ServicePackageActivationMode{ExclusiveProcess, SharedProcess} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServicePackageActivationMode1 enumerates the values for service package activation mode 1. +type ServicePackageActivationMode1 string + +const ( + // ServicePackageActivationMode1ExclusiveProcess ... + ServicePackageActivationMode1ExclusiveProcess ServicePackageActivationMode1 = "ExclusiveProcess" + // ServicePackageActivationMode1SharedProcess ... + ServicePackageActivationMode1SharedProcess ServicePackageActivationMode1 = "SharedProcess" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleServicePackageActivationMode1Values returns an array of possible values for the ServicePackageActivationMode1 const type. +func PossibleServicePackageActivationMode1Values() []ServicePackageActivationMode1 { + return []ServicePackageActivationMode1{ServicePackageActivationMode1ExclusiveProcess, ServicePackageActivationMode1SharedProcess} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServicePartitionKind enumerates the values for service partition kind. +type ServicePartitionKind string + +const ( + // ServicePartitionKindInt64Range ... + ServicePartitionKindInt64Range ServicePartitionKind = "Int64Range" + // ServicePartitionKindNamed ... + ServicePartitionKindNamed ServicePartitionKind = "Named" + // ServicePartitionKindPartitionInformation ... + ServicePartitionKindPartitionInformation ServicePartitionKind = "PartitionInformation" + // ServicePartitionKindSingleton ... + ServicePartitionKindSingleton ServicePartitionKind = "Singleton" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleServicePartitionKindValues returns an array of possible values for the ServicePartitionKind const type. +func PossibleServicePartitionKindValues() []ServicePartitionKind { + return []ServicePartitionKind{ServicePartitionKindInt64Range, ServicePartitionKindNamed, ServicePartitionKindPartitionInformation, ServicePartitionKindSingleton} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceStatus enumerates the values for service status. +type ServiceStatus string + +const ( + // ServiceStatusActive ... + ServiceStatusActive ServiceStatus = "Active" + // ServiceStatusCreating ... + ServiceStatusCreating ServiceStatus = "Creating" + // ServiceStatusDeleting ... + ServiceStatusDeleting ServiceStatus = "Deleting" + // ServiceStatusFailed ... + ServiceStatusFailed ServiceStatus = "Failed" + // ServiceStatusUnknown ... + ServiceStatusUnknown ServiceStatus = "Unknown" + // ServiceStatusUpgrading ... + ServiceStatusUpgrading ServiceStatus = "Upgrading" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleServiceStatusValues returns an array of possible values for the ServiceStatus const type. +func PossibleServiceStatusValues() []ServiceStatus { + return []ServiceStatus{ServiceStatusActive, ServiceStatusCreating, ServiceStatusDeleting, ServiceStatusFailed, ServiceStatusUnknown, ServiceStatusUpgrading} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// State enumerates the values for state. +type State string + +const ( + // StateCompleted ... + StateCompleted State = "Completed" + // StateInProgress ... + StateInProgress State = "InProgress" + // StateInvalid ... + StateInvalid State = "Invalid" + // StatePending ... + StatePending State = "Pending" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{StateCompleted, StateInProgress, StateInvalid, StatePending} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// State1 enumerates the values for state 1. +type State1 string + +const ( + // State1Cancelled ... + State1Cancelled State1 = "Cancelled" + // State1Completed ... + State1Completed State1 = "Completed" + // State1Faulted ... + State1Faulted State1 = "Faulted" + // State1ForceCancelled ... + State1ForceCancelled State1 = "ForceCancelled" + // State1Invalid ... + State1Invalid State1 = "Invalid" + // State1RollingBack ... + State1RollingBack State1 = "RollingBack" + // State1Running ... + State1Running State1 = "Running" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleState1Values returns an array of possible values for the State1 const type. +func PossibleState1Values() []State1 { + return []State1{State1Cancelled, State1Completed, State1Faulted, State1ForceCancelled, State1Invalid, State1RollingBack, State1Running} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// State2 enumerates the values for state 2. +type State2 string + +const ( + // State2Cancelled ... + State2Cancelled State2 = "Cancelled" + // State2Completed ... + State2Completed State2 = "Completed" + // State2Faulted ... + State2Faulted State2 = "Faulted" + // State2ForceCancelled ... + State2ForceCancelled State2 = "ForceCancelled" + // State2Invalid ... + State2Invalid State2 = "Invalid" + // State2RollingBack ... + State2RollingBack State2 = "RollingBack" + // State2Running ... + State2Running State2 = "Running" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleState2Values returns an array of possible values for the State2 const type. +func PossibleState2Values() []State2 { + return []State2{State2Cancelled, State2Completed, State2Faulted, State2ForceCancelled, State2Invalid, State2RollingBack, State2Running} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// State3 enumerates the values for state 3. +type State3 string + +const ( + // State3Cancelled ... + State3Cancelled State3 = "Cancelled" + // State3Completed ... + State3Completed State3 = "Completed" + // State3Faulted ... + State3Faulted State3 = "Faulted" + // State3ForceCancelled ... + State3ForceCancelled State3 = "ForceCancelled" + // State3Invalid ... + State3Invalid State3 = "Invalid" + // State3RollingBack ... + State3RollingBack State3 = "RollingBack" + // State3Running ... + State3Running State3 = "Running" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleState3Values returns an array of possible values for the State3 const type. +func PossibleState3Values() []State3 { + return []State3{State3Cancelled, State3Completed, State3Faulted, State3ForceCancelled, State3Invalid, State3RollingBack, State3Running} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// State4 enumerates the values for state 4. +type State4 string + +const ( + // State4Cancelled ... + State4Cancelled State4 = "Cancelled" + // State4Completed ... + State4Completed State4 = "Completed" + // State4Faulted ... + State4Faulted State4 = "Faulted" + // State4ForceCancelled ... + State4ForceCancelled State4 = "ForceCancelled" + // State4Invalid ... + State4Invalid State4 = "Invalid" + // State4RollingBack ... + State4RollingBack State4 = "RollingBack" + // State4Running ... + State4Running State4 = "Running" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleState4Values returns an array of possible values for the State4 const type. +func PossibleState4Values() []State4 { + return []State4{State4Cancelled, State4Completed, State4Faulted, State4ForceCancelled, State4Invalid, State4RollingBack, State4Running} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// State5 enumerates the values for state 5. +type State5 string + +const ( + // State5Cancelled ... + State5Cancelled State5 = "Cancelled" + // State5Completed ... + State5Completed State5 = "Completed" + // State5Faulted ... + State5Faulted State5 = "Faulted" + // State5ForceCancelled ... + State5ForceCancelled State5 = "ForceCancelled" + // State5Invalid ... + State5Invalid State5 = "Invalid" + // State5RollingBack ... + State5RollingBack State5 = "RollingBack" + // State5Running ... + State5Running State5 = "Running" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleState5Values returns an array of possible values for the State5 const type. +func PossibleState5Values() []State5 { + return []State5{State5Cancelled, State5Completed, State5Faulted, State5ForceCancelled, State5Invalid, State5RollingBack, State5Running} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Status enumerates the values for status. +type Status string + +const ( + // StatusCreating ... + StatusCreating Status = "Creating" + // StatusDeleting ... + StatusDeleting Status = "Deleting" + // StatusFailed ... + StatusFailed Status = "Failed" + // StatusInvalid ... + StatusInvalid Status = "Invalid" + // StatusReady ... + StatusReady Status = "Ready" + // StatusUpgrading ... + StatusUpgrading Status = "Upgrading" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleStatusValues returns an array of possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{StatusCreating, StatusDeleting, StatusFailed, StatusInvalid, StatusReady, StatusUpgrading} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Status1 enumerates the values for status 1. +type Status1 string + +const ( + // Status1Available ... + Status1Available Status1 = "Available" + // Status1Failed ... + Status1Failed Status1 = "Failed" + // Status1Invalid ... + Status1Invalid Status1 = "Invalid" + // Status1Provisioning ... + Status1Provisioning Status1 = "Provisioning" + // Status1Unprovisioning ... + Status1Unprovisioning Status1 = "Unprovisioning" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleStatus1Values returns an array of possible values for the Status1 const type. +func PossibleStatus1Values() []Status1 { + return []Status1{Status1Available, Status1Failed, Status1Invalid, Status1Provisioning, Status1Unprovisioning} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Status2 enumerates the values for status 2. +type Status2 string + +const ( + // Status2Activating ... + Status2Activating Status2 = "Activating" + // Status2Active ... + Status2Active Status2 = "Active" + // Status2Deactivating ... + Status2Deactivating Status2 = "Deactivating" + // Status2Downloading ... + Status2Downloading Status2 = "Downloading" + // Status2Invalid ... + Status2Invalid Status2 = "Invalid" + // Status2Upgrading ... + Status2Upgrading Status2 = "Upgrading" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleStatus2Values returns an array of possible values for the Status2 const type. +func PossibleStatus2Values() []Status2 { + return []Status2{Status2Activating, Status2Active, Status2Deactivating, Status2Downloading, Status2Invalid, Status2Upgrading} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Status3 enumerates the values for status 3. +type Status3 string + +const ( + // Status3Invalid ... + Status3Invalid Status3 = "Invalid" + // Status3Pending ... + Status3Pending Status3 = "Pending" + // Status3Started ... + Status3Started Status3 = "Started" + // Status3Starting ... + Status3Starting Status3 = "Starting" + // Status3Stopped ... + Status3Stopped Status3 = "Stopped" + // Status3Stopping ... + Status3Stopping Status3 = "Stopping" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleStatus3Values returns an array of possible values for the Status3 const type. +func PossibleStatus3Values() []Status3 { + return []Status3{Status3Invalid, Status3Pending, Status3Started, Status3Starting, Status3Stopped, Status3Stopping} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Status4 enumerates the values for status 4. +type Status4 string + +const ( + // Status4Activating ... + Status4Activating Status4 = "Activating" + // Status4Active ... + Status4Active Status4 = "Active" + // Status4Deactivating ... + Status4Deactivating Status4 = "Deactivating" + // Status4Downloading ... + Status4Downloading Status4 = "Downloading" + // Status4Invalid ... + Status4Invalid Status4 = "Invalid" + // Status4Upgrading ... + Status4Upgrading Status4 = "Upgrading" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleStatus4Values returns an array of possible values for the Status4 const type. +func PossibleStatus4Values() []Status4 { + return []Status4{Status4Activating, Status4Active, Status4Deactivating, Status4Downloading, Status4Invalid, Status4Upgrading} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Status5 enumerates the values for status 5. +type Status5 string + +const ( + // Status5Invalid ... + Status5Invalid Status5 = "Invalid" + // Status5Running ... + Status5Running Status5 = "Running" + // Status5Stopped ... + Status5Stopped Status5 = "Stopped" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleStatus5Values returns an array of possible values for the Status5 const type. +func PossibleStatus5Values() []Status5 { + return []Status5{Status5Invalid, Status5Running, Status5Stopped} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Status6 enumerates the values for status 6. +type Status6 string + +const ( + // Status6Created ... + Status6Created Status6 = "Created" + // Status6Creating ... + Status6Creating Status6 = "Creating" + // Status6Deleting ... + Status6Deleting Status6 = "Deleting" + // Status6Failed ... + Status6Failed Status6 = "Failed" + // Status6Invalid ... + Status6Invalid Status6 = "Invalid" + // Status6Provisioning ... + Status6Provisioning Status6 = "Provisioning" + // Status6Unprovisioning ... + Status6Unprovisioning Status6 = "Unprovisioning" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleStatus6Values returns an array of possible values for the Status6 const type. +func PossibleStatus6Values() []Status6 { + return []Status6{Status6Created, Status6Creating, Status6Deleting, Status6Failed, Status6Invalid, Status6Provisioning, Status6Unprovisioning} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Status7 enumerates the values for status 7. +type Status7 string + +const ( + // Status7Activating ... + Status7Activating Status7 = "Activating" + // Status7Active ... + Status7Active Status7 = "Active" + // Status7Deactivating ... + Status7Deactivating Status7 = "Deactivating" + // Status7Downloading ... + Status7Downloading Status7 = "Downloading" + // Status7Invalid ... + Status7Invalid Status7 = "Invalid" + // Status7Upgrading ... + Status7Upgrading Status7 = "Upgrading" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleStatus7Values returns an array of possible values for the Status7 const type. +func PossibleStatus7Values() []Status7 { + return []Status7{Status7Activating, Status7Active, Status7Deactivating, Status7Downloading, Status7Invalid, Status7Upgrading} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Status8 enumerates the values for status 8. +type Status8 string + +const ( + // Status8Disabled ... + Status8Disabled Status8 = "Disabled" + // Status8Enabled ... + Status8Enabled Status8 = "Enabled" + // Status8Invalid ... + Status8Invalid Status8 = "Invalid" + // Status8Registered ... + Status8Registered Status8 = "Registered" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleStatus8Values returns an array of possible values for the Status8 const type. +func PossibleStatus8Values() []Status8 { + return []Status8{Status8Disabled, Status8Enabled, Status8Invalid, Status8Registered} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Type enumerates the values for type. +type Type string + +const ( + // TypeInvalid ... + TypeInvalid Type = "Invalid" + // TypeNodeTransition ... + TypeNodeTransition Type = "NodeTransition" + // TypePartitionDataLoss ... + TypePartitionDataLoss Type = "PartitionDataLoss" + // TypePartitionQuorumLoss ... + TypePartitionQuorumLoss Type = "PartitionQuorumLoss" + // TypePartitionRestart ... + TypePartitionRestart Type = "PartitionRestart" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeInvalid, TypeNodeTransition, TypePartitionDataLoss, TypePartitionQuorumLoss, TypePartitionRestart} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// TypeBasicServicePlacementPolicyDescription enumerates the values for type basic service placement policy +// description. +type TypeBasicServicePlacementPolicyDescription string + +const ( + // TypeInvalidDomain ... + TypeInvalidDomain TypeBasicServicePlacementPolicyDescription = "InvalidDomain" + // TypeNonPartiallyPlaceService ... + TypeNonPartiallyPlaceService TypeBasicServicePlacementPolicyDescription = "NonPartiallyPlaceService" + // TypePreferPrimaryDomain ... + TypePreferPrimaryDomain TypeBasicServicePlacementPolicyDescription = "PreferPrimaryDomain" + // TypeRequireDomain ... + TypeRequireDomain TypeBasicServicePlacementPolicyDescription = "RequireDomain" + // TypeRequireDomainDistribution ... + TypeRequireDomainDistribution TypeBasicServicePlacementPolicyDescription = "RequireDomainDistribution" + // TypeServicePlacementPolicyDescription ... + TypeServicePlacementPolicyDescription TypeBasicServicePlacementPolicyDescription = "ServicePlacementPolicyDescription" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleTypeBasicServicePlacementPolicyDescriptionValues returns an array of possible values for the TypeBasicServicePlacementPolicyDescription const type. +func PossibleTypeBasicServicePlacementPolicyDescriptionValues() []TypeBasicServicePlacementPolicyDescription { + return []TypeBasicServicePlacementPolicyDescription{TypeInvalidDomain, TypeNonPartiallyPlaceService, TypePreferPrimaryDomain, TypeRequireDomain, TypeRequireDomainDistribution, TypeServicePlacementPolicyDescription} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpgradeKind enumerates the values for upgrade kind. +type UpgradeKind string + +const ( + // UpgradeKindInvalid ... + UpgradeKindInvalid UpgradeKind = "Invalid" + // UpgradeKindRolling ... + UpgradeKindRolling UpgradeKind = "Rolling" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleUpgradeKindValues returns an array of possible values for the UpgradeKind const type. +func PossibleUpgradeKindValues() []UpgradeKind { + return []UpgradeKind{UpgradeKindInvalid, UpgradeKindRolling} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpgradeKind1 enumerates the values for upgrade kind 1. +type UpgradeKind1 string + +const ( + // UpgradeKind1Invalid ... + UpgradeKind1Invalid UpgradeKind1 = "Invalid" + // UpgradeKind1Rolling ... + UpgradeKind1Rolling UpgradeKind1 = "Rolling" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleUpgradeKind1Values returns an array of possible values for the UpgradeKind1 const type. +func PossibleUpgradeKind1Values() []UpgradeKind1 { + return []UpgradeKind1{UpgradeKind1Invalid, UpgradeKind1Rolling} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpgradeKind2 enumerates the values for upgrade kind 2. +type UpgradeKind2 string + +const ( + // UpgradeKind2Invalid ... + UpgradeKind2Invalid UpgradeKind2 = "Invalid" + // UpgradeKind2Rolling ... + UpgradeKind2Rolling UpgradeKind2 = "Rolling" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleUpgradeKind2Values returns an array of possible values for the UpgradeKind2 const type. +func PossibleUpgradeKind2Values() []UpgradeKind2 { + return []UpgradeKind2{UpgradeKind2Invalid, UpgradeKind2Rolling} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpgradePhase enumerates the values for upgrade phase. +type UpgradePhase string + +const ( + // UpgradePhaseInvalid ... + UpgradePhaseInvalid UpgradePhase = "Invalid" + // UpgradePhasePostUpgradeSafetyCheck ... + UpgradePhasePostUpgradeSafetyCheck UpgradePhase = "PostUpgradeSafetyCheck" + // UpgradePhasePreUpgradeSafetyCheck ... + UpgradePhasePreUpgradeSafetyCheck UpgradePhase = "PreUpgradeSafetyCheck" + // UpgradePhaseUpgrading ... + UpgradePhaseUpgrading UpgradePhase = "Upgrading" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleUpgradePhaseValues returns an array of possible values for the UpgradePhase const type. +func PossibleUpgradePhaseValues() []UpgradePhase { + return []UpgradePhase{UpgradePhaseInvalid, UpgradePhasePostUpgradeSafetyCheck, UpgradePhasePreUpgradeSafetyCheck, UpgradePhaseUpgrading} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpgradeState enumerates the values for upgrade state. +type UpgradeState string + +const ( + // UpgradeStateFailed ... + UpgradeStateFailed UpgradeState = "Failed" + // UpgradeStateInvalid ... + UpgradeStateInvalid UpgradeState = "Invalid" + // UpgradeStateRollingBackCompleted ... + UpgradeStateRollingBackCompleted UpgradeState = "RollingBackCompleted" + // UpgradeStateRollingBackInProgress ... + UpgradeStateRollingBackInProgress UpgradeState = "RollingBackInProgress" + // UpgradeStateRollingForwardCompleted ... + UpgradeStateRollingForwardCompleted UpgradeState = "RollingForwardCompleted" + // UpgradeStateRollingForwardInProgress ... + UpgradeStateRollingForwardInProgress UpgradeState = "RollingForwardInProgress" + // UpgradeStateRollingForwardPending ... + UpgradeStateRollingForwardPending UpgradeState = "RollingForwardPending" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleUpgradeStateValues returns an array of possible values for the UpgradeState const type. +func PossibleUpgradeStateValues() []UpgradeState { + return []UpgradeState{UpgradeStateFailed, UpgradeStateInvalid, UpgradeStateRollingBackCompleted, UpgradeStateRollingBackInProgress, UpgradeStateRollingForwardCompleted, UpgradeStateRollingForwardInProgress, UpgradeStateRollingForwardPending} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpgradeState1 enumerates the values for upgrade state 1. +type UpgradeState1 string + +const ( + // UpgradeState1Failed ... + UpgradeState1Failed UpgradeState1 = "Failed" + // UpgradeState1Invalid ... + UpgradeState1Invalid UpgradeState1 = "Invalid" + // UpgradeState1RollingBackCompleted ... + UpgradeState1RollingBackCompleted UpgradeState1 = "RollingBackCompleted" + // UpgradeState1RollingBackInProgress ... + UpgradeState1RollingBackInProgress UpgradeState1 = "RollingBackInProgress" + // UpgradeState1RollingForwardCompleted ... + UpgradeState1RollingForwardCompleted UpgradeState1 = "RollingForwardCompleted" + // UpgradeState1RollingForwardInProgress ... + UpgradeState1RollingForwardInProgress UpgradeState1 = "RollingForwardInProgress" + // UpgradeState1RollingForwardPending ... + UpgradeState1RollingForwardPending UpgradeState1 = "RollingForwardPending" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleUpgradeState1Values returns an array of possible values for the UpgradeState1 const type. +func PossibleUpgradeState1Values() []UpgradeState1 { + return []UpgradeState1{UpgradeState1Failed, UpgradeState1Invalid, UpgradeState1RollingBackCompleted, UpgradeState1RollingBackInProgress, UpgradeState1RollingForwardCompleted, UpgradeState1RollingForwardInProgress, UpgradeState1RollingForwardPending} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Weight enumerates the values for weight. +type Weight string + +const ( + // WeightHigh ... + WeightHigh Weight = "High" + // WeightLow ... + WeightLow Weight = "Low" + // WeightMedium ... + WeightMedium Weight = "Medium" + // WeightZero ... + WeightZero Weight = "Zero" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleWeightValues returns an array of possible values for the Weight const type. +func PossibleWeightValues() []Weight { + return []Weight{WeightHigh, WeightLow, WeightMedium, WeightZero} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// WriteStatus enumerates the values for write status. +type WriteStatus string + +const ( + // WriteStatusGranted ... + WriteStatusGranted WriteStatus = "Granted" + // WriteStatusInvalid ... + WriteStatusInvalid WriteStatus = "Invalid" + // WriteStatusNotPrimary ... + WriteStatusNotPrimary WriteStatus = "NotPrimary" + // WriteStatusNoWriteQuorum ... + WriteStatusNoWriteQuorum WriteStatus = "NoWriteQuorum" + // WriteStatusReconfigurationPending ... + WriteStatusReconfigurationPending WriteStatus = "ReconfigurationPending" +) + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PossibleWriteStatusValues returns an array of possible values for the WriteStatus const type. +func PossibleWriteStatusValues() []WriteStatus { + return []WriteStatus{WriteStatusGranted, WriteStatusInvalid, WriteStatusNotPrimary, WriteStatusNoWriteQuorum, WriteStatusReconfigurationPending} +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AadMetadata azure Active Directory metadata used for secured connection to cluster. +type AadMetadata struct { + // Authority - The AAD authority url. + Authority *string `json:"authority,omitempty"` + // Client - The AAD client application Id. + Client *string `json:"client,omitempty"` + // Cluster - The AAD cluster application Id. + Cluster *string `json:"cluster,omitempty"` + // Login - The AAD login url. + Login *string `json:"login,omitempty"` + // Redirect - The client application redirect address. + Redirect *string `json:"redirect,omitempty"` + // Tenant - The AAD tenant Id. + Tenant *string `json:"tenant,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AadMetadataObject azure Active Directory metadata object used for secured connection to cluster. +type AadMetadataObject struct { + autorest.Response `json:"-"` + // Type - The client authentication method. + Type *string `json:"type,omitempty"` + Metadata *AadMetadata `json:"metadata,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationCapacityDescription describes capacity information for services of this application. This description +// can be used for describing the following. +// - Reserving the capacity for the services on the nodes +// - Limiting the total number of nodes that services of this application can run on +// - Limiting the custom capacity metrics to limit the total consumption of this metric by the services of this +// application +type ApplicationCapacityDescription struct { + // MinimumNodes - The minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of the MaximumNodes property. + MinimumNodes *int64 `json:"MinimumNodes,omitempty"` + // MaximumNodes - The maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + MaximumNodes *int64 `json:"MaximumNodes,omitempty"` + ApplicationMetrics *[]ApplicationMetricDescription `json:"ApplicationMetrics,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationDescription describes a Service Fabric application. +type ApplicationDescription struct { + Name *string `json:"Name,omitempty"` + TypeName *string `json:"TypeName,omitempty"` + TypeVersion *string `json:"TypeVersion,omitempty"` + ParameterList *[]ApplicationParameter `json:"ParameterList,omitempty"` + ApplicationCapacity *ApplicationCapacityDescription `json:"ApplicationCapacity,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationHealth represents the health of the application. Contains the application aggregated health state and +// the service and deployed application health states. +type ApplicationHealth struct { + autorest.Response `json:"-"` + Name *string `json:"Name,omitempty"` + // ServiceHealthStates - Service health states as found in the health store. + ServiceHealthStates *[]ServiceHealthState `json:"ServiceHealthStates,omitempty"` + // DeployedApplicationHealthStates - Deployed application health states as found in the health store. + DeployedApplicationHealthStates *[]DeployedApplicationHealthState `json:"DeployedApplicationHealthStates,omitempty"` + // AggregatedHealthState - The HealthState representing the aggregated health state of the entity computed by Health Manager. + // The health evaluation of the entity reflects all events reported on the entity and its children (if any). + // The aggregation is done by applying the desired health policy. + // . Possible values include: 'AggregatedHealthState1Invalid', 'AggregatedHealthState1Ok', 'AggregatedHealthState1Warning', 'AggregatedHealthState1Error', 'AggregatedHealthState1Unknown' + AggregatedHealthState AggregatedHealthState1 `json:"AggregatedHealthState,omitempty"` + // HealthEvents - The list of health events reported on the entity. + HealthEvents *[]HealthEvent `json:"HealthEvents,omitempty"` + // UnhealthyEvaluations - The unhealthy evaluations that show why the current aggregated health state was returned by Health Manager. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationHealthEvaluation represents health evaluation for an application, containing information about the +// data and the algorithm used by the health store to evaluate health. +type ApplicationHealthEvaluation struct { + // ApplicationName - Full name of the application. + ApplicationName *string `json:"ApplicationName,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the current aggregated health state of the application. The types of the unhealthy evaluations can be DeployedApplicationsHealthEvaluation, ServicesHealthEvaluation or EventHealthEvaluation. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) MarshalJSON() ([]byte, error) { + ahe.Kind = KindApplication + objectMap := make(map[string]interface{}) + if ahe.ApplicationName != nil { + objectMap["ApplicationName"] = ahe.ApplicationName + } + if ahe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = ahe.UnhealthyEvaluations + } + if ahe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = ahe.AggregatedHealthState + } + if ahe.Description != nil { + objectMap["Description"] = ahe.Description + } + if ahe.Kind != "" { + objectMap["Kind"] = ahe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return &ahe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationHealthEvaluation. +func (ahe ApplicationHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &ahe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationHealthPolicies defines the application health policy map used to evaluate the health of an +// application or one of its children entities. +type ApplicationHealthPolicies struct { + // ApplicationHealthPolicyMap - The wrapper that contains the map with application health policies used to evaluate specific applications in the cluster. + ApplicationHealthPolicyMap *[]ApplicationHealthPolicyMapItem `json:"ApplicationHealthPolicyMap,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationHealthPolicy defines a health policy used to evaluate the health of an application or one of its +// children entities. +type ApplicationHealthPolicy struct { + // ConsiderWarningAsError - Indicates whether warnings are treated with the same severity as errors. + ConsiderWarningAsError *bool `json:"ConsiderWarningAsError,omitempty"` + // MaxPercentUnhealthyDeployedApplications - The maximum allowed percentage of unhealthy deployed applications. Allowed values are Byte values from zero to 100. + // The percentage represents the maximum tolerated percentage of deployed applications that can be unhealthy before the application is considered in error. + // This is calculated by dividing the number of unhealthy deployed applications over the number of nodes where the application is currently deployed on in the cluster. + // The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. + MaxPercentUnhealthyDeployedApplications *int32 `json:"MaxPercentUnhealthyDeployedApplications,omitempty"` + // DefaultServiceTypeHealthPolicy - The health policy used by default to evaluate the health of a service type. + DefaultServiceTypeHealthPolicy *ServiceTypeHealthPolicy `json:"DefaultServiceTypeHealthPolicy,omitempty"` + // ServiceTypeHealthPolicyMap - The map with service type health policy per service type name. The map is empty be default. + ServiceTypeHealthPolicyMap *[]ServiceTypeHealthPolicyMapItem `json:"ServiceTypeHealthPolicyMap,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationHealthPolicyMapItem defines an item in ApplicationHealthPolicyMap. +type ApplicationHealthPolicyMapItem struct { + // Key - The key of the application health policy map item. This is the name of the application. + Key *string `json:"Key,omitempty"` + // Value - The value of the application health policy map item. This is the ApplicationHealthPolicy for this application. + Value *ApplicationHealthPolicy `json:"Value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationHealthState represents the health state of an application, which contains the application identifier +// and the aggregated health state. +type ApplicationHealthState struct { + // Name - Full name of the application. + Name *string `json:"Name,omitempty"` + // AggregatedHealthState - Possible values include: 'AggregatedHealthState2Invalid', 'AggregatedHealthState2Ok', 'AggregatedHealthState2Warning', 'AggregatedHealthState2Error', 'AggregatedHealthState2Unknown' + AggregatedHealthState AggregatedHealthState2 `json:"AggregatedHealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationHealthStateChunk represents the health state chunk of a application. +// The application health state chunk contains the application name, its aggregated health state and any children +// services and deployed applications that respect the filters in cluster health chunk query description. +type ApplicationHealthStateChunk struct { + // ApplicationName - The name of the application. + ApplicationName *string `json:"ApplicationName,omitempty"` + // ApplicationTypeName - The application type name for the application. + ApplicationTypeName *string `json:"ApplicationTypeName,omitempty"` + // ServiceHealthStateChunks - The list of service health state chunks in the cluster that respect the filters in the cluster health chunk query description. + ServiceHealthStateChunks *ServiceHealthStateChunkList `json:"ServiceHealthStateChunks,omitempty"` + // DeployedApplicationHealthStateChunks - The list of deployed application health state chunks in the cluster that respect the filters in the cluster health chunk query description. + DeployedApplicationHealthStateChunks *DeployedApplicationHealthStateChunkList `json:"DeployedApplicationHealthStateChunks,omitempty"` + // HealthState - Possible values include: 'HealthState2Invalid', 'HealthState2Ok', 'HealthState2Warning', 'HealthState2Error', 'HealthState2Unknown' + HealthState HealthState2 `json:"HealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationHealthStateChunkList the list of application health state chunks in the cluster that respect the +// input filters in the chunk query. Returned by get cluster health state chunks query. +type ApplicationHealthStateChunkList struct { + // Items - The list of application health state chunks that respect the input filters in the chunk query. + Items *[]ApplicationHealthStateChunk `json:"Items,omitempty"` + // TotalCount - Total number of entity health state objects that match the specified filters from the cluster health chunk query description. + TotalCount *int64 `json:"TotalCount,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationHealthStateFilter defines matching criteria to determine whether a application should be included in +// the cluster health chunk. +// One filter can match zero, one or multiple applications, depending on its properties. +type ApplicationHealthStateFilter struct { + // ApplicationNameFilter - The name of the application that matches the filter, as a fabric uri. The filter is applied only to the specified application, if it exists. + // If the application doesn't exist, no application is returned in the cluster health chunk based on this filter. + // If the application exists, it is included in the cluster health chunk if it respects the other filter properties. + // If not specified, all applications are matched against the other filter members, like health state filter. + ApplicationNameFilter *string `json:"ApplicationNameFilter,omitempty"` + // ApplicationTypeNameFilter - The name of the application type that matches the filter. + // If specified, the filter is applied only to applications of the selected application type, if any exists. + // If no applications of the specified application type exists, no application is returned in the cluster health chunk based on this filter. + // Each application of the specified application type is included in the cluster health chunk if it respects the other filter properties. + // If not specified, all applications are matched against the other filter members, like health state filter. + ApplicationTypeNameFilter *string `json:"ApplicationTypeNameFilter,omitempty"` + // HealthStateFilter - The filter for the health state of the applications. It allows selecting applications if they match the desired health states. + // The possible values are integer value of one of the following health states. Only applications that match the filter are returned. All applications are used to evaluate the cluster aggregated health state. + // If not specified, default value is None, unless the application name or the application type name are specified. If the filter has default value and application name is specified, the matching application is returned. + // The state values are flag based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + // For example, if the provided value is 6, it matches applications with HealthState value of OK (2) and Warning (4). + // - Default - Default value. Matches any HealthState. The value is zero. + // - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + // - Ok - Filter that matches input with HealthState value Ok. The value is 2. + // - Warning - Filter that matches input with HealthState value Warning. The value is 4. + // - Error - Filter that matches input with HealthState value Error. The value is 8. + // - All - Filter that matches input with any HealthState value. The value is 65535. + HealthStateFilter *int32 `json:"HealthStateFilter,omitempty"` + // ServiceFilters - Defines a list of filters that specify which services to be included in the returned cluster health chunk as children of the application. The services are returned only if the parent application matches a filter. + // If the list is empty, no services are returned. All the services are used to evaluate the parent application aggregated health state, regardless of the input filters. + // The application filter may specify multiple service filters. + // For example, it can specify a filter to return all services with health state Error and another filter to always include a service identified by its service name. + ServiceFilters *[]ServiceHealthStateFilter `json:"ServiceFilters,omitempty"` + // DeployedApplicationFilters - Defines a list of filters that specify which deployed applications to be included in the returned cluster health chunk as children of the application. The deployed applications are returned only if the parent application matches a filter. + // If the list is empty, no deployed applications are returned. All the deployed applications are used to evaluate the parent application aggregated health state, regardless of the input filters. + // The application filter may specify multiple deployed application filters. + // For example, it can specify a filter to return all deployed applications with health state Error and another filter to always include a deployed application on a specified node. + DeployedApplicationFilters *[]DeployedApplicationHealthStateFilter `json:"DeployedApplicationFilters,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationInfo information about a Service Fabric application. +type ApplicationInfo struct { + autorest.Response `json:"-"` + ID *string `json:"Id,omitempty"` + // Name - The Uniform Resource Identifier(URI) of the application. + Name *string `json:"Name,omitempty"` + // TypeName - The Name of the application type as specified in the Application Manifest. + TypeName *string `json:"TypeName,omitempty"` + // TypeVersion - The version of the application type as specified in the Application Manifest. + TypeVersion *string `json:"TypeVersion,omitempty"` + // Status - Possible values include: 'StatusInvalid', 'StatusReady', 'StatusUpgrading', 'StatusCreating', 'StatusDeleting', 'StatusFailed' + Status Status `json:"Status,omitempty"` + Parameters *[]ApplicationParameter `json:"Parameters,omitempty"` + // HealthState - Possible values include: 'HealthStateInvalid', 'HealthStateOk', 'HealthStateWarning', 'HealthStateError', 'HealthStateUnknown' + HealthState HealthState `json:"HealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationMetricDescription describes capacity information for a custom resource balancing metric. This can be +// used to limit the total consumption of this metric by the services of this application. +type ApplicationMetricDescription struct { + // Name - The name of the metric. + Name *string `json:"Name,omitempty"` + // MaximumCapacity - The maximum node capacity for Service Fabric application. + // This is the maximum Load for an instance of this application on a single node. Even if the capacity of node is greater than this value, Service Fabric will limit the total load of services within the application on each node to this value. + // If set to zero, capacity for this metric is unlimited on each node. + // When creating a new application with application capacity defined, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. + // When updating existing application with application capacity, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. + MaximumCapacity *int64 `json:"MaximumCapacity,omitempty"` + // ReservationCapacity - The node reservation capacity for Service Fabric application. + // This is the amount of load which is reserved on nodes which have instances of this application. + // If MinimumNodes is specified, then the product of these values will be the capacity reserved in the cluster for the application. + // If set to zero, no capacity is reserved for this metric. + // When setting application capacity or when updating application capacity; this value must be smaller than or equal to MaximumCapacity for each metric. + ReservationCapacity *int64 `json:"ReservationCapacity,omitempty"` + // TotalApplicationCapacity - The total metric capacity for Service Fabric application. + // This is the total metric capacity for this application in the cluster. Service Fabric will try to limit the sum of loads of services within the application to this value. + // When creating a new application with application capacity defined, the product of MaximumNodes and MaximumCapacity must always be smaller than or equal to this value. + TotalApplicationCapacity *int64 `json:"TotalApplicationCapacity,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationNameInfo information about the application name. +type ApplicationNameInfo struct { + autorest.Response `json:"-"` + ID *string `json:"Id,omitempty"` + Name *string `json:"Name,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationParameter describes an application parameter override to be applied when creating or upgrading an +// application. +type ApplicationParameter struct { + // Key - The name of the parameter. + Key *string `json:"Key,omitempty"` + // Value - The value of the parameter. + Value *string `json:"Value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationsHealthEvaluation represents health evaluation for applications, containing health evaluations for +// each unhealthy application that impacted current aggregated health state. +type ApplicationsHealthEvaluation struct { + // MaxPercentUnhealthyApplications - Maximum allowed percentage of unhealthy applications from the ClusterHealthPolicy. + MaxPercentUnhealthyApplications *int32 `json:"MaxPercentUnhealthyApplications,omitempty"` + // TotalCount - Total number of applications from the health store. + TotalCount *int64 `json:"TotalCount,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy ApplicationHealthEvaluation that impacted the aggregated health. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) MarshalJSON() ([]byte, error) { + ahe.Kind = KindApplications + objectMap := make(map[string]interface{}) + if ahe.MaxPercentUnhealthyApplications != nil { + objectMap["MaxPercentUnhealthyApplications"] = ahe.MaxPercentUnhealthyApplications + } + if ahe.TotalCount != nil { + objectMap["TotalCount"] = ahe.TotalCount + } + if ahe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = ahe.UnhealthyEvaluations + } + if ahe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = ahe.AggregatedHealthState + } + if ahe.Description != nil { + objectMap["Description"] = ahe.Description + } + if ahe.Kind != "" { + objectMap["Kind"] = ahe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return &ahe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationsHealthEvaluation. +func (ahe ApplicationsHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &ahe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationTypeApplicationsHealthEvaluation represents health evaluation for applications of a particular +// application type. The application type applications evaluation can be returned when cluster health evaluation +// returns unhealthy aggregated health state, either Error or Warning. It contains health evaluations for each +// unhealthy application of the included application type that impacted current aggregated health state. +type ApplicationTypeApplicationsHealthEvaluation struct { + // ApplicationTypeName - Name of the application type. + ApplicationTypeName *string `json:"ApplicationTypeName,omitempty"` + // MaxPercentUnhealthyApplications - Maximum allowed percentage of unhealthy applications for the application type, specified as an entry in ApplicationTypeHealthPolicyMap. + MaxPercentUnhealthyApplications *int32 `json:"MaxPercentUnhealthyApplications,omitempty"` + // TotalCount - Total number of applications of the application type found in the health store. + TotalCount *int64 `json:"TotalCount,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy ApplicationHealthEvaluation of this application type that impacted the aggregated health. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) MarshalJSON() ([]byte, error) { + atahe.Kind = KindApplicationTypeApplications + objectMap := make(map[string]interface{}) + if atahe.ApplicationTypeName != nil { + objectMap["ApplicationTypeName"] = atahe.ApplicationTypeName + } + if atahe.MaxPercentUnhealthyApplications != nil { + objectMap["MaxPercentUnhealthyApplications"] = atahe.MaxPercentUnhealthyApplications + } + if atahe.TotalCount != nil { + objectMap["TotalCount"] = atahe.TotalCount + } + if atahe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = atahe.UnhealthyEvaluations + } + if atahe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = atahe.AggregatedHealthState + } + if atahe.Description != nil { + objectMap["Description"] = atahe.Description + } + if atahe.Kind != "" { + objectMap["Kind"] = atahe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return &atahe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for ApplicationTypeApplicationsHealthEvaluation. +func (atahe ApplicationTypeApplicationsHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &atahe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationTypeHealthPolicyMapItem defines an item in ApplicationTypeHealthPolicyMap. +type ApplicationTypeHealthPolicyMapItem struct { + // Key - The key of the application type health policy map item. This is the name of the application type. + Key *string `json:"Key,omitempty"` + // Value - The value of the application type health policy map item. + // The max percent unhealthy applications allowed for the application type. Must be between zero and 100. + Value *int32 `json:"Value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationTypeImageStorePath path description for the application package in the image store specified during +// the prior copy operation. +type ApplicationTypeImageStorePath struct { + // ApplicationTypeBuildPath - The relative image store path to the application package. + ApplicationTypeBuildPath *string `json:"ApplicationTypeBuildPath,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationTypeImageStoreVersion a version description for the application type +type ApplicationTypeImageStoreVersion struct { + // ApplicationTypeVersion - The application type version. + ApplicationTypeVersion *string `json:"ApplicationTypeVersion,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationTypeInfo information about an application type. +type ApplicationTypeInfo struct { + // Name - The name of the application type. + Name *string `json:"Name,omitempty"` + // Version - The version of the application type. + Version *string `json:"Version,omitempty"` + // Status - Possible values include: 'Status1Invalid', 'Status1Provisioning', 'Status1Available', 'Status1Unprovisioning', 'Status1Failed' + Status Status1 `json:"Status,omitempty"` + DefaultParameterList *[]ApplicationParameter `json:"DefaultParameterList,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationTypeManifest contains the manifest describing an application type registered in a Service Fabric +// cluster. +type ApplicationTypeManifest struct { + autorest.Response `json:"-"` + // Manifest - The XML manifest as a string. + Manifest *string `json:"Manifest,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationUpgradeDescription describes the parameters for an application upgrade. Please note that upgrade +// description replaces the existing application description. This means that if the parameters are not specified, +// the existing parameters on the applications will be overwritten with the empty parameters list. This would +// results in application using the default value of the parameters from the application manifest. If you do not +// want to change any existing parameter values, please get the application parameters first using the +// GetApplicationInfo query and then supply those values as Parameters in this ApplicationUpgradeDescription. +type ApplicationUpgradeDescription struct { + Name *string `json:"Name,omitempty"` + TargetApplicationTypeVersion *string `json:"TargetApplicationTypeVersion,omitempty"` + Parameters *[]ApplicationParameter `json:"Parameters,omitempty"` + // UpgradeKind - Possible values include: 'UpgradeKindInvalid', 'UpgradeKindRolling' + UpgradeKind UpgradeKind `json:"UpgradeKind,omitempty"` + // RollingUpgradeMode - Possible values include: 'RollingUpgradeModeInvalid', 'RollingUpgradeModeUnmonitoredAuto', 'RollingUpgradeModeUnmonitoredManual', 'RollingUpgradeModeMonitored' + RollingUpgradeMode RollingUpgradeMode `json:"RollingUpgradeMode,omitempty"` + UpgradeReplicaSetCheckTimeoutInSeconds *int64 `json:"UpgradeReplicaSetCheckTimeoutInSeconds,omitempty"` + ForceRestart *bool `json:"ForceRestart,omitempty"` + MonitoringPolicy *MonitoringPolicyDescription `json:"MonitoringPolicy,omitempty"` + ApplicationHealthPolicy *ApplicationHealthPolicy `json:"ApplicationHealthPolicy,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationUpgradeProgressInfo describes the parameters for an application upgrade. +type ApplicationUpgradeProgressInfo struct { + autorest.Response `json:"-"` + Name *string `json:"Name,omitempty"` + TypeName *string `json:"TypeName,omitempty"` + TargetApplicationTypeVersion *string `json:"TargetApplicationTypeVersion,omitempty"` + UpgradeDomains *[]UpgradeDomainInfo `json:"UpgradeDomains,omitempty"` + // UpgradeState - Possible values include: 'UpgradeStateInvalid', 'UpgradeStateRollingBackInProgress', 'UpgradeStateRollingBackCompleted', 'UpgradeStateRollingForwardPending', 'UpgradeStateRollingForwardInProgress', 'UpgradeStateRollingForwardCompleted', 'UpgradeStateFailed' + UpgradeState UpgradeState `json:"UpgradeState,omitempty"` + NextUpgradeDomain *string `json:"NextUpgradeDomain,omitempty"` + // RollingUpgradeMode - Possible values include: 'RollingUpgradeMode1Invalid', 'RollingUpgradeMode1UnmonitoredAuto', 'RollingUpgradeMode1UnmonitoredManual', 'RollingUpgradeMode1Monitored' + RollingUpgradeMode RollingUpgradeMode1 `json:"RollingUpgradeMode,omitempty"` + UpgradeDescription *ApplicationUpgradeDescription `json:"UpgradeDescription,omitempty"` + // UpgradeDurationInMilliseconds - The estimated total amount of time spent processing the overall upgrade. + UpgradeDurationInMilliseconds *string `json:"UpgradeDurationInMilliseconds,omitempty"` + // UpgradeDomainDurationInMilliseconds - The estimated total amount of time spent processing the current upgrade domain. + UpgradeDomainDurationInMilliseconds *string `json:"UpgradeDomainDurationInMilliseconds,omitempty"` + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + CurrentUpgradeDomainProgress *CurrentUpgradeDomainProgressInfo `json:"CurrentUpgradeDomainProgress,omitempty"` + // StartTimestampUtc - The estimated UTC datetime when the upgrade started. + StartTimestampUtc *string `json:"StartTimestampUtc,omitempty"` + // FailureTimestampUtc - The estimated UTC datetime when the upgrade failed and FailureAction was executed. + FailureTimestampUtc *string `json:"FailureTimestampUtc,omitempty"` + // FailureReason - Possible values include: 'None', 'Interrupted', 'HealthCheck', 'UpgradeDomainTimeout', 'UpgradeTimeout' + FailureReason FailureReason `json:"FailureReason,omitempty"` + UpgradeDomainProgressAtFailure *FailureUpgradeDomainProgressInfo `json:"UpgradeDomainProgressAtFailure,omitempty"` + // UpgradeStatusDetails - Additional detailed information about the status of the pending upgrade. + UpgradeStatusDetails *string `json:"UpgradeStatusDetails,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ApplicationUpgradeUpdateDescription describes the parameters for updating an ongoing application upgrade. +type ApplicationUpgradeUpdateDescription struct { + Name *string `json:"Name,omitempty"` + // UpgradeKind - Possible values include: 'UpgradeKind2Invalid', 'UpgradeKind2Rolling' + UpgradeKind UpgradeKind2 `json:"UpgradeKind,omitempty"` + ApplicationHealthPolicy *ApplicationHealthPolicy `json:"ApplicationHealthPolicy,omitempty"` + UpdateDescription *RollingUpgradeUpdateDescription `json:"UpdateDescription,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ChaosContext describes a map, which is a collection of (string, string) type key-value pairs. The map can be +// used to record information about +// the Chaos run. There cannot be more than 100 such pairs and each string (key or value) can be at most 4095 +// characters long. +// This map is set by the starter of the Chaos run to optionally store the context about the specific run. +type ChaosContext struct { + Map interface{} `json:"Map,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ChaosContextMapItem describes an item in the ChaosContextMap in ChaosParameters. +type ChaosContextMapItem struct { + // Key - The key for a ChaosContextMapItem. + Key *string `json:"Key,omitempty"` + // Value - The value for a ChaosContextMapItem. + Value *string `json:"Value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicChaosEvent represents an event generated during a Chaos run. +type BasicChaosEvent interface { + AsExecutingFaultsChaosEvent() (*ExecutingFaultsChaosEvent, bool) + AsStartedChaosEvent() (*StartedChaosEvent, bool) + AsStoppedChaosEvent() (*StoppedChaosEvent, bool) + AsTestErrorChaosEvent() (*TestErrorChaosEvent, bool) + AsValidationFailedChaosEvent() (*ValidationFailedChaosEvent, bool) + AsWaitingChaosEvent() (*WaitingChaosEvent, bool) + AsChaosEvent() (*ChaosEvent, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ChaosEvent represents an event generated during a Chaos run. +type ChaosEvent struct { + TimeStampUtc *date.Time `json:"TimeStampUtc,omitempty"` + // Kind - Possible values include: 'KindChaosEvent', 'KindExecutingFaults', 'KindStarted', 'KindStopped', 'KindTestError', 'KindValidationFailed', 'KindWaiting' + Kind KindBasicChaosEvent `json:"Kind,omitempty"` +} + +func unmarshalBasicChaosEvent(body []byte) (BasicChaosEvent, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["Kind"] { + case string(KindExecutingFaults): + var efce ExecutingFaultsChaosEvent + err := json.Unmarshal(body, &efce) + return efce, err + case string(KindStarted): + var sce StartedChaosEvent + err := json.Unmarshal(body, &sce) + return sce, err + case string(KindStopped): + var sce StoppedChaosEvent + err := json.Unmarshal(body, &sce) + return sce, err + case string(KindTestError): + var tece TestErrorChaosEvent + err := json.Unmarshal(body, &tece) + return tece, err + case string(KindValidationFailed): + var vfce ValidationFailedChaosEvent + err := json.Unmarshal(body, &vfce) + return vfce, err + case string(KindWaiting): + var wce WaitingChaosEvent + err := json.Unmarshal(body, &wce) + return wce, err + default: + var ce ChaosEvent + err := json.Unmarshal(body, &ce) + return ce, err + } +} +func unmarshalBasicChaosEventArray(body []byte) ([]BasicChaosEvent, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ceArray := make([]BasicChaosEvent, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ce, err := unmarshalBasicChaosEvent(*rawMessage) + if err != nil { + return nil, err + } + ceArray[index] = ce + } + return ceArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ChaosEvent. +func (ce ChaosEvent) MarshalJSON() ([]byte, error) { + ce.Kind = KindChaosEvent + objectMap := make(map[string]interface{}) + if ce.TimeStampUtc != nil { + objectMap["TimeStampUtc"] = ce.TimeStampUtc + } + if ce.Kind != "" { + objectMap["Kind"] = ce.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsExecutingFaultsChaosEvent is the BasicChaosEvent implementation for ChaosEvent. +func (ce ChaosEvent) AsExecutingFaultsChaosEvent() (*ExecutingFaultsChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStartedChaosEvent is the BasicChaosEvent implementation for ChaosEvent. +func (ce ChaosEvent) AsStartedChaosEvent() (*StartedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStoppedChaosEvent is the BasicChaosEvent implementation for ChaosEvent. +func (ce ChaosEvent) AsStoppedChaosEvent() (*StoppedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsTestErrorChaosEvent is the BasicChaosEvent implementation for ChaosEvent. +func (ce ChaosEvent) AsTestErrorChaosEvent() (*TestErrorChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsValidationFailedChaosEvent is the BasicChaosEvent implementation for ChaosEvent. +func (ce ChaosEvent) AsValidationFailedChaosEvent() (*ValidationFailedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitingChaosEvent is the BasicChaosEvent implementation for ChaosEvent. +func (ce ChaosEvent) AsWaitingChaosEvent() (*WaitingChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsChaosEvent is the BasicChaosEvent implementation for ChaosEvent. +func (ce ChaosEvent) AsChaosEvent() (*ChaosEvent, bool) { + return &ce, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicChaosEvent is the BasicChaosEvent implementation for ChaosEvent. +func (ce ChaosEvent) AsBasicChaosEvent() (BasicChaosEvent, bool) { + return &ce, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ChaosEventWrapper wrapper object for Chaos event. +type ChaosEventWrapper struct { + ChaosEvent BasicChaosEvent `json:"ChaosEvent,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for ChaosEventWrapper struct. +func (cew *ChaosEventWrapper) 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 "ChaosEvent": + if v != nil { + chaosEvent, err := unmarshalBasicChaosEvent(*v) + if err != nil { + return err + } + cew.ChaosEvent = chaosEvent + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ChaosParameters defines all the parameters to configure a Chaos run. +type ChaosParameters struct { + // TimeToRunInSeconds - Total time (in seconds) for which Chaos will run before automatically stopping. The maximum allowed value is 4,294,967,295 (System.UInt32.MaxValue). + // Depending on other time settings, the actual running time of Chaos can be larger than the TimeToRunInSeconds. + // To be conservative, we should expect Chaos to automatically stop after + // (MaxClusterStabilizationTimeoutInSeconds + MaxConcurrentFaults * WaitTimeBetweenFaultsInSeconds + WaitTimeBetweenIterationsInSeconds) seconds. + TimeToRunInSeconds *string `json:"TimeToRunInSeconds,omitempty"` + // MaxClusterStabilizationTimeoutInSeconds - The maximum amount of time to wait for all cluster entities to become stable and healthy. Chaos executes in iterations and at the start of each iteration it validates the health of cluster entities. + // During validation if a cluster entity is not stable and healthy within MaxClusterStabilizationTimeoutInSeconds, Chaos generates a validation failed event. + MaxClusterStabilizationTimeoutInSeconds *int64 `json:"MaxClusterStabilizationTimeoutInSeconds,omitempty"` + // MaxConcurrentFaults - MaxConcurrentFaults is the maximum number of concurrent faults induced per iteration. + // Chaos executes in iterations and two consecutive iterations are separated by a validation phase. + // The higher the concurrency, the more aggressive the injection of faults -- inducing more complex series of states to uncover bugs. + // The recommendation is to start with a value of 2 or 3 and to exercise caution while moving up. + MaxConcurrentFaults *int64 `json:"MaxConcurrentFaults,omitempty"` + // EnableMoveReplicaFaults - Enables or disables the move primary and move secondary faults. + EnableMoveReplicaFaults *bool `json:"EnableMoveReplicaFaults,omitempty"` + // WaitTimeBetweenFaultsInSeconds - Wait time (in seconds) between consecutive faults within a single iteration. + // The larger the value, the lower the overlapping between faults and the simpler the sequence of state transitions that the cluster goes through. + // The recommendation is to start with a value between 1 and 5 and exercise caution while moving up. + WaitTimeBetweenFaultsInSeconds *int64 `json:"WaitTimeBetweenFaultsInSeconds,omitempty"` + // WaitTimeBetweenIterationsInSeconds - Time-separation (in seconds) between two consecutive iterations of Chaos. + // The larger the value, the lower the fault injection rate. + WaitTimeBetweenIterationsInSeconds *int64 `json:"WaitTimeBetweenIterationsInSeconds,omitempty"` + // ClusterHealthPolicy - Passed-in cluster health policy is used to validate health of the cluster in between Chaos iterations. If the cluster health is in error or if an unexpected exception happens during fault execution--to provide the cluster with some time to recuperate--Chaos will wait for 30 minutes before the next health-check. + ClusterHealthPolicy *ClusterHealthPolicy `json:"ClusterHealthPolicy,omitempty"` + Context *ChaosContext `json:"Context,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ChaosReport contains detailed Chaos report. +type ChaosReport struct { + autorest.Response `json:"-"` + ChaosParameters *ChaosParameters `json:"ChaosParameters,omitempty"` + // Status - Current status of the Chaos run. + // - Invalid - Indicates an invalid Chaos status. All Service Fabric enumerations have the invalid type. + // The valus is zero. + // - Running - Indicates that Chaos is not stopped. + // - Stopped - Indicates that Chaos is not scheduling futher faults. Possible values include: 'Status5Invalid', 'Status5Running', 'Status5Stopped' + Status Status5 `json:"Status,omitempty"` + ContinuationToken *string `json:"ContinuationToken,omitempty"` + // History - List of ChaosEvent's that meet the user-supplied criteria. + History *[]ChaosEventWrapper `json:"History,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ClusterHealth represents the health of the cluster. +// Contains the cluster aggregated health state, the cluster application and node health states as well as the +// health events and the unhealthy evaluations. +type ClusterHealth struct { + autorest.Response `json:"-"` + // NodeHealthStates - Cluster node health states as found in the health store. + NodeHealthStates *[]NodeHealthState `json:"NodeHealthStates,omitempty"` + // ApplicationHealthStates - Cluster application health states as found in the health store. + ApplicationHealthStates *[]ApplicationHealthState `json:"ApplicationHealthStates,omitempty"` + // AggregatedHealthState - The HealthState representing the aggregated health state of the entity computed by Health Manager. + // The health evaluation of the entity reflects all events reported on the entity and its children (if any). + // The aggregation is done by applying the desired health policy. + // . Possible values include: 'AggregatedHealthState1Invalid', 'AggregatedHealthState1Ok', 'AggregatedHealthState1Warning', 'AggregatedHealthState1Error', 'AggregatedHealthState1Unknown' + AggregatedHealthState AggregatedHealthState1 `json:"AggregatedHealthState,omitempty"` + // HealthEvents - The list of health events reported on the entity. + HealthEvents *[]HealthEvent `json:"HealthEvents,omitempty"` + // UnhealthyEvaluations - The unhealthy evaluations that show why the current aggregated health state was returned by Health Manager. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ClusterHealthChunk represents the health chunk of the cluster. +// Contains the cluster aggregated health state, and the cluster entities that respect the input filter. +type ClusterHealthChunk struct { + autorest.Response `json:"-"` + // HealthState - The HealthState representing the aggregated health state of the cluster computed by Health Manager. + // The health evaluation of the entity reflects all events reported on the entity and its children (if any). + // The aggregation is done by applying the desired cluster health policy and the application health policies. + // . Possible values include: 'HealthState1Invalid', 'HealthState1Ok', 'HealthState1Warning', 'HealthState1Error', 'HealthState1Unknown' + HealthState HealthState1 `json:"HealthState,omitempty"` + // NodeHealthStateChunks - The list of node health state chunks in the cluster that respect the filters in the cluster health chunk query description. + NodeHealthStateChunks *NodeHealthStateChunkList `json:"NodeHealthStateChunks,omitempty"` + // ApplicationHealthStateChunks - The list of application health state chunks in the cluster that respect the filters in the cluster health chunk query description. + ApplicationHealthStateChunks *ApplicationHealthStateChunkList `json:"ApplicationHealthStateChunks,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ClusterHealthChunkQueryDescription the cluster health chunk query description, which can specify the health +// policies to evaluate cluster health and very expressive filters to select which cluster entities to include in +// response. +type ClusterHealthChunkQueryDescription struct { + // NodeFilters - Defines a list of filters that specify which nodes to be included in the returned cluster health chunk. + // If no filters are specified, no nodes are returned. All the nodes are used to evaluate the cluster's aggregated health state, regardless of the input filters. + // The cluster health chunk query may specify multiple node filters. + // For example, it can specify a filter to return all nodes with health state Error and another filter to always include a node identified by its NodeName. + NodeFilters *[]NodeHealthStateFilter `json:"NodeFilters,omitempty"` + // ApplicationFilters - Defines a list of filters that specify which applications to be included in the returned cluster health chunk. + // If no filters are specified, no applications are returned. All the applications are used to evaluate the cluster's aggregated health state, regardless of the input filters. + // The cluster health chunk query may specify multiple application filters. + // For example, it can specify a filter to return all applications with health state Error and another filter to always include applications of a specified application type. + ApplicationFilters *[]ApplicationHealthStateFilter `json:"ApplicationFilters,omitempty"` + ClusterHealthPolicy *ClusterHealthPolicy `json:"ClusterHealthPolicy,omitempty"` + ApplicationHealthPolicies *ApplicationHealthPolicies `json:"ApplicationHealthPolicies,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ClusterHealthPolicies health policies to evaluate cluster health. +type ClusterHealthPolicies struct { + ApplicationHealthPolicyMap *[]ApplicationHealthPolicyMapItem `json:"ApplicationHealthPolicyMap,omitempty"` + ClusterHealthPolicy *ClusterHealthPolicy `json:"ClusterHealthPolicy,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ClusterHealthPolicy defines a health policy used to evaluate the health of the cluster or of a cluster node. +type ClusterHealthPolicy struct { + // ConsiderWarningAsError - Indicates whether warnings are treated with the same severity as errors. + ConsiderWarningAsError *bool `json:"ConsiderWarningAsError,omitempty"` + // MaxPercentUnhealthyNodes - The maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes to be unhealthy, this value would be 10. + // The percentage represents the maximum tolerated percentage of nodes that can be unhealthy before the cluster is considered in error. + // If the percentage is respected but there is at least one unhealthy node, the health is evaluated as Warning. + // The percentage is calculated by dividing the number of unhealthy nodes over the total number of nodes in the cluster. + // The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. + // In large clusters, some nodes will always be down or out for repairs, so this percentage should be configured to tolerate that. + MaxPercentUnhealthyNodes *int32 `json:"MaxPercentUnhealthyNodes,omitempty"` + // MaxPercentUnhealthyApplications - The maximum allowed percentage of unhealthy applications before reporting an error. For example, to allow 10% of applications to be unhealthy, this value would be 10. + // The percentage represents the maximum tolerated percentage of applications that can be unhealthy before the cluster is considered in error. + // If the percentage is respected but there is at least one unhealthy application, the health is evaluated as Warning. + // This is calculated by dividing the number of unhealthy applications over the total number of application instances in the cluster, excluding applications of application types that are included in the ApplicationTypeHealthPolicyMap. + // The computation rounds up to tolerate one failure on small numbers of applications. Default percentage is zero. + MaxPercentUnhealthyApplications *int32 `json:"MaxPercentUnhealthyApplications,omitempty"` + ApplicationTypeHealthPolicyMap *[]ApplicationTypeHealthPolicyMapItem `json:"ApplicationTypeHealthPolicyMap,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ClusterManifest information about the cluster manifest. +type ClusterManifest struct { + autorest.Response `json:"-"` + // Manifest - The contents of the cluster manifest file. + Manifest *string `json:"Manifest,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ClusterUpgradeDescriptionObject represents a ServiceFabric cluster upgrade +type ClusterUpgradeDescriptionObject struct { + ConfigVersion *string `json:"ConfigVersion,omitempty"` + CodeVersion *string `json:"CodeVersion,omitempty"` + // UpgradeKind - Possible values include: 'UpgradeKind1Invalid', 'UpgradeKind1Rolling' + UpgradeKind UpgradeKind1 `json:"UpgradeKind,omitempty"` + // RollingUpgradeMode - Possible values include: 'RollingUpgradeMode2Invalid', 'RollingUpgradeMode2UnmonitoredAuto', 'RollingUpgradeMode2UnmonitoredManual', 'RollingUpgradeMode2Monitored' + RollingUpgradeMode RollingUpgradeMode2 `json:"RollingUpgradeMode,omitempty"` + UpgradeReplicaSetCheckTimeoutInSeconds *int64 `json:"UpgradeReplicaSetCheckTimeoutInSeconds,omitempty"` + ForceRestart *bool `json:"ForceRestart,omitempty"` + EnableDeltaHealthEvaluation *bool `json:"EnableDeltaHealthEvaluation,omitempty"` + MonitoringPolicy *MonitoringPolicyDescription `json:"MonitoringPolicy,omitempty"` + ClusterHealthPolicy *ClusterHealthPolicy `json:"ClusterHealthPolicy,omitempty"` + ClusterUpgradeHealthPolicy *ClusterUpgradeHealthPolicyObject `json:"ClusterUpgradeHealthPolicy,omitempty"` + ApplicationHealthPolicyMap *[]ApplicationHealthPolicyMapItem `json:"ApplicationHealthPolicyMap,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ClusterUpgradeHealthPolicyObject defines a health policy used to evaluate the health of the cluster during a +// cluster upgrade. +type ClusterUpgradeHealthPolicyObject struct { + // MaxPercentDeltaUnhealthyNodes - The maximum allowed percentage of nodes health degradation allowed during cluster upgrades. The delta is measured between the state of the nodes at the beginning of upgrade and the state of the nodes at the time of the health evaluation. The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. The default value is 10%. + MaxPercentDeltaUnhealthyNodes *int32 `json:"MaxPercentDeltaUnhealthyNodes,omitempty"` + // MaxPercentUpgradeDomainDeltaUnhealthyNodes - The maximum allowed percentage of upgrade domain nodes health degradation allowed during cluster upgrades. The delta is measured between the state of the upgrade domain nodes at the beginning of upgrade and the state of the upgrade domain nodes at the time of the health evaluation. The check is performed after every upgrade domain upgrade completion for all completed upgrade domains to make sure the state of the upgrade domains is within tolerated limits. The default value is 15%. + MaxPercentUpgradeDomainDeltaUnhealthyNodes *int32 `json:"MaxPercentUpgradeDomainDeltaUnhealthyNodes,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ClusterUpgradeProgressObject information about a cluster upgrade. +type ClusterUpgradeProgressObject struct { + autorest.Response `json:"-"` + CodeVersion *string `json:"CodeVersion,omitempty"` + ConfigVersion *string `json:"ConfigVersion,omitempty"` + UpgradeDomains *[]UpgradeDomainInfo `json:"UpgradeDomains,omitempty"` + // UpgradeState - Possible values include: 'UpgradeState1Invalid', 'UpgradeState1RollingBackInProgress', 'UpgradeState1RollingBackCompleted', 'UpgradeState1RollingForwardPending', 'UpgradeState1RollingForwardInProgress', 'UpgradeState1RollingForwardCompleted', 'UpgradeState1Failed' + UpgradeState UpgradeState1 `json:"UpgradeState,omitempty"` + NextUpgradeDomain *string `json:"NextUpgradeDomain,omitempty"` + // RollingUpgradeMode - Possible values include: 'RollingUpgradeMode3Invalid', 'RollingUpgradeMode3UnmonitoredAuto', 'RollingUpgradeMode3UnmonitoredManual', 'RollingUpgradeMode3Monitored' + RollingUpgradeMode RollingUpgradeMode3 `json:"RollingUpgradeMode,omitempty"` + UpgradeDescription *ClusterUpgradeDescriptionObject `json:"UpgradeDescription,omitempty"` + UpgradeDurationInMilliseconds *string `json:"UpgradeDurationInMilliseconds,omitempty"` + UpgradeDomainDurationInMilliseconds *string `json:"UpgradeDomainDurationInMilliseconds,omitempty"` + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + CurrentUpgradeDomainProgress *CurrentUpgradeDomainProgressInfo `json:"CurrentUpgradeDomainProgress,omitempty"` + StartTimestampUtc *string `json:"StartTimestampUtc,omitempty"` + FailureTimestampUtc *string `json:"FailureTimestampUtc,omitempty"` + // FailureReason - Possible values include: 'FailureReason1None', 'FailureReason1Interrupted', 'FailureReason1HealthCheck', 'FailureReason1UpgradeDomainTimeout', 'FailureReason1UpgradeTimeout' + FailureReason FailureReason1 `json:"FailureReason,omitempty"` + UpgradeDomainProgressAtFailure *FailedUpgradeDomainProgressObject `json:"UpgradeDomainProgressAtFailure,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CodePackageEntryPoint information about setup or main entry point of a code package deployed on a Service Fabric +// node. +type CodePackageEntryPoint struct { + // EntryPointLocation - The location of entry point executable on the node. + EntryPointLocation *string `json:"EntryPointLocation,omitempty"` + // ProcessID - The process id of the entry point. + ProcessID *string `json:"ProcessId,omitempty"` + // RunAsUserName - The user name under which entry point executable is run on the node. + RunAsUserName *string `json:"RunAsUserName,omitempty"` + CodePackageEntryPointStatistics *CodePackageEntryPointStatistics `json:"CodePackageEntryPointStatistics,omitempty"` + // Status - Possible values include: 'Status3Invalid', 'Status3Pending', 'Status3Starting', 'Status3Started', 'Status3Stopping', 'Status3Stopped' + Status Status3 `json:"Status,omitempty"` + // NextActivationTime - The time (in UTC) when the entry point executable will be run next. + NextActivationTime *date.Time `json:"NextActivationTime,omitempty"` + InstanceID *string `json:"InstanceId,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CodePackageEntryPointStatistics statistics about setup or main entry point of a code package deployed on a +// Service Fabric node. +type CodePackageEntryPointStatistics struct { + // LastExitCode - The last exit code of the entry point. + LastExitCode *string `json:"LastExitCode,omitempty"` + // LastActivationTime - The last time (in UTC) when Service Fabric attempted to run the entry point. + LastActivationTime *date.Time `json:"LastActivationTime,omitempty"` + // LastExitTime - The last time (in UTC) when the entry point finished running. + LastExitTime *date.Time `json:"LastExitTime,omitempty"` + // LastSuccessfulActivationTime - The last time (in UTC) when the entry point ran successfully. + LastSuccessfulActivationTime *date.Time `json:"LastSuccessfulActivationTime,omitempty"` + // LastSuccessfulExitTime - The last time (in UTC) when the entry point finished running gracefully. + LastSuccessfulExitTime *date.Time `json:"LastSuccessfulExitTime,omitempty"` + // ActivationCount - Number of times the entry point has run. + ActivationCount *string `json:"ActivationCount,omitempty"` + // ActivationFailureCount - Number of times the entry point failed to run. + ActivationFailureCount *string `json:"ActivationFailureCount,omitempty"` + // ContinuousActivationFailureCount - Number of times the entry point continuously failed to run. + ContinuousActivationFailureCount *string `json:"ContinuousActivationFailureCount,omitempty"` + // ExitCount - Number of times the entry point finished running. + ExitCount *string `json:"ExitCount,omitempty"` + // ExitFailureCount - Number of times the entry point failed to exit gracefully. + ExitFailureCount *string `json:"ExitFailureCount,omitempty"` + // ContinuousExitFailureCount - Number of times the entry point continuously failed to exit gracefully. + ContinuousExitFailureCount *string `json:"ContinuousExitFailureCount,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ComposeApplicationStatusInfo information about a Service Fabric compose application. +type ComposeApplicationStatusInfo struct { + autorest.Response `json:"-"` + Name *string `json:"Name,omitempty"` + // Status - Possible values include: 'Status6Invalid', 'Status6Provisioning', 'Status6Creating', 'Status6Created', 'Status6Unprovisioning', 'Status6Deleting', 'Status6Failed' + Status Status6 `json:"Status,omitempty"` + // StatusDetails - The status details of compose application including failure message. + StatusDetails *string `json:"StatusDetails,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CreateComposeApplicationDescription defines description for creating a Service Fabric compose application. +type CreateComposeApplicationDescription struct { + ApplicationName *string `json:"ApplicationName,omitempty"` + // ComposeFileContent - The content of the compose file that describes application to create. + ComposeFileContent *string `json:"ComposeFileContent,omitempty"` + RepositoryCredential *RepositoryCredential `json:"RepositoryCredential,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// CurrentUpgradeDomainProgressInfo information about the current in-progress upgrade domain. +type CurrentUpgradeDomainProgressInfo struct { + DomainName *string `json:"DomainName,omitempty"` + NodeUpgradeProgressList *[]NodeUpgradeProgressInfo `json:"NodeUpgradeProgressList,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeactivationIntentDescription describes the intent or reason for deactivating the node. +type DeactivationIntentDescription struct { + // DeactivationIntent - Describes the intent or reason for deactivating the node. The possible values are following. + // - Pause - Indicates that the node should be paused. The value is 1. + // - Restart - Indicates that the intent is for the node to be restarted after a short period of time. The value is 2. + // - RemoveData - Indicates the intent is for the node to remove data. The value is 3. + // . Possible values include: 'Pause', 'Restart', 'RemoveData' + DeactivationIntent DeactivationIntent `json:"DeactivationIntent,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeltaNodesCheckHealthEvaluation represents health evaluation for delta nodes, containing health evaluations for +// each unhealthy node that impacted current aggregated health state. +// Can be returned during cluster upgrade when the aggregated health state of the cluster is Warning or Error. +type DeltaNodesCheckHealthEvaluation struct { + // BaselineErrorCount - Number of nodes with aggregated heath state Error in the health store at the beginning of the cluster upgrade. + BaselineErrorCount *int64 `json:"BaselineErrorCount,omitempty"` + // BaselineTotalCount - Total number of nodes in the health store at the beginning of the cluster upgrade. + BaselineTotalCount *int64 `json:"BaselineTotalCount,omitempty"` + // MaxPercentDeltaUnhealthyNodes - Maximum allowed percentage of delta unhealthy nodes from the ClusterUpgradeHealthPolicy. + MaxPercentDeltaUnhealthyNodes *int32 `json:"MaxPercentDeltaUnhealthyNodes,omitempty"` + // TotalCount - Total number of nodes in the health store. + TotalCount *int64 `json:"TotalCount,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the aggregated health state. + // Includes all the unhealthy NodeHealthEvaluation that impacted the aggregated health. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) MarshalJSON() ([]byte, error) { + dnche.Kind = KindDeltaNodesCheck + objectMap := make(map[string]interface{}) + if dnche.BaselineErrorCount != nil { + objectMap["BaselineErrorCount"] = dnche.BaselineErrorCount + } + if dnche.BaselineTotalCount != nil { + objectMap["BaselineTotalCount"] = dnche.BaselineTotalCount + } + if dnche.MaxPercentDeltaUnhealthyNodes != nil { + objectMap["MaxPercentDeltaUnhealthyNodes"] = dnche.MaxPercentDeltaUnhealthyNodes + } + if dnche.TotalCount != nil { + objectMap["TotalCount"] = dnche.TotalCount + } + if dnche.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = dnche.UnhealthyEvaluations + } + if dnche.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = dnche.AggregatedHealthState + } + if dnche.Description != nil { + objectMap["Description"] = dnche.Description + } + if dnche.Kind != "" { + objectMap["Kind"] = dnche.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return &dnche, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for DeltaNodesCheckHealthEvaluation. +func (dnche DeltaNodesCheckHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &dnche, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedApplicationHealth information about the health of an application deployed on a Service Fabric node. +type DeployedApplicationHealth struct { + autorest.Response `json:"-"` + // Name - Name of the application deployed on the node whose health information is described by this object. + Name *string `json:"Name,omitempty"` + // NodeName - Name of the node where this application is deployed. + NodeName *string `json:"NodeName,omitempty"` + // DeployedServicePackageHealthStates - Deployed service package health states for the current deployed application as found in the health store. + DeployedServicePackageHealthStates *[]DeployedServicePackageHealthState `json:"DeployedServicePackageHealthStates,omitempty"` + // AggregatedHealthState - The HealthState representing the aggregated health state of the entity computed by Health Manager. + // The health evaluation of the entity reflects all events reported on the entity and its children (if any). + // The aggregation is done by applying the desired health policy. + // . Possible values include: 'AggregatedHealthState1Invalid', 'AggregatedHealthState1Ok', 'AggregatedHealthState1Warning', 'AggregatedHealthState1Error', 'AggregatedHealthState1Unknown' + AggregatedHealthState AggregatedHealthState1 `json:"AggregatedHealthState,omitempty"` + // HealthEvents - The list of health events reported on the entity. + HealthEvents *[]HealthEvent `json:"HealthEvents,omitempty"` + // UnhealthyEvaluations - The unhealthy evaluations that show why the current aggregated health state was returned by Health Manager. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedApplicationHealthEvaluation represents health evaluation for a deployed application, containing +// information about the data and the algorithm used by the health store to evaluate health. +type DeployedApplicationHealthEvaluation struct { + // NodeName - Name of the node where the application is deployed to. + NodeName *string `json:"NodeName,omitempty"` + // ApplicationName - Full name of the application. + ApplicationName *string `json:"ApplicationName,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the current aggregated health state of the deployed application. + // The types of the unhealthy evaluations can be DeployedServicePackagesHealthEvaluation or EventHealthEvaluation. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) MarshalJSON() ([]byte, error) { + dahe.Kind = KindDeployedApplication + objectMap := make(map[string]interface{}) + if dahe.NodeName != nil { + objectMap["NodeName"] = dahe.NodeName + } + if dahe.ApplicationName != nil { + objectMap["ApplicationName"] = dahe.ApplicationName + } + if dahe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = dahe.UnhealthyEvaluations + } + if dahe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = dahe.AggregatedHealthState + } + if dahe.Description != nil { + objectMap["Description"] = dahe.Description + } + if dahe.Kind != "" { + objectMap["Kind"] = dahe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return &dahe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationHealthEvaluation. +func (dahe DeployedApplicationHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &dahe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedApplicationHealthState represents the health state of a deployed application, which contains the entity +// identifier and the aggregated health state. +type DeployedApplicationHealthState struct { + // NodeName - Name of the node on which the service package is deployed. + NodeName *string `json:"NodeName,omitempty"` + // ApplicationName - Full name of the application. + ApplicationName *string `json:"ApplicationName,omitempty"` + // AggregatedHealthState - Possible values include: 'AggregatedHealthState2Invalid', 'AggregatedHealthState2Ok', 'AggregatedHealthState2Warning', 'AggregatedHealthState2Error', 'AggregatedHealthState2Unknown' + AggregatedHealthState AggregatedHealthState2 `json:"AggregatedHealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedApplicationHealthStateChunk represents the health state chunk of a deployed application, which contains +// the node where the application is deployed, the aggregated health state and any deployed service packages that +// respect the chunk query description filters. +type DeployedApplicationHealthStateChunk struct { + // NodeName - The name of node where the application is deployed. + NodeName *string `json:"NodeName,omitempty"` + // DeployedServicePackageHealthStateChunks - The list of deployed service oackage health state chunks belonging to the deployed application that respect the filters in the cluster health chunk query description. + DeployedServicePackageHealthStateChunks *DeployedServicePackageHealthStateChunkList `json:"DeployedServicePackageHealthStateChunks,omitempty"` + // HealthState - Possible values include: 'HealthState2Invalid', 'HealthState2Ok', 'HealthState2Warning', 'HealthState2Error', 'HealthState2Unknown' + HealthState HealthState2 `json:"HealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedApplicationHealthStateChunkList the list of deployed application health state chunks that respect the +// input filters in the chunk query. Returned by get cluster health state chunks query. +type DeployedApplicationHealthStateChunkList struct { + // Items - The list of deployed application health state chunks that respect the input filters in the chunk query. + Items *[]DeployedApplicationHealthStateChunk `json:"Items,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedApplicationHealthStateFilter defines matching criteria to determine whether a deployed application +// should be included as a child of an application in the cluster health chunk. +// The deployed applications are only returned if the parent application matches a filter specified in the cluster +// health chunk query description. +// One filter can match zero, one or multiple deployed applications, depending on its properties. +type DeployedApplicationHealthStateFilter struct { + // NodeNameFilter - The name of the node where the application is deployed in order to match the filter. + // If specified, the filter is applied only to the application deployed on the specified node. + // If the application is not deployed on the node with the specified name, no deployed application is returned in the cluster health chunk based on this filter. + // Otherwise, the deployed application is included in the cluster health chunk if it respects the other filter properties. + // If not specified, all deployed applications that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + NodeNameFilter *string `json:"NodeNameFilter,omitempty"` + // HealthStateFilter - The filter for the health state of the deployed applications. It allows selecting deployed applications if they match the desired health states. + // The possible values are integer value of one of the following health states. Only deployed applications that match the filter are returned. All deployed applications are used to evaluate the cluster aggregated health state. + // If not specified, default value is None, unless the node name is specified. If the filter has default value and node name is specified, the matching deployed application is returned. + // The state values are flag based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + // For example, if the provided value is 6, it matches deployed applications with HealthState value of OK (2) and Warning (4). + // - Default - Default value. Matches any HealthState. The value is zero. + // - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + // - Ok - Filter that matches input with HealthState value Ok. The value is 2. + // - Warning - Filter that matches input with HealthState value Warning. The value is 4. + // - Error - Filter that matches input with HealthState value Error. The value is 8. + // - All - Filter that matches input with any HealthState value. The value is 65535. + HealthStateFilter *int32 `json:"HealthStateFilter,omitempty"` + // DeployedServicePackageFilters - Defines a list of filters that specify which deployed service packages to be included in the returned cluster health chunk as children of the parent deployed application. The deployed service packages are returned only if the parent deployed application matches a filter. + // If the list is empty, no deployed service packages are returned. All the deployed service packages are used to evaluate the parent deployed application aggregated health state, regardless of the input filters. + // The deployed application filter may specify multiple deployed service package filters. + // For example, it can specify a filter to return all deployed service packages with health state Error and another filter to always include a deployed service package on a node. + DeployedServicePackageFilters *[]DeployedServicePackageHealthStateFilter `json:"DeployedServicePackageFilters,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedApplicationInfo information about application deployed on the node. +type DeployedApplicationInfo struct { + autorest.Response `json:"-"` + ID *string `json:"Id,omitempty"` + // Name - The name of the application. + Name *string `json:"Name,omitempty"` + // TypeName - The name of the application type. + TypeName *string `json:"TypeName,omitempty"` + // Status - Possible values include: 'Status2Invalid', 'Status2Downloading', 'Status2Activating', 'Status2Active', 'Status2Upgrading', 'Status2Deactivating' + Status Status2 `json:"Status,omitempty"` + // WorkDirectory - The work directory of the application on the node. The work directory can be used to store application data. + WorkDirectory *string `json:"WorkDirectory,omitempty"` + // LogDirectory - The log directory of the application on the node. The log directory can be used to store application logs. + LogDirectory *string `json:"LogDirectory,omitempty"` + // TempDirectory - The temp directory of the application on the node. The code packages belonging to the application are forked with this directory set as their temporary directory. + TempDirectory *string `json:"TempDirectory,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedApplicationsHealthEvaluation represents health evaluation for deployed applications, containing health +// evaluations for each unhealthy deployed application that impacted current aggregated health state. +// Can be returned when evaluating application health and the aggregated health state is either Error or Warning. +type DeployedApplicationsHealthEvaluation struct { + // MaxPercentUnhealthyDeployedApplications - Maximum allowed percentage of unhealthy deployed applications from the ApplicationHealthPolicy. + MaxPercentUnhealthyDeployedApplications *int32 `json:"MaxPercentUnhealthyDeployedApplications,omitempty"` + // TotalCount - Total number of deployed applications of the application in the health store. + TotalCount *int64 `json:"TotalCount,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy DeployedApplicationHealthEvaluation that impacted the aggregated health. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) MarshalJSON() ([]byte, error) { + dahe.Kind = KindDeployedApplications + objectMap := make(map[string]interface{}) + if dahe.MaxPercentUnhealthyDeployedApplications != nil { + objectMap["MaxPercentUnhealthyDeployedApplications"] = dahe.MaxPercentUnhealthyDeployedApplications + } + if dahe.TotalCount != nil { + objectMap["TotalCount"] = dahe.TotalCount + } + if dahe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = dahe.UnhealthyEvaluations + } + if dahe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = dahe.AggregatedHealthState + } + if dahe.Description != nil { + objectMap["Description"] = dahe.Description + } + if dahe.Kind != "" { + objectMap["Kind"] = dahe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return &dahe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for DeployedApplicationsHealthEvaluation. +func (dahe DeployedApplicationsHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &dahe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedCodePackageInfo information about code package deployed on a Service Fabric node. +type DeployedCodePackageInfo struct { + // Name - The name of the code package. + Name *string `json:"Name,omitempty"` + // Version - The version of the code package specified in service manifest. + Version *string `json:"Version,omitempty"` + // ServiceManifestName - The name of service manifest that specified this code package. + ServiceManifestName *string `json:"ServiceManifestName,omitempty"` + ServicePackageActivationID *string `json:"ServicePackageActivationId,omitempty"` + // HostType - Possible values include: 'HostTypeInvalid', 'HostTypeExeHost', 'HostTypeContainerHost' + HostType HostType `json:"HostType,omitempty"` + // HostIsolationMode - Possible values include: 'HostIsolationModeNone', 'HostIsolationModeProcess', 'HostIsolationModeHyperV' + HostIsolationMode HostIsolationMode `json:"HostIsolationMode,omitempty"` + // Status - Possible values include: 'Status4Invalid', 'Status4Downloading', 'Status4Activating', 'Status4Active', 'Status4Upgrading', 'Status4Deactivating' + Status Status4 `json:"Status,omitempty"` + // RunFrequencyInterval - The interval at which code package is run. This is used for periodic code package. + RunFrequencyInterval *string `json:"RunFrequencyInterval,omitempty"` + SetupEntryPoint *CodePackageEntryPoint `json:"SetupEntryPoint,omitempty"` + MainEntryPoint *CodePackageEntryPoint `json:"MainEntryPoint,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServicePackageHealth information about the health of a service package for a specific application +// deployed on a Service Fabric node. +type DeployedServicePackageHealth struct { + autorest.Response `json:"-"` + // ApplicationName - Name of the application. + ApplicationName *string `json:"ApplicationName,omitempty"` + // ServiceManifestName - Name of the service manifest. + ServiceManifestName *string `json:"ServiceManifestName,omitempty"` + // NodeName - Name of the node where this service package is deployed. + NodeName *string `json:"NodeName,omitempty"` + // AggregatedHealthState - The HealthState representing the aggregated health state of the entity computed by Health Manager. + // The health evaluation of the entity reflects all events reported on the entity and its children (if any). + // The aggregation is done by applying the desired health policy. + // . Possible values include: 'AggregatedHealthState1Invalid', 'AggregatedHealthState1Ok', 'AggregatedHealthState1Warning', 'AggregatedHealthState1Error', 'AggregatedHealthState1Unknown' + AggregatedHealthState AggregatedHealthState1 `json:"AggregatedHealthState,omitempty"` + // HealthEvents - The list of health events reported on the entity. + HealthEvents *[]HealthEvent `json:"HealthEvents,omitempty"` + // UnhealthyEvaluations - The unhealthy evaluations that show why the current aggregated health state was returned by Health Manager. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServicePackageHealthEvaluation represents health evaluation for a deployed service package, containing +// information about the data and the algorithm used by health store to evaluate health. The evaluation is returned +// only when the aggregated health state is either Error or Warning. +type DeployedServicePackageHealthEvaluation struct { + // NodeName - Name of the node. + NodeName *string `json:"NodeName,omitempty"` + // ApplicationName - Full name of the application. + ApplicationName *string `json:"ApplicationName,omitempty"` + // ServiceManifestName - Name of the service manifest. + ServiceManifestName *string `json:"ServiceManifestName,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the current aggregated health state. The type of the unhealthy evaluations can be EventHealthEvaluation. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) MarshalJSON() ([]byte, error) { + dsphe.Kind = KindDeployedServicePackage + objectMap := make(map[string]interface{}) + if dsphe.NodeName != nil { + objectMap["NodeName"] = dsphe.NodeName + } + if dsphe.ApplicationName != nil { + objectMap["ApplicationName"] = dsphe.ApplicationName + } + if dsphe.ServiceManifestName != nil { + objectMap["ServiceManifestName"] = dsphe.ServiceManifestName + } + if dsphe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = dsphe.UnhealthyEvaluations + } + if dsphe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = dsphe.AggregatedHealthState + } + if dsphe.Description != nil { + objectMap["Description"] = dsphe.Description + } + if dsphe.Kind != "" { + objectMap["Kind"] = dsphe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return &dsphe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackageHealthEvaluation. +func (dsphe DeployedServicePackageHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &dsphe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServicePackageHealthState represents the health state of a deployed service package, containing the +// entity identifier and the aggregated health state. +type DeployedServicePackageHealthState struct { + // NodeName - Name of the node on which the service package is deployed. + NodeName *string `json:"NodeName,omitempty"` + // ApplicationName - Full name of the application. + ApplicationName *string `json:"ApplicationName,omitempty"` + // ServiceManifestName - Name of the manifest describing the service package. + ServiceManifestName *string `json:"ServiceManifestName,omitempty"` + ServicePackageActivationID *string `json:"ServicePackageActivationId,omitempty"` + // AggregatedHealthState - Possible values include: 'AggregatedHealthState2Invalid', 'AggregatedHealthState2Ok', 'AggregatedHealthState2Warning', 'AggregatedHealthState2Error', 'AggregatedHealthState2Unknown' + AggregatedHealthState AggregatedHealthState2 `json:"AggregatedHealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServicePackageHealthStateChunk represents the health state chunk of a deployed service package, which +// contains the service manifest name and the service package aggregated health state. +type DeployedServicePackageHealthStateChunk struct { + // ServiceManifestName - The name of the service manifest. + ServiceManifestName *string `json:"ServiceManifestName,omitempty"` + ServicePackageActivationID *string `json:"ServicePackageActivationId,omitempty"` + // HealthState - Possible values include: 'HealthState2Invalid', 'HealthState2Ok', 'HealthState2Warning', 'HealthState2Error', 'HealthState2Unknown' + HealthState HealthState2 `json:"HealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServicePackageHealthStateChunkList the list of deployed service package health state chunks that respect +// the input filters in the chunk query. Returned by get cluster health state chunks query. +type DeployedServicePackageHealthStateChunkList struct { + // Items - The list of deployed service package health state chunks that respect the input filters in the chunk query. + Items *[]DeployedServicePackageHealthStateChunk `json:"Items,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServicePackageHealthStateFilter defines matching criteria to determine whether a deployed service +// package should be included as a child of a deployed application in the cluster health chunk. +// The deployed service packages are only returned if the parent entities match a filter specified in the cluster +// health chunk query description. The parent deployed application and its parent application must be included in +// the cluster health chunk. +// One filter can match zero, one or multiple deployed service packages, depending on its properties. +type DeployedServicePackageHealthStateFilter struct { + // ServiceManifestNameFilter - The name of the service manifest which identifies the deployed service packages that matches the filter. + // If specified, the filter is applied only to the specified deployed service packages, if any. + // If no deployed service packages with specified manifest name exist, nothing is returned in the cluster health chunk based on this filter. + // If any deployed service package exists, they are included in the cluster health chunk if it respects the other filter properties. + // If not specified, all deployed service packages that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + ServiceManifestNameFilter *string `json:"ServiceManifestNameFilter,omitempty"` + // ServicePackageActivationIDFilter - The activation ID of a deployed service package that matches the filter. + // If not specified, the filter applies to all deployed service packages that match the other parameters. + // If specified, the filter matches only the deployed service package with the specified activation ID. + ServicePackageActivationIDFilter *string `json:"ServicePackageActivationIdFilter,omitempty"` + // HealthStateFilter - The filter for the health state of the deployed service packages. It allows selecting deployed service packages if they match the desired health states. + // The possible values are integer value of one of the following health states. Only deployed service packages that match the filter are returned. All deployed service packages are used to evaluate the parent deployed application aggregated health state. + // If not specified, default value is None, unless the deployed service package id is specified. If the filter has default value and deployed service package id is specified, the matching deployed service package is returned. + // The state values are flag based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + // For example, if the provided value is 6, it matches deployed service packages with HealthState value of OK (2) and Warning (4). + // - Default - Default value. Matches any HealthState. The value is zero. + // - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + // - Ok - Filter that matches input with HealthState value Ok. The value is 2. + // - Warning - Filter that matches input with HealthState value Warning. The value is 4. + // - Error - Filter that matches input with HealthState value Error. The value is 8. + // - All - Filter that matches input with any HealthState value. The value is 65535. + HealthStateFilter *int32 `json:"HealthStateFilter,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServicePackageInfo information about service package deployed on a Service Fabric node. +type DeployedServicePackageInfo struct { + // Name - The name of the service package. + Name *string `json:"Name,omitempty"` + // Version - The version of the service package specified in service manifest. + Version *string `json:"Version,omitempty"` + // Status - Possible values include: 'Status7Invalid', 'Status7Downloading', 'Status7Activating', 'Status7Active', 'Status7Upgrading', 'Status7Deactivating' + Status Status7 `json:"Status,omitempty"` + ServicePackageActivationID *string `json:"ServicePackageActivationId,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServicePackagesHealthEvaluation represents health evaluation for deployed service packages, containing +// health evaluations for each unhealthy deployed service package that impacted current aggregated health state. +// Can be returned when evaluating deployed application health and the aggregated health state is either Error or +// Warning. +type DeployedServicePackagesHealthEvaluation struct { + // TotalCount - Total number of deployed service packages of the deployed application in the health store. + TotalCount *int64 `json:"TotalCount,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy DeployedServicePackageHealthEvaluation that impacted the aggregated health. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) MarshalJSON() ([]byte, error) { + dsphe.Kind = KindDeployedServicePackages + objectMap := make(map[string]interface{}) + if dsphe.TotalCount != nil { + objectMap["TotalCount"] = dsphe.TotalCount + } + if dsphe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = dsphe.UnhealthyEvaluations + } + if dsphe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = dsphe.AggregatedHealthState + } + if dsphe.Description != nil { + objectMap["Description"] = dsphe.Description + } + if dsphe.Kind != "" { + objectMap["Kind"] = dsphe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return &dsphe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for DeployedServicePackagesHealthEvaluation. +func (dsphe DeployedServicePackagesHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &dsphe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicDeployedServiceReplicaDetailInfo information about a Service Fabric service replica deployed on a node. +type BasicDeployedServiceReplicaDetailInfo interface { + AsDeployedStatefulServiceReplicaDetailInfo() (*DeployedStatefulServiceReplicaDetailInfo, bool) + AsDeployedStatelessServiceInstanceDetailInfo() (*DeployedStatelessServiceInstanceDetailInfo, bool) + AsDeployedServiceReplicaDetailInfo() (*DeployedServiceReplicaDetailInfo, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServiceReplicaDetailInfo information about a Service Fabric service replica deployed on a node. +type DeployedServiceReplicaDetailInfo struct { + autorest.Response `json:"-"` + // ServiceName - Full hierarchical name of the service in URI format starting with `fabric:`. + ServiceName *string `json:"ServiceName,omitempty"` + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // CurrentServiceOperation - Possible values include: 'CurrentServiceOperationUnknown', 'CurrentServiceOperationNone', 'CurrentServiceOperationOpen', 'CurrentServiceOperationChangeRole', 'CurrentServiceOperationClose', 'CurrentServiceOperationAbort' + CurrentServiceOperation CurrentServiceOperation `json:"CurrentServiceOperation,omitempty"` + // CurrentServiceOperationStartTimeUtc - The start time of the current service operation in UTC format. + CurrentServiceOperationStartTimeUtc *date.Time `json:"CurrentServiceOperationStartTimeUtc,omitempty"` + ReportedLoad *[]LoadMetricReportInfo `json:"ReportedLoad,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindDeployedServiceReplicaDetailInfo', 'ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateful', 'ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateless' + ServiceKind ServiceKindBasicDeployedServiceReplicaDetailInfo `json:"ServiceKind,omitempty"` +} + +func unmarshalBasicDeployedServiceReplicaDetailInfo(body []byte) (BasicDeployedServiceReplicaDetailInfo, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["ServiceKind"] { + case string(ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateful): + var dssrdi DeployedStatefulServiceReplicaDetailInfo + err := json.Unmarshal(body, &dssrdi) + return dssrdi, err + case string(ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateless): + var dssidi DeployedStatelessServiceInstanceDetailInfo + err := json.Unmarshal(body, &dssidi) + return dssidi, err + default: + var dsrdi DeployedServiceReplicaDetailInfo + err := json.Unmarshal(body, &dsrdi) + return dsrdi, err + } +} +func unmarshalBasicDeployedServiceReplicaDetailInfoArray(body []byte) ([]BasicDeployedServiceReplicaDetailInfo, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dsrdiArray := make([]BasicDeployedServiceReplicaDetailInfo, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dsrdi, err := unmarshalBasicDeployedServiceReplicaDetailInfo(*rawMessage) + if err != nil { + return nil, err + } + dsrdiArray[index] = dsrdi + } + return dsrdiArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for DeployedServiceReplicaDetailInfo. +func (dsrdi DeployedServiceReplicaDetailInfo) MarshalJSON() ([]byte, error) { + dsrdi.ServiceKind = ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindDeployedServiceReplicaDetailInfo + objectMap := make(map[string]interface{}) + if dsrdi.ServiceName != nil { + objectMap["ServiceName"] = dsrdi.ServiceName + } + if dsrdi.PartitionID != nil { + objectMap["PartitionId"] = dsrdi.PartitionID + } + if dsrdi.CurrentServiceOperation != "" { + objectMap["CurrentServiceOperation"] = dsrdi.CurrentServiceOperation + } + if dsrdi.CurrentServiceOperationStartTimeUtc != nil { + objectMap["CurrentServiceOperationStartTimeUtc"] = dsrdi.CurrentServiceOperationStartTimeUtc + } + if dsrdi.ReportedLoad != nil { + objectMap["ReportedLoad"] = dsrdi.ReportedLoad + } + if dsrdi.ServiceKind != "" { + objectMap["ServiceKind"] = dsrdi.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedStatefulServiceReplicaDetailInfo is the BasicDeployedServiceReplicaDetailInfo implementation for DeployedServiceReplicaDetailInfo. +func (dsrdi DeployedServiceReplicaDetailInfo) AsDeployedStatefulServiceReplicaDetailInfo() (*DeployedStatefulServiceReplicaDetailInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedStatelessServiceInstanceDetailInfo is the BasicDeployedServiceReplicaDetailInfo implementation for DeployedServiceReplicaDetailInfo. +func (dsrdi DeployedServiceReplicaDetailInfo) AsDeployedStatelessServiceInstanceDetailInfo() (*DeployedStatelessServiceInstanceDetailInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServiceReplicaDetailInfo is the BasicDeployedServiceReplicaDetailInfo implementation for DeployedServiceReplicaDetailInfo. +func (dsrdi DeployedServiceReplicaDetailInfo) AsDeployedServiceReplicaDetailInfo() (*DeployedServiceReplicaDetailInfo, bool) { + return &dsrdi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicDeployedServiceReplicaDetailInfo is the BasicDeployedServiceReplicaDetailInfo implementation for DeployedServiceReplicaDetailInfo. +func (dsrdi DeployedServiceReplicaDetailInfo) AsBasicDeployedServiceReplicaDetailInfo() (BasicDeployedServiceReplicaDetailInfo, bool) { + return &dsrdi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServiceReplicaDetailInfoModel ... +type DeployedServiceReplicaDetailInfoModel struct { + autorest.Response `json:"-"` + Value BasicDeployedServiceReplicaDetailInfo `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for DeployedServiceReplicaDetailInfoModel struct. +func (dsrdim *DeployedServiceReplicaDetailInfoModel) UnmarshalJSON(body []byte) error { + dsrdi, err := unmarshalBasicDeployedServiceReplicaDetailInfo(body) + if err != nil { + return err + } + dsrdim.Value = dsrdi + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicDeployedServiceReplicaInfo information about a Service Fabric service replica deployed on a node. +type BasicDeployedServiceReplicaInfo interface { + AsDeployedStatefulServiceReplicaInfo() (*DeployedStatefulServiceReplicaInfo, bool) + AsDeployedStatelessServiceInstanceInfo() (*DeployedStatelessServiceInstanceInfo, bool) + AsDeployedServiceReplicaInfo() (*DeployedServiceReplicaInfo, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServiceReplicaInfo information about a Service Fabric service replica deployed on a node. +type DeployedServiceReplicaInfo struct { + // ServiceName - Full hierarchical name of the service in URI format starting with `fabric:`. + ServiceName *string `json:"ServiceName,omitempty"` + // ServiceTypeName - Name of the service type as specified in the service manifest. + ServiceTypeName *string `json:"ServiceTypeName,omitempty"` + // ServiceManifestName - The name of the service manifest in which this service type is defined. + ServiceManifestName *string `json:"ServiceManifestName,omitempty"` + // CodePackageName - The name of the code package that hosts this replica. + CodePackageName *string `json:"CodePackageName,omitempty"` + PartitionID *uuid.UUID `json:"PartitionID,omitempty"` + // ReplicaStatus - Possible values include: 'ReplicaStatusInvalid', 'ReplicaStatusInBuild', 'ReplicaStatusStandby', 'ReplicaStatusReady', 'ReplicaStatusDown', 'ReplicaStatusDropped' + ReplicaStatus ReplicaStatus `json:"ReplicaStatus,omitempty"` + // Address - The last address returned by the replica in Open or ChangeRole. + Address *string `json:"Address,omitempty"` + ServicePackageActivationID *string `json:"ServicePackageActivationId,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindDeployedServiceReplicaInfo', 'ServiceKindStateful', 'ServiceKindStateless' + ServiceKind ServiceKind `json:"ServiceKind,omitempty"` +} + +func unmarshalBasicDeployedServiceReplicaInfo(body []byte) (BasicDeployedServiceReplicaInfo, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["ServiceKind"] { + case string(ServiceKindStateful): + var dssri DeployedStatefulServiceReplicaInfo + err := json.Unmarshal(body, &dssri) + return dssri, err + case string(ServiceKindStateless): + var dssii DeployedStatelessServiceInstanceInfo + err := json.Unmarshal(body, &dssii) + return dssii, err + default: + var dsri DeployedServiceReplicaInfo + err := json.Unmarshal(body, &dsri) + return dsri, err + } +} +func unmarshalBasicDeployedServiceReplicaInfoArray(body []byte) ([]BasicDeployedServiceReplicaInfo, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dsriArray := make([]BasicDeployedServiceReplicaInfo, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dsri, err := unmarshalBasicDeployedServiceReplicaInfo(*rawMessage) + if err != nil { + return nil, err + } + dsriArray[index] = dsri + } + return dsriArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for DeployedServiceReplicaInfo. +func (dsri DeployedServiceReplicaInfo) MarshalJSON() ([]byte, error) { + dsri.ServiceKind = ServiceKindDeployedServiceReplicaInfo + objectMap := make(map[string]interface{}) + if dsri.ServiceName != nil { + objectMap["ServiceName"] = dsri.ServiceName + } + if dsri.ServiceTypeName != nil { + objectMap["ServiceTypeName"] = dsri.ServiceTypeName + } + if dsri.ServiceManifestName != nil { + objectMap["ServiceManifestName"] = dsri.ServiceManifestName + } + if dsri.CodePackageName != nil { + objectMap["CodePackageName"] = dsri.CodePackageName + } + if dsri.PartitionID != nil { + objectMap["PartitionID"] = dsri.PartitionID + } + if dsri.ReplicaStatus != "" { + objectMap["ReplicaStatus"] = dsri.ReplicaStatus + } + if dsri.Address != nil { + objectMap["Address"] = dsri.Address + } + if dsri.ServicePackageActivationID != nil { + objectMap["ServicePackageActivationId"] = dsri.ServicePackageActivationID + } + if dsri.ServiceKind != "" { + objectMap["ServiceKind"] = dsri.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedStatefulServiceReplicaInfo is the BasicDeployedServiceReplicaInfo implementation for DeployedServiceReplicaInfo. +func (dsri DeployedServiceReplicaInfo) AsDeployedStatefulServiceReplicaInfo() (*DeployedStatefulServiceReplicaInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedStatelessServiceInstanceInfo is the BasicDeployedServiceReplicaInfo implementation for DeployedServiceReplicaInfo. +func (dsri DeployedServiceReplicaInfo) AsDeployedStatelessServiceInstanceInfo() (*DeployedStatelessServiceInstanceInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServiceReplicaInfo is the BasicDeployedServiceReplicaInfo implementation for DeployedServiceReplicaInfo. +func (dsri DeployedServiceReplicaInfo) AsDeployedServiceReplicaInfo() (*DeployedServiceReplicaInfo, bool) { + return &dsri, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicDeployedServiceReplicaInfo is the BasicDeployedServiceReplicaInfo implementation for DeployedServiceReplicaInfo. +func (dsri DeployedServiceReplicaInfo) AsBasicDeployedServiceReplicaInfo() (BasicDeployedServiceReplicaInfo, bool) { + return &dsri, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedServiceTypeInfo information about service type deployed on a node, information such as the status of the +// service type registration on a node. +type DeployedServiceTypeInfo struct { + autorest.Response `json:"-"` + // ServiceTypeName - The name of the service type defined in the service manifest. + ServiceTypeName *string `json:"ServiceTypeName,omitempty"` + // ServiceManifestName - The name of the service manifest in which this service type is defined. + ServiceManifestName *string `json:"ServiceManifestName,omitempty"` + // CodePackageName - The name of the code package that registered the service type. + CodePackageName *string `json:"CodePackageName,omitempty"` + // Status - Possible values include: 'Status8Invalid', 'Status8Disabled', 'Status8Enabled', 'Status8Registered' + Status Status8 `json:"Status,omitempty"` + ServicePackageActivationID *string `json:"ServicePackageActivationId,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedStatefulServiceReplicaDetailInfo information about a stateful replica running in a code package. +type DeployedStatefulServiceReplicaDetailInfo struct { + // ReplicaID - Id of the stateful service replica. + ReplicaID *string `json:"ReplicaId,omitempty"` + // CurrentReplicatorOperation - Possible values include: 'CurrentReplicatorOperationInvalid', 'CurrentReplicatorOperationNone', 'CurrentReplicatorOperationOpen', 'CurrentReplicatorOperationChangeRole', 'CurrentReplicatorOperationUpdateEpoch', 'CurrentReplicatorOperationClose', 'CurrentReplicatorOperationAbort', 'CurrentReplicatorOperationOnDataLoss', 'CurrentReplicatorOperationWaitForCatchup', 'CurrentReplicatorOperationBuild' + CurrentReplicatorOperation CurrentReplicatorOperation `json:"CurrentReplicatorOperation,omitempty"` + // ReadStatus - Possible values include: 'ReadStatusInvalid', 'ReadStatusGranted', 'ReadStatusReconfigurationPending', 'ReadStatusNotPrimary', 'ReadStatusNoWriteQuorum' + ReadStatus ReadStatus `json:"ReadStatus,omitempty"` + // WriteStatus - Possible values include: 'WriteStatusInvalid', 'WriteStatusGranted', 'WriteStatusReconfigurationPending', 'WriteStatusNotPrimary', 'WriteStatusNoWriteQuorum' + WriteStatus WriteStatus `json:"WriteStatus,omitempty"` + ReplicatorStatus BasicReplicatorStatus `json:"ReplicatorStatus,omitempty"` + ReplicaStatus *KeyValueStoreReplicaStatus `json:"ReplicaStatus,omitempty"` + // ServiceName - Full hierarchical name of the service in URI format starting with `fabric:`. + ServiceName *string `json:"ServiceName,omitempty"` + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // CurrentServiceOperation - Possible values include: 'CurrentServiceOperationUnknown', 'CurrentServiceOperationNone', 'CurrentServiceOperationOpen', 'CurrentServiceOperationChangeRole', 'CurrentServiceOperationClose', 'CurrentServiceOperationAbort' + CurrentServiceOperation CurrentServiceOperation `json:"CurrentServiceOperation,omitempty"` + // CurrentServiceOperationStartTimeUtc - The start time of the current service operation in UTC format. + CurrentServiceOperationStartTimeUtc *date.Time `json:"CurrentServiceOperationStartTimeUtc,omitempty"` + ReportedLoad *[]LoadMetricReportInfo `json:"ReportedLoad,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindDeployedServiceReplicaDetailInfo', 'ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateful', 'ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateless' + ServiceKind ServiceKindBasicDeployedServiceReplicaDetailInfo `json:"ServiceKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for DeployedStatefulServiceReplicaDetailInfo. +func (dssrdi DeployedStatefulServiceReplicaDetailInfo) MarshalJSON() ([]byte, error) { + dssrdi.ServiceKind = ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateful + objectMap := make(map[string]interface{}) + if dssrdi.ReplicaID != nil { + objectMap["ReplicaId"] = dssrdi.ReplicaID + } + if dssrdi.CurrentReplicatorOperation != "" { + objectMap["CurrentReplicatorOperation"] = dssrdi.CurrentReplicatorOperation + } + if dssrdi.ReadStatus != "" { + objectMap["ReadStatus"] = dssrdi.ReadStatus + } + if dssrdi.WriteStatus != "" { + objectMap["WriteStatus"] = dssrdi.WriteStatus + } + objectMap["ReplicatorStatus"] = dssrdi.ReplicatorStatus + if dssrdi.ReplicaStatus != nil { + objectMap["ReplicaStatus"] = dssrdi.ReplicaStatus + } + if dssrdi.ServiceName != nil { + objectMap["ServiceName"] = dssrdi.ServiceName + } + if dssrdi.PartitionID != nil { + objectMap["PartitionId"] = dssrdi.PartitionID + } + if dssrdi.CurrentServiceOperation != "" { + objectMap["CurrentServiceOperation"] = dssrdi.CurrentServiceOperation + } + if dssrdi.CurrentServiceOperationStartTimeUtc != nil { + objectMap["CurrentServiceOperationStartTimeUtc"] = dssrdi.CurrentServiceOperationStartTimeUtc + } + if dssrdi.ReportedLoad != nil { + objectMap["ReportedLoad"] = dssrdi.ReportedLoad + } + if dssrdi.ServiceKind != "" { + objectMap["ServiceKind"] = dssrdi.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedStatefulServiceReplicaDetailInfo is the BasicDeployedServiceReplicaDetailInfo implementation for DeployedStatefulServiceReplicaDetailInfo. +func (dssrdi DeployedStatefulServiceReplicaDetailInfo) AsDeployedStatefulServiceReplicaDetailInfo() (*DeployedStatefulServiceReplicaDetailInfo, bool) { + return &dssrdi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedStatelessServiceInstanceDetailInfo is the BasicDeployedServiceReplicaDetailInfo implementation for DeployedStatefulServiceReplicaDetailInfo. +func (dssrdi DeployedStatefulServiceReplicaDetailInfo) AsDeployedStatelessServiceInstanceDetailInfo() (*DeployedStatelessServiceInstanceDetailInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServiceReplicaDetailInfo is the BasicDeployedServiceReplicaDetailInfo implementation for DeployedStatefulServiceReplicaDetailInfo. +func (dssrdi DeployedStatefulServiceReplicaDetailInfo) AsDeployedServiceReplicaDetailInfo() (*DeployedServiceReplicaDetailInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicDeployedServiceReplicaDetailInfo is the BasicDeployedServiceReplicaDetailInfo implementation for DeployedStatefulServiceReplicaDetailInfo. +func (dssrdi DeployedStatefulServiceReplicaDetailInfo) AsBasicDeployedServiceReplicaDetailInfo() (BasicDeployedServiceReplicaDetailInfo, bool) { + return &dssrdi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for DeployedStatefulServiceReplicaDetailInfo struct. +func (dssrdi *DeployedStatefulServiceReplicaDetailInfo) 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 "ReplicaId": + if v != nil { + var replicaID string + err = json.Unmarshal(*v, &replicaID) + if err != nil { + return err + } + dssrdi.ReplicaID = &replicaID + } + case "CurrentReplicatorOperation": + if v != nil { + var currentReplicatorOperation CurrentReplicatorOperation + err = json.Unmarshal(*v, ¤tReplicatorOperation) + if err != nil { + return err + } + dssrdi.CurrentReplicatorOperation = currentReplicatorOperation + } + case "ReadStatus": + if v != nil { + var readStatus ReadStatus + err = json.Unmarshal(*v, &readStatus) + if err != nil { + return err + } + dssrdi.ReadStatus = readStatus + } + case "WriteStatus": + if v != nil { + var writeStatus WriteStatus + err = json.Unmarshal(*v, &writeStatus) + if err != nil { + return err + } + dssrdi.WriteStatus = writeStatus + } + case "ReplicatorStatus": + if v != nil { + replicatorStatus, err := unmarshalBasicReplicatorStatus(*v) + if err != nil { + return err + } + dssrdi.ReplicatorStatus = replicatorStatus + } + case "ReplicaStatus": + if v != nil { + var replicaStatus KeyValueStoreReplicaStatus + err = json.Unmarshal(*v, &replicaStatus) + if err != nil { + return err + } + dssrdi.ReplicaStatus = &replicaStatus + } + case "ServiceName": + if v != nil { + var serviceName string + err = json.Unmarshal(*v, &serviceName) + if err != nil { + return err + } + dssrdi.ServiceName = &serviceName + } + case "PartitionId": + if v != nil { + var partitionID uuid.UUID + err = json.Unmarshal(*v, &partitionID) + if err != nil { + return err + } + dssrdi.PartitionID = &partitionID + } + case "CurrentServiceOperation": + if v != nil { + var currentServiceOperation CurrentServiceOperation + err = json.Unmarshal(*v, ¤tServiceOperation) + if err != nil { + return err + } + dssrdi.CurrentServiceOperation = currentServiceOperation + } + case "CurrentServiceOperationStartTimeUtc": + if v != nil { + var currentServiceOperationStartTimeUtc date.Time + err = json.Unmarshal(*v, ¤tServiceOperationStartTimeUtc) + if err != nil { + return err + } + dssrdi.CurrentServiceOperationStartTimeUtc = ¤tServiceOperationStartTimeUtc + } + case "ReportedLoad": + if v != nil { + var reportedLoad []LoadMetricReportInfo + err = json.Unmarshal(*v, &reportedLoad) + if err != nil { + return err + } + dssrdi.ReportedLoad = &reportedLoad + } + case "ServiceKind": + if v != nil { + var serviceKind ServiceKindBasicDeployedServiceReplicaDetailInfo + err = json.Unmarshal(*v, &serviceKind) + if err != nil { + return err + } + dssrdi.ServiceKind = serviceKind + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedStatefulServiceReplicaInfo information about a stateful service replica deployed on a node. +type DeployedStatefulServiceReplicaInfo struct { + // ReplicaID - Id of the stateful service replica. + ReplicaID *string `json:"ReplicaId,omitempty"` + // ReplicaRole - Possible values include: 'ReplicaRoleUnknown', 'ReplicaRoleNone', 'ReplicaRolePrimary', 'ReplicaRoleIdleSecondary', 'ReplicaRoleActiveSecondary' + ReplicaRole ReplicaRole `json:"ReplicaRole,omitempty"` + // ServiceName - Full hierarchical name of the service in URI format starting with `fabric:`. + ServiceName *string `json:"ServiceName,omitempty"` + // ServiceTypeName - Name of the service type as specified in the service manifest. + ServiceTypeName *string `json:"ServiceTypeName,omitempty"` + // ServiceManifestName - The name of the service manifest in which this service type is defined. + ServiceManifestName *string `json:"ServiceManifestName,omitempty"` + // CodePackageName - The name of the code package that hosts this replica. + CodePackageName *string `json:"CodePackageName,omitempty"` + PartitionID *uuid.UUID `json:"PartitionID,omitempty"` + // ReplicaStatus - Possible values include: 'ReplicaStatusInvalid', 'ReplicaStatusInBuild', 'ReplicaStatusStandby', 'ReplicaStatusReady', 'ReplicaStatusDown', 'ReplicaStatusDropped' + ReplicaStatus ReplicaStatus `json:"ReplicaStatus,omitempty"` + // Address - The last address returned by the replica in Open or ChangeRole. + Address *string `json:"Address,omitempty"` + ServicePackageActivationID *string `json:"ServicePackageActivationId,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindDeployedServiceReplicaInfo', 'ServiceKindStateful', 'ServiceKindStateless' + ServiceKind ServiceKind `json:"ServiceKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for DeployedStatefulServiceReplicaInfo. +func (dssri DeployedStatefulServiceReplicaInfo) MarshalJSON() ([]byte, error) { + dssri.ServiceKind = ServiceKindStateful + objectMap := make(map[string]interface{}) + if dssri.ReplicaID != nil { + objectMap["ReplicaId"] = dssri.ReplicaID + } + if dssri.ReplicaRole != "" { + objectMap["ReplicaRole"] = dssri.ReplicaRole + } + if dssri.ServiceName != nil { + objectMap["ServiceName"] = dssri.ServiceName + } + if dssri.ServiceTypeName != nil { + objectMap["ServiceTypeName"] = dssri.ServiceTypeName + } + if dssri.ServiceManifestName != nil { + objectMap["ServiceManifestName"] = dssri.ServiceManifestName + } + if dssri.CodePackageName != nil { + objectMap["CodePackageName"] = dssri.CodePackageName + } + if dssri.PartitionID != nil { + objectMap["PartitionID"] = dssri.PartitionID + } + if dssri.ReplicaStatus != "" { + objectMap["ReplicaStatus"] = dssri.ReplicaStatus + } + if dssri.Address != nil { + objectMap["Address"] = dssri.Address + } + if dssri.ServicePackageActivationID != nil { + objectMap["ServicePackageActivationId"] = dssri.ServicePackageActivationID + } + if dssri.ServiceKind != "" { + objectMap["ServiceKind"] = dssri.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedStatefulServiceReplicaInfo is the BasicDeployedServiceReplicaInfo implementation for DeployedStatefulServiceReplicaInfo. +func (dssri DeployedStatefulServiceReplicaInfo) AsDeployedStatefulServiceReplicaInfo() (*DeployedStatefulServiceReplicaInfo, bool) { + return &dssri, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedStatelessServiceInstanceInfo is the BasicDeployedServiceReplicaInfo implementation for DeployedStatefulServiceReplicaInfo. +func (dssri DeployedStatefulServiceReplicaInfo) AsDeployedStatelessServiceInstanceInfo() (*DeployedStatelessServiceInstanceInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServiceReplicaInfo is the BasicDeployedServiceReplicaInfo implementation for DeployedStatefulServiceReplicaInfo. +func (dssri DeployedStatefulServiceReplicaInfo) AsDeployedServiceReplicaInfo() (*DeployedServiceReplicaInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicDeployedServiceReplicaInfo is the BasicDeployedServiceReplicaInfo implementation for DeployedStatefulServiceReplicaInfo. +func (dssri DeployedStatefulServiceReplicaInfo) AsBasicDeployedServiceReplicaInfo() (BasicDeployedServiceReplicaInfo, bool) { + return &dssri, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedStatelessServiceInstanceDetailInfo information about a stateless instance running in a code package. +type DeployedStatelessServiceInstanceDetailInfo struct { + // InstanceID - Id of the stateless service instance. + InstanceID *string `json:"InstanceId,omitempty"` + // ServiceName - Full hierarchical name of the service in URI format starting with `fabric:`. + ServiceName *string `json:"ServiceName,omitempty"` + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // CurrentServiceOperation - Possible values include: 'CurrentServiceOperationUnknown', 'CurrentServiceOperationNone', 'CurrentServiceOperationOpen', 'CurrentServiceOperationChangeRole', 'CurrentServiceOperationClose', 'CurrentServiceOperationAbort' + CurrentServiceOperation CurrentServiceOperation `json:"CurrentServiceOperation,omitempty"` + // CurrentServiceOperationStartTimeUtc - The start time of the current service operation in UTC format. + CurrentServiceOperationStartTimeUtc *date.Time `json:"CurrentServiceOperationStartTimeUtc,omitempty"` + ReportedLoad *[]LoadMetricReportInfo `json:"ReportedLoad,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindDeployedServiceReplicaDetailInfo', 'ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateful', 'ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateless' + ServiceKind ServiceKindBasicDeployedServiceReplicaDetailInfo `json:"ServiceKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for DeployedStatelessServiceInstanceDetailInfo. +func (dssidi DeployedStatelessServiceInstanceDetailInfo) MarshalJSON() ([]byte, error) { + dssidi.ServiceKind = ServiceKindBasicDeployedServiceReplicaDetailInfoServiceKindStateless + objectMap := make(map[string]interface{}) + if dssidi.InstanceID != nil { + objectMap["InstanceId"] = dssidi.InstanceID + } + if dssidi.ServiceName != nil { + objectMap["ServiceName"] = dssidi.ServiceName + } + if dssidi.PartitionID != nil { + objectMap["PartitionId"] = dssidi.PartitionID + } + if dssidi.CurrentServiceOperation != "" { + objectMap["CurrentServiceOperation"] = dssidi.CurrentServiceOperation + } + if dssidi.CurrentServiceOperationStartTimeUtc != nil { + objectMap["CurrentServiceOperationStartTimeUtc"] = dssidi.CurrentServiceOperationStartTimeUtc + } + if dssidi.ReportedLoad != nil { + objectMap["ReportedLoad"] = dssidi.ReportedLoad + } + if dssidi.ServiceKind != "" { + objectMap["ServiceKind"] = dssidi.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedStatefulServiceReplicaDetailInfo is the BasicDeployedServiceReplicaDetailInfo implementation for DeployedStatelessServiceInstanceDetailInfo. +func (dssidi DeployedStatelessServiceInstanceDetailInfo) AsDeployedStatefulServiceReplicaDetailInfo() (*DeployedStatefulServiceReplicaDetailInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedStatelessServiceInstanceDetailInfo is the BasicDeployedServiceReplicaDetailInfo implementation for DeployedStatelessServiceInstanceDetailInfo. +func (dssidi DeployedStatelessServiceInstanceDetailInfo) AsDeployedStatelessServiceInstanceDetailInfo() (*DeployedStatelessServiceInstanceDetailInfo, bool) { + return &dssidi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServiceReplicaDetailInfo is the BasicDeployedServiceReplicaDetailInfo implementation for DeployedStatelessServiceInstanceDetailInfo. +func (dssidi DeployedStatelessServiceInstanceDetailInfo) AsDeployedServiceReplicaDetailInfo() (*DeployedServiceReplicaDetailInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicDeployedServiceReplicaDetailInfo is the BasicDeployedServiceReplicaDetailInfo implementation for DeployedStatelessServiceInstanceDetailInfo. +func (dssidi DeployedStatelessServiceInstanceDetailInfo) AsBasicDeployedServiceReplicaDetailInfo() (BasicDeployedServiceReplicaDetailInfo, bool) { + return &dssidi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployedStatelessServiceInstanceInfo information about a stateless service instance deployed on a node. +type DeployedStatelessServiceInstanceInfo struct { + // InstanceID - Id of the stateless service instance. + InstanceID *string `json:"InstanceId,omitempty"` + // ServiceName - Full hierarchical name of the service in URI format starting with `fabric:`. + ServiceName *string `json:"ServiceName,omitempty"` + // ServiceTypeName - Name of the service type as specified in the service manifest. + ServiceTypeName *string `json:"ServiceTypeName,omitempty"` + // ServiceManifestName - The name of the service manifest in which this service type is defined. + ServiceManifestName *string `json:"ServiceManifestName,omitempty"` + // CodePackageName - The name of the code package that hosts this replica. + CodePackageName *string `json:"CodePackageName,omitempty"` + PartitionID *uuid.UUID `json:"PartitionID,omitempty"` + // ReplicaStatus - Possible values include: 'ReplicaStatusInvalid', 'ReplicaStatusInBuild', 'ReplicaStatusStandby', 'ReplicaStatusReady', 'ReplicaStatusDown', 'ReplicaStatusDropped' + ReplicaStatus ReplicaStatus `json:"ReplicaStatus,omitempty"` + // Address - The last address returned by the replica in Open or ChangeRole. + Address *string `json:"Address,omitempty"` + ServicePackageActivationID *string `json:"ServicePackageActivationId,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindDeployedServiceReplicaInfo', 'ServiceKindStateful', 'ServiceKindStateless' + ServiceKind ServiceKind `json:"ServiceKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for DeployedStatelessServiceInstanceInfo. +func (dssii DeployedStatelessServiceInstanceInfo) MarshalJSON() ([]byte, error) { + dssii.ServiceKind = ServiceKindStateless + objectMap := make(map[string]interface{}) + if dssii.InstanceID != nil { + objectMap["InstanceId"] = dssii.InstanceID + } + if dssii.ServiceName != nil { + objectMap["ServiceName"] = dssii.ServiceName + } + if dssii.ServiceTypeName != nil { + objectMap["ServiceTypeName"] = dssii.ServiceTypeName + } + if dssii.ServiceManifestName != nil { + objectMap["ServiceManifestName"] = dssii.ServiceManifestName + } + if dssii.CodePackageName != nil { + objectMap["CodePackageName"] = dssii.CodePackageName + } + if dssii.PartitionID != nil { + objectMap["PartitionID"] = dssii.PartitionID + } + if dssii.ReplicaStatus != "" { + objectMap["ReplicaStatus"] = dssii.ReplicaStatus + } + if dssii.Address != nil { + objectMap["Address"] = dssii.Address + } + if dssii.ServicePackageActivationID != nil { + objectMap["ServicePackageActivationId"] = dssii.ServicePackageActivationID + } + if dssii.ServiceKind != "" { + objectMap["ServiceKind"] = dssii.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedStatefulServiceReplicaInfo is the BasicDeployedServiceReplicaInfo implementation for DeployedStatelessServiceInstanceInfo. +func (dssii DeployedStatelessServiceInstanceInfo) AsDeployedStatefulServiceReplicaInfo() (*DeployedStatefulServiceReplicaInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedStatelessServiceInstanceInfo is the BasicDeployedServiceReplicaInfo implementation for DeployedStatelessServiceInstanceInfo. +func (dssii DeployedStatelessServiceInstanceInfo) AsDeployedStatelessServiceInstanceInfo() (*DeployedStatelessServiceInstanceInfo, bool) { + return &dssii, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServiceReplicaInfo is the BasicDeployedServiceReplicaInfo implementation for DeployedStatelessServiceInstanceInfo. +func (dssii DeployedStatelessServiceInstanceInfo) AsDeployedServiceReplicaInfo() (*DeployedServiceReplicaInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicDeployedServiceReplicaInfo is the BasicDeployedServiceReplicaInfo implementation for DeployedStatelessServiceInstanceInfo. +func (dssii DeployedStatelessServiceInstanceInfo) AsBasicDeployedServiceReplicaInfo() (BasicDeployedServiceReplicaInfo, bool) { + return &dssii, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// DeployServicePackageToNodeDescription defines description for downloading packages associated with a service +// manifest to image cache on a Service Fabric node. +type DeployServicePackageToNodeDescription struct { + // ServiceManifestName - The name of service manifest whose packages need to be downloaded. + ServiceManifestName *string `json:"ServiceManifestName,omitempty"` + ApplicationTypeName *string `json:"ApplicationTypeName,omitempty"` + ApplicationTypeVersion *string `json:"ApplicationTypeVersion,omitempty"` + NodeName *string `json:"NodeName,omitempty"` + PackageSharingPolicy *[]PackageSharingPolicyInfo `json:"PackageSharingPolicy,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// EnsureAvailabilitySafetyCheck safety check that waits for ensures the avaiability of the partition. It waits +// until there are replicas avaiabile such that bring down this replica will not cause avaiability loss for the +// partition. +type EnsureAvailabilitySafetyCheck struct { + // PartitionID - Id of the partition which is undergoing the safety check. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // Kind - Possible values include: 'KindSafetyCheck', 'KindPartitionSafetyCheck', 'KindEnsureAvailability', 'KindEnsurePartitionQuorum', 'KindEnsureSeedNodeQuorum', 'KindWaitForInbuildReplica', 'KindWaitForPrimaryPlacement', 'KindWaitForPrimarySwap', 'KindWaitForReconfiguration' + Kind KindBasicSafetyCheck `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for EnsureAvailabilitySafetyCheck. +func (easc EnsureAvailabilitySafetyCheck) MarshalJSON() ([]byte, error) { + easc.Kind = KindEnsureAvailability + objectMap := make(map[string]interface{}) + if easc.PartitionID != nil { + objectMap["PartitionId"] = easc.PartitionID + } + if easc.Kind != "" { + objectMap["Kind"] = easc.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionSafetyCheck is the BasicSafetyCheck implementation for EnsureAvailabilitySafetyCheck. +func (easc EnsureAvailabilitySafetyCheck) AsPartitionSafetyCheck() (*PartitionSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionSafetyCheck is the BasicSafetyCheck implementation for EnsureAvailabilitySafetyCheck. +func (easc EnsureAvailabilitySafetyCheck) AsBasicPartitionSafetyCheck() (BasicPartitionSafetyCheck, bool) { + return &easc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsureAvailabilitySafetyCheck is the BasicSafetyCheck implementation for EnsureAvailabilitySafetyCheck. +func (easc EnsureAvailabilitySafetyCheck) AsEnsureAvailabilitySafetyCheck() (*EnsureAvailabilitySafetyCheck, bool) { + return &easc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsurePartitionQurumSafetyCheck is the BasicSafetyCheck implementation for EnsureAvailabilitySafetyCheck. +func (easc EnsureAvailabilitySafetyCheck) AsEnsurePartitionQurumSafetyCheck() (*EnsurePartitionQurumSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSeedNodeSafetyCheck is the BasicSafetyCheck implementation for EnsureAvailabilitySafetyCheck. +func (easc EnsureAvailabilitySafetyCheck) AsSeedNodeSafetyCheck() (*SeedNodeSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForInbuildReplicaSafetyCheck is the BasicSafetyCheck implementation for EnsureAvailabilitySafetyCheck. +func (easc EnsureAvailabilitySafetyCheck) AsWaitForInbuildReplicaSafetyCheck() (*WaitForInbuildReplicaSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimaryPlacementSafetyCheck is the BasicSafetyCheck implementation for EnsureAvailabilitySafetyCheck. +func (easc EnsureAvailabilitySafetyCheck) AsWaitForPrimaryPlacementSafetyCheck() (*WaitForPrimaryPlacementSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimarySwapSafetyCheck is the BasicSafetyCheck implementation for EnsureAvailabilitySafetyCheck. +func (easc EnsureAvailabilitySafetyCheck) AsWaitForPrimarySwapSafetyCheck() (*WaitForPrimarySwapSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForReconfigurationSafetyCheck is the BasicSafetyCheck implementation for EnsureAvailabilitySafetyCheck. +func (easc EnsureAvailabilitySafetyCheck) AsWaitForReconfigurationSafetyCheck() (*WaitForReconfigurationSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSafetyCheck is the BasicSafetyCheck implementation for EnsureAvailabilitySafetyCheck. +func (easc EnsureAvailabilitySafetyCheck) AsSafetyCheck() (*SafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicSafetyCheck is the BasicSafetyCheck implementation for EnsureAvailabilitySafetyCheck. +func (easc EnsureAvailabilitySafetyCheck) AsBasicSafetyCheck() (BasicSafetyCheck, bool) { + return &easc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// EnsurePartitionQurumSafetyCheck safety check that ensures that a quorum of replicas are not lost for a +// partition. +type EnsurePartitionQurumSafetyCheck struct { + // PartitionID - Id of the partition which is undergoing the safety check. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // Kind - Possible values include: 'KindSafetyCheck', 'KindPartitionSafetyCheck', 'KindEnsureAvailability', 'KindEnsurePartitionQuorum', 'KindEnsureSeedNodeQuorum', 'KindWaitForInbuildReplica', 'KindWaitForPrimaryPlacement', 'KindWaitForPrimarySwap', 'KindWaitForReconfiguration' + Kind KindBasicSafetyCheck `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for EnsurePartitionQurumSafetyCheck. +func (epqsc EnsurePartitionQurumSafetyCheck) MarshalJSON() ([]byte, error) { + epqsc.Kind = KindEnsurePartitionQuorum + objectMap := make(map[string]interface{}) + if epqsc.PartitionID != nil { + objectMap["PartitionId"] = epqsc.PartitionID + } + if epqsc.Kind != "" { + objectMap["Kind"] = epqsc.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionSafetyCheck is the BasicSafetyCheck implementation for EnsurePartitionQurumSafetyCheck. +func (epqsc EnsurePartitionQurumSafetyCheck) AsPartitionSafetyCheck() (*PartitionSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionSafetyCheck is the BasicSafetyCheck implementation for EnsurePartitionQurumSafetyCheck. +func (epqsc EnsurePartitionQurumSafetyCheck) AsBasicPartitionSafetyCheck() (BasicPartitionSafetyCheck, bool) { + return &epqsc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsureAvailabilitySafetyCheck is the BasicSafetyCheck implementation for EnsurePartitionQurumSafetyCheck. +func (epqsc EnsurePartitionQurumSafetyCheck) AsEnsureAvailabilitySafetyCheck() (*EnsureAvailabilitySafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsurePartitionQurumSafetyCheck is the BasicSafetyCheck implementation for EnsurePartitionQurumSafetyCheck. +func (epqsc EnsurePartitionQurumSafetyCheck) AsEnsurePartitionQurumSafetyCheck() (*EnsurePartitionQurumSafetyCheck, bool) { + return &epqsc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSeedNodeSafetyCheck is the BasicSafetyCheck implementation for EnsurePartitionQurumSafetyCheck. +func (epqsc EnsurePartitionQurumSafetyCheck) AsSeedNodeSafetyCheck() (*SeedNodeSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForInbuildReplicaSafetyCheck is the BasicSafetyCheck implementation for EnsurePartitionQurumSafetyCheck. +func (epqsc EnsurePartitionQurumSafetyCheck) AsWaitForInbuildReplicaSafetyCheck() (*WaitForInbuildReplicaSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimaryPlacementSafetyCheck is the BasicSafetyCheck implementation for EnsurePartitionQurumSafetyCheck. +func (epqsc EnsurePartitionQurumSafetyCheck) AsWaitForPrimaryPlacementSafetyCheck() (*WaitForPrimaryPlacementSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimarySwapSafetyCheck is the BasicSafetyCheck implementation for EnsurePartitionQurumSafetyCheck. +func (epqsc EnsurePartitionQurumSafetyCheck) AsWaitForPrimarySwapSafetyCheck() (*WaitForPrimarySwapSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForReconfigurationSafetyCheck is the BasicSafetyCheck implementation for EnsurePartitionQurumSafetyCheck. +func (epqsc EnsurePartitionQurumSafetyCheck) AsWaitForReconfigurationSafetyCheck() (*WaitForReconfigurationSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSafetyCheck is the BasicSafetyCheck implementation for EnsurePartitionQurumSafetyCheck. +func (epqsc EnsurePartitionQurumSafetyCheck) AsSafetyCheck() (*SafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicSafetyCheck is the BasicSafetyCheck implementation for EnsurePartitionQurumSafetyCheck. +func (epqsc EnsurePartitionQurumSafetyCheck) AsBasicSafetyCheck() (BasicSafetyCheck, bool) { + return &epqsc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// EntityHealth health information common to all entities in the cluster. It contains the aggregated health state, +// health events and unhealthy evaluation. +type EntityHealth struct { + // AggregatedHealthState - The HealthState representing the aggregated health state of the entity computed by Health Manager. + // The health evaluation of the entity reflects all events reported on the entity and its children (if any). + // The aggregation is done by applying the desired health policy. + // . Possible values include: 'AggregatedHealthState1Invalid', 'AggregatedHealthState1Ok', 'AggregatedHealthState1Warning', 'AggregatedHealthState1Error', 'AggregatedHealthState1Unknown' + AggregatedHealthState AggregatedHealthState1 `json:"AggregatedHealthState,omitempty"` + // HealthEvents - The list of health events reported on the entity. + HealthEvents *[]HealthEvent `json:"HealthEvents,omitempty"` + // UnhealthyEvaluations - The unhealthy evaluations that show why the current aggregated health state was returned by Health Manager. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// EntityHealthState a base type for the health state of various entities in the cluster. It contains the +// aggregated health state. +type EntityHealthState struct { + // AggregatedHealthState - Possible values include: 'AggregatedHealthState2Invalid', 'AggregatedHealthState2Ok', 'AggregatedHealthState2Warning', 'AggregatedHealthState2Error', 'AggregatedHealthState2Unknown' + AggregatedHealthState AggregatedHealthState2 `json:"AggregatedHealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// EntityHealthStateChunk a base type for the health state chunk of various entities in the cluster. It contains +// the aggregated health state. +type EntityHealthStateChunk struct { + // HealthState - Possible values include: 'HealthState2Invalid', 'HealthState2Ok', 'HealthState2Warning', 'HealthState2Error', 'HealthState2Unknown' + HealthState HealthState2 `json:"HealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// EntityHealthStateChunkList a base type for the list of health state chunks found in the cluster. It contains the +// total number of health states that match the input filters. +type EntityHealthStateChunkList struct { + // TotalCount - Total number of entity health state objects that match the specified filters from the cluster health chunk query description. + TotalCount *int64 `json:"TotalCount,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Epoch an Epoch is a configuration number for the partition as a whole. When the configuration of the replica set +// changes, for example when the Primary replica changes, the operations that are replicated from the new Primary +// replica are said to be a new Epoch from the ones which were sent by the old Primary replica. +type Epoch struct { + // ConfigurationVersion - The current configuration number of this Epoch. The configuration number is an increasing value that is updated whenever the configuration of this replica set changes. + ConfigurationVersion *string `json:"ConfigurationVersion,omitempty"` + // DataLossVersion - The current dataloss number of this Epoch. The data loss number property is an increasing value which is updated whenever data loss is suspected, as when loss of a quorum of replicas in the replica set that includes the Primary replica. + DataLossVersion *string `json:"DataLossVersion,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// EventHealthEvaluation represents health evaluation of a HealthEvent that was reported on the entity. +// The health evaluation is returned when evaluating health of an entity results in Error or Warning. +type EventHealthEvaluation struct { + // ConsiderWarningAsError - Indicates whether warnings are treated with the same severity as errors. The field is specified in the health policy used to evaluate the entity. + ConsiderWarningAsError *bool `json:"ConsiderWarningAsError,omitempty"` + UnhealthyEvent *HealthEvent `json:"UnhealthyEvent,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for EventHealthEvaluation. +func (ehe EventHealthEvaluation) MarshalJSON() ([]byte, error) { + ehe.Kind = KindEvent + objectMap := make(map[string]interface{}) + if ehe.ConsiderWarningAsError != nil { + objectMap["ConsiderWarningAsError"] = ehe.ConsiderWarningAsError + } + if ehe.UnhealthyEvent != nil { + objectMap["UnhealthyEvent"] = ehe.UnhealthyEvent + } + if ehe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = ehe.AggregatedHealthState + } + if ehe.Description != nil { + objectMap["Description"] = ehe.Description + } + if ehe.Kind != "" { + objectMap["Kind"] = ehe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return &ehe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for EventHealthEvaluation. +func (ehe EventHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &ehe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ExecutingFaultsChaosEvent describes a Chaos event that gets generated when Chaos has decided on the faults for +// an iteration. This Chaos event contains the details of the faults as a list of strings. +type ExecutingFaultsChaosEvent struct { + Faults *[]string `json:"Faults,omitempty"` + TimeStampUtc *date.Time `json:"TimeStampUtc,omitempty"` + // Kind - Possible values include: 'KindChaosEvent', 'KindExecutingFaults', 'KindStarted', 'KindStopped', 'KindTestError', 'KindValidationFailed', 'KindWaiting' + Kind KindBasicChaosEvent `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ExecutingFaultsChaosEvent. +func (efce ExecutingFaultsChaosEvent) MarshalJSON() ([]byte, error) { + efce.Kind = KindExecutingFaults + objectMap := make(map[string]interface{}) + if efce.Faults != nil { + objectMap["Faults"] = efce.Faults + } + if efce.TimeStampUtc != nil { + objectMap["TimeStampUtc"] = efce.TimeStampUtc + } + if efce.Kind != "" { + objectMap["Kind"] = efce.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsExecutingFaultsChaosEvent is the BasicChaosEvent implementation for ExecutingFaultsChaosEvent. +func (efce ExecutingFaultsChaosEvent) AsExecutingFaultsChaosEvent() (*ExecutingFaultsChaosEvent, bool) { + return &efce, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStartedChaosEvent is the BasicChaosEvent implementation for ExecutingFaultsChaosEvent. +func (efce ExecutingFaultsChaosEvent) AsStartedChaosEvent() (*StartedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStoppedChaosEvent is the BasicChaosEvent implementation for ExecutingFaultsChaosEvent. +func (efce ExecutingFaultsChaosEvent) AsStoppedChaosEvent() (*StoppedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsTestErrorChaosEvent is the BasicChaosEvent implementation for ExecutingFaultsChaosEvent. +func (efce ExecutingFaultsChaosEvent) AsTestErrorChaosEvent() (*TestErrorChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsValidationFailedChaosEvent is the BasicChaosEvent implementation for ExecutingFaultsChaosEvent. +func (efce ExecutingFaultsChaosEvent) AsValidationFailedChaosEvent() (*ValidationFailedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitingChaosEvent is the BasicChaosEvent implementation for ExecutingFaultsChaosEvent. +func (efce ExecutingFaultsChaosEvent) AsWaitingChaosEvent() (*WaitingChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsChaosEvent is the BasicChaosEvent implementation for ExecutingFaultsChaosEvent. +func (efce ExecutingFaultsChaosEvent) AsChaosEvent() (*ChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicChaosEvent is the BasicChaosEvent implementation for ExecutingFaultsChaosEvent. +func (efce ExecutingFaultsChaosEvent) AsBasicChaosEvent() (BasicChaosEvent, bool) { + return &efce, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// FabricCodeVersionInfo information about a Service Fabric code version. +type FabricCodeVersionInfo struct { + // CodeVersion - The product version of Service Fabric. + CodeVersion *string `json:"CodeVersion,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// FabricConfigVersionInfo information about a Service Fabric config version. +type FabricConfigVersionInfo struct { + // ConfigVersion - The config version of Service Fabric. + ConfigVersion *string `json:"ConfigVersion,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// FabricError the REST API operations for Service Fabric return standard HTTP status codes. This type defines the +// additional information returned from the Service Fabric API operations that are not successful. +type FabricError struct { + Error *FabricErrorError `json:"Error,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// FabricErrorError error object containing error code and error message. +type FabricErrorError struct { + // Code - Possible values include: 'FABRICEINVALIDPARTITIONKEY', 'FABRICEIMAGEBUILDERVALIDATIONERROR', 'FABRICEINVALIDADDRESS', 'FABRICEAPPLICATIONNOTUPGRADING', 'FABRICEAPPLICATIONUPGRADEVALIDATIONERROR', 'FABRICEFABRICNOTUPGRADING', 'FABRICEFABRICUPGRADEVALIDATIONERROR', 'FABRICEINVALIDCONFIGURATION', 'FABRICEINVALIDNAMEURI', 'FABRICEPATHTOOLONG', 'FABRICEKEYTOOLARGE', 'FABRICESERVICEAFFINITYCHAINNOTSUPPORTED', 'FABRICEINVALIDATOMICGROUP', 'FABRICEVALUEEMPTY', 'FABRICENODENOTFOUND', 'FABRICEAPPLICATIONTYPENOTFOUND', 'FABRICEAPPLICATIONNOTFOUND', 'FABRICESERVICETYPENOTFOUND', 'FABRICESERVICEDOESNOTEXIST', 'FABRICESERVICETYPETEMPLATENOTFOUND', 'FABRICECONFIGURATIONSECTIONNOTFOUND', 'FABRICEPARTITIONNOTFOUND', 'FABRICEREPLICADOESNOTEXIST', 'FABRICESERVICEGROUPDOESNOTEXIST', 'FABRICECONFIGURATIONPARAMETERNOTFOUND', 'FABRICEDIRECTORYNOTFOUND', 'FABRICEFABRICVERSIONNOTFOUND', 'FABRICEFILENOTFOUND', 'FABRICENAMEDOESNOTEXIST', 'FABRICEPROPERTYDOESNOTEXIST', 'FABRICEENUMERATIONCOMPLETED', 'FABRICESERVICEMANIFESTNOTFOUND', 'FABRICEKEYNOTFOUND', 'FABRICEHEALTHENTITYNOTFOUND', 'FABRICEAPPLICATIONTYPEALREADYEXISTS', 'FABRICEAPPLICATIONALREADYEXISTS', 'FABRICEAPPLICATIONALREADYINTARGETVERSION', 'FABRICEAPPLICATIONTYPEPROVISIONINPROGRESS', 'FABRICEAPPLICATIONUPGRADEINPROGRESS', 'FABRICESERVICEALREADYEXISTS', 'FABRICESERVICEGROUPALREADYEXISTS', 'FABRICEAPPLICATIONTYPEINUSE', 'FABRICEFABRICALREADYINTARGETVERSION', 'FABRICEFABRICVERSIONALREADYEXISTS', 'FABRICEFABRICVERSIONINUSE', 'FABRICEFABRICUPGRADEINPROGRESS', 'FABRICENAMEALREADYEXISTS', 'FABRICENAMENOTEMPTY', 'FABRICEPROPERTYCHECKFAILED', 'FABRICESERVICEMETADATAMISMATCH', 'FABRICESERVICETYPEMISMATCH', 'FABRICEHEALTHSTALEREPORT', 'FABRICESEQUENCENUMBERCHECKFAILED', 'FABRICENODEHASNOTSTOPPEDYET', 'FABRICEINSTANCEIDMISMATCH', 'FABRICEVALUETOOLARGE', 'FABRICENOWRITEQUORUM', 'FABRICENOTPRIMARY', 'FABRICENOTREADY', 'FABRICERECONFIGURATIONPENDING', 'FABRICESERVICEOFFLINE', 'EABORT', 'FABRICECOMMUNICATIONERROR', 'FABRICEOPERATIONNOTCOMPLETE', 'FABRICETIMEOUT', 'FABRICENODEISUP' + Code Code `json:"Code,omitempty"` + // Message - Error message. + Message *string `json:"Message,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// FailedUpgradeDomainProgressObject the detailed upgrade progress for nodes in the current upgrade domain at the +// point of failure. +type FailedUpgradeDomainProgressObject struct { + DomainName *string `json:"DomainName,omitempty"` + NodeUpgradeProgressList *[]NodeUpgradeProgressInfo `json:"NodeUpgradeProgressList,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// FailureUpgradeDomainProgressInfo information about the upgrade domain progress at the time of upgrade failure. +type FailureUpgradeDomainProgressInfo struct { + DomainName *string `json:"DomainName,omitempty"` + NodeUpgradeProgressList *[]NodeUpgradeProgressInfo `json:"NodeUpgradeProgressList,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// FileInfo information about a image store file. +type FileInfo struct { + // FileSize - The size of file in bytes. + FileSize *string `json:"FileSize,omitempty"` + FileVersion *FileVersion `json:"FileVersion,omitempty"` + // ModifiedDate - The date and time when the image store file was last modified. + ModifiedDate *date.Time `json:"ModifiedDate,omitempty"` + // StoreRelativePath - The file path relative to the image store root path. + StoreRelativePath *string `json:"StoreRelativePath,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// FileVersion information about the version of image store file. +type FileVersion struct { + // VersionNumber - The current iamge store version number for the file is used in image store for checking whether it need to be updated. + VersionNumber *string `json:"VersionNumber,omitempty"` + // EpochDataLossNumber - The epoch data loss number of image store file is used to indicate the status of data loss. + EpochDataLossNumber *string `json:"EpochDataLossNumber,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// FolderInfo information about a image store folder. It inclues how many files this folder contains and its image +// store relative path. +type FolderInfo struct { + StoreRelativePath *string `json:"StoreRelativePath,omitempty"` + // FileCount - The number of files from within the image store folder. + FileCount *uuid.UUID `json:"FileCount,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicHealthEvaluation represents a health evaluation which describes the data and the algorithm used by health +// manager to evaluate the health of an entity. +type BasicHealthEvaluation interface { + AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) + AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) + AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) + AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) + AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) + AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) + AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) + AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) + AsEventHealthEvaluation() (*EventHealthEvaluation, bool) + AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) + AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) + AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) + AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) + AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) + AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) + AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) + AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) + AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) + AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) + AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) + AsHealthEvaluation() (*HealthEvaluation, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// HealthEvaluation represents a health evaluation which describes the data and the algorithm used by health +// manager to evaluate the health of an entity. +type HealthEvaluation struct { + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +func unmarshalBasicHealthEvaluation(body []byte) (BasicHealthEvaluation, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["Kind"] { + case string(KindApplication): + var ahe ApplicationHealthEvaluation + err := json.Unmarshal(body, &ahe) + return ahe, err + case string(KindApplications): + var ahe ApplicationsHealthEvaluation + err := json.Unmarshal(body, &ahe) + return ahe, err + case string(KindApplicationTypeApplications): + var atahe ApplicationTypeApplicationsHealthEvaluation + err := json.Unmarshal(body, &atahe) + return atahe, err + case string(KindDeltaNodesCheck): + var dnche DeltaNodesCheckHealthEvaluation + err := json.Unmarshal(body, &dnche) + return dnche, err + case string(KindDeployedApplication): + var dahe DeployedApplicationHealthEvaluation + err := json.Unmarshal(body, &dahe) + return dahe, err + case string(KindDeployedApplications): + var dahe DeployedApplicationsHealthEvaluation + err := json.Unmarshal(body, &dahe) + return dahe, err + case string(KindDeployedServicePackage): + var dsphe DeployedServicePackageHealthEvaluation + err := json.Unmarshal(body, &dsphe) + return dsphe, err + case string(KindDeployedServicePackages): + var dsphe DeployedServicePackagesHealthEvaluation + err := json.Unmarshal(body, &dsphe) + return dsphe, err + case string(KindEvent): + var ehe EventHealthEvaluation + err := json.Unmarshal(body, &ehe) + return ehe, err + case string(KindNode): + var nhe NodeHealthEvaluation + err := json.Unmarshal(body, &nhe) + return nhe, err + case string(KindNodes): + var nhe NodesHealthEvaluation + err := json.Unmarshal(body, &nhe) + return nhe, err + case string(KindPartition): + var phe PartitionHealthEvaluation + err := json.Unmarshal(body, &phe) + return phe, err + case string(KindPartitions): + var phe PartitionsHealthEvaluation + err := json.Unmarshal(body, &phe) + return phe, err + case string(KindReplica): + var rhe ReplicaHealthEvaluation + err := json.Unmarshal(body, &rhe) + return rhe, err + case string(KindReplicas): + var rhe ReplicasHealthEvaluation + err := json.Unmarshal(body, &rhe) + return rhe, err + case string(KindService): + var she ServiceHealthEvaluation + err := json.Unmarshal(body, &she) + return she, err + case string(KindServices): + var she ServicesHealthEvaluation + err := json.Unmarshal(body, &she) + return she, err + case string(KindSystemApplication): + var sahe SystemApplicationHealthEvaluation + err := json.Unmarshal(body, &sahe) + return sahe, err + case string(KindUpgradeDomainDeltaNodesCheck): + var uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation + err := json.Unmarshal(body, &uddnche) + return uddnche, err + case string(KindUpgradeDomainNodes): + var udnhe UpgradeDomainNodesHealthEvaluation + err := json.Unmarshal(body, &udnhe) + return udnhe, err + default: + var he HealthEvaluation + err := json.Unmarshal(body, &he) + return he, err + } +} +func unmarshalBasicHealthEvaluationArray(body []byte) ([]BasicHealthEvaluation, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + heArray := make([]BasicHealthEvaluation, len(rawMessages)) + + for index, rawMessage := range rawMessages { + he, err := unmarshalBasicHealthEvaluation(*rawMessage) + if err != nil { + return nil, err + } + heArray[index] = he + } + return heArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for HealthEvaluation. +func (he HealthEvaluation) MarshalJSON() ([]byte, error) { + he.Kind = KindHealthEvaluation + objectMap := make(map[string]interface{}) + if he.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = he.AggregatedHealthState + } + if he.Description != nil { + objectMap["Description"] = he.Description + } + if he.Kind != "" { + objectMap["Kind"] = he.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return &he, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for HealthEvaluation. +func (he HealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &he, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// HealthEvaluationWrapper wrapper object for health evaluation. +type HealthEvaluationWrapper struct { + HealthEvaluation BasicHealthEvaluation `json:"HealthEvaluation,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for HealthEvaluationWrapper struct. +func (hew *HealthEvaluationWrapper) 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 "HealthEvaluation": + if v != nil { + healthEvaluation, err := unmarshalBasicHealthEvaluation(*v) + if err != nil { + return err + } + hew.HealthEvaluation = healthEvaluation + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// HealthEvent represents health information reported on a health entity, such as cluster, application or node, +// with additional metadata added by the Health Manager. +type HealthEvent struct { + // IsExpired - Returns true if the health event is expired, otherwise false. + IsExpired *bool `json:"IsExpired,omitempty"` + // SourceUtcTimestamp - The date and time when the health report was sent by the source. + SourceUtcTimestamp *date.Time `json:"SourceUtcTimestamp,omitempty"` + // LastModifiedUtcTimestamp - The date and time when the health report was last modified by the health store. + LastModifiedUtcTimestamp *date.Time `json:"LastModifiedUtcTimestamp,omitempty"` + // LastOkTransitionAt - If the current health state is 'Ok', this property returns the time at which the health report was first reported with 'Ok'. + // For periodic reporting, many reports with the same state may have been generated. + // This property returns the date and time when the first 'Ok' health report was received. + // If the current health state is 'Error' or 'Warning', returns the date and time at which the health state was last in 'Ok', before transitioning to a different state. + // If the health state was never 'Ok', the value will be zero date-time. + LastOkTransitionAt *date.Time `json:"LastOkTransitionAt,omitempty"` + // LastWarningTransitionAt - If the current health state is 'Warning', this property returns the time at which the health report was first reported with 'Warning'. For periodic reporting, many reports with the same state may have been generated however, this property returns only the date and time at the first 'Warning' health report was received. + // If the current health state is 'Ok' or 'Error', returns the date and time at which the health state was last in 'Warning', before transitioning to a different state. + // If the health state was never 'Warning', the value will be zero date-time. + LastWarningTransitionAt *date.Time `json:"LastWarningTransitionAt,omitempty"` + // LastErrorTransitionAt - If the current health state is 'Error', this property returns the time at which the health report was first reported with 'Error'. For periodic reporting, many reports with the same state may have been generated however, this property returns only the date and time at the first 'Error' health report was received. + // If the current health state is 'Ok' or 'Warning', returns the date and time at which the health state was last in 'Error', before transitioning to a different state. + // If the health state was never 'Error', the value will be zero date-time. + LastErrorTransitionAt *date.Time `json:"LastErrorTransitionAt,omitempty"` + // SourceID - The source name which identifies the client/watchdog/system component which generated the health information. + SourceID *string `json:"SourceId,omitempty"` + // Property - The property of the health information. An entity can have health reports for different properties. + // The property is a string and not a fixed enumeration to allow the reporter flexibility to categorize the state condition that triggers the report. + // For example, a reporter with SourceId "LocalWatchdog" can monitor the state of the available disk on a node, + // so it can report "AvailableDisk" property on that node. + // The same reporter can monitor the node connectivity, so it can report a property "Connectivity" on the same node. + // In the health store, these reports are treated as separate health events for the specified node. + // Together with the SourceId, the property uniquely identifies the health information. + Property *string `json:"Property,omitempty"` + // HealthState - Possible values include: 'HealthState3Invalid', 'HealthState3Ok', 'HealthState3Warning', 'HealthState3Error', 'HealthState3Unknown' + HealthState HealthState3 `json:"HealthState,omitempty"` + // TimeToLiveInMilliSeconds - The duration for which this health report is valid. This field is using ISO8601 format for specifying the duration. + // When clients report periodically, they should send reports with higher frequency than time to live. + // If clients report on transition, they can set the time to live to infinite. + // When time to live expires, the health event that contains the health information + // is either removed from health store, if RemoveWhenExpired is true, or evaluated at error, if RemoveWhenExpired false. + // If not specified, time to live defaults to infinite value. + TimeToLiveInMilliSeconds *string `json:"TimeToLiveInMilliSeconds,omitempty"` + // Description - The description of the health information. It represents free text used to add human readable information about the report. + // The maximum string length for the description is 4096 characters. + // If the provided string is longer, it will be automatically truncated. + // When truncated, the last characters of the description contain a marker "[Truncated]", and total string size is 4096 characters. + // The presence of the marker indicates to users that truncation occurred. + // Note that when truncated, the description has less than 4096 characters from the original string. + Description *string `json:"Description,omitempty"` + // SequenceNumber - The sequence number for this health report as a numeric string. + // The report sequence number is used by the health store to detect stale reports. + // If not specified, a sequence number is auto-generated by the health client when a report is added. + SequenceNumber *string `json:"SequenceNumber,omitempty"` + // RemoveWhenExpired - Value that indicates whether the report is removed from health store when it expires. + // If set to true, the report is remopved from the health store after it expires. + // If set to false, the report is treated as an error when expired. The value of this property is false by default. + // When clients report periodically, they should set RemoveWhenExpired false (default). + // This way, is the reporter has issues (eg. deadlock) and can't report, the entity is evaluated at error when the health report expires. + // This flags the entity as being in Error health state. + RemoveWhenExpired *bool `json:"RemoveWhenExpired,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// HealthInformation represents common health report information. It is included in all health reports sent to +// health store and in all health events returned by health queries. +type HealthInformation struct { + // SourceID - The source name which identifies the client/watchdog/system component which generated the health information. + SourceID *string `json:"SourceId,omitempty"` + // Property - The property of the health information. An entity can have health reports for different properties. + // The property is a string and not a fixed enumeration to allow the reporter flexibility to categorize the state condition that triggers the report. + // For example, a reporter with SourceId "LocalWatchdog" can monitor the state of the available disk on a node, + // so it can report "AvailableDisk" property on that node. + // The same reporter can monitor the node connectivity, so it can report a property "Connectivity" on the same node. + // In the health store, these reports are treated as separate health events for the specified node. + // Together with the SourceId, the property uniquely identifies the health information. + Property *string `json:"Property,omitempty"` + // HealthState - Possible values include: 'HealthState3Invalid', 'HealthState3Ok', 'HealthState3Warning', 'HealthState3Error', 'HealthState3Unknown' + HealthState HealthState3 `json:"HealthState,omitempty"` + // TimeToLiveInMilliSeconds - The duration for which this health report is valid. This field is using ISO8601 format for specifying the duration. + // When clients report periodically, they should send reports with higher frequency than time to live. + // If clients report on transition, they can set the time to live to infinite. + // When time to live expires, the health event that contains the health information + // is either removed from health store, if RemoveWhenExpired is true, or evaluated at error, if RemoveWhenExpired false. + // If not specified, time to live defaults to infinite value. + TimeToLiveInMilliSeconds *string `json:"TimeToLiveInMilliSeconds,omitempty"` + // Description - The description of the health information. It represents free text used to add human readable information about the report. + // The maximum string length for the description is 4096 characters. + // If the provided string is longer, it will be automatically truncated. + // When truncated, the last characters of the description contain a marker "[Truncated]", and total string size is 4096 characters. + // The presence of the marker indicates to users that truncation occurred. + // Note that when truncated, the description has less than 4096 characters from the original string. + Description *string `json:"Description,omitempty"` + // SequenceNumber - The sequence number for this health report as a numeric string. + // The report sequence number is used by the health store to detect stale reports. + // If not specified, a sequence number is auto-generated by the health client when a report is added. + SequenceNumber *string `json:"SequenceNumber,omitempty"` + // RemoveWhenExpired - Value that indicates whether the report is removed from health store when it expires. + // If set to true, the report is remopved from the health store after it expires. + // If set to false, the report is treated as an error when expired. The value of this property is false by default. + // When clients report periodically, they should set RemoveWhenExpired false (default). + // This way, is the reporter has issues (eg. deadlock) and can't report, the entity is evaluated at error when the health report expires. + // This flags the entity as being in Error health state. + RemoveWhenExpired *bool `json:"RemoveWhenExpired,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ImageStoreContent information about the image store content. +type ImageStoreContent struct { + autorest.Response `json:"-"` + // StoreFiles - The list of image store file info objects represents files found under the given image store relative path. + StoreFiles *[]FileInfo `json:"StoreFiles,omitempty"` + // StoreFolders - The list of image store folder info objectes represents subfolders found under the given image store relative path. + StoreFolders *[]FolderInfo `json:"StoreFolders,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ImageStoreCopyDescription information about how to copy image store content from one image store relative path +// to another image store relative path. +type ImageStoreCopyDescription struct { + // RemoteSource - The relative path of source image store content to be copied from. + RemoteSource *string `json:"RemoteSource,omitempty"` + // RemoteDestination - The relative path of destination image store content to be copied to. + RemoteDestination *string `json:"RemoteDestination,omitempty"` + // SkipFiles - The list of the file names to be skipped for copying. + SkipFiles *[]string `json:"SkipFiles,omitempty"` + // CheckMarkFile - Indicates whether to check mark file during copying. The property is true if checking mark file is required, false otherwise. The mark file is used to check whether the folder is well constructed. If the property is true and mark file does not exist, the copy is skipped. + CheckMarkFile *bool `json:"CheckMarkFile,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Int64RangePartitionInformation describes the partition information for the integer range that is based on +// partition schemes. +type Int64RangePartitionInformation struct { + // LowKey - Specifies the minimum key value handled by this partition. + LowKey *string `json:"LowKey,omitempty"` + // HighKey - Specifies the maximum key value handled by this partition. + HighKey *string `json:"HighKey,omitempty"` + ID *uuid.UUID `json:"Id,omitempty"` + // ServicePartitionKind - Possible values include: 'ServicePartitionKindPartitionInformation', 'ServicePartitionKindInt64Range', 'ServicePartitionKindNamed', 'ServicePartitionKindSingleton' + ServicePartitionKind ServicePartitionKind `json:"ServicePartitionKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for Int64RangePartitionInformation. +func (i6rpi Int64RangePartitionInformation) MarshalJSON() ([]byte, error) { + i6rpi.ServicePartitionKind = ServicePartitionKindInt64Range + objectMap := make(map[string]interface{}) + if i6rpi.LowKey != nil { + objectMap["LowKey"] = i6rpi.LowKey + } + if i6rpi.HighKey != nil { + objectMap["HighKey"] = i6rpi.HighKey + } + if i6rpi.ID != nil { + objectMap["Id"] = i6rpi.ID + } + if i6rpi.ServicePartitionKind != "" { + objectMap["ServicePartitionKind"] = i6rpi.ServicePartitionKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsInt64RangePartitionInformation is the BasicPartitionInformation implementation for Int64RangePartitionInformation. +func (i6rpi Int64RangePartitionInformation) AsInt64RangePartitionInformation() (*Int64RangePartitionInformation, bool) { + return &i6rpi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNamedPartitionInformation is the BasicPartitionInformation implementation for Int64RangePartitionInformation. +func (i6rpi Int64RangePartitionInformation) AsNamedPartitionInformation() (*NamedPartitionInformation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSingletonPartitionInformation is the BasicPartitionInformation implementation for Int64RangePartitionInformation. +func (i6rpi Int64RangePartitionInformation) AsSingletonPartitionInformation() (*SingletonPartitionInformation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionInformation is the BasicPartitionInformation implementation for Int64RangePartitionInformation. +func (i6rpi Int64RangePartitionInformation) AsPartitionInformation() (*PartitionInformation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionInformation is the BasicPartitionInformation implementation for Int64RangePartitionInformation. +func (i6rpi Int64RangePartitionInformation) AsBasicPartitionInformation() (BasicPartitionInformation, bool) { + return &i6rpi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// InvokeDataLossResult represents information about an operation in a terminal state (Completed or Faulted). +type InvokeDataLossResult struct { + // ErrorCode - If OperationState is Completed, this is 0. If OperationState is Faulted, this is an error code indicating the reason. + ErrorCode *int32 `json:"ErrorCode,omitempty"` + SelectedPartition *SelectedPartition `json:"SelectedPartition,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// InvokeQuorumLossResult represents information about an operation in a terminal state (Completed or Faulted). +type InvokeQuorumLossResult struct { + // ErrorCode - If OperationState is Completed, this is 0. If OperationState is Faulted, this is an error code indicating the reason. + ErrorCode *int32 `json:"ErrorCode,omitempty"` + SelectedPartition *SelectedPartition `json:"SelectedPartition,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// KeyValueStoreReplicaStatus key value store related information for the replica. +type KeyValueStoreReplicaStatus struct { + // DatabaseRowCountEstimate - Value indicating the estimated number of rows in the underlying database. + DatabaseRowCountEstimate *string `json:"DatabaseRowCountEstimate,omitempty"` + // DatabaseLogicalSizeEstimate - Value indicating the estimated size of the underlying database. + DatabaseLogicalSizeEstimate *string `json:"DatabaseLogicalSizeEstimate,omitempty"` + // CopyNotificationCurrentKeyFilter - Value indicating the latest key-prefix filter applied to enumeration during the callback. Null if there is no pending callback. + CopyNotificationCurrentKeyFilter *string `json:"CopyNotificationCurrentKeyFilter,omitempty"` + // CopyNotificationCurrentProgress - Value indicating the latest number of keys enumerated during the callback. 0 if there is no pending callback. + CopyNotificationCurrentProgress *string `json:"CopyNotificationCurrentProgress,omitempty"` + // StatusDetails - Value indicating the current status details of the replica. + StatusDetails *string `json:"StatusDetails,omitempty"` + // Kind - Possible values include: 'KindReplicaStatusBase', 'KindKeyValueStore' + Kind KindBasicReplicaStatusBase `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for KeyValueStoreReplicaStatus. +func (kvsrs KeyValueStoreReplicaStatus) MarshalJSON() ([]byte, error) { + kvsrs.Kind = KindKeyValueStore + objectMap := make(map[string]interface{}) + if kvsrs.DatabaseRowCountEstimate != nil { + objectMap["DatabaseRowCountEstimate"] = kvsrs.DatabaseRowCountEstimate + } + if kvsrs.DatabaseLogicalSizeEstimate != nil { + objectMap["DatabaseLogicalSizeEstimate"] = kvsrs.DatabaseLogicalSizeEstimate + } + if kvsrs.CopyNotificationCurrentKeyFilter != nil { + objectMap["CopyNotificationCurrentKeyFilter"] = kvsrs.CopyNotificationCurrentKeyFilter + } + if kvsrs.CopyNotificationCurrentProgress != nil { + objectMap["CopyNotificationCurrentProgress"] = kvsrs.CopyNotificationCurrentProgress + } + if kvsrs.StatusDetails != nil { + objectMap["StatusDetails"] = kvsrs.StatusDetails + } + if kvsrs.Kind != "" { + objectMap["Kind"] = kvsrs.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsKeyValueStoreReplicaStatus is the BasicReplicaStatusBase implementation for KeyValueStoreReplicaStatus. +func (kvsrs KeyValueStoreReplicaStatus) AsKeyValueStoreReplicaStatus() (*KeyValueStoreReplicaStatus, bool) { + return &kvsrs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaStatusBase is the BasicReplicaStatusBase implementation for KeyValueStoreReplicaStatus. +func (kvsrs KeyValueStoreReplicaStatus) AsReplicaStatusBase() (*ReplicaStatusBase, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicaStatusBase is the BasicReplicaStatusBase implementation for KeyValueStoreReplicaStatus. +func (kvsrs KeyValueStoreReplicaStatus) AsBasicReplicaStatusBase() (BasicReplicaStatusBase, bool) { + return &kvsrs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ListDeployedApplicationInfo ... +type ListDeployedApplicationInfo struct { + autorest.Response `json:"-"` + Value *[]DeployedApplicationInfo `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ListDeployedCodePackageInfo ... +type ListDeployedCodePackageInfo struct { + autorest.Response `json:"-"` + Value *[]DeployedCodePackageInfo `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ListDeployedServicePackageInfo ... +type ListDeployedServicePackageInfo struct { + autorest.Response `json:"-"` + Value *[]DeployedServicePackageInfo `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ListDeployedServiceReplicaInfo ... +type ListDeployedServiceReplicaInfo struct { + autorest.Response `json:"-"` + Value *[]BasicDeployedServiceReplicaInfo `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for ListDeployedServiceReplicaInfo struct. +func (ldsri *ListDeployedServiceReplicaInfo) UnmarshalJSON(body []byte) error { + dsri, err := unmarshalBasicDeployedServiceReplicaInfoArray(body) + if err != nil { + return err + } + ldsri.Value = &dsri + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ListDeployedServiceTypeInfo ... +type ListDeployedServiceTypeInfo struct { + autorest.Response `json:"-"` + Value *[]DeployedServiceTypeInfo `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ListFabricCodeVersionInfo ... +type ListFabricCodeVersionInfo struct { + autorest.Response `json:"-"` + Value *[]FabricCodeVersionInfo `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ListFabricConfigVersionInfo ... +type ListFabricConfigVersionInfo struct { + autorest.Response `json:"-"` + Value *[]FabricConfigVersionInfo `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ListOperationStatus ... +type ListOperationStatus struct { + autorest.Response `json:"-"` + Value *[]OperationStatus `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ListServiceTypeInfo ... +type ListServiceTypeInfo struct { + autorest.Response `json:"-"` + Value *[]ServiceTypeInfo `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// LoadMetricReport represents the load metric report which contains the time metric was reported, its name and +// value. +type LoadMetricReport struct { + // LastReportedUtc - Gets the UTC time when the load was reported. + LastReportedUtc *date.Time `json:"LastReportedUtc,omitempty"` + // Name - The name of the load metric. + Name *string `json:"Name,omitempty"` + // Value - The value of the load metric. + Value *string `json:"Value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// LoadMetricReportInfo information about load reported by replica. +type LoadMetricReportInfo struct { + // Name - The name of the metric. + Name *string `json:"Name,omitempty"` + // Value - The value of the load for the metric.. + Value *int32 `json:"Value,omitempty"` + // LastReportedUtc - The UTC time when the load is reported. + LastReportedUtc *date.Time `json:"LastReportedUtc,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MonitoringPolicyDescription describes the parameters for monitoring an upgrade in Monitored mode. +type MonitoringPolicyDescription struct { + // FailureAction - Possible values include: 'FailureActionInvalid', 'FailureActionRollback', 'FailureActionManual' + FailureAction FailureAction `json:"FailureAction,omitempty"` + HealthCheckWaitDurationInMilliseconds *string `json:"HealthCheckWaitDurationInMilliseconds,omitempty"` + HealthCheckStableDurationInMilliseconds *string `json:"HealthCheckStableDurationInMilliseconds,omitempty"` + HealthCheckRetryTimeoutInMilliseconds *string `json:"HealthCheckRetryTimeoutInMilliseconds,omitempty"` + UpgradeTimeoutInMilliseconds *string `json:"UpgradeTimeoutInMilliseconds,omitempty"` + UpgradeDomainTimeoutInMilliseconds *string `json:"UpgradeDomainTimeoutInMilliseconds,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NamedPartitionInformation describes the partition information for the name as a string that is based on +// partition schemes. +type NamedPartitionInformation struct { + // Name - Name of the partition. + Name *string `json:"Name,omitempty"` + ID *uuid.UUID `json:"Id,omitempty"` + // ServicePartitionKind - Possible values include: 'ServicePartitionKindPartitionInformation', 'ServicePartitionKindInt64Range', 'ServicePartitionKindNamed', 'ServicePartitionKindSingleton' + ServicePartitionKind ServicePartitionKind `json:"ServicePartitionKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for NamedPartitionInformation. +func (npi NamedPartitionInformation) MarshalJSON() ([]byte, error) { + npi.ServicePartitionKind = ServicePartitionKindNamed + objectMap := make(map[string]interface{}) + if npi.Name != nil { + objectMap["Name"] = npi.Name + } + if npi.ID != nil { + objectMap["Id"] = npi.ID + } + if npi.ServicePartitionKind != "" { + objectMap["ServicePartitionKind"] = npi.ServicePartitionKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsInt64RangePartitionInformation is the BasicPartitionInformation implementation for NamedPartitionInformation. +func (npi NamedPartitionInformation) AsInt64RangePartitionInformation() (*Int64RangePartitionInformation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNamedPartitionInformation is the BasicPartitionInformation implementation for NamedPartitionInformation. +func (npi NamedPartitionInformation) AsNamedPartitionInformation() (*NamedPartitionInformation, bool) { + return &npi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSingletonPartitionInformation is the BasicPartitionInformation implementation for NamedPartitionInformation. +func (npi NamedPartitionInformation) AsSingletonPartitionInformation() (*SingletonPartitionInformation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionInformation is the BasicPartitionInformation implementation for NamedPartitionInformation. +func (npi NamedPartitionInformation) AsPartitionInformation() (*PartitionInformation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionInformation is the BasicPartitionInformation implementation for NamedPartitionInformation. +func (npi NamedPartitionInformation) AsBasicPartitionInformation() (BasicPartitionInformation, bool) { + return &npi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NamedPartitionSchemeDescription describes the named partition scheme of the service. +type NamedPartitionSchemeDescription struct { + // Count - The number of partitions. + Count *int32 `json:"Count,omitempty"` + // Names - Array of size specified by the ‘Count’ parameter, for the names of the partitions. + Names *[]string `json:"Names,omitempty"` + // PartitionScheme - Possible values include: 'PartitionSchemePartitionSchemeDescription', 'PartitionSchemeNamed', 'PartitionSchemeSingleton', 'PartitionSchemeUniformInt64Range' + PartitionScheme PartitionScheme `json:"PartitionScheme,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for NamedPartitionSchemeDescription. +func (npsd NamedPartitionSchemeDescription) MarshalJSON() ([]byte, error) { + npsd.PartitionScheme = PartitionSchemeNamed + objectMap := make(map[string]interface{}) + if npsd.Count != nil { + objectMap["Count"] = npsd.Count + } + if npsd.Names != nil { + objectMap["Names"] = npsd.Names + } + if npsd.PartitionScheme != "" { + objectMap["PartitionScheme"] = npsd.PartitionScheme + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNamedPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for NamedPartitionSchemeDescription. +func (npsd NamedPartitionSchemeDescription) AsNamedPartitionSchemeDescription() (*NamedPartitionSchemeDescription, bool) { + return &npsd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSingletonPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for NamedPartitionSchemeDescription. +func (npsd NamedPartitionSchemeDescription) AsSingletonPartitionSchemeDescription() (*SingletonPartitionSchemeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUniformInt64RangePartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for NamedPartitionSchemeDescription. +func (npsd NamedPartitionSchemeDescription) AsUniformInt64RangePartitionSchemeDescription() (*UniformInt64RangePartitionSchemeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for NamedPartitionSchemeDescription. +func (npsd NamedPartitionSchemeDescription) AsPartitionSchemeDescription() (*PartitionSchemeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for NamedPartitionSchemeDescription. +func (npsd NamedPartitionSchemeDescription) AsBasicPartitionSchemeDescription() (BasicPartitionSchemeDescription, bool) { + return &npsd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeDeactivationInfo information about the node deactivation. This information is valid for a node that is +// undergoing deactivation or has already been deactivated. +type NodeDeactivationInfo struct { + // NodeDeactivationIntent - Possible values include: 'NodeDeactivationIntent1Invalid', 'NodeDeactivationIntent1Pause', 'NodeDeactivationIntent1Restart', 'NodeDeactivationIntent1RemoveData', 'NodeDeactivationIntent1RemoveNode' + NodeDeactivationIntent NodeDeactivationIntent1 `json:"NodeDeactivationIntent,omitempty"` + // NodeDeactivationStatus - Possible values include: 'NodeDeactivationStatusNone', 'NodeDeactivationStatusSafetyCheckInProgress', 'NodeDeactivationStatusSafetyCheckComplete', 'NodeDeactivationStatusCompleted' + NodeDeactivationStatus NodeDeactivationStatus `json:"NodeDeactivationStatus,omitempty"` + NodeDeactivationTask *[]NodeDeactivationTask `json:"NodeDeactivationTask,omitempty"` + PendingSafetyChecks *[]SafetyCheckWrapper `json:"PendingSafetyChecks,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeDeactivationTask the task representing the deactivation operation on the node. +type NodeDeactivationTask struct { + NodeDeactivationTaskID *NodeDeactivationTaskID `json:"NodeDeactivationTaskId,omitempty"` + // NodeDeactivationIntent - Possible values include: 'NodeDeactivationIntentInvalid', 'NodeDeactivationIntentPause', 'NodeDeactivationIntentRestart', 'NodeDeactivationIntentRemoveData', 'NodeDeactivationIntentRemoveNode' + NodeDeactivationIntent NodeDeactivationIntent `json:"NodeDeactivationIntent,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeDeactivationTaskID identity of the task related to deactivation operation on the node. +type NodeDeactivationTaskID struct { + // ID - Value of the task id. + ID *string `json:"Id,omitempty"` + // NodeDeactivationTaskType - Possible values include: 'NodeDeactivationTaskTypeInvalid', 'NodeDeactivationTaskTypeInfrastructure', 'NodeDeactivationTaskTypeRepair', 'NodeDeactivationTaskTypeClient' + NodeDeactivationTaskType NodeDeactivationTaskType `json:"NodeDeactivationTaskType,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeHealth information about the health of a Service Fabric node. +type NodeHealth struct { + autorest.Response `json:"-"` + // Name - Name of the node whose health information is described by this object. + Name *string `json:"Name,omitempty"` + // AggregatedHealthState - The HealthState representing the aggregated health state of the entity computed by Health Manager. + // The health evaluation of the entity reflects all events reported on the entity and its children (if any). + // The aggregation is done by applying the desired health policy. + // . Possible values include: 'AggregatedHealthState1Invalid', 'AggregatedHealthState1Ok', 'AggregatedHealthState1Warning', 'AggregatedHealthState1Error', 'AggregatedHealthState1Unknown' + AggregatedHealthState AggregatedHealthState1 `json:"AggregatedHealthState,omitempty"` + // HealthEvents - The list of health events reported on the entity. + HealthEvents *[]HealthEvent `json:"HealthEvents,omitempty"` + // UnhealthyEvaluations - The unhealthy evaluations that show why the current aggregated health state was returned by Health Manager. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeHealthEvaluation represents health evaluation for a node, containing information about the data and the +// algorithm used by health store to evaluate health. The evaluation is returned only when the aggregated health +// state is either Error or Warning. +type NodeHealthEvaluation struct { + // NodeName - Name of the node. + NodeName *string `json:"NodeName,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the current aggregated health state of the node. The types of the unhealthy evaluations can be EventHealthEvaluation. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) MarshalJSON() ([]byte, error) { + nhe.Kind = KindNode + objectMap := make(map[string]interface{}) + if nhe.NodeName != nil { + objectMap["NodeName"] = nhe.NodeName + } + if nhe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = nhe.UnhealthyEvaluations + } + if nhe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = nhe.AggregatedHealthState + } + if nhe.Description != nil { + objectMap["Description"] = nhe.Description + } + if nhe.Kind != "" { + objectMap["Kind"] = nhe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return &nhe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for NodeHealthEvaluation. +func (nhe NodeHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &nhe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeHealthState represents the health state of a node, which contains the node identifier and its aggregated +// health state. +type NodeHealthState struct { + // Name - The name of the node. + Name *string `json:"Name,omitempty"` + ID *NodeID `json:"Id,omitempty"` + // AggregatedHealthState - Possible values include: 'AggregatedHealthState2Invalid', 'AggregatedHealthState2Ok', 'AggregatedHealthState2Warning', 'AggregatedHealthState2Error', 'AggregatedHealthState2Unknown' + AggregatedHealthState AggregatedHealthState2 `json:"AggregatedHealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeHealthStateChunk represents the health state chunk of a node, which contains the node name and its +// aggregated health state. +type NodeHealthStateChunk struct { + // NodeName - The name of the node. + NodeName *string `json:"NodeName,omitempty"` + // HealthState - Possible values include: 'HealthState2Invalid', 'HealthState2Ok', 'HealthState2Warning', 'HealthState2Error', 'HealthState2Unknown' + HealthState HealthState2 `json:"HealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeHealthStateChunkList the list of node health state chunks in the cluster that respect the input filters in +// the chunk query. Returned by get cluster health state chunks query. +type NodeHealthStateChunkList struct { + // Items - The list of node health state chunks that respect the input filters in the chunk query. + Items *[]NodeHealthStateChunk `json:"Items,omitempty"` + // TotalCount - Total number of entity health state objects that match the specified filters from the cluster health chunk query description. + TotalCount *int64 `json:"TotalCount,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeHealthStateFilter defines matching criteria to determine whether a node should be included in the returned +// cluster health chunk. +// One filter can match zero, one or multiple nodes, depending on its properties. +// Can be specified in the cluster health chunk query description. +type NodeHealthStateFilter struct { + // NodeNameFilter - Name of the node that matches the filter. The filter is applied only to the specified node, if it exists. + // If the node doesn't exist, no node is returned in the cluster health chunk based on this filter. + // If the node exists, it is included in the cluster health chunk if the health state matches the other filter properties. + // If not specified, all nodes that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + NodeNameFilter *string `json:"NodeNameFilter,omitempty"` + // HealthStateFilter - The filter for the health state of the nodes. It allows selecting nodes if they match the desired health states. + // The possible values are integer value of one of the following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the cluster aggregated health state. + // If not specified, default value is None, unless the node name is specified. If the filter has default value and node name is specified, the matching node is returned. + // The state values are flag based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + // For example, if the provided value is 6, it matches nodes with HealthState value of OK (2) and Warning (4). + // + // - Default - Default value. Matches any HealthState. The value is zero. + // - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + // - Ok - Filter that matches input with HealthState value Ok. The value is 2. + // - Warning - Filter that matches input with HealthState value Warning. The value is 4. + // - Error - Filter that matches input with HealthState value Error. The value is 8. + // - All - Filter that matches input with any HealthState value. The value is 65535. + HealthStateFilter *int32 `json:"HealthStateFilter,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeID an internal ID used by Service Fabric to uniquely identify a node. Node Id is deterministically generated +// from node name. +type NodeID struct { + // ID - Value of the node Id. This is a 128 bit integer. + ID *string `json:"Id,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeInfo information about a node in Service Fabric cluster. +type NodeInfo struct { + autorest.Response `json:"-"` + // Name - The name of the node. + Name *string `json:"Name,omitempty"` + // IPAddressOrFQDN - The IP address or fully qualified domain name of the node. + IPAddressOrFQDN *string `json:"IpAddressOrFQDN,omitempty"` + // Type - The type of the node. + Type *string `json:"Type,omitempty"` + // CodeVersion - The version of Service Fabric binaries that the node is running. + CodeVersion *string `json:"CodeVersion,omitempty"` + // ConfigVersion - The version of Service Fabric cluster manifest that the node is using. + ConfigVersion *string `json:"ConfigVersion,omitempty"` + // NodeStatus - Possible values include: 'NodeStatusInvalid', 'NodeStatusUp', 'NodeStatusDown', 'NodeStatusEnabling', 'NodeStatusDisabling', 'NodeStatusDisabled', 'NodeStatusUnknown', 'NodeStatusRemoved' + NodeStatus NodeStatus `json:"NodeStatus,omitempty"` + // NodeUpTimeInSeconds - Time in seconds since the node has been in NodeStatus Up. Value ero indicates that the node is not Up. + NodeUpTimeInSeconds *string `json:"NodeUpTimeInSeconds,omitempty"` + // HealthState - Possible values include: 'HealthState4Invalid', 'HealthState4Ok', 'HealthState4Warning', 'HealthState4Error', 'HealthState4Unknown' + HealthState HealthState4 `json:"HealthState,omitempty"` + // IsSeedNode - Indicates if the node is a seed node or not. Returns true if the node is a seed node, otherwise false. A quorum of seed nodes are required for proper operation of Service Fabric cluster. + IsSeedNode *bool `json:"IsSeedNode,omitempty"` + // UpgradeDomain - The upgrade domain of the node. + UpgradeDomain *string `json:"UpgradeDomain,omitempty"` + // FaultDomain - The fault domain of the node. + FaultDomain *string `json:"FaultDomain,omitempty"` + ID *NodeID `json:"Id,omitempty"` + // InstanceID - The id representing the node instance. While the Id of the node is deterministically generated from the node name and remains same across restarts, the InstanceId changes every time node restarts. + InstanceID *string `json:"InstanceId,omitempty"` + NodeDeactivationInfo *NodeDeactivationInfo `json:"NodeDeactivationInfo,omitempty"` + // IsStopped - Indicates if the node is stopped by calling stop node API or not. Returns true if the node is stopped, otherwise false. + IsStopped *bool `json:"IsStopped,omitempty"` + // NodeDownTimeInSeconds - Time in seconds since the node has been in NodeStatus Down. Value zero indicates node is not NodeStatus Down. + NodeDownTimeInSeconds *string `json:"NodeDownTimeInSeconds,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeLoadInfo information about load on a Service Fabric node. It holds a summary of all metrics and their load +// on a node. +type NodeLoadInfo struct { + autorest.Response `json:"-"` + // NodeName - Name of the node for which the load information is provided by this object. + NodeName *string `json:"NodeName,omitempty"` + // NodeLoadMetricInformation - List that contains metrics and their load information on this node. + NodeLoadMetricInformation *[]NodeLoadMetricInformation `json:"NodeLoadMetricInformation,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeLoadMetricInformation represents data structure that contains load information for a certain metric on a +// node. +type NodeLoadMetricInformation struct { + // Name - Name of the metric for which this load information is provided. + Name *string `json:"Name,omitempty"` + // NodeCapacity - Total capacity on the node for this metric. + NodeCapacity *string `json:"NodeCapacity,omitempty"` + // NodeLoad - Current load on the node for this metric. + NodeLoad *string `json:"NodeLoad,omitempty"` + // NodeRemainingCapacity - The remaining capacity on the node for this metric. + NodeRemainingCapacity *string `json:"NodeRemainingCapacity,omitempty"` + // IsCapacityViolation - Indicates if there is a capacity violation for this metric on the node. + IsCapacityViolation *bool `json:"IsCapacityViolation,omitempty"` + // NodeBufferedCapacity - The value that indicates the reserved capacity for this metric on the node. + NodeBufferedCapacity *string `json:"NodeBufferedCapacity,omitempty"` + // NodeRemainingBufferedCapacity - The remaining reserved capacity for this metric on the node. + NodeRemainingBufferedCapacity *string `json:"NodeRemainingBufferedCapacity,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeResult contains information about a node that was targeted by a user-induced operation. +type NodeResult struct { + // NodeName - The node name + NodeName *string `json:"NodeName,omitempty"` + // NodeInstanceID - The node instance id. + NodeInstanceID *string `json:"NodeInstanceId,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodesHealthEvaluation represents health evaluation for nodes, containing health evaluations for each unhealthy +// node that impacted current aggregated health state. Can be returned when evaluating cluster health and the +// aggregated health state is either Error or Warning. +type NodesHealthEvaluation struct { + // MaxPercentUnhealthyNodes - Maximum allowed percentage of unhealthy nodes from the ClusterHealthPolicy. + MaxPercentUnhealthyNodes *int32 `json:"MaxPercentUnhealthyNodes,omitempty"` + // TotalCount - Total number of nodes found in the health store. + TotalCount *int64 `json:"TotalCount,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy NodeHealthEvaluation that impacted the aggregated health. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) MarshalJSON() ([]byte, error) { + nhe.Kind = KindNodes + objectMap := make(map[string]interface{}) + if nhe.MaxPercentUnhealthyNodes != nil { + objectMap["MaxPercentUnhealthyNodes"] = nhe.MaxPercentUnhealthyNodes + } + if nhe.TotalCount != nil { + objectMap["TotalCount"] = nhe.TotalCount + } + if nhe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = nhe.UnhealthyEvaluations + } + if nhe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = nhe.AggregatedHealthState + } + if nhe.Description != nil { + objectMap["Description"] = nhe.Description + } + if nhe.Kind != "" { + objectMap["Kind"] = nhe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return &nhe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for NodesHealthEvaluation. +func (nhe NodesHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &nhe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeTransitionProgress information about an NodeTransition operation. This class contains an OperationState and +// a NodeTransitionResult. The NodeTransitionResult is not valid until OperationState +// is Completed or Faulted. +type NodeTransitionProgress struct { + autorest.Response `json:"-"` + // State - Possible values include: 'State1Invalid', 'State1Running', 'State1RollingBack', 'State1Completed', 'State1Faulted', 'State1Cancelled', 'State1ForceCancelled' + State State1 `json:"State,omitempty"` + NodeTransitionResult *NodeTransitionResult `json:"NodeTransitionResult,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeTransitionResult represents information about an operation in a terminal state (Completed or Faulted). +type NodeTransitionResult struct { + // ErrorCode - If OperationState is Completed, this is 0. If OperationState is Faulted, this is an error code indicating the reason. + ErrorCode *int32 `json:"ErrorCode,omitempty"` + NodeResult *NodeResult `json:"NodeResult,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// NodeUpgradeProgressInfo information about the upgrading node and its status +type NodeUpgradeProgressInfo struct { + NodeName *string `json:"NodeName,omitempty"` + // UpgradePhase - Possible values include: 'UpgradePhaseInvalid', 'UpgradePhasePreUpgradeSafetyCheck', 'UpgradePhaseUpgrading', 'UpgradePhasePostUpgradeSafetyCheck' + UpgradePhase UpgradePhase `json:"UpgradePhase,omitempty"` + PendingSafetyChecks *[]SafetyCheckWrapper `json:"PendingSafetyChecks,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// OperationStatus contains the OperationId, OperationState, and OperationType for user-induced operations. +type OperationStatus struct { + OperationID *uuid.UUID `json:"OperationId,omitempty"` + // State - Possible values include: 'State2Invalid', 'State2Running', 'State2RollingBack', 'State2Completed', 'State2Faulted', 'State2Cancelled', 'State2ForceCancelled' + State State2 `json:"State,omitempty"` + // Type - Possible values include: 'TypeInvalid', 'TypePartitionDataLoss', 'TypePartitionQuorumLoss', 'TypePartitionRestart', 'TypeNodeTransition' + Type Type `json:"Type,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PackageSharingPolicyInfo represents a policy for the package sharing. +type PackageSharingPolicyInfo struct { + // SharedPackageName - The name of code, configuration or data package that should be shared. + SharedPackageName *string `json:"SharedPackageName,omitempty"` + // PackageSharingScope - Possible values include: 'PackageSharingScopeNone', 'PackageSharingScopeAll', 'PackageSharingScopeCode', 'PackageSharingScopeConfig', 'PackageSharingScopeData' + PackageSharingScope PackageSharingScope `json:"PackageSharingScope,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PagedApplicationInfoList the list of applications in the cluster. The list is paged when all of the results +// cannot fit in a single message. The next set of results can be obtained by executing the same query with the +// continuation token provided in this list. +type PagedApplicationInfoList struct { + autorest.Response `json:"-"` + ContinuationToken *string `json:"ContinuationToken,omitempty"` + Items *[]ApplicationInfo `json:"Items,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PagedApplicationTypeInfoList the list of application types that are provisioned or being provisioned in the +// cluster. The list is paged when all of the results cannot fit in a single message. The next set of results can +// be obtained by executing the same query with the continuation token provided in this list. +type PagedApplicationTypeInfoList struct { + autorest.Response `json:"-"` + ContinuationToken *string `json:"ContinuationToken,omitempty"` + Items *[]ApplicationTypeInfo `json:"Items,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PagedComposeApplicationStatusInfoList the list of compose applications in the cluster. The list is paged when +// all of the results cannot fit in a single message. The next set of results can be obtained by executing the same +// query with the continuation token provided in this list. +type PagedComposeApplicationStatusInfoList struct { + autorest.Response `json:"-"` + ContinuationToken *string `json:"ContinuationToken,omitempty"` + Items *[]ComposeApplicationStatusInfo `json:"Items,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PagedNodeInfoList the list of nodes in the cluster. The list is paged when all of the results cannot fit in a +// single message. The next set of results can be obtained by executing the same query with the continuation token +// provided in this list. +type PagedNodeInfoList struct { + autorest.Response `json:"-"` + ContinuationToken *string `json:"ContinuationToken,omitempty"` + Items *[]NodeInfo `json:"Items,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PagedReplicaInfoList the list of replicas in the cluster for a given partition. The list is paged when all of +// the results cannot fit in a single message. The next set of results can be obtained by executing the same query +// with the continuation token provided in this list. +type PagedReplicaInfoList struct { + autorest.Response `json:"-"` + ContinuationToken *string `json:"ContinuationToken,omitempty"` + Items *[]BasicReplicaInfo `json:"Items,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for PagedReplicaInfoList struct. +func (pril *PagedReplicaInfoList) 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 "ContinuationToken": + if v != nil { + var continuationToken string + err = json.Unmarshal(*v, &continuationToken) + if err != nil { + return err + } + pril.ContinuationToken = &continuationToken + } + case "Items": + if v != nil { + items, err := unmarshalBasicReplicaInfoArray(*v) + if err != nil { + return err + } + pril.Items = &items + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PagedServiceInfoList the list of services in the cluster for an application. The list is paged when all of the +// results cannot fit in a single message. The next set of results can be obtained by executing the same query with +// the continuation token provided in this list. +type PagedServiceInfoList struct { + autorest.Response `json:"-"` + ContinuationToken *string `json:"ContinuationToken,omitempty"` + Items *[]BasicServiceInfo `json:"Items,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for PagedServiceInfoList struct. +func (psil *PagedServiceInfoList) 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 "ContinuationToken": + if v != nil { + var continuationToken string + err = json.Unmarshal(*v, &continuationToken) + if err != nil { + return err + } + psil.ContinuationToken = &continuationToken + } + case "Items": + if v != nil { + items, err := unmarshalBasicServiceInfoArray(*v) + if err != nil { + return err + } + psil.Items = &items + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PagedServicePartitionInfoList the list of partition in the cluster for a service. The list is paged when all of +// the results cannot fit in a single message. The next set of results can be obtained by executing the same query +// with the continuation token provided in this list. +type PagedServicePartitionInfoList struct { + autorest.Response `json:"-"` + ContinuationToken *string `json:"ContinuationToken,omitempty"` + Items *[]BasicServicePartitionInfo `json:"Items,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for PagedServicePartitionInfoList struct. +func (pspil *PagedServicePartitionInfoList) 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 "ContinuationToken": + if v != nil { + var continuationToken string + err = json.Unmarshal(*v, &continuationToken) + if err != nil { + return err + } + pspil.ContinuationToken = &continuationToken + } + case "Items": + if v != nil { + items, err := unmarshalBasicServicePartitionInfoArray(*v) + if err != nil { + return err + } + pspil.Items = &items + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionDataLossProgress information about a partition data loss user-induced operation. +type PartitionDataLossProgress struct { + autorest.Response `json:"-"` + // State - Possible values include: 'State3Invalid', 'State3Running', 'State3RollingBack', 'State3Completed', 'State3Faulted', 'State3Cancelled', 'State3ForceCancelled' + State State3 `json:"State,omitempty"` + InvokeDataLossResult *InvokeDataLossResult `json:"InvokeDataLossResult,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionHealth information about the health of a Service Fabric partition. +type PartitionHealth struct { + autorest.Response `json:"-"` + // PartitionID - ID of the partition whose health information is described by this object. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // ReplicaHealthStates - The list of replica health states associated with the partition. + ReplicaHealthStates *[]BasicReplicaHealthState `json:"ReplicaHealthStates,omitempty"` + // AggregatedHealthState - The HealthState representing the aggregated health state of the entity computed by Health Manager. + // The health evaluation of the entity reflects all events reported on the entity and its children (if any). + // The aggregation is done by applying the desired health policy. + // . Possible values include: 'AggregatedHealthState1Invalid', 'AggregatedHealthState1Ok', 'AggregatedHealthState1Warning', 'AggregatedHealthState1Error', 'AggregatedHealthState1Unknown' + AggregatedHealthState AggregatedHealthState1 `json:"AggregatedHealthState,omitempty"` + // HealthEvents - The list of health events reported on the entity. + HealthEvents *[]HealthEvent `json:"HealthEvents,omitempty"` + // UnhealthyEvaluations - The unhealthy evaluations that show why the current aggregated health state was returned by Health Manager. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for PartitionHealth struct. +func (ph *PartitionHealth) 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 "PartitionId": + if v != nil { + var partitionID uuid.UUID + err = json.Unmarshal(*v, &partitionID) + if err != nil { + return err + } + ph.PartitionID = &partitionID + } + case "ReplicaHealthStates": + if v != nil { + replicaHealthStates, err := unmarshalBasicReplicaHealthStateArray(*v) + if err != nil { + return err + } + ph.ReplicaHealthStates = &replicaHealthStates + } + case "AggregatedHealthState": + if v != nil { + var aggregatedHealthState AggregatedHealthState1 + err = json.Unmarshal(*v, &aggregatedHealthState) + if err != nil { + return err + } + ph.AggregatedHealthState = aggregatedHealthState + } + case "HealthEvents": + if v != nil { + var healthEvents []HealthEvent + err = json.Unmarshal(*v, &healthEvents) + if err != nil { + return err + } + ph.HealthEvents = &healthEvents + } + case "UnhealthyEvaluations": + if v != nil { + var unhealthyEvaluations []HealthEvaluationWrapper + err = json.Unmarshal(*v, &unhealthyEvaluations) + if err != nil { + return err + } + ph.UnhealthyEvaluations = &unhealthyEvaluations + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionHealthEvaluation represents health evaluation for a partition, containing information about the data +// and the algorithm used by health store to evaluate health. The evaluation is returned only when the aggregated +// health state is either Error or Warning. +type PartitionHealthEvaluation struct { + // PartitionID - Id of the partition. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the current aggregated health state of the partition. The types of the unhealthy evaluations can be ReplicasHealthEvaluation or EventHealthEvaluation. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) MarshalJSON() ([]byte, error) { + phe.Kind = KindPartition + objectMap := make(map[string]interface{}) + if phe.PartitionID != nil { + objectMap["PartitionId"] = phe.PartitionID + } + if phe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = phe.UnhealthyEvaluations + } + if phe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = phe.AggregatedHealthState + } + if phe.Description != nil { + objectMap["Description"] = phe.Description + } + if phe.Kind != "" { + objectMap["Kind"] = phe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return &phe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for PartitionHealthEvaluation. +func (phe PartitionHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &phe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionHealthState represents the health state of a partition, which contains the partition identifier and its +// aggregated health state. +type PartitionHealthState struct { + // PartitionID - The ID of the partition. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // AggregatedHealthState - Possible values include: 'AggregatedHealthState2Invalid', 'AggregatedHealthState2Ok', 'AggregatedHealthState2Warning', 'AggregatedHealthState2Error', 'AggregatedHealthState2Unknown' + AggregatedHealthState AggregatedHealthState2 `json:"AggregatedHealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionHealthStateChunk represents the health state chunk of a partition, which contains the partition id, its +// aggregated health state and any replicas that respect the filters in the cluster health chunk query description. +type PartitionHealthStateChunk struct { + // PartitionID - The ID of the partition. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // ReplicaHealthStateChunks - The list of replica health state chunks belonging to the partition that respect the filters in the cluster health chunk query description. + ReplicaHealthStateChunks *ReplicaHealthStateChunkList `json:"ReplicaHealthStateChunks,omitempty"` + // HealthState - Possible values include: 'HealthState2Invalid', 'HealthState2Ok', 'HealthState2Warning', 'HealthState2Error', 'HealthState2Unknown' + HealthState HealthState2 `json:"HealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionHealthStateChunkList the list of partition health state chunks that respect the input filters in the +// chunk query description. +// Returned by get cluster health state chunks query as part of the parent application hierarchy. +type PartitionHealthStateChunkList struct { + // Items - The list of partition health state chunks that respect the input filters in the chunk query. + Items *[]PartitionHealthStateChunk `json:"Items,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionHealthStateFilter defines matching criteria to determine whether a partition should be included as a +// child of a service in the cluster health chunk. +// The partitions are only returned if the parent entities match a filter specified in the cluster health chunk +// query description. The parent service and application must be included in the cluster health chunk. +// One filter can match zero, one or multiple partitions, depending on its properties. +type PartitionHealthStateFilter struct { + // PartitionIDFilter - ID of the partition that matches the filter. The filter is applied only to the specified partition, if it exists. + // If the partition doesn't exist, no partition is returned in the cluster health chunk based on this filter. + // If the partition exists, it is included in the cluster health chunk if it respects the other filter properties. + // If not specified, all partitions that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + PartitionIDFilter *uuid.UUID `json:"PartitionIdFilter,omitempty"` + // HealthStateFilter - The filter for the health state of the partitions. It allows selecting partitions if they match the desired health states. + // The possible values are integer value of one of the following health states. Only partitions that match the filter are returned. All partitions are used to evaluate the cluster aggregated health state. + // If not specified, default value is None, unless the partition id is specified. If the filter has default value and partition id is specified, the matching partition is returned. + // The state values are flag based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + // For example, if the provided value is 6, it matches partitions with HealthState value of OK (2) and Warning (4). + // - Default - Default value. Matches any HealthState. The value is zero. + // - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + // - Ok - Filter that matches input with HealthState value Ok. The value is 2. + // - Warning - Filter that matches input with HealthState value Warning. The value is 4. + // - Error - Filter that matches input with HealthState value Error. The value is 8. + // - All - Filter that matches input with any HealthState value. The value is 65535. + HealthStateFilter *int32 `json:"HealthStateFilter,omitempty"` + // ReplicaFilters - Defines a list of filters that specify which replicas to be included in the returned cluster health chunk as children of the parent partition. The replicas are returned only if the parent partition matches a filter. + // If the list is empty, no replicas are returned. All the replicas are used to evaluate the parent partition aggregated health state, regardless of the input filters. + // The partition filter may specify multiple replica filters. + // For example, it can specify a filter to return all replicas with health state Error and another filter to always include a replica identified by its replica id. + ReplicaFilters *[]ReplicaHealthStateFilter `json:"ReplicaFilters,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicPartitionInformation information about the partition identity, partitioning scheme and keys supported by it. +type BasicPartitionInformation interface { + AsInt64RangePartitionInformation() (*Int64RangePartitionInformation, bool) + AsNamedPartitionInformation() (*NamedPartitionInformation, bool) + AsSingletonPartitionInformation() (*SingletonPartitionInformation, bool) + AsPartitionInformation() (*PartitionInformation, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionInformation information about the partition identity, partitioning scheme and keys supported by it. +type PartitionInformation struct { + ID *uuid.UUID `json:"Id,omitempty"` + // ServicePartitionKind - Possible values include: 'ServicePartitionKindPartitionInformation', 'ServicePartitionKindInt64Range', 'ServicePartitionKindNamed', 'ServicePartitionKindSingleton' + ServicePartitionKind ServicePartitionKind `json:"ServicePartitionKind,omitempty"` +} + +func unmarshalBasicPartitionInformation(body []byte) (BasicPartitionInformation, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["ServicePartitionKind"] { + case string(ServicePartitionKindInt64Range): + var i6rpi Int64RangePartitionInformation + err := json.Unmarshal(body, &i6rpi) + return i6rpi, err + case string(ServicePartitionKindNamed): + var npi NamedPartitionInformation + err := json.Unmarshal(body, &npi) + return npi, err + case string(ServicePartitionKindSingleton): + var spi SingletonPartitionInformation + err := json.Unmarshal(body, &spi) + return spi, err + default: + var pi PartitionInformation + err := json.Unmarshal(body, &pi) + return pi, err + } +} +func unmarshalBasicPartitionInformationArray(body []byte) ([]BasicPartitionInformation, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + piArray := make([]BasicPartitionInformation, len(rawMessages)) + + for index, rawMessage := range rawMessages { + pi, err := unmarshalBasicPartitionInformation(*rawMessage) + if err != nil { + return nil, err + } + piArray[index] = pi + } + return piArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for PartitionInformation. +func (pi PartitionInformation) MarshalJSON() ([]byte, error) { + pi.ServicePartitionKind = ServicePartitionKindPartitionInformation + objectMap := make(map[string]interface{}) + if pi.ID != nil { + objectMap["Id"] = pi.ID + } + if pi.ServicePartitionKind != "" { + objectMap["ServicePartitionKind"] = pi.ServicePartitionKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsInt64RangePartitionInformation is the BasicPartitionInformation implementation for PartitionInformation. +func (pi PartitionInformation) AsInt64RangePartitionInformation() (*Int64RangePartitionInformation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNamedPartitionInformation is the BasicPartitionInformation implementation for PartitionInformation. +func (pi PartitionInformation) AsNamedPartitionInformation() (*NamedPartitionInformation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSingletonPartitionInformation is the BasicPartitionInformation implementation for PartitionInformation. +func (pi PartitionInformation) AsSingletonPartitionInformation() (*SingletonPartitionInformation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionInformation is the BasicPartitionInformation implementation for PartitionInformation. +func (pi PartitionInformation) AsPartitionInformation() (*PartitionInformation, bool) { + return &pi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionInformation is the BasicPartitionInformation implementation for PartitionInformation. +func (pi PartitionInformation) AsBasicPartitionInformation() (BasicPartitionInformation, bool) { + return &pi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionLoadInformation represents load information for a partition, which contains the primary and secondary +// reported load metrics. +// In case there is no load reported, PartitionLoadInformation will contain the default load for the service of the +// partition. +// For default loads, LoadMetricReport's LastReportedUtc is set to 0. +type PartitionLoadInformation struct { + autorest.Response `json:"-"` + // PartitionID - Id of the partition. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // PrimaryLoadMetricReports - Array of load reports from the primary replica for this partition. + PrimaryLoadMetricReports *[]LoadMetricReport `json:"PrimaryLoadMetricReports,omitempty"` + // SecondaryLoadMetricReports - Array of aggregated load reports from all secondary replicas for this partition. + // Array only contains the latest reported load for each metric. + SecondaryLoadMetricReports *[]LoadMetricReport `json:"SecondaryLoadMetricReports,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionQuorumLossProgress information about a partition quorum loss user-induced operation. +type PartitionQuorumLossProgress struct { + autorest.Response `json:"-"` + // State - Possible values include: 'State4Invalid', 'State4Running', 'State4RollingBack', 'State4Completed', 'State4Faulted', 'State4Cancelled', 'State4ForceCancelled' + State State4 `json:"State,omitempty"` + InvokeQuorumLossResult *InvokeQuorumLossResult `json:"InvokeQuorumLossResult,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionRestartProgress information about a partition restart user-induced operation. +type PartitionRestartProgress struct { + autorest.Response `json:"-"` + // State - Possible values include: 'State5Invalid', 'State5Running', 'State5RollingBack', 'State5Completed', 'State5Faulted', 'State5Cancelled', 'State5ForceCancelled' + State State5 `json:"State,omitempty"` + RestartPartitionResult *RestartPartitionResult `json:"RestartPartitionResult,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicPartitionSafetyCheck represents a safety check for the service partition being performed by service fabric +// before continuing with operations. +type BasicPartitionSafetyCheck interface { + AsEnsureAvailabilitySafetyCheck() (*EnsureAvailabilitySafetyCheck, bool) + AsEnsurePartitionQurumSafetyCheck() (*EnsurePartitionQurumSafetyCheck, bool) + AsWaitForInbuildReplicaSafetyCheck() (*WaitForInbuildReplicaSafetyCheck, bool) + AsWaitForPrimaryPlacementSafetyCheck() (*WaitForPrimaryPlacementSafetyCheck, bool) + AsWaitForPrimarySwapSafetyCheck() (*WaitForPrimarySwapSafetyCheck, bool) + AsWaitForReconfigurationSafetyCheck() (*WaitForReconfigurationSafetyCheck, bool) + AsPartitionSafetyCheck() (*PartitionSafetyCheck, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionSafetyCheck represents a safety check for the service partition being performed by service fabric +// before continuing with operations. +type PartitionSafetyCheck struct { + // PartitionID - Id of the partition which is undergoing the safety check. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // Kind - Possible values include: 'KindSafetyCheck', 'KindPartitionSafetyCheck', 'KindEnsureAvailability', 'KindEnsurePartitionQuorum', 'KindEnsureSeedNodeQuorum', 'KindWaitForInbuildReplica', 'KindWaitForPrimaryPlacement', 'KindWaitForPrimarySwap', 'KindWaitForReconfiguration' + Kind KindBasicSafetyCheck `json:"Kind,omitempty"` +} + +func unmarshalBasicPartitionSafetyCheck(body []byte) (BasicPartitionSafetyCheck, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["Kind"] { + case string(KindEnsureAvailability): + var easc EnsureAvailabilitySafetyCheck + err := json.Unmarshal(body, &easc) + return easc, err + case string(KindEnsurePartitionQuorum): + var epqsc EnsurePartitionQurumSafetyCheck + err := json.Unmarshal(body, &epqsc) + return epqsc, err + case string(KindWaitForInbuildReplica): + var wfirsc WaitForInbuildReplicaSafetyCheck + err := json.Unmarshal(body, &wfirsc) + return wfirsc, err + case string(KindWaitForPrimaryPlacement): + var wfppsc WaitForPrimaryPlacementSafetyCheck + err := json.Unmarshal(body, &wfppsc) + return wfppsc, err + case string(KindWaitForPrimarySwap): + var wfpssc WaitForPrimarySwapSafetyCheck + err := json.Unmarshal(body, &wfpssc) + return wfpssc, err + case string(KindWaitForReconfiguration): + var wfrsc WaitForReconfigurationSafetyCheck + err := json.Unmarshal(body, &wfrsc) + return wfrsc, err + default: + var psc PartitionSafetyCheck + err := json.Unmarshal(body, &psc) + return psc, err + } +} +func unmarshalBasicPartitionSafetyCheckArray(body []byte) ([]BasicPartitionSafetyCheck, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + pscArray := make([]BasicPartitionSafetyCheck, len(rawMessages)) + + for index, rawMessage := range rawMessages { + psc, err := unmarshalBasicPartitionSafetyCheck(*rawMessage) + if err != nil { + return nil, err + } + pscArray[index] = psc + } + return pscArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for PartitionSafetyCheck. +func (psc PartitionSafetyCheck) MarshalJSON() ([]byte, error) { + psc.Kind = KindPartitionSafetyCheck + objectMap := make(map[string]interface{}) + if psc.PartitionID != nil { + objectMap["PartitionId"] = psc.PartitionID + } + if psc.Kind != "" { + objectMap["Kind"] = psc.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionSafetyCheck is the BasicSafetyCheck implementation for PartitionSafetyCheck. +func (psc PartitionSafetyCheck) AsPartitionSafetyCheck() (*PartitionSafetyCheck, bool) { + return &psc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionSafetyCheck is the BasicSafetyCheck implementation for PartitionSafetyCheck. +func (psc PartitionSafetyCheck) AsBasicPartitionSafetyCheck() (BasicPartitionSafetyCheck, bool) { + return &psc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsureAvailabilitySafetyCheck is the BasicSafetyCheck implementation for PartitionSafetyCheck. +func (psc PartitionSafetyCheck) AsEnsureAvailabilitySafetyCheck() (*EnsureAvailabilitySafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsurePartitionQurumSafetyCheck is the BasicSafetyCheck implementation for PartitionSafetyCheck. +func (psc PartitionSafetyCheck) AsEnsurePartitionQurumSafetyCheck() (*EnsurePartitionQurumSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSeedNodeSafetyCheck is the BasicSafetyCheck implementation for PartitionSafetyCheck. +func (psc PartitionSafetyCheck) AsSeedNodeSafetyCheck() (*SeedNodeSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForInbuildReplicaSafetyCheck is the BasicSafetyCheck implementation for PartitionSafetyCheck. +func (psc PartitionSafetyCheck) AsWaitForInbuildReplicaSafetyCheck() (*WaitForInbuildReplicaSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimaryPlacementSafetyCheck is the BasicSafetyCheck implementation for PartitionSafetyCheck. +func (psc PartitionSafetyCheck) AsWaitForPrimaryPlacementSafetyCheck() (*WaitForPrimaryPlacementSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimarySwapSafetyCheck is the BasicSafetyCheck implementation for PartitionSafetyCheck. +func (psc PartitionSafetyCheck) AsWaitForPrimarySwapSafetyCheck() (*WaitForPrimarySwapSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForReconfigurationSafetyCheck is the BasicSafetyCheck implementation for PartitionSafetyCheck. +func (psc PartitionSafetyCheck) AsWaitForReconfigurationSafetyCheck() (*WaitForReconfigurationSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSafetyCheck is the BasicSafetyCheck implementation for PartitionSafetyCheck. +func (psc PartitionSafetyCheck) AsSafetyCheck() (*SafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicSafetyCheck is the BasicSafetyCheck implementation for PartitionSafetyCheck. +func (psc PartitionSafetyCheck) AsBasicSafetyCheck() (BasicSafetyCheck, bool) { + return &psc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicPartitionSchemeDescription describes how the service is partitioned. +type BasicPartitionSchemeDescription interface { + AsNamedPartitionSchemeDescription() (*NamedPartitionSchemeDescription, bool) + AsSingletonPartitionSchemeDescription() (*SingletonPartitionSchemeDescription, bool) + AsUniformInt64RangePartitionSchemeDescription() (*UniformInt64RangePartitionSchemeDescription, bool) + AsPartitionSchemeDescription() (*PartitionSchemeDescription, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionSchemeDescription describes how the service is partitioned. +type PartitionSchemeDescription struct { + // PartitionScheme - Possible values include: 'PartitionSchemePartitionSchemeDescription', 'PartitionSchemeNamed', 'PartitionSchemeSingleton', 'PartitionSchemeUniformInt64Range' + PartitionScheme PartitionScheme `json:"PartitionScheme,omitempty"` +} + +func unmarshalBasicPartitionSchemeDescription(body []byte) (BasicPartitionSchemeDescription, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["PartitionScheme"] { + case string(PartitionSchemeNamed): + var npsd NamedPartitionSchemeDescription + err := json.Unmarshal(body, &npsd) + return npsd, err + case string(PartitionSchemeSingleton): + var spsd SingletonPartitionSchemeDescription + err := json.Unmarshal(body, &spsd) + return spsd, err + case string(PartitionSchemeUniformInt64Range): + var ui6rpsd UniformInt64RangePartitionSchemeDescription + err := json.Unmarshal(body, &ui6rpsd) + return ui6rpsd, err + default: + var psd PartitionSchemeDescription + err := json.Unmarshal(body, &psd) + return psd, err + } +} +func unmarshalBasicPartitionSchemeDescriptionArray(body []byte) ([]BasicPartitionSchemeDescription, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + psdArray := make([]BasicPartitionSchemeDescription, len(rawMessages)) + + for index, rawMessage := range rawMessages { + psd, err := unmarshalBasicPartitionSchemeDescription(*rawMessage) + if err != nil { + return nil, err + } + psdArray[index] = psd + } + return psdArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for PartitionSchemeDescription. +func (psd PartitionSchemeDescription) MarshalJSON() ([]byte, error) { + psd.PartitionScheme = PartitionSchemePartitionSchemeDescription + objectMap := make(map[string]interface{}) + if psd.PartitionScheme != "" { + objectMap["PartitionScheme"] = psd.PartitionScheme + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNamedPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for PartitionSchemeDescription. +func (psd PartitionSchemeDescription) AsNamedPartitionSchemeDescription() (*NamedPartitionSchemeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSingletonPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for PartitionSchemeDescription. +func (psd PartitionSchemeDescription) AsSingletonPartitionSchemeDescription() (*SingletonPartitionSchemeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUniformInt64RangePartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for PartitionSchemeDescription. +func (psd PartitionSchemeDescription) AsUniformInt64RangePartitionSchemeDescription() (*UniformInt64RangePartitionSchemeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for PartitionSchemeDescription. +func (psd PartitionSchemeDescription) AsPartitionSchemeDescription() (*PartitionSchemeDescription, bool) { + return &psd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for PartitionSchemeDescription. +func (psd PartitionSchemeDescription) AsBasicPartitionSchemeDescription() (BasicPartitionSchemeDescription, bool) { + return &psd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PartitionsHealthEvaluation represents health evaluation for the partitions of a service, containing health +// evaluations for each unhealthy partition that impacts current aggregated health state. Can be returned when +// evaluating service health and the aggregated health state is either Error or Warning. +type PartitionsHealthEvaluation struct { + // MaxPercentUnhealthyPartitionsPerService - Maximum allowed percentage of unhealthy partitions per service from the ServiceTypeHealthPolicy. + MaxPercentUnhealthyPartitionsPerService *int32 `json:"MaxPercentUnhealthyPartitionsPerService,omitempty"` + // TotalCount - Total number of partitions of the service from the health store. + TotalCount *int64 `json:"TotalCount,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy PartitionHealthEvaluation that impacted the aggregated health. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) MarshalJSON() ([]byte, error) { + phe.Kind = KindPartitions + objectMap := make(map[string]interface{}) + if phe.MaxPercentUnhealthyPartitionsPerService != nil { + objectMap["MaxPercentUnhealthyPartitionsPerService"] = phe.MaxPercentUnhealthyPartitionsPerService + } + if phe.TotalCount != nil { + objectMap["TotalCount"] = phe.TotalCount + } + if phe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = phe.UnhealthyEvaluations + } + if phe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = phe.AggregatedHealthState + } + if phe.Description != nil { + objectMap["Description"] = phe.Description + } + if phe.Kind != "" { + objectMap["Kind"] = phe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return &phe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for PartitionsHealthEvaluation. +func (phe PartitionsHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &phe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// PrimaryReplicatorStatus ... +type PrimaryReplicatorStatus struct { + // ReplicationQueueStatus - Details about the replication queue on the primary replicator. + ReplicationQueueStatus *ReplicatorQueueStatus `json:"ReplicationQueueStatus,omitempty"` + // RemoteReplicators - The status of all the active and idle secondary replicators that the primary is aware of. + RemoteReplicators *[]RemoteReplicatorStatus `json:"RemoteReplicators,omitempty"` + // Kind - Possible values include: 'KindReplicatorStatus', 'KindPrimary', 'KindSecondaryReplicatorStatus', 'KindActiveSecondary', 'KindIdleSecondary' + Kind KindBasicReplicatorStatus `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for PrimaryReplicatorStatus. +func (prs PrimaryReplicatorStatus) MarshalJSON() ([]byte, error) { + prs.Kind = KindPrimary + objectMap := make(map[string]interface{}) + if prs.ReplicationQueueStatus != nil { + objectMap["ReplicationQueueStatus"] = prs.ReplicationQueueStatus + } + if prs.RemoteReplicators != nil { + objectMap["RemoteReplicators"] = prs.RemoteReplicators + } + if prs.Kind != "" { + objectMap["Kind"] = prs.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPrimaryReplicatorStatus is the BasicReplicatorStatus implementation for PrimaryReplicatorStatus. +func (prs PrimaryReplicatorStatus) AsPrimaryReplicatorStatus() (*PrimaryReplicatorStatus, bool) { + return &prs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryReplicatorStatus is the BasicReplicatorStatus implementation for PrimaryReplicatorStatus. +func (prs PrimaryReplicatorStatus) AsSecondaryReplicatorStatus() (*SecondaryReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicSecondaryReplicatorStatus is the BasicReplicatorStatus implementation for PrimaryReplicatorStatus. +func (prs PrimaryReplicatorStatus) AsBasicSecondaryReplicatorStatus() (BasicSecondaryReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryActiveReplicatorStatus is the BasicReplicatorStatus implementation for PrimaryReplicatorStatus. +func (prs PrimaryReplicatorStatus) AsSecondaryActiveReplicatorStatus() (*SecondaryActiveReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryIdleReplicatorStatus is the BasicReplicatorStatus implementation for PrimaryReplicatorStatus. +func (prs PrimaryReplicatorStatus) AsSecondaryIdleReplicatorStatus() (*SecondaryIdleReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicatorStatus is the BasicReplicatorStatus implementation for PrimaryReplicatorStatus. +func (prs PrimaryReplicatorStatus) AsReplicatorStatus() (*ReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicatorStatus is the BasicReplicatorStatus implementation for PrimaryReplicatorStatus. +func (prs PrimaryReplicatorStatus) AsBasicReplicatorStatus() (BasicReplicatorStatus, bool) { + return &prs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReadCloser ... +type ReadCloser struct { + autorest.Response `json:"-"` + Value *io.ReadCloser `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoteReplicatorAcknowledgementDetail provides various statistics of the acknowledgements that are being +// received from the remote replicator. +type RemoteReplicatorAcknowledgementDetail struct { + // AverageReceiveDuration - Represents the average duration it takes for the remote replicator to receive an operation. + AverageReceiveDuration *string `json:"AverageReceiveDuration,omitempty"` + // AverageApplyDuration - Represents the average duration it takes for the remote replicator to apply an operation. This usually entails writing the operation to disk. + AverageApplyDuration *string `json:"AverageApplyDuration,omitempty"` + // NotReceivedCount - Represents the number of operations not yet received by a remote replicator. + NotReceivedCount *string `json:"NotReceivedCount,omitempty"` + // ReceivedAndNotAppliedCount - Represents the number of operations received and not yet applied by a remote replicator. + ReceivedAndNotAppliedCount *string `json:"ReceivedAndNotAppliedCount,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoteReplicatorAcknowledgementStatus provides details about the remote replicators from the primary +// replicator's point of view. +type RemoteReplicatorAcknowledgementStatus struct { + // ReplicationStreamAcknowledgementDetail - Details about the acknowledgements for operations that are part of the replication stream data. + ReplicationStreamAcknowledgementDetail *RemoteReplicatorAcknowledgementDetail `json:"ReplicationStreamAcknowledgementDetail,omitempty"` + // CopyStreamAcknowledgementDetail - Details about the acknowledgements for operations that are part of the copy stream data. + CopyStreamAcknowledgementDetail *RemoteReplicatorAcknowledgementDetail `json:"CopyStreamAcknowledgementDetail,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RemoteReplicatorStatus represents the state of the secondary replicator from the primary replicator’s point of +// view. +type RemoteReplicatorStatus struct { + // ReplicaID - Represents the replica id of the remote secondary replicator. + ReplicaID *string `json:"ReplicaId,omitempty"` + // LastAcknowledgementProcessedTimeUtc - The last timestamp (in UTC) when an acknowledgement from the secondary replicator was processed on the primary. + // UTC 0 represents an invalid value, indicating that no acknowledgement messages were ever processed. + LastAcknowledgementProcessedTimeUtc *date.Time `json:"LastAcknowledgementProcessedTimeUtc,omitempty"` + // LastReceivedReplicationSequenceNumber - The highest replication operation sequence number that the secondary has received from the primary. + LastReceivedReplicationSequenceNumber *string `json:"LastReceivedReplicationSequenceNumber,omitempty"` + // LastAppliedReplicationSequenceNumber - The highest replication operation sequence number that the secondary has applied to its state. + LastAppliedReplicationSequenceNumber *string `json:"LastAppliedReplicationSequenceNumber,omitempty"` + // IsInBuild - A value that indicates whether the secondary replica is in the process of being built. + IsInBuild *bool `json:"IsInBuild,omitempty"` + // LastReceivedCopySequenceNumber - The highest copy operation sequence number that the secondary has received from the primary. + // A value of -1 implies that the secondary has received all copy operations. + LastReceivedCopySequenceNumber *string `json:"LastReceivedCopySequenceNumber,omitempty"` + // LastAppliedCopySequenceNumber - The highest copy operation sequence number that the secondary has applied to its state. + // A value of -1 implies that the secondary has applied all copy operations and the copy process is complete. + LastAppliedCopySequenceNumber *string `json:"LastAppliedCopySequenceNumber,omitempty"` + // RemoteReplicatorAcknowledgementStatus - Represents the acknowledgement status for the remote secondary replicator. + RemoteReplicatorAcknowledgementStatus *RemoteReplicatorAcknowledgementStatus `json:"RemoteReplicatorAcknowledgementStatus,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicReplicaHealth represents a base class for stateful service replica or stateless service instance health. +// Contains the replica aggregated health state, the health events and the unhealthy evaluations. +type BasicReplicaHealth interface { + AsStatefulServiceReplicaHealth() (*StatefulServiceReplicaHealth, bool) + AsStatelessServiceInstanceHealth() (*StatelessServiceInstanceHealth, bool) + AsReplicaHealth() (*ReplicaHealth, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicaHealth represents a base class for stateful service replica or stateless service instance health. +// Contains the replica aggregated health state, the health events and the unhealthy evaluations. +type ReplicaHealth struct { + autorest.Response `json:"-"` + // PartitionID - Id of the partition to which this replica belongs. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicReplicaHealthServiceKindReplicaHealth', 'ServiceKindBasicReplicaHealthServiceKindStateful', 'ServiceKindBasicReplicaHealthServiceKindStateless' + ServiceKind ServiceKindBasicReplicaHealth `json:"ServiceKind,omitempty"` + // AggregatedHealthState - The HealthState representing the aggregated health state of the entity computed by Health Manager. + // The health evaluation of the entity reflects all events reported on the entity and its children (if any). + // The aggregation is done by applying the desired health policy. + // . Possible values include: 'AggregatedHealthState1Invalid', 'AggregatedHealthState1Ok', 'AggregatedHealthState1Warning', 'AggregatedHealthState1Error', 'AggregatedHealthState1Unknown' + AggregatedHealthState AggregatedHealthState1 `json:"AggregatedHealthState,omitempty"` + // HealthEvents - The list of health events reported on the entity. + HealthEvents *[]HealthEvent `json:"HealthEvents,omitempty"` + // UnhealthyEvaluations - The unhealthy evaluations that show why the current aggregated health state was returned by Health Manager. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` +} + +func unmarshalBasicReplicaHealth(body []byte) (BasicReplicaHealth, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["ServiceKind"] { + case string(ServiceKindBasicReplicaHealthServiceKindStateful): + var ssrh StatefulServiceReplicaHealth + err := json.Unmarshal(body, &ssrh) + return ssrh, err + case string(ServiceKindBasicReplicaHealthServiceKindStateless): + var ssih StatelessServiceInstanceHealth + err := json.Unmarshal(body, &ssih) + return ssih, err + default: + var rh ReplicaHealth + err := json.Unmarshal(body, &rh) + return rh, err + } +} +func unmarshalBasicReplicaHealthArray(body []byte) ([]BasicReplicaHealth, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rhArray := make([]BasicReplicaHealth, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rh, err := unmarshalBasicReplicaHealth(*rawMessage) + if err != nil { + return nil, err + } + rhArray[index] = rh + } + return rhArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ReplicaHealth. +func (rh ReplicaHealth) MarshalJSON() ([]byte, error) { + rh.ServiceKind = ServiceKindBasicReplicaHealthServiceKindReplicaHealth + objectMap := make(map[string]interface{}) + if rh.PartitionID != nil { + objectMap["PartitionId"] = rh.PartitionID + } + if rh.ServiceKind != "" { + objectMap["ServiceKind"] = rh.ServiceKind + } + if rh.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = rh.AggregatedHealthState + } + if rh.HealthEvents != nil { + objectMap["HealthEvents"] = rh.HealthEvents + } + if rh.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = rh.UnhealthyEvaluations + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceReplicaHealth is the BasicReplicaHealth implementation for ReplicaHealth. +func (rh ReplicaHealth) AsStatefulServiceReplicaHealth() (*StatefulServiceReplicaHealth, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceInstanceHealth is the BasicReplicaHealth implementation for ReplicaHealth. +func (rh ReplicaHealth) AsStatelessServiceInstanceHealth() (*StatelessServiceInstanceHealth, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealth is the BasicReplicaHealth implementation for ReplicaHealth. +func (rh ReplicaHealth) AsReplicaHealth() (*ReplicaHealth, bool) { + return &rh, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicaHealth is the BasicReplicaHealth implementation for ReplicaHealth. +func (rh ReplicaHealth) AsBasicReplicaHealth() (BasicReplicaHealth, bool) { + return &rh, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicaHealthEvaluation represents health evaluation for a replica, containing information about the data and +// the algorithm used by health store to evaluate health. The evaluation is returned only when the aggregated +// health state is either Error or Warning. +type ReplicaHealthEvaluation struct { + // PartitionID - Id of the partition to which the replica belongs. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // ReplicaOrInstanceID - Id of the stateful service replica or the stateless service instance. + ReplicaOrInstanceID *string `json:"ReplicaOrInstanceId,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the current aggregated health state of the replica. The types of the unhealthy evaluations can be EventHealthEvaluation. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) MarshalJSON() ([]byte, error) { + rhe.Kind = KindReplica + objectMap := make(map[string]interface{}) + if rhe.PartitionID != nil { + objectMap["PartitionId"] = rhe.PartitionID + } + if rhe.ReplicaOrInstanceID != nil { + objectMap["ReplicaOrInstanceId"] = rhe.ReplicaOrInstanceID + } + if rhe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = rhe.UnhealthyEvaluations + } + if rhe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = rhe.AggregatedHealthState + } + if rhe.Description != nil { + objectMap["Description"] = rhe.Description + } + if rhe.Kind != "" { + objectMap["Kind"] = rhe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return &rhe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for ReplicaHealthEvaluation. +func (rhe ReplicaHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &rhe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicaHealthModel ... +type ReplicaHealthModel struct { + autorest.Response `json:"-"` + Value BasicReplicaHealth `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for ReplicaHealthModel struct. +func (rhm *ReplicaHealthModel) UnmarshalJSON(body []byte) error { + rh, err := unmarshalBasicReplicaHealth(body) + if err != nil { + return err + } + rhm.Value = rh + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicReplicaHealthState represents a base class for stateful service replica or stateless service instance health +// state. +type BasicReplicaHealthState interface { + AsStatefulServiceReplicaHealthState() (*StatefulServiceReplicaHealthState, bool) + AsStatelessServiceInstanceHealthState() (*StatelessServiceInstanceHealthState, bool) + AsReplicaHealthState() (*ReplicaHealthState, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicaHealthState represents a base class for stateful service replica or stateless service instance health +// state. +type ReplicaHealthState struct { + // PartitionID - The ID of the partition to which this replica belongs. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicReplicaHealthStateServiceKindReplicaHealthState', 'ServiceKindBasicReplicaHealthStateServiceKindStateful', 'ServiceKindBasicReplicaHealthStateServiceKindStateless' + ServiceKind ServiceKindBasicReplicaHealthState `json:"ServiceKind,omitempty"` + // AggregatedHealthState - Possible values include: 'AggregatedHealthState2Invalid', 'AggregatedHealthState2Ok', 'AggregatedHealthState2Warning', 'AggregatedHealthState2Error', 'AggregatedHealthState2Unknown' + AggregatedHealthState AggregatedHealthState2 `json:"AggregatedHealthState,omitempty"` +} + +func unmarshalBasicReplicaHealthState(body []byte) (BasicReplicaHealthState, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["ServiceKind"] { + case string(ServiceKindBasicReplicaHealthStateServiceKindStateful): + var ssrhs StatefulServiceReplicaHealthState + err := json.Unmarshal(body, &ssrhs) + return ssrhs, err + case string(ServiceKindBasicReplicaHealthStateServiceKindStateless): + var ssihs StatelessServiceInstanceHealthState + err := json.Unmarshal(body, &ssihs) + return ssihs, err + default: + var RHS ReplicaHealthState + err := json.Unmarshal(body, &RHS) + return RHS, err + } +} +func unmarshalBasicReplicaHealthStateArray(body []byte) ([]BasicReplicaHealthState, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + RHSArray := make([]BasicReplicaHealthState, len(rawMessages)) + + for index, rawMessage := range rawMessages { + RHS, err := unmarshalBasicReplicaHealthState(*rawMessage) + if err != nil { + return nil, err + } + RHSArray[index] = RHS + } + return RHSArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ReplicaHealthState. +func (RHS ReplicaHealthState) MarshalJSON() ([]byte, error) { + RHS.ServiceKind = ServiceKindBasicReplicaHealthStateServiceKindReplicaHealthState + objectMap := make(map[string]interface{}) + if RHS.PartitionID != nil { + objectMap["PartitionId"] = RHS.PartitionID + } + if RHS.ServiceKind != "" { + objectMap["ServiceKind"] = RHS.ServiceKind + } + if RHS.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = RHS.AggregatedHealthState + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceReplicaHealthState is the BasicReplicaHealthState implementation for ReplicaHealthState. +func (RHS ReplicaHealthState) AsStatefulServiceReplicaHealthState() (*StatefulServiceReplicaHealthState, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceInstanceHealthState is the BasicReplicaHealthState implementation for ReplicaHealthState. +func (RHS ReplicaHealthState) AsStatelessServiceInstanceHealthState() (*StatelessServiceInstanceHealthState, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthState is the BasicReplicaHealthState implementation for ReplicaHealthState. +func (RHS ReplicaHealthState) AsReplicaHealthState() (*ReplicaHealthState, bool) { + return &RHS, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicaHealthState is the BasicReplicaHealthState implementation for ReplicaHealthState. +func (RHS ReplicaHealthState) AsBasicReplicaHealthState() (BasicReplicaHealthState, bool) { + return &RHS, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicaHealthStateChunk represents the health state chunk of a stateful service replica or a stateless service +// instance. +// The replica health state contains the replica ID and its aggregated health state. +type ReplicaHealthStateChunk struct { + // ReplicaOrInstanceID - The ID of the stateful service replica or the stateless service instance. + ReplicaOrInstanceID *string `json:"ReplicaOrInstanceId,omitempty"` + // HealthState - Possible values include: 'HealthState2Invalid', 'HealthState2Ok', 'HealthState2Warning', 'HealthState2Error', 'HealthState2Unknown' + HealthState HealthState2 `json:"HealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicaHealthStateChunkList the list of replica health state chunks that respect the input filters in the chunk +// query. Returned by get cluster health state chunks query. +type ReplicaHealthStateChunkList struct { + // Items - The list of replica health state chunks that respect the input filters in the chunk query. + Items *[]ReplicaHealthStateChunk `json:"Items,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicaHealthStateFilter defines matching criteria to determine whether a replica should be included as a child +// of a partition in the cluster health chunk. +// The replicas are only returned if the parent entities match a filter specified in the cluster health chunk query +// description. The parent partition, service and application must be included in the cluster health chunk. +// One filter can match zero, one or multiple replicas, depending on its properties. +type ReplicaHealthStateFilter struct { + // ReplicaOrInstanceIDFilter - Id of the stateful service replica or stateles service instance that matches the filter. The filter is applied only to the specified replica, if it exists. + // If the replica doesn't exist, no replica is returned in the cluster health chunk based on this filter. + // If the replica exists, it is included in the cluster health chunk if it respects the other filter properties. + // If not specified, all replicas that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + ReplicaOrInstanceIDFilter *string `json:"ReplicaOrInstanceIdFilter,omitempty"` + // HealthStateFilter - The filter for the health state of the replicas. It allows selecting replicas if they match the desired health states. + // The possible values are integer value of one of the following health states. Only replicas that match the filter are returned. All replicas are used to evaluate the parent partition aggregated health state. + // If not specified, default value is None, unless the replica id is specified. If the filter has default value and replica id is specified, the matching replica is returned. + // The state values are flag based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + // For example, if the provided value is 6, it matches replicas with HealthState value of OK (2) and Warning (4). + // - Default - Default value. Matches any HealthState. The value is zero. + // - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + // - Ok - Filter that matches input with HealthState value Ok. The value is 2. + // - Warning - Filter that matches input with HealthState value Warning. The value is 4. + // - Error - Filter that matches input with HealthState value Error. The value is 8. + // - All - Filter that matches input with any HealthState value. The value is 65535. + HealthStateFilter *int32 `json:"HealthStateFilter,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicReplicaInfo information about the identity, status, health, node name, uptime, and other details about the +// replica. +type BasicReplicaInfo interface { + AsStatefulServiceReplicaInfo() (*StatefulServiceReplicaInfo, bool) + AsStatelessServiceInstanceInfo() (*StatelessServiceInstanceInfo, bool) + AsReplicaInfo() (*ReplicaInfo, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicaInfo information about the identity, status, health, node name, uptime, and other details about the +// replica. +type ReplicaInfo struct { + autorest.Response `json:"-"` + // ReplicaStatus - Possible values include: 'ReplicaStatus1Invalid', 'ReplicaStatus1InBuild', 'ReplicaStatus1Standby', 'ReplicaStatus1Ready', 'ReplicaStatus1Down', 'ReplicaStatus1Dropped' + ReplicaStatus ReplicaStatus1 `json:"ReplicaStatus,omitempty"` + // HealthState - Possible values include: 'HealthState6Invalid', 'HealthState6Ok', 'HealthState6Warning', 'HealthState6Error', 'HealthState6Unknown' + HealthState HealthState6 `json:"HealthState,omitempty"` + // NodeName - The name of the node. + NodeName *string `json:"NodeName,omitempty"` + // Address - The address the replica is listening on. + Address *string `json:"Address,omitempty"` + // LastInBuildDurationInSeconds - The last in build duration of the replica in seconds. + LastInBuildDurationInSeconds *string `json:"LastInBuildDurationInSeconds,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicReplicaInfoServiceKindReplicaInfo', 'ServiceKindBasicReplicaInfoServiceKindStateful', 'ServiceKindBasicReplicaInfoServiceKindStateless' + ServiceKind ServiceKindBasicReplicaInfo `json:"ServiceKind,omitempty"` +} + +func unmarshalBasicReplicaInfo(body []byte) (BasicReplicaInfo, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["ServiceKind"] { + case string(ServiceKindBasicReplicaInfoServiceKindStateful): + var ssri StatefulServiceReplicaInfo + err := json.Unmarshal(body, &ssri) + return ssri, err + case string(ServiceKindBasicReplicaInfoServiceKindStateless): + var ssii StatelessServiceInstanceInfo + err := json.Unmarshal(body, &ssii) + return ssii, err + default: + var ri ReplicaInfo + err := json.Unmarshal(body, &ri) + return ri, err + } +} +func unmarshalBasicReplicaInfoArray(body []byte) ([]BasicReplicaInfo, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + riArray := make([]BasicReplicaInfo, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ri, err := unmarshalBasicReplicaInfo(*rawMessage) + if err != nil { + return nil, err + } + riArray[index] = ri + } + return riArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ReplicaInfo. +func (ri ReplicaInfo) MarshalJSON() ([]byte, error) { + ri.ServiceKind = ServiceKindBasicReplicaInfoServiceKindReplicaInfo + objectMap := make(map[string]interface{}) + if ri.ReplicaStatus != "" { + objectMap["ReplicaStatus"] = ri.ReplicaStatus + } + if ri.HealthState != "" { + objectMap["HealthState"] = ri.HealthState + } + if ri.NodeName != nil { + objectMap["NodeName"] = ri.NodeName + } + if ri.Address != nil { + objectMap["Address"] = ri.Address + } + if ri.LastInBuildDurationInSeconds != nil { + objectMap["LastInBuildDurationInSeconds"] = ri.LastInBuildDurationInSeconds + } + if ri.ServiceKind != "" { + objectMap["ServiceKind"] = ri.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceReplicaInfo is the BasicReplicaInfo implementation for ReplicaInfo. +func (ri ReplicaInfo) AsStatefulServiceReplicaInfo() (*StatefulServiceReplicaInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceInstanceInfo is the BasicReplicaInfo implementation for ReplicaInfo. +func (ri ReplicaInfo) AsStatelessServiceInstanceInfo() (*StatelessServiceInstanceInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaInfo is the BasicReplicaInfo implementation for ReplicaInfo. +func (ri ReplicaInfo) AsReplicaInfo() (*ReplicaInfo, bool) { + return &ri, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicaInfo is the BasicReplicaInfo implementation for ReplicaInfo. +func (ri ReplicaInfo) AsBasicReplicaInfo() (BasicReplicaInfo, bool) { + return &ri, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicaInfoModel ... +type ReplicaInfoModel struct { + autorest.Response `json:"-"` + Value BasicReplicaInfo `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for ReplicaInfoModel struct. +func (rim *ReplicaInfoModel) UnmarshalJSON(body []byte) error { + ri, err := unmarshalBasicReplicaInfo(body) + if err != nil { + return err + } + rim.Value = ri + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicasHealthEvaluation represents health evaluation for replicas, containing health evaluations for each +// unhealthy replica that impacted current aggregated health state. Can be returned when evaluating partition +// health and the aggregated health state is either Error or Warning. +type ReplicasHealthEvaluation struct { + // MaxPercentUnhealthyReplicasPerPartition - Maximum allowed percentage of unhealthy replicas per partition from the ApplicationHealthPolicy. + MaxPercentUnhealthyReplicasPerPartition *int32 `json:"MaxPercentUnhealthyReplicasPerPartition,omitempty"` + // TotalCount - Total number of replicas in the partition from the health store. + TotalCount *int64 `json:"TotalCount,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy ReplicaHealthEvaluation that impacted the aggregated health. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) MarshalJSON() ([]byte, error) { + rhe.Kind = KindReplicas + objectMap := make(map[string]interface{}) + if rhe.MaxPercentUnhealthyReplicasPerPartition != nil { + objectMap["MaxPercentUnhealthyReplicasPerPartition"] = rhe.MaxPercentUnhealthyReplicasPerPartition + } + if rhe.TotalCount != nil { + objectMap["TotalCount"] = rhe.TotalCount + } + if rhe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = rhe.UnhealthyEvaluations + } + if rhe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = rhe.AggregatedHealthState + } + if rhe.Description != nil { + objectMap["Description"] = rhe.Description + } + if rhe.Kind != "" { + objectMap["Kind"] = rhe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return &rhe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for ReplicasHealthEvaluation. +func (rhe ReplicasHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &rhe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicReplicaStatusBase information about the replica. +type BasicReplicaStatusBase interface { + AsKeyValueStoreReplicaStatus() (*KeyValueStoreReplicaStatus, bool) + AsReplicaStatusBase() (*ReplicaStatusBase, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicaStatusBase information about the replica. +type ReplicaStatusBase struct { + // Kind - Possible values include: 'KindReplicaStatusBase', 'KindKeyValueStore' + Kind KindBasicReplicaStatusBase `json:"Kind,omitempty"` +} + +func unmarshalBasicReplicaStatusBase(body []byte) (BasicReplicaStatusBase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["Kind"] { + case string(KindKeyValueStore): + var kvsrs KeyValueStoreReplicaStatus + err := json.Unmarshal(body, &kvsrs) + return kvsrs, err + default: + var rsb ReplicaStatusBase + err := json.Unmarshal(body, &rsb) + return rsb, err + } +} +func unmarshalBasicReplicaStatusBaseArray(body []byte) ([]BasicReplicaStatusBase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rsbArray := make([]BasicReplicaStatusBase, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rsb, err := unmarshalBasicReplicaStatusBase(*rawMessage) + if err != nil { + return nil, err + } + rsbArray[index] = rsb + } + return rsbArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ReplicaStatusBase. +func (rsb ReplicaStatusBase) MarshalJSON() ([]byte, error) { + rsb.Kind = KindReplicaStatusBase + objectMap := make(map[string]interface{}) + if rsb.Kind != "" { + objectMap["Kind"] = rsb.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsKeyValueStoreReplicaStatus is the BasicReplicaStatusBase implementation for ReplicaStatusBase. +func (rsb ReplicaStatusBase) AsKeyValueStoreReplicaStatus() (*KeyValueStoreReplicaStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaStatusBase is the BasicReplicaStatusBase implementation for ReplicaStatusBase. +func (rsb ReplicaStatusBase) AsReplicaStatusBase() (*ReplicaStatusBase, bool) { + return &rsb, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicaStatusBase is the BasicReplicaStatusBase implementation for ReplicaStatusBase. +func (rsb ReplicaStatusBase) AsBasicReplicaStatusBase() (BasicReplicaStatusBase, bool) { + return &rsb, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicatorQueueStatus provides various statistics of the queue used in the service fabric replicator. +// Contains information about the service fabric replicator like the replication/copy queue utilization, last +// acknowledgement received timestamp, etc. +// Depending on the role of the replicator, the properties in this type imply different meanings. +type ReplicatorQueueStatus struct { + // QueueUtilizationPercentage - Represents the utilization of the queue. A value of 0 indicates that the queue is empty and a value of 100 indicates the queue is full. + QueueUtilizationPercentage *int32 `json:"QueueUtilizationPercentage,omitempty"` + // QueueMemorySize - Represents the virtual memory consumed by the queue in bytes. + QueueMemorySize *string `json:"QueueMemorySize,omitempty"` + // FirstSequenceNumber - On a primary replicator, this is semantically the sequence number of the operation for which all the secondary replicas have sent an acknowledgement. + // On a secondary replicator, this is the smallest sequence number of the operation that is present in the queue. + FirstSequenceNumber *string `json:"FirstSequenceNumber,omitempty"` + // CompletedSequenceNumber - On a primary replicator, this is semantically the highest sequence number of the operation for which all the secondary replicas have sent an acknowledgement. + // On a secondary replicator, this is semantically the highest sequence number that has been applied to the persistent state. + CompletedSequenceNumber *string `json:"CompletedSequenceNumber,omitempty"` + // CommittedSequenceNumber - On a primary replicator, this is semantically the highest sequence number of the operation for which a write quorum of the secondary replicas have sent an acknowledgement. + // On a secondary replicator, this is semantically the highest sequence number of the in-order operation received from the primary. + CommittedSequenceNumber *string `json:"CommittedSequenceNumber,omitempty"` + // LastSequenceNumber - Represents the latest sequence number of the operation that is available in the queue. + LastSequenceNumber *string `json:"LastSequenceNumber,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicReplicatorStatus represents a base class for primary or secondary replicator status. +// Contains information about the service fabric replicator like the replication/copy queue utilization, last +// acknowledgement received timestamp, etc. +type BasicReplicatorStatus interface { + AsPrimaryReplicatorStatus() (*PrimaryReplicatorStatus, bool) + AsSecondaryReplicatorStatus() (*SecondaryReplicatorStatus, bool) + AsBasicSecondaryReplicatorStatus() (BasicSecondaryReplicatorStatus, bool) + AsSecondaryActiveReplicatorStatus() (*SecondaryActiveReplicatorStatus, bool) + AsSecondaryIdleReplicatorStatus() (*SecondaryIdleReplicatorStatus, bool) + AsReplicatorStatus() (*ReplicatorStatus, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ReplicatorStatus represents a base class for primary or secondary replicator status. +// Contains information about the service fabric replicator like the replication/copy queue utilization, last +// acknowledgement received timestamp, etc. +type ReplicatorStatus struct { + // Kind - Possible values include: 'KindReplicatorStatus', 'KindPrimary', 'KindSecondaryReplicatorStatus', 'KindActiveSecondary', 'KindIdleSecondary' + Kind KindBasicReplicatorStatus `json:"Kind,omitempty"` +} + +func unmarshalBasicReplicatorStatus(body []byte) (BasicReplicatorStatus, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["Kind"] { + case string(KindPrimary): + var prs PrimaryReplicatorStatus + err := json.Unmarshal(body, &prs) + return prs, err + case string(KindSecondaryReplicatorStatus): + var srs SecondaryReplicatorStatus + err := json.Unmarshal(body, &srs) + return srs, err + case string(KindActiveSecondary): + var sars SecondaryActiveReplicatorStatus + err := json.Unmarshal(body, &sars) + return sars, err + case string(KindIdleSecondary): + var sirs SecondaryIdleReplicatorStatus + err := json.Unmarshal(body, &sirs) + return sirs, err + default: + var rs ReplicatorStatus + err := json.Unmarshal(body, &rs) + return rs, err + } +} +func unmarshalBasicReplicatorStatusArray(body []byte) ([]BasicReplicatorStatus, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rsArray := make([]BasicReplicatorStatus, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rs, err := unmarshalBasicReplicatorStatus(*rawMessage) + if err != nil { + return nil, err + } + rsArray[index] = rs + } + return rsArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ReplicatorStatus. +func (rs ReplicatorStatus) MarshalJSON() ([]byte, error) { + rs.Kind = KindReplicatorStatus + objectMap := make(map[string]interface{}) + if rs.Kind != "" { + objectMap["Kind"] = rs.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPrimaryReplicatorStatus is the BasicReplicatorStatus implementation for ReplicatorStatus. +func (rs ReplicatorStatus) AsPrimaryReplicatorStatus() (*PrimaryReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryReplicatorStatus is the BasicReplicatorStatus implementation for ReplicatorStatus. +func (rs ReplicatorStatus) AsSecondaryReplicatorStatus() (*SecondaryReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicSecondaryReplicatorStatus is the BasicReplicatorStatus implementation for ReplicatorStatus. +func (rs ReplicatorStatus) AsBasicSecondaryReplicatorStatus() (BasicSecondaryReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryActiveReplicatorStatus is the BasicReplicatorStatus implementation for ReplicatorStatus. +func (rs ReplicatorStatus) AsSecondaryActiveReplicatorStatus() (*SecondaryActiveReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryIdleReplicatorStatus is the BasicReplicatorStatus implementation for ReplicatorStatus. +func (rs ReplicatorStatus) AsSecondaryIdleReplicatorStatus() (*SecondaryIdleReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicatorStatus is the BasicReplicatorStatus implementation for ReplicatorStatus. +func (rs ReplicatorStatus) AsReplicatorStatus() (*ReplicatorStatus, bool) { + return &rs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicatorStatus is the BasicReplicatorStatus implementation for ReplicatorStatus. +func (rs ReplicatorStatus) AsBasicReplicatorStatus() (BasicReplicatorStatus, bool) { + return &rs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RepositoryCredential credential information to connect to container repository. +type RepositoryCredential struct { + // RepositoryUserName - The user name to connect to container repository. + RepositoryUserName *string `json:"RepositoryUserName,omitempty"` + // RepositoryPassword - The password for supplied username to connect to container repository. + RepositoryPassword *string `json:"RepositoryPassword,omitempty"` + // PasswordEncrypted - Indicates that supplied container repository password is encrypted. + PasswordEncrypted *bool `json:"PasswordEncrypted,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResolvedServiceEndpoint endpoint of a resolved service partition. +type ResolvedServiceEndpoint struct { + // Kind - Possible values include: 'KindInvalid', 'KindStateless', 'KindStatefulPrimary', 'KindStatefulSecondary' + Kind Kind `json:"Kind,omitempty"` + // Address - The address of the endpoint. If the endpoint has multiple listeners the address is a JSON object with one property per listener with the value as the address of that listener. + Address *string `json:"Address,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResolvedServicePartition information about a service partition and its associated endpoints. +type ResolvedServicePartition struct { + autorest.Response `json:"-"` + Name *string `json:"Name,omitempty"` + // PartitionInformation - A representation of the resolved partition. + PartitionInformation BasicPartitionInformation `json:"PartitionInformation,omitempty"` + Endpoints *[]ResolvedServiceEndpoint `json:"Endpoints,omitempty"` + // Version - The version of this resolved service partition result. This version should be passed in the next time the ResolveService call is made via the PreviousRspVersion query parameter. + Version *string `json:"Version,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for ResolvedServicePartition struct. +func (rsp *ResolvedServicePartition) 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 + } + rsp.Name = &name + } + case "PartitionInformation": + if v != nil { + partitionInformation, err := unmarshalBasicPartitionInformation(*v) + if err != nil { + return err + } + rsp.PartitionInformation = partitionInformation + } + case "Endpoints": + if v != nil { + var endpoints []ResolvedServiceEndpoint + err = json.Unmarshal(*v, &endpoints) + if err != nil { + return err + } + rsp.Endpoints = &endpoints + } + case "Version": + if v != nil { + var version string + err = json.Unmarshal(*v, &version) + if err != nil { + return err + } + rsp.Version = &version + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartDeployedCodePackageDescription defines description for restarting a deloyed code package on Service +// Fabric node. +type RestartDeployedCodePackageDescription struct { + // ServiceManifestName - The name of service manifest that specified this code package. + ServiceManifestName *string `json:"ServiceManifestName,omitempty"` + ServicePackageActivationID *string `json:"ServicePackageActivationId,omitempty"` + // CodePackageName - The name of the code package. + CodePackageName *string `json:"CodePackageName,omitempty"` + CodePackageInstanceID *string `json:"CodePackageInstanceId,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartNodeDescription describes the parameters to restart a Service Fabric node. +type RestartNodeDescription struct { + // NodeInstanceID - The instance id of the target node. If instance id is specified the node is restarted only if it matches with the current instance of the node. A default value of "0" would match any instance id. The instance id can be obtained using get node query. + NodeInstanceID *string `json:"NodeInstanceId,omitempty"` + // CreateFabricDump - Specify True to create a dump of the fabric node process. This is case sensitive. Possible values include: 'False', 'True' + CreateFabricDump CreateFabricDump `json:"CreateFabricDump,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RestartPartitionResult represents information about an operation in a terminal state (Completed or Faulted). +type RestartPartitionResult struct { + // ErrorCode - If OperationState is Completed, this is 0. If OperationState is Faulted, this is an error code indicating the reason. + ErrorCode *int32 `json:"ErrorCode,omitempty"` + SelectedPartition *SelectedPartition `json:"SelectedPartition,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ResumeApplicationUpgradeDescription describes the parameters for resuming an unmonitored manual Service Fabric +// application upgrade +type ResumeApplicationUpgradeDescription struct { + // UpgradeDomainName - The name of the upgrade domain in which to resume the upgrade. + UpgradeDomainName *string `json:"UpgradeDomainName,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// RollingUpgradeUpdateDescription describes the parameters for updating a rolling upgrade of application or +// cluster. +type RollingUpgradeUpdateDescription struct { + // RollingUpgradeMode - Possible values include: 'RollingUpgradeMode4Invalid', 'RollingUpgradeMode4UnmonitoredAuto', 'RollingUpgradeMode4UnmonitoredManual', 'RollingUpgradeMode4Monitored' + RollingUpgradeMode RollingUpgradeMode4 `json:"RollingUpgradeMode,omitempty"` + ForceRestart *bool `json:"ForceRestart,omitempty"` + ReplicaSetCheckTimeoutInMilliseconds *int64 `json:"ReplicaSetCheckTimeoutInMilliseconds,omitempty"` + // FailureAction - Possible values include: 'FailureAction1Invalid', 'FailureAction1Rollback', 'FailureAction1Manual' + FailureAction FailureAction1 `json:"FailureAction,omitempty"` + HealthCheckWaitDurationInMilliseconds *string `json:"HealthCheckWaitDurationInMilliseconds,omitempty"` + HealthCheckStableDurationInMilliseconds *string `json:"HealthCheckStableDurationInMilliseconds,omitempty"` + HealthCheckRetryTimeoutInMilliseconds *string `json:"HealthCheckRetryTimeoutInMilliseconds,omitempty"` + UpgradeTimeoutInMilliseconds *string `json:"UpgradeTimeoutInMilliseconds,omitempty"` + UpgradeDomainTimeoutInMilliseconds *string `json:"UpgradeDomainTimeoutInMilliseconds,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicSafetyCheck represents a safety check performed by service fabric before continuing with the operations. These +// checks ensure the avaiability of the service and the reliability of the state. +type BasicSafetyCheck interface { + AsPartitionSafetyCheck() (*PartitionSafetyCheck, bool) + AsBasicPartitionSafetyCheck() (BasicPartitionSafetyCheck, bool) + AsEnsureAvailabilitySafetyCheck() (*EnsureAvailabilitySafetyCheck, bool) + AsEnsurePartitionQurumSafetyCheck() (*EnsurePartitionQurumSafetyCheck, bool) + AsSeedNodeSafetyCheck() (*SeedNodeSafetyCheck, bool) + AsWaitForInbuildReplicaSafetyCheck() (*WaitForInbuildReplicaSafetyCheck, bool) + AsWaitForPrimaryPlacementSafetyCheck() (*WaitForPrimaryPlacementSafetyCheck, bool) + AsWaitForPrimarySwapSafetyCheck() (*WaitForPrimarySwapSafetyCheck, bool) + AsWaitForReconfigurationSafetyCheck() (*WaitForReconfigurationSafetyCheck, bool) + AsSafetyCheck() (*SafetyCheck, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// SafetyCheck represents a safety check performed by service fabric before continuing with the operations. These +// checks ensure the avaiability of the service and the reliability of the state. +type SafetyCheck struct { + // Kind - Possible values include: 'KindSafetyCheck', 'KindPartitionSafetyCheck', 'KindEnsureAvailability', 'KindEnsurePartitionQuorum', 'KindEnsureSeedNodeQuorum', 'KindWaitForInbuildReplica', 'KindWaitForPrimaryPlacement', 'KindWaitForPrimarySwap', 'KindWaitForReconfiguration' + Kind KindBasicSafetyCheck `json:"Kind,omitempty"` +} + +func unmarshalBasicSafetyCheck(body []byte) (BasicSafetyCheck, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["Kind"] { + case string(KindPartitionSafetyCheck): + var psc PartitionSafetyCheck + err := json.Unmarshal(body, &psc) + return psc, err + case string(KindEnsureAvailability): + var easc EnsureAvailabilitySafetyCheck + err := json.Unmarshal(body, &easc) + return easc, err + case string(KindEnsurePartitionQuorum): + var epqsc EnsurePartitionQurumSafetyCheck + err := json.Unmarshal(body, &epqsc) + return epqsc, err + case string(KindEnsureSeedNodeQuorum): + var snsc SeedNodeSafetyCheck + err := json.Unmarshal(body, &snsc) + return snsc, err + case string(KindWaitForInbuildReplica): + var wfirsc WaitForInbuildReplicaSafetyCheck + err := json.Unmarshal(body, &wfirsc) + return wfirsc, err + case string(KindWaitForPrimaryPlacement): + var wfppsc WaitForPrimaryPlacementSafetyCheck + err := json.Unmarshal(body, &wfppsc) + return wfppsc, err + case string(KindWaitForPrimarySwap): + var wfpssc WaitForPrimarySwapSafetyCheck + err := json.Unmarshal(body, &wfpssc) + return wfpssc, err + case string(KindWaitForReconfiguration): + var wfrsc WaitForReconfigurationSafetyCheck + err := json.Unmarshal(body, &wfrsc) + return wfrsc, err + default: + var sc SafetyCheck + err := json.Unmarshal(body, &sc) + return sc, err + } +} +func unmarshalBasicSafetyCheckArray(body []byte) ([]BasicSafetyCheck, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + scArray := make([]BasicSafetyCheck, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sc, err := unmarshalBasicSafetyCheck(*rawMessage) + if err != nil { + return nil, err + } + scArray[index] = sc + } + return scArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for SafetyCheck. +func (sc SafetyCheck) MarshalJSON() ([]byte, error) { + sc.Kind = KindSafetyCheck + objectMap := make(map[string]interface{}) + if sc.Kind != "" { + objectMap["Kind"] = sc.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionSafetyCheck is the BasicSafetyCheck implementation for SafetyCheck. +func (sc SafetyCheck) AsPartitionSafetyCheck() (*PartitionSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionSafetyCheck is the BasicSafetyCheck implementation for SafetyCheck. +func (sc SafetyCheck) AsBasicPartitionSafetyCheck() (BasicPartitionSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsureAvailabilitySafetyCheck is the BasicSafetyCheck implementation for SafetyCheck. +func (sc SafetyCheck) AsEnsureAvailabilitySafetyCheck() (*EnsureAvailabilitySafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsurePartitionQurumSafetyCheck is the BasicSafetyCheck implementation for SafetyCheck. +func (sc SafetyCheck) AsEnsurePartitionQurumSafetyCheck() (*EnsurePartitionQurumSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSeedNodeSafetyCheck is the BasicSafetyCheck implementation for SafetyCheck. +func (sc SafetyCheck) AsSeedNodeSafetyCheck() (*SeedNodeSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForInbuildReplicaSafetyCheck is the BasicSafetyCheck implementation for SafetyCheck. +func (sc SafetyCheck) AsWaitForInbuildReplicaSafetyCheck() (*WaitForInbuildReplicaSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimaryPlacementSafetyCheck is the BasicSafetyCheck implementation for SafetyCheck. +func (sc SafetyCheck) AsWaitForPrimaryPlacementSafetyCheck() (*WaitForPrimaryPlacementSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimarySwapSafetyCheck is the BasicSafetyCheck implementation for SafetyCheck. +func (sc SafetyCheck) AsWaitForPrimarySwapSafetyCheck() (*WaitForPrimarySwapSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForReconfigurationSafetyCheck is the BasicSafetyCheck implementation for SafetyCheck. +func (sc SafetyCheck) AsWaitForReconfigurationSafetyCheck() (*WaitForReconfigurationSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSafetyCheck is the BasicSafetyCheck implementation for SafetyCheck. +func (sc SafetyCheck) AsSafetyCheck() (*SafetyCheck, bool) { + return &sc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicSafetyCheck is the BasicSafetyCheck implementation for SafetyCheck. +func (sc SafetyCheck) AsBasicSafetyCheck() (BasicSafetyCheck, bool) { + return &sc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// SafetyCheckWrapper a wrapper for the safety check object. Safety checks are performed by service fabric before +// continuing with the operations. These checks ensure the avaiability of the service and the reliability of the +// state. +type SafetyCheckWrapper struct { + SafetyCheck BasicSafetyCheck `json:"SafetyCheck,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for SafetyCheckWrapper struct. +func (scw *SafetyCheckWrapper) 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 "SafetyCheck": + if v != nil { + safetyCheck, err := unmarshalBasicSafetyCheck(*v) + if err != nil { + return err + } + scw.SafetyCheck = safetyCheck + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// SecondaryActiveReplicatorStatus status of the secondary replicator when it is in active mode and is part of the +// replica set. +type SecondaryActiveReplicatorStatus struct { + // ReplicationQueueStatus - Details about the replication queue on the secondary replicator. + ReplicationQueueStatus *ReplicatorQueueStatus `json:"ReplicationQueueStatus,omitempty"` + // LastReplicationOperationReceivedTimeUtc - The last time-stamp (UTC) at which a replication operation was received from the primary. + // UTC 0 represents an invalid value, indicating that a replication operation message was never received. + LastReplicationOperationReceivedTimeUtc *date.Time `json:"LastReplicationOperationReceivedTimeUtc,omitempty"` + // IsInBuild - Value that indicates whether the replica is currently being built. + IsInBuild *bool `json:"IsInBuild,omitempty"` + // CopyQueueStatus - Details about the copy queue on the secondary replicator. + CopyQueueStatus *ReplicatorQueueStatus `json:"CopyQueueStatus,omitempty"` + // LastCopyOperationReceivedTimeUtc - The last time-stamp (UTC) at which a copy operation was received from the primary. + // UTC 0 represents an invalid value, indicating that a copy operation message was never received. + LastCopyOperationReceivedTimeUtc *date.Time `json:"LastCopyOperationReceivedTimeUtc,omitempty"` + // LastAcknowledgementSentTimeUtc - The last time-stamp (UTC) at which an acknowledgment was sent to the primary replicator. + // UTC 0 represents an invalid value, indicating that an acknowledgment message was never sent. + LastAcknowledgementSentTimeUtc *date.Time `json:"LastAcknowledgementSentTimeUtc,omitempty"` + // Kind - Possible values include: 'KindReplicatorStatus', 'KindPrimary', 'KindSecondaryReplicatorStatus', 'KindActiveSecondary', 'KindIdleSecondary' + Kind KindBasicReplicatorStatus `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for SecondaryActiveReplicatorStatus. +func (sars SecondaryActiveReplicatorStatus) MarshalJSON() ([]byte, error) { + sars.Kind = KindActiveSecondary + objectMap := make(map[string]interface{}) + if sars.ReplicationQueueStatus != nil { + objectMap["ReplicationQueueStatus"] = sars.ReplicationQueueStatus + } + if sars.LastReplicationOperationReceivedTimeUtc != nil { + objectMap["LastReplicationOperationReceivedTimeUtc"] = sars.LastReplicationOperationReceivedTimeUtc + } + if sars.IsInBuild != nil { + objectMap["IsInBuild"] = sars.IsInBuild + } + if sars.CopyQueueStatus != nil { + objectMap["CopyQueueStatus"] = sars.CopyQueueStatus + } + if sars.LastCopyOperationReceivedTimeUtc != nil { + objectMap["LastCopyOperationReceivedTimeUtc"] = sars.LastCopyOperationReceivedTimeUtc + } + if sars.LastAcknowledgementSentTimeUtc != nil { + objectMap["LastAcknowledgementSentTimeUtc"] = sars.LastAcknowledgementSentTimeUtc + } + if sars.Kind != "" { + objectMap["Kind"] = sars.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPrimaryReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryActiveReplicatorStatus. +func (sars SecondaryActiveReplicatorStatus) AsPrimaryReplicatorStatus() (*PrimaryReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryActiveReplicatorStatus. +func (sars SecondaryActiveReplicatorStatus) AsSecondaryReplicatorStatus() (*SecondaryReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicSecondaryReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryActiveReplicatorStatus. +func (sars SecondaryActiveReplicatorStatus) AsBasicSecondaryReplicatorStatus() (BasicSecondaryReplicatorStatus, bool) { + return &sars, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryActiveReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryActiveReplicatorStatus. +func (sars SecondaryActiveReplicatorStatus) AsSecondaryActiveReplicatorStatus() (*SecondaryActiveReplicatorStatus, bool) { + return &sars, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryIdleReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryActiveReplicatorStatus. +func (sars SecondaryActiveReplicatorStatus) AsSecondaryIdleReplicatorStatus() (*SecondaryIdleReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryActiveReplicatorStatus. +func (sars SecondaryActiveReplicatorStatus) AsReplicatorStatus() (*ReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryActiveReplicatorStatus. +func (sars SecondaryActiveReplicatorStatus) AsBasicReplicatorStatus() (BasicReplicatorStatus, bool) { + return &sars, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// SecondaryIdleReplicatorStatus status of the secondary replicator when it is in idle mode and is being built by +// the primary. +type SecondaryIdleReplicatorStatus struct { + // ReplicationQueueStatus - Details about the replication queue on the secondary replicator. + ReplicationQueueStatus *ReplicatorQueueStatus `json:"ReplicationQueueStatus,omitempty"` + // LastReplicationOperationReceivedTimeUtc - The last time-stamp (UTC) at which a replication operation was received from the primary. + // UTC 0 represents an invalid value, indicating that a replication operation message was never received. + LastReplicationOperationReceivedTimeUtc *date.Time `json:"LastReplicationOperationReceivedTimeUtc,omitempty"` + // IsInBuild - Value that indicates whether the replica is currently being built. + IsInBuild *bool `json:"IsInBuild,omitempty"` + // CopyQueueStatus - Details about the copy queue on the secondary replicator. + CopyQueueStatus *ReplicatorQueueStatus `json:"CopyQueueStatus,omitempty"` + // LastCopyOperationReceivedTimeUtc - The last time-stamp (UTC) at which a copy operation was received from the primary. + // UTC 0 represents an invalid value, indicating that a copy operation message was never received. + LastCopyOperationReceivedTimeUtc *date.Time `json:"LastCopyOperationReceivedTimeUtc,omitempty"` + // LastAcknowledgementSentTimeUtc - The last time-stamp (UTC) at which an acknowledgment was sent to the primary replicator. + // UTC 0 represents an invalid value, indicating that an acknowledgment message was never sent. + LastAcknowledgementSentTimeUtc *date.Time `json:"LastAcknowledgementSentTimeUtc,omitempty"` + // Kind - Possible values include: 'KindReplicatorStatus', 'KindPrimary', 'KindSecondaryReplicatorStatus', 'KindActiveSecondary', 'KindIdleSecondary' + Kind KindBasicReplicatorStatus `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for SecondaryIdleReplicatorStatus. +func (sirs SecondaryIdleReplicatorStatus) MarshalJSON() ([]byte, error) { + sirs.Kind = KindIdleSecondary + objectMap := make(map[string]interface{}) + if sirs.ReplicationQueueStatus != nil { + objectMap["ReplicationQueueStatus"] = sirs.ReplicationQueueStatus + } + if sirs.LastReplicationOperationReceivedTimeUtc != nil { + objectMap["LastReplicationOperationReceivedTimeUtc"] = sirs.LastReplicationOperationReceivedTimeUtc + } + if sirs.IsInBuild != nil { + objectMap["IsInBuild"] = sirs.IsInBuild + } + if sirs.CopyQueueStatus != nil { + objectMap["CopyQueueStatus"] = sirs.CopyQueueStatus + } + if sirs.LastCopyOperationReceivedTimeUtc != nil { + objectMap["LastCopyOperationReceivedTimeUtc"] = sirs.LastCopyOperationReceivedTimeUtc + } + if sirs.LastAcknowledgementSentTimeUtc != nil { + objectMap["LastAcknowledgementSentTimeUtc"] = sirs.LastAcknowledgementSentTimeUtc + } + if sirs.Kind != "" { + objectMap["Kind"] = sirs.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPrimaryReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryIdleReplicatorStatus. +func (sirs SecondaryIdleReplicatorStatus) AsPrimaryReplicatorStatus() (*PrimaryReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryIdleReplicatorStatus. +func (sirs SecondaryIdleReplicatorStatus) AsSecondaryReplicatorStatus() (*SecondaryReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicSecondaryReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryIdleReplicatorStatus. +func (sirs SecondaryIdleReplicatorStatus) AsBasicSecondaryReplicatorStatus() (BasicSecondaryReplicatorStatus, bool) { + return &sirs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryActiveReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryIdleReplicatorStatus. +func (sirs SecondaryIdleReplicatorStatus) AsSecondaryActiveReplicatorStatus() (*SecondaryActiveReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryIdleReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryIdleReplicatorStatus. +func (sirs SecondaryIdleReplicatorStatus) AsSecondaryIdleReplicatorStatus() (*SecondaryIdleReplicatorStatus, bool) { + return &sirs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryIdleReplicatorStatus. +func (sirs SecondaryIdleReplicatorStatus) AsReplicatorStatus() (*ReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryIdleReplicatorStatus. +func (sirs SecondaryIdleReplicatorStatus) AsBasicReplicatorStatus() (BasicReplicatorStatus, bool) { + return &sirs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicSecondaryReplicatorStatus ... +type BasicSecondaryReplicatorStatus interface { + AsSecondaryActiveReplicatorStatus() (*SecondaryActiveReplicatorStatus, bool) + AsSecondaryIdleReplicatorStatus() (*SecondaryIdleReplicatorStatus, bool) + AsSecondaryReplicatorStatus() (*SecondaryReplicatorStatus, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// SecondaryReplicatorStatus ... +type SecondaryReplicatorStatus struct { + // ReplicationQueueStatus - Details about the replication queue on the secondary replicator. + ReplicationQueueStatus *ReplicatorQueueStatus `json:"ReplicationQueueStatus,omitempty"` + // LastReplicationOperationReceivedTimeUtc - The last time-stamp (UTC) at which a replication operation was received from the primary. + // UTC 0 represents an invalid value, indicating that a replication operation message was never received. + LastReplicationOperationReceivedTimeUtc *date.Time `json:"LastReplicationOperationReceivedTimeUtc,omitempty"` + // IsInBuild - Value that indicates whether the replica is currently being built. + IsInBuild *bool `json:"IsInBuild,omitempty"` + // CopyQueueStatus - Details about the copy queue on the secondary replicator. + CopyQueueStatus *ReplicatorQueueStatus `json:"CopyQueueStatus,omitempty"` + // LastCopyOperationReceivedTimeUtc - The last time-stamp (UTC) at which a copy operation was received from the primary. + // UTC 0 represents an invalid value, indicating that a copy operation message was never received. + LastCopyOperationReceivedTimeUtc *date.Time `json:"LastCopyOperationReceivedTimeUtc,omitempty"` + // LastAcknowledgementSentTimeUtc - The last time-stamp (UTC) at which an acknowledgment was sent to the primary replicator. + // UTC 0 represents an invalid value, indicating that an acknowledgment message was never sent. + LastAcknowledgementSentTimeUtc *date.Time `json:"LastAcknowledgementSentTimeUtc,omitempty"` + // Kind - Possible values include: 'KindReplicatorStatus', 'KindPrimary', 'KindSecondaryReplicatorStatus', 'KindActiveSecondary', 'KindIdleSecondary' + Kind KindBasicReplicatorStatus `json:"Kind,omitempty"` +} + +func unmarshalBasicSecondaryReplicatorStatus(body []byte) (BasicSecondaryReplicatorStatus, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["Kind"] { + case string(KindActiveSecondary): + var sars SecondaryActiveReplicatorStatus + err := json.Unmarshal(body, &sars) + return sars, err + case string(KindIdleSecondary): + var sirs SecondaryIdleReplicatorStatus + err := json.Unmarshal(body, &sirs) + return sirs, err + default: + var srs SecondaryReplicatorStatus + err := json.Unmarshal(body, &srs) + return srs, err + } +} +func unmarshalBasicSecondaryReplicatorStatusArray(body []byte) ([]BasicSecondaryReplicatorStatus, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + srsArray := make([]BasicSecondaryReplicatorStatus, len(rawMessages)) + + for index, rawMessage := range rawMessages { + srs, err := unmarshalBasicSecondaryReplicatorStatus(*rawMessage) + if err != nil { + return nil, err + } + srsArray[index] = srs + } + return srsArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for SecondaryReplicatorStatus. +func (srs SecondaryReplicatorStatus) MarshalJSON() ([]byte, error) { + srs.Kind = KindSecondaryReplicatorStatus + objectMap := make(map[string]interface{}) + if srs.ReplicationQueueStatus != nil { + objectMap["ReplicationQueueStatus"] = srs.ReplicationQueueStatus + } + if srs.LastReplicationOperationReceivedTimeUtc != nil { + objectMap["LastReplicationOperationReceivedTimeUtc"] = srs.LastReplicationOperationReceivedTimeUtc + } + if srs.IsInBuild != nil { + objectMap["IsInBuild"] = srs.IsInBuild + } + if srs.CopyQueueStatus != nil { + objectMap["CopyQueueStatus"] = srs.CopyQueueStatus + } + if srs.LastCopyOperationReceivedTimeUtc != nil { + objectMap["LastCopyOperationReceivedTimeUtc"] = srs.LastCopyOperationReceivedTimeUtc + } + if srs.LastAcknowledgementSentTimeUtc != nil { + objectMap["LastAcknowledgementSentTimeUtc"] = srs.LastAcknowledgementSentTimeUtc + } + if srs.Kind != "" { + objectMap["Kind"] = srs.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPrimaryReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryReplicatorStatus. +func (srs SecondaryReplicatorStatus) AsPrimaryReplicatorStatus() (*PrimaryReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryReplicatorStatus. +func (srs SecondaryReplicatorStatus) AsSecondaryReplicatorStatus() (*SecondaryReplicatorStatus, bool) { + return &srs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicSecondaryReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryReplicatorStatus. +func (srs SecondaryReplicatorStatus) AsBasicSecondaryReplicatorStatus() (BasicSecondaryReplicatorStatus, bool) { + return &srs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryActiveReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryReplicatorStatus. +func (srs SecondaryReplicatorStatus) AsSecondaryActiveReplicatorStatus() (*SecondaryActiveReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSecondaryIdleReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryReplicatorStatus. +func (srs SecondaryReplicatorStatus) AsSecondaryIdleReplicatorStatus() (*SecondaryIdleReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryReplicatorStatus. +func (srs SecondaryReplicatorStatus) AsReplicatorStatus() (*ReplicatorStatus, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicatorStatus is the BasicReplicatorStatus implementation for SecondaryReplicatorStatus. +func (srs SecondaryReplicatorStatus) AsBasicReplicatorStatus() (BasicReplicatorStatus, bool) { + return &srs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// SeedNodeSafetyCheck represents a safety check for the seed nodes being performed by service fabric before +// continuing with node level operations. +type SeedNodeSafetyCheck struct { + // Kind - Possible values include: 'KindSafetyCheck', 'KindPartitionSafetyCheck', 'KindEnsureAvailability', 'KindEnsurePartitionQuorum', 'KindEnsureSeedNodeQuorum', 'KindWaitForInbuildReplica', 'KindWaitForPrimaryPlacement', 'KindWaitForPrimarySwap', 'KindWaitForReconfiguration' + Kind KindBasicSafetyCheck `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for SeedNodeSafetyCheck. +func (snsc SeedNodeSafetyCheck) MarshalJSON() ([]byte, error) { + snsc.Kind = KindEnsureSeedNodeQuorum + objectMap := make(map[string]interface{}) + if snsc.Kind != "" { + objectMap["Kind"] = snsc.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionSafetyCheck is the BasicSafetyCheck implementation for SeedNodeSafetyCheck. +func (snsc SeedNodeSafetyCheck) AsPartitionSafetyCheck() (*PartitionSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionSafetyCheck is the BasicSafetyCheck implementation for SeedNodeSafetyCheck. +func (snsc SeedNodeSafetyCheck) AsBasicPartitionSafetyCheck() (BasicPartitionSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsureAvailabilitySafetyCheck is the BasicSafetyCheck implementation for SeedNodeSafetyCheck. +func (snsc SeedNodeSafetyCheck) AsEnsureAvailabilitySafetyCheck() (*EnsureAvailabilitySafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsurePartitionQurumSafetyCheck is the BasicSafetyCheck implementation for SeedNodeSafetyCheck. +func (snsc SeedNodeSafetyCheck) AsEnsurePartitionQurumSafetyCheck() (*EnsurePartitionQurumSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSeedNodeSafetyCheck is the BasicSafetyCheck implementation for SeedNodeSafetyCheck. +func (snsc SeedNodeSafetyCheck) AsSeedNodeSafetyCheck() (*SeedNodeSafetyCheck, bool) { + return &snsc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForInbuildReplicaSafetyCheck is the BasicSafetyCheck implementation for SeedNodeSafetyCheck. +func (snsc SeedNodeSafetyCheck) AsWaitForInbuildReplicaSafetyCheck() (*WaitForInbuildReplicaSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimaryPlacementSafetyCheck is the BasicSafetyCheck implementation for SeedNodeSafetyCheck. +func (snsc SeedNodeSafetyCheck) AsWaitForPrimaryPlacementSafetyCheck() (*WaitForPrimaryPlacementSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimarySwapSafetyCheck is the BasicSafetyCheck implementation for SeedNodeSafetyCheck. +func (snsc SeedNodeSafetyCheck) AsWaitForPrimarySwapSafetyCheck() (*WaitForPrimarySwapSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForReconfigurationSafetyCheck is the BasicSafetyCheck implementation for SeedNodeSafetyCheck. +func (snsc SeedNodeSafetyCheck) AsWaitForReconfigurationSafetyCheck() (*WaitForReconfigurationSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSafetyCheck is the BasicSafetyCheck implementation for SeedNodeSafetyCheck. +func (snsc SeedNodeSafetyCheck) AsSafetyCheck() (*SafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicSafetyCheck is the BasicSafetyCheck implementation for SeedNodeSafetyCheck. +func (snsc SeedNodeSafetyCheck) AsBasicSafetyCheck() (BasicSafetyCheck, bool) { + return &snsc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// SelectedPartition this class returns information about the partition that the user-induced operation acted upon. +type SelectedPartition struct { + // ServiceName - The name of the service the partition belongs to. + ServiceName *string `json:"ServiceName,omitempty"` + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceCorrelationDescription creates a particular correlation between services. +type ServiceCorrelationDescription struct { + // Scheme - The ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. Possible values include: 'SchemeInvalid', 'SchemeAffinity', 'SchemeAlignedAffinity', 'SchemeNonAlignedAffinity' + Scheme Scheme `json:"Scheme,omitempty"` + // ServiceName - The name of the service that the correlation relationship is established with. + ServiceName *string `json:"ServiceName,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicServiceDescription a ServiceDescription contains all of the information necessary to create a service. +type BasicServiceDescription interface { + AsStatefulServiceDescription() (*StatefulServiceDescription, bool) + AsStatelessServiceDescription() (*StatelessServiceDescription, bool) + AsServiceDescription() (*ServiceDescription, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceDescription a ServiceDescription contains all of the information necessary to create a service. +type ServiceDescription struct { + autorest.Response `json:"-"` + // ApplicationName - The application name. + ApplicationName *string `json:"ApplicationName,omitempty"` + // ServiceName - The service name. + ServiceName *string `json:"ServiceName,omitempty"` + // ServiceTypeName - The service type name. + ServiceTypeName *string `json:"ServiceTypeName,omitempty"` + // InitializationData - The initialization data as an array of bytes. Initialization data is passed to service instances or replicas when they are created. + InitializationData *[]int32 `json:"InitializationData,omitempty"` + // PartitionDescription - The partition description as an object. + PartitionDescription BasicPartitionSchemeDescription `json:"PartitionDescription,omitempty"` + // PlacementConstraints - The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + PlacementConstraints *string `json:"PlacementConstraints,omitempty"` + // CorrelationScheme - The correlation scheme. + CorrelationScheme *[]ServiceCorrelationDescription `json:"CorrelationScheme,omitempty"` + // ServiceLoadMetrics - The service load metrics. + ServiceLoadMetrics *[]ServiceLoadMetricDescription `json:"ServiceLoadMetrics,omitempty"` + // ServicePlacementPolicies - The service placement policies. + ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"ServicePlacementPolicies,omitempty"` + // DefaultMoveCost - The move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + DefaultMoveCost DefaultMoveCost `json:"DefaultMoveCost,omitempty"` + // IsDefaultMoveCostSpecified - Indicates if the DefaultMoveCost property is specified. + IsDefaultMoveCostSpecified *bool `json:"IsDefaultMoveCostSpecified,omitempty"` + // ServicePackageActivationMode - The activation mode of service package to be used for a service. Possible values include: 'ServicePackageActivationMode1SharedProcess', 'ServicePackageActivationMode1ExclusiveProcess' + ServicePackageActivationMode ServicePackageActivationMode1 `json:"ServicePackageActivationMode,omitempty"` + // ServiceDNSName - The DNS name of the service. It requires the DNS system service to be enabled in Service Fabric cluster. + ServiceDNSName *string `json:"ServiceDnsName,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicServiceDescriptionServiceKindServiceDescription', 'ServiceKindBasicServiceDescriptionServiceKindStateful', 'ServiceKindBasicServiceDescriptionServiceKindStateless' + ServiceKind ServiceKindBasicServiceDescription `json:"ServiceKind,omitempty"` +} + +func unmarshalBasicServiceDescription(body []byte) (BasicServiceDescription, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["ServiceKind"] { + case string(ServiceKindBasicServiceDescriptionServiceKindStateful): + var ssd StatefulServiceDescription + err := json.Unmarshal(body, &ssd) + return ssd, err + case string(ServiceKindBasicServiceDescriptionServiceKindStateless): + var ssd StatelessServiceDescription + err := json.Unmarshal(body, &ssd) + return ssd, err + default: + var sd ServiceDescription + err := json.Unmarshal(body, &sd) + return sd, err + } +} +func unmarshalBasicServiceDescriptionArray(body []byte) ([]BasicServiceDescription, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sdArray := make([]BasicServiceDescription, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sd, err := unmarshalBasicServiceDescription(*rawMessage) + if err != nil { + return nil, err + } + sdArray[index] = sd + } + return sdArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ServiceDescription. +func (sd ServiceDescription) MarshalJSON() ([]byte, error) { + sd.ServiceKind = ServiceKindBasicServiceDescriptionServiceKindServiceDescription + objectMap := make(map[string]interface{}) + if sd.ApplicationName != nil { + objectMap["ApplicationName"] = sd.ApplicationName + } + if sd.ServiceName != nil { + objectMap["ServiceName"] = sd.ServiceName + } + if sd.ServiceTypeName != nil { + objectMap["ServiceTypeName"] = sd.ServiceTypeName + } + if sd.InitializationData != nil { + objectMap["InitializationData"] = sd.InitializationData + } + objectMap["PartitionDescription"] = sd.PartitionDescription + if sd.PlacementConstraints != nil { + objectMap["PlacementConstraints"] = sd.PlacementConstraints + } + if sd.CorrelationScheme != nil { + objectMap["CorrelationScheme"] = sd.CorrelationScheme + } + if sd.ServiceLoadMetrics != nil { + objectMap["ServiceLoadMetrics"] = sd.ServiceLoadMetrics + } + if sd.ServicePlacementPolicies != nil { + objectMap["ServicePlacementPolicies"] = sd.ServicePlacementPolicies + } + if sd.DefaultMoveCost != "" { + objectMap["DefaultMoveCost"] = sd.DefaultMoveCost + } + if sd.IsDefaultMoveCostSpecified != nil { + objectMap["IsDefaultMoveCostSpecified"] = sd.IsDefaultMoveCostSpecified + } + if sd.ServicePackageActivationMode != "" { + objectMap["ServicePackageActivationMode"] = sd.ServicePackageActivationMode + } + if sd.ServiceDNSName != nil { + objectMap["ServiceDnsName"] = sd.ServiceDNSName + } + if sd.ServiceKind != "" { + objectMap["ServiceKind"] = sd.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceDescription is the BasicServiceDescription implementation for ServiceDescription. +func (sd ServiceDescription) AsStatefulServiceDescription() (*StatefulServiceDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceDescription is the BasicServiceDescription implementation for ServiceDescription. +func (sd ServiceDescription) AsStatelessServiceDescription() (*StatelessServiceDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceDescription is the BasicServiceDescription implementation for ServiceDescription. +func (sd ServiceDescription) AsServiceDescription() (*ServiceDescription, bool) { + return &sd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServiceDescription is the BasicServiceDescription implementation for ServiceDescription. +func (sd ServiceDescription) AsBasicServiceDescription() (BasicServiceDescription, bool) { + return &sd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for ServiceDescription struct. +func (sd *ServiceDescription) 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 "ApplicationName": + if v != nil { + var applicationName string + err = json.Unmarshal(*v, &applicationName) + if err != nil { + return err + } + sd.ApplicationName = &applicationName + } + case "ServiceName": + if v != nil { + var serviceName string + err = json.Unmarshal(*v, &serviceName) + if err != nil { + return err + } + sd.ServiceName = &serviceName + } + case "ServiceTypeName": + if v != nil { + var serviceTypeName string + err = json.Unmarshal(*v, &serviceTypeName) + if err != nil { + return err + } + sd.ServiceTypeName = &serviceTypeName + } + case "InitializationData": + if v != nil { + var initializationData []int32 + err = json.Unmarshal(*v, &initializationData) + if err != nil { + return err + } + sd.InitializationData = &initializationData + } + case "PartitionDescription": + if v != nil { + partitionDescription, err := unmarshalBasicPartitionSchemeDescription(*v) + if err != nil { + return err + } + sd.PartitionDescription = partitionDescription + } + case "PlacementConstraints": + if v != nil { + var placementConstraints string + err = json.Unmarshal(*v, &placementConstraints) + if err != nil { + return err + } + sd.PlacementConstraints = &placementConstraints + } + case "CorrelationScheme": + if v != nil { + var correlationScheme []ServiceCorrelationDescription + err = json.Unmarshal(*v, &correlationScheme) + if err != nil { + return err + } + sd.CorrelationScheme = &correlationScheme + } + case "ServiceLoadMetrics": + if v != nil { + var serviceLoadMetrics []ServiceLoadMetricDescription + err = json.Unmarshal(*v, &serviceLoadMetrics) + if err != nil { + return err + } + sd.ServiceLoadMetrics = &serviceLoadMetrics + } + case "ServicePlacementPolicies": + if v != nil { + servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) + if err != nil { + return err + } + sd.ServicePlacementPolicies = &servicePlacementPolicies + } + case "DefaultMoveCost": + if v != nil { + var defaultMoveCost DefaultMoveCost + err = json.Unmarshal(*v, &defaultMoveCost) + if err != nil { + return err + } + sd.DefaultMoveCost = defaultMoveCost + } + case "IsDefaultMoveCostSpecified": + if v != nil { + var isDefaultMoveCostSpecified bool + err = json.Unmarshal(*v, &isDefaultMoveCostSpecified) + if err != nil { + return err + } + sd.IsDefaultMoveCostSpecified = &isDefaultMoveCostSpecified + } + case "ServicePackageActivationMode": + if v != nil { + var servicePackageActivationMode ServicePackageActivationMode1 + err = json.Unmarshal(*v, &servicePackageActivationMode) + if err != nil { + return err + } + sd.ServicePackageActivationMode = servicePackageActivationMode + } + case "ServiceDnsName": + if v != nil { + var serviceDNSName string + err = json.Unmarshal(*v, &serviceDNSName) + if err != nil { + return err + } + sd.ServiceDNSName = &serviceDNSName + } + case "ServiceKind": + if v != nil { + var serviceKind ServiceKindBasicServiceDescription + err = json.Unmarshal(*v, &serviceKind) + if err != nil { + return err + } + sd.ServiceKind = serviceKind + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceDescriptionModel ... +type ServiceDescriptionModel struct { + autorest.Response `json:"-"` + Value BasicServiceDescription `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for ServiceDescriptionModel struct. +func (sdm *ServiceDescriptionModel) UnmarshalJSON(body []byte) error { + sd, err := unmarshalBasicServiceDescription(body) + if err != nil { + return err + } + sdm.Value = sd + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceFromTemplateDescription defines description for creating a Service Fabric service from a template defined +// in the application manifest. +type ServiceFromTemplateDescription struct { + // ApplicationName - Full name of the application. + ApplicationName *string `json:"ApplicationName,omitempty"` + // ServiceName - Full name of the service. + ServiceName *string `json:"ServiceName,omitempty"` + // ServiceTypeName - The name of the Service Fabric service type. + ServiceTypeName *string `json:"ServiceTypeName,omitempty"` + // InitializationData - The initialization data for the newly created service instance. + InitializationData *[]int32 `json:"InitializationData,omitempty"` + // ServicePackageActivationMode - The activation mode of service package to be used for a service. Possible values include: 'SharedProcess', 'ExclusiveProcess' + ServicePackageActivationMode ServicePackageActivationMode `json:"ServicePackageActivationMode,omitempty"` + // ServiceDNSName - The DNS name of the service. It requires the DNS system service to be enabled in Service Fabric cluster. + ServiceDNSName *string `json:"ServiceDnsName,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceHealth information about the health of a Service Fabric service. +type ServiceHealth struct { + autorest.Response `json:"-"` + // Name - The name of the service whose health information is described by this object. + Name *string `json:"Name,omitempty"` + // PartitionHealthStates - The list of partition health states associated with the service. + PartitionHealthStates *[]PartitionHealthState `json:"PartitionHealthStates,omitempty"` + // AggregatedHealthState - The HealthState representing the aggregated health state of the entity computed by Health Manager. + // The health evaluation of the entity reflects all events reported on the entity and its children (if any). + // The aggregation is done by applying the desired health policy. + // . Possible values include: 'AggregatedHealthState1Invalid', 'AggregatedHealthState1Ok', 'AggregatedHealthState1Warning', 'AggregatedHealthState1Error', 'AggregatedHealthState1Unknown' + AggregatedHealthState AggregatedHealthState1 `json:"AggregatedHealthState,omitempty"` + // HealthEvents - The list of health events reported on the entity. + HealthEvents *[]HealthEvent `json:"HealthEvents,omitempty"` + // UnhealthyEvaluations - The unhealthy evaluations that show why the current aggregated health state was returned by Health Manager. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceHealthEvaluation represents health evaluation for a service, containing information about the data and +// the algorithm used by health store to evaluate health. The evaluation is returned only when the aggregated +// health state is either Error or Warning. +type ServiceHealthEvaluation struct { + // ServiceName - Full name of the service. + ServiceName *string `json:"ServiceName,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the current aggregated health state of the service. The types of the unhealthy evaluations can be PartitionsHealthEvaluation or EventHealthEvaluation. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) MarshalJSON() ([]byte, error) { + she.Kind = KindService + objectMap := make(map[string]interface{}) + if she.ServiceName != nil { + objectMap["ServiceName"] = she.ServiceName + } + if she.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = she.UnhealthyEvaluations + } + if she.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = she.AggregatedHealthState + } + if she.Description != nil { + objectMap["Description"] = she.Description + } + if she.Kind != "" { + objectMap["Kind"] = she.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return &she, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for ServiceHealthEvaluation. +func (she ServiceHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &she, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceHealthState represents the health state of a service, which contains the service identifier and its +// aggregated health state. +type ServiceHealthState struct { + // ServiceName - Full name of the service. + ServiceName *string `json:"ServiceName,omitempty"` + // AggregatedHealthState - Possible values include: 'AggregatedHealthState2Invalid', 'AggregatedHealthState2Ok', 'AggregatedHealthState2Warning', 'AggregatedHealthState2Error', 'AggregatedHealthState2Unknown' + AggregatedHealthState AggregatedHealthState2 `json:"AggregatedHealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceHealthStateChunk represents the health state chunk of a service, which contains the service name, its +// aggregated health state and any partitions that respect the filters in the cluster health chunk query +// description. +type ServiceHealthStateChunk struct { + // ServiceName - The name of the service. + ServiceName *string `json:"ServiceName,omitempty"` + // PartitionHealthStateChunks - The list of partition health state chunks belonging to the service that respect the filters in the cluster health chunk query description. + PartitionHealthStateChunks *PartitionHealthStateChunkList `json:"PartitionHealthStateChunks,omitempty"` + // HealthState - Possible values include: 'HealthState2Invalid', 'HealthState2Ok', 'HealthState2Warning', 'HealthState2Error', 'HealthState2Unknown' + HealthState HealthState2 `json:"HealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceHealthStateChunkList the list of service health state chunks that respect the input filters in the chunk +// query. Returned by get cluster health state chunks query. +type ServiceHealthStateChunkList struct { + // Items - The list of service health state chunks that respect the input filters in the chunk query. + Items *[]ServiceHealthStateChunk `json:"Items,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceHealthStateFilter defines matching criteria to determine whether a service should be included as a child +// of an application in the cluster health chunk. +// The services are only returned if the parent application matches a filter specified in the cluster health chunk +// query description. +// One filter can match zero, one or multiple services, depending on its properties. +type ServiceHealthStateFilter struct { + // ServiceNameFilter - The name of the service that matches the filter. The filter is applied only to the specified service, if it exists. + // If the service doesn't exist, no service is returned in the cluster health chunk based on this filter. + // If the service exists, it is included as the application's child if the health state matches the other filter properties. + // If not specified, all services that match the parent filters (if any) are taken into consideration and matched against the other filter members, like health state filter. + ServiceNameFilter *string `json:"ServiceNameFilter,omitempty"` + // HealthStateFilter - The filter for the health state of the services. It allows selecting services if they match the desired health states. + // The possible values are integer value of one of the following health states. Only services that match the filter are returned. All services are used to evaluate the cluster aggregated health state. + // If not specified, default value is None, unless the service name is specified. If the filter has default value and service name is specified, the matching service is returned. + // The state values are flag based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. + // For example, if the provided value is 6, it matches services with HealthState value of OK (2) and Warning (4). + // - Default - Default value. Matches any HealthState. The value is zero. + // - None - Filter that doesn’t match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. + // - Ok - Filter that matches input with HealthState value Ok. The value is 2. + // - Warning - Filter that matches input with HealthState value Warning. The value is 4. + // - Error - Filter that matches input with HealthState value Error. The value is 8. + // - All - Filter that matches input with any HealthState value. The value is 65535. + HealthStateFilter *int32 `json:"HealthStateFilter,omitempty"` + // PartitionFilters - Defines a list of filters that specify which partitions to be included in the returned cluster health chunk as children of the service. The partitions are returned only if the parent service matches a filter. + // If the list is empty, no partitions are returned. All the partitions are used to evaluate the parent service aggregated health state, regardless of the input filters. + // The service filter may specify multiple partition filters. + // For example, it can specify a filter to return all partitions with health state Error and another filter to always include a partition identified by its partition id. + PartitionFilters *[]PartitionHealthStateFilter `json:"PartitionFilters,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicServiceInfo information about a Service Fabric service. +type BasicServiceInfo interface { + AsStatefulServiceInfo() (*StatefulServiceInfo, bool) + AsStatelessServiceInfo() (*StatelessServiceInfo, bool) + AsServiceInfo() (*ServiceInfo, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceInfo information about a Service Fabric service. +type ServiceInfo struct { + autorest.Response `json:"-"` + ID *string `json:"Id,omitempty"` + // Name - Full hierarchical name of the service in URI format starting with `fabric:`. + Name *string `json:"Name,omitempty"` + // TypeName - The name of the service type as specified in the service manifest. + TypeName *string `json:"TypeName,omitempty"` + // ManifestVersion - The version of the service manifest. + ManifestVersion *string `json:"ManifestVersion,omitempty"` + // HealthState - Possible values include: 'HealthState7Invalid', 'HealthState7Ok', 'HealthState7Warning', 'HealthState7Error', 'HealthState7Unknown' + HealthState HealthState7 `json:"HealthState,omitempty"` + // ServiceStatus - Possible values include: 'ServiceStatusUnknown', 'ServiceStatusActive', 'ServiceStatusUpgrading', 'ServiceStatusDeleting', 'ServiceStatusCreating', 'ServiceStatusFailed' + ServiceStatus ServiceStatus `json:"ServiceStatus,omitempty"` + // IsServiceGroup - Whether the service is in a service group. + IsServiceGroup *bool `json:"IsServiceGroup,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicServiceInfoServiceKindServiceInfo', 'ServiceKindBasicServiceInfoServiceKindStateful', 'ServiceKindBasicServiceInfoServiceKindStateless' + ServiceKind ServiceKindBasicServiceInfo `json:"ServiceKind,omitempty"` +} + +func unmarshalBasicServiceInfo(body []byte) (BasicServiceInfo, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["ServiceKind"] { + case string(ServiceKindBasicServiceInfoServiceKindStateful): + var ssi StatefulServiceInfo + err := json.Unmarshal(body, &ssi) + return ssi, err + case string(ServiceKindBasicServiceInfoServiceKindStateless): + var ssi StatelessServiceInfo + err := json.Unmarshal(body, &ssi) + return ssi, err + default: + var si ServiceInfo + err := json.Unmarshal(body, &si) + return si, err + } +} +func unmarshalBasicServiceInfoArray(body []byte) ([]BasicServiceInfo, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + siArray := make([]BasicServiceInfo, len(rawMessages)) + + for index, rawMessage := range rawMessages { + si, err := unmarshalBasicServiceInfo(*rawMessage) + if err != nil { + return nil, err + } + siArray[index] = si + } + return siArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ServiceInfo. +func (si ServiceInfo) MarshalJSON() ([]byte, error) { + si.ServiceKind = ServiceKindBasicServiceInfoServiceKindServiceInfo + objectMap := make(map[string]interface{}) + if si.ID != nil { + objectMap["Id"] = si.ID + } + if si.Name != nil { + objectMap["Name"] = si.Name + } + if si.TypeName != nil { + objectMap["TypeName"] = si.TypeName + } + if si.ManifestVersion != nil { + objectMap["ManifestVersion"] = si.ManifestVersion + } + if si.HealthState != "" { + objectMap["HealthState"] = si.HealthState + } + if si.ServiceStatus != "" { + objectMap["ServiceStatus"] = si.ServiceStatus + } + if si.IsServiceGroup != nil { + objectMap["IsServiceGroup"] = si.IsServiceGroup + } + if si.ServiceKind != "" { + objectMap["ServiceKind"] = si.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceInfo is the BasicServiceInfo implementation for ServiceInfo. +func (si ServiceInfo) AsStatefulServiceInfo() (*StatefulServiceInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceInfo is the BasicServiceInfo implementation for ServiceInfo. +func (si ServiceInfo) AsStatelessServiceInfo() (*StatelessServiceInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceInfo is the BasicServiceInfo implementation for ServiceInfo. +func (si ServiceInfo) AsServiceInfo() (*ServiceInfo, bool) { + return &si, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServiceInfo is the BasicServiceInfo implementation for ServiceInfo. +func (si ServiceInfo) AsBasicServiceInfo() (BasicServiceInfo, bool) { + return &si, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceInfoModel ... +type ServiceInfoModel struct { + autorest.Response `json:"-"` + Value BasicServiceInfo `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for ServiceInfoModel struct. +func (sim *ServiceInfoModel) UnmarshalJSON(body []byte) error { + si, err := unmarshalBasicServiceInfo(body) + if err != nil { + return err + } + sim.Value = si + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceLoadMetricDescription specifies a metric to load balance a service during runtime. +type ServiceLoadMetricDescription struct { + // Name - The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive. + Name *string `json:"Name,omitempty"` + // Weight - The service load metric relative weight, compared to other metrics configured for this service, as a number. Possible values include: 'WeightZero', 'WeightLow', 'WeightMedium', 'WeightHigh' + Weight Weight `json:"Weight,omitempty"` + // PrimaryDefaultLoad - Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica. + PrimaryDefaultLoad *int32 `json:"PrimaryDefaultLoad,omitempty"` + // SecondaryDefaultLoad - Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica. + SecondaryDefaultLoad *int32 `json:"SecondaryDefaultLoad,omitempty"` + // DefaultLoad - Used only for Stateless services. The default amount of load, as a number, that this service creates for this metric. + DefaultLoad *int32 `json:"DefaultLoad,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceNameInfo information about the service name. +type ServiceNameInfo struct { + autorest.Response `json:"-"` + ID *string `json:"Id,omitempty"` + // Name - The name of the service. + Name *string `json:"Name,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicServicePartitionInfo information about a partition of a Service Fabric service. +type BasicServicePartitionInfo interface { + AsStatefulServicePartitionInfo() (*StatefulServicePartitionInfo, bool) + AsStatelessServicePartitionInfo() (*StatelessServicePartitionInfo, bool) + AsServicePartitionInfo() (*ServicePartitionInfo, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServicePartitionInfo information about a partition of a Service Fabric service. +type ServicePartitionInfo struct { + autorest.Response `json:"-"` + // HealthState - Possible values include: 'HealthState5Invalid', 'HealthState5Ok', 'HealthState5Warning', 'HealthState5Error', 'HealthState5Unknown' + HealthState HealthState5 `json:"HealthState,omitempty"` + // PartitionStatus - Possible values include: 'PartitionStatusInvalid', 'PartitionStatusReady', 'PartitionStatusNotReady', 'PartitionStatusInQuorumLoss', 'PartitionStatusReconfiguring', 'PartitionStatusDeleting' + PartitionStatus PartitionStatus `json:"PartitionStatus,omitempty"` + PartitionInformation BasicPartitionInformation `json:"PartitionInformation,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicServicePartitionInfoServiceKindServicePartitionInfo', 'ServiceKindBasicServicePartitionInfoServiceKindStateful', 'ServiceKindBasicServicePartitionInfoServiceKindStateless' + ServiceKind ServiceKindBasicServicePartitionInfo `json:"ServiceKind,omitempty"` +} + +func unmarshalBasicServicePartitionInfo(body []byte) (BasicServicePartitionInfo, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["ServiceKind"] { + case string(ServiceKindBasicServicePartitionInfoServiceKindStateful): + var sspi StatefulServicePartitionInfo + err := json.Unmarshal(body, &sspi) + return sspi, err + case string(ServiceKindBasicServicePartitionInfoServiceKindStateless): + var sspi StatelessServicePartitionInfo + err := json.Unmarshal(body, &sspi) + return sspi, err + default: + var spi ServicePartitionInfo + err := json.Unmarshal(body, &spi) + return spi, err + } +} +func unmarshalBasicServicePartitionInfoArray(body []byte) ([]BasicServicePartitionInfo, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + spiArray := make([]BasicServicePartitionInfo, len(rawMessages)) + + for index, rawMessage := range rawMessages { + spi, err := unmarshalBasicServicePartitionInfo(*rawMessage) + if err != nil { + return nil, err + } + spiArray[index] = spi + } + return spiArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ServicePartitionInfo. +func (spi ServicePartitionInfo) MarshalJSON() ([]byte, error) { + spi.ServiceKind = ServiceKindBasicServicePartitionInfoServiceKindServicePartitionInfo + objectMap := make(map[string]interface{}) + if spi.HealthState != "" { + objectMap["HealthState"] = spi.HealthState + } + if spi.PartitionStatus != "" { + objectMap["PartitionStatus"] = spi.PartitionStatus + } + objectMap["PartitionInformation"] = spi.PartitionInformation + if spi.ServiceKind != "" { + objectMap["ServiceKind"] = spi.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServicePartitionInfo is the BasicServicePartitionInfo implementation for ServicePartitionInfo. +func (spi ServicePartitionInfo) AsStatefulServicePartitionInfo() (*StatefulServicePartitionInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServicePartitionInfo is the BasicServicePartitionInfo implementation for ServicePartitionInfo. +func (spi ServicePartitionInfo) AsStatelessServicePartitionInfo() (*StatelessServicePartitionInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePartitionInfo is the BasicServicePartitionInfo implementation for ServicePartitionInfo. +func (spi ServicePartitionInfo) AsServicePartitionInfo() (*ServicePartitionInfo, bool) { + return &spi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServicePartitionInfo is the BasicServicePartitionInfo implementation for ServicePartitionInfo. +func (spi ServicePartitionInfo) AsBasicServicePartitionInfo() (BasicServicePartitionInfo, bool) { + return &spi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for ServicePartitionInfo struct. +func (spi *ServicePartitionInfo) 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 "HealthState": + if v != nil { + var healthState HealthState5 + err = json.Unmarshal(*v, &healthState) + if err != nil { + return err + } + spi.HealthState = healthState + } + case "PartitionStatus": + if v != nil { + var partitionStatus PartitionStatus + err = json.Unmarshal(*v, &partitionStatus) + if err != nil { + return err + } + spi.PartitionStatus = partitionStatus + } + case "PartitionInformation": + if v != nil { + partitionInformation, err := unmarshalBasicPartitionInformation(*v) + if err != nil { + return err + } + spi.PartitionInformation = partitionInformation + } + case "ServiceKind": + if v != nil { + var serviceKind ServiceKindBasicServicePartitionInfo + err = json.Unmarshal(*v, &serviceKind) + if err != nil { + return err + } + spi.ServiceKind = serviceKind + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServicePartitionInfoModel ... +type ServicePartitionInfoModel struct { + autorest.Response `json:"-"` + Value BasicServicePartitionInfo `json:"value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for ServicePartitionInfoModel struct. +func (spim *ServicePartitionInfoModel) UnmarshalJSON(body []byte) error { + spi, err := unmarshalBasicServicePartitionInfo(body) + if err != nil { + return err + } + spim.Value = spi + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServicePlacementInvalidDomainPolicyDescription describes the policy to be used for placement of a Service Fabric +// service where a particular fault or upgrade domain should not be used for placement of the instances or replicas +// of that service. +type ServicePlacementInvalidDomainPolicyDescription struct { + // DomainName - The name of the domain that should not be used for placement. + DomainName *string `json:"DomainName,omitempty"` + // Type - Possible values include: 'TypeServicePlacementPolicyDescription', 'TypeInvalidDomain', 'TypeNonPartiallyPlaceService', 'TypePreferPrimaryDomain', 'TypeRequireDomain', 'TypeRequireDomainDistribution' + Type TypeBasicServicePlacementPolicyDescription `json:"Type,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ServicePlacementInvalidDomainPolicyDescription. +func (spidpd ServicePlacementInvalidDomainPolicyDescription) MarshalJSON() ([]byte, error) { + spidpd.Type = TypeInvalidDomain + objectMap := make(map[string]interface{}) + if spidpd.DomainName != nil { + objectMap["DomainName"] = spidpd.DomainName + } + if spidpd.Type != "" { + objectMap["Type"] = spidpd.Type + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementInvalidDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementInvalidDomainPolicyDescription. +func (spidpd ServicePlacementInvalidDomainPolicyDescription) AsServicePlacementInvalidDomainPolicyDescription() (*ServicePlacementInvalidDomainPolicyDescription, bool) { + return &spidpd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementNonPartiallyPlaceServicePolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementInvalidDomainPolicyDescription. +func (spidpd ServicePlacementInvalidDomainPolicyDescription) AsServicePlacementNonPartiallyPlaceServicePolicyDescription() (*ServicePlacementNonPartiallyPlaceServicePolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementPreferPrimaryDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementInvalidDomainPolicyDescription. +func (spidpd ServicePlacementInvalidDomainPolicyDescription) AsServicePlacementPreferPrimaryDomainPolicyDescription() (*ServicePlacementPreferPrimaryDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementRequiredDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementInvalidDomainPolicyDescription. +func (spidpd ServicePlacementInvalidDomainPolicyDescription) AsServicePlacementRequiredDomainPolicyDescription() (*ServicePlacementRequiredDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementRequireDomainDistributionPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementInvalidDomainPolicyDescription. +func (spidpd ServicePlacementInvalidDomainPolicyDescription) AsServicePlacementRequireDomainDistributionPolicyDescription() (*ServicePlacementRequireDomainDistributionPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementInvalidDomainPolicyDescription. +func (spidpd ServicePlacementInvalidDomainPolicyDescription) AsServicePlacementPolicyDescription() (*ServicePlacementPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServicePlacementPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementInvalidDomainPolicyDescription. +func (spidpd ServicePlacementInvalidDomainPolicyDescription) AsBasicServicePlacementPolicyDescription() (BasicServicePlacementPolicyDescription, bool) { + return &spidpd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServicePlacementNonPartiallyPlaceServicePolicyDescription describes the policy to be used for placement of a +// Service Fabric service where all replicas must be able to be placed in order for any replicas to be created. +type ServicePlacementNonPartiallyPlaceServicePolicyDescription struct { + // Type - Possible values include: 'TypeServicePlacementPolicyDescription', 'TypeInvalidDomain', 'TypeNonPartiallyPlaceService', 'TypePreferPrimaryDomain', 'TypeRequireDomain', 'TypeRequireDomainDistribution' + Type TypeBasicServicePlacementPolicyDescription `json:"Type,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ServicePlacementNonPartiallyPlaceServicePolicyDescription. +func (spnppspd ServicePlacementNonPartiallyPlaceServicePolicyDescription) MarshalJSON() ([]byte, error) { + spnppspd.Type = TypeNonPartiallyPlaceService + objectMap := make(map[string]interface{}) + if spnppspd.Type != "" { + objectMap["Type"] = spnppspd.Type + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementInvalidDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementNonPartiallyPlaceServicePolicyDescription. +func (spnppspd ServicePlacementNonPartiallyPlaceServicePolicyDescription) AsServicePlacementInvalidDomainPolicyDescription() (*ServicePlacementInvalidDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementNonPartiallyPlaceServicePolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementNonPartiallyPlaceServicePolicyDescription. +func (spnppspd ServicePlacementNonPartiallyPlaceServicePolicyDescription) AsServicePlacementNonPartiallyPlaceServicePolicyDescription() (*ServicePlacementNonPartiallyPlaceServicePolicyDescription, bool) { + return &spnppspd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementPreferPrimaryDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementNonPartiallyPlaceServicePolicyDescription. +func (spnppspd ServicePlacementNonPartiallyPlaceServicePolicyDescription) AsServicePlacementPreferPrimaryDomainPolicyDescription() (*ServicePlacementPreferPrimaryDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementRequiredDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementNonPartiallyPlaceServicePolicyDescription. +func (spnppspd ServicePlacementNonPartiallyPlaceServicePolicyDescription) AsServicePlacementRequiredDomainPolicyDescription() (*ServicePlacementRequiredDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementRequireDomainDistributionPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementNonPartiallyPlaceServicePolicyDescription. +func (spnppspd ServicePlacementNonPartiallyPlaceServicePolicyDescription) AsServicePlacementRequireDomainDistributionPolicyDescription() (*ServicePlacementRequireDomainDistributionPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementNonPartiallyPlaceServicePolicyDescription. +func (spnppspd ServicePlacementNonPartiallyPlaceServicePolicyDescription) AsServicePlacementPolicyDescription() (*ServicePlacementPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServicePlacementPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementNonPartiallyPlaceServicePolicyDescription. +func (spnppspd ServicePlacementNonPartiallyPlaceServicePolicyDescription) AsBasicServicePlacementPolicyDescription() (BasicServicePlacementPolicyDescription, bool) { + return &spnppspd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicServicePlacementPolicyDescription describes the policy to be used for placement of a Service Fabric service. +type BasicServicePlacementPolicyDescription interface { + AsServicePlacementInvalidDomainPolicyDescription() (*ServicePlacementInvalidDomainPolicyDescription, bool) + AsServicePlacementNonPartiallyPlaceServicePolicyDescription() (*ServicePlacementNonPartiallyPlaceServicePolicyDescription, bool) + AsServicePlacementPreferPrimaryDomainPolicyDescription() (*ServicePlacementPreferPrimaryDomainPolicyDescription, bool) + AsServicePlacementRequiredDomainPolicyDescription() (*ServicePlacementRequiredDomainPolicyDescription, bool) + AsServicePlacementRequireDomainDistributionPolicyDescription() (*ServicePlacementRequireDomainDistributionPolicyDescription, bool) + AsServicePlacementPolicyDescription() (*ServicePlacementPolicyDescription, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServicePlacementPolicyDescription describes the policy to be used for placement of a Service Fabric service. +type ServicePlacementPolicyDescription struct { + // Type - Possible values include: 'TypeServicePlacementPolicyDescription', 'TypeInvalidDomain', 'TypeNonPartiallyPlaceService', 'TypePreferPrimaryDomain', 'TypeRequireDomain', 'TypeRequireDomainDistribution' + Type TypeBasicServicePlacementPolicyDescription `json:"Type,omitempty"` +} + +func unmarshalBasicServicePlacementPolicyDescription(body []byte) (BasicServicePlacementPolicyDescription, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["Type"] { + case string(TypeInvalidDomain): + var spidpd ServicePlacementInvalidDomainPolicyDescription + err := json.Unmarshal(body, &spidpd) + return spidpd, err + case string(TypeNonPartiallyPlaceService): + var spnppspd ServicePlacementNonPartiallyPlaceServicePolicyDescription + err := json.Unmarshal(body, &spnppspd) + return spnppspd, err + case string(TypePreferPrimaryDomain): + var spppdpd ServicePlacementPreferPrimaryDomainPolicyDescription + err := json.Unmarshal(body, &spppdpd) + return spppdpd, err + case string(TypeRequireDomain): + var sprdpd ServicePlacementRequiredDomainPolicyDescription + err := json.Unmarshal(body, &sprdpd) + return sprdpd, err + case string(TypeRequireDomainDistribution): + var sprddpd ServicePlacementRequireDomainDistributionPolicyDescription + err := json.Unmarshal(body, &sprddpd) + return sprddpd, err + default: + var sppd ServicePlacementPolicyDescription + err := json.Unmarshal(body, &sppd) + return sppd, err + } +} +func unmarshalBasicServicePlacementPolicyDescriptionArray(body []byte) ([]BasicServicePlacementPolicyDescription, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sppdArray := make([]BasicServicePlacementPolicyDescription, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sppd, err := unmarshalBasicServicePlacementPolicyDescription(*rawMessage) + if err != nil { + return nil, err + } + sppdArray[index] = sppd + } + return sppdArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ServicePlacementPolicyDescription. +func (sppd ServicePlacementPolicyDescription) MarshalJSON() ([]byte, error) { + sppd.Type = TypeServicePlacementPolicyDescription + objectMap := make(map[string]interface{}) + if sppd.Type != "" { + objectMap["Type"] = sppd.Type + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementInvalidDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPolicyDescription. +func (sppd ServicePlacementPolicyDescription) AsServicePlacementInvalidDomainPolicyDescription() (*ServicePlacementInvalidDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementNonPartiallyPlaceServicePolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPolicyDescription. +func (sppd ServicePlacementPolicyDescription) AsServicePlacementNonPartiallyPlaceServicePolicyDescription() (*ServicePlacementNonPartiallyPlaceServicePolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementPreferPrimaryDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPolicyDescription. +func (sppd ServicePlacementPolicyDescription) AsServicePlacementPreferPrimaryDomainPolicyDescription() (*ServicePlacementPreferPrimaryDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementRequiredDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPolicyDescription. +func (sppd ServicePlacementPolicyDescription) AsServicePlacementRequiredDomainPolicyDescription() (*ServicePlacementRequiredDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementRequireDomainDistributionPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPolicyDescription. +func (sppd ServicePlacementPolicyDescription) AsServicePlacementRequireDomainDistributionPolicyDescription() (*ServicePlacementRequireDomainDistributionPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPolicyDescription. +func (sppd ServicePlacementPolicyDescription) AsServicePlacementPolicyDescription() (*ServicePlacementPolicyDescription, bool) { + return &sppd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServicePlacementPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPolicyDescription. +func (sppd ServicePlacementPolicyDescription) AsBasicServicePlacementPolicyDescription() (BasicServicePlacementPolicyDescription, bool) { + return &sppd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServicePlacementPreferPrimaryDomainPolicyDescription describes the policy to be used for placement of a Service +// Fabric service where the service's Primary replicas should optimally be placed in a particular domain. +// +// This placement policy is usually used with fault domains in scenarios where the Service Fabric cluster is +// geographically distributed in order to indicate that a service�s primary replica should be located in a +// particular fault domain, which in geo-distributed scenarios usually aligns with regional or datacenter +// boundaries. Note that since this is an optimization it is possible that the Primary replica may not end up +// located in this domain due to failures, capacity limits, or other constraints. +type ServicePlacementPreferPrimaryDomainPolicyDescription struct { + // DomainName - The name of the domain that should used for placement as per this policy. + DomainName *string `json:"DomainName,omitempty"` + // Type - Possible values include: 'TypeServicePlacementPolicyDescription', 'TypeInvalidDomain', 'TypeNonPartiallyPlaceService', 'TypePreferPrimaryDomain', 'TypeRequireDomain', 'TypeRequireDomainDistribution' + Type TypeBasicServicePlacementPolicyDescription `json:"Type,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ServicePlacementPreferPrimaryDomainPolicyDescription. +func (spppdpd ServicePlacementPreferPrimaryDomainPolicyDescription) MarshalJSON() ([]byte, error) { + spppdpd.Type = TypePreferPrimaryDomain + objectMap := make(map[string]interface{}) + if spppdpd.DomainName != nil { + objectMap["DomainName"] = spppdpd.DomainName + } + if spppdpd.Type != "" { + objectMap["Type"] = spppdpd.Type + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementInvalidDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPreferPrimaryDomainPolicyDescription. +func (spppdpd ServicePlacementPreferPrimaryDomainPolicyDescription) AsServicePlacementInvalidDomainPolicyDescription() (*ServicePlacementInvalidDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementNonPartiallyPlaceServicePolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPreferPrimaryDomainPolicyDescription. +func (spppdpd ServicePlacementPreferPrimaryDomainPolicyDescription) AsServicePlacementNonPartiallyPlaceServicePolicyDescription() (*ServicePlacementNonPartiallyPlaceServicePolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementPreferPrimaryDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPreferPrimaryDomainPolicyDescription. +func (spppdpd ServicePlacementPreferPrimaryDomainPolicyDescription) AsServicePlacementPreferPrimaryDomainPolicyDescription() (*ServicePlacementPreferPrimaryDomainPolicyDescription, bool) { + return &spppdpd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementRequiredDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPreferPrimaryDomainPolicyDescription. +func (spppdpd ServicePlacementPreferPrimaryDomainPolicyDescription) AsServicePlacementRequiredDomainPolicyDescription() (*ServicePlacementRequiredDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementRequireDomainDistributionPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPreferPrimaryDomainPolicyDescription. +func (spppdpd ServicePlacementPreferPrimaryDomainPolicyDescription) AsServicePlacementRequireDomainDistributionPolicyDescription() (*ServicePlacementRequireDomainDistributionPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPreferPrimaryDomainPolicyDescription. +func (spppdpd ServicePlacementPreferPrimaryDomainPolicyDescription) AsServicePlacementPolicyDescription() (*ServicePlacementPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServicePlacementPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementPreferPrimaryDomainPolicyDescription. +func (spppdpd ServicePlacementPreferPrimaryDomainPolicyDescription) AsBasicServicePlacementPolicyDescription() (BasicServicePlacementPolicyDescription, bool) { + return &spppdpd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServicePlacementRequiredDomainPolicyDescription describes the policy to be used for placement of a Service +// Fabric service where the instances or replicas of that service must be placed in a particular domain +type ServicePlacementRequiredDomainPolicyDescription struct { + // DomainName - The name of the domain that should used for placement as per this policy. + DomainName *string `json:"DomainName,omitempty"` + // Type - Possible values include: 'TypeServicePlacementPolicyDescription', 'TypeInvalidDomain', 'TypeNonPartiallyPlaceService', 'TypePreferPrimaryDomain', 'TypeRequireDomain', 'TypeRequireDomainDistribution' + Type TypeBasicServicePlacementPolicyDescription `json:"Type,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ServicePlacementRequiredDomainPolicyDescription. +func (sprdpd ServicePlacementRequiredDomainPolicyDescription) MarshalJSON() ([]byte, error) { + sprdpd.Type = TypeRequireDomain + objectMap := make(map[string]interface{}) + if sprdpd.DomainName != nil { + objectMap["DomainName"] = sprdpd.DomainName + } + if sprdpd.Type != "" { + objectMap["Type"] = sprdpd.Type + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementInvalidDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementRequiredDomainPolicyDescription. +func (sprdpd ServicePlacementRequiredDomainPolicyDescription) AsServicePlacementInvalidDomainPolicyDescription() (*ServicePlacementInvalidDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementNonPartiallyPlaceServicePolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementRequiredDomainPolicyDescription. +func (sprdpd ServicePlacementRequiredDomainPolicyDescription) AsServicePlacementNonPartiallyPlaceServicePolicyDescription() (*ServicePlacementNonPartiallyPlaceServicePolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementPreferPrimaryDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementRequiredDomainPolicyDescription. +func (sprdpd ServicePlacementRequiredDomainPolicyDescription) AsServicePlacementPreferPrimaryDomainPolicyDescription() (*ServicePlacementPreferPrimaryDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementRequiredDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementRequiredDomainPolicyDescription. +func (sprdpd ServicePlacementRequiredDomainPolicyDescription) AsServicePlacementRequiredDomainPolicyDescription() (*ServicePlacementRequiredDomainPolicyDescription, bool) { + return &sprdpd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementRequireDomainDistributionPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementRequiredDomainPolicyDescription. +func (sprdpd ServicePlacementRequiredDomainPolicyDescription) AsServicePlacementRequireDomainDistributionPolicyDescription() (*ServicePlacementRequireDomainDistributionPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementRequiredDomainPolicyDescription. +func (sprdpd ServicePlacementRequiredDomainPolicyDescription) AsServicePlacementPolicyDescription() (*ServicePlacementPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServicePlacementPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementRequiredDomainPolicyDescription. +func (sprdpd ServicePlacementRequiredDomainPolicyDescription) AsBasicServicePlacementPolicyDescription() (BasicServicePlacementPolicyDescription, bool) { + return &sprdpd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServicePlacementRequireDomainDistributionPolicyDescription describes the policy to be used for placement of a +// Service Fabric service where two replicas from the same partition should never be placed in the same fault or +// upgrade domain. +// +// While this is not common it can expose the service to an increased risk of concurrent failures due to unplanned +// outages or other cases of subsequent/concurrent failures. As an example, consider a case where replicas are +// deployed across different data center, with one replica per location. In the event that one of the datacenters +// goes offline, normally the replica that was placed in that datacenter will be packed into one of the remaining +// datacenters. If this is not desirable then this policy should be set. +type ServicePlacementRequireDomainDistributionPolicyDescription struct { + // DomainName - The name of the domain that should used for placement as per this policy. + DomainName *string `json:"DomainName,omitempty"` + // Type - Possible values include: 'TypeServicePlacementPolicyDescription', 'TypeInvalidDomain', 'TypeNonPartiallyPlaceService', 'TypePreferPrimaryDomain', 'TypeRequireDomain', 'TypeRequireDomainDistribution' + Type TypeBasicServicePlacementPolicyDescription `json:"Type,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ServicePlacementRequireDomainDistributionPolicyDescription. +func (sprddpd ServicePlacementRequireDomainDistributionPolicyDescription) MarshalJSON() ([]byte, error) { + sprddpd.Type = TypeRequireDomainDistribution + objectMap := make(map[string]interface{}) + if sprddpd.DomainName != nil { + objectMap["DomainName"] = sprddpd.DomainName + } + if sprddpd.Type != "" { + objectMap["Type"] = sprddpd.Type + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementInvalidDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementRequireDomainDistributionPolicyDescription. +func (sprddpd ServicePlacementRequireDomainDistributionPolicyDescription) AsServicePlacementInvalidDomainPolicyDescription() (*ServicePlacementInvalidDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementNonPartiallyPlaceServicePolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementRequireDomainDistributionPolicyDescription. +func (sprddpd ServicePlacementRequireDomainDistributionPolicyDescription) AsServicePlacementNonPartiallyPlaceServicePolicyDescription() (*ServicePlacementNonPartiallyPlaceServicePolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementPreferPrimaryDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementRequireDomainDistributionPolicyDescription. +func (sprddpd ServicePlacementRequireDomainDistributionPolicyDescription) AsServicePlacementPreferPrimaryDomainPolicyDescription() (*ServicePlacementPreferPrimaryDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementRequiredDomainPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementRequireDomainDistributionPolicyDescription. +func (sprddpd ServicePlacementRequireDomainDistributionPolicyDescription) AsServicePlacementRequiredDomainPolicyDescription() (*ServicePlacementRequiredDomainPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementRequireDomainDistributionPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementRequireDomainDistributionPolicyDescription. +func (sprddpd ServicePlacementRequireDomainDistributionPolicyDescription) AsServicePlacementRequireDomainDistributionPolicyDescription() (*ServicePlacementRequireDomainDistributionPolicyDescription, bool) { + return &sprddpd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePlacementPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementRequireDomainDistributionPolicyDescription. +func (sprddpd ServicePlacementRequireDomainDistributionPolicyDescription) AsServicePlacementPolicyDescription() (*ServicePlacementPolicyDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServicePlacementPolicyDescription is the BasicServicePlacementPolicyDescription implementation for ServicePlacementRequireDomainDistributionPolicyDescription. +func (sprddpd ServicePlacementRequireDomainDistributionPolicyDescription) AsBasicServicePlacementPolicyDescription() (BasicServicePlacementPolicyDescription, bool) { + return &sprddpd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServicesHealthEvaluation represents health evaluation for services of a certain service type belonging to an +// application, containing health evaluations for each unhealthy service that impacted current aggregated health +// state. Can be returned when evaluating application health and the aggregated health state is either Error or +// Warning. +type ServicesHealthEvaluation struct { + // ServiceTypeName - Name of the service type of the services. + ServiceTypeName *string `json:"ServiceTypeName,omitempty"` + // MaxPercentUnhealthyServices - Maximum allowed percentage of unhealthy services from the ServiceTypeHealthPolicy. + MaxPercentUnhealthyServices *int32 `json:"MaxPercentUnhealthyServices,omitempty"` + // TotalCount - Total number of services of the current service type in the application from the health store. + TotalCount *int64 `json:"TotalCount,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy ServiceHealthEvaluation that impacted the aggregated health. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) MarshalJSON() ([]byte, error) { + she.Kind = KindServices + objectMap := make(map[string]interface{}) + if she.ServiceTypeName != nil { + objectMap["ServiceTypeName"] = she.ServiceTypeName + } + if she.MaxPercentUnhealthyServices != nil { + objectMap["MaxPercentUnhealthyServices"] = she.MaxPercentUnhealthyServices + } + if she.TotalCount != nil { + objectMap["TotalCount"] = she.TotalCount + } + if she.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = she.UnhealthyEvaluations + } + if she.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = she.AggregatedHealthState + } + if she.Description != nil { + objectMap["Description"] = she.Description + } + if she.Kind != "" { + objectMap["Kind"] = she.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return &she, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for ServicesHealthEvaluation. +func (she ServicesHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &she, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicServiceTypeDescription describes a service type defined in the service manifest of a provisioned application +// type. The properties the the ones defined in the service manifest. +type BasicServiceTypeDescription interface { + AsStatefulServiceTypeDescription() (*StatefulServiceTypeDescription, bool) + AsStatelessServiceTypeDescription() (*StatelessServiceTypeDescription, bool) + AsServiceTypeDescription() (*ServiceTypeDescription, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceTypeDescription describes a service type defined in the service manifest of a provisioned application +// type. The properties the the ones defined in the service manifest. +type ServiceTypeDescription struct { + // IsStateful - Indicates whether the service type is a stateful service type or a stateless service type. This property is true if the service type is a stateful service type, false otherwise. + IsStateful *bool `json:"IsStateful,omitempty"` + // ServiceTypeName - Name of the service type. + ServiceTypeName *string `json:"ServiceTypeName,omitempty"` + // PlacementConstraints - The placement constraint to be used when instantiating this service in a Service Fabric cluster. + PlacementConstraints *string `json:"PlacementConstraints,omitempty"` + ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"ServicePlacementPolicies,omitempty"` + Extensions *[]ServiceTypeExtensionDescription `json:"Extensions,omitempty"` + // Kind - Possible values include: 'KindServiceTypeDescription', 'KindStateful', 'KindStateless1' + Kind KindBasicServiceTypeDescription `json:"Kind,omitempty"` +} + +func unmarshalBasicServiceTypeDescription(body []byte) (BasicServiceTypeDescription, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["Kind"] { + case string(KindStateful): + var sstd StatefulServiceTypeDescription + err := json.Unmarshal(body, &sstd) + return sstd, err + case string(KindStateless1): + var sstd StatelessServiceTypeDescription + err := json.Unmarshal(body, &sstd) + return sstd, err + default: + var std ServiceTypeDescription + err := json.Unmarshal(body, &std) + return std, err + } +} +func unmarshalBasicServiceTypeDescriptionArray(body []byte) ([]BasicServiceTypeDescription, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + stdArray := make([]BasicServiceTypeDescription, len(rawMessages)) + + for index, rawMessage := range rawMessages { + std, err := unmarshalBasicServiceTypeDescription(*rawMessage) + if err != nil { + return nil, err + } + stdArray[index] = std + } + return stdArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ServiceTypeDescription. +func (std ServiceTypeDescription) MarshalJSON() ([]byte, error) { + std.Kind = KindServiceTypeDescription + objectMap := make(map[string]interface{}) + if std.IsStateful != nil { + objectMap["IsStateful"] = std.IsStateful + } + if std.ServiceTypeName != nil { + objectMap["ServiceTypeName"] = std.ServiceTypeName + } + if std.PlacementConstraints != nil { + objectMap["PlacementConstraints"] = std.PlacementConstraints + } + if std.ServicePlacementPolicies != nil { + objectMap["ServicePlacementPolicies"] = std.ServicePlacementPolicies + } + if std.Extensions != nil { + objectMap["Extensions"] = std.Extensions + } + if std.Kind != "" { + objectMap["Kind"] = std.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceTypeDescription is the BasicServiceTypeDescription implementation for ServiceTypeDescription. +func (std ServiceTypeDescription) AsStatefulServiceTypeDescription() (*StatefulServiceTypeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceTypeDescription is the BasicServiceTypeDescription implementation for ServiceTypeDescription. +func (std ServiceTypeDescription) AsStatelessServiceTypeDescription() (*StatelessServiceTypeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceTypeDescription is the BasicServiceTypeDescription implementation for ServiceTypeDescription. +func (std ServiceTypeDescription) AsServiceTypeDescription() (*ServiceTypeDescription, bool) { + return &std, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServiceTypeDescription is the BasicServiceTypeDescription implementation for ServiceTypeDescription. +func (std ServiceTypeDescription) AsBasicServiceTypeDescription() (BasicServiceTypeDescription, bool) { + return &std, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for ServiceTypeDescription struct. +func (std *ServiceTypeDescription) 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 "IsStateful": + if v != nil { + var isStateful bool + err = json.Unmarshal(*v, &isStateful) + if err != nil { + return err + } + std.IsStateful = &isStateful + } + case "ServiceTypeName": + if v != nil { + var serviceTypeName string + err = json.Unmarshal(*v, &serviceTypeName) + if err != nil { + return err + } + std.ServiceTypeName = &serviceTypeName + } + case "PlacementConstraints": + if v != nil { + var placementConstraints string + err = json.Unmarshal(*v, &placementConstraints) + if err != nil { + return err + } + std.PlacementConstraints = &placementConstraints + } + case "ServicePlacementPolicies": + if v != nil { + servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) + if err != nil { + return err + } + std.ServicePlacementPolicies = &servicePlacementPolicies + } + case "Extensions": + if v != nil { + var extensions []ServiceTypeExtensionDescription + err = json.Unmarshal(*v, &extensions) + if err != nil { + return err + } + std.Extensions = &extensions + } + case "Kind": + if v != nil { + var kind KindBasicServiceTypeDescription + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + std.Kind = kind + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceTypeExtensionDescription describes extension of a service type defined in the service manifest. +type ServiceTypeExtensionDescription struct { + // Key - The name of the extension. + Key *string `json:"Key,omitempty"` + // Value - The extension value. + Value *string `json:"Value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceTypeHealthPolicy represents the health policy used to evaluate the health of services belonging to a +// service type. +type ServiceTypeHealthPolicy struct { + // MaxPercentUnhealthyPartitionsPerService - The maximum allowed percentage of unhealthy partitions per service. Allowed values are Byte values from zero to 100 + // The percentage represents the maximum tolerated percentage of partitions that can be unhealthy before the service is considered in error. + // If the percentage is respected but there is at least one unhealthy partition, the health is evaluated as Warning. + // The percentage is calculated by dividing the number of unhealthy partitions over the total number of partitions in the service. + // The computation rounds up to tolerate one failure on small numbers of partitions. Default percentage is zero. + MaxPercentUnhealthyPartitionsPerService *int32 `json:"MaxPercentUnhealthyPartitionsPerService,omitempty"` + // MaxPercentUnhealthyReplicasPerPartition - The maximum allowed percentage of unhealthy replicas per partition. Allowed values are Byte values from zero to 100. + // The percentage represents the maximum tolerated percentage of replicas that can be unhealthy before the partition is considered in error. + // If the percentage is respected but there is at least one unhealthy replica, the health is evaluated as Warning. + // The percentage is calculated by dividing the number of unhealthy replicas over the total number of replicas in the partition. + // The computation rounds up to tolerate one failure on small numbers of replicas. Default percentage is zero. + MaxPercentUnhealthyReplicasPerPartition *int32 `json:"MaxPercentUnhealthyReplicasPerPartition,omitempty"` + // MaxPercentUnhealthyServices - The maximum maximum allowed percentage of unhealthy services. Allowed values are Byte values from zero to 100. + // The percentage represents the maximum tolerated percentage of services that can be unhealthy before the application is considered in error. + // If the percentage is respected but there is at least one unhealthy service, the health is evaluated as Warning. + // This is calculated by dividing the number of unhealthy services of the specific service type over the total number of services of the specific service type. + // The computation rounds up to tolerate one failure on small numbers of services. Default percentage is zero. + MaxPercentUnhealthyServices *int32 `json:"MaxPercentUnhealthyServices,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceTypeHealthPolicyMapItem defines an item in ServiceTypeHealthPolicyMap. +type ServiceTypeHealthPolicyMapItem struct { + // Key - The key of the service type health policy map item. This is the name of the service type. + Key *string `json:"Key,omitempty"` + // Value - The value of the service type health policy map item. This is the ServiceTypeHealthPolicy for this service type. + Value *ServiceTypeHealthPolicy `json:"Value,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceTypeInfo information about a service type that is defined in a service manifest of a provisioned +// application type. +type ServiceTypeInfo struct { + ServiceTypeDescription BasicServiceTypeDescription `json:"ServiceTypeDescription,omitempty"` + // ServiceManifestName - The name of the service manifest in which this service type is defined. + ServiceManifestName *string `json:"ServiceManifestName,omitempty"` + // ServiceManifestVersion - The version of the service manifest in which this service type is defined. + ServiceManifestVersion *string `json:"ServiceManifestVersion,omitempty"` + // IsServiceGroup - Indicates whether the service is a service group. If it is, the property value is true otherwise false. + IsServiceGroup *bool `json:"IsServiceGroup,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for ServiceTypeInfo struct. +func (sti *ServiceTypeInfo) 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 "ServiceTypeDescription": + if v != nil { + serviceTypeDescription, err := unmarshalBasicServiceTypeDescription(*v) + if err != nil { + return err + } + sti.ServiceTypeDescription = serviceTypeDescription + } + case "ServiceManifestName": + if v != nil { + var serviceManifestName string + err = json.Unmarshal(*v, &serviceManifestName) + if err != nil { + return err + } + sti.ServiceManifestName = &serviceManifestName + } + case "ServiceManifestVersion": + if v != nil { + var serviceManifestVersion string + err = json.Unmarshal(*v, &serviceManifestVersion) + if err != nil { + return err + } + sti.ServiceManifestVersion = &serviceManifestVersion + } + case "IsServiceGroup": + if v != nil { + var isServiceGroup bool + err = json.Unmarshal(*v, &isServiceGroup) + if err != nil { + return err + } + sti.IsServiceGroup = &isServiceGroup + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceTypeManifest contains the manifest describing a service type registered as part of an application in a +// Service Fabric cluster. +type ServiceTypeManifest struct { + autorest.Response `json:"-"` + // Manifest - The XML manifest as a string. + Manifest *string `json:"Manifest,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// BasicServiceUpdateDescription a ServiceUpdateDescription contains all of the information necessary to update a +// service. +type BasicServiceUpdateDescription interface { + AsStatefulServiceUpdateDescription() (*StatefulServiceUpdateDescription, bool) + AsStatelessServiceUpdateDescription() (*StatelessServiceUpdateDescription, bool) + AsServiceUpdateDescription() (*ServiceUpdateDescription, bool) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ServiceUpdateDescription a ServiceUpdateDescription contains all of the information necessary to update a +// service. +type ServiceUpdateDescription struct { + // Flags - Flags indicating whether other properties are set. Each of the associated properties corresponds to a flag, specified below, which, if set, indicate that the property is specified. + // This property can be a combination of those flags obtained using bitwise 'OR' operator. + // For example, if the provided value is 6 then the flags for ReplicaRestartWaitDuration (2) and QuorumLossWaitDuration (4) are set. + // - None - Does not indicate any other properties are set. The value is zero. + // - TargetReplicaSetSize/InstanceCount - Indicates whether the TargetReplicaSetSize property (for Stateful services) or the InstanceCount property (for Stateless services) is set. The value is 1. + // - ReplicaRestartWaitDuration - Indicates the ReplicaRestartWaitDuration property is set. The value is 2. + // - QuorumLossWaitDuration - Indicates the QuorumLossWaitDuration property is set. The value is 4. + // - StandByReplicaKeepDuration - Indicates the StandByReplicaKeepDuration property is set. The value is 8. + // - MinReplicaSetSize - Indicates the MinReplicaSetSize property is set. The value is 16. + // - PlacementConstraints - Indicates the PlacementConstraints property is set. The value is 32. + // - PlacementPolicyList - Indicates the ServicePlacementPolicies property is set. The value is 64. + // - Correlation - Indicates the CorrelationScheme property is set. The value is 128. + // - Metrics - Indicates the ServiceLoadMetrics property is set. The value is 256. + // - DefaultMoveCost - Indicates the DefaultMoveCost property is set. The value is 512. + Flags *string `json:"Flags,omitempty"` + // PlacementConstraints - The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + PlacementConstraints *string `json:"PlacementConstraints,omitempty"` + // CorrelationScheme - The correlation scheme. + CorrelationScheme *[]ServiceCorrelationDescription `json:"CorrelationScheme,omitempty"` + // LoadMetrics - The service load metrics. + LoadMetrics *[]ServiceLoadMetricDescription `json:"LoadMetrics,omitempty"` + // ServicePlacementPolicies - The service placement policies. + ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"ServicePlacementPolicies,omitempty"` + // DefaultMoveCost - The move cost for the service. Possible values include: 'DefaultMoveCost1Zero', 'DefaultMoveCost1Low', 'DefaultMoveCost1Medium', 'DefaultMoveCost1High' + DefaultMoveCost DefaultMoveCost1 `json:"DefaultMoveCost,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicServiceUpdateDescriptionServiceKindServiceUpdateDescription', 'ServiceKindBasicServiceUpdateDescriptionServiceKindStateful', 'ServiceKindBasicServiceUpdateDescriptionServiceKindStateless' + ServiceKind ServiceKindBasicServiceUpdateDescription `json:"ServiceKind,omitempty"` +} + +func unmarshalBasicServiceUpdateDescription(body []byte) (BasicServiceUpdateDescription, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["ServiceKind"] { + case string(ServiceKindBasicServiceUpdateDescriptionServiceKindStateful): + var ssud StatefulServiceUpdateDescription + err := json.Unmarshal(body, &ssud) + return ssud, err + case string(ServiceKindBasicServiceUpdateDescriptionServiceKindStateless): + var ssud StatelessServiceUpdateDescription + err := json.Unmarshal(body, &ssud) + return ssud, err + default: + var sud ServiceUpdateDescription + err := json.Unmarshal(body, &sud) + return sud, err + } +} +func unmarshalBasicServiceUpdateDescriptionArray(body []byte) ([]BasicServiceUpdateDescription, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sudArray := make([]BasicServiceUpdateDescription, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sud, err := unmarshalBasicServiceUpdateDescription(*rawMessage) + if err != nil { + return nil, err + } + sudArray[index] = sud + } + return sudArray, nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ServiceUpdateDescription. +func (sud ServiceUpdateDescription) MarshalJSON() ([]byte, error) { + sud.ServiceKind = ServiceKindBasicServiceUpdateDescriptionServiceKindServiceUpdateDescription + objectMap := make(map[string]interface{}) + if sud.Flags != nil { + objectMap["Flags"] = sud.Flags + } + if sud.PlacementConstraints != nil { + objectMap["PlacementConstraints"] = sud.PlacementConstraints + } + if sud.CorrelationScheme != nil { + objectMap["CorrelationScheme"] = sud.CorrelationScheme + } + if sud.LoadMetrics != nil { + objectMap["LoadMetrics"] = sud.LoadMetrics + } + if sud.ServicePlacementPolicies != nil { + objectMap["ServicePlacementPolicies"] = sud.ServicePlacementPolicies + } + if sud.DefaultMoveCost != "" { + objectMap["DefaultMoveCost"] = sud.DefaultMoveCost + } + if sud.ServiceKind != "" { + objectMap["ServiceKind"] = sud.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceUpdateDescription is the BasicServiceUpdateDescription implementation for ServiceUpdateDescription. +func (sud ServiceUpdateDescription) AsStatefulServiceUpdateDescription() (*StatefulServiceUpdateDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceUpdateDescription is the BasicServiceUpdateDescription implementation for ServiceUpdateDescription. +func (sud ServiceUpdateDescription) AsStatelessServiceUpdateDescription() (*StatelessServiceUpdateDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceUpdateDescription is the BasicServiceUpdateDescription implementation for ServiceUpdateDescription. +func (sud ServiceUpdateDescription) AsServiceUpdateDescription() (*ServiceUpdateDescription, bool) { + return &sud, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServiceUpdateDescription is the BasicServiceUpdateDescription implementation for ServiceUpdateDescription. +func (sud ServiceUpdateDescription) AsBasicServiceUpdateDescription() (BasicServiceUpdateDescription, bool) { + return &sud, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for ServiceUpdateDescription struct. +func (sud *ServiceUpdateDescription) 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 "Flags": + if v != nil { + var flags string + err = json.Unmarshal(*v, &flags) + if err != nil { + return err + } + sud.Flags = &flags + } + case "PlacementConstraints": + if v != nil { + var placementConstraints string + err = json.Unmarshal(*v, &placementConstraints) + if err != nil { + return err + } + sud.PlacementConstraints = &placementConstraints + } + case "CorrelationScheme": + if v != nil { + var correlationScheme []ServiceCorrelationDescription + err = json.Unmarshal(*v, &correlationScheme) + if err != nil { + return err + } + sud.CorrelationScheme = &correlationScheme + } + case "LoadMetrics": + if v != nil { + var loadMetrics []ServiceLoadMetricDescription + err = json.Unmarshal(*v, &loadMetrics) + if err != nil { + return err + } + sud.LoadMetrics = &loadMetrics + } + case "ServicePlacementPolicies": + if v != nil { + servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) + if err != nil { + return err + } + sud.ServicePlacementPolicies = &servicePlacementPolicies + } + case "DefaultMoveCost": + if v != nil { + var defaultMoveCost DefaultMoveCost1 + err = json.Unmarshal(*v, &defaultMoveCost) + if err != nil { + return err + } + sud.DefaultMoveCost = defaultMoveCost + } + case "ServiceKind": + if v != nil { + var serviceKind ServiceKindBasicServiceUpdateDescription + err = json.Unmarshal(*v, &serviceKind) + if err != nil { + return err + } + sud.ServiceKind = serviceKind + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// SingletonPartitionInformation information about a partition that is singleton. The services with singletone +// partitioning scheme are effectively non-partitioned. They only have one partition. +type SingletonPartitionInformation struct { + ID *uuid.UUID `json:"Id,omitempty"` + // ServicePartitionKind - Possible values include: 'ServicePartitionKindPartitionInformation', 'ServicePartitionKindInt64Range', 'ServicePartitionKindNamed', 'ServicePartitionKindSingleton' + ServicePartitionKind ServicePartitionKind `json:"ServicePartitionKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for SingletonPartitionInformation. +func (spi SingletonPartitionInformation) MarshalJSON() ([]byte, error) { + spi.ServicePartitionKind = ServicePartitionKindSingleton + objectMap := make(map[string]interface{}) + if spi.ID != nil { + objectMap["Id"] = spi.ID + } + if spi.ServicePartitionKind != "" { + objectMap["ServicePartitionKind"] = spi.ServicePartitionKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsInt64RangePartitionInformation is the BasicPartitionInformation implementation for SingletonPartitionInformation. +func (spi SingletonPartitionInformation) AsInt64RangePartitionInformation() (*Int64RangePartitionInformation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNamedPartitionInformation is the BasicPartitionInformation implementation for SingletonPartitionInformation. +func (spi SingletonPartitionInformation) AsNamedPartitionInformation() (*NamedPartitionInformation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSingletonPartitionInformation is the BasicPartitionInformation implementation for SingletonPartitionInformation. +func (spi SingletonPartitionInformation) AsSingletonPartitionInformation() (*SingletonPartitionInformation, bool) { + return &spi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionInformation is the BasicPartitionInformation implementation for SingletonPartitionInformation. +func (spi SingletonPartitionInformation) AsPartitionInformation() (*PartitionInformation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionInformation is the BasicPartitionInformation implementation for SingletonPartitionInformation. +func (spi SingletonPartitionInformation) AsBasicPartitionInformation() (BasicPartitionInformation, bool) { + return &spi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// SingletonPartitionSchemeDescription describes the partition scheme of a singleton-partitioned, or +// non-partitioned service. +type SingletonPartitionSchemeDescription struct { + // PartitionScheme - Possible values include: 'PartitionSchemePartitionSchemeDescription', 'PartitionSchemeNamed', 'PartitionSchemeSingleton', 'PartitionSchemeUniformInt64Range' + PartitionScheme PartitionScheme `json:"PartitionScheme,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for SingletonPartitionSchemeDescription. +func (spsd SingletonPartitionSchemeDescription) MarshalJSON() ([]byte, error) { + spsd.PartitionScheme = PartitionSchemeSingleton + objectMap := make(map[string]interface{}) + if spsd.PartitionScheme != "" { + objectMap["PartitionScheme"] = spsd.PartitionScheme + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNamedPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for SingletonPartitionSchemeDescription. +func (spsd SingletonPartitionSchemeDescription) AsNamedPartitionSchemeDescription() (*NamedPartitionSchemeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSingletonPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for SingletonPartitionSchemeDescription. +func (spsd SingletonPartitionSchemeDescription) AsSingletonPartitionSchemeDescription() (*SingletonPartitionSchemeDescription, bool) { + return &spsd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUniformInt64RangePartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for SingletonPartitionSchemeDescription. +func (spsd SingletonPartitionSchemeDescription) AsUniformInt64RangePartitionSchemeDescription() (*UniformInt64RangePartitionSchemeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for SingletonPartitionSchemeDescription. +func (spsd SingletonPartitionSchemeDescription) AsPartitionSchemeDescription() (*PartitionSchemeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for SingletonPartitionSchemeDescription. +func (spsd SingletonPartitionSchemeDescription) AsBasicPartitionSchemeDescription() (BasicPartitionSchemeDescription, bool) { + return &spsd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartedChaosEvent describes a Chaos event that gets generated when Chaos is started. +type StartedChaosEvent struct { + ChaosParameters *ChaosParameters `json:"ChaosParameters,omitempty"` + TimeStampUtc *date.Time `json:"TimeStampUtc,omitempty"` + // Kind - Possible values include: 'KindChaosEvent', 'KindExecutingFaults', 'KindStarted', 'KindStopped', 'KindTestError', 'KindValidationFailed', 'KindWaiting' + Kind KindBasicChaosEvent `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StartedChaosEvent. +func (sce StartedChaosEvent) MarshalJSON() ([]byte, error) { + sce.Kind = KindStarted + objectMap := make(map[string]interface{}) + if sce.ChaosParameters != nil { + objectMap["ChaosParameters"] = sce.ChaosParameters + } + if sce.TimeStampUtc != nil { + objectMap["TimeStampUtc"] = sce.TimeStampUtc + } + if sce.Kind != "" { + objectMap["Kind"] = sce.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsExecutingFaultsChaosEvent is the BasicChaosEvent implementation for StartedChaosEvent. +func (sce StartedChaosEvent) AsExecutingFaultsChaosEvent() (*ExecutingFaultsChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStartedChaosEvent is the BasicChaosEvent implementation for StartedChaosEvent. +func (sce StartedChaosEvent) AsStartedChaosEvent() (*StartedChaosEvent, bool) { + return &sce, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStoppedChaosEvent is the BasicChaosEvent implementation for StartedChaosEvent. +func (sce StartedChaosEvent) AsStoppedChaosEvent() (*StoppedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsTestErrorChaosEvent is the BasicChaosEvent implementation for StartedChaosEvent. +func (sce StartedChaosEvent) AsTestErrorChaosEvent() (*TestErrorChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsValidationFailedChaosEvent is the BasicChaosEvent implementation for StartedChaosEvent. +func (sce StartedChaosEvent) AsValidationFailedChaosEvent() (*ValidationFailedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitingChaosEvent is the BasicChaosEvent implementation for StartedChaosEvent. +func (sce StartedChaosEvent) AsWaitingChaosEvent() (*WaitingChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsChaosEvent is the BasicChaosEvent implementation for StartedChaosEvent. +func (sce StartedChaosEvent) AsChaosEvent() (*ChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicChaosEvent is the BasicChaosEvent implementation for StartedChaosEvent. +func (sce StartedChaosEvent) AsBasicChaosEvent() (BasicChaosEvent, bool) { + return &sce, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StartNodeDescription describes the parameter for starting a stopped Service Fabric node. +type StartNodeDescription struct { + // NodeInstanceID - The instance id of the node that is stopped. If instance id is specified the node is started only if it matches with the current instance of the stopped node. A default value of "0" would match any instance id. The instance id can be obtained using get node query. + NodeInstanceID *string `json:"NodeInstanceId,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatefulServiceDescription describes a stateful service. +type StatefulServiceDescription struct { + // TargetReplicaSetSize - The target replica set size as a number. + TargetReplicaSetSize *int32 `json:"TargetReplicaSetSize,omitempty"` + // MinReplicaSetSize - The minimum replica set size as a number. + MinReplicaSetSize *int32 `json:"MinReplicaSetSize,omitempty"` + // HasPersistedState - A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. + HasPersistedState *bool `json:"HasPersistedState,omitempty"` + // Flags - Flags indicating whether other properties are set. Each of the associated properties corresponds to a flag, specified below, which, if set, indicate that the property is specified. + // This property can be a combination of those flags obtained using bitwise 'OR' operator. + // For example, if the provided value is 6 then the flags for QuorumLossWaitDuration (2) and StandByReplicaKeepDuration(4) are set. + // - None - Does not indicate any other properties are set. The value is zero. + // - ReplicaRestartWaitDuration - Indicates the ReplicaRestartWaitDuration property is set. The value is 1. + // - QuorumLossWaitDuration - Indicates the QuorumLossWaitDuration property is set. The value is 2. + // - StandByReplicaKeepDuration - Indicates the StandByReplicaKeepDuration property is set. The value is 4. + Flags *int32 `json:"Flags,omitempty"` + // ReplicaRestartWaitDurationSeconds - The duration, in seconds, between when a replica goes down and when a new replica is created. + ReplicaRestartWaitDurationSeconds *int64 `json:"ReplicaRestartWaitDurationSeconds,omitempty"` + // QuorumLossWaitDurationSeconds - The maximum duration, in seconds, for which a partition is allowed to be in a state of quorum loss. + QuorumLossWaitDurationSeconds *int64 `json:"QuorumLossWaitDurationSeconds,omitempty"` + // StandByReplicaKeepDurationSeconds - The definition on how long StandBy replicas should be maintained before being removed. + StandByReplicaKeepDurationSeconds *int64 `json:"StandByReplicaKeepDurationSeconds,omitempty"` + // ApplicationName - The application name. + ApplicationName *string `json:"ApplicationName,omitempty"` + // ServiceName - The service name. + ServiceName *string `json:"ServiceName,omitempty"` + // ServiceTypeName - The service type name. + ServiceTypeName *string `json:"ServiceTypeName,omitempty"` + // InitializationData - The initialization data as an array of bytes. Initialization data is passed to service instances or replicas when they are created. + InitializationData *[]int32 `json:"InitializationData,omitempty"` + // PartitionDescription - The partition description as an object. + PartitionDescription BasicPartitionSchemeDescription `json:"PartitionDescription,omitempty"` + // PlacementConstraints - The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + PlacementConstraints *string `json:"PlacementConstraints,omitempty"` + // CorrelationScheme - The correlation scheme. + CorrelationScheme *[]ServiceCorrelationDescription `json:"CorrelationScheme,omitempty"` + // ServiceLoadMetrics - The service load metrics. + ServiceLoadMetrics *[]ServiceLoadMetricDescription `json:"ServiceLoadMetrics,omitempty"` + // ServicePlacementPolicies - The service placement policies. + ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"ServicePlacementPolicies,omitempty"` + // DefaultMoveCost - The move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + DefaultMoveCost DefaultMoveCost `json:"DefaultMoveCost,omitempty"` + // IsDefaultMoveCostSpecified - Indicates if the DefaultMoveCost property is specified. + IsDefaultMoveCostSpecified *bool `json:"IsDefaultMoveCostSpecified,omitempty"` + // ServicePackageActivationMode - The activation mode of service package to be used for a service. Possible values include: 'ServicePackageActivationMode1SharedProcess', 'ServicePackageActivationMode1ExclusiveProcess' + ServicePackageActivationMode ServicePackageActivationMode1 `json:"ServicePackageActivationMode,omitempty"` + // ServiceDNSName - The DNS name of the service. It requires the DNS system service to be enabled in Service Fabric cluster. + ServiceDNSName *string `json:"ServiceDnsName,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicServiceDescriptionServiceKindServiceDescription', 'ServiceKindBasicServiceDescriptionServiceKindStateful', 'ServiceKindBasicServiceDescriptionServiceKindStateless' + ServiceKind ServiceKindBasicServiceDescription `json:"ServiceKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatefulServiceDescription. +func (ssd StatefulServiceDescription) MarshalJSON() ([]byte, error) { + ssd.ServiceKind = ServiceKindBasicServiceDescriptionServiceKindStateful + objectMap := make(map[string]interface{}) + if ssd.TargetReplicaSetSize != nil { + objectMap["TargetReplicaSetSize"] = ssd.TargetReplicaSetSize + } + if ssd.MinReplicaSetSize != nil { + objectMap["MinReplicaSetSize"] = ssd.MinReplicaSetSize + } + if ssd.HasPersistedState != nil { + objectMap["HasPersistedState"] = ssd.HasPersistedState + } + if ssd.Flags != nil { + objectMap["Flags"] = ssd.Flags + } + if ssd.ReplicaRestartWaitDurationSeconds != nil { + objectMap["ReplicaRestartWaitDurationSeconds"] = ssd.ReplicaRestartWaitDurationSeconds + } + if ssd.QuorumLossWaitDurationSeconds != nil { + objectMap["QuorumLossWaitDurationSeconds"] = ssd.QuorumLossWaitDurationSeconds + } + if ssd.StandByReplicaKeepDurationSeconds != nil { + objectMap["StandByReplicaKeepDurationSeconds"] = ssd.StandByReplicaKeepDurationSeconds + } + if ssd.ApplicationName != nil { + objectMap["ApplicationName"] = ssd.ApplicationName + } + if ssd.ServiceName != nil { + objectMap["ServiceName"] = ssd.ServiceName + } + if ssd.ServiceTypeName != nil { + objectMap["ServiceTypeName"] = ssd.ServiceTypeName + } + if ssd.InitializationData != nil { + objectMap["InitializationData"] = ssd.InitializationData + } + objectMap["PartitionDescription"] = ssd.PartitionDescription + if ssd.PlacementConstraints != nil { + objectMap["PlacementConstraints"] = ssd.PlacementConstraints + } + if ssd.CorrelationScheme != nil { + objectMap["CorrelationScheme"] = ssd.CorrelationScheme + } + if ssd.ServiceLoadMetrics != nil { + objectMap["ServiceLoadMetrics"] = ssd.ServiceLoadMetrics + } + if ssd.ServicePlacementPolicies != nil { + objectMap["ServicePlacementPolicies"] = ssd.ServicePlacementPolicies + } + if ssd.DefaultMoveCost != "" { + objectMap["DefaultMoveCost"] = ssd.DefaultMoveCost + } + if ssd.IsDefaultMoveCostSpecified != nil { + objectMap["IsDefaultMoveCostSpecified"] = ssd.IsDefaultMoveCostSpecified + } + if ssd.ServicePackageActivationMode != "" { + objectMap["ServicePackageActivationMode"] = ssd.ServicePackageActivationMode + } + if ssd.ServiceDNSName != nil { + objectMap["ServiceDnsName"] = ssd.ServiceDNSName + } + if ssd.ServiceKind != "" { + objectMap["ServiceKind"] = ssd.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceDescription is the BasicServiceDescription implementation for StatefulServiceDescription. +func (ssd StatefulServiceDescription) AsStatefulServiceDescription() (*StatefulServiceDescription, bool) { + return &ssd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceDescription is the BasicServiceDescription implementation for StatefulServiceDescription. +func (ssd StatefulServiceDescription) AsStatelessServiceDescription() (*StatelessServiceDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceDescription is the BasicServiceDescription implementation for StatefulServiceDescription. +func (ssd StatefulServiceDescription) AsServiceDescription() (*ServiceDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServiceDescription is the BasicServiceDescription implementation for StatefulServiceDescription. +func (ssd StatefulServiceDescription) AsBasicServiceDescription() (BasicServiceDescription, bool) { + return &ssd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for StatefulServiceDescription struct. +func (ssd *StatefulServiceDescription) 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 "TargetReplicaSetSize": + if v != nil { + var targetReplicaSetSize int32 + err = json.Unmarshal(*v, &targetReplicaSetSize) + if err != nil { + return err + } + ssd.TargetReplicaSetSize = &targetReplicaSetSize + } + case "MinReplicaSetSize": + if v != nil { + var minReplicaSetSize int32 + err = json.Unmarshal(*v, &minReplicaSetSize) + if err != nil { + return err + } + ssd.MinReplicaSetSize = &minReplicaSetSize + } + case "HasPersistedState": + if v != nil { + var hasPersistedState bool + err = json.Unmarshal(*v, &hasPersistedState) + if err != nil { + return err + } + ssd.HasPersistedState = &hasPersistedState + } + case "Flags": + if v != nil { + var flags int32 + err = json.Unmarshal(*v, &flags) + if err != nil { + return err + } + ssd.Flags = &flags + } + case "ReplicaRestartWaitDurationSeconds": + if v != nil { + var replicaRestartWaitDurationSeconds int64 + err = json.Unmarshal(*v, &replicaRestartWaitDurationSeconds) + if err != nil { + return err + } + ssd.ReplicaRestartWaitDurationSeconds = &replicaRestartWaitDurationSeconds + } + case "QuorumLossWaitDurationSeconds": + if v != nil { + var quorumLossWaitDurationSeconds int64 + err = json.Unmarshal(*v, &quorumLossWaitDurationSeconds) + if err != nil { + return err + } + ssd.QuorumLossWaitDurationSeconds = &quorumLossWaitDurationSeconds + } + case "StandByReplicaKeepDurationSeconds": + if v != nil { + var standByReplicaKeepDurationSeconds int64 + err = json.Unmarshal(*v, &standByReplicaKeepDurationSeconds) + if err != nil { + return err + } + ssd.StandByReplicaKeepDurationSeconds = &standByReplicaKeepDurationSeconds + } + case "ApplicationName": + if v != nil { + var applicationName string + err = json.Unmarshal(*v, &applicationName) + if err != nil { + return err + } + ssd.ApplicationName = &applicationName + } + case "ServiceName": + if v != nil { + var serviceName string + err = json.Unmarshal(*v, &serviceName) + if err != nil { + return err + } + ssd.ServiceName = &serviceName + } + case "ServiceTypeName": + if v != nil { + var serviceTypeName string + err = json.Unmarshal(*v, &serviceTypeName) + if err != nil { + return err + } + ssd.ServiceTypeName = &serviceTypeName + } + case "InitializationData": + if v != nil { + var initializationData []int32 + err = json.Unmarshal(*v, &initializationData) + if err != nil { + return err + } + ssd.InitializationData = &initializationData + } + case "PartitionDescription": + if v != nil { + partitionDescription, err := unmarshalBasicPartitionSchemeDescription(*v) + if err != nil { + return err + } + ssd.PartitionDescription = partitionDescription + } + case "PlacementConstraints": + if v != nil { + var placementConstraints string + err = json.Unmarshal(*v, &placementConstraints) + if err != nil { + return err + } + ssd.PlacementConstraints = &placementConstraints + } + case "CorrelationScheme": + if v != nil { + var correlationScheme []ServiceCorrelationDescription + err = json.Unmarshal(*v, &correlationScheme) + if err != nil { + return err + } + ssd.CorrelationScheme = &correlationScheme + } + case "ServiceLoadMetrics": + if v != nil { + var serviceLoadMetrics []ServiceLoadMetricDescription + err = json.Unmarshal(*v, &serviceLoadMetrics) + if err != nil { + return err + } + ssd.ServiceLoadMetrics = &serviceLoadMetrics + } + case "ServicePlacementPolicies": + if v != nil { + servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) + if err != nil { + return err + } + ssd.ServicePlacementPolicies = &servicePlacementPolicies + } + case "DefaultMoveCost": + if v != nil { + var defaultMoveCost DefaultMoveCost + err = json.Unmarshal(*v, &defaultMoveCost) + if err != nil { + return err + } + ssd.DefaultMoveCost = defaultMoveCost + } + case "IsDefaultMoveCostSpecified": + if v != nil { + var isDefaultMoveCostSpecified bool + err = json.Unmarshal(*v, &isDefaultMoveCostSpecified) + if err != nil { + return err + } + ssd.IsDefaultMoveCostSpecified = &isDefaultMoveCostSpecified + } + case "ServicePackageActivationMode": + if v != nil { + var servicePackageActivationMode ServicePackageActivationMode1 + err = json.Unmarshal(*v, &servicePackageActivationMode) + if err != nil { + return err + } + ssd.ServicePackageActivationMode = servicePackageActivationMode + } + case "ServiceDnsName": + if v != nil { + var serviceDNSName string + err = json.Unmarshal(*v, &serviceDNSName) + if err != nil { + return err + } + ssd.ServiceDNSName = &serviceDNSName + } + case "ServiceKind": + if v != nil { + var serviceKind ServiceKindBasicServiceDescription + err = json.Unmarshal(*v, &serviceKind) + if err != nil { + return err + } + ssd.ServiceKind = serviceKind + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatefulServiceInfo information about a stateful Service Fabric service. +type StatefulServiceInfo struct { + // HasPersistedState - Whether the service has persisted state. + HasPersistedState *bool `json:"HasPersistedState,omitempty"` + ID *string `json:"Id,omitempty"` + // Name - Full hierarchical name of the service in URI format starting with `fabric:`. + Name *string `json:"Name,omitempty"` + // TypeName - The name of the service type as specified in the service manifest. + TypeName *string `json:"TypeName,omitempty"` + // ManifestVersion - The version of the service manifest. + ManifestVersion *string `json:"ManifestVersion,omitempty"` + // HealthState - Possible values include: 'HealthState7Invalid', 'HealthState7Ok', 'HealthState7Warning', 'HealthState7Error', 'HealthState7Unknown' + HealthState HealthState7 `json:"HealthState,omitempty"` + // ServiceStatus - Possible values include: 'ServiceStatusUnknown', 'ServiceStatusActive', 'ServiceStatusUpgrading', 'ServiceStatusDeleting', 'ServiceStatusCreating', 'ServiceStatusFailed' + ServiceStatus ServiceStatus `json:"ServiceStatus,omitempty"` + // IsServiceGroup - Whether the service is in a service group. + IsServiceGroup *bool `json:"IsServiceGroup,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicServiceInfoServiceKindServiceInfo', 'ServiceKindBasicServiceInfoServiceKindStateful', 'ServiceKindBasicServiceInfoServiceKindStateless' + ServiceKind ServiceKindBasicServiceInfo `json:"ServiceKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatefulServiceInfo. +func (ssi StatefulServiceInfo) MarshalJSON() ([]byte, error) { + ssi.ServiceKind = ServiceKindBasicServiceInfoServiceKindStateful + objectMap := make(map[string]interface{}) + if ssi.HasPersistedState != nil { + objectMap["HasPersistedState"] = ssi.HasPersistedState + } + if ssi.ID != nil { + objectMap["Id"] = ssi.ID + } + if ssi.Name != nil { + objectMap["Name"] = ssi.Name + } + if ssi.TypeName != nil { + objectMap["TypeName"] = ssi.TypeName + } + if ssi.ManifestVersion != nil { + objectMap["ManifestVersion"] = ssi.ManifestVersion + } + if ssi.HealthState != "" { + objectMap["HealthState"] = ssi.HealthState + } + if ssi.ServiceStatus != "" { + objectMap["ServiceStatus"] = ssi.ServiceStatus + } + if ssi.IsServiceGroup != nil { + objectMap["IsServiceGroup"] = ssi.IsServiceGroup + } + if ssi.ServiceKind != "" { + objectMap["ServiceKind"] = ssi.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceInfo is the BasicServiceInfo implementation for StatefulServiceInfo. +func (ssi StatefulServiceInfo) AsStatefulServiceInfo() (*StatefulServiceInfo, bool) { + return &ssi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceInfo is the BasicServiceInfo implementation for StatefulServiceInfo. +func (ssi StatefulServiceInfo) AsStatelessServiceInfo() (*StatelessServiceInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceInfo is the BasicServiceInfo implementation for StatefulServiceInfo. +func (ssi StatefulServiceInfo) AsServiceInfo() (*ServiceInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServiceInfo is the BasicServiceInfo implementation for StatefulServiceInfo. +func (ssi StatefulServiceInfo) AsBasicServiceInfo() (BasicServiceInfo, bool) { + return &ssi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatefulServicePartitionInfo information about a partition of a stateful Service Fabric service.. +type StatefulServicePartitionInfo struct { + // TargetReplicaSetSize - The target replica set size as a number. + TargetReplicaSetSize *int64 `json:"TargetReplicaSetSize,omitempty"` + // MinReplicaSetSize - The minimum replica set size as a number. + MinReplicaSetSize *int64 `json:"MinReplicaSetSize,omitempty"` + // LastQuorumLossDuration - The duration for which this partition was in quorum loss. If the partition is currently in quorum loss, it returns the duration since it has been in that state. This field is using ISO8601 format for specifying the duration. + LastQuorumLossDuration *string `json:"LastQuorumLossDuration,omitempty"` + CurrentConfigurationEpoch *Epoch `json:"CurrentConfigurationEpoch,omitempty"` + // HealthState - Possible values include: 'HealthState5Invalid', 'HealthState5Ok', 'HealthState5Warning', 'HealthState5Error', 'HealthState5Unknown' + HealthState HealthState5 `json:"HealthState,omitempty"` + // PartitionStatus - Possible values include: 'PartitionStatusInvalid', 'PartitionStatusReady', 'PartitionStatusNotReady', 'PartitionStatusInQuorumLoss', 'PartitionStatusReconfiguring', 'PartitionStatusDeleting' + PartitionStatus PartitionStatus `json:"PartitionStatus,omitempty"` + PartitionInformation BasicPartitionInformation `json:"PartitionInformation,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicServicePartitionInfoServiceKindServicePartitionInfo', 'ServiceKindBasicServicePartitionInfoServiceKindStateful', 'ServiceKindBasicServicePartitionInfoServiceKindStateless' + ServiceKind ServiceKindBasicServicePartitionInfo `json:"ServiceKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatefulServicePartitionInfo. +func (sspi StatefulServicePartitionInfo) MarshalJSON() ([]byte, error) { + sspi.ServiceKind = ServiceKindBasicServicePartitionInfoServiceKindStateful + objectMap := make(map[string]interface{}) + if sspi.TargetReplicaSetSize != nil { + objectMap["TargetReplicaSetSize"] = sspi.TargetReplicaSetSize + } + if sspi.MinReplicaSetSize != nil { + objectMap["MinReplicaSetSize"] = sspi.MinReplicaSetSize + } + if sspi.LastQuorumLossDuration != nil { + objectMap["LastQuorumLossDuration"] = sspi.LastQuorumLossDuration + } + if sspi.CurrentConfigurationEpoch != nil { + objectMap["CurrentConfigurationEpoch"] = sspi.CurrentConfigurationEpoch + } + if sspi.HealthState != "" { + objectMap["HealthState"] = sspi.HealthState + } + if sspi.PartitionStatus != "" { + objectMap["PartitionStatus"] = sspi.PartitionStatus + } + objectMap["PartitionInformation"] = sspi.PartitionInformation + if sspi.ServiceKind != "" { + objectMap["ServiceKind"] = sspi.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServicePartitionInfo is the BasicServicePartitionInfo implementation for StatefulServicePartitionInfo. +func (sspi StatefulServicePartitionInfo) AsStatefulServicePartitionInfo() (*StatefulServicePartitionInfo, bool) { + return &sspi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServicePartitionInfo is the BasicServicePartitionInfo implementation for StatefulServicePartitionInfo. +func (sspi StatefulServicePartitionInfo) AsStatelessServicePartitionInfo() (*StatelessServicePartitionInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePartitionInfo is the BasicServicePartitionInfo implementation for StatefulServicePartitionInfo. +func (sspi StatefulServicePartitionInfo) AsServicePartitionInfo() (*ServicePartitionInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServicePartitionInfo is the BasicServicePartitionInfo implementation for StatefulServicePartitionInfo. +func (sspi StatefulServicePartitionInfo) AsBasicServicePartitionInfo() (BasicServicePartitionInfo, bool) { + return &sspi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for StatefulServicePartitionInfo struct. +func (sspi *StatefulServicePartitionInfo) 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 "TargetReplicaSetSize": + if v != nil { + var targetReplicaSetSize int64 + err = json.Unmarshal(*v, &targetReplicaSetSize) + if err != nil { + return err + } + sspi.TargetReplicaSetSize = &targetReplicaSetSize + } + case "MinReplicaSetSize": + if v != nil { + var minReplicaSetSize int64 + err = json.Unmarshal(*v, &minReplicaSetSize) + if err != nil { + return err + } + sspi.MinReplicaSetSize = &minReplicaSetSize + } + case "LastQuorumLossDuration": + if v != nil { + var lastQuorumLossDuration string + err = json.Unmarshal(*v, &lastQuorumLossDuration) + if err != nil { + return err + } + sspi.LastQuorumLossDuration = &lastQuorumLossDuration + } + case "CurrentConfigurationEpoch": + if v != nil { + var currentConfigurationEpoch Epoch + err = json.Unmarshal(*v, ¤tConfigurationEpoch) + if err != nil { + return err + } + sspi.CurrentConfigurationEpoch = ¤tConfigurationEpoch + } + case "HealthState": + if v != nil { + var healthState HealthState5 + err = json.Unmarshal(*v, &healthState) + if err != nil { + return err + } + sspi.HealthState = healthState + } + case "PartitionStatus": + if v != nil { + var partitionStatus PartitionStatus + err = json.Unmarshal(*v, &partitionStatus) + if err != nil { + return err + } + sspi.PartitionStatus = partitionStatus + } + case "PartitionInformation": + if v != nil { + partitionInformation, err := unmarshalBasicPartitionInformation(*v) + if err != nil { + return err + } + sspi.PartitionInformation = partitionInformation + } + case "ServiceKind": + if v != nil { + var serviceKind ServiceKindBasicServicePartitionInfo + err = json.Unmarshal(*v, &serviceKind) + if err != nil { + return err + } + sspi.ServiceKind = serviceKind + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatefulServiceReplicaHealth represents the health of the stateful service replica. +// Contains the replica aggregated health state, the health events and the unhealthy evaluations. +type StatefulServiceReplicaHealth struct { + // ReplicaID - Id of the stateful service replica. + ReplicaID *string `json:"ReplicaId,omitempty"` + // PartitionID - Id of the partition to which this replica belongs. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicReplicaHealthServiceKindReplicaHealth', 'ServiceKindBasicReplicaHealthServiceKindStateful', 'ServiceKindBasicReplicaHealthServiceKindStateless' + ServiceKind ServiceKindBasicReplicaHealth `json:"ServiceKind,omitempty"` + // AggregatedHealthState - The HealthState representing the aggregated health state of the entity computed by Health Manager. + // The health evaluation of the entity reflects all events reported on the entity and its children (if any). + // The aggregation is done by applying the desired health policy. + // . Possible values include: 'AggregatedHealthState1Invalid', 'AggregatedHealthState1Ok', 'AggregatedHealthState1Warning', 'AggregatedHealthState1Error', 'AggregatedHealthState1Unknown' + AggregatedHealthState AggregatedHealthState1 `json:"AggregatedHealthState,omitempty"` + // HealthEvents - The list of health events reported on the entity. + HealthEvents *[]HealthEvent `json:"HealthEvents,omitempty"` + // UnhealthyEvaluations - The unhealthy evaluations that show why the current aggregated health state was returned by Health Manager. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatefulServiceReplicaHealth. +func (ssrh StatefulServiceReplicaHealth) MarshalJSON() ([]byte, error) { + ssrh.ServiceKind = ServiceKindBasicReplicaHealthServiceKindStateful + objectMap := make(map[string]interface{}) + if ssrh.ReplicaID != nil { + objectMap["ReplicaId"] = ssrh.ReplicaID + } + if ssrh.PartitionID != nil { + objectMap["PartitionId"] = ssrh.PartitionID + } + if ssrh.ServiceKind != "" { + objectMap["ServiceKind"] = ssrh.ServiceKind + } + if ssrh.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = ssrh.AggregatedHealthState + } + if ssrh.HealthEvents != nil { + objectMap["HealthEvents"] = ssrh.HealthEvents + } + if ssrh.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = ssrh.UnhealthyEvaluations + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceReplicaHealth is the BasicReplicaHealth implementation for StatefulServiceReplicaHealth. +func (ssrh StatefulServiceReplicaHealth) AsStatefulServiceReplicaHealth() (*StatefulServiceReplicaHealth, bool) { + return &ssrh, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceInstanceHealth is the BasicReplicaHealth implementation for StatefulServiceReplicaHealth. +func (ssrh StatefulServiceReplicaHealth) AsStatelessServiceInstanceHealth() (*StatelessServiceInstanceHealth, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealth is the BasicReplicaHealth implementation for StatefulServiceReplicaHealth. +func (ssrh StatefulServiceReplicaHealth) AsReplicaHealth() (*ReplicaHealth, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicaHealth is the BasicReplicaHealth implementation for StatefulServiceReplicaHealth. +func (ssrh StatefulServiceReplicaHealth) AsBasicReplicaHealth() (BasicReplicaHealth, bool) { + return &ssrh, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatefulServiceReplicaHealthState represents the health state of the stateful service replica, which contains +// the replica id and the aggregated health state. +type StatefulServiceReplicaHealthState struct { + // ReplicaID - The ID of the stateful service replica. + ReplicaID *string `json:"ReplicaId,omitempty"` + // PartitionID - The ID of the partition to which this replica belongs. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicReplicaHealthStateServiceKindReplicaHealthState', 'ServiceKindBasicReplicaHealthStateServiceKindStateful', 'ServiceKindBasicReplicaHealthStateServiceKindStateless' + ServiceKind ServiceKindBasicReplicaHealthState `json:"ServiceKind,omitempty"` + // AggregatedHealthState - Possible values include: 'AggregatedHealthState2Invalid', 'AggregatedHealthState2Ok', 'AggregatedHealthState2Warning', 'AggregatedHealthState2Error', 'AggregatedHealthState2Unknown' + AggregatedHealthState AggregatedHealthState2 `json:"AggregatedHealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatefulServiceReplicaHealthState. +func (ssrhs StatefulServiceReplicaHealthState) MarshalJSON() ([]byte, error) { + ssrhs.ServiceKind = ServiceKindBasicReplicaHealthStateServiceKindStateful + objectMap := make(map[string]interface{}) + if ssrhs.ReplicaID != nil { + objectMap["ReplicaId"] = ssrhs.ReplicaID + } + if ssrhs.PartitionID != nil { + objectMap["PartitionId"] = ssrhs.PartitionID + } + if ssrhs.ServiceKind != "" { + objectMap["ServiceKind"] = ssrhs.ServiceKind + } + if ssrhs.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = ssrhs.AggregatedHealthState + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceReplicaHealthState is the BasicReplicaHealthState implementation for StatefulServiceReplicaHealthState. +func (ssrhs StatefulServiceReplicaHealthState) AsStatefulServiceReplicaHealthState() (*StatefulServiceReplicaHealthState, bool) { + return &ssrhs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceInstanceHealthState is the BasicReplicaHealthState implementation for StatefulServiceReplicaHealthState. +func (ssrhs StatefulServiceReplicaHealthState) AsStatelessServiceInstanceHealthState() (*StatelessServiceInstanceHealthState, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthState is the BasicReplicaHealthState implementation for StatefulServiceReplicaHealthState. +func (ssrhs StatefulServiceReplicaHealthState) AsReplicaHealthState() (*ReplicaHealthState, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicaHealthState is the BasicReplicaHealthState implementation for StatefulServiceReplicaHealthState. +func (ssrhs StatefulServiceReplicaHealthState) AsBasicReplicaHealthState() (BasicReplicaHealthState, bool) { + return &ssrhs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatefulServiceReplicaInfo represents a stateful service replica. This includes information about the identity, +// role, status, health, node name, uptime, and other details about the replica. +type StatefulServiceReplicaInfo struct { + // ReplicaRole - Possible values include: 'ReplicaRole1Unknown', 'ReplicaRole1None', 'ReplicaRole1Primary', 'ReplicaRole1IdleSecondary', 'ReplicaRole1ActiveSecondary' + ReplicaRole ReplicaRole1 `json:"ReplicaRole,omitempty"` + ReplicaID *string `json:"ReplicaId,omitempty"` + // ReplicaStatus - Possible values include: 'ReplicaStatus1Invalid', 'ReplicaStatus1InBuild', 'ReplicaStatus1Standby', 'ReplicaStatus1Ready', 'ReplicaStatus1Down', 'ReplicaStatus1Dropped' + ReplicaStatus ReplicaStatus1 `json:"ReplicaStatus,omitempty"` + // HealthState - Possible values include: 'HealthState6Invalid', 'HealthState6Ok', 'HealthState6Warning', 'HealthState6Error', 'HealthState6Unknown' + HealthState HealthState6 `json:"HealthState,omitempty"` + // NodeName - The name of the node. + NodeName *string `json:"NodeName,omitempty"` + // Address - The address the replica is listening on. + Address *string `json:"Address,omitempty"` + // LastInBuildDurationInSeconds - The last in build duration of the replica in seconds. + LastInBuildDurationInSeconds *string `json:"LastInBuildDurationInSeconds,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicReplicaInfoServiceKindReplicaInfo', 'ServiceKindBasicReplicaInfoServiceKindStateful', 'ServiceKindBasicReplicaInfoServiceKindStateless' + ServiceKind ServiceKindBasicReplicaInfo `json:"ServiceKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatefulServiceReplicaInfo. +func (ssri StatefulServiceReplicaInfo) MarshalJSON() ([]byte, error) { + ssri.ServiceKind = ServiceKindBasicReplicaInfoServiceKindStateful + objectMap := make(map[string]interface{}) + if ssri.ReplicaRole != "" { + objectMap["ReplicaRole"] = ssri.ReplicaRole + } + if ssri.ReplicaID != nil { + objectMap["ReplicaId"] = ssri.ReplicaID + } + if ssri.ReplicaStatus != "" { + objectMap["ReplicaStatus"] = ssri.ReplicaStatus + } + if ssri.HealthState != "" { + objectMap["HealthState"] = ssri.HealthState + } + if ssri.NodeName != nil { + objectMap["NodeName"] = ssri.NodeName + } + if ssri.Address != nil { + objectMap["Address"] = ssri.Address + } + if ssri.LastInBuildDurationInSeconds != nil { + objectMap["LastInBuildDurationInSeconds"] = ssri.LastInBuildDurationInSeconds + } + if ssri.ServiceKind != "" { + objectMap["ServiceKind"] = ssri.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceReplicaInfo is the BasicReplicaInfo implementation for StatefulServiceReplicaInfo. +func (ssri StatefulServiceReplicaInfo) AsStatefulServiceReplicaInfo() (*StatefulServiceReplicaInfo, bool) { + return &ssri, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceInstanceInfo is the BasicReplicaInfo implementation for StatefulServiceReplicaInfo. +func (ssri StatefulServiceReplicaInfo) AsStatelessServiceInstanceInfo() (*StatelessServiceInstanceInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaInfo is the BasicReplicaInfo implementation for StatefulServiceReplicaInfo. +func (ssri StatefulServiceReplicaInfo) AsReplicaInfo() (*ReplicaInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicaInfo is the BasicReplicaInfo implementation for StatefulServiceReplicaInfo. +func (ssri StatefulServiceReplicaInfo) AsBasicReplicaInfo() (BasicReplicaInfo, bool) { + return &ssri, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatefulServiceTypeDescription describes a stateful service type defined in the service manifest of a +// provisioned application type. +type StatefulServiceTypeDescription struct { + // HasPersistedState - A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. + HasPersistedState *bool `json:"HasPersistedState,omitempty"` + // IsStateful - Indicates whether the service type is a stateful service type or a stateless service type. This property is true if the service type is a stateful service type, false otherwise. + IsStateful *bool `json:"IsStateful,omitempty"` + // ServiceTypeName - Name of the service type. + ServiceTypeName *string `json:"ServiceTypeName,omitempty"` + // PlacementConstraints - The placement constraint to be used when instantiating this service in a Service Fabric cluster. + PlacementConstraints *string `json:"PlacementConstraints,omitempty"` + ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"ServicePlacementPolicies,omitempty"` + Extensions *[]ServiceTypeExtensionDescription `json:"Extensions,omitempty"` + // Kind - Possible values include: 'KindServiceTypeDescription', 'KindStateful', 'KindStateless1' + Kind KindBasicServiceTypeDescription `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatefulServiceTypeDescription. +func (sstd StatefulServiceTypeDescription) MarshalJSON() ([]byte, error) { + sstd.Kind = KindStateful + objectMap := make(map[string]interface{}) + if sstd.HasPersistedState != nil { + objectMap["HasPersistedState"] = sstd.HasPersistedState + } + if sstd.IsStateful != nil { + objectMap["IsStateful"] = sstd.IsStateful + } + if sstd.ServiceTypeName != nil { + objectMap["ServiceTypeName"] = sstd.ServiceTypeName + } + if sstd.PlacementConstraints != nil { + objectMap["PlacementConstraints"] = sstd.PlacementConstraints + } + if sstd.ServicePlacementPolicies != nil { + objectMap["ServicePlacementPolicies"] = sstd.ServicePlacementPolicies + } + if sstd.Extensions != nil { + objectMap["Extensions"] = sstd.Extensions + } + if sstd.Kind != "" { + objectMap["Kind"] = sstd.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceTypeDescription is the BasicServiceTypeDescription implementation for StatefulServiceTypeDescription. +func (sstd StatefulServiceTypeDescription) AsStatefulServiceTypeDescription() (*StatefulServiceTypeDescription, bool) { + return &sstd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceTypeDescription is the BasicServiceTypeDescription implementation for StatefulServiceTypeDescription. +func (sstd StatefulServiceTypeDescription) AsStatelessServiceTypeDescription() (*StatelessServiceTypeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceTypeDescription is the BasicServiceTypeDescription implementation for StatefulServiceTypeDescription. +func (sstd StatefulServiceTypeDescription) AsServiceTypeDescription() (*ServiceTypeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServiceTypeDescription is the BasicServiceTypeDescription implementation for StatefulServiceTypeDescription. +func (sstd StatefulServiceTypeDescription) AsBasicServiceTypeDescription() (BasicServiceTypeDescription, bool) { + return &sstd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for StatefulServiceTypeDescription struct. +func (sstd *StatefulServiceTypeDescription) 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 "HasPersistedState": + if v != nil { + var hasPersistedState bool + err = json.Unmarshal(*v, &hasPersistedState) + if err != nil { + return err + } + sstd.HasPersistedState = &hasPersistedState + } + case "IsStateful": + if v != nil { + var isStateful bool + err = json.Unmarshal(*v, &isStateful) + if err != nil { + return err + } + sstd.IsStateful = &isStateful + } + case "ServiceTypeName": + if v != nil { + var serviceTypeName string + err = json.Unmarshal(*v, &serviceTypeName) + if err != nil { + return err + } + sstd.ServiceTypeName = &serviceTypeName + } + case "PlacementConstraints": + if v != nil { + var placementConstraints string + err = json.Unmarshal(*v, &placementConstraints) + if err != nil { + return err + } + sstd.PlacementConstraints = &placementConstraints + } + case "ServicePlacementPolicies": + if v != nil { + servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) + if err != nil { + return err + } + sstd.ServicePlacementPolicies = &servicePlacementPolicies + } + case "Extensions": + if v != nil { + var extensions []ServiceTypeExtensionDescription + err = json.Unmarshal(*v, &extensions) + if err != nil { + return err + } + sstd.Extensions = &extensions + } + case "Kind": + if v != nil { + var kind KindBasicServiceTypeDescription + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sstd.Kind = kind + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatefulServiceUpdateDescription describes an update for a stateful service. +type StatefulServiceUpdateDescription struct { + // TargetReplicaSetSize - The target replica set size as a number. + TargetReplicaSetSize *int32 `json:"TargetReplicaSetSize,omitempty"` + // MinReplicaSetSize - The minimum replica set size as a number. + MinReplicaSetSize *int32 `json:"MinReplicaSetSize,omitempty"` + // ReplicaRestartWaitDurationSeconds - The duration, in seconds, between when a replica goes down and when a new replica is created. + ReplicaRestartWaitDurationSeconds *string `json:"ReplicaRestartWaitDurationSeconds,omitempty"` + // QuorumLossWaitDurationSeconds - The maximum duration, in seconds, for which a partition is allowed to be in a state of quorum loss. + QuorumLossWaitDurationSeconds *string `json:"QuorumLossWaitDurationSeconds,omitempty"` + // StandByReplicaKeepDurationSeconds - The definition on how long StandBy replicas should be maintained before being removed. + StandByReplicaKeepDurationSeconds *string `json:"StandByReplicaKeepDurationSeconds,omitempty"` + // Flags - Flags indicating whether other properties are set. Each of the associated properties corresponds to a flag, specified below, which, if set, indicate that the property is specified. + // This property can be a combination of those flags obtained using bitwise 'OR' operator. + // For example, if the provided value is 6 then the flags for ReplicaRestartWaitDuration (2) and QuorumLossWaitDuration (4) are set. + // - None - Does not indicate any other properties are set. The value is zero. + // - TargetReplicaSetSize/InstanceCount - Indicates whether the TargetReplicaSetSize property (for Stateful services) or the InstanceCount property (for Stateless services) is set. The value is 1. + // - ReplicaRestartWaitDuration - Indicates the ReplicaRestartWaitDuration property is set. The value is 2. + // - QuorumLossWaitDuration - Indicates the QuorumLossWaitDuration property is set. The value is 4. + // - StandByReplicaKeepDuration - Indicates the StandByReplicaKeepDuration property is set. The value is 8. + // - MinReplicaSetSize - Indicates the MinReplicaSetSize property is set. The value is 16. + // - PlacementConstraints - Indicates the PlacementConstraints property is set. The value is 32. + // - PlacementPolicyList - Indicates the ServicePlacementPolicies property is set. The value is 64. + // - Correlation - Indicates the CorrelationScheme property is set. The value is 128. + // - Metrics - Indicates the ServiceLoadMetrics property is set. The value is 256. + // - DefaultMoveCost - Indicates the DefaultMoveCost property is set. The value is 512. + Flags *string `json:"Flags,omitempty"` + // PlacementConstraints - The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + PlacementConstraints *string `json:"PlacementConstraints,omitempty"` + // CorrelationScheme - The correlation scheme. + CorrelationScheme *[]ServiceCorrelationDescription `json:"CorrelationScheme,omitempty"` + // LoadMetrics - The service load metrics. + LoadMetrics *[]ServiceLoadMetricDescription `json:"LoadMetrics,omitempty"` + // ServicePlacementPolicies - The service placement policies. + ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"ServicePlacementPolicies,omitempty"` + // DefaultMoveCost - The move cost for the service. Possible values include: 'DefaultMoveCost1Zero', 'DefaultMoveCost1Low', 'DefaultMoveCost1Medium', 'DefaultMoveCost1High' + DefaultMoveCost DefaultMoveCost1 `json:"DefaultMoveCost,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicServiceUpdateDescriptionServiceKindServiceUpdateDescription', 'ServiceKindBasicServiceUpdateDescriptionServiceKindStateful', 'ServiceKindBasicServiceUpdateDescriptionServiceKindStateless' + ServiceKind ServiceKindBasicServiceUpdateDescription `json:"ServiceKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatefulServiceUpdateDescription. +func (ssud StatefulServiceUpdateDescription) MarshalJSON() ([]byte, error) { + ssud.ServiceKind = ServiceKindBasicServiceUpdateDescriptionServiceKindStateful + objectMap := make(map[string]interface{}) + if ssud.TargetReplicaSetSize != nil { + objectMap["TargetReplicaSetSize"] = ssud.TargetReplicaSetSize + } + if ssud.MinReplicaSetSize != nil { + objectMap["MinReplicaSetSize"] = ssud.MinReplicaSetSize + } + if ssud.ReplicaRestartWaitDurationSeconds != nil { + objectMap["ReplicaRestartWaitDurationSeconds"] = ssud.ReplicaRestartWaitDurationSeconds + } + if ssud.QuorumLossWaitDurationSeconds != nil { + objectMap["QuorumLossWaitDurationSeconds"] = ssud.QuorumLossWaitDurationSeconds + } + if ssud.StandByReplicaKeepDurationSeconds != nil { + objectMap["StandByReplicaKeepDurationSeconds"] = ssud.StandByReplicaKeepDurationSeconds + } + if ssud.Flags != nil { + objectMap["Flags"] = ssud.Flags + } + if ssud.PlacementConstraints != nil { + objectMap["PlacementConstraints"] = ssud.PlacementConstraints + } + if ssud.CorrelationScheme != nil { + objectMap["CorrelationScheme"] = ssud.CorrelationScheme + } + if ssud.LoadMetrics != nil { + objectMap["LoadMetrics"] = ssud.LoadMetrics + } + if ssud.ServicePlacementPolicies != nil { + objectMap["ServicePlacementPolicies"] = ssud.ServicePlacementPolicies + } + if ssud.DefaultMoveCost != "" { + objectMap["DefaultMoveCost"] = ssud.DefaultMoveCost + } + if ssud.ServiceKind != "" { + objectMap["ServiceKind"] = ssud.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceUpdateDescription is the BasicServiceUpdateDescription implementation for StatefulServiceUpdateDescription. +func (ssud StatefulServiceUpdateDescription) AsStatefulServiceUpdateDescription() (*StatefulServiceUpdateDescription, bool) { + return &ssud, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceUpdateDescription is the BasicServiceUpdateDescription implementation for StatefulServiceUpdateDescription. +func (ssud StatefulServiceUpdateDescription) AsStatelessServiceUpdateDescription() (*StatelessServiceUpdateDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceUpdateDescription is the BasicServiceUpdateDescription implementation for StatefulServiceUpdateDescription. +func (ssud StatefulServiceUpdateDescription) AsServiceUpdateDescription() (*ServiceUpdateDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServiceUpdateDescription is the BasicServiceUpdateDescription implementation for StatefulServiceUpdateDescription. +func (ssud StatefulServiceUpdateDescription) AsBasicServiceUpdateDescription() (BasicServiceUpdateDescription, bool) { + return &ssud, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for StatefulServiceUpdateDescription struct. +func (ssud *StatefulServiceUpdateDescription) 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 "TargetReplicaSetSize": + if v != nil { + var targetReplicaSetSize int32 + err = json.Unmarshal(*v, &targetReplicaSetSize) + if err != nil { + return err + } + ssud.TargetReplicaSetSize = &targetReplicaSetSize + } + case "MinReplicaSetSize": + if v != nil { + var minReplicaSetSize int32 + err = json.Unmarshal(*v, &minReplicaSetSize) + if err != nil { + return err + } + ssud.MinReplicaSetSize = &minReplicaSetSize + } + case "ReplicaRestartWaitDurationSeconds": + if v != nil { + var replicaRestartWaitDurationSeconds string + err = json.Unmarshal(*v, &replicaRestartWaitDurationSeconds) + if err != nil { + return err + } + ssud.ReplicaRestartWaitDurationSeconds = &replicaRestartWaitDurationSeconds + } + case "QuorumLossWaitDurationSeconds": + if v != nil { + var quorumLossWaitDurationSeconds string + err = json.Unmarshal(*v, &quorumLossWaitDurationSeconds) + if err != nil { + return err + } + ssud.QuorumLossWaitDurationSeconds = &quorumLossWaitDurationSeconds + } + case "StandByReplicaKeepDurationSeconds": + if v != nil { + var standByReplicaKeepDurationSeconds string + err = json.Unmarshal(*v, &standByReplicaKeepDurationSeconds) + if err != nil { + return err + } + ssud.StandByReplicaKeepDurationSeconds = &standByReplicaKeepDurationSeconds + } + case "Flags": + if v != nil { + var flags string + err = json.Unmarshal(*v, &flags) + if err != nil { + return err + } + ssud.Flags = &flags + } + case "PlacementConstraints": + if v != nil { + var placementConstraints string + err = json.Unmarshal(*v, &placementConstraints) + if err != nil { + return err + } + ssud.PlacementConstraints = &placementConstraints + } + case "CorrelationScheme": + if v != nil { + var correlationScheme []ServiceCorrelationDescription + err = json.Unmarshal(*v, &correlationScheme) + if err != nil { + return err + } + ssud.CorrelationScheme = &correlationScheme + } + case "LoadMetrics": + if v != nil { + var loadMetrics []ServiceLoadMetricDescription + err = json.Unmarshal(*v, &loadMetrics) + if err != nil { + return err + } + ssud.LoadMetrics = &loadMetrics + } + case "ServicePlacementPolicies": + if v != nil { + servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) + if err != nil { + return err + } + ssud.ServicePlacementPolicies = &servicePlacementPolicies + } + case "DefaultMoveCost": + if v != nil { + var defaultMoveCost DefaultMoveCost1 + err = json.Unmarshal(*v, &defaultMoveCost) + if err != nil { + return err + } + ssud.DefaultMoveCost = defaultMoveCost + } + case "ServiceKind": + if v != nil { + var serviceKind ServiceKindBasicServiceUpdateDescription + err = json.Unmarshal(*v, &serviceKind) + if err != nil { + return err + } + ssud.ServiceKind = serviceKind + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatelessServiceDescription describes a stateless service. +type StatelessServiceDescription struct { + // InstanceCount - The instance count. + InstanceCount *int32 `json:"InstanceCount,omitempty"` + // ApplicationName - The application name. + ApplicationName *string `json:"ApplicationName,omitempty"` + // ServiceName - The service name. + ServiceName *string `json:"ServiceName,omitempty"` + // ServiceTypeName - The service type name. + ServiceTypeName *string `json:"ServiceTypeName,omitempty"` + // InitializationData - The initialization data as an array of bytes. Initialization data is passed to service instances or replicas when they are created. + InitializationData *[]int32 `json:"InitializationData,omitempty"` + // PartitionDescription - The partition description as an object. + PartitionDescription BasicPartitionSchemeDescription `json:"PartitionDescription,omitempty"` + // PlacementConstraints - The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + PlacementConstraints *string `json:"PlacementConstraints,omitempty"` + // CorrelationScheme - The correlation scheme. + CorrelationScheme *[]ServiceCorrelationDescription `json:"CorrelationScheme,omitempty"` + // ServiceLoadMetrics - The service load metrics. + ServiceLoadMetrics *[]ServiceLoadMetricDescription `json:"ServiceLoadMetrics,omitempty"` + // ServicePlacementPolicies - The service placement policies. + ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"ServicePlacementPolicies,omitempty"` + // DefaultMoveCost - The move cost for the service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + DefaultMoveCost DefaultMoveCost `json:"DefaultMoveCost,omitempty"` + // IsDefaultMoveCostSpecified - Indicates if the DefaultMoveCost property is specified. + IsDefaultMoveCostSpecified *bool `json:"IsDefaultMoveCostSpecified,omitempty"` + // ServicePackageActivationMode - The activation mode of service package to be used for a service. Possible values include: 'ServicePackageActivationMode1SharedProcess', 'ServicePackageActivationMode1ExclusiveProcess' + ServicePackageActivationMode ServicePackageActivationMode1 `json:"ServicePackageActivationMode,omitempty"` + // ServiceDNSName - The DNS name of the service. It requires the DNS system service to be enabled in Service Fabric cluster. + ServiceDNSName *string `json:"ServiceDnsName,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicServiceDescriptionServiceKindServiceDescription', 'ServiceKindBasicServiceDescriptionServiceKindStateful', 'ServiceKindBasicServiceDescriptionServiceKindStateless' + ServiceKind ServiceKindBasicServiceDescription `json:"ServiceKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatelessServiceDescription. +func (ssd StatelessServiceDescription) MarshalJSON() ([]byte, error) { + ssd.ServiceKind = ServiceKindBasicServiceDescriptionServiceKindStateless + objectMap := make(map[string]interface{}) + if ssd.InstanceCount != nil { + objectMap["InstanceCount"] = ssd.InstanceCount + } + if ssd.ApplicationName != nil { + objectMap["ApplicationName"] = ssd.ApplicationName + } + if ssd.ServiceName != nil { + objectMap["ServiceName"] = ssd.ServiceName + } + if ssd.ServiceTypeName != nil { + objectMap["ServiceTypeName"] = ssd.ServiceTypeName + } + if ssd.InitializationData != nil { + objectMap["InitializationData"] = ssd.InitializationData + } + objectMap["PartitionDescription"] = ssd.PartitionDescription + if ssd.PlacementConstraints != nil { + objectMap["PlacementConstraints"] = ssd.PlacementConstraints + } + if ssd.CorrelationScheme != nil { + objectMap["CorrelationScheme"] = ssd.CorrelationScheme + } + if ssd.ServiceLoadMetrics != nil { + objectMap["ServiceLoadMetrics"] = ssd.ServiceLoadMetrics + } + if ssd.ServicePlacementPolicies != nil { + objectMap["ServicePlacementPolicies"] = ssd.ServicePlacementPolicies + } + if ssd.DefaultMoveCost != "" { + objectMap["DefaultMoveCost"] = ssd.DefaultMoveCost + } + if ssd.IsDefaultMoveCostSpecified != nil { + objectMap["IsDefaultMoveCostSpecified"] = ssd.IsDefaultMoveCostSpecified + } + if ssd.ServicePackageActivationMode != "" { + objectMap["ServicePackageActivationMode"] = ssd.ServicePackageActivationMode + } + if ssd.ServiceDNSName != nil { + objectMap["ServiceDnsName"] = ssd.ServiceDNSName + } + if ssd.ServiceKind != "" { + objectMap["ServiceKind"] = ssd.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceDescription is the BasicServiceDescription implementation for StatelessServiceDescription. +func (ssd StatelessServiceDescription) AsStatefulServiceDescription() (*StatefulServiceDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceDescription is the BasicServiceDescription implementation for StatelessServiceDescription. +func (ssd StatelessServiceDescription) AsStatelessServiceDescription() (*StatelessServiceDescription, bool) { + return &ssd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceDescription is the BasicServiceDescription implementation for StatelessServiceDescription. +func (ssd StatelessServiceDescription) AsServiceDescription() (*ServiceDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServiceDescription is the BasicServiceDescription implementation for StatelessServiceDescription. +func (ssd StatelessServiceDescription) AsBasicServiceDescription() (BasicServiceDescription, bool) { + return &ssd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for StatelessServiceDescription struct. +func (ssd *StatelessServiceDescription) 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 "InstanceCount": + if v != nil { + var instanceCount int32 + err = json.Unmarshal(*v, &instanceCount) + if err != nil { + return err + } + ssd.InstanceCount = &instanceCount + } + case "ApplicationName": + if v != nil { + var applicationName string + err = json.Unmarshal(*v, &applicationName) + if err != nil { + return err + } + ssd.ApplicationName = &applicationName + } + case "ServiceName": + if v != nil { + var serviceName string + err = json.Unmarshal(*v, &serviceName) + if err != nil { + return err + } + ssd.ServiceName = &serviceName + } + case "ServiceTypeName": + if v != nil { + var serviceTypeName string + err = json.Unmarshal(*v, &serviceTypeName) + if err != nil { + return err + } + ssd.ServiceTypeName = &serviceTypeName + } + case "InitializationData": + if v != nil { + var initializationData []int32 + err = json.Unmarshal(*v, &initializationData) + if err != nil { + return err + } + ssd.InitializationData = &initializationData + } + case "PartitionDescription": + if v != nil { + partitionDescription, err := unmarshalBasicPartitionSchemeDescription(*v) + if err != nil { + return err + } + ssd.PartitionDescription = partitionDescription + } + case "PlacementConstraints": + if v != nil { + var placementConstraints string + err = json.Unmarshal(*v, &placementConstraints) + if err != nil { + return err + } + ssd.PlacementConstraints = &placementConstraints + } + case "CorrelationScheme": + if v != nil { + var correlationScheme []ServiceCorrelationDescription + err = json.Unmarshal(*v, &correlationScheme) + if err != nil { + return err + } + ssd.CorrelationScheme = &correlationScheme + } + case "ServiceLoadMetrics": + if v != nil { + var serviceLoadMetrics []ServiceLoadMetricDescription + err = json.Unmarshal(*v, &serviceLoadMetrics) + if err != nil { + return err + } + ssd.ServiceLoadMetrics = &serviceLoadMetrics + } + case "ServicePlacementPolicies": + if v != nil { + servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) + if err != nil { + return err + } + ssd.ServicePlacementPolicies = &servicePlacementPolicies + } + case "DefaultMoveCost": + if v != nil { + var defaultMoveCost DefaultMoveCost + err = json.Unmarshal(*v, &defaultMoveCost) + if err != nil { + return err + } + ssd.DefaultMoveCost = defaultMoveCost + } + case "IsDefaultMoveCostSpecified": + if v != nil { + var isDefaultMoveCostSpecified bool + err = json.Unmarshal(*v, &isDefaultMoveCostSpecified) + if err != nil { + return err + } + ssd.IsDefaultMoveCostSpecified = &isDefaultMoveCostSpecified + } + case "ServicePackageActivationMode": + if v != nil { + var servicePackageActivationMode ServicePackageActivationMode1 + err = json.Unmarshal(*v, &servicePackageActivationMode) + if err != nil { + return err + } + ssd.ServicePackageActivationMode = servicePackageActivationMode + } + case "ServiceDnsName": + if v != nil { + var serviceDNSName string + err = json.Unmarshal(*v, &serviceDNSName) + if err != nil { + return err + } + ssd.ServiceDNSName = &serviceDNSName + } + case "ServiceKind": + if v != nil { + var serviceKind ServiceKindBasicServiceDescription + err = json.Unmarshal(*v, &serviceKind) + if err != nil { + return err + } + ssd.ServiceKind = serviceKind + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatelessServiceInfo information about a stateless Service Fabric service. +type StatelessServiceInfo struct { + ID *string `json:"Id,omitempty"` + // Name - Full hierarchical name of the service in URI format starting with `fabric:`. + Name *string `json:"Name,omitempty"` + // TypeName - The name of the service type as specified in the service manifest. + TypeName *string `json:"TypeName,omitempty"` + // ManifestVersion - The version of the service manifest. + ManifestVersion *string `json:"ManifestVersion,omitempty"` + // HealthState - Possible values include: 'HealthState7Invalid', 'HealthState7Ok', 'HealthState7Warning', 'HealthState7Error', 'HealthState7Unknown' + HealthState HealthState7 `json:"HealthState,omitempty"` + // ServiceStatus - Possible values include: 'ServiceStatusUnknown', 'ServiceStatusActive', 'ServiceStatusUpgrading', 'ServiceStatusDeleting', 'ServiceStatusCreating', 'ServiceStatusFailed' + ServiceStatus ServiceStatus `json:"ServiceStatus,omitempty"` + // IsServiceGroup - Whether the service is in a service group. + IsServiceGroup *bool `json:"IsServiceGroup,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicServiceInfoServiceKindServiceInfo', 'ServiceKindBasicServiceInfoServiceKindStateful', 'ServiceKindBasicServiceInfoServiceKindStateless' + ServiceKind ServiceKindBasicServiceInfo `json:"ServiceKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatelessServiceInfo. +func (ssi StatelessServiceInfo) MarshalJSON() ([]byte, error) { + ssi.ServiceKind = ServiceKindBasicServiceInfoServiceKindStateless + objectMap := make(map[string]interface{}) + if ssi.ID != nil { + objectMap["Id"] = ssi.ID + } + if ssi.Name != nil { + objectMap["Name"] = ssi.Name + } + if ssi.TypeName != nil { + objectMap["TypeName"] = ssi.TypeName + } + if ssi.ManifestVersion != nil { + objectMap["ManifestVersion"] = ssi.ManifestVersion + } + if ssi.HealthState != "" { + objectMap["HealthState"] = ssi.HealthState + } + if ssi.ServiceStatus != "" { + objectMap["ServiceStatus"] = ssi.ServiceStatus + } + if ssi.IsServiceGroup != nil { + objectMap["IsServiceGroup"] = ssi.IsServiceGroup + } + if ssi.ServiceKind != "" { + objectMap["ServiceKind"] = ssi.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceInfo is the BasicServiceInfo implementation for StatelessServiceInfo. +func (ssi StatelessServiceInfo) AsStatefulServiceInfo() (*StatefulServiceInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceInfo is the BasicServiceInfo implementation for StatelessServiceInfo. +func (ssi StatelessServiceInfo) AsStatelessServiceInfo() (*StatelessServiceInfo, bool) { + return &ssi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceInfo is the BasicServiceInfo implementation for StatelessServiceInfo. +func (ssi StatelessServiceInfo) AsServiceInfo() (*ServiceInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServiceInfo is the BasicServiceInfo implementation for StatelessServiceInfo. +func (ssi StatelessServiceInfo) AsBasicServiceInfo() (BasicServiceInfo, bool) { + return &ssi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatelessServiceInstanceHealth represents the health of the statelss service instance. +// Contains the instance aggregated health state, the health events and the unhealthy evaluations. +type StatelessServiceInstanceHealth struct { + // InstanceID - Id of the stateless service instance. + InstanceID *string `json:"InstanceId,omitempty"` + // PartitionID - Id of the partition to which this replica belongs. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicReplicaHealthServiceKindReplicaHealth', 'ServiceKindBasicReplicaHealthServiceKindStateful', 'ServiceKindBasicReplicaHealthServiceKindStateless' + ServiceKind ServiceKindBasicReplicaHealth `json:"ServiceKind,omitempty"` + // AggregatedHealthState - The HealthState representing the aggregated health state of the entity computed by Health Manager. + // The health evaluation of the entity reflects all events reported on the entity and its children (if any). + // The aggregation is done by applying the desired health policy. + // . Possible values include: 'AggregatedHealthState1Invalid', 'AggregatedHealthState1Ok', 'AggregatedHealthState1Warning', 'AggregatedHealthState1Error', 'AggregatedHealthState1Unknown' + AggregatedHealthState AggregatedHealthState1 `json:"AggregatedHealthState,omitempty"` + // HealthEvents - The list of health events reported on the entity. + HealthEvents *[]HealthEvent `json:"HealthEvents,omitempty"` + // UnhealthyEvaluations - The unhealthy evaluations that show why the current aggregated health state was returned by Health Manager. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatelessServiceInstanceHealth. +func (ssih StatelessServiceInstanceHealth) MarshalJSON() ([]byte, error) { + ssih.ServiceKind = ServiceKindBasicReplicaHealthServiceKindStateless + objectMap := make(map[string]interface{}) + if ssih.InstanceID != nil { + objectMap["InstanceId"] = ssih.InstanceID + } + if ssih.PartitionID != nil { + objectMap["PartitionId"] = ssih.PartitionID + } + if ssih.ServiceKind != "" { + objectMap["ServiceKind"] = ssih.ServiceKind + } + if ssih.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = ssih.AggregatedHealthState + } + if ssih.HealthEvents != nil { + objectMap["HealthEvents"] = ssih.HealthEvents + } + if ssih.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = ssih.UnhealthyEvaluations + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceReplicaHealth is the BasicReplicaHealth implementation for StatelessServiceInstanceHealth. +func (ssih StatelessServiceInstanceHealth) AsStatefulServiceReplicaHealth() (*StatefulServiceReplicaHealth, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceInstanceHealth is the BasicReplicaHealth implementation for StatelessServiceInstanceHealth. +func (ssih StatelessServiceInstanceHealth) AsStatelessServiceInstanceHealth() (*StatelessServiceInstanceHealth, bool) { + return &ssih, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealth is the BasicReplicaHealth implementation for StatelessServiceInstanceHealth. +func (ssih StatelessServiceInstanceHealth) AsReplicaHealth() (*ReplicaHealth, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicaHealth is the BasicReplicaHealth implementation for StatelessServiceInstanceHealth. +func (ssih StatelessServiceInstanceHealth) AsBasicReplicaHealth() (BasicReplicaHealth, bool) { + return &ssih, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatelessServiceInstanceHealthState represents the health state of the stateless service instance, which +// contains the instance id and the aggregated health state. +type StatelessServiceInstanceHealthState struct { + // ReplicaID - Id of the stateless service instance on the wire this field is called ReplicaId. + ReplicaID *string `json:"ReplicaId,omitempty"` + // PartitionID - The ID of the partition to which this replica belongs. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicReplicaHealthStateServiceKindReplicaHealthState', 'ServiceKindBasicReplicaHealthStateServiceKindStateful', 'ServiceKindBasicReplicaHealthStateServiceKindStateless' + ServiceKind ServiceKindBasicReplicaHealthState `json:"ServiceKind,omitempty"` + // AggregatedHealthState - Possible values include: 'AggregatedHealthState2Invalid', 'AggregatedHealthState2Ok', 'AggregatedHealthState2Warning', 'AggregatedHealthState2Error', 'AggregatedHealthState2Unknown' + AggregatedHealthState AggregatedHealthState2 `json:"AggregatedHealthState,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatelessServiceInstanceHealthState. +func (ssihs StatelessServiceInstanceHealthState) MarshalJSON() ([]byte, error) { + ssihs.ServiceKind = ServiceKindBasicReplicaHealthStateServiceKindStateless + objectMap := make(map[string]interface{}) + if ssihs.ReplicaID != nil { + objectMap["ReplicaId"] = ssihs.ReplicaID + } + if ssihs.PartitionID != nil { + objectMap["PartitionId"] = ssihs.PartitionID + } + if ssihs.ServiceKind != "" { + objectMap["ServiceKind"] = ssihs.ServiceKind + } + if ssihs.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = ssihs.AggregatedHealthState + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceReplicaHealthState is the BasicReplicaHealthState implementation for StatelessServiceInstanceHealthState. +func (ssihs StatelessServiceInstanceHealthState) AsStatefulServiceReplicaHealthState() (*StatefulServiceReplicaHealthState, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceInstanceHealthState is the BasicReplicaHealthState implementation for StatelessServiceInstanceHealthState. +func (ssihs StatelessServiceInstanceHealthState) AsStatelessServiceInstanceHealthState() (*StatelessServiceInstanceHealthState, bool) { + return &ssihs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthState is the BasicReplicaHealthState implementation for StatelessServiceInstanceHealthState. +func (ssihs StatelessServiceInstanceHealthState) AsReplicaHealthState() (*ReplicaHealthState, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicaHealthState is the BasicReplicaHealthState implementation for StatelessServiceInstanceHealthState. +func (ssihs StatelessServiceInstanceHealthState) AsBasicReplicaHealthState() (BasicReplicaHealthState, bool) { + return &ssihs, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatelessServiceInstanceInfo represents a stateless service instance. This includes information about the +// identity, status, health, node name, uptime, and other details about the instance. +type StatelessServiceInstanceInfo struct { + // InstanceID - Id of the stateless service instance. + InstanceID *string `json:"InstanceId,omitempty"` + // ReplicaStatus - Possible values include: 'ReplicaStatus1Invalid', 'ReplicaStatus1InBuild', 'ReplicaStatus1Standby', 'ReplicaStatus1Ready', 'ReplicaStatus1Down', 'ReplicaStatus1Dropped' + ReplicaStatus ReplicaStatus1 `json:"ReplicaStatus,omitempty"` + // HealthState - Possible values include: 'HealthState6Invalid', 'HealthState6Ok', 'HealthState6Warning', 'HealthState6Error', 'HealthState6Unknown' + HealthState HealthState6 `json:"HealthState,omitempty"` + // NodeName - The name of the node. + NodeName *string `json:"NodeName,omitempty"` + // Address - The address the replica is listening on. + Address *string `json:"Address,omitempty"` + // LastInBuildDurationInSeconds - The last in build duration of the replica in seconds. + LastInBuildDurationInSeconds *string `json:"LastInBuildDurationInSeconds,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicReplicaInfoServiceKindReplicaInfo', 'ServiceKindBasicReplicaInfoServiceKindStateful', 'ServiceKindBasicReplicaInfoServiceKindStateless' + ServiceKind ServiceKindBasicReplicaInfo `json:"ServiceKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatelessServiceInstanceInfo. +func (ssii StatelessServiceInstanceInfo) MarshalJSON() ([]byte, error) { + ssii.ServiceKind = ServiceKindBasicReplicaInfoServiceKindStateless + objectMap := make(map[string]interface{}) + if ssii.InstanceID != nil { + objectMap["InstanceId"] = ssii.InstanceID + } + if ssii.ReplicaStatus != "" { + objectMap["ReplicaStatus"] = ssii.ReplicaStatus + } + if ssii.HealthState != "" { + objectMap["HealthState"] = ssii.HealthState + } + if ssii.NodeName != nil { + objectMap["NodeName"] = ssii.NodeName + } + if ssii.Address != nil { + objectMap["Address"] = ssii.Address + } + if ssii.LastInBuildDurationInSeconds != nil { + objectMap["LastInBuildDurationInSeconds"] = ssii.LastInBuildDurationInSeconds + } + if ssii.ServiceKind != "" { + objectMap["ServiceKind"] = ssii.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceReplicaInfo is the BasicReplicaInfo implementation for StatelessServiceInstanceInfo. +func (ssii StatelessServiceInstanceInfo) AsStatefulServiceReplicaInfo() (*StatefulServiceReplicaInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceInstanceInfo is the BasicReplicaInfo implementation for StatelessServiceInstanceInfo. +func (ssii StatelessServiceInstanceInfo) AsStatelessServiceInstanceInfo() (*StatelessServiceInstanceInfo, bool) { + return &ssii, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaInfo is the BasicReplicaInfo implementation for StatelessServiceInstanceInfo. +func (ssii StatelessServiceInstanceInfo) AsReplicaInfo() (*ReplicaInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicReplicaInfo is the BasicReplicaInfo implementation for StatelessServiceInstanceInfo. +func (ssii StatelessServiceInstanceInfo) AsBasicReplicaInfo() (BasicReplicaInfo, bool) { + return &ssii, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatelessServicePartitionInfo information about a partition of a stateless Service Fabric service. +type StatelessServicePartitionInfo struct { + // InstanceCount - Number of instances of this partition. + InstanceCount *int64 `json:"InstanceCount,omitempty"` + // HealthState - Possible values include: 'HealthState5Invalid', 'HealthState5Ok', 'HealthState5Warning', 'HealthState5Error', 'HealthState5Unknown' + HealthState HealthState5 `json:"HealthState,omitempty"` + // PartitionStatus - Possible values include: 'PartitionStatusInvalid', 'PartitionStatusReady', 'PartitionStatusNotReady', 'PartitionStatusInQuorumLoss', 'PartitionStatusReconfiguring', 'PartitionStatusDeleting' + PartitionStatus PartitionStatus `json:"PartitionStatus,omitempty"` + PartitionInformation BasicPartitionInformation `json:"PartitionInformation,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicServicePartitionInfoServiceKindServicePartitionInfo', 'ServiceKindBasicServicePartitionInfoServiceKindStateful', 'ServiceKindBasicServicePartitionInfoServiceKindStateless' + ServiceKind ServiceKindBasicServicePartitionInfo `json:"ServiceKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatelessServicePartitionInfo. +func (sspi StatelessServicePartitionInfo) MarshalJSON() ([]byte, error) { + sspi.ServiceKind = ServiceKindBasicServicePartitionInfoServiceKindStateless + objectMap := make(map[string]interface{}) + if sspi.InstanceCount != nil { + objectMap["InstanceCount"] = sspi.InstanceCount + } + if sspi.HealthState != "" { + objectMap["HealthState"] = sspi.HealthState + } + if sspi.PartitionStatus != "" { + objectMap["PartitionStatus"] = sspi.PartitionStatus + } + objectMap["PartitionInformation"] = sspi.PartitionInformation + if sspi.ServiceKind != "" { + objectMap["ServiceKind"] = sspi.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServicePartitionInfo is the BasicServicePartitionInfo implementation for StatelessServicePartitionInfo. +func (sspi StatelessServicePartitionInfo) AsStatefulServicePartitionInfo() (*StatefulServicePartitionInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServicePartitionInfo is the BasicServicePartitionInfo implementation for StatelessServicePartitionInfo. +func (sspi StatelessServicePartitionInfo) AsStatelessServicePartitionInfo() (*StatelessServicePartitionInfo, bool) { + return &sspi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicePartitionInfo is the BasicServicePartitionInfo implementation for StatelessServicePartitionInfo. +func (sspi StatelessServicePartitionInfo) AsServicePartitionInfo() (*ServicePartitionInfo, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServicePartitionInfo is the BasicServicePartitionInfo implementation for StatelessServicePartitionInfo. +func (sspi StatelessServicePartitionInfo) AsBasicServicePartitionInfo() (BasicServicePartitionInfo, bool) { + return &sspi, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for StatelessServicePartitionInfo struct. +func (sspi *StatelessServicePartitionInfo) 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 "InstanceCount": + if v != nil { + var instanceCount int64 + err = json.Unmarshal(*v, &instanceCount) + if err != nil { + return err + } + sspi.InstanceCount = &instanceCount + } + case "HealthState": + if v != nil { + var healthState HealthState5 + err = json.Unmarshal(*v, &healthState) + if err != nil { + return err + } + sspi.HealthState = healthState + } + case "PartitionStatus": + if v != nil { + var partitionStatus PartitionStatus + err = json.Unmarshal(*v, &partitionStatus) + if err != nil { + return err + } + sspi.PartitionStatus = partitionStatus + } + case "PartitionInformation": + if v != nil { + partitionInformation, err := unmarshalBasicPartitionInformation(*v) + if err != nil { + return err + } + sspi.PartitionInformation = partitionInformation + } + case "ServiceKind": + if v != nil { + var serviceKind ServiceKindBasicServicePartitionInfo + err = json.Unmarshal(*v, &serviceKind) + if err != nil { + return err + } + sspi.ServiceKind = serviceKind + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatelessServiceTypeDescription describes a stateless service type defined in the service manifest of a +// provisioned application type. +type StatelessServiceTypeDescription struct { + // UseImplicitHost - A flag indicating if this type is not implemented and hosted by a user service process, but is implicitly hosted by a system created process. This value is true for services using the guest executable services, false otherwise. + UseImplicitHost *bool `json:"UseImplicitHost,omitempty"` + // IsStateful - Indicates whether the service type is a stateful service type or a stateless service type. This property is true if the service type is a stateful service type, false otherwise. + IsStateful *bool `json:"IsStateful,omitempty"` + // ServiceTypeName - Name of the service type. + ServiceTypeName *string `json:"ServiceTypeName,omitempty"` + // PlacementConstraints - The placement constraint to be used when instantiating this service in a Service Fabric cluster. + PlacementConstraints *string `json:"PlacementConstraints,omitempty"` + ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"ServicePlacementPolicies,omitempty"` + Extensions *[]ServiceTypeExtensionDescription `json:"Extensions,omitempty"` + // Kind - Possible values include: 'KindServiceTypeDescription', 'KindStateful', 'KindStateless1' + Kind KindBasicServiceTypeDescription `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatelessServiceTypeDescription. +func (sstd StatelessServiceTypeDescription) MarshalJSON() ([]byte, error) { + sstd.Kind = KindStateless1 + objectMap := make(map[string]interface{}) + if sstd.UseImplicitHost != nil { + objectMap["UseImplicitHost"] = sstd.UseImplicitHost + } + if sstd.IsStateful != nil { + objectMap["IsStateful"] = sstd.IsStateful + } + if sstd.ServiceTypeName != nil { + objectMap["ServiceTypeName"] = sstd.ServiceTypeName + } + if sstd.PlacementConstraints != nil { + objectMap["PlacementConstraints"] = sstd.PlacementConstraints + } + if sstd.ServicePlacementPolicies != nil { + objectMap["ServicePlacementPolicies"] = sstd.ServicePlacementPolicies + } + if sstd.Extensions != nil { + objectMap["Extensions"] = sstd.Extensions + } + if sstd.Kind != "" { + objectMap["Kind"] = sstd.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceTypeDescription is the BasicServiceTypeDescription implementation for StatelessServiceTypeDescription. +func (sstd StatelessServiceTypeDescription) AsStatefulServiceTypeDescription() (*StatefulServiceTypeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceTypeDescription is the BasicServiceTypeDescription implementation for StatelessServiceTypeDescription. +func (sstd StatelessServiceTypeDescription) AsStatelessServiceTypeDescription() (*StatelessServiceTypeDescription, bool) { + return &sstd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceTypeDescription is the BasicServiceTypeDescription implementation for StatelessServiceTypeDescription. +func (sstd StatelessServiceTypeDescription) AsServiceTypeDescription() (*ServiceTypeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServiceTypeDescription is the BasicServiceTypeDescription implementation for StatelessServiceTypeDescription. +func (sstd StatelessServiceTypeDescription) AsBasicServiceTypeDescription() (BasicServiceTypeDescription, bool) { + return &sstd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for StatelessServiceTypeDescription struct. +func (sstd *StatelessServiceTypeDescription) 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 "UseImplicitHost": + if v != nil { + var useImplicitHost bool + err = json.Unmarshal(*v, &useImplicitHost) + if err != nil { + return err + } + sstd.UseImplicitHost = &useImplicitHost + } + case "IsStateful": + if v != nil { + var isStateful bool + err = json.Unmarshal(*v, &isStateful) + if err != nil { + return err + } + sstd.IsStateful = &isStateful + } + case "ServiceTypeName": + if v != nil { + var serviceTypeName string + err = json.Unmarshal(*v, &serviceTypeName) + if err != nil { + return err + } + sstd.ServiceTypeName = &serviceTypeName + } + case "PlacementConstraints": + if v != nil { + var placementConstraints string + err = json.Unmarshal(*v, &placementConstraints) + if err != nil { + return err + } + sstd.PlacementConstraints = &placementConstraints + } + case "ServicePlacementPolicies": + if v != nil { + servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) + if err != nil { + return err + } + sstd.ServicePlacementPolicies = &servicePlacementPolicies + } + case "Extensions": + if v != nil { + var extensions []ServiceTypeExtensionDescription + err = json.Unmarshal(*v, &extensions) + if err != nil { + return err + } + sstd.Extensions = &extensions + } + case "Kind": + if v != nil { + var kind KindBasicServiceTypeDescription + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sstd.Kind = kind + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StatelessServiceUpdateDescription describes an update for a stateless service. +type StatelessServiceUpdateDescription struct { + // InstanceCount - The instance count. + InstanceCount *int32 `json:"InstanceCount,omitempty"` + // Flags - Flags indicating whether other properties are set. Each of the associated properties corresponds to a flag, specified below, which, if set, indicate that the property is specified. + // This property can be a combination of those flags obtained using bitwise 'OR' operator. + // For example, if the provided value is 6 then the flags for ReplicaRestartWaitDuration (2) and QuorumLossWaitDuration (4) are set. + // - None - Does not indicate any other properties are set. The value is zero. + // - TargetReplicaSetSize/InstanceCount - Indicates whether the TargetReplicaSetSize property (for Stateful services) or the InstanceCount property (for Stateless services) is set. The value is 1. + // - ReplicaRestartWaitDuration - Indicates the ReplicaRestartWaitDuration property is set. The value is 2. + // - QuorumLossWaitDuration - Indicates the QuorumLossWaitDuration property is set. The value is 4. + // - StandByReplicaKeepDuration - Indicates the StandByReplicaKeepDuration property is set. The value is 8. + // - MinReplicaSetSize - Indicates the MinReplicaSetSize property is set. The value is 16. + // - PlacementConstraints - Indicates the PlacementConstraints property is set. The value is 32. + // - PlacementPolicyList - Indicates the ServicePlacementPolicies property is set. The value is 64. + // - Correlation - Indicates the CorrelationScheme property is set. The value is 128. + // - Metrics - Indicates the ServiceLoadMetrics property is set. The value is 256. + // - DefaultMoveCost - Indicates the DefaultMoveCost property is set. The value is 512. + Flags *string `json:"Flags,omitempty"` + // PlacementConstraints - The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + PlacementConstraints *string `json:"PlacementConstraints,omitempty"` + // CorrelationScheme - The correlation scheme. + CorrelationScheme *[]ServiceCorrelationDescription `json:"CorrelationScheme,omitempty"` + // LoadMetrics - The service load metrics. + LoadMetrics *[]ServiceLoadMetricDescription `json:"LoadMetrics,omitempty"` + // ServicePlacementPolicies - The service placement policies. + ServicePlacementPolicies *[]BasicServicePlacementPolicyDescription `json:"ServicePlacementPolicies,omitempty"` + // DefaultMoveCost - The move cost for the service. Possible values include: 'DefaultMoveCost1Zero', 'DefaultMoveCost1Low', 'DefaultMoveCost1Medium', 'DefaultMoveCost1High' + DefaultMoveCost DefaultMoveCost1 `json:"DefaultMoveCost,omitempty"` + // ServiceKind - Possible values include: 'ServiceKindBasicServiceUpdateDescriptionServiceKindServiceUpdateDescription', 'ServiceKindBasicServiceUpdateDescriptionServiceKindStateful', 'ServiceKindBasicServiceUpdateDescriptionServiceKindStateless' + ServiceKind ServiceKindBasicServiceUpdateDescription `json:"ServiceKind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StatelessServiceUpdateDescription. +func (ssud StatelessServiceUpdateDescription) MarshalJSON() ([]byte, error) { + ssud.ServiceKind = ServiceKindBasicServiceUpdateDescriptionServiceKindStateless + objectMap := make(map[string]interface{}) + if ssud.InstanceCount != nil { + objectMap["InstanceCount"] = ssud.InstanceCount + } + if ssud.Flags != nil { + objectMap["Flags"] = ssud.Flags + } + if ssud.PlacementConstraints != nil { + objectMap["PlacementConstraints"] = ssud.PlacementConstraints + } + if ssud.CorrelationScheme != nil { + objectMap["CorrelationScheme"] = ssud.CorrelationScheme + } + if ssud.LoadMetrics != nil { + objectMap["LoadMetrics"] = ssud.LoadMetrics + } + if ssud.ServicePlacementPolicies != nil { + objectMap["ServicePlacementPolicies"] = ssud.ServicePlacementPolicies + } + if ssud.DefaultMoveCost != "" { + objectMap["DefaultMoveCost"] = ssud.DefaultMoveCost + } + if ssud.ServiceKind != "" { + objectMap["ServiceKind"] = ssud.ServiceKind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatefulServiceUpdateDescription is the BasicServiceUpdateDescription implementation for StatelessServiceUpdateDescription. +func (ssud StatelessServiceUpdateDescription) AsStatefulServiceUpdateDescription() (*StatefulServiceUpdateDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStatelessServiceUpdateDescription is the BasicServiceUpdateDescription implementation for StatelessServiceUpdateDescription. +func (ssud StatelessServiceUpdateDescription) AsStatelessServiceUpdateDescription() (*StatelessServiceUpdateDescription, bool) { + return &ssud, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceUpdateDescription is the BasicServiceUpdateDescription implementation for StatelessServiceUpdateDescription. +func (ssud StatelessServiceUpdateDescription) AsServiceUpdateDescription() (*ServiceUpdateDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicServiceUpdateDescription is the BasicServiceUpdateDescription implementation for StatelessServiceUpdateDescription. +func (ssud StatelessServiceUpdateDescription) AsBasicServiceUpdateDescription() (BasicServiceUpdateDescription, bool) { + return &ssud, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UnmarshalJSON is the custom unmarshaler for StatelessServiceUpdateDescription struct. +func (ssud *StatelessServiceUpdateDescription) 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 "InstanceCount": + if v != nil { + var instanceCount int32 + err = json.Unmarshal(*v, &instanceCount) + if err != nil { + return err + } + ssud.InstanceCount = &instanceCount + } + case "Flags": + if v != nil { + var flags string + err = json.Unmarshal(*v, &flags) + if err != nil { + return err + } + ssud.Flags = &flags + } + case "PlacementConstraints": + if v != nil { + var placementConstraints string + err = json.Unmarshal(*v, &placementConstraints) + if err != nil { + return err + } + ssud.PlacementConstraints = &placementConstraints + } + case "CorrelationScheme": + if v != nil { + var correlationScheme []ServiceCorrelationDescription + err = json.Unmarshal(*v, &correlationScheme) + if err != nil { + return err + } + ssud.CorrelationScheme = &correlationScheme + } + case "LoadMetrics": + if v != nil { + var loadMetrics []ServiceLoadMetricDescription + err = json.Unmarshal(*v, &loadMetrics) + if err != nil { + return err + } + ssud.LoadMetrics = &loadMetrics + } + case "ServicePlacementPolicies": + if v != nil { + servicePlacementPolicies, err := unmarshalBasicServicePlacementPolicyDescriptionArray(*v) + if err != nil { + return err + } + ssud.ServicePlacementPolicies = &servicePlacementPolicies + } + case "DefaultMoveCost": + if v != nil { + var defaultMoveCost DefaultMoveCost1 + err = json.Unmarshal(*v, &defaultMoveCost) + if err != nil { + return err + } + ssud.DefaultMoveCost = defaultMoveCost + } + case "ServiceKind": + if v != nil { + var serviceKind ServiceKindBasicServiceUpdateDescription + err = json.Unmarshal(*v, &serviceKind) + if err != nil { + return err + } + ssud.ServiceKind = serviceKind + } + } + } + + return nil +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StopNodeDescription describes the parameter for stopping a Service Fabric node. +type StopNodeDescription struct { + // NodeInstanceID - The instance id of the target node. If instance id is specified the node is stopped only if it matches with the current instance of the node. A default value of "0" would match any instance id. The instance id can be obtained using get node query. + NodeInstanceID *string `json:"NodeInstanceId,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// StoppedChaosEvent describes a Chaos event that gets generated when Chaos stops because either the user issued a +// stop or the time to run was up. +type StoppedChaosEvent struct { + Reason *string `json:"Reason,omitempty"` + TimeStampUtc *date.Time `json:"TimeStampUtc,omitempty"` + // Kind - Possible values include: 'KindChaosEvent', 'KindExecutingFaults', 'KindStarted', 'KindStopped', 'KindTestError', 'KindValidationFailed', 'KindWaiting' + Kind KindBasicChaosEvent `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for StoppedChaosEvent. +func (sce StoppedChaosEvent) MarshalJSON() ([]byte, error) { + sce.Kind = KindStopped + objectMap := make(map[string]interface{}) + if sce.Reason != nil { + objectMap["Reason"] = sce.Reason + } + if sce.TimeStampUtc != nil { + objectMap["TimeStampUtc"] = sce.TimeStampUtc + } + if sce.Kind != "" { + objectMap["Kind"] = sce.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsExecutingFaultsChaosEvent is the BasicChaosEvent implementation for StoppedChaosEvent. +func (sce StoppedChaosEvent) AsExecutingFaultsChaosEvent() (*ExecutingFaultsChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStartedChaosEvent is the BasicChaosEvent implementation for StoppedChaosEvent. +func (sce StoppedChaosEvent) AsStartedChaosEvent() (*StartedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStoppedChaosEvent is the BasicChaosEvent implementation for StoppedChaosEvent. +func (sce StoppedChaosEvent) AsStoppedChaosEvent() (*StoppedChaosEvent, bool) { + return &sce, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsTestErrorChaosEvent is the BasicChaosEvent implementation for StoppedChaosEvent. +func (sce StoppedChaosEvent) AsTestErrorChaosEvent() (*TestErrorChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsValidationFailedChaosEvent is the BasicChaosEvent implementation for StoppedChaosEvent. +func (sce StoppedChaosEvent) AsValidationFailedChaosEvent() (*ValidationFailedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitingChaosEvent is the BasicChaosEvent implementation for StoppedChaosEvent. +func (sce StoppedChaosEvent) AsWaitingChaosEvent() (*WaitingChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsChaosEvent is the BasicChaosEvent implementation for StoppedChaosEvent. +func (sce StoppedChaosEvent) AsChaosEvent() (*ChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicChaosEvent is the BasicChaosEvent implementation for StoppedChaosEvent. +func (sce StoppedChaosEvent) AsBasicChaosEvent() (BasicChaosEvent, bool) { + return &sce, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// SystemApplicationHealthEvaluation represents health evaluation for the fabric:/System application, containing +// information about the data and the algorithm used by health store to evaluate health. The evaluation is returned +// only when the aggregated health state of the cluster is either Error or Warning. +type SystemApplicationHealthEvaluation struct { + // UnhealthyEvaluations - List of unhealthy evaluations that led to the current aggregated health state of the system application. The types of the unhealthy evaluations can be DeployedApplicationsHealthEvaluation, ServicesHealthEvaluation or EventHealthEvaluation. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) MarshalJSON() ([]byte, error) { + sahe.Kind = KindSystemApplication + objectMap := make(map[string]interface{}) + if sahe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = sahe.UnhealthyEvaluations + } + if sahe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = sahe.AggregatedHealthState + } + if sahe.Description != nil { + objectMap["Description"] = sahe.Description + } + if sahe.Kind != "" { + objectMap["Kind"] = sahe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return &sahe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for SystemApplicationHealthEvaluation. +func (sahe SystemApplicationHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &sahe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// TestErrorChaosEvent describes a Chaos event that gets generated when an unexpected event occurs in the Chaos +// engine. +// For example, due to the cluster snapshot being inconsistent, while faulting a faultable entity, Chaos found that +// the entity was alreay faulted -- which would be an unexpected event. +type TestErrorChaosEvent struct { + Reason *string `json:"Reason,omitempty"` + TimeStampUtc *date.Time `json:"TimeStampUtc,omitempty"` + // Kind - Possible values include: 'KindChaosEvent', 'KindExecutingFaults', 'KindStarted', 'KindStopped', 'KindTestError', 'KindValidationFailed', 'KindWaiting' + Kind KindBasicChaosEvent `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for TestErrorChaosEvent. +func (tece TestErrorChaosEvent) MarshalJSON() ([]byte, error) { + tece.Kind = KindTestError + objectMap := make(map[string]interface{}) + if tece.Reason != nil { + objectMap["Reason"] = tece.Reason + } + if tece.TimeStampUtc != nil { + objectMap["TimeStampUtc"] = tece.TimeStampUtc + } + if tece.Kind != "" { + objectMap["Kind"] = tece.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsExecutingFaultsChaosEvent is the BasicChaosEvent implementation for TestErrorChaosEvent. +func (tece TestErrorChaosEvent) AsExecutingFaultsChaosEvent() (*ExecutingFaultsChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStartedChaosEvent is the BasicChaosEvent implementation for TestErrorChaosEvent. +func (tece TestErrorChaosEvent) AsStartedChaosEvent() (*StartedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStoppedChaosEvent is the BasicChaosEvent implementation for TestErrorChaosEvent. +func (tece TestErrorChaosEvent) AsStoppedChaosEvent() (*StoppedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsTestErrorChaosEvent is the BasicChaosEvent implementation for TestErrorChaosEvent. +func (tece TestErrorChaosEvent) AsTestErrorChaosEvent() (*TestErrorChaosEvent, bool) { + return &tece, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsValidationFailedChaosEvent is the BasicChaosEvent implementation for TestErrorChaosEvent. +func (tece TestErrorChaosEvent) AsValidationFailedChaosEvent() (*ValidationFailedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitingChaosEvent is the BasicChaosEvent implementation for TestErrorChaosEvent. +func (tece TestErrorChaosEvent) AsWaitingChaosEvent() (*WaitingChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsChaosEvent is the BasicChaosEvent implementation for TestErrorChaosEvent. +func (tece TestErrorChaosEvent) AsChaosEvent() (*ChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicChaosEvent is the BasicChaosEvent implementation for TestErrorChaosEvent. +func (tece TestErrorChaosEvent) AsBasicChaosEvent() (BasicChaosEvent, bool) { + return &tece, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UniformInt64RangePartitionSchemeDescription describes a partitioning scheme where an integer range is allocated +// evenly across a number of partitions. +type UniformInt64RangePartitionSchemeDescription struct { + // Count - The number of partitions. + Count *int32 `json:"Count,omitempty"` + // LowKey - String indicating the lower bound of the partition key range that + // should be split between the partition ‘Count’ + LowKey *string `json:"LowKey,omitempty"` + // HighKey - String indicating the upper bound of the partition key range that + // should be split between the partition ‘Count’ + HighKey *string `json:"HighKey,omitempty"` + // PartitionScheme - Possible values include: 'PartitionSchemePartitionSchemeDescription', 'PartitionSchemeNamed', 'PartitionSchemeSingleton', 'PartitionSchemeUniformInt64Range' + PartitionScheme PartitionScheme `json:"PartitionScheme,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for UniformInt64RangePartitionSchemeDescription. +func (ui6rpsd UniformInt64RangePartitionSchemeDescription) MarshalJSON() ([]byte, error) { + ui6rpsd.PartitionScheme = PartitionSchemeUniformInt64Range + objectMap := make(map[string]interface{}) + if ui6rpsd.Count != nil { + objectMap["Count"] = ui6rpsd.Count + } + if ui6rpsd.LowKey != nil { + objectMap["LowKey"] = ui6rpsd.LowKey + } + if ui6rpsd.HighKey != nil { + objectMap["HighKey"] = ui6rpsd.HighKey + } + if ui6rpsd.PartitionScheme != "" { + objectMap["PartitionScheme"] = ui6rpsd.PartitionScheme + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNamedPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for UniformInt64RangePartitionSchemeDescription. +func (ui6rpsd UniformInt64RangePartitionSchemeDescription) AsNamedPartitionSchemeDescription() (*NamedPartitionSchemeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSingletonPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for UniformInt64RangePartitionSchemeDescription. +func (ui6rpsd UniformInt64RangePartitionSchemeDescription) AsSingletonPartitionSchemeDescription() (*SingletonPartitionSchemeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUniformInt64RangePartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for UniformInt64RangePartitionSchemeDescription. +func (ui6rpsd UniformInt64RangePartitionSchemeDescription) AsUniformInt64RangePartitionSchemeDescription() (*UniformInt64RangePartitionSchemeDescription, bool) { + return &ui6rpsd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for UniformInt64RangePartitionSchemeDescription. +func (ui6rpsd UniformInt64RangePartitionSchemeDescription) AsPartitionSchemeDescription() (*PartitionSchemeDescription, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionSchemeDescription is the BasicPartitionSchemeDescription implementation for UniformInt64RangePartitionSchemeDescription. +func (ui6rpsd UniformInt64RangePartitionSchemeDescription) AsBasicPartitionSchemeDescription() (BasicPartitionSchemeDescription, bool) { + return &ui6rpsd, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpgradeDomainDeltaNodesCheckHealthEvaluation represents health evaluation for delta unhealthy cluster nodes in +// an upgrade domain, containing health evaluations for each unhealthy node that impacted current aggregated health +// state. +// Can be returned during cluster upgrade when cluster aggregated health state is Warning or Error. +type UpgradeDomainDeltaNodesCheckHealthEvaluation struct { + // UpgradeDomainName - Name of the upgrade domain where nodes health is currently evaluated. + UpgradeDomainName *string `json:"UpgradeDomainName,omitempty"` + // BaselineErrorCount - Number of upgrade domain nodes with aggregated heath state Error in the health store at the beginning of the cluster upgrade. + BaselineErrorCount *int64 `json:"BaselineErrorCount,omitempty"` + // BaselineTotalCount - Total number of upgrade domain nodes in the health store at the beginning of the cluster upgrade. + BaselineTotalCount *int64 `json:"BaselineTotalCount,omitempty"` + // MaxPercentDeltaUnhealthyNodes - Maximum allowed percentage of upgrade domain delta unhealthy nodes from the ClusterUpgradeHealthPolicy. + MaxPercentDeltaUnhealthyNodes *int32 `json:"MaxPercentDeltaUnhealthyNodes,omitempty"` + // TotalCount - Total number of upgrade domain nodes in the health store. + TotalCount *int64 `json:"TotalCount,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy NodeHealthEvaluation that impacted the aggregated health. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) MarshalJSON() ([]byte, error) { + uddnche.Kind = KindUpgradeDomainDeltaNodesCheck + objectMap := make(map[string]interface{}) + if uddnche.UpgradeDomainName != nil { + objectMap["UpgradeDomainName"] = uddnche.UpgradeDomainName + } + if uddnche.BaselineErrorCount != nil { + objectMap["BaselineErrorCount"] = uddnche.BaselineErrorCount + } + if uddnche.BaselineTotalCount != nil { + objectMap["BaselineTotalCount"] = uddnche.BaselineTotalCount + } + if uddnche.MaxPercentDeltaUnhealthyNodes != nil { + objectMap["MaxPercentDeltaUnhealthyNodes"] = uddnche.MaxPercentDeltaUnhealthyNodes + } + if uddnche.TotalCount != nil { + objectMap["TotalCount"] = uddnche.TotalCount + } + if uddnche.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = uddnche.UnhealthyEvaluations + } + if uddnche.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = uddnche.AggregatedHealthState + } + if uddnche.Description != nil { + objectMap["Description"] = uddnche.Description + } + if uddnche.Kind != "" { + objectMap["Kind"] = uddnche.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return &uddnche, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainDeltaNodesCheckHealthEvaluation. +func (uddnche UpgradeDomainDeltaNodesCheckHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &uddnche, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpgradeDomainInfo information about an upgrade domain. +type UpgradeDomainInfo struct { + Name *string `json:"Name,omitempty"` + // State - Possible values include: 'StateInvalid', 'StatePending', 'StateInProgress', 'StateCompleted' + State State `json:"State,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UpgradeDomainNodesHealthEvaluation represents health evaluation for cluster nodes in an upgrade domain, +// containing health evaluations for each unhealthy node that impacted current aggregated health state. Can be +// returned when evaluating cluster health during cluster upgrade and the aggregated health state is either Error +// or Warning. +type UpgradeDomainNodesHealthEvaluation struct { + // UpgradeDomainName - Name of the upgrade domain where nodes health is currently evaluated. + UpgradeDomainName *string `json:"UpgradeDomainName,omitempty"` + // MaxPercentUnhealthyNodes - Maximum allowed percentage of unhealthy nodes from the ClusterHealthPolicy. + MaxPercentUnhealthyNodes *int32 `json:"MaxPercentUnhealthyNodes,omitempty"` + // TotalCount - Total number of nodes in the current upgrade domain. + TotalCount *int64 `json:"TotalCount,omitempty"` + // UnhealthyEvaluations - List of unhealthy evaluations that led to the aggregated health state. Includes all the unhealthy NodeHealthEvaluation that impacted the aggregated health. + UnhealthyEvaluations *[]HealthEvaluationWrapper `json:"UnhealthyEvaluations,omitempty"` + // AggregatedHealthState - Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown' + AggregatedHealthState AggregatedHealthState `json:"AggregatedHealthState,omitempty"` + // Description - Description of the health evaluation, which represents a summary of the evaluation process. + Description *string `json:"Description,omitempty"` + // Kind - Possible values include: 'KindHealthEvaluation', 'KindApplication', 'KindApplications', 'KindApplicationTypeApplications', 'KindDeltaNodesCheck', 'KindDeployedApplication', 'KindDeployedApplications', 'KindDeployedServicePackage', 'KindDeployedServicePackages', 'KindEvent', 'KindNode', 'KindNodes', 'KindPartition', 'KindPartitions', 'KindReplica', 'KindReplicas', 'KindService', 'KindServices', 'KindSystemApplication', 'KindUpgradeDomainDeltaNodesCheck', 'KindUpgradeDomainNodes' + Kind KindBasicHealthEvaluation `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) MarshalJSON() ([]byte, error) { + udnhe.Kind = KindUpgradeDomainNodes + objectMap := make(map[string]interface{}) + if udnhe.UpgradeDomainName != nil { + objectMap["UpgradeDomainName"] = udnhe.UpgradeDomainName + } + if udnhe.MaxPercentUnhealthyNodes != nil { + objectMap["MaxPercentUnhealthyNodes"] = udnhe.MaxPercentUnhealthyNodes + } + if udnhe.TotalCount != nil { + objectMap["TotalCount"] = udnhe.TotalCount + } + if udnhe.UnhealthyEvaluations != nil { + objectMap["UnhealthyEvaluations"] = udnhe.UnhealthyEvaluations + } + if udnhe.AggregatedHealthState != "" { + objectMap["AggregatedHealthState"] = udnhe.AggregatedHealthState + } + if udnhe.Description != nil { + objectMap["Description"] = udnhe.Description + } + if udnhe.Kind != "" { + objectMap["Kind"] = udnhe.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsApplicationHealthEvaluation() (*ApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsApplicationsHealthEvaluation() (*ApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsApplicationTypeApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsApplicationTypeApplicationsHealthEvaluation() (*ApplicationTypeApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsDeltaNodesCheckHealthEvaluation() (*DeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsDeployedApplicationHealthEvaluation() (*DeployedApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedApplicationsHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsDeployedApplicationsHealthEvaluation() (*DeployedApplicationsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackageHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsDeployedServicePackageHealthEvaluation() (*DeployedServicePackageHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsDeployedServicePackagesHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsDeployedServicePackagesHealthEvaluation() (*DeployedServicePackagesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEventHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsEventHealthEvaluation() (*EventHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodeHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsNodeHealthEvaluation() (*NodeHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsNodesHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsNodesHealthEvaluation() (*NodesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsPartitionHealthEvaluation() (*PartitionHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionsHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsPartitionsHealthEvaluation() (*PartitionsHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicaHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsReplicaHealthEvaluation() (*ReplicaHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsReplicasHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsReplicasHealthEvaluation() (*ReplicasHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServiceHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsServiceHealthEvaluation() (*ServiceHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsServicesHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsServicesHealthEvaluation() (*ServicesHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSystemApplicationHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsSystemApplicationHealthEvaluation() (*SystemApplicationHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainDeltaNodesCheckHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsUpgradeDomainDeltaNodesCheckHealthEvaluation() (*UpgradeDomainDeltaNodesCheckHealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsUpgradeDomainNodesHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsUpgradeDomainNodesHealthEvaluation() (*UpgradeDomainNodesHealthEvaluation, bool) { + return &udnhe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsHealthEvaluation() (*HealthEvaluation, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicHealthEvaluation is the BasicHealthEvaluation implementation for UpgradeDomainNodesHealthEvaluation. +func (udnhe UpgradeDomainNodesHealthEvaluation) AsBasicHealthEvaluation() (BasicHealthEvaluation, bool) { + return &udnhe, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// ValidationFailedChaosEvent chaos event corresponding to a failure during validation. +type ValidationFailedChaosEvent struct { + Reason *string `json:"Reason,omitempty"` + TimeStampUtc *date.Time `json:"TimeStampUtc,omitempty"` + // Kind - Possible values include: 'KindChaosEvent', 'KindExecutingFaults', 'KindStarted', 'KindStopped', 'KindTestError', 'KindValidationFailed', 'KindWaiting' + Kind KindBasicChaosEvent `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for ValidationFailedChaosEvent. +func (vfce ValidationFailedChaosEvent) MarshalJSON() ([]byte, error) { + vfce.Kind = KindValidationFailed + objectMap := make(map[string]interface{}) + if vfce.Reason != nil { + objectMap["Reason"] = vfce.Reason + } + if vfce.TimeStampUtc != nil { + objectMap["TimeStampUtc"] = vfce.TimeStampUtc + } + if vfce.Kind != "" { + objectMap["Kind"] = vfce.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsExecutingFaultsChaosEvent is the BasicChaosEvent implementation for ValidationFailedChaosEvent. +func (vfce ValidationFailedChaosEvent) AsExecutingFaultsChaosEvent() (*ExecutingFaultsChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStartedChaosEvent is the BasicChaosEvent implementation for ValidationFailedChaosEvent. +func (vfce ValidationFailedChaosEvent) AsStartedChaosEvent() (*StartedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStoppedChaosEvent is the BasicChaosEvent implementation for ValidationFailedChaosEvent. +func (vfce ValidationFailedChaosEvent) AsStoppedChaosEvent() (*StoppedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsTestErrorChaosEvent is the BasicChaosEvent implementation for ValidationFailedChaosEvent. +func (vfce ValidationFailedChaosEvent) AsTestErrorChaosEvent() (*TestErrorChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsValidationFailedChaosEvent is the BasicChaosEvent implementation for ValidationFailedChaosEvent. +func (vfce ValidationFailedChaosEvent) AsValidationFailedChaosEvent() (*ValidationFailedChaosEvent, bool) { + return &vfce, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitingChaosEvent is the BasicChaosEvent implementation for ValidationFailedChaosEvent. +func (vfce ValidationFailedChaosEvent) AsWaitingChaosEvent() (*WaitingChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsChaosEvent is the BasicChaosEvent implementation for ValidationFailedChaosEvent. +func (vfce ValidationFailedChaosEvent) AsChaosEvent() (*ChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicChaosEvent is the BasicChaosEvent implementation for ValidationFailedChaosEvent. +func (vfce ValidationFailedChaosEvent) AsBasicChaosEvent() (BasicChaosEvent, bool) { + return &vfce, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// WaitForInbuildReplicaSafetyCheck safety check that waits for the replica build operation to finish. This +// indiciates that there is a replica that is going through the copy or is providing data for building another +// replica. Bring the node down will abort this copy operation which are typoically expensive involving data +// movements. +type WaitForInbuildReplicaSafetyCheck struct { + // PartitionID - Id of the partition which is undergoing the safety check. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // Kind - Possible values include: 'KindSafetyCheck', 'KindPartitionSafetyCheck', 'KindEnsureAvailability', 'KindEnsurePartitionQuorum', 'KindEnsureSeedNodeQuorum', 'KindWaitForInbuildReplica', 'KindWaitForPrimaryPlacement', 'KindWaitForPrimarySwap', 'KindWaitForReconfiguration' + Kind KindBasicSafetyCheck `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for WaitForInbuildReplicaSafetyCheck. +func (wfirsc WaitForInbuildReplicaSafetyCheck) MarshalJSON() ([]byte, error) { + wfirsc.Kind = KindWaitForInbuildReplica + objectMap := make(map[string]interface{}) + if wfirsc.PartitionID != nil { + objectMap["PartitionId"] = wfirsc.PartitionID + } + if wfirsc.Kind != "" { + objectMap["Kind"] = wfirsc.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionSafetyCheck is the BasicSafetyCheck implementation for WaitForInbuildReplicaSafetyCheck. +func (wfirsc WaitForInbuildReplicaSafetyCheck) AsPartitionSafetyCheck() (*PartitionSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionSafetyCheck is the BasicSafetyCheck implementation for WaitForInbuildReplicaSafetyCheck. +func (wfirsc WaitForInbuildReplicaSafetyCheck) AsBasicPartitionSafetyCheck() (BasicPartitionSafetyCheck, bool) { + return &wfirsc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsureAvailabilitySafetyCheck is the BasicSafetyCheck implementation for WaitForInbuildReplicaSafetyCheck. +func (wfirsc WaitForInbuildReplicaSafetyCheck) AsEnsureAvailabilitySafetyCheck() (*EnsureAvailabilitySafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsurePartitionQurumSafetyCheck is the BasicSafetyCheck implementation for WaitForInbuildReplicaSafetyCheck. +func (wfirsc WaitForInbuildReplicaSafetyCheck) AsEnsurePartitionQurumSafetyCheck() (*EnsurePartitionQurumSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSeedNodeSafetyCheck is the BasicSafetyCheck implementation for WaitForInbuildReplicaSafetyCheck. +func (wfirsc WaitForInbuildReplicaSafetyCheck) AsSeedNodeSafetyCheck() (*SeedNodeSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForInbuildReplicaSafetyCheck is the BasicSafetyCheck implementation for WaitForInbuildReplicaSafetyCheck. +func (wfirsc WaitForInbuildReplicaSafetyCheck) AsWaitForInbuildReplicaSafetyCheck() (*WaitForInbuildReplicaSafetyCheck, bool) { + return &wfirsc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimaryPlacementSafetyCheck is the BasicSafetyCheck implementation for WaitForInbuildReplicaSafetyCheck. +func (wfirsc WaitForInbuildReplicaSafetyCheck) AsWaitForPrimaryPlacementSafetyCheck() (*WaitForPrimaryPlacementSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimarySwapSafetyCheck is the BasicSafetyCheck implementation for WaitForInbuildReplicaSafetyCheck. +func (wfirsc WaitForInbuildReplicaSafetyCheck) AsWaitForPrimarySwapSafetyCheck() (*WaitForPrimarySwapSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForReconfigurationSafetyCheck is the BasicSafetyCheck implementation for WaitForInbuildReplicaSafetyCheck. +func (wfirsc WaitForInbuildReplicaSafetyCheck) AsWaitForReconfigurationSafetyCheck() (*WaitForReconfigurationSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSafetyCheck is the BasicSafetyCheck implementation for WaitForInbuildReplicaSafetyCheck. +func (wfirsc WaitForInbuildReplicaSafetyCheck) AsSafetyCheck() (*SafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicSafetyCheck is the BasicSafetyCheck implementation for WaitForInbuildReplicaSafetyCheck. +func (wfirsc WaitForInbuildReplicaSafetyCheck) AsBasicSafetyCheck() (BasicSafetyCheck, bool) { + return &wfirsc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// WaitForPrimaryPlacementSafetyCheck safety check that waits for the primary replica that was moved out of the +// node due to upgrade to be placed back again on that node. +type WaitForPrimaryPlacementSafetyCheck struct { + // PartitionID - Id of the partition which is undergoing the safety check. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // Kind - Possible values include: 'KindSafetyCheck', 'KindPartitionSafetyCheck', 'KindEnsureAvailability', 'KindEnsurePartitionQuorum', 'KindEnsureSeedNodeQuorum', 'KindWaitForInbuildReplica', 'KindWaitForPrimaryPlacement', 'KindWaitForPrimarySwap', 'KindWaitForReconfiguration' + Kind KindBasicSafetyCheck `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for WaitForPrimaryPlacementSafetyCheck. +func (wfppsc WaitForPrimaryPlacementSafetyCheck) MarshalJSON() ([]byte, error) { + wfppsc.Kind = KindWaitForPrimaryPlacement + objectMap := make(map[string]interface{}) + if wfppsc.PartitionID != nil { + objectMap["PartitionId"] = wfppsc.PartitionID + } + if wfppsc.Kind != "" { + objectMap["Kind"] = wfppsc.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimaryPlacementSafetyCheck. +func (wfppsc WaitForPrimaryPlacementSafetyCheck) AsPartitionSafetyCheck() (*PartitionSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimaryPlacementSafetyCheck. +func (wfppsc WaitForPrimaryPlacementSafetyCheck) AsBasicPartitionSafetyCheck() (BasicPartitionSafetyCheck, bool) { + return &wfppsc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsureAvailabilitySafetyCheck is the BasicSafetyCheck implementation for WaitForPrimaryPlacementSafetyCheck. +func (wfppsc WaitForPrimaryPlacementSafetyCheck) AsEnsureAvailabilitySafetyCheck() (*EnsureAvailabilitySafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsurePartitionQurumSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimaryPlacementSafetyCheck. +func (wfppsc WaitForPrimaryPlacementSafetyCheck) AsEnsurePartitionQurumSafetyCheck() (*EnsurePartitionQurumSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSeedNodeSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimaryPlacementSafetyCheck. +func (wfppsc WaitForPrimaryPlacementSafetyCheck) AsSeedNodeSafetyCheck() (*SeedNodeSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForInbuildReplicaSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimaryPlacementSafetyCheck. +func (wfppsc WaitForPrimaryPlacementSafetyCheck) AsWaitForInbuildReplicaSafetyCheck() (*WaitForInbuildReplicaSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimaryPlacementSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimaryPlacementSafetyCheck. +func (wfppsc WaitForPrimaryPlacementSafetyCheck) AsWaitForPrimaryPlacementSafetyCheck() (*WaitForPrimaryPlacementSafetyCheck, bool) { + return &wfppsc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimarySwapSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimaryPlacementSafetyCheck. +func (wfppsc WaitForPrimaryPlacementSafetyCheck) AsWaitForPrimarySwapSafetyCheck() (*WaitForPrimarySwapSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForReconfigurationSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimaryPlacementSafetyCheck. +func (wfppsc WaitForPrimaryPlacementSafetyCheck) AsWaitForReconfigurationSafetyCheck() (*WaitForReconfigurationSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimaryPlacementSafetyCheck. +func (wfppsc WaitForPrimaryPlacementSafetyCheck) AsSafetyCheck() (*SafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimaryPlacementSafetyCheck. +func (wfppsc WaitForPrimaryPlacementSafetyCheck) AsBasicSafetyCheck() (BasicSafetyCheck, bool) { + return &wfppsc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// WaitForPrimarySwapSafetyCheck safety check that waits for the primary replica to be moved out of the node before +// starting an upgrade to ensure the avaiability of the primary replica for the partition. +type WaitForPrimarySwapSafetyCheck struct { + // PartitionID - Id of the partition which is undergoing the safety check. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // Kind - Possible values include: 'KindSafetyCheck', 'KindPartitionSafetyCheck', 'KindEnsureAvailability', 'KindEnsurePartitionQuorum', 'KindEnsureSeedNodeQuorum', 'KindWaitForInbuildReplica', 'KindWaitForPrimaryPlacement', 'KindWaitForPrimarySwap', 'KindWaitForReconfiguration' + Kind KindBasicSafetyCheck `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for WaitForPrimarySwapSafetyCheck. +func (wfpssc WaitForPrimarySwapSafetyCheck) MarshalJSON() ([]byte, error) { + wfpssc.Kind = KindWaitForPrimarySwap + objectMap := make(map[string]interface{}) + if wfpssc.PartitionID != nil { + objectMap["PartitionId"] = wfpssc.PartitionID + } + if wfpssc.Kind != "" { + objectMap["Kind"] = wfpssc.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimarySwapSafetyCheck. +func (wfpssc WaitForPrimarySwapSafetyCheck) AsPartitionSafetyCheck() (*PartitionSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimarySwapSafetyCheck. +func (wfpssc WaitForPrimarySwapSafetyCheck) AsBasicPartitionSafetyCheck() (BasicPartitionSafetyCheck, bool) { + return &wfpssc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsureAvailabilitySafetyCheck is the BasicSafetyCheck implementation for WaitForPrimarySwapSafetyCheck. +func (wfpssc WaitForPrimarySwapSafetyCheck) AsEnsureAvailabilitySafetyCheck() (*EnsureAvailabilitySafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsurePartitionQurumSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimarySwapSafetyCheck. +func (wfpssc WaitForPrimarySwapSafetyCheck) AsEnsurePartitionQurumSafetyCheck() (*EnsurePartitionQurumSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSeedNodeSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimarySwapSafetyCheck. +func (wfpssc WaitForPrimarySwapSafetyCheck) AsSeedNodeSafetyCheck() (*SeedNodeSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForInbuildReplicaSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimarySwapSafetyCheck. +func (wfpssc WaitForPrimarySwapSafetyCheck) AsWaitForInbuildReplicaSafetyCheck() (*WaitForInbuildReplicaSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimaryPlacementSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimarySwapSafetyCheck. +func (wfpssc WaitForPrimarySwapSafetyCheck) AsWaitForPrimaryPlacementSafetyCheck() (*WaitForPrimaryPlacementSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimarySwapSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimarySwapSafetyCheck. +func (wfpssc WaitForPrimarySwapSafetyCheck) AsWaitForPrimarySwapSafetyCheck() (*WaitForPrimarySwapSafetyCheck, bool) { + return &wfpssc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForReconfigurationSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimarySwapSafetyCheck. +func (wfpssc WaitForPrimarySwapSafetyCheck) AsWaitForReconfigurationSafetyCheck() (*WaitForReconfigurationSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimarySwapSafetyCheck. +func (wfpssc WaitForPrimarySwapSafetyCheck) AsSafetyCheck() (*SafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicSafetyCheck is the BasicSafetyCheck implementation for WaitForPrimarySwapSafetyCheck. +func (wfpssc WaitForPrimarySwapSafetyCheck) AsBasicSafetyCheck() (BasicSafetyCheck, bool) { + return &wfpssc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// WaitForReconfigurationSafetyCheck safety check that waits for the current reconfiguration of the partition to be +// completed before starting an upgrade. +type WaitForReconfigurationSafetyCheck struct { + // PartitionID - Id of the partition which is undergoing the safety check. + PartitionID *uuid.UUID `json:"PartitionId,omitempty"` + // Kind - Possible values include: 'KindSafetyCheck', 'KindPartitionSafetyCheck', 'KindEnsureAvailability', 'KindEnsurePartitionQuorum', 'KindEnsureSeedNodeQuorum', 'KindWaitForInbuildReplica', 'KindWaitForPrimaryPlacement', 'KindWaitForPrimarySwap', 'KindWaitForReconfiguration' + Kind KindBasicSafetyCheck `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for WaitForReconfigurationSafetyCheck. +func (wfrsc WaitForReconfigurationSafetyCheck) MarshalJSON() ([]byte, error) { + wfrsc.Kind = KindWaitForReconfiguration + objectMap := make(map[string]interface{}) + if wfrsc.PartitionID != nil { + objectMap["PartitionId"] = wfrsc.PartitionID + } + if wfrsc.Kind != "" { + objectMap["Kind"] = wfrsc.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsPartitionSafetyCheck is the BasicSafetyCheck implementation for WaitForReconfigurationSafetyCheck. +func (wfrsc WaitForReconfigurationSafetyCheck) AsPartitionSafetyCheck() (*PartitionSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicPartitionSafetyCheck is the BasicSafetyCheck implementation for WaitForReconfigurationSafetyCheck. +func (wfrsc WaitForReconfigurationSafetyCheck) AsBasicPartitionSafetyCheck() (BasicPartitionSafetyCheck, bool) { + return &wfrsc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsureAvailabilitySafetyCheck is the BasicSafetyCheck implementation for WaitForReconfigurationSafetyCheck. +func (wfrsc WaitForReconfigurationSafetyCheck) AsEnsureAvailabilitySafetyCheck() (*EnsureAvailabilitySafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsEnsurePartitionQurumSafetyCheck is the BasicSafetyCheck implementation for WaitForReconfigurationSafetyCheck. +func (wfrsc WaitForReconfigurationSafetyCheck) AsEnsurePartitionQurumSafetyCheck() (*EnsurePartitionQurumSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSeedNodeSafetyCheck is the BasicSafetyCheck implementation for WaitForReconfigurationSafetyCheck. +func (wfrsc WaitForReconfigurationSafetyCheck) AsSeedNodeSafetyCheck() (*SeedNodeSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForInbuildReplicaSafetyCheck is the BasicSafetyCheck implementation for WaitForReconfigurationSafetyCheck. +func (wfrsc WaitForReconfigurationSafetyCheck) AsWaitForInbuildReplicaSafetyCheck() (*WaitForInbuildReplicaSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimaryPlacementSafetyCheck is the BasicSafetyCheck implementation for WaitForReconfigurationSafetyCheck. +func (wfrsc WaitForReconfigurationSafetyCheck) AsWaitForPrimaryPlacementSafetyCheck() (*WaitForPrimaryPlacementSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForPrimarySwapSafetyCheck is the BasicSafetyCheck implementation for WaitForReconfigurationSafetyCheck. +func (wfrsc WaitForReconfigurationSafetyCheck) AsWaitForPrimarySwapSafetyCheck() (*WaitForPrimarySwapSafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitForReconfigurationSafetyCheck is the BasicSafetyCheck implementation for WaitForReconfigurationSafetyCheck. +func (wfrsc WaitForReconfigurationSafetyCheck) AsWaitForReconfigurationSafetyCheck() (*WaitForReconfigurationSafetyCheck, bool) { + return &wfrsc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsSafetyCheck is the BasicSafetyCheck implementation for WaitForReconfigurationSafetyCheck. +func (wfrsc WaitForReconfigurationSafetyCheck) AsSafetyCheck() (*SafetyCheck, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicSafetyCheck is the BasicSafetyCheck implementation for WaitForReconfigurationSafetyCheck. +func (wfrsc WaitForReconfigurationSafetyCheck) AsBasicSafetyCheck() (BasicSafetyCheck, bool) { + return &wfrsc, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// WaitingChaosEvent describes a Chaos event that gets generated when Chaos is waiting for the cluster to become +// ready for faulting, for example, Chaos may be waiting for the on-going upgrade to finish. +type WaitingChaosEvent struct { + Reason *string `json:"Reason,omitempty"` + TimeStampUtc *date.Time `json:"TimeStampUtc,omitempty"` + // Kind - Possible values include: 'KindChaosEvent', 'KindExecutingFaults', 'KindStarted', 'KindStopped', 'KindTestError', 'KindValidationFailed', 'KindWaiting' + Kind KindBasicChaosEvent `json:"Kind,omitempty"` +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// MarshalJSON is the custom marshaler for WaitingChaosEvent. +func (wce WaitingChaosEvent) MarshalJSON() ([]byte, error) { + wce.Kind = KindWaiting + objectMap := make(map[string]interface{}) + if wce.Reason != nil { + objectMap["Reason"] = wce.Reason + } + if wce.TimeStampUtc != nil { + objectMap["TimeStampUtc"] = wce.TimeStampUtc + } + if wce.Kind != "" { + objectMap["Kind"] = wce.Kind + } + return json.Marshal(objectMap) +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsExecutingFaultsChaosEvent is the BasicChaosEvent implementation for WaitingChaosEvent. +func (wce WaitingChaosEvent) AsExecutingFaultsChaosEvent() (*ExecutingFaultsChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStartedChaosEvent is the BasicChaosEvent implementation for WaitingChaosEvent. +func (wce WaitingChaosEvent) AsStartedChaosEvent() (*StartedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsStoppedChaosEvent is the BasicChaosEvent implementation for WaitingChaosEvent. +func (wce WaitingChaosEvent) AsStoppedChaosEvent() (*StoppedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsTestErrorChaosEvent is the BasicChaosEvent implementation for WaitingChaosEvent. +func (wce WaitingChaosEvent) AsTestErrorChaosEvent() (*TestErrorChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsValidationFailedChaosEvent is the BasicChaosEvent implementation for WaitingChaosEvent. +func (wce WaitingChaosEvent) AsValidationFailedChaosEvent() (*ValidationFailedChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsWaitingChaosEvent is the BasicChaosEvent implementation for WaitingChaosEvent. +func (wce WaitingChaosEvent) AsWaitingChaosEvent() (*WaitingChaosEvent, bool) { + return &wce, true +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsChaosEvent is the BasicChaosEvent implementation for WaitingChaosEvent. +func (wce WaitingChaosEvent) AsChaosEvent() (*ChaosEvent, bool) { + return nil, false +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// AsBasicChaosEvent is the BasicChaosEvent implementation for WaitingChaosEvent. +func (wce WaitingChaosEvent) AsBasicChaosEvent() (BasicChaosEvent, bool) { + return &wce, true +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/5.6/servicefabric/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/5.6/servicefabric/version.go new file mode 100644 index 00000000..c52aafb4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicefabric/5.6/servicefabric/version.go @@ -0,0 +1,31 @@ +package servicefabric + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " servicefabric/5.6.*" +} + +// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/servicefabric/6.2/servicefabric instead +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/google.golang.org/api/prediction/v1.5/prediction-api.json b/vendor/google.golang.org/api/prediction/v1.5/prediction-api.json new file mode 100644 index 00000000..4fe72932 --- /dev/null +++ b/vendor/google.golang.org/api/prediction/v1.5/prediction-api.json @@ -0,0 +1,700 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/devstorage.full_control": { + "description": "Manage your data and permissions in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/prediction": { + "description": "Manage your data in the Google Prediction API" + } + } + } + }, + "basePath": "/prediction/v1.5/", + "baseUrl": "https://www.googleapis.com/prediction/v1.5/", + "batchPath": "batch/prediction/v1.5", + "description": "Lets you access a cloud hosted machine learning service that makes it easy to build smart apps", + "discoveryVersion": "v1", + "documentationLink": "https://developers.google.com/prediction/docs/developer-guide", + "etag": "\"-iA1DTNe4s-I6JZXPt1t1Ypy8IU/B0qrlmHp5fl-zt3tPCgucMogpLQ\"", + "icons": { + "x16": "https://www.google.com/images/icons/feature/predictionapi-16.png", + "x32": "https://www.google.com/images/icons/feature/predictionapi-32.png" + }, + "id": "prediction:v1.5", + "kind": "discovery#restDescription", + "name": "prediction", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "alt": { + "default": "json", + "description": "Data format for the response.", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query", + "type": "string" + }, + "userIp": { + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "hostedmodels": { + "methods": { + "predict": { + "description": "Submit input and request an output against a hosted model.", + "httpMethod": "POST", + "id": "prediction.hostedmodels.predict", + "parameterOrder": [ + "hostedModelName" + ], + "parameters": { + "hostedModelName": { + "description": "The name of a hosted model.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "hostedmodels/{hostedModelName}/predict", + "request": { + "$ref": "Input" + }, + "response": { + "$ref": "Output" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + } + } + }, + "trainedmodels": { + "methods": { + "analyze": { + "description": "Get analysis of the model and the data the model was trained on.", + "httpMethod": "GET", + "id": "prediction.trainedmodels.analyze", + "parameterOrder": [ + "id" + ], + "parameters": { + "id": { + "description": "The unique name for the predictive model.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "trainedmodels/{id}/analyze", + "response": { + "$ref": "Analyze" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "delete": { + "description": "Delete a trained model.", + "httpMethod": "DELETE", + "id": "prediction.trainedmodels.delete", + "parameterOrder": [ + "id" + ], + "parameters": { + "id": { + "description": "The unique name for the predictive model.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "trainedmodels/{id}", + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "get": { + "description": "Check training status of your model.", + "httpMethod": "GET", + "id": "prediction.trainedmodels.get", + "parameterOrder": [ + "id" + ], + "parameters": { + "id": { + "description": "The unique name for the predictive model.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "trainedmodels/{id}", + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "insert": { + "description": "Begin training your model.", + "httpMethod": "POST", + "id": "prediction.trainedmodels.insert", + "path": "trainedmodels", + "request": { + "$ref": "Training" + }, + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/prediction" + ] + }, + "list": { + "description": "List available models.", + "httpMethod": "GET", + "id": "prediction.trainedmodels.list", + "parameters": { + "maxResults": { + "description": "Maximum number of results to return", + "format": "uint32", + "location": "query", + "minimum": "0", + "type": "integer" + }, + "pageToken": { + "description": "Pagination token", + "location": "query", + "type": "string" + } + }, + "path": "trainedmodels/list", + "response": { + "$ref": "List" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "predict": { + "description": "Submit model id and request a prediction.", + "httpMethod": "POST", + "id": "prediction.trainedmodels.predict", + "parameterOrder": [ + "id" + ], + "parameters": { + "id": { + "description": "The unique name for the predictive model.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "trainedmodels/{id}/predict", + "request": { + "$ref": "Input" + }, + "response": { + "$ref": "Output" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + }, + "update": { + "description": "Add new data to a trained model.", + "httpMethod": "PUT", + "id": "prediction.trainedmodels.update", + "parameterOrder": [ + "id" + ], + "parameters": { + "id": { + "description": "The unique name for the predictive model.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "trainedmodels/{id}", + "request": { + "$ref": "Update" + }, + "response": { + "$ref": "Training" + }, + "scopes": [ + "https://www.googleapis.com/auth/prediction" + ] + } + } + } + }, + "revision": "20160511", + "rootUrl": "https://www.googleapis.com/", + "schemas": { + "Analyze": { + "id": "Analyze", + "properties": { + "dataDescription": { + "description": "Description of the data the model was trained on.", + "properties": { + "features": { + "description": "Description of the input features in the data set.", + "items": { + "properties": { + "categorical": { + "description": "Description of the categorical values of this feature.", + "properties": { + "count": { + "description": "Number of categorical values for this feature in the data.", + "format": "int64", + "type": "string" + }, + "values": { + "description": "List of all the categories for this feature in the data set.", + "items": { + "properties": { + "count": { + "description": "Number of times this feature had this value.", + "format": "int64", + "type": "string" + }, + "value": { + "description": "The category name.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "index": { + "description": "The feature index.", + "format": "int64", + "type": "string" + }, + "numeric": { + "description": "Description of the numeric values of this feature.", + "properties": { + "count": { + "description": "Number of numeric values for this feature in the data set.", + "format": "int64", + "type": "string" + }, + "mean": { + "description": "Mean of the numeric values of this feature in the data set.", + "format": "double", + "type": "number" + }, + "variance": { + "description": "Variance of the numeric values of this feature in the data set.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "text": { + "description": "Description of multiple-word text values of this feature.", + "properties": { + "count": { + "description": "Number of multiple-word text values for this feature.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "outputFeature": { + "description": "Description of the output value or label.", + "properties": { + "numeric": { + "description": "Description of the output values in the data set.", + "properties": { + "count": { + "description": "Number of numeric output values in the data set.", + "format": "int64", + "type": "string" + }, + "mean": { + "description": "Mean of the output values in the data set.", + "format": "double", + "type": "number" + }, + "variance": { + "description": "Variance of the output values in the data set.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "text": { + "description": "Description of the output labels in the data set.", + "items": { + "properties": { + "count": { + "description": "Number of times the output label occurred in the data set.", + "format": "int64", + "type": "string" + }, + "value": { + "description": "The output label.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "errors": { + "description": "List of errors with the data.", + "items": { + "additionalProperties": { + "description": "Error level followed by a detailed error message.", + "type": "string" + }, + "type": "object" + }, + "type": "array" + }, + "id": { + "description": "The unique name for the predictive model.", + "type": "string" + }, + "kind": { + "default": "prediction#analyze", + "description": "What kind of resource this is.", + "type": "string" + }, + "modelDescription": { + "description": "Description of the model.", + "properties": { + "confusionMatrix": { + "additionalProperties": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "type": "object" + }, + "description": "An output confusion matrix. This shows an estimate for how this model will do in predictions. This is first indexed by the true class label. For each true class label, this provides a pair {predicted_label, count}, where count is the estimated number of times the model will predict the predicted label given the true label. Will not output if more then 100 classes [Categorical models only].", + "type": "object" + }, + "confusionMatrixRowTotals": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "description": "A list of the confusion matrix row totals", + "type": "object" + }, + "modelinfo": { + "$ref": "Training", + "description": "Basic information about the model." + } + }, + "type": "object" + }, + "selfLink": { + "description": "A URL to re-request this resource.", + "type": "string" + } + }, + "type": "object" + }, + "Input": { + "id": "Input", + "properties": { + "input": { + "description": "Input to the model for a prediction", + "properties": { + "csvInstance": { + "description": "A list of input features, these can be strings or doubles.", + "items": { + "type": "any" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "List": { + "id": "List", + "properties": { + "items": { + "description": "List of models.", + "items": { + "$ref": "Training" + }, + "type": "array" + }, + "kind": { + "default": "prediction#list", + "description": "What kind of resource this is.", + "type": "string" + }, + "nextPageToken": { + "description": "Pagination token to fetch the next page, if one exists.", + "type": "string" + }, + "selfLink": { + "description": "A URL to re-request this resource.", + "type": "string" + } + }, + "type": "object" + }, + "Output": { + "id": "Output", + "properties": { + "id": { + "description": "The unique name for the predictive model.", + "type": "string" + }, + "kind": { + "default": "prediction#output", + "description": "What kind of resource this is.", + "type": "string" + }, + "outputLabel": { + "description": "The most likely class label [Categorical models only].", + "type": "string" + }, + "outputMulti": { + "description": "A list of class labels with their estimated probabilities [Categorical models only].", + "items": { + "properties": { + "label": { + "description": "The class label.", + "type": "string" + }, + "score": { + "description": "The probability of the class label.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "type": "array" + }, + "outputValue": { + "description": "The estimated regression value [Regression models only].", + "format": "double", + "type": "number" + }, + "selfLink": { + "description": "A URL to re-request this resource.", + "type": "string" + } + }, + "type": "object" + }, + "Training": { + "id": "Training", + "properties": { + "created": { + "description": "Insert time of the model (as a RFC 3339 timestamp).", + "format": "date-time", + "type": "string" + }, + "id": { + "description": "The unique name for the predictive model.", + "type": "string" + }, + "kind": { + "default": "prediction#training", + "description": "What kind of resource this is.", + "type": "string" + }, + "modelInfo": { + "description": "Model metadata.", + "properties": { + "classWeightedAccuracy": { + "description": "Estimated accuracy of model taking utility weights into account [Categorical models only].", + "format": "double", + "type": "number" + }, + "classificationAccuracy": { + "description": "A number between 0.0 and 1.0, where 1.0 is 100% accurate. This is an estimate, based on the amount and quality of the training data, of the estimated prediction accuracy. You can use this is a guide to decide whether the results are accurate enough for your needs. This estimate will be more reliable if your real input data is similar to your training data [Categorical models only].", + "format": "double", + "type": "number" + }, + "meanSquaredError": { + "description": "An estimated mean squared error. The can be used to measure the quality of the predicted model [Regression models only].", + "format": "double", + "type": "number" + }, + "modelType": { + "description": "Type of predictive model (CLASSIFICATION or REGRESSION)", + "type": "string" + }, + "numberInstances": { + "description": "Number of valid data instances used in the trained model.", + "format": "int64", + "type": "string" + }, + "numberLabels": { + "description": "Number of class labels in the trained model [Categorical models only].", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "modelType": { + "description": "Type of predictive model (classification or regression)", + "type": "string" + }, + "selfLink": { + "description": "A URL to re-request this resource.", + "type": "string" + }, + "storageDataLocation": { + "description": "Google storage location of the training data file.", + "type": "string" + }, + "storagePMMLLocation": { + "description": "Google storage location of the preprocessing pmml file.", + "type": "string" + }, + "storagePMMLModelLocation": { + "description": "Google storage location of the pmml model file.", + "type": "string" + }, + "trainingComplete": { + "description": "Training completion time (as a RFC 3339 timestamp).", + "format": "date-time", + "type": "string" + }, + "trainingInstances": { + "description": "Instances to train model on.", + "items": { + "properties": { + "csvInstance": { + "description": "The input features for this instance", + "items": { + "type": "any" + }, + "type": "array" + }, + "output": { + "description": "The generic output value - could be regression or class label", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "trainingStatus": { + "description": "The current status of the training job. This can be one of following: RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND", + "type": "string" + }, + "utility": { + "description": "A class weighting function, which allows the importance weights for class labels to be specified [Categorical models only].", + "items": { + "additionalProperties": { + "format": "double", + "type": "number" + }, + "description": "Class label (string).", + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "Update": { + "id": "Update", + "properties": { + "csvInstance": { + "description": "The input features for this instance", + "items": { + "type": "any" + }, + "type": "array" + }, + "label": { + "description": "The class label of this instance", + "type": "string" + }, + "output": { + "description": "The generic output value - could be regression value or class label", + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "prediction/v1.5/", + "title": "Prediction API", + "version": "v1.5" +} \ No newline at end of file diff --git a/vendor/google.golang.org/api/prediction/v1.5/prediction-gen.go b/vendor/google.golang.org/api/prediction/v1.5/prediction-gen.go new file mode 100644 index 00000000..5571bdeb --- /dev/null +++ b/vendor/google.golang.org/api/prediction/v1.5/prediction-gen.go @@ -0,0 +1,1992 @@ +// Copyright 2018 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// AUTO-GENERATED CODE. DO NOT EDIT. + +// Package prediction provides access to the Prediction API. +// +// See https://developers.google.com/prediction/docs/developer-guide +// +// Usage example: +// +// import "google.golang.org/api/prediction/v1.5" +// ... +// predictionService, err := prediction.New(oauthHttpClient) +package prediction // import "google.golang.org/api/prediction/v1.5" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + gensupport "google.golang.org/api/gensupport" + googleapi "google.golang.org/api/googleapi" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled + +const apiId = "prediction:v1.5" +const apiName = "prediction" +const apiVersion = "v1.5" +const basePath = "https://www.googleapis.com/prediction/v1.5/" + +// OAuth2 scopes used by this API. +const ( + // Manage your data and permissions in Google Cloud Storage + DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write" + + // Manage your data in the Google Prediction API + PredictionScope = "https://www.googleapis.com/auth/prediction" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Hostedmodels = NewHostedmodelsService(s) + s.Trainedmodels = NewTrainedmodelsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Hostedmodels *HostedmodelsService + + Trainedmodels *TrainedmodelsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewHostedmodelsService(s *Service) *HostedmodelsService { + rs := &HostedmodelsService{s: s} + return rs +} + +type HostedmodelsService struct { + s *Service +} + +func NewTrainedmodelsService(s *Service) *TrainedmodelsService { + rs := &TrainedmodelsService{s: s} + return rs +} + +type TrainedmodelsService struct { + s *Service +} + +type Analyze struct { + // DataDescription: Description of the data the model was trained on. + DataDescription *AnalyzeDataDescription `json:"dataDescription,omitempty"` + + // Errors: List of errors with the data. + Errors []map[string]string `json:"errors,omitempty"` + + // Id: The unique name for the predictive model. + Id string `json:"id,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // ModelDescription: Description of the model. + ModelDescription *AnalyzeModelDescription `json:"modelDescription,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DataDescription") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DataDescription") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *Analyze) MarshalJSON() ([]byte, error) { + type NoMethod Analyze + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AnalyzeDataDescription: Description of the data the model was trained +// on. +type AnalyzeDataDescription struct { + // Features: Description of the input features in the data set. + Features []*AnalyzeDataDescriptionFeatures `json:"features,omitempty"` + + // OutputFeature: Description of the output value or label. + OutputFeature *AnalyzeDataDescriptionOutputFeature `json:"outputFeature,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Features") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Features") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AnalyzeDataDescription) MarshalJSON() ([]byte, error) { + type NoMethod AnalyzeDataDescription + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type AnalyzeDataDescriptionFeatures struct { + // Categorical: Description of the categorical values of this feature. + Categorical *AnalyzeDataDescriptionFeaturesCategorical `json:"categorical,omitempty"` + + // Index: The feature index. + Index int64 `json:"index,omitempty,string"` + + // Numeric: Description of the numeric values of this feature. + Numeric *AnalyzeDataDescriptionFeaturesNumeric `json:"numeric,omitempty"` + + // Text: Description of multiple-word text values of this feature. + Text *AnalyzeDataDescriptionFeaturesText `json:"text,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Categorical") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Categorical") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AnalyzeDataDescriptionFeatures) MarshalJSON() ([]byte, error) { + type NoMethod AnalyzeDataDescriptionFeatures + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AnalyzeDataDescriptionFeaturesCategorical: Description of the +// categorical values of this feature. +type AnalyzeDataDescriptionFeaturesCategorical struct { + // Count: Number of categorical values for this feature in the data. + Count int64 `json:"count,omitempty,string"` + + // Values: List of all the categories for this feature in the data set. + Values []*AnalyzeDataDescriptionFeaturesCategoricalValues `json:"values,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Count") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AnalyzeDataDescriptionFeaturesCategorical) MarshalJSON() ([]byte, error) { + type NoMethod AnalyzeDataDescriptionFeaturesCategorical + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type AnalyzeDataDescriptionFeaturesCategoricalValues struct { + // Count: Number of times this feature had this value. + Count int64 `json:"count,omitempty,string"` + + // Value: The category name. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Count") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AnalyzeDataDescriptionFeaturesCategoricalValues) MarshalJSON() ([]byte, error) { + type NoMethod AnalyzeDataDescriptionFeaturesCategoricalValues + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AnalyzeDataDescriptionFeaturesNumeric: Description of the numeric +// values of this feature. +type AnalyzeDataDescriptionFeaturesNumeric struct { + // Count: Number of numeric values for this feature in the data set. + Count int64 `json:"count,omitempty,string"` + + // Mean: Mean of the numeric values of this feature in the data set. + Mean float64 `json:"mean,omitempty"` + + // Variance: Variance of the numeric values of this feature in the data + // set. + Variance float64 `json:"variance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Count") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AnalyzeDataDescriptionFeaturesNumeric) MarshalJSON() ([]byte, error) { + type NoMethod AnalyzeDataDescriptionFeaturesNumeric + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *AnalyzeDataDescriptionFeaturesNumeric) UnmarshalJSON(data []byte) error { + type NoMethod AnalyzeDataDescriptionFeaturesNumeric + var s1 struct { + Mean gensupport.JSONFloat64 `json:"mean"` + Variance gensupport.JSONFloat64 `json:"variance"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Mean = float64(s1.Mean) + s.Variance = float64(s1.Variance) + return nil +} + +// AnalyzeDataDescriptionFeaturesText: Description of multiple-word text +// values of this feature. +type AnalyzeDataDescriptionFeaturesText struct { + // Count: Number of multiple-word text values for this feature. + Count int64 `json:"count,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Count") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AnalyzeDataDescriptionFeaturesText) MarshalJSON() ([]byte, error) { + type NoMethod AnalyzeDataDescriptionFeaturesText + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AnalyzeDataDescriptionOutputFeature: Description of the output value +// or label. +type AnalyzeDataDescriptionOutputFeature struct { + // Numeric: Description of the output values in the data set. + Numeric *AnalyzeDataDescriptionOutputFeatureNumeric `json:"numeric,omitempty"` + + // Text: Description of the output labels in the data set. + Text []*AnalyzeDataDescriptionOutputFeatureText `json:"text,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Numeric") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Numeric") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AnalyzeDataDescriptionOutputFeature) MarshalJSON() ([]byte, error) { + type NoMethod AnalyzeDataDescriptionOutputFeature + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AnalyzeDataDescriptionOutputFeatureNumeric: Description of the output +// values in the data set. +type AnalyzeDataDescriptionOutputFeatureNumeric struct { + // Count: Number of numeric output values in the data set. + Count int64 `json:"count,omitempty,string"` + + // Mean: Mean of the output values in the data set. + Mean float64 `json:"mean,omitempty"` + + // Variance: Variance of the output values in the data set. + Variance float64 `json:"variance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Count") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AnalyzeDataDescriptionOutputFeatureNumeric) MarshalJSON() ([]byte, error) { + type NoMethod AnalyzeDataDescriptionOutputFeatureNumeric + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *AnalyzeDataDescriptionOutputFeatureNumeric) UnmarshalJSON(data []byte) error { + type NoMethod AnalyzeDataDescriptionOutputFeatureNumeric + var s1 struct { + Mean gensupport.JSONFloat64 `json:"mean"` + Variance gensupport.JSONFloat64 `json:"variance"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Mean = float64(s1.Mean) + s.Variance = float64(s1.Variance) + return nil +} + +type AnalyzeDataDescriptionOutputFeatureText struct { + // Count: Number of times the output label occurred in the data set. + Count int64 `json:"count,omitempty,string"` + + // Value: The output label. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Count") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AnalyzeDataDescriptionOutputFeatureText) MarshalJSON() ([]byte, error) { + type NoMethod AnalyzeDataDescriptionOutputFeatureText + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AnalyzeModelDescription: Description of the model. +type AnalyzeModelDescription struct { + // ConfusionMatrix: An output confusion matrix. This shows an estimate + // for how this model will do in predictions. This is first indexed by + // the true class label. For each true class label, this provides a pair + // {predicted_label, count}, where count is the estimated number of + // times the model will predict the predicted label given the true + // label. Will not output if more then 100 classes [Categorical models + // only]. + ConfusionMatrix map[string]map[string]float64 `json:"confusionMatrix,omitempty"` + + // ConfusionMatrixRowTotals: A list of the confusion matrix row totals + ConfusionMatrixRowTotals map[string]float64 `json:"confusionMatrixRowTotals,omitempty"` + + // Modelinfo: Basic information about the model. + Modelinfo *Training `json:"modelinfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ConfusionMatrix") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ConfusionMatrix") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *AnalyzeModelDescription) MarshalJSON() ([]byte, error) { + type NoMethod AnalyzeModelDescription + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type Input struct { + // Input: Input to the model for a prediction + Input *InputInput `json:"input,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Input") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Input") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Input) MarshalJSON() ([]byte, error) { + type NoMethod Input + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// InputInput: Input to the model for a prediction +type InputInput struct { + // CsvInstance: A list of input features, these can be strings or + // doubles. + CsvInstance []interface{} `json:"csvInstance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CsvInstance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CsvInstance") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *InputInput) MarshalJSON() ([]byte, error) { + type NoMethod InputInput + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type List struct { + // Items: List of models. + Items []*Training `json:"items,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Items") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *List) MarshalJSON() ([]byte, error) { + type NoMethod List + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type Output struct { + // Id: The unique name for the predictive model. + Id string `json:"id,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // OutputLabel: The most likely class label [Categorical models only]. + OutputLabel string `json:"outputLabel,omitempty"` + + // OutputMulti: A list of class labels with their estimated + // probabilities [Categorical models only]. + OutputMulti []*OutputOutputMulti `json:"outputMulti,omitempty"` + + // OutputValue: The estimated regression value [Regression models only]. + OutputValue float64 `json:"outputValue,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Id") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Output) MarshalJSON() ([]byte, error) { + type NoMethod Output + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *Output) UnmarshalJSON(data []byte) error { + type NoMethod Output + var s1 struct { + OutputValue gensupport.JSONFloat64 `json:"outputValue"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.OutputValue = float64(s1.OutputValue) + return nil +} + +type OutputOutputMulti struct { + // Label: The class label. + Label string `json:"label,omitempty"` + + // Score: The probability of the class label. + Score float64 `json:"score,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Label") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Label") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *OutputOutputMulti) MarshalJSON() ([]byte, error) { + type NoMethod OutputOutputMulti + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *OutputOutputMulti) UnmarshalJSON(data []byte) error { + type NoMethod OutputOutputMulti + var s1 struct { + Score gensupport.JSONFloat64 `json:"score"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Score = float64(s1.Score) + return nil +} + +type Training struct { + // Created: Insert time of the model (as a RFC 3339 timestamp). + Created string `json:"created,omitempty"` + + // Id: The unique name for the predictive model. + Id string `json:"id,omitempty"` + + // Kind: What kind of resource this is. + Kind string `json:"kind,omitempty"` + + // ModelInfo: Model metadata. + ModelInfo *TrainingModelInfo `json:"modelInfo,omitempty"` + + // ModelType: Type of predictive model (classification or regression) + ModelType string `json:"modelType,omitempty"` + + // SelfLink: A URL to re-request this resource. + SelfLink string `json:"selfLink,omitempty"` + + // StorageDataLocation: Google storage location of the training data + // file. + StorageDataLocation string `json:"storageDataLocation,omitempty"` + + // StoragePMMLLocation: Google storage location of the preprocessing + // pmml file. + StoragePMMLLocation string `json:"storagePMMLLocation,omitempty"` + + // StoragePMMLModelLocation: Google storage location of the pmml model + // file. + StoragePMMLModelLocation string `json:"storagePMMLModelLocation,omitempty"` + + // TrainingComplete: Training completion time (as a RFC 3339 timestamp). + TrainingComplete string `json:"trainingComplete,omitempty"` + + // TrainingInstances: Instances to train model on. + TrainingInstances []*TrainingTrainingInstances `json:"trainingInstances,omitempty"` + + // TrainingStatus: The current status of the training job. This can be + // one of following: RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND + TrainingStatus string `json:"trainingStatus,omitempty"` + + // Utility: A class weighting function, which allows the importance + // weights for class labels to be specified [Categorical models only]. + Utility []map[string]float64 `json:"utility,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Created") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Created") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Training) MarshalJSON() ([]byte, error) { + type NoMethod Training + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TrainingModelInfo: Model metadata. +type TrainingModelInfo struct { + // ClassWeightedAccuracy: Estimated accuracy of model taking utility + // weights into account [Categorical models only]. + ClassWeightedAccuracy float64 `json:"classWeightedAccuracy,omitempty"` + + // ClassificationAccuracy: A number between 0.0 and 1.0, where 1.0 is + // 100% accurate. This is an estimate, based on the amount and quality + // of the training data, of the estimated prediction accuracy. You can + // use this is a guide to decide whether the results are accurate enough + // for your needs. This estimate will be more reliable if your real + // input data is similar to your training data [Categorical models + // only]. + ClassificationAccuracy float64 `json:"classificationAccuracy,omitempty"` + + // MeanSquaredError: An estimated mean squared error. The can be used to + // measure the quality of the predicted model [Regression models only]. + MeanSquaredError float64 `json:"meanSquaredError,omitempty"` + + // ModelType: Type of predictive model (CLASSIFICATION or REGRESSION) + ModelType string `json:"modelType,omitempty"` + + // NumberInstances: Number of valid data instances used in the trained + // model. + NumberInstances int64 `json:"numberInstances,omitempty,string"` + + // NumberLabels: Number of class labels in the trained model + // [Categorical models only]. + NumberLabels int64 `json:"numberLabels,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. + // "ClassWeightedAccuracy") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ClassWeightedAccuracy") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *TrainingModelInfo) MarshalJSON() ([]byte, error) { + type NoMethod TrainingModelInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *TrainingModelInfo) UnmarshalJSON(data []byte) error { + type NoMethod TrainingModelInfo + var s1 struct { + ClassWeightedAccuracy gensupport.JSONFloat64 `json:"classWeightedAccuracy"` + ClassificationAccuracy gensupport.JSONFloat64 `json:"classificationAccuracy"` + MeanSquaredError gensupport.JSONFloat64 `json:"meanSquaredError"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.ClassWeightedAccuracy = float64(s1.ClassWeightedAccuracy) + s.ClassificationAccuracy = float64(s1.ClassificationAccuracy) + s.MeanSquaredError = float64(s1.MeanSquaredError) + return nil +} + +type TrainingTrainingInstances struct { + // CsvInstance: The input features for this instance + CsvInstance []interface{} `json:"csvInstance,omitempty"` + + // Output: The generic output value - could be regression or class label + Output string `json:"output,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CsvInstance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CsvInstance") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *TrainingTrainingInstances) MarshalJSON() ([]byte, error) { + type NoMethod TrainingTrainingInstances + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type Update struct { + // CsvInstance: The input features for this instance + CsvInstance []interface{} `json:"csvInstance,omitempty"` + + // Label: The class label of this instance + Label string `json:"label,omitempty"` + + // Output: The generic output value - could be regression value or class + // label + Output string `json:"output,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CsvInstance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CsvInstance") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Update) MarshalJSON() ([]byte, error) { + type NoMethod Update + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "prediction.hostedmodels.predict": + +type HostedmodelsPredictCall struct { + s *Service + hostedModelName string + input *Input + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Predict: Submit input and request an output against a hosted model. +func (r *HostedmodelsService) Predict(hostedModelName string, input *Input) *HostedmodelsPredictCall { + c := &HostedmodelsPredictCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.hostedModelName = hostedModelName + c.input = input + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HostedmodelsPredictCall) Fields(s ...googleapi.Field) *HostedmodelsPredictCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *HostedmodelsPredictCall) Context(ctx context.Context) *HostedmodelsPredictCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *HostedmodelsPredictCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *HostedmodelsPredictCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.input) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "hostedmodels/{hostedModelName}/predict") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "hostedModelName": c.hostedModelName, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "prediction.hostedmodels.predict" call. +// Exactly one of *Output or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Output.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *HostedmodelsPredictCall) Do(opts ...googleapi.CallOption) (*Output, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Output{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit input and request an output against a hosted model.", + // "httpMethod": "POST", + // "id": "prediction.hostedmodels.predict", + // "parameterOrder": [ + // "hostedModelName" + // ], + // "parameters": { + // "hostedModelName": { + // "description": "The name of a hosted model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "hostedmodels/{hostedModelName}/predict", + // "request": { + // "$ref": "Input" + // }, + // "response": { + // "$ref": "Output" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.analyze": + +type TrainedmodelsAnalyzeCall struct { + s *Service + id string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Analyze: Get analysis of the model and the data the model was trained +// on. +func (r *TrainedmodelsService) Analyze(id string) *TrainedmodelsAnalyzeCall { + c := &TrainedmodelsAnalyzeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainedmodelsAnalyzeCall) Fields(s ...googleapi.Field) *TrainedmodelsAnalyzeCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TrainedmodelsAnalyzeCall) IfNoneMatch(entityTag string) *TrainedmodelsAnalyzeCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TrainedmodelsAnalyzeCall) Context(ctx context.Context) *TrainedmodelsAnalyzeCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *TrainedmodelsAnalyzeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *TrainedmodelsAnalyzeCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}/analyze") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "prediction.trainedmodels.analyze" call. +// Exactly one of *Analyze or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Analyze.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TrainedmodelsAnalyzeCall) Do(opts ...googleapi.CallOption) (*Analyze, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Analyze{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get analysis of the model and the data the model was trained on.", + // "httpMethod": "GET", + // "id": "prediction.trainedmodels.analyze", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "trainedmodels/{id}/analyze", + // "response": { + // "$ref": "Analyze" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.delete": + +type TrainedmodelsDeleteCall struct { + s *Service + id string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Delete a trained model. +func (r *TrainedmodelsService) Delete(id string) *TrainedmodelsDeleteCall { + c := &TrainedmodelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainedmodelsDeleteCall) Fields(s ...googleapi.Field) *TrainedmodelsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TrainedmodelsDeleteCall) Context(ctx context.Context) *TrainedmodelsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *TrainedmodelsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *TrainedmodelsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "prediction.trainedmodels.delete" call. +func (c *TrainedmodelsDeleteCall) Do(opts ...googleapi.CallOption) error { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a trained model.", + // "httpMethod": "DELETE", + // "id": "prediction.trainedmodels.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "trainedmodels/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.get": + +type TrainedmodelsGetCall struct { + s *Service + id string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Check training status of your model. +func (r *TrainedmodelsService) Get(id string) *TrainedmodelsGetCall { + c := &TrainedmodelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainedmodelsGetCall) Fields(s ...googleapi.Field) *TrainedmodelsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TrainedmodelsGetCall) IfNoneMatch(entityTag string) *TrainedmodelsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TrainedmodelsGetCall) Context(ctx context.Context) *TrainedmodelsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *TrainedmodelsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *TrainedmodelsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "prediction.trainedmodels.get" call. +// Exactly one of *Training or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Training.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TrainedmodelsGetCall) Do(opts ...googleapi.CallOption) (*Training, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Training{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Check training status of your model.", + // "httpMethod": "GET", + // "id": "prediction.trainedmodels.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "trainedmodels/{id}", + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.insert": + +type TrainedmodelsInsertCall struct { + s *Service + training *Training + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Begin training your model. +func (r *TrainedmodelsService) Insert(training *Training) *TrainedmodelsInsertCall { + c := &TrainedmodelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.training = training + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainedmodelsInsertCall) Fields(s ...googleapi.Field) *TrainedmodelsInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TrainedmodelsInsertCall) Context(ctx context.Context) *TrainedmodelsInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *TrainedmodelsInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *TrainedmodelsInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.training) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "prediction.trainedmodels.insert" call. +// Exactly one of *Training or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Training.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TrainedmodelsInsertCall) Do(opts ...googleapi.CallOption) (*Training, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Training{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Begin training your model.", + // "httpMethod": "POST", + // "id": "prediction.trainedmodels.insert", + // "path": "trainedmodels", + // "request": { + // "$ref": "Training" + // }, + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_only", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.list": + +type TrainedmodelsListCall struct { + s *Service + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: List available models. +func (r *TrainedmodelsService) List() *TrainedmodelsListCall { + c := &TrainedmodelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return +func (c *TrainedmodelsListCall) MaxResults(maxResults int64) *TrainedmodelsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// PageToken sets the optional parameter "pageToken": Pagination token +func (c *TrainedmodelsListCall) PageToken(pageToken string) *TrainedmodelsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainedmodelsListCall) Fields(s ...googleapi.Field) *TrainedmodelsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TrainedmodelsListCall) IfNoneMatch(entityTag string) *TrainedmodelsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TrainedmodelsListCall) Context(ctx context.Context) *TrainedmodelsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *TrainedmodelsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *TrainedmodelsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/list") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "prediction.trainedmodels.list" call. +// Exactly one of *List or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *List.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TrainedmodelsListCall) Do(opts ...googleapi.CallOption) (*List, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &List{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List available models.", + // "httpMethod": "GET", + // "id": "prediction.trainedmodels.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of results to return", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Pagination token", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "trainedmodels/list", + // "response": { + // "$ref": "List" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *TrainedmodelsListCall) Pages(ctx context.Context, f func(*List) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "prediction.trainedmodels.predict": + +type TrainedmodelsPredictCall struct { + s *Service + id string + input *Input + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Predict: Submit model id and request a prediction. +func (r *TrainedmodelsService) Predict(id string, input *Input) *TrainedmodelsPredictCall { + c := &TrainedmodelsPredictCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.id = id + c.input = input + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainedmodelsPredictCall) Fields(s ...googleapi.Field) *TrainedmodelsPredictCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TrainedmodelsPredictCall) Context(ctx context.Context) *TrainedmodelsPredictCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *TrainedmodelsPredictCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *TrainedmodelsPredictCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.input) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}/predict") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "prediction.trainedmodels.predict" call. +// Exactly one of *Output or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Output.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TrainedmodelsPredictCall) Do(opts ...googleapi.CallOption) (*Output, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Output{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Submit model id and request a prediction.", + // "httpMethod": "POST", + // "id": "prediction.trainedmodels.predict", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "trainedmodels/{id}/predict", + // "request": { + // "$ref": "Input" + // }, + // "response": { + // "$ref": "Output" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.trainedmodels.update": + +type TrainedmodelsUpdateCall struct { + s *Service + id string + update *Update + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Update: Add new data to a trained model. +func (r *TrainedmodelsService) Update(id string, update *Update) *TrainedmodelsUpdateCall { + c := &TrainedmodelsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.id = id + c.update = update + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainedmodelsUpdateCall) Fields(s ...googleapi.Field) *TrainedmodelsUpdateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TrainedmodelsUpdateCall) Context(ctx context.Context) *TrainedmodelsUpdateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *TrainedmodelsUpdateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *TrainedmodelsUpdateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.update) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("PUT", urls, body) + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "prediction.trainedmodels.update" call. +// Exactly one of *Training or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Training.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TrainedmodelsUpdateCall) Do(opts ...googleapi.CallOption) (*Training, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Training{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add new data to a trained model.", + // "httpMethod": "PUT", + // "id": "prediction.trainedmodels.update", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The unique name for the predictive model.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "trainedmodels/{id}", + // "request": { + // "$ref": "Update" + // }, + // "response": { + // "$ref": "Training" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +}