1// Package servicefabric implements the Azure ARM Servicefabric service API version 6.2.0.9.
2//
3// Service Fabric REST Client APIs allows management of Service Fabric clusters, applications and services.
4package servicefabric
5
6// Copyright (c) Microsoft Corporation. All rights reserved.
7// Licensed under the MIT License. See License.txt in the project root for license information.
8//
9// Code generated by Microsoft (R) AutoRest Code Generator.
10// Changes may cause incorrect behavior and will be lost if the code is regenerated.
11
12import (
13	"context"
14	"github.com/Azure/go-autorest/autorest"
15	"github.com/Azure/go-autorest/autorest/azure"
16	"github.com/Azure/go-autorest/autorest/date"
17	"github.com/Azure/go-autorest/autorest/validation"
18	"github.com/Azure/go-autorest/tracing"
19	"github.com/gofrs/uuid"
20	"net/http"
21)
22
23const (
24	// DefaultBaseURI is the default URI used for the service Servicefabric
25	DefaultBaseURI = "http://localhost:19080"
26)
27
28// BaseClient is the base client for Servicefabric.
29type BaseClient struct {
30	autorest.Client
31	BaseURI string
32}
33
34// New creates an instance of the BaseClient client.
35func New() BaseClient {
36	return NewWithBaseURI(DefaultBaseURI)
37}
38
39// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint.  Use this when interacting with
40// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
41func NewWithBaseURI(baseURI string) BaseClient {
42	return BaseClient{
43		Client:  autorest.NewClientWithUserAgent(UserAgent()),
44		BaseURI: baseURI,
45	}
46}
47
48// BackupPartition creates a backup of the stateful persisted partition's state. In case the partition is already being
49// periodically backed up, then by default the new backup is created at the same backup storage. One can also override
50// the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its
51// progress can be tracked using the GetBackupProgress operation.
52// In case, the operation times out, specify a greater backup timeout value in the query parameter.
53// Parameters:
54// partitionID - the identity of the partition.
55// backupPartitionDescription - describes the parameters to backup the partition now. If not present, backup
56// operation uses default parameters from the backup policy current associated with this partition.
57// backupTimeout - specifies the maximum amount of time, in minutes, to wait for the backup operation to
58// complete. Post that, the operation completes with timeout error. However, in certain corner cases it could
59// be that though the operation returns back timeout, the backup actually goes through. In case of timeout
60// error, its recommended to invoke this operation again with a greater timeout value. The default value for
61// the same is 10 minutes.
62// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
63// duration that the client is willing to wait for the requested operation to complete. The default value for
64// this parameter is 60 seconds.
65func (client BaseClient) BackupPartition(ctx context.Context, partitionID uuid.UUID, backupPartitionDescription *BackupPartitionDescription, backupTimeout *int32, timeout *int64) (result autorest.Response, err error) {
66	if tracing.IsEnabled() {
67		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.BackupPartition")
68		defer func() {
69			sc := -1
70			if result.Response != nil {
71				sc = result.Response.StatusCode
72			}
73			tracing.EndSpan(ctx, sc, err)
74		}()
75	}
76	if err := validation.Validate([]validation.Validation{
77		{TargetValue: timeout,
78			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
79				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
80					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
81				}}}}}); err != nil {
82		return result, validation.NewError("servicefabric.BaseClient", "BackupPartition", err.Error())
83	}
84
85	req, err := client.BackupPartitionPreparer(ctx, partitionID, backupPartitionDescription, backupTimeout, timeout)
86	if err != nil {
87		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "BackupPartition", nil, "Failure preparing request")
88		return
89	}
90
91	resp, err := client.BackupPartitionSender(req)
92	if err != nil {
93		result.Response = resp
94		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "BackupPartition", resp, "Failure sending request")
95		return
96	}
97
98	result, err = client.BackupPartitionResponder(resp)
99	if err != nil {
100		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "BackupPartition", resp, "Failure responding to request")
101		return
102	}
103
104	return
105}
106
107// BackupPartitionPreparer prepares the BackupPartition request.
108func (client BaseClient) BackupPartitionPreparer(ctx context.Context, partitionID uuid.UUID, backupPartitionDescription *BackupPartitionDescription, backupTimeout *int32, timeout *int64) (*http.Request, error) {
109	pathParameters := map[string]interface{}{
110		"partitionId": partitionID,
111	}
112
113	const APIVersion = "6.2-preview"
114	queryParameters := map[string]interface{}{
115		"api-version": APIVersion,
116	}
117	if backupTimeout != nil {
118		queryParameters["BackupTimeout"] = autorest.Encode("query", *backupTimeout)
119	} else {
120		queryParameters["BackupTimeout"] = autorest.Encode("query", 10)
121	}
122	if timeout != nil {
123		queryParameters["timeout"] = autorest.Encode("query", *timeout)
124	} else {
125		queryParameters["timeout"] = autorest.Encode("query", 60)
126	}
127
128	preparer := autorest.CreatePreparer(
129		autorest.AsContentType("application/json; charset=utf-8"),
130		autorest.AsPost(),
131		autorest.WithBaseURL(client.BaseURI),
132		autorest.WithPathParameters("/Partitions/{partitionId}/$/Backup", pathParameters),
133		autorest.WithQueryParameters(queryParameters))
134	if backupPartitionDescription != nil {
135		preparer = autorest.DecoratePreparer(preparer,
136			autorest.WithJSON(backupPartitionDescription))
137	}
138	return preparer.Prepare((&http.Request{}).WithContext(ctx))
139}
140
141// BackupPartitionSender sends the BackupPartition request. The method will close the
142// http.Response Body if it receives an error.
143func (client BaseClient) BackupPartitionSender(req *http.Request) (*http.Response, error) {
144	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
145}
146
147// BackupPartitionResponder handles the response to the BackupPartition request. The method always
148// closes the http.Response Body.
149func (client BaseClient) BackupPartitionResponder(resp *http.Response) (result autorest.Response, err error) {
150	err = autorest.Respond(
151		resp,
152		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
153		autorest.ByClosing())
154	result.Response = resp
155	return
156}
157
158// CancelOperation the following is a list of APIs that start fault operations that may be cancelled using
159// CancelOperation -
160// - StartDataLoss
161// - StartQuorumLoss
162// - StartPartitionRestart
163// - StartNodeTransition
164//
165// If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up.  If force is
166// true, the command will be aborted, and some internal state
167// may be left behind.  Specifying force as true should be used with care.  Calling this API with force set to true is
168// not allowed until this API has already
169// been called on the same test command with force set to false first, or unless the test command already has an
170// OperationState of OperationState.RollingBack.
171// Clarification: OperationState.RollingBack means that the system will/is be cleaning up internal system state caused
172// by executing the command.  It will not restore data if the
173// test command was to cause data loss.  For example, if you call StartDataLoss then call this API, the system will
174// only clean up internal state from running the command.
175// It will not restore the target partition's data, if the command progressed far enough to cause data loss.
176//
177// Important note:  if this API is invoked with force==true, internal state may be left behind.
178// Parameters:
179// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
180// API
181// force - indicates whether to gracefully rollback and clean up internal system state modified by executing
182// the user-induced operation.
183// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
184// duration that the client is willing to wait for the requested operation to complete. The default value for
185// this parameter is 60 seconds.
186func (client BaseClient) CancelOperation(ctx context.Context, operationID uuid.UUID, force bool, timeout *int64) (result autorest.Response, err error) {
187	if tracing.IsEnabled() {
188		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CancelOperation")
189		defer func() {
190			sc := -1
191			if result.Response != nil {
192				sc = result.Response.StatusCode
193			}
194			tracing.EndSpan(ctx, sc, err)
195		}()
196	}
197	if err := validation.Validate([]validation.Validation{
198		{TargetValue: timeout,
199			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
200				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
201					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
202				}}}}}); err != nil {
203		return result, validation.NewError("servicefabric.BaseClient", "CancelOperation", err.Error())
204	}
205
206	req, err := client.CancelOperationPreparer(ctx, operationID, force, timeout)
207	if err != nil {
208		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", nil, "Failure preparing request")
209		return
210	}
211
212	resp, err := client.CancelOperationSender(req)
213	if err != nil {
214		result.Response = resp
215		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", resp, "Failure sending request")
216		return
217	}
218
219	result, err = client.CancelOperationResponder(resp)
220	if err != nil {
221		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", resp, "Failure responding to request")
222		return
223	}
224
225	return
226}
227
228// CancelOperationPreparer prepares the CancelOperation request.
229func (client BaseClient) CancelOperationPreparer(ctx context.Context, operationID uuid.UUID, force bool, timeout *int64) (*http.Request, error) {
230	const APIVersion = "6.0"
231	queryParameters := map[string]interface{}{
232		"api-version": APIVersion,
233		"Force":       autorest.Encode("query", force),
234		"OperationId": autorest.Encode("query", operationID),
235	}
236	if timeout != nil {
237		queryParameters["timeout"] = autorest.Encode("query", *timeout)
238	} else {
239		queryParameters["timeout"] = autorest.Encode("query", 60)
240	}
241
242	preparer := autorest.CreatePreparer(
243		autorest.AsPost(),
244		autorest.WithBaseURL(client.BaseURI),
245		autorest.WithPath("/Faults/$/Cancel"),
246		autorest.WithQueryParameters(queryParameters))
247	return preparer.Prepare((&http.Request{}).WithContext(ctx))
248}
249
250// CancelOperationSender sends the CancelOperation request. The method will close the
251// http.Response Body if it receives an error.
252func (client BaseClient) CancelOperationSender(req *http.Request) (*http.Response, error) {
253	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
254}
255
256// CancelOperationResponder handles the response to the CancelOperation request. The method always
257// closes the http.Response Body.
258func (client BaseClient) CancelOperationResponder(resp *http.Response) (result autorest.Response, err error) {
259	err = autorest.Respond(
260		resp,
261		azure.WithErrorUnlessStatusCode(http.StatusOK),
262		autorest.ByClosing())
263	result.Response = resp
264	return
265}
266
267// CancelRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your code.
268// Parameters:
269// repairTaskCancelDescription - describes the repair task to be cancelled.
270func (client BaseClient) CancelRepairTask(ctx context.Context, repairTaskCancelDescription RepairTaskCancelDescription) (result RepairTaskUpdateInfo, err error) {
271	if tracing.IsEnabled() {
272		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CancelRepairTask")
273		defer func() {
274			sc := -1
275			if result.Response.Response != nil {
276				sc = result.Response.Response.StatusCode
277			}
278			tracing.EndSpan(ctx, sc, err)
279		}()
280	}
281	if err := validation.Validate([]validation.Validation{
282		{TargetValue: repairTaskCancelDescription,
283			Constraints: []validation.Constraint{{Target: "repairTaskCancelDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
284		return result, validation.NewError("servicefabric.BaseClient", "CancelRepairTask", err.Error())
285	}
286
287	req, err := client.CancelRepairTaskPreparer(ctx, repairTaskCancelDescription)
288	if err != nil {
289		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", nil, "Failure preparing request")
290		return
291	}
292
293	resp, err := client.CancelRepairTaskSender(req)
294	if err != nil {
295		result.Response = autorest.Response{Response: resp}
296		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", resp, "Failure sending request")
297		return
298	}
299
300	result, err = client.CancelRepairTaskResponder(resp)
301	if err != nil {
302		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", resp, "Failure responding to request")
303		return
304	}
305
306	return
307}
308
309// CancelRepairTaskPreparer prepares the CancelRepairTask request.
310func (client BaseClient) CancelRepairTaskPreparer(ctx context.Context, repairTaskCancelDescription RepairTaskCancelDescription) (*http.Request, error) {
311	const APIVersion = "6.0"
312	queryParameters := map[string]interface{}{
313		"api-version": APIVersion,
314	}
315
316	preparer := autorest.CreatePreparer(
317		autorest.AsContentType("application/json; charset=utf-8"),
318		autorest.AsPost(),
319		autorest.WithBaseURL(client.BaseURI),
320		autorest.WithPath("/$/CancelRepairTask"),
321		autorest.WithJSON(repairTaskCancelDescription),
322		autorest.WithQueryParameters(queryParameters))
323	return preparer.Prepare((&http.Request{}).WithContext(ctx))
324}
325
326// CancelRepairTaskSender sends the CancelRepairTask request. The method will close the
327// http.Response Body if it receives an error.
328func (client BaseClient) CancelRepairTaskSender(req *http.Request) (*http.Response, error) {
329	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
330}
331
332// CancelRepairTaskResponder handles the response to the CancelRepairTask request. The method always
333// closes the http.Response Body.
334func (client BaseClient) CancelRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
335	err = autorest.Respond(
336		resp,
337		azure.WithErrorUnlessStatusCode(http.StatusOK),
338		autorest.ByUnmarshallingJSON(&result),
339		autorest.ByClosing())
340	result.Response = autorest.Response{Response: resp}
341	return
342}
343
344// CommitImageStoreUploadSession when all file chunks have been uploaded, the upload session needs to be committed
345// explicitly to complete the upload. Image store preserves the upload session until the expiration time, which is 30
346// minutes after the last chunk received.
347// Parameters:
348// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session
349// which keeps track of all file chunks until it is committed.
350// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
351// duration that the client is willing to wait for the requested operation to complete. The default value for
352// this parameter is 60 seconds.
353func (client BaseClient) CommitImageStoreUploadSession(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
354	if tracing.IsEnabled() {
355		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CommitImageStoreUploadSession")
356		defer func() {
357			sc := -1
358			if result.Response != nil {
359				sc = result.Response.StatusCode
360			}
361			tracing.EndSpan(ctx, sc, err)
362		}()
363	}
364	if err := validation.Validate([]validation.Validation{
365		{TargetValue: timeout,
366			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
367				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
368					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
369				}}}}}); err != nil {
370		return result, validation.NewError("servicefabric.BaseClient", "CommitImageStoreUploadSession", err.Error())
371	}
372
373	req, err := client.CommitImageStoreUploadSessionPreparer(ctx, sessionID, timeout)
374	if err != nil {
375		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", nil, "Failure preparing request")
376		return
377	}
378
379	resp, err := client.CommitImageStoreUploadSessionSender(req)
380	if err != nil {
381		result.Response = resp
382		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", resp, "Failure sending request")
383		return
384	}
385
386	result, err = client.CommitImageStoreUploadSessionResponder(resp)
387	if err != nil {
388		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", resp, "Failure responding to request")
389		return
390	}
391
392	return
393}
394
395// CommitImageStoreUploadSessionPreparer prepares the CommitImageStoreUploadSession request.
396func (client BaseClient) CommitImageStoreUploadSessionPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) {
397	const APIVersion = "6.0"
398	queryParameters := map[string]interface{}{
399		"api-version": APIVersion,
400		"session-id":  autorest.Encode("query", sessionID),
401	}
402	if timeout != nil {
403		queryParameters["timeout"] = autorest.Encode("query", *timeout)
404	} else {
405		queryParameters["timeout"] = autorest.Encode("query", 60)
406	}
407
408	preparer := autorest.CreatePreparer(
409		autorest.AsPost(),
410		autorest.WithBaseURL(client.BaseURI),
411		autorest.WithPath("/ImageStore/$/CommitUploadSession"),
412		autorest.WithQueryParameters(queryParameters))
413	return preparer.Prepare((&http.Request{}).WithContext(ctx))
414}
415
416// CommitImageStoreUploadSessionSender sends the CommitImageStoreUploadSession request. The method will close the
417// http.Response Body if it receives an error.
418func (client BaseClient) CommitImageStoreUploadSessionSender(req *http.Request) (*http.Response, error) {
419	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
420}
421
422// CommitImageStoreUploadSessionResponder handles the response to the CommitImageStoreUploadSession request. The method always
423// closes the http.Response Body.
424func (client BaseClient) CommitImageStoreUploadSessionResponder(resp *http.Response) (result autorest.Response, err error) {
425	err = autorest.Respond(
426		resp,
427		azure.WithErrorUnlessStatusCode(http.StatusOK),
428		autorest.ByClosing())
429	result.Response = resp
430	return
431}
432
433// CopyImageStoreContent copies the image store content from the source image store relative path to the destination
434// image store relative path.
435// Parameters:
436// imageStoreCopyDescription - describes the copy description for the image store.
437// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
438// duration that the client is willing to wait for the requested operation to complete. The default value for
439// this parameter is 60 seconds.
440func (client BaseClient) CopyImageStoreContent(ctx context.Context, imageStoreCopyDescription ImageStoreCopyDescription, timeout *int64) (result autorest.Response, err error) {
441	if tracing.IsEnabled() {
442		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CopyImageStoreContent")
443		defer func() {
444			sc := -1
445			if result.Response != nil {
446				sc = result.Response.StatusCode
447			}
448			tracing.EndSpan(ctx, sc, err)
449		}()
450	}
451	if err := validation.Validate([]validation.Validation{
452		{TargetValue: imageStoreCopyDescription,
453			Constraints: []validation.Constraint{{Target: "imageStoreCopyDescription.RemoteSource", Name: validation.Null, Rule: true, Chain: nil},
454				{Target: "imageStoreCopyDescription.RemoteDestination", Name: validation.Null, Rule: true, Chain: nil}}},
455		{TargetValue: timeout,
456			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
457				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
458					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
459				}}}}}); err != nil {
460		return result, validation.NewError("servicefabric.BaseClient", "CopyImageStoreContent", err.Error())
461	}
462
463	req, err := client.CopyImageStoreContentPreparer(ctx, imageStoreCopyDescription, timeout)
464	if err != nil {
465		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", nil, "Failure preparing request")
466		return
467	}
468
469	resp, err := client.CopyImageStoreContentSender(req)
470	if err != nil {
471		result.Response = resp
472		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", resp, "Failure sending request")
473		return
474	}
475
476	result, err = client.CopyImageStoreContentResponder(resp)
477	if err != nil {
478		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", resp, "Failure responding to request")
479		return
480	}
481
482	return
483}
484
485// CopyImageStoreContentPreparer prepares the CopyImageStoreContent request.
486func (client BaseClient) CopyImageStoreContentPreparer(ctx context.Context, imageStoreCopyDescription ImageStoreCopyDescription, timeout *int64) (*http.Request, error) {
487	const APIVersion = "6.0"
488	queryParameters := map[string]interface{}{
489		"api-version": APIVersion,
490	}
491	if timeout != nil {
492		queryParameters["timeout"] = autorest.Encode("query", *timeout)
493	} else {
494		queryParameters["timeout"] = autorest.Encode("query", 60)
495	}
496
497	preparer := autorest.CreatePreparer(
498		autorest.AsContentType("application/json; charset=utf-8"),
499		autorest.AsPost(),
500		autorest.WithBaseURL(client.BaseURI),
501		autorest.WithPath("/ImageStore/$/Copy"),
502		autorest.WithJSON(imageStoreCopyDescription),
503		autorest.WithQueryParameters(queryParameters))
504	return preparer.Prepare((&http.Request{}).WithContext(ctx))
505}
506
507// CopyImageStoreContentSender sends the CopyImageStoreContent request. The method will close the
508// http.Response Body if it receives an error.
509func (client BaseClient) CopyImageStoreContentSender(req *http.Request) (*http.Response, error) {
510	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
511}
512
513// CopyImageStoreContentResponder handles the response to the CopyImageStoreContent request. The method always
514// closes the http.Response Body.
515func (client BaseClient) CopyImageStoreContentResponder(resp *http.Response) (result autorest.Response, err error) {
516	err = autorest.Respond(
517		resp,
518		azure.WithErrorUnlessStatusCode(http.StatusOK),
519		autorest.ByClosing())
520	result.Response = resp
521	return
522}
523
524// CreateApplication creates a Service Fabric application using the specified description.
525// Parameters:
526// applicationDescription - description for creating an application.
527// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
528// duration that the client is willing to wait for the requested operation to complete. The default value for
529// this parameter is 60 seconds.
530func (client BaseClient) CreateApplication(ctx context.Context, applicationDescription ApplicationDescription, timeout *int64) (result autorest.Response, err error) {
531	if tracing.IsEnabled() {
532		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateApplication")
533		defer func() {
534			sc := -1
535			if result.Response != nil {
536				sc = result.Response.StatusCode
537			}
538			tracing.EndSpan(ctx, sc, err)
539		}()
540	}
541	if err := validation.Validate([]validation.Validation{
542		{TargetValue: applicationDescription,
543			Constraints: []validation.Constraint{{Target: "applicationDescription.Name", Name: validation.Null, Rule: true, Chain: nil},
544				{Target: "applicationDescription.TypeName", Name: validation.Null, Rule: true, Chain: nil},
545				{Target: "applicationDescription.TypeVersion", Name: validation.Null, Rule: true, Chain: nil},
546				{Target: "applicationDescription.ApplicationCapacity", Name: validation.Null, Rule: false,
547					Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MinimumNodes", Name: validation.Null, Rule: false,
548						Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MinimumNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}},
549						{Target: "applicationDescription.ApplicationCapacity.MaximumNodes", Name: validation.Null, Rule: false,
550							Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MaximumNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}},
551					}}}},
552		{TargetValue: timeout,
553			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
554				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
555					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
556				}}}}}); err != nil {
557		return result, validation.NewError("servicefabric.BaseClient", "CreateApplication", err.Error())
558	}
559
560	req, err := client.CreateApplicationPreparer(ctx, applicationDescription, timeout)
561	if err != nil {
562		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", nil, "Failure preparing request")
563		return
564	}
565
566	resp, err := client.CreateApplicationSender(req)
567	if err != nil {
568		result.Response = resp
569		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", resp, "Failure sending request")
570		return
571	}
572
573	result, err = client.CreateApplicationResponder(resp)
574	if err != nil {
575		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", resp, "Failure responding to request")
576		return
577	}
578
579	return
580}
581
582// CreateApplicationPreparer prepares the CreateApplication request.
583func (client BaseClient) CreateApplicationPreparer(ctx context.Context, applicationDescription ApplicationDescription, timeout *int64) (*http.Request, error) {
584	const APIVersion = "6.0"
585	queryParameters := map[string]interface{}{
586		"api-version": APIVersion,
587	}
588	if timeout != nil {
589		queryParameters["timeout"] = autorest.Encode("query", *timeout)
590	} else {
591		queryParameters["timeout"] = autorest.Encode("query", 60)
592	}
593
594	preparer := autorest.CreatePreparer(
595		autorest.AsContentType("application/json; charset=utf-8"),
596		autorest.AsPost(),
597		autorest.WithBaseURL(client.BaseURI),
598		autorest.WithPath("/Applications/$/Create"),
599		autorest.WithJSON(applicationDescription),
600		autorest.WithQueryParameters(queryParameters))
601	return preparer.Prepare((&http.Request{}).WithContext(ctx))
602}
603
604// CreateApplicationSender sends the CreateApplication request. The method will close the
605// http.Response Body if it receives an error.
606func (client BaseClient) CreateApplicationSender(req *http.Request) (*http.Response, error) {
607	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
608}
609
610// CreateApplicationResponder handles the response to the CreateApplication request. The method always
611// closes the http.Response Body.
612func (client BaseClient) CreateApplicationResponder(resp *http.Response) (result autorest.Response, err error) {
613	err = autorest.Respond(
614		resp,
615		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
616		autorest.ByClosing())
617	result.Response = resp
618	return
619}
620
621// CreateBackupPolicy creates a backup policy which can be associated later with a Service Fabric application, service
622// or a partition for periodic backup.
623// Parameters:
624// backupPolicyDescription - describes the backup policy.
625// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
626// duration that the client is willing to wait for the requested operation to complete. The default value for
627// this parameter is 60 seconds.
628func (client BaseClient) CreateBackupPolicy(ctx context.Context, backupPolicyDescription BackupPolicyDescription, timeout *int64) (result autorest.Response, err error) {
629	if tracing.IsEnabled() {
630		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateBackupPolicy")
631		defer func() {
632			sc := -1
633			if result.Response != nil {
634				sc = result.Response.StatusCode
635			}
636			tracing.EndSpan(ctx, sc, err)
637		}()
638	}
639	if err := validation.Validate([]validation.Validation{
640		{TargetValue: backupPolicyDescription,
641			Constraints: []validation.Constraint{{Target: "backupPolicyDescription.Name", Name: validation.Null, Rule: true, Chain: nil},
642				{Target: "backupPolicyDescription.AutoRestoreOnDataLoss", Name: validation.Null, Rule: true, Chain: nil},
643				{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.Null, Rule: true,
644					Chain: []validation.Constraint{{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMaximum, Rule: int64(255), Chain: nil},
645						{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
646					}}}},
647		{TargetValue: timeout,
648			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
649				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
650					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
651				}}}}}); err != nil {
652		return result, validation.NewError("servicefabric.BaseClient", "CreateBackupPolicy", err.Error())
653	}
654
655	req, err := client.CreateBackupPolicyPreparer(ctx, backupPolicyDescription, timeout)
656	if err != nil {
657		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", nil, "Failure preparing request")
658		return
659	}
660
661	resp, err := client.CreateBackupPolicySender(req)
662	if err != nil {
663		result.Response = resp
664		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", resp, "Failure sending request")
665		return
666	}
667
668	result, err = client.CreateBackupPolicyResponder(resp)
669	if err != nil {
670		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", resp, "Failure responding to request")
671		return
672	}
673
674	return
675}
676
677// CreateBackupPolicyPreparer prepares the CreateBackupPolicy request.
678func (client BaseClient) CreateBackupPolicyPreparer(ctx context.Context, backupPolicyDescription BackupPolicyDescription, timeout *int64) (*http.Request, error) {
679	const APIVersion = "6.2-preview"
680	queryParameters := map[string]interface{}{
681		"api-version": APIVersion,
682	}
683	if timeout != nil {
684		queryParameters["timeout"] = autorest.Encode("query", *timeout)
685	} else {
686		queryParameters["timeout"] = autorest.Encode("query", 60)
687	}
688
689	preparer := autorest.CreatePreparer(
690		autorest.AsContentType("application/json; charset=utf-8"),
691		autorest.AsPost(),
692		autorest.WithBaseURL(client.BaseURI),
693		autorest.WithPath("/BackupRestore/BackupPolicies/$/Create"),
694		autorest.WithJSON(backupPolicyDescription),
695		autorest.WithQueryParameters(queryParameters))
696	return preparer.Prepare((&http.Request{}).WithContext(ctx))
697}
698
699// CreateBackupPolicySender sends the CreateBackupPolicy request. The method will close the
700// http.Response Body if it receives an error.
701func (client BaseClient) CreateBackupPolicySender(req *http.Request) (*http.Response, error) {
702	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
703}
704
705// CreateBackupPolicyResponder handles the response to the CreateBackupPolicy request. The method always
706// closes the http.Response Body.
707func (client BaseClient) CreateBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
708	err = autorest.Respond(
709		resp,
710		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
711		autorest.ByClosing())
712	result.Response = resp
713	return
714}
715
716// CreateComposeDeployment compose is a file format that describes multi-container applications. This API allows
717// deploying container based applications defined in compose format in a Service Fabric cluster. Once the deployment is
718// created it's status can be tracked via `GetComposeDeploymentStatus` API.
719// Parameters:
720// createComposeDeploymentDescription - describes the compose deployment that needs to be created.
721// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
722// duration that the client is willing to wait for the requested operation to complete. The default value for
723// this parameter is 60 seconds.
724func (client BaseClient) CreateComposeDeployment(ctx context.Context, createComposeDeploymentDescription CreateComposeDeploymentDescription, timeout *int64) (result autorest.Response, err error) {
725	if tracing.IsEnabled() {
726		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateComposeDeployment")
727		defer func() {
728			sc := -1
729			if result.Response != nil {
730				sc = result.Response.StatusCode
731			}
732			tracing.EndSpan(ctx, sc, err)
733		}()
734	}
735	if err := validation.Validate([]validation.Validation{
736		{TargetValue: createComposeDeploymentDescription,
737			Constraints: []validation.Constraint{{Target: "createComposeDeploymentDescription.DeploymentName", Name: validation.Null, Rule: true, Chain: nil},
738				{Target: "createComposeDeploymentDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}},
739		{TargetValue: timeout,
740			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
741				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
742					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
743				}}}}}); err != nil {
744		return result, validation.NewError("servicefabric.BaseClient", "CreateComposeDeployment", err.Error())
745	}
746
747	req, err := client.CreateComposeDeploymentPreparer(ctx, createComposeDeploymentDescription, timeout)
748	if err != nil {
749		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", nil, "Failure preparing request")
750		return
751	}
752
753	resp, err := client.CreateComposeDeploymentSender(req)
754	if err != nil {
755		result.Response = resp
756		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", resp, "Failure sending request")
757		return
758	}
759
760	result, err = client.CreateComposeDeploymentResponder(resp)
761	if err != nil {
762		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", resp, "Failure responding to request")
763		return
764	}
765
766	return
767}
768
769// CreateComposeDeploymentPreparer prepares the CreateComposeDeployment request.
770func (client BaseClient) CreateComposeDeploymentPreparer(ctx context.Context, createComposeDeploymentDescription CreateComposeDeploymentDescription, timeout *int64) (*http.Request, error) {
771	const APIVersion = "6.0-preview"
772	queryParameters := map[string]interface{}{
773		"api-version": APIVersion,
774	}
775	if timeout != nil {
776		queryParameters["timeout"] = autorest.Encode("query", *timeout)
777	} else {
778		queryParameters["timeout"] = autorest.Encode("query", 60)
779	}
780
781	preparer := autorest.CreatePreparer(
782		autorest.AsContentType("application/json; charset=utf-8"),
783		autorest.AsPut(),
784		autorest.WithBaseURL(client.BaseURI),
785		autorest.WithPath("/ComposeDeployments/$/Create"),
786		autorest.WithJSON(createComposeDeploymentDescription),
787		autorest.WithQueryParameters(queryParameters))
788	return preparer.Prepare((&http.Request{}).WithContext(ctx))
789}
790
791// CreateComposeDeploymentSender sends the CreateComposeDeployment request. The method will close the
792// http.Response Body if it receives an error.
793func (client BaseClient) CreateComposeDeploymentSender(req *http.Request) (*http.Response, error) {
794	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
795}
796
797// CreateComposeDeploymentResponder handles the response to the CreateComposeDeployment request. The method always
798// closes the http.Response Body.
799func (client BaseClient) CreateComposeDeploymentResponder(resp *http.Response) (result autorest.Response, err error) {
800	err = autorest.Respond(
801		resp,
802		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
803		autorest.ByClosing())
804	result.Response = resp
805	return
806}
807
808// CreateName creates the specified Service Fabric name.
809// Parameters:
810// nameDescription - describes the Service Fabric name to be created.
811// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
812// duration that the client is willing to wait for the requested operation to complete. The default value for
813// this parameter is 60 seconds.
814func (client BaseClient) CreateName(ctx context.Context, nameDescription NameDescription, timeout *int64) (result autorest.Response, err error) {
815	if tracing.IsEnabled() {
816		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateName")
817		defer func() {
818			sc := -1
819			if result.Response != nil {
820				sc = result.Response.StatusCode
821			}
822			tracing.EndSpan(ctx, sc, err)
823		}()
824	}
825	if err := validation.Validate([]validation.Validation{
826		{TargetValue: nameDescription,
827			Constraints: []validation.Constraint{{Target: "nameDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}},
828		{TargetValue: timeout,
829			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
830				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
831					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
832				}}}}}); err != nil {
833		return result, validation.NewError("servicefabric.BaseClient", "CreateName", err.Error())
834	}
835
836	req, err := client.CreateNamePreparer(ctx, nameDescription, timeout)
837	if err != nil {
838		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", nil, "Failure preparing request")
839		return
840	}
841
842	resp, err := client.CreateNameSender(req)
843	if err != nil {
844		result.Response = resp
845		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", resp, "Failure sending request")
846		return
847	}
848
849	result, err = client.CreateNameResponder(resp)
850	if err != nil {
851		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", resp, "Failure responding to request")
852		return
853	}
854
855	return
856}
857
858// CreateNamePreparer prepares the CreateName request.
859func (client BaseClient) CreateNamePreparer(ctx context.Context, nameDescription NameDescription, timeout *int64) (*http.Request, error) {
860	const APIVersion = "6.0"
861	queryParameters := map[string]interface{}{
862		"api-version": APIVersion,
863	}
864	if timeout != nil {
865		queryParameters["timeout"] = autorest.Encode("query", *timeout)
866	} else {
867		queryParameters["timeout"] = autorest.Encode("query", 60)
868	}
869
870	preparer := autorest.CreatePreparer(
871		autorest.AsContentType("application/json; charset=utf-8"),
872		autorest.AsPost(),
873		autorest.WithBaseURL(client.BaseURI),
874		autorest.WithPath("/Names/$/Create"),
875		autorest.WithJSON(nameDescription),
876		autorest.WithQueryParameters(queryParameters))
877	return preparer.Prepare((&http.Request{}).WithContext(ctx))
878}
879
880// CreateNameSender sends the CreateName request. The method will close the
881// http.Response Body if it receives an error.
882func (client BaseClient) CreateNameSender(req *http.Request) (*http.Response, error) {
883	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
884}
885
886// CreateNameResponder handles the response to the CreateName request. The method always
887// closes the http.Response Body.
888func (client BaseClient) CreateNameResponder(resp *http.Response) (result autorest.Response, err error) {
889	err = autorest.Respond(
890		resp,
891		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
892		autorest.ByClosing())
893	result.Response = resp
894	return
895}
896
897// CreateRepairTask for clusters that have the Repair Manager Service configured,
898// this API provides a way to create repair tasks that run automatically or manually.
899// For repair tasks that run automatically, an appropriate repair executor
900// must be running for each repair action to run automatically.
901// These are currently only available in specially-configured Azure Cloud Services.
902//
903// To create a manual repair task, provide the set of impacted node names and the
904// expected impact. When the state of the created repair task changes to approved,
905// you can safely perform repair actions on those nodes.
906//
907// This API supports the Service Fabric platform; it is not meant to be used directly from your code.
908// Parameters:
909// repairTask - describes the repair task to be created or updated.
910func (client BaseClient) CreateRepairTask(ctx context.Context, repairTask RepairTask) (result RepairTaskUpdateInfo, err error) {
911	if tracing.IsEnabled() {
912		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateRepairTask")
913		defer func() {
914			sc := -1
915			if result.Response.Response != nil {
916				sc = result.Response.Response.StatusCode
917			}
918			tracing.EndSpan(ctx, sc, err)
919		}()
920	}
921	if err := validation.Validate([]validation.Validation{
922		{TargetValue: repairTask,
923			Constraints: []validation.Constraint{{Target: "repairTask.TaskID", Name: validation.Null, Rule: true, Chain: nil},
924				{Target: "repairTask.Action", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
925		return result, validation.NewError("servicefabric.BaseClient", "CreateRepairTask", err.Error())
926	}
927
928	req, err := client.CreateRepairTaskPreparer(ctx, repairTask)
929	if err != nil {
930		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", nil, "Failure preparing request")
931		return
932	}
933
934	resp, err := client.CreateRepairTaskSender(req)
935	if err != nil {
936		result.Response = autorest.Response{Response: resp}
937		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", resp, "Failure sending request")
938		return
939	}
940
941	result, err = client.CreateRepairTaskResponder(resp)
942	if err != nil {
943		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", resp, "Failure responding to request")
944		return
945	}
946
947	return
948}
949
950// CreateRepairTaskPreparer prepares the CreateRepairTask request.
951func (client BaseClient) CreateRepairTaskPreparer(ctx context.Context, repairTask RepairTask) (*http.Request, error) {
952	const APIVersion = "6.0"
953	queryParameters := map[string]interface{}{
954		"api-version": APIVersion,
955	}
956
957	preparer := autorest.CreatePreparer(
958		autorest.AsContentType("application/json; charset=utf-8"),
959		autorest.AsPost(),
960		autorest.WithBaseURL(client.BaseURI),
961		autorest.WithPath("/$/CreateRepairTask"),
962		autorest.WithJSON(repairTask),
963		autorest.WithQueryParameters(queryParameters))
964	return preparer.Prepare((&http.Request{}).WithContext(ctx))
965}
966
967// CreateRepairTaskSender sends the CreateRepairTask request. The method will close the
968// http.Response Body if it receives an error.
969func (client BaseClient) CreateRepairTaskSender(req *http.Request) (*http.Response, error) {
970	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
971}
972
973// CreateRepairTaskResponder handles the response to the CreateRepairTask request. The method always
974// closes the http.Response Body.
975func (client BaseClient) CreateRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
976	err = autorest.Respond(
977		resp,
978		azure.WithErrorUnlessStatusCode(http.StatusOK),
979		autorest.ByUnmarshallingJSON(&result),
980		autorest.ByClosing())
981	result.Response = autorest.Response{Response: resp}
982	return
983}
984
985// CreateService this api allows creating a new Service Fabric stateless or stateful service under a specified Service
986// Fabric application. The description for creating the service includes partitioning information and optional
987// properties for placement and load balancing. Some of the properties can later be modified using `UpdateService` API.
988// Parameters:
989// applicationID - the identity of the application. This is typically the full name of the application without
990// the 'fabric:' URI scheme.
991// Starting from version 6.0, hierarchical names are delimited with the "~" character.
992// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
993// in 6.0+ and "myapp/app1" in previous versions.
994// serviceDescription - the information necessary to create a service.
995// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
996// duration that the client is willing to wait for the requested operation to complete. The default value for
997// this parameter is 60 seconds.
998func (client BaseClient) CreateService(ctx context.Context, applicationID string, serviceDescription BasicServiceDescription, timeout *int64) (result autorest.Response, err error) {
999	if tracing.IsEnabled() {
1000		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateService")
1001		defer func() {
1002			sc := -1
1003			if result.Response != nil {
1004				sc = result.Response.StatusCode
1005			}
1006			tracing.EndSpan(ctx, sc, err)
1007		}()
1008	}
1009	if err := validation.Validate([]validation.Validation{
1010		{TargetValue: serviceDescription,
1011			Constraints: []validation.Constraint{{Target: "serviceDescription.ServiceName", Name: validation.Null, Rule: true, Chain: nil},
1012				{Target: "serviceDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}}},
1013		{TargetValue: timeout,
1014			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1015				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1016					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1017				}}}}}); err != nil {
1018		return result, validation.NewError("servicefabric.BaseClient", "CreateService", err.Error())
1019	}
1020
1021	req, err := client.CreateServicePreparer(ctx, applicationID, serviceDescription, timeout)
1022	if err != nil {
1023		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", nil, "Failure preparing request")
1024		return
1025	}
1026
1027	resp, err := client.CreateServiceSender(req)
1028	if err != nil {
1029		result.Response = resp
1030		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", resp, "Failure sending request")
1031		return
1032	}
1033
1034	result, err = client.CreateServiceResponder(resp)
1035	if err != nil {
1036		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", resp, "Failure responding to request")
1037		return
1038	}
1039
1040	return
1041}
1042
1043// CreateServicePreparer prepares the CreateService request.
1044func (client BaseClient) CreateServicePreparer(ctx context.Context, applicationID string, serviceDescription BasicServiceDescription, timeout *int64) (*http.Request, error) {
1045	pathParameters := map[string]interface{}{
1046		"applicationId": applicationID,
1047	}
1048
1049	const APIVersion = "6.0"
1050	queryParameters := map[string]interface{}{
1051		"api-version": APIVersion,
1052	}
1053	if timeout != nil {
1054		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1055	} else {
1056		queryParameters["timeout"] = autorest.Encode("query", 60)
1057	}
1058
1059	preparer := autorest.CreatePreparer(
1060		autorest.AsContentType("application/json; charset=utf-8"),
1061		autorest.AsPost(),
1062		autorest.WithBaseURL(client.BaseURI),
1063		autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/$/Create", pathParameters),
1064		autorest.WithJSON(serviceDescription),
1065		autorest.WithQueryParameters(queryParameters))
1066	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1067}
1068
1069// CreateServiceSender sends the CreateService request. The method will close the
1070// http.Response Body if it receives an error.
1071func (client BaseClient) CreateServiceSender(req *http.Request) (*http.Response, error) {
1072	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1073}
1074
1075// CreateServiceResponder handles the response to the CreateService request. The method always
1076// closes the http.Response Body.
1077func (client BaseClient) CreateServiceResponder(resp *http.Response) (result autorest.Response, err error) {
1078	err = autorest.Respond(
1079		resp,
1080		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
1081		autorest.ByClosing())
1082	result.Response = resp
1083	return
1084}
1085
1086// CreateServiceFromTemplate creates a Service Fabric service from the service template defined in the application
1087// manifest. A service template contains the properties that will be same for the service instance of the same type.
1088// The API allows overriding the properties that are usually different for different services of the same service type.
1089// Parameters:
1090// applicationID - the identity of the application. This is typically the full name of the application without
1091// the 'fabric:' URI scheme.
1092// Starting from version 6.0, hierarchical names are delimited with the "~" character.
1093// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
1094// in 6.0+ and "myapp/app1" in previous versions.
1095// serviceFromTemplateDescription - describes the service that needs to be created from the template defined in
1096// the application manifest.
1097// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1098// duration that the client is willing to wait for the requested operation to complete. The default value for
1099// this parameter is 60 seconds.
1100func (client BaseClient) CreateServiceFromTemplate(ctx context.Context, applicationID string, serviceFromTemplateDescription ServiceFromTemplateDescription, timeout *int64) (result autorest.Response, err error) {
1101	if tracing.IsEnabled() {
1102		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateServiceFromTemplate")
1103		defer func() {
1104			sc := -1
1105			if result.Response != nil {
1106				sc = result.Response.StatusCode
1107			}
1108			tracing.EndSpan(ctx, sc, err)
1109		}()
1110	}
1111	if err := validation.Validate([]validation.Validation{
1112		{TargetValue: serviceFromTemplateDescription,
1113			Constraints: []validation.Constraint{{Target: "serviceFromTemplateDescription.ApplicationName", Name: validation.Null, Rule: true, Chain: nil},
1114				{Target: "serviceFromTemplateDescription.ServiceName", Name: validation.Null, Rule: true, Chain: nil},
1115				{Target: "serviceFromTemplateDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}}},
1116		{TargetValue: timeout,
1117			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1118				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1119					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1120				}}}}}); err != nil {
1121		return result, validation.NewError("servicefabric.BaseClient", "CreateServiceFromTemplate", err.Error())
1122	}
1123
1124	req, err := client.CreateServiceFromTemplatePreparer(ctx, applicationID, serviceFromTemplateDescription, timeout)
1125	if err != nil {
1126		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", nil, "Failure preparing request")
1127		return
1128	}
1129
1130	resp, err := client.CreateServiceFromTemplateSender(req)
1131	if err != nil {
1132		result.Response = resp
1133		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", resp, "Failure sending request")
1134		return
1135	}
1136
1137	result, err = client.CreateServiceFromTemplateResponder(resp)
1138	if err != nil {
1139		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", resp, "Failure responding to request")
1140		return
1141	}
1142
1143	return
1144}
1145
1146// CreateServiceFromTemplatePreparer prepares the CreateServiceFromTemplate request.
1147func (client BaseClient) CreateServiceFromTemplatePreparer(ctx context.Context, applicationID string, serviceFromTemplateDescription ServiceFromTemplateDescription, timeout *int64) (*http.Request, error) {
1148	pathParameters := map[string]interface{}{
1149		"applicationId": applicationID,
1150	}
1151
1152	const APIVersion = "6.0"
1153	queryParameters := map[string]interface{}{
1154		"api-version": APIVersion,
1155	}
1156	if timeout != nil {
1157		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1158	} else {
1159		queryParameters["timeout"] = autorest.Encode("query", 60)
1160	}
1161
1162	preparer := autorest.CreatePreparer(
1163		autorest.AsContentType("application/json; charset=utf-8"),
1164		autorest.AsPost(),
1165		autorest.WithBaseURL(client.BaseURI),
1166		autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/$/CreateFromTemplate", pathParameters),
1167		autorest.WithJSON(serviceFromTemplateDescription),
1168		autorest.WithQueryParameters(queryParameters))
1169	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1170}
1171
1172// CreateServiceFromTemplateSender sends the CreateServiceFromTemplate request. The method will close the
1173// http.Response Body if it receives an error.
1174func (client BaseClient) CreateServiceFromTemplateSender(req *http.Request) (*http.Response, error) {
1175	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1176}
1177
1178// CreateServiceFromTemplateResponder handles the response to the CreateServiceFromTemplate request. The method always
1179// closes the http.Response Body.
1180func (client BaseClient) CreateServiceFromTemplateResponder(resp *http.Response) (result autorest.Response, err error) {
1181	err = autorest.Respond(
1182		resp,
1183		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
1184		autorest.ByClosing())
1185	result.Response = resp
1186	return
1187}
1188
1189// DeleteApplication deletes an existing Service Fabric application. An application must be created before it can be
1190// deleted. Deleting an application will delete all services that are part of that application. By default, Service
1191// Fabric will try to close service replicas in a graceful manner and then delete the service. However, if a service is
1192// having issues closing the replica gracefully, the delete operation may take a long time or get stuck. Use the
1193// optional ForceRemove flag to skip the graceful close sequence and forcefully delete the application and all of the
1194// its services.
1195// Parameters:
1196// applicationID - the identity of the application. This is typically the full name of the application without
1197// the 'fabric:' URI scheme.
1198// Starting from version 6.0, hierarchical names are delimited with the "~" character.
1199// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
1200// in 6.0+ and "myapp/app1" in previous versions.
1201// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful
1202// shutdown sequence. This parameter can be used to forcefully delete an application or service for which
1203// delete is timing out due to issues in the service code that prevents graceful close of replicas.
1204// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1205// duration that the client is willing to wait for the requested operation to complete. The default value for
1206// this parameter is 60 seconds.
1207func (client BaseClient) DeleteApplication(ctx context.Context, applicationID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) {
1208	if tracing.IsEnabled() {
1209		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteApplication")
1210		defer func() {
1211			sc := -1
1212			if result.Response != nil {
1213				sc = result.Response.StatusCode
1214			}
1215			tracing.EndSpan(ctx, sc, err)
1216		}()
1217	}
1218	if err := validation.Validate([]validation.Validation{
1219		{TargetValue: timeout,
1220			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1221				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1222					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1223				}}}}}); err != nil {
1224		return result, validation.NewError("servicefabric.BaseClient", "DeleteApplication", err.Error())
1225	}
1226
1227	req, err := client.DeleteApplicationPreparer(ctx, applicationID, forceRemove, timeout)
1228	if err != nil {
1229		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", nil, "Failure preparing request")
1230		return
1231	}
1232
1233	resp, err := client.DeleteApplicationSender(req)
1234	if err != nil {
1235		result.Response = resp
1236		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", resp, "Failure sending request")
1237		return
1238	}
1239
1240	result, err = client.DeleteApplicationResponder(resp)
1241	if err != nil {
1242		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", resp, "Failure responding to request")
1243		return
1244	}
1245
1246	return
1247}
1248
1249// DeleteApplicationPreparer prepares the DeleteApplication request.
1250func (client BaseClient) DeleteApplicationPreparer(ctx context.Context, applicationID string, forceRemove *bool, timeout *int64) (*http.Request, error) {
1251	pathParameters := map[string]interface{}{
1252		"applicationId": applicationID,
1253	}
1254
1255	const APIVersion = "6.0"
1256	queryParameters := map[string]interface{}{
1257		"api-version": APIVersion,
1258	}
1259	if forceRemove != nil {
1260		queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove)
1261	}
1262	if timeout != nil {
1263		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1264	} else {
1265		queryParameters["timeout"] = autorest.Encode("query", 60)
1266	}
1267
1268	preparer := autorest.CreatePreparer(
1269		autorest.AsPost(),
1270		autorest.WithBaseURL(client.BaseURI),
1271		autorest.WithPathParameters("/Applications/{applicationId}/$/Delete", pathParameters),
1272		autorest.WithQueryParameters(queryParameters))
1273	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1274}
1275
1276// DeleteApplicationSender sends the DeleteApplication request. The method will close the
1277// http.Response Body if it receives an error.
1278func (client BaseClient) DeleteApplicationSender(req *http.Request) (*http.Response, error) {
1279	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1280}
1281
1282// DeleteApplicationResponder handles the response to the DeleteApplication request. The method always
1283// closes the http.Response Body.
1284func (client BaseClient) DeleteApplicationResponder(resp *http.Response) (result autorest.Response, err error) {
1285	err = autorest.Respond(
1286		resp,
1287		azure.WithErrorUnlessStatusCode(http.StatusOK),
1288		autorest.ByClosing())
1289	result.Response = resp
1290	return
1291}
1292
1293// DeleteBackupPolicy deletes an existing backup policy. A backup policy must be created before it can be deleted. A
1294// currently active backup policy, associated with any Service Fabric application, service or partition, cannot be
1295// deleted without first deleting the mapping.
1296// Parameters:
1297// backupPolicyName - the name of the backup policy.
1298// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1299// duration that the client is willing to wait for the requested operation to complete. The default value for
1300// this parameter is 60 seconds.
1301func (client BaseClient) DeleteBackupPolicy(ctx context.Context, backupPolicyName string, timeout *int64) (result autorest.Response, err error) {
1302	if tracing.IsEnabled() {
1303		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteBackupPolicy")
1304		defer func() {
1305			sc := -1
1306			if result.Response != nil {
1307				sc = result.Response.StatusCode
1308			}
1309			tracing.EndSpan(ctx, sc, err)
1310		}()
1311	}
1312	if err := validation.Validate([]validation.Validation{
1313		{TargetValue: timeout,
1314			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1315				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1316					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1317				}}}}}); err != nil {
1318		return result, validation.NewError("servicefabric.BaseClient", "DeleteBackupPolicy", err.Error())
1319	}
1320
1321	req, err := client.DeleteBackupPolicyPreparer(ctx, backupPolicyName, timeout)
1322	if err != nil {
1323		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", nil, "Failure preparing request")
1324		return
1325	}
1326
1327	resp, err := client.DeleteBackupPolicySender(req)
1328	if err != nil {
1329		result.Response = resp
1330		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", resp, "Failure sending request")
1331		return
1332	}
1333
1334	result, err = client.DeleteBackupPolicyResponder(resp)
1335	if err != nil {
1336		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", resp, "Failure responding to request")
1337		return
1338	}
1339
1340	return
1341}
1342
1343// DeleteBackupPolicyPreparer prepares the DeleteBackupPolicy request.
1344func (client BaseClient) DeleteBackupPolicyPreparer(ctx context.Context, backupPolicyName string, timeout *int64) (*http.Request, error) {
1345	pathParameters := map[string]interface{}{
1346		"backupPolicyName": autorest.Encode("path", backupPolicyName),
1347	}
1348
1349	const APIVersion = "6.2-preview"
1350	queryParameters := map[string]interface{}{
1351		"api-version": APIVersion,
1352	}
1353	if timeout != nil {
1354		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1355	} else {
1356		queryParameters["timeout"] = autorest.Encode("query", 60)
1357	}
1358
1359	preparer := autorest.CreatePreparer(
1360		autorest.AsPost(),
1361		autorest.WithBaseURL(client.BaseURI),
1362		autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/Delete", pathParameters),
1363		autorest.WithQueryParameters(queryParameters))
1364	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1365}
1366
1367// DeleteBackupPolicySender sends the DeleteBackupPolicy request. The method will close the
1368// http.Response Body if it receives an error.
1369func (client BaseClient) DeleteBackupPolicySender(req *http.Request) (*http.Response, error) {
1370	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1371}
1372
1373// DeleteBackupPolicyResponder handles the response to the DeleteBackupPolicy request. The method always
1374// closes the http.Response Body.
1375func (client BaseClient) DeleteBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
1376	err = autorest.Respond(
1377		resp,
1378		azure.WithErrorUnlessStatusCode(http.StatusOK),
1379		autorest.ByClosing())
1380	result.Response = resp
1381	return
1382}
1383
1384// DeleteImageStoreContent deletes existing image store content being found within the given image store relative path.
1385// This can be used to delete uploaded application packages once they are provisioned.
1386// Parameters:
1387// contentPath - relative path to file or folder in the image store from its root.
1388// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1389// duration that the client is willing to wait for the requested operation to complete. The default value for
1390// this parameter is 60 seconds.
1391func (client BaseClient) DeleteImageStoreContent(ctx context.Context, contentPath string, timeout *int64) (result autorest.Response, err error) {
1392	if tracing.IsEnabled() {
1393		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImageStoreContent")
1394		defer func() {
1395			sc := -1
1396			if result.Response != nil {
1397				sc = result.Response.StatusCode
1398			}
1399			tracing.EndSpan(ctx, sc, err)
1400		}()
1401	}
1402	if err := validation.Validate([]validation.Validation{
1403		{TargetValue: timeout,
1404			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1405				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1406					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1407				}}}}}); err != nil {
1408		return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreContent", err.Error())
1409	}
1410
1411	req, err := client.DeleteImageStoreContentPreparer(ctx, contentPath, timeout)
1412	if err != nil {
1413		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", nil, "Failure preparing request")
1414		return
1415	}
1416
1417	resp, err := client.DeleteImageStoreContentSender(req)
1418	if err != nil {
1419		result.Response = resp
1420		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", resp, "Failure sending request")
1421		return
1422	}
1423
1424	result, err = client.DeleteImageStoreContentResponder(resp)
1425	if err != nil {
1426		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", resp, "Failure responding to request")
1427		return
1428	}
1429
1430	return
1431}
1432
1433// DeleteImageStoreContentPreparer prepares the DeleteImageStoreContent request.
1434func (client BaseClient) DeleteImageStoreContentPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) {
1435	pathParameters := map[string]interface{}{
1436		"contentPath": autorest.Encode("path", contentPath),
1437	}
1438
1439	const APIVersion = "6.0"
1440	queryParameters := map[string]interface{}{
1441		"api-version": APIVersion,
1442	}
1443	if timeout != nil {
1444		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1445	} else {
1446		queryParameters["timeout"] = autorest.Encode("query", 60)
1447	}
1448
1449	preparer := autorest.CreatePreparer(
1450		autorest.AsDelete(),
1451		autorest.WithBaseURL(client.BaseURI),
1452		autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters),
1453		autorest.WithQueryParameters(queryParameters))
1454	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1455}
1456
1457// DeleteImageStoreContentSender sends the DeleteImageStoreContent request. The method will close the
1458// http.Response Body if it receives an error.
1459func (client BaseClient) DeleteImageStoreContentSender(req *http.Request) (*http.Response, error) {
1460	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1461}
1462
1463// DeleteImageStoreContentResponder handles the response to the DeleteImageStoreContent request. The method always
1464// closes the http.Response Body.
1465func (client BaseClient) DeleteImageStoreContentResponder(resp *http.Response) (result autorest.Response, err error) {
1466	err = autorest.Respond(
1467		resp,
1468		azure.WithErrorUnlessStatusCode(http.StatusOK),
1469		autorest.ByClosing())
1470	result.Response = resp
1471	return
1472}
1473
1474// DeleteImageStoreUploadSession the DELETE request will cause the existing upload session to expire and remove any
1475// previously uploaded file chunks.
1476// Parameters:
1477// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session
1478// which keeps track of all file chunks until it is committed.
1479// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1480// duration that the client is willing to wait for the requested operation to complete. The default value for
1481// this parameter is 60 seconds.
1482func (client BaseClient) DeleteImageStoreUploadSession(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
1483	if tracing.IsEnabled() {
1484		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImageStoreUploadSession")
1485		defer func() {
1486			sc := -1
1487			if result.Response != nil {
1488				sc = result.Response.StatusCode
1489			}
1490			tracing.EndSpan(ctx, sc, err)
1491		}()
1492	}
1493	if err := validation.Validate([]validation.Validation{
1494		{TargetValue: timeout,
1495			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1496				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1497					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1498				}}}}}); err != nil {
1499		return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreUploadSession", err.Error())
1500	}
1501
1502	req, err := client.DeleteImageStoreUploadSessionPreparer(ctx, sessionID, timeout)
1503	if err != nil {
1504		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", nil, "Failure preparing request")
1505		return
1506	}
1507
1508	resp, err := client.DeleteImageStoreUploadSessionSender(req)
1509	if err != nil {
1510		result.Response = resp
1511		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", resp, "Failure sending request")
1512		return
1513	}
1514
1515	result, err = client.DeleteImageStoreUploadSessionResponder(resp)
1516	if err != nil {
1517		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", resp, "Failure responding to request")
1518		return
1519	}
1520
1521	return
1522}
1523
1524// DeleteImageStoreUploadSessionPreparer prepares the DeleteImageStoreUploadSession request.
1525func (client BaseClient) DeleteImageStoreUploadSessionPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) {
1526	const APIVersion = "6.0"
1527	queryParameters := map[string]interface{}{
1528		"api-version": APIVersion,
1529		"session-id":  autorest.Encode("query", sessionID),
1530	}
1531	if timeout != nil {
1532		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1533	} else {
1534		queryParameters["timeout"] = autorest.Encode("query", 60)
1535	}
1536
1537	preparer := autorest.CreatePreparer(
1538		autorest.AsDelete(),
1539		autorest.WithBaseURL(client.BaseURI),
1540		autorest.WithPath("/ImageStore/$/DeleteUploadSession"),
1541		autorest.WithQueryParameters(queryParameters))
1542	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1543}
1544
1545// DeleteImageStoreUploadSessionSender sends the DeleteImageStoreUploadSession request. The method will close the
1546// http.Response Body if it receives an error.
1547func (client BaseClient) DeleteImageStoreUploadSessionSender(req *http.Request) (*http.Response, error) {
1548	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1549}
1550
1551// DeleteImageStoreUploadSessionResponder handles the response to the DeleteImageStoreUploadSession request. The method always
1552// closes the http.Response Body.
1553func (client BaseClient) DeleteImageStoreUploadSessionResponder(resp *http.Response) (result autorest.Response, err error) {
1554	err = autorest.Respond(
1555		resp,
1556		azure.WithErrorUnlessStatusCode(http.StatusOK),
1557		autorest.ByClosing())
1558	result.Response = resp
1559	return
1560}
1561
1562// DeleteName deletes the specified Service Fabric name. A name must be created before it can be deleted. Deleting a
1563// name with child properties will fail.
1564// Parameters:
1565// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
1566// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1567// duration that the client is willing to wait for the requested operation to complete. The default value for
1568// this parameter is 60 seconds.
1569func (client BaseClient) DeleteName(ctx context.Context, nameID string, timeout *int64) (result autorest.Response, err error) {
1570	if tracing.IsEnabled() {
1571		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteName")
1572		defer func() {
1573			sc := -1
1574			if result.Response != nil {
1575				sc = result.Response.StatusCode
1576			}
1577			tracing.EndSpan(ctx, sc, err)
1578		}()
1579	}
1580	if err := validation.Validate([]validation.Validation{
1581		{TargetValue: timeout,
1582			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1583				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1584					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1585				}}}}}); err != nil {
1586		return result, validation.NewError("servicefabric.BaseClient", "DeleteName", err.Error())
1587	}
1588
1589	req, err := client.DeleteNamePreparer(ctx, nameID, timeout)
1590	if err != nil {
1591		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", nil, "Failure preparing request")
1592		return
1593	}
1594
1595	resp, err := client.DeleteNameSender(req)
1596	if err != nil {
1597		result.Response = resp
1598		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", resp, "Failure sending request")
1599		return
1600	}
1601
1602	result, err = client.DeleteNameResponder(resp)
1603	if err != nil {
1604		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", resp, "Failure responding to request")
1605		return
1606	}
1607
1608	return
1609}
1610
1611// DeleteNamePreparer prepares the DeleteName request.
1612func (client BaseClient) DeleteNamePreparer(ctx context.Context, nameID string, timeout *int64) (*http.Request, error) {
1613	pathParameters := map[string]interface{}{
1614		"nameId": nameID,
1615	}
1616
1617	const APIVersion = "6.0"
1618	queryParameters := map[string]interface{}{
1619		"api-version": APIVersion,
1620	}
1621	if timeout != nil {
1622		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1623	} else {
1624		queryParameters["timeout"] = autorest.Encode("query", 60)
1625	}
1626
1627	preparer := autorest.CreatePreparer(
1628		autorest.AsDelete(),
1629		autorest.WithBaseURL(client.BaseURI),
1630		autorest.WithPathParameters("/Names/{nameId}", pathParameters),
1631		autorest.WithQueryParameters(queryParameters))
1632	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1633}
1634
1635// DeleteNameSender sends the DeleteName request. The method will close the
1636// http.Response Body if it receives an error.
1637func (client BaseClient) DeleteNameSender(req *http.Request) (*http.Response, error) {
1638	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1639}
1640
1641// DeleteNameResponder handles the response to the DeleteName request. The method always
1642// closes the http.Response Body.
1643func (client BaseClient) DeleteNameResponder(resp *http.Response) (result autorest.Response, err error) {
1644	err = autorest.Respond(
1645		resp,
1646		azure.WithErrorUnlessStatusCode(http.StatusOK),
1647		autorest.ByClosing())
1648	result.Response = resp
1649	return
1650}
1651
1652// DeleteProperty deletes the specified Service Fabric property under a given name. A property must be created before
1653// it can be deleted.
1654// Parameters:
1655// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
1656// propertyName - specifies the name of the property to get.
1657// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1658// duration that the client is willing to wait for the requested operation to complete. The default value for
1659// this parameter is 60 seconds.
1660func (client BaseClient) DeleteProperty(ctx context.Context, nameID string, propertyName string, timeout *int64) (result autorest.Response, err error) {
1661	if tracing.IsEnabled() {
1662		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteProperty")
1663		defer func() {
1664			sc := -1
1665			if result.Response != nil {
1666				sc = result.Response.StatusCode
1667			}
1668			tracing.EndSpan(ctx, sc, err)
1669		}()
1670	}
1671	if err := validation.Validate([]validation.Validation{
1672		{TargetValue: timeout,
1673			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1674				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1675					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1676				}}}}}); err != nil {
1677		return result, validation.NewError("servicefabric.BaseClient", "DeleteProperty", err.Error())
1678	}
1679
1680	req, err := client.DeletePropertyPreparer(ctx, nameID, propertyName, timeout)
1681	if err != nil {
1682		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", nil, "Failure preparing request")
1683		return
1684	}
1685
1686	resp, err := client.DeletePropertySender(req)
1687	if err != nil {
1688		result.Response = resp
1689		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", resp, "Failure sending request")
1690		return
1691	}
1692
1693	result, err = client.DeletePropertyResponder(resp)
1694	if err != nil {
1695		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", resp, "Failure responding to request")
1696		return
1697	}
1698
1699	return
1700}
1701
1702// DeletePropertyPreparer prepares the DeleteProperty request.
1703func (client BaseClient) DeletePropertyPreparer(ctx context.Context, nameID string, propertyName string, timeout *int64) (*http.Request, error) {
1704	pathParameters := map[string]interface{}{
1705		"nameId": nameID,
1706	}
1707
1708	const APIVersion = "6.0"
1709	queryParameters := map[string]interface{}{
1710		"api-version":  APIVersion,
1711		"PropertyName": autorest.Encode("query", propertyName),
1712	}
1713	if timeout != nil {
1714		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1715	} else {
1716		queryParameters["timeout"] = autorest.Encode("query", 60)
1717	}
1718
1719	preparer := autorest.CreatePreparer(
1720		autorest.AsDelete(),
1721		autorest.WithBaseURL(client.BaseURI),
1722		autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters),
1723		autorest.WithQueryParameters(queryParameters))
1724	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1725}
1726
1727// DeletePropertySender sends the DeleteProperty request. The method will close the
1728// http.Response Body if it receives an error.
1729func (client BaseClient) DeletePropertySender(req *http.Request) (*http.Response, error) {
1730	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1731}
1732
1733// DeletePropertyResponder handles the response to the DeleteProperty request. The method always
1734// closes the http.Response Body.
1735func (client BaseClient) DeletePropertyResponder(resp *http.Response) (result autorest.Response, err error) {
1736	err = autorest.Respond(
1737		resp,
1738		azure.WithErrorUnlessStatusCode(http.StatusOK),
1739		autorest.ByClosing())
1740	result.Response = resp
1741	return
1742}
1743
1744// DeleteRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your code.
1745// Parameters:
1746// repairTaskDeleteDescription - describes the repair task to be deleted.
1747func (client BaseClient) DeleteRepairTask(ctx context.Context, repairTaskDeleteDescription RepairTaskDeleteDescription) (result autorest.Response, err error) {
1748	if tracing.IsEnabled() {
1749		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteRepairTask")
1750		defer func() {
1751			sc := -1
1752			if result.Response != nil {
1753				sc = result.Response.StatusCode
1754			}
1755			tracing.EndSpan(ctx, sc, err)
1756		}()
1757	}
1758	if err := validation.Validate([]validation.Validation{
1759		{TargetValue: repairTaskDeleteDescription,
1760			Constraints: []validation.Constraint{{Target: "repairTaskDeleteDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
1761		return result, validation.NewError("servicefabric.BaseClient", "DeleteRepairTask", err.Error())
1762	}
1763
1764	req, err := client.DeleteRepairTaskPreparer(ctx, repairTaskDeleteDescription)
1765	if err != nil {
1766		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", nil, "Failure preparing request")
1767		return
1768	}
1769
1770	resp, err := client.DeleteRepairTaskSender(req)
1771	if err != nil {
1772		result.Response = resp
1773		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", resp, "Failure sending request")
1774		return
1775	}
1776
1777	result, err = client.DeleteRepairTaskResponder(resp)
1778	if err != nil {
1779		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", resp, "Failure responding to request")
1780		return
1781	}
1782
1783	return
1784}
1785
1786// DeleteRepairTaskPreparer prepares the DeleteRepairTask request.
1787func (client BaseClient) DeleteRepairTaskPreparer(ctx context.Context, repairTaskDeleteDescription RepairTaskDeleteDescription) (*http.Request, error) {
1788	const APIVersion = "6.0"
1789	queryParameters := map[string]interface{}{
1790		"api-version": APIVersion,
1791	}
1792
1793	preparer := autorest.CreatePreparer(
1794		autorest.AsContentType("application/json; charset=utf-8"),
1795		autorest.AsPost(),
1796		autorest.WithBaseURL(client.BaseURI),
1797		autorest.WithPath("/$/DeleteRepairTask"),
1798		autorest.WithJSON(repairTaskDeleteDescription),
1799		autorest.WithQueryParameters(queryParameters))
1800	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1801}
1802
1803// DeleteRepairTaskSender sends the DeleteRepairTask request. The method will close the
1804// http.Response Body if it receives an error.
1805func (client BaseClient) DeleteRepairTaskSender(req *http.Request) (*http.Response, error) {
1806	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1807}
1808
1809// DeleteRepairTaskResponder handles the response to the DeleteRepairTask request. The method always
1810// closes the http.Response Body.
1811func (client BaseClient) DeleteRepairTaskResponder(resp *http.Response) (result autorest.Response, err error) {
1812	err = autorest.Respond(
1813		resp,
1814		azure.WithErrorUnlessStatusCode(http.StatusOK),
1815		autorest.ByClosing())
1816	result.Response = resp
1817	return
1818}
1819
1820// DeleteService deletes an existing Service Fabric service. A service must be created before it can be deleted. By
1821// default, Service Fabric will try to close service replicas in a graceful manner and then delete the service.
1822// However, if the service is having issues closing the replica gracefully, the delete operation may take a long time
1823// or get stuck. Use the optional ForceRemove flag to skip the graceful close sequence and forcefully delete the
1824// service.
1825// Parameters:
1826// serviceID - the identity of the service. This is typically the full name of the service without the
1827// 'fabric:' URI scheme.
1828// Starting from version 6.0, hierarchical names are delimited with the "~" character.
1829// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
1830// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
1831// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful
1832// shutdown sequence. This parameter can be used to forcefully delete an application or service for which
1833// delete is timing out due to issues in the service code that prevents graceful close of replicas.
1834// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1835// duration that the client is willing to wait for the requested operation to complete. The default value for
1836// this parameter is 60 seconds.
1837func (client BaseClient) DeleteService(ctx context.Context, serviceID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) {
1838	if tracing.IsEnabled() {
1839		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteService")
1840		defer func() {
1841			sc := -1
1842			if result.Response != nil {
1843				sc = result.Response.StatusCode
1844			}
1845			tracing.EndSpan(ctx, sc, err)
1846		}()
1847	}
1848	if err := validation.Validate([]validation.Validation{
1849		{TargetValue: timeout,
1850			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1851				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1852					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1853				}}}}}); err != nil {
1854		return result, validation.NewError("servicefabric.BaseClient", "DeleteService", err.Error())
1855	}
1856
1857	req, err := client.DeleteServicePreparer(ctx, serviceID, forceRemove, timeout)
1858	if err != nil {
1859		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", nil, "Failure preparing request")
1860		return
1861	}
1862
1863	resp, err := client.DeleteServiceSender(req)
1864	if err != nil {
1865		result.Response = resp
1866		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", resp, "Failure sending request")
1867		return
1868	}
1869
1870	result, err = client.DeleteServiceResponder(resp)
1871	if err != nil {
1872		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", resp, "Failure responding to request")
1873		return
1874	}
1875
1876	return
1877}
1878
1879// DeleteServicePreparer prepares the DeleteService request.
1880func (client BaseClient) DeleteServicePreparer(ctx context.Context, serviceID string, forceRemove *bool, timeout *int64) (*http.Request, error) {
1881	pathParameters := map[string]interface{}{
1882		"serviceId": serviceID,
1883	}
1884
1885	const APIVersion = "6.0"
1886	queryParameters := map[string]interface{}{
1887		"api-version": APIVersion,
1888	}
1889	if forceRemove != nil {
1890		queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove)
1891	}
1892	if timeout != nil {
1893		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1894	} else {
1895		queryParameters["timeout"] = autorest.Encode("query", 60)
1896	}
1897
1898	preparer := autorest.CreatePreparer(
1899		autorest.AsPost(),
1900		autorest.WithBaseURL(client.BaseURI),
1901		autorest.WithPathParameters("/Services/{serviceId}/$/Delete", pathParameters),
1902		autorest.WithQueryParameters(queryParameters))
1903	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1904}
1905
1906// DeleteServiceSender sends the DeleteService request. The method will close the
1907// http.Response Body if it receives an error.
1908func (client BaseClient) DeleteServiceSender(req *http.Request) (*http.Response, error) {
1909	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1910}
1911
1912// DeleteServiceResponder handles the response to the DeleteService request. The method always
1913// closes the http.Response Body.
1914func (client BaseClient) DeleteServiceResponder(resp *http.Response) (result autorest.Response, err error) {
1915	err = autorest.Respond(
1916		resp,
1917		azure.WithErrorUnlessStatusCode(http.StatusOK),
1918		autorest.ByClosing())
1919	result.Response = resp
1920	return
1921}
1922
1923// DeployServicePackageToNode this API provides a way to download code packages including the container images on a
1924// specific node outside of the normal application deployment and upgrade path. This is useful for the large code
1925// packages and container images to be present on the node before the actual application deployment and upgrade, thus
1926// significantly reducing the total time required for the deployment or upgrade.
1927// Parameters:
1928// nodeName - the name of the node.
1929// deployServicePackageToNodeDescription - describes information for deploying a service package to a Service
1930// Fabric node.
1931// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1932// duration that the client is willing to wait for the requested operation to complete. The default value for
1933// this parameter is 60 seconds.
1934func (client BaseClient) DeployServicePackageToNode(ctx context.Context, nodeName string, deployServicePackageToNodeDescription DeployServicePackageToNodeDescription, timeout *int64) (result autorest.Response, err error) {
1935	if tracing.IsEnabled() {
1936		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeployServicePackageToNode")
1937		defer func() {
1938			sc := -1
1939			if result.Response != nil {
1940				sc = result.Response.StatusCode
1941			}
1942			tracing.EndSpan(ctx, sc, err)
1943		}()
1944	}
1945	if err := validation.Validate([]validation.Validation{
1946		{TargetValue: deployServicePackageToNodeDescription,
1947			Constraints: []validation.Constraint{{Target: "deployServicePackageToNodeDescription.ServiceManifestName", Name: validation.Null, Rule: true, Chain: nil},
1948				{Target: "deployServicePackageToNodeDescription.ApplicationTypeName", Name: validation.Null, Rule: true, Chain: nil},
1949				{Target: "deployServicePackageToNodeDescription.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil},
1950				{Target: "deployServicePackageToNodeDescription.NodeName", Name: validation.Null, Rule: true, Chain: nil}}},
1951		{TargetValue: timeout,
1952			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1953				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1954					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1955				}}}}}); err != nil {
1956		return result, validation.NewError("servicefabric.BaseClient", "DeployServicePackageToNode", err.Error())
1957	}
1958
1959	req, err := client.DeployServicePackageToNodePreparer(ctx, nodeName, deployServicePackageToNodeDescription, timeout)
1960	if err != nil {
1961		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", nil, "Failure preparing request")
1962		return
1963	}
1964
1965	resp, err := client.DeployServicePackageToNodeSender(req)
1966	if err != nil {
1967		result.Response = resp
1968		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", resp, "Failure sending request")
1969		return
1970	}
1971
1972	result, err = client.DeployServicePackageToNodeResponder(resp)
1973	if err != nil {
1974		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", resp, "Failure responding to request")
1975		return
1976	}
1977
1978	return
1979}
1980
1981// DeployServicePackageToNodePreparer prepares the DeployServicePackageToNode request.
1982func (client BaseClient) DeployServicePackageToNodePreparer(ctx context.Context, nodeName string, deployServicePackageToNodeDescription DeployServicePackageToNodeDescription, timeout *int64) (*http.Request, error) {
1983	pathParameters := map[string]interface{}{
1984		"nodeName": autorest.Encode("path", nodeName),
1985	}
1986
1987	const APIVersion = "6.0"
1988	queryParameters := map[string]interface{}{
1989		"api-version": APIVersion,
1990	}
1991	if timeout != nil {
1992		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1993	} else {
1994		queryParameters["timeout"] = autorest.Encode("query", 60)
1995	}
1996
1997	preparer := autorest.CreatePreparer(
1998		autorest.AsContentType("application/json; charset=utf-8"),
1999		autorest.AsPost(),
2000		autorest.WithBaseURL(client.BaseURI),
2001		autorest.WithPathParameters("/Nodes/{nodeName}/$/DeployServicePackage", pathParameters),
2002		autorest.WithJSON(deployServicePackageToNodeDescription),
2003		autorest.WithQueryParameters(queryParameters))
2004	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2005}
2006
2007// DeployServicePackageToNodeSender sends the DeployServicePackageToNode request. The method will close the
2008// http.Response Body if it receives an error.
2009func (client BaseClient) DeployServicePackageToNodeSender(req *http.Request) (*http.Response, error) {
2010	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2011}
2012
2013// DeployServicePackageToNodeResponder handles the response to the DeployServicePackageToNode request. The method always
2014// closes the http.Response Body.
2015func (client BaseClient) DeployServicePackageToNodeResponder(resp *http.Response) (result autorest.Response, err error) {
2016	err = autorest.Respond(
2017		resp,
2018		azure.WithErrorUnlessStatusCode(http.StatusOK),
2019		autorest.ByClosing())
2020	result.Response = resp
2021	return
2022}
2023
2024// DisableApplicationBackup disables periodic backup of Service Fabric application which was previously enabled.
2025// Parameters:
2026// applicationID - the identity of the application. This is typically the full name of the application without
2027// the 'fabric:' URI scheme.
2028// Starting from version 6.0, hierarchical names are delimited with the "~" character.
2029// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
2030// in 6.0+ and "myapp/app1" in previous versions.
2031// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2032// duration that the client is willing to wait for the requested operation to complete. The default value for
2033// this parameter is 60 seconds.
2034func (client BaseClient) DisableApplicationBackup(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) {
2035	if tracing.IsEnabled() {
2036		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableApplicationBackup")
2037		defer func() {
2038			sc := -1
2039			if result.Response != nil {
2040				sc = result.Response.StatusCode
2041			}
2042			tracing.EndSpan(ctx, sc, err)
2043		}()
2044	}
2045	if err := validation.Validate([]validation.Validation{
2046		{TargetValue: timeout,
2047			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2048				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2049					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2050				}}}}}); err != nil {
2051		return result, validation.NewError("servicefabric.BaseClient", "DisableApplicationBackup", err.Error())
2052	}
2053
2054	req, err := client.DisableApplicationBackupPreparer(ctx, applicationID, timeout)
2055	if err != nil {
2056		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", nil, "Failure preparing request")
2057		return
2058	}
2059
2060	resp, err := client.DisableApplicationBackupSender(req)
2061	if err != nil {
2062		result.Response = resp
2063		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", resp, "Failure sending request")
2064		return
2065	}
2066
2067	result, err = client.DisableApplicationBackupResponder(resp)
2068	if err != nil {
2069		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", resp, "Failure responding to request")
2070		return
2071	}
2072
2073	return
2074}
2075
2076// DisableApplicationBackupPreparer prepares the DisableApplicationBackup request.
2077func (client BaseClient) DisableApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
2078	pathParameters := map[string]interface{}{
2079		"applicationId": applicationID,
2080	}
2081
2082	const APIVersion = "6.2-preview"
2083	queryParameters := map[string]interface{}{
2084		"api-version": APIVersion,
2085	}
2086	if timeout != nil {
2087		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2088	} else {
2089		queryParameters["timeout"] = autorest.Encode("query", 60)
2090	}
2091
2092	preparer := autorest.CreatePreparer(
2093		autorest.AsPost(),
2094		autorest.WithBaseURL(client.BaseURI),
2095		autorest.WithPathParameters("/Applications/{applicationId}/$/DisableBackup", pathParameters),
2096		autorest.WithQueryParameters(queryParameters))
2097	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2098}
2099
2100// DisableApplicationBackupSender sends the DisableApplicationBackup request. The method will close the
2101// http.Response Body if it receives an error.
2102func (client BaseClient) DisableApplicationBackupSender(req *http.Request) (*http.Response, error) {
2103	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2104}
2105
2106// DisableApplicationBackupResponder handles the response to the DisableApplicationBackup request. The method always
2107// closes the http.Response Body.
2108func (client BaseClient) DisableApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2109	err = autorest.Respond(
2110		resp,
2111		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2112		autorest.ByClosing())
2113	result.Response = resp
2114	return
2115}
2116
2117// DisableNode deactivate a Service Fabric cluster node with the specified deactivation intent. Once the deactivation
2118// is in progress, the deactivation intent can be increased, but not decreased (for example, a node which is was
2119// deactivated with the Pause intent can be deactivated further with Restart, but not the other way around. Nodes may
2120// be reactivated using the Activate a node operation any time after they are deactivated. If the deactivation is not
2121// complete this will cancel the deactivation. A node which goes down and comes back up while deactivated will still
2122// need to be reactivated before services will be placed on that node.
2123// Parameters:
2124// nodeName - the name of the node.
2125// deactivationIntentDescription - describes the intent or reason for deactivating the node.
2126// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2127// duration that the client is willing to wait for the requested operation to complete. The default value for
2128// this parameter is 60 seconds.
2129func (client BaseClient) DisableNode(ctx context.Context, nodeName string, deactivationIntentDescription DeactivationIntentDescription, timeout *int64) (result autorest.Response, err error) {
2130	if tracing.IsEnabled() {
2131		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableNode")
2132		defer func() {
2133			sc := -1
2134			if result.Response != nil {
2135				sc = result.Response.StatusCode
2136			}
2137			tracing.EndSpan(ctx, sc, err)
2138		}()
2139	}
2140	if err := validation.Validate([]validation.Validation{
2141		{TargetValue: timeout,
2142			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2143				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2144					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2145				}}}}}); err != nil {
2146		return result, validation.NewError("servicefabric.BaseClient", "DisableNode", err.Error())
2147	}
2148
2149	req, err := client.DisableNodePreparer(ctx, nodeName, deactivationIntentDescription, timeout)
2150	if err != nil {
2151		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", nil, "Failure preparing request")
2152		return
2153	}
2154
2155	resp, err := client.DisableNodeSender(req)
2156	if err != nil {
2157		result.Response = resp
2158		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", resp, "Failure sending request")
2159		return
2160	}
2161
2162	result, err = client.DisableNodeResponder(resp)
2163	if err != nil {
2164		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", resp, "Failure responding to request")
2165		return
2166	}
2167
2168	return
2169}
2170
2171// DisableNodePreparer prepares the DisableNode request.
2172func (client BaseClient) DisableNodePreparer(ctx context.Context, nodeName string, deactivationIntentDescription DeactivationIntentDescription, timeout *int64) (*http.Request, error) {
2173	pathParameters := map[string]interface{}{
2174		"nodeName": autorest.Encode("path", nodeName),
2175	}
2176
2177	const APIVersion = "6.0"
2178	queryParameters := map[string]interface{}{
2179		"api-version": APIVersion,
2180	}
2181	if timeout != nil {
2182		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2183	} else {
2184		queryParameters["timeout"] = autorest.Encode("query", 60)
2185	}
2186
2187	preparer := autorest.CreatePreparer(
2188		autorest.AsContentType("application/json; charset=utf-8"),
2189		autorest.AsPost(),
2190		autorest.WithBaseURL(client.BaseURI),
2191		autorest.WithPathParameters("/Nodes/{nodeName}/$/Deactivate", pathParameters),
2192		autorest.WithJSON(deactivationIntentDescription),
2193		autorest.WithQueryParameters(queryParameters))
2194	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2195}
2196
2197// DisableNodeSender sends the DisableNode request. The method will close the
2198// http.Response Body if it receives an error.
2199func (client BaseClient) DisableNodeSender(req *http.Request) (*http.Response, error) {
2200	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2201}
2202
2203// DisableNodeResponder handles the response to the DisableNode request. The method always
2204// closes the http.Response Body.
2205func (client BaseClient) DisableNodeResponder(resp *http.Response) (result autorest.Response, err error) {
2206	err = autorest.Respond(
2207		resp,
2208		azure.WithErrorUnlessStatusCode(http.StatusOK),
2209		autorest.ByClosing())
2210	result.Response = resp
2211	return
2212}
2213
2214// DisablePartitionBackup disables periodic backup of partition which was previously enabled. Backup must be explicitly
2215// enabled before it can be disabled.
2216// In case the backup is enabled for the Service Fabric application or service, which this partition is part of, this
2217// partition would continue to be periodically backed up as per the policy mapped at the higher level entity.
2218// Parameters:
2219// partitionID - the identity of the partition.
2220// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2221// duration that the client is willing to wait for the requested operation to complete. The default value for
2222// this parameter is 60 seconds.
2223func (client BaseClient) DisablePartitionBackup(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
2224	if tracing.IsEnabled() {
2225		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisablePartitionBackup")
2226		defer func() {
2227			sc := -1
2228			if result.Response != nil {
2229				sc = result.Response.StatusCode
2230			}
2231			tracing.EndSpan(ctx, sc, err)
2232		}()
2233	}
2234	if err := validation.Validate([]validation.Validation{
2235		{TargetValue: timeout,
2236			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2237				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2238					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2239				}}}}}); err != nil {
2240		return result, validation.NewError("servicefabric.BaseClient", "DisablePartitionBackup", err.Error())
2241	}
2242
2243	req, err := client.DisablePartitionBackupPreparer(ctx, partitionID, timeout)
2244	if err != nil {
2245		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", nil, "Failure preparing request")
2246		return
2247	}
2248
2249	resp, err := client.DisablePartitionBackupSender(req)
2250	if err != nil {
2251		result.Response = resp
2252		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", resp, "Failure sending request")
2253		return
2254	}
2255
2256	result, err = client.DisablePartitionBackupResponder(resp)
2257	if err != nil {
2258		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", resp, "Failure responding to request")
2259		return
2260	}
2261
2262	return
2263}
2264
2265// DisablePartitionBackupPreparer prepares the DisablePartitionBackup request.
2266func (client BaseClient) DisablePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
2267	pathParameters := map[string]interface{}{
2268		"partitionId": partitionID,
2269	}
2270
2271	const APIVersion = "6.2-preview"
2272	queryParameters := map[string]interface{}{
2273		"api-version": APIVersion,
2274	}
2275	if timeout != nil {
2276		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2277	} else {
2278		queryParameters["timeout"] = autorest.Encode("query", 60)
2279	}
2280
2281	preparer := autorest.CreatePreparer(
2282		autorest.AsPost(),
2283		autorest.WithBaseURL(client.BaseURI),
2284		autorest.WithPathParameters("/Partitions/{partitionId}/$/DisableBackup", pathParameters),
2285		autorest.WithQueryParameters(queryParameters))
2286	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2287}
2288
2289// DisablePartitionBackupSender sends the DisablePartitionBackup request. The method will close the
2290// http.Response Body if it receives an error.
2291func (client BaseClient) DisablePartitionBackupSender(req *http.Request) (*http.Response, error) {
2292	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2293}
2294
2295// DisablePartitionBackupResponder handles the response to the DisablePartitionBackup request. The method always
2296// closes the http.Response Body.
2297func (client BaseClient) DisablePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2298	err = autorest.Respond(
2299		resp,
2300		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2301		autorest.ByClosing())
2302	result.Response = resp
2303	return
2304}
2305
2306// DisableServiceBackup disables periodic backup of Service Fabric service which was previously enabled. Backup must be
2307// explicitly enabled before it can be disabled.
2308// In case the backup is enabled for the Service Fabric application, which this service is part of, this service would
2309// continue to be periodically backed up as per the policy mapped at the application level.
2310// Parameters:
2311// serviceID - the identity of the service. This is typically the full name of the service without the
2312// 'fabric:' URI scheme.
2313// Starting from version 6.0, hierarchical names are delimited with the "~" character.
2314// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
2315// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
2316// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2317// duration that the client is willing to wait for the requested operation to complete. The default value for
2318// this parameter is 60 seconds.
2319func (client BaseClient) DisableServiceBackup(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) {
2320	if tracing.IsEnabled() {
2321		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableServiceBackup")
2322		defer func() {
2323			sc := -1
2324			if result.Response != nil {
2325				sc = result.Response.StatusCode
2326			}
2327			tracing.EndSpan(ctx, sc, err)
2328		}()
2329	}
2330	if err := validation.Validate([]validation.Validation{
2331		{TargetValue: timeout,
2332			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2333				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2334					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2335				}}}}}); err != nil {
2336		return result, validation.NewError("servicefabric.BaseClient", "DisableServiceBackup", err.Error())
2337	}
2338
2339	req, err := client.DisableServiceBackupPreparer(ctx, serviceID, timeout)
2340	if err != nil {
2341		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", nil, "Failure preparing request")
2342		return
2343	}
2344
2345	resp, err := client.DisableServiceBackupSender(req)
2346	if err != nil {
2347		result.Response = resp
2348		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", resp, "Failure sending request")
2349		return
2350	}
2351
2352	result, err = client.DisableServiceBackupResponder(resp)
2353	if err != nil {
2354		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", resp, "Failure responding to request")
2355		return
2356	}
2357
2358	return
2359}
2360
2361// DisableServiceBackupPreparer prepares the DisableServiceBackup request.
2362func (client BaseClient) DisableServiceBackupPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
2363	pathParameters := map[string]interface{}{
2364		"serviceId": serviceID,
2365	}
2366
2367	const APIVersion = "6.2-preview"
2368	queryParameters := map[string]interface{}{
2369		"api-version": APIVersion,
2370	}
2371	if timeout != nil {
2372		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2373	} else {
2374		queryParameters["timeout"] = autorest.Encode("query", 60)
2375	}
2376
2377	preparer := autorest.CreatePreparer(
2378		autorest.AsPost(),
2379		autorest.WithBaseURL(client.BaseURI),
2380		autorest.WithPathParameters("/Services/{serviceId}/$/DisableBackup", pathParameters),
2381		autorest.WithQueryParameters(queryParameters))
2382	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2383}
2384
2385// DisableServiceBackupSender sends the DisableServiceBackup request. The method will close the
2386// http.Response Body if it receives an error.
2387func (client BaseClient) DisableServiceBackupSender(req *http.Request) (*http.Response, error) {
2388	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2389}
2390
2391// DisableServiceBackupResponder handles the response to the DisableServiceBackup request. The method always
2392// closes the http.Response Body.
2393func (client BaseClient) DisableServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2394	err = autorest.Respond(
2395		resp,
2396		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2397		autorest.ByClosing())
2398	result.Response = resp
2399	return
2400}
2401
2402// EnableApplicationBackup enables periodic backup of stateful partitions which are part of this Service Fabric
2403// application. Each partition is backed up individually as per the specified backup policy description.
2404// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup.
2405// Parameters:
2406// applicationID - the identity of the application. This is typically the full name of the application without
2407// the 'fabric:' URI scheme.
2408// Starting from version 6.0, hierarchical names are delimited with the "~" character.
2409// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
2410// in 6.0+ and "myapp/app1" in previous versions.
2411// enableBackupDescription - specifies the parameters for enabling backup.
2412// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2413// duration that the client is willing to wait for the requested operation to complete. The default value for
2414// this parameter is 60 seconds.
2415func (client BaseClient) EnableApplicationBackup(ctx context.Context, applicationID string, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) {
2416	if tracing.IsEnabled() {
2417		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableApplicationBackup")
2418		defer func() {
2419			sc := -1
2420			if result.Response != nil {
2421				sc = result.Response.StatusCode
2422			}
2423			tracing.EndSpan(ctx, sc, err)
2424		}()
2425	}
2426	if err := validation.Validate([]validation.Validation{
2427		{TargetValue: enableBackupDescription,
2428			Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}},
2429		{TargetValue: timeout,
2430			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2431				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2432					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2433				}}}}}); err != nil {
2434		return result, validation.NewError("servicefabric.BaseClient", "EnableApplicationBackup", err.Error())
2435	}
2436
2437	req, err := client.EnableApplicationBackupPreparer(ctx, applicationID, enableBackupDescription, timeout)
2438	if err != nil {
2439		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", nil, "Failure preparing request")
2440		return
2441	}
2442
2443	resp, err := client.EnableApplicationBackupSender(req)
2444	if err != nil {
2445		result.Response = resp
2446		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", resp, "Failure sending request")
2447		return
2448	}
2449
2450	result, err = client.EnableApplicationBackupResponder(resp)
2451	if err != nil {
2452		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", resp, "Failure responding to request")
2453		return
2454	}
2455
2456	return
2457}
2458
2459// EnableApplicationBackupPreparer prepares the EnableApplicationBackup request.
2460func (client BaseClient) EnableApplicationBackupPreparer(ctx context.Context, applicationID string, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) {
2461	pathParameters := map[string]interface{}{
2462		"applicationId": applicationID,
2463	}
2464
2465	const APIVersion = "6.2-preview"
2466	queryParameters := map[string]interface{}{
2467		"api-version": APIVersion,
2468	}
2469	if timeout != nil {
2470		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2471	} else {
2472		queryParameters["timeout"] = autorest.Encode("query", 60)
2473	}
2474
2475	preparer := autorest.CreatePreparer(
2476		autorest.AsContentType("application/json; charset=utf-8"),
2477		autorest.AsPost(),
2478		autorest.WithBaseURL(client.BaseURI),
2479		autorest.WithPathParameters("/Applications/{applicationId}/$/EnableBackup", pathParameters),
2480		autorest.WithJSON(enableBackupDescription),
2481		autorest.WithQueryParameters(queryParameters))
2482	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2483}
2484
2485// EnableApplicationBackupSender sends the EnableApplicationBackup request. The method will close the
2486// http.Response Body if it receives an error.
2487func (client BaseClient) EnableApplicationBackupSender(req *http.Request) (*http.Response, error) {
2488	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2489}
2490
2491// EnableApplicationBackupResponder handles the response to the EnableApplicationBackup request. The method always
2492// closes the http.Response Body.
2493func (client BaseClient) EnableApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2494	err = autorest.Respond(
2495		resp,
2496		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2497		autorest.ByClosing())
2498	result.Response = resp
2499	return
2500}
2501
2502// EnableNode activates a Service Fabric cluster node which is currently deactivated. Once activated, the node will
2503// again become a viable target for placing new replicas, and any deactivated replicas remaining on the node will be
2504// reactivated.
2505// Parameters:
2506// nodeName - the name of the node.
2507// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2508// duration that the client is willing to wait for the requested operation to complete. The default value for
2509// this parameter is 60 seconds.
2510func (client BaseClient) EnableNode(ctx context.Context, nodeName string, timeout *int64) (result autorest.Response, err error) {
2511	if tracing.IsEnabled() {
2512		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableNode")
2513		defer func() {
2514			sc := -1
2515			if result.Response != nil {
2516				sc = result.Response.StatusCode
2517			}
2518			tracing.EndSpan(ctx, sc, err)
2519		}()
2520	}
2521	if err := validation.Validate([]validation.Validation{
2522		{TargetValue: timeout,
2523			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2524				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2525					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2526				}}}}}); err != nil {
2527		return result, validation.NewError("servicefabric.BaseClient", "EnableNode", err.Error())
2528	}
2529
2530	req, err := client.EnableNodePreparer(ctx, nodeName, timeout)
2531	if err != nil {
2532		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", nil, "Failure preparing request")
2533		return
2534	}
2535
2536	resp, err := client.EnableNodeSender(req)
2537	if err != nil {
2538		result.Response = resp
2539		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", resp, "Failure sending request")
2540		return
2541	}
2542
2543	result, err = client.EnableNodeResponder(resp)
2544	if err != nil {
2545		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", resp, "Failure responding to request")
2546		return
2547	}
2548
2549	return
2550}
2551
2552// EnableNodePreparer prepares the EnableNode request.
2553func (client BaseClient) EnableNodePreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) {
2554	pathParameters := map[string]interface{}{
2555		"nodeName": autorest.Encode("path", nodeName),
2556	}
2557
2558	const APIVersion = "6.0"
2559	queryParameters := map[string]interface{}{
2560		"api-version": APIVersion,
2561	}
2562	if timeout != nil {
2563		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2564	} else {
2565		queryParameters["timeout"] = autorest.Encode("query", 60)
2566	}
2567
2568	preparer := autorest.CreatePreparer(
2569		autorest.AsPost(),
2570		autorest.WithBaseURL(client.BaseURI),
2571		autorest.WithPathParameters("/Nodes/{nodeName}/$/Activate", pathParameters),
2572		autorest.WithQueryParameters(queryParameters))
2573	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2574}
2575
2576// EnableNodeSender sends the EnableNode request. The method will close the
2577// http.Response Body if it receives an error.
2578func (client BaseClient) EnableNodeSender(req *http.Request) (*http.Response, error) {
2579	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2580}
2581
2582// EnableNodeResponder handles the response to the EnableNode request. The method always
2583// closes the http.Response Body.
2584func (client BaseClient) EnableNodeResponder(resp *http.Response) (result autorest.Response, err error) {
2585	err = autorest.Respond(
2586		resp,
2587		azure.WithErrorUnlessStatusCode(http.StatusOK),
2588		autorest.ByClosing())
2589	result.Response = resp
2590	return
2591}
2592
2593// EnablePartitionBackup enables periodic backup of stateful persisted partition. Each partition is backed up as per
2594// the specified backup policy description. In case the application or service, which is partition is part of, is
2595// already enabled for backup then this operation would override the policy being used to take the periodic backup of
2596// this partition.
2597// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup.
2598// Parameters:
2599// partitionID - the identity of the partition.
2600// enableBackupDescription - specifies the parameters for enabling backup.
2601// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2602// duration that the client is willing to wait for the requested operation to complete. The default value for
2603// this parameter is 60 seconds.
2604func (client BaseClient) EnablePartitionBackup(ctx context.Context, partitionID uuid.UUID, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) {
2605	if tracing.IsEnabled() {
2606		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnablePartitionBackup")
2607		defer func() {
2608			sc := -1
2609			if result.Response != nil {
2610				sc = result.Response.StatusCode
2611			}
2612			tracing.EndSpan(ctx, sc, err)
2613		}()
2614	}
2615	if err := validation.Validate([]validation.Validation{
2616		{TargetValue: enableBackupDescription,
2617			Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}},
2618		{TargetValue: timeout,
2619			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2620				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2621					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2622				}}}}}); err != nil {
2623		return result, validation.NewError("servicefabric.BaseClient", "EnablePartitionBackup", err.Error())
2624	}
2625
2626	req, err := client.EnablePartitionBackupPreparer(ctx, partitionID, enableBackupDescription, timeout)
2627	if err != nil {
2628		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", nil, "Failure preparing request")
2629		return
2630	}
2631
2632	resp, err := client.EnablePartitionBackupSender(req)
2633	if err != nil {
2634		result.Response = resp
2635		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", resp, "Failure sending request")
2636		return
2637	}
2638
2639	result, err = client.EnablePartitionBackupResponder(resp)
2640	if err != nil {
2641		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", resp, "Failure responding to request")
2642		return
2643	}
2644
2645	return
2646}
2647
2648// EnablePartitionBackupPreparer prepares the EnablePartitionBackup request.
2649func (client BaseClient) EnablePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) {
2650	pathParameters := map[string]interface{}{
2651		"partitionId": partitionID,
2652	}
2653
2654	const APIVersion = "6.2-preview"
2655	queryParameters := map[string]interface{}{
2656		"api-version": APIVersion,
2657	}
2658	if timeout != nil {
2659		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2660	} else {
2661		queryParameters["timeout"] = autorest.Encode("query", 60)
2662	}
2663
2664	preparer := autorest.CreatePreparer(
2665		autorest.AsContentType("application/json; charset=utf-8"),
2666		autorest.AsPost(),
2667		autorest.WithBaseURL(client.BaseURI),
2668		autorest.WithPathParameters("/Partitions/{partitionId}/$/EnableBackup", pathParameters),
2669		autorest.WithJSON(enableBackupDescription),
2670		autorest.WithQueryParameters(queryParameters))
2671	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2672}
2673
2674// EnablePartitionBackupSender sends the EnablePartitionBackup request. The method will close the
2675// http.Response Body if it receives an error.
2676func (client BaseClient) EnablePartitionBackupSender(req *http.Request) (*http.Response, error) {
2677	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2678}
2679
2680// EnablePartitionBackupResponder handles the response to the EnablePartitionBackup request. The method always
2681// closes the http.Response Body.
2682func (client BaseClient) EnablePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2683	err = autorest.Respond(
2684		resp,
2685		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2686		autorest.ByClosing())
2687	result.Response = resp
2688	return
2689}
2690
2691// EnableServiceBackup enables periodic backup of stateful partitions which are part of this Service Fabric service.
2692// Each partition is backed up individually as per the specified backup policy description. In case the application,
2693// which the service is part of, is already enabled for backup then this operation would override the policy being used
2694// to take the periodic backup for this service and its partitions (unless explicitly overridden at the partition
2695// level).
2696// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup.
2697// Parameters:
2698// serviceID - the identity of the service. This is typically the full name of the service without the
2699// 'fabric:' URI scheme.
2700// Starting from version 6.0, hierarchical names are delimited with the "~" character.
2701// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
2702// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
2703// enableBackupDescription - specifies the parameters for enabling backup.
2704// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2705// duration that the client is willing to wait for the requested operation to complete. The default value for
2706// this parameter is 60 seconds.
2707func (client BaseClient) EnableServiceBackup(ctx context.Context, serviceID string, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) {
2708	if tracing.IsEnabled() {
2709		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableServiceBackup")
2710		defer func() {
2711			sc := -1
2712			if result.Response != nil {
2713				sc = result.Response.StatusCode
2714			}
2715			tracing.EndSpan(ctx, sc, err)
2716		}()
2717	}
2718	if err := validation.Validate([]validation.Validation{
2719		{TargetValue: enableBackupDescription,
2720			Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}},
2721		{TargetValue: timeout,
2722			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2723				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2724					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2725				}}}}}); err != nil {
2726		return result, validation.NewError("servicefabric.BaseClient", "EnableServiceBackup", err.Error())
2727	}
2728
2729	req, err := client.EnableServiceBackupPreparer(ctx, serviceID, enableBackupDescription, timeout)
2730	if err != nil {
2731		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", nil, "Failure preparing request")
2732		return
2733	}
2734
2735	resp, err := client.EnableServiceBackupSender(req)
2736	if err != nil {
2737		result.Response = resp
2738		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", resp, "Failure sending request")
2739		return
2740	}
2741
2742	result, err = client.EnableServiceBackupResponder(resp)
2743	if err != nil {
2744		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", resp, "Failure responding to request")
2745		return
2746	}
2747
2748	return
2749}
2750
2751// EnableServiceBackupPreparer prepares the EnableServiceBackup request.
2752func (client BaseClient) EnableServiceBackupPreparer(ctx context.Context, serviceID string, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) {
2753	pathParameters := map[string]interface{}{
2754		"serviceId": serviceID,
2755	}
2756
2757	const APIVersion = "6.2-preview"
2758	queryParameters := map[string]interface{}{
2759		"api-version": APIVersion,
2760	}
2761	if timeout != nil {
2762		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2763	} else {
2764		queryParameters["timeout"] = autorest.Encode("query", 60)
2765	}
2766
2767	preparer := autorest.CreatePreparer(
2768		autorest.AsContentType("application/json; charset=utf-8"),
2769		autorest.AsPost(),
2770		autorest.WithBaseURL(client.BaseURI),
2771		autorest.WithPathParameters("/Services/{serviceId}/$/EnableBackup", pathParameters),
2772		autorest.WithJSON(enableBackupDescription),
2773		autorest.WithQueryParameters(queryParameters))
2774	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2775}
2776
2777// EnableServiceBackupSender sends the EnableServiceBackup request. The method will close the
2778// http.Response Body if it receives an error.
2779func (client BaseClient) EnableServiceBackupSender(req *http.Request) (*http.Response, error) {
2780	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2781}
2782
2783// EnableServiceBackupResponder handles the response to the EnableServiceBackup request. The method always
2784// closes the http.Response Body.
2785func (client BaseClient) EnableServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2786	err = autorest.Respond(
2787		resp,
2788		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2789		autorest.ByClosing())
2790	result.Response = resp
2791	return
2792}
2793
2794// ForceApproveRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your
2795// code.
2796// Parameters:
2797// repairTaskApproveDescription - describes the repair task to be approved.
2798func (client BaseClient) ForceApproveRepairTask(ctx context.Context, repairTaskApproveDescription RepairTaskApproveDescription) (result RepairTaskUpdateInfo, err error) {
2799	if tracing.IsEnabled() {
2800		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ForceApproveRepairTask")
2801		defer func() {
2802			sc := -1
2803			if result.Response.Response != nil {
2804				sc = result.Response.Response.StatusCode
2805			}
2806			tracing.EndSpan(ctx, sc, err)
2807		}()
2808	}
2809	if err := validation.Validate([]validation.Validation{
2810		{TargetValue: repairTaskApproveDescription,
2811			Constraints: []validation.Constraint{{Target: "repairTaskApproveDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
2812		return result, validation.NewError("servicefabric.BaseClient", "ForceApproveRepairTask", err.Error())
2813	}
2814
2815	req, err := client.ForceApproveRepairTaskPreparer(ctx, repairTaskApproveDescription)
2816	if err != nil {
2817		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", nil, "Failure preparing request")
2818		return
2819	}
2820
2821	resp, err := client.ForceApproveRepairTaskSender(req)
2822	if err != nil {
2823		result.Response = autorest.Response{Response: resp}
2824		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", resp, "Failure sending request")
2825		return
2826	}
2827
2828	result, err = client.ForceApproveRepairTaskResponder(resp)
2829	if err != nil {
2830		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", resp, "Failure responding to request")
2831		return
2832	}
2833
2834	return
2835}
2836
2837// ForceApproveRepairTaskPreparer prepares the ForceApproveRepairTask request.
2838func (client BaseClient) ForceApproveRepairTaskPreparer(ctx context.Context, repairTaskApproveDescription RepairTaskApproveDescription) (*http.Request, error) {
2839	const APIVersion = "6.0"
2840	queryParameters := map[string]interface{}{
2841		"api-version": APIVersion,
2842	}
2843
2844	preparer := autorest.CreatePreparer(
2845		autorest.AsContentType("application/json; charset=utf-8"),
2846		autorest.AsPost(),
2847		autorest.WithBaseURL(client.BaseURI),
2848		autorest.WithPath("/$/ForceApproveRepairTask"),
2849		autorest.WithJSON(repairTaskApproveDescription),
2850		autorest.WithQueryParameters(queryParameters))
2851	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2852}
2853
2854// ForceApproveRepairTaskSender sends the ForceApproveRepairTask request. The method will close the
2855// http.Response Body if it receives an error.
2856func (client BaseClient) ForceApproveRepairTaskSender(req *http.Request) (*http.Response, error) {
2857	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2858}
2859
2860// ForceApproveRepairTaskResponder handles the response to the ForceApproveRepairTask request. The method always
2861// closes the http.Response Body.
2862func (client BaseClient) ForceApproveRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
2863	err = autorest.Respond(
2864		resp,
2865		azure.WithErrorUnlessStatusCode(http.StatusOK),
2866		autorest.ByUnmarshallingJSON(&result),
2867		autorest.ByClosing())
2868	result.Response = autorest.Response{Response: resp}
2869	return
2870}
2871
2872// GetAadMetadata gets the Azure Active Directory metadata used for secured connection to cluster.
2873// This API is not supposed to be called separately. It provides information needed to set up an Azure Active Directory
2874// secured connection with a Service Fabric cluster.
2875// Parameters:
2876// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2877// duration that the client is willing to wait for the requested operation to complete. The default value for
2878// this parameter is 60 seconds.
2879func (client BaseClient) GetAadMetadata(ctx context.Context, timeout *int64) (result AadMetadataObject, err error) {
2880	if tracing.IsEnabled() {
2881		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetAadMetadata")
2882		defer func() {
2883			sc := -1
2884			if result.Response.Response != nil {
2885				sc = result.Response.Response.StatusCode
2886			}
2887			tracing.EndSpan(ctx, sc, err)
2888		}()
2889	}
2890	if err := validation.Validate([]validation.Validation{
2891		{TargetValue: timeout,
2892			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2893				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2894					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2895				}}}}}); err != nil {
2896		return result, validation.NewError("servicefabric.BaseClient", "GetAadMetadata", err.Error())
2897	}
2898
2899	req, err := client.GetAadMetadataPreparer(ctx, timeout)
2900	if err != nil {
2901		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", nil, "Failure preparing request")
2902		return
2903	}
2904
2905	resp, err := client.GetAadMetadataSender(req)
2906	if err != nil {
2907		result.Response = autorest.Response{Response: resp}
2908		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", resp, "Failure sending request")
2909		return
2910	}
2911
2912	result, err = client.GetAadMetadataResponder(resp)
2913	if err != nil {
2914		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", resp, "Failure responding to request")
2915		return
2916	}
2917
2918	return
2919}
2920
2921// GetAadMetadataPreparer prepares the GetAadMetadata request.
2922func (client BaseClient) GetAadMetadataPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
2923	const APIVersion = "6.0"
2924	queryParameters := map[string]interface{}{
2925		"api-version": APIVersion,
2926	}
2927	if timeout != nil {
2928		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2929	} else {
2930		queryParameters["timeout"] = autorest.Encode("query", 60)
2931	}
2932
2933	preparer := autorest.CreatePreparer(
2934		autorest.AsGet(),
2935		autorest.WithBaseURL(client.BaseURI),
2936		autorest.WithPath("/$/GetAadMetadata"),
2937		autorest.WithQueryParameters(queryParameters))
2938	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2939}
2940
2941// GetAadMetadataSender sends the GetAadMetadata request. The method will close the
2942// http.Response Body if it receives an error.
2943func (client BaseClient) GetAadMetadataSender(req *http.Request) (*http.Response, error) {
2944	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2945}
2946
2947// GetAadMetadataResponder handles the response to the GetAadMetadata request. The method always
2948// closes the http.Response Body.
2949func (client BaseClient) GetAadMetadataResponder(resp *http.Response) (result AadMetadataObject, err error) {
2950	err = autorest.Respond(
2951		resp,
2952		azure.WithErrorUnlessStatusCode(http.StatusOK),
2953		autorest.ByUnmarshallingJSON(&result),
2954		autorest.ByClosing())
2955	result.Response = autorest.Response{Response: resp}
2956	return
2957}
2958
2959// GetAllEntitiesBackedUpByPolicy returns a list of Service Fabric application, service or partition which are
2960// associated with this backup policy.
2961// Parameters:
2962// backupPolicyName - the name of the backup policy.
2963// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
2964// token with a non empty value is included in the response of the API when the results from the system do not
2965// fit in a single response. When this value is passed to the next API call, the API returns next set of
2966// results. If there are no further results then the continuation token does not contain a value. The value of
2967// this parameter should not be URL encoded.
2968// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
2969// defines the upper bound on the number of results returned. The results returned can be less than the
2970// specified maximum results if they do not fit in the message as per the max message size restrictions defined
2971// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
2972// as possible that fit in the return message.
2973// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2974// duration that the client is willing to wait for the requested operation to complete. The default value for
2975// this parameter is 60 seconds.
2976func (client BaseClient) GetAllEntitiesBackedUpByPolicy(ctx context.Context, backupPolicyName string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupEntityList, err error) {
2977	if tracing.IsEnabled() {
2978		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetAllEntitiesBackedUpByPolicy")
2979		defer func() {
2980			sc := -1
2981			if result.Response.Response != nil {
2982				sc = result.Response.Response.StatusCode
2983			}
2984			tracing.EndSpan(ctx, sc, err)
2985		}()
2986	}
2987	if err := validation.Validate([]validation.Validation{
2988		{TargetValue: maxResults,
2989			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
2990				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
2991		{TargetValue: timeout,
2992			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2993				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2994					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2995				}}}}}); err != nil {
2996		return result, validation.NewError("servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", err.Error())
2997	}
2998
2999	req, err := client.GetAllEntitiesBackedUpByPolicyPreparer(ctx, backupPolicyName, continuationToken, maxResults, timeout)
3000	if err != nil {
3001		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", nil, "Failure preparing request")
3002		return
3003	}
3004
3005	resp, err := client.GetAllEntitiesBackedUpByPolicySender(req)
3006	if err != nil {
3007		result.Response = autorest.Response{Response: resp}
3008		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", resp, "Failure sending request")
3009		return
3010	}
3011
3012	result, err = client.GetAllEntitiesBackedUpByPolicyResponder(resp)
3013	if err != nil {
3014		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", resp, "Failure responding to request")
3015		return
3016	}
3017
3018	return
3019}
3020
3021// GetAllEntitiesBackedUpByPolicyPreparer prepares the GetAllEntitiesBackedUpByPolicy request.
3022func (client BaseClient) GetAllEntitiesBackedUpByPolicyPreparer(ctx context.Context, backupPolicyName string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
3023	pathParameters := map[string]interface{}{
3024		"backupPolicyName": autorest.Encode("path", backupPolicyName),
3025	}
3026
3027	const APIVersion = "6.2-preview"
3028	queryParameters := map[string]interface{}{
3029		"api-version": APIVersion,
3030	}
3031	if len(continuationToken) > 0 {
3032		queryParameters["ContinuationToken"] = continuationToken
3033	}
3034	if maxResults != nil {
3035		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
3036	} else {
3037		queryParameters["MaxResults"] = autorest.Encode("query", 0)
3038	}
3039	if timeout != nil {
3040		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3041	} else {
3042		queryParameters["timeout"] = autorest.Encode("query", 60)
3043	}
3044
3045	preparer := autorest.CreatePreparer(
3046		autorest.AsGet(),
3047		autorest.WithBaseURL(client.BaseURI),
3048		autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/GetBackupEnabledEntities", pathParameters),
3049		autorest.WithQueryParameters(queryParameters))
3050	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3051}
3052
3053// GetAllEntitiesBackedUpByPolicySender sends the GetAllEntitiesBackedUpByPolicy request. The method will close the
3054// http.Response Body if it receives an error.
3055func (client BaseClient) GetAllEntitiesBackedUpByPolicySender(req *http.Request) (*http.Response, error) {
3056	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3057}
3058
3059// GetAllEntitiesBackedUpByPolicyResponder handles the response to the GetAllEntitiesBackedUpByPolicy request. The method always
3060// closes the http.Response Body.
3061func (client BaseClient) GetAllEntitiesBackedUpByPolicyResponder(resp *http.Response) (result PagedBackupEntityList, err error) {
3062	err = autorest.Respond(
3063		resp,
3064		azure.WithErrorUnlessStatusCode(http.StatusOK),
3065		autorest.ByUnmarshallingJSON(&result),
3066		autorest.ByClosing())
3067	result.Response = autorest.Response{Response: resp}
3068	return
3069}
3070
3071// GetApplicationBackupConfigurationInfo gets the Service Fabric backup configuration information for the application
3072// and the services and partitions under this application.
3073// Parameters:
3074// applicationID - the identity of the application. This is typically the full name of the application without
3075// the 'fabric:' URI scheme.
3076// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3077// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3078// in 6.0+ and "myapp/app1" in previous versions.
3079// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
3080// token with a non empty value is included in the response of the API when the results from the system do not
3081// fit in a single response. When this value is passed to the next API call, the API returns next set of
3082// results. If there are no further results then the continuation token does not contain a value. The value of
3083// this parameter should not be URL encoded.
3084// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
3085// defines the upper bound on the number of results returned. The results returned can be less than the
3086// specified maximum results if they do not fit in the message as per the max message size restrictions defined
3087// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
3088// as possible that fit in the return message.
3089// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3090// duration that the client is willing to wait for the requested operation to complete. The default value for
3091// this parameter is 60 seconds.
3092func (client BaseClient) GetApplicationBackupConfigurationInfo(ctx context.Context, applicationID string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupConfigurationInfoList, err error) {
3093	if tracing.IsEnabled() {
3094		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationBackupConfigurationInfo")
3095		defer func() {
3096			sc := -1
3097			if result.Response.Response != nil {
3098				sc = result.Response.Response.StatusCode
3099			}
3100			tracing.EndSpan(ctx, sc, err)
3101		}()
3102	}
3103	if err := validation.Validate([]validation.Validation{
3104		{TargetValue: maxResults,
3105			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
3106				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
3107		{TargetValue: timeout,
3108			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3109				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3110					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3111				}}}}}); err != nil {
3112		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", err.Error())
3113	}
3114
3115	req, err := client.GetApplicationBackupConfigurationInfoPreparer(ctx, applicationID, continuationToken, maxResults, timeout)
3116	if err != nil {
3117		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", nil, "Failure preparing request")
3118		return
3119	}
3120
3121	resp, err := client.GetApplicationBackupConfigurationInfoSender(req)
3122	if err != nil {
3123		result.Response = autorest.Response{Response: resp}
3124		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", resp, "Failure sending request")
3125		return
3126	}
3127
3128	result, err = client.GetApplicationBackupConfigurationInfoResponder(resp)
3129	if err != nil {
3130		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", resp, "Failure responding to request")
3131		return
3132	}
3133
3134	return
3135}
3136
3137// GetApplicationBackupConfigurationInfoPreparer prepares the GetApplicationBackupConfigurationInfo request.
3138func (client BaseClient) GetApplicationBackupConfigurationInfoPreparer(ctx context.Context, applicationID string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
3139	pathParameters := map[string]interface{}{
3140		"applicationId": applicationID,
3141	}
3142
3143	const APIVersion = "6.2-preview"
3144	queryParameters := map[string]interface{}{
3145		"api-version": APIVersion,
3146	}
3147	if len(continuationToken) > 0 {
3148		queryParameters["ContinuationToken"] = continuationToken
3149	}
3150	if maxResults != nil {
3151		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
3152	} else {
3153		queryParameters["MaxResults"] = autorest.Encode("query", 0)
3154	}
3155	if timeout != nil {
3156		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3157	} else {
3158		queryParameters["timeout"] = autorest.Encode("query", 60)
3159	}
3160
3161	preparer := autorest.CreatePreparer(
3162		autorest.AsGet(),
3163		autorest.WithBaseURL(client.BaseURI),
3164		autorest.WithPathParameters("/Applications/{applicationId}/$/GetBackupConfigurationInfo", pathParameters),
3165		autorest.WithQueryParameters(queryParameters))
3166	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3167}
3168
3169// GetApplicationBackupConfigurationInfoSender sends the GetApplicationBackupConfigurationInfo request. The method will close the
3170// http.Response Body if it receives an error.
3171func (client BaseClient) GetApplicationBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) {
3172	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3173}
3174
3175// GetApplicationBackupConfigurationInfoResponder handles the response to the GetApplicationBackupConfigurationInfo request. The method always
3176// closes the http.Response Body.
3177func (client BaseClient) GetApplicationBackupConfigurationInfoResponder(resp *http.Response) (result PagedBackupConfigurationInfoList, err error) {
3178	err = autorest.Respond(
3179		resp,
3180		azure.WithErrorUnlessStatusCode(http.StatusOK),
3181		autorest.ByUnmarshallingJSON(&result),
3182		autorest.ByClosing())
3183	result.Response = autorest.Response{Response: resp}
3184	return
3185}
3186
3187// GetApplicationBackupList returns a list of backups available for every partition in this Service Fabric application.
3188// The server enumerates all the backups available at the backup location configured in the backup policy. It also
3189// allows filtering of the result based on start and end datetime or just fetching the latest available backup for
3190// every partition.
3191// Parameters:
3192// applicationID - the identity of the application. This is typically the full name of the application without
3193// the 'fabric:' URI scheme.
3194// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3195// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3196// in 6.0+ and "myapp/app1" in previous versions.
3197// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3198// duration that the client is willing to wait for the requested operation to complete. The default value for
3199// this parameter is 60 seconds.
3200// latest - specifies whether to get only the most recent backup available for a partition for the specified
3201// time range.
3202// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The
3203// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups
3204// from the beginning are enumerated.
3205// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date
3206// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is
3207// done till the most recent backup.
3208// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
3209// token with a non empty value is included in the response of the API when the results from the system do not
3210// fit in a single response. When this value is passed to the next API call, the API returns next set of
3211// results. If there are no further results then the continuation token does not contain a value. The value of
3212// this parameter should not be URL encoded.
3213// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
3214// defines the upper bound on the number of results returned. The results returned can be less than the
3215// specified maximum results if they do not fit in the message as per the max message size restrictions defined
3216// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
3217// as possible that fit in the return message.
3218func (client BaseClient) GetApplicationBackupList(ctx context.Context, applicationID string, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time, continuationToken string, maxResults *int64) (result PagedBackupInfoList, err error) {
3219	if tracing.IsEnabled() {
3220		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationBackupList")
3221		defer func() {
3222			sc := -1
3223			if result.Response.Response != nil {
3224				sc = result.Response.Response.StatusCode
3225			}
3226			tracing.EndSpan(ctx, sc, err)
3227		}()
3228	}
3229	if err := validation.Validate([]validation.Validation{
3230		{TargetValue: timeout,
3231			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3232				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3233					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3234				}}}},
3235		{TargetValue: maxResults,
3236			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
3237				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil {
3238		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationBackupList", err.Error())
3239	}
3240
3241	req, err := client.GetApplicationBackupListPreparer(ctx, applicationID, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults)
3242	if err != nil {
3243		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", nil, "Failure preparing request")
3244		return
3245	}
3246
3247	resp, err := client.GetApplicationBackupListSender(req)
3248	if err != nil {
3249		result.Response = autorest.Response{Response: resp}
3250		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", resp, "Failure sending request")
3251		return
3252	}
3253
3254	result, err = client.GetApplicationBackupListResponder(resp)
3255	if err != nil {
3256		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", resp, "Failure responding to request")
3257		return
3258	}
3259
3260	return
3261}
3262
3263// GetApplicationBackupListPreparer prepares the GetApplicationBackupList request.
3264func (client BaseClient) GetApplicationBackupListPreparer(ctx context.Context, applicationID string, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time, continuationToken string, maxResults *int64) (*http.Request, error) {
3265	pathParameters := map[string]interface{}{
3266		"applicationId": applicationID,
3267	}
3268
3269	const APIVersion = "6.2-preview"
3270	queryParameters := map[string]interface{}{
3271		"api-version": APIVersion,
3272	}
3273	if timeout != nil {
3274		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3275	} else {
3276		queryParameters["timeout"] = autorest.Encode("query", 60)
3277	}
3278	if latest != nil {
3279		queryParameters["Latest"] = autorest.Encode("query", *latest)
3280	} else {
3281		queryParameters["Latest"] = autorest.Encode("query", false)
3282	}
3283	if startDateTimeFilter != nil {
3284		queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter)
3285	}
3286	if endDateTimeFilter != nil {
3287		queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter)
3288	}
3289	if len(continuationToken) > 0 {
3290		queryParameters["ContinuationToken"] = continuationToken
3291	}
3292	if maxResults != nil {
3293		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
3294	} else {
3295		queryParameters["MaxResults"] = autorest.Encode("query", 0)
3296	}
3297
3298	preparer := autorest.CreatePreparer(
3299		autorest.AsGet(),
3300		autorest.WithBaseURL(client.BaseURI),
3301		autorest.WithPathParameters("/Applications/{applicationId}/$/GetBackups", pathParameters),
3302		autorest.WithQueryParameters(queryParameters))
3303	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3304}
3305
3306// GetApplicationBackupListSender sends the GetApplicationBackupList request. The method will close the
3307// http.Response Body if it receives an error.
3308func (client BaseClient) GetApplicationBackupListSender(req *http.Request) (*http.Response, error) {
3309	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3310}
3311
3312// GetApplicationBackupListResponder handles the response to the GetApplicationBackupList request. The method always
3313// closes the http.Response Body.
3314func (client BaseClient) GetApplicationBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) {
3315	err = autorest.Respond(
3316		resp,
3317		azure.WithErrorUnlessStatusCode(http.StatusOK),
3318		autorest.ByUnmarshallingJSON(&result),
3319		autorest.ByClosing())
3320	result.Response = autorest.Response{Response: resp}
3321	return
3322}
3323
3324// GetApplicationEventList the response is list of ApplicationEvent objects.
3325// Parameters:
3326// applicationID - the identity of the application. This is typically the full name of the application without
3327// the 'fabric:' URI scheme.
3328// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3329// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3330// in 6.0+ and "myapp/app1" in previous versions.
3331// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
3332// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
3333// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3334// duration that the client is willing to wait for the requested operation to complete. The default value for
3335// this parameter is 60 seconds.
3336// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
3337// be included in the response.
3338// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
3339// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
3340// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
3341// populated.
3342func (client BaseClient) GetApplicationEventList(ctx context.Context, applicationID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListApplicationEvent, err error) {
3343	if tracing.IsEnabled() {
3344		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationEventList")
3345		defer func() {
3346			sc := -1
3347			if result.Response.Response != nil {
3348				sc = result.Response.Response.StatusCode
3349			}
3350			tracing.EndSpan(ctx, sc, err)
3351		}()
3352	}
3353	if err := validation.Validate([]validation.Validation{
3354		{TargetValue: timeout,
3355			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3356				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3357					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3358				}}}}}); err != nil {
3359		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationEventList", err.Error())
3360	}
3361
3362	req, err := client.GetApplicationEventListPreparer(ctx, applicationID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
3363	if err != nil {
3364		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", nil, "Failure preparing request")
3365		return
3366	}
3367
3368	resp, err := client.GetApplicationEventListSender(req)
3369	if err != nil {
3370		result.Response = autorest.Response{Response: resp}
3371		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", resp, "Failure sending request")
3372		return
3373	}
3374
3375	result, err = client.GetApplicationEventListResponder(resp)
3376	if err != nil {
3377		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", resp, "Failure responding to request")
3378		return
3379	}
3380
3381	return
3382}
3383
3384// GetApplicationEventListPreparer prepares the GetApplicationEventList request.
3385func (client BaseClient) GetApplicationEventListPreparer(ctx context.Context, applicationID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
3386	pathParameters := map[string]interface{}{
3387		"applicationId": applicationID,
3388	}
3389
3390	const APIVersion = "6.2-preview"
3391	queryParameters := map[string]interface{}{
3392		"api-version":  APIVersion,
3393		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
3394		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
3395	}
3396	if timeout != nil {
3397		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3398	} else {
3399		queryParameters["timeout"] = autorest.Encode("query", 60)
3400	}
3401	if len(eventsTypesFilter) > 0 {
3402		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
3403	}
3404	if excludeAnalysisEvents != nil {
3405		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
3406	}
3407	if skipCorrelationLookup != nil {
3408		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
3409	}
3410
3411	preparer := autorest.CreatePreparer(
3412		autorest.AsGet(),
3413		autorest.WithBaseURL(client.BaseURI),
3414		autorest.WithPathParameters("/EventsStore/Applications/{applicationId}/$/Events", pathParameters),
3415		autorest.WithQueryParameters(queryParameters))
3416	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3417}
3418
3419// GetApplicationEventListSender sends the GetApplicationEventList request. The method will close the
3420// http.Response Body if it receives an error.
3421func (client BaseClient) GetApplicationEventListSender(req *http.Request) (*http.Response, error) {
3422	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3423}
3424
3425// GetApplicationEventListResponder handles the response to the GetApplicationEventList request. The method always
3426// closes the http.Response Body.
3427func (client BaseClient) GetApplicationEventListResponder(resp *http.Response) (result ListApplicationEvent, err error) {
3428	err = autorest.Respond(
3429		resp,
3430		azure.WithErrorUnlessStatusCode(http.StatusOK),
3431		autorest.ByUnmarshallingJSON(&result),
3432		autorest.ByClosing())
3433	result.Response = autorest.Response{Response: resp}
3434	return
3435}
3436
3437// GetApplicationHealth returns the heath state of the service fabric application. The response reports either Ok,
3438// Error or Warning health state. If the entity is not found in the health store, it will return Error.
3439// Parameters:
3440// applicationID - the identity of the application. This is typically the full name of the application without
3441// the 'fabric:' URI scheme.
3442// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3443// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3444// in 6.0+ and "myapp/app1" in previous versions.
3445// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
3446// state.
3447// The possible values for this parameter include integer value of one of the following health states.
3448// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
3449// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
3450// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
3451// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
3452//
3453// - Default - Default value. Matches any HealthState. The value is zero.
3454// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3455// collection of states. The value is 1.
3456// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3457// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3458// - Error - Filter that matches input with HealthState value Error. The value is 8.
3459// - All - Filter that matches input with any HealthState value. The value is 65535.
3460// deployedApplicationsHealthStateFilter - allows filtering of the deployed applications health state objects
3461// returned in the result of application health query based on their health state.
3462// The possible values for this parameter include integer value of one of the following health states. Only
3463// deployed applications that match the filter will be returned.
3464// All deployed applications are used to evaluate the aggregated health state. If not specified, all entries
3465// are returned.
3466// The state values are flag based enumeration, so the value could be a combination of these value obtained
3467// using bitwise 'OR' operator.
3468// For example, if the provided value is 6 then health state of deployed applications with HealthState value of
3469// OK (2) and Warning (4) are returned.
3470//
3471// - Default - Default value. Matches any HealthState. The value is zero.
3472// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3473// collection of states. The value is 1.
3474// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3475// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3476// - Error - Filter that matches input with HealthState value Error. The value is 8.
3477// - All - Filter that matches input with any HealthState value. The value is 65535.
3478// servicesHealthStateFilter - allows filtering of the services health state objects returned in the result of
3479// services health query based on their health state.
3480// The possible values for this parameter include integer value of one of the following health states.
3481// Only services that match the filter are returned. All services are used to evaluate the aggregated health
3482// state.
3483// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
3484// be a combination of these value
3485// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of services
3486// with HealthState value of OK (2) and Warning (4) will be returned.
3487//
3488// - Default - Default value. Matches any HealthState. The value is zero.
3489// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3490// collection of states. The value is 1.
3491// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3492// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3493// - Error - Filter that matches input with HealthState value Error. The value is 8.
3494// - All - Filter that matches input with any HealthState value. The value is 65535.
3495// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
3496// result. False by default.
3497// The statistics show the number of children entities in health state Ok, Warning, and Error.
3498// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3499// duration that the client is willing to wait for the requested operation to complete. The default value for
3500// this parameter is 60 seconds.
3501func (client BaseClient) GetApplicationHealth(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result ApplicationHealth, err error) {
3502	if tracing.IsEnabled() {
3503		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationHealth")
3504		defer func() {
3505			sc := -1
3506			if result.Response.Response != nil {
3507				sc = result.Response.Response.StatusCode
3508			}
3509			tracing.EndSpan(ctx, sc, err)
3510		}()
3511	}
3512	if err := validation.Validate([]validation.Validation{
3513		{TargetValue: timeout,
3514			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3515				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3516					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3517				}}}}}); err != nil {
3518		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealth", err.Error())
3519	}
3520
3521	req, err := client.GetApplicationHealthPreparer(ctx, applicationID, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, timeout)
3522	if err != nil {
3523		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", nil, "Failure preparing request")
3524		return
3525	}
3526
3527	resp, err := client.GetApplicationHealthSender(req)
3528	if err != nil {
3529		result.Response = autorest.Response{Response: resp}
3530		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", resp, "Failure sending request")
3531		return
3532	}
3533
3534	result, err = client.GetApplicationHealthResponder(resp)
3535	if err != nil {
3536		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", resp, "Failure responding to request")
3537		return
3538	}
3539
3540	return
3541}
3542
3543// GetApplicationHealthPreparer prepares the GetApplicationHealth request.
3544func (client BaseClient) GetApplicationHealthPreparer(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
3545	pathParameters := map[string]interface{}{
3546		"applicationId": applicationID,
3547	}
3548
3549	const APIVersion = "6.0"
3550	queryParameters := map[string]interface{}{
3551		"api-version": APIVersion,
3552	}
3553	if eventsHealthStateFilter != nil {
3554		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
3555	} else {
3556		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
3557	}
3558	if deployedApplicationsHealthStateFilter != nil {
3559		queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", *deployedApplicationsHealthStateFilter)
3560	} else {
3561		queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", 0)
3562	}
3563	if servicesHealthStateFilter != nil {
3564		queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", *servicesHealthStateFilter)
3565	} else {
3566		queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", 0)
3567	}
3568	if excludeHealthStatistics != nil {
3569		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
3570	} else {
3571		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
3572	}
3573	if timeout != nil {
3574		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3575	} else {
3576		queryParameters["timeout"] = autorest.Encode("query", 60)
3577	}
3578
3579	preparer := autorest.CreatePreparer(
3580		autorest.AsGet(),
3581		autorest.WithBaseURL(client.BaseURI),
3582		autorest.WithPathParameters("/Applications/{applicationId}/$/GetHealth", pathParameters),
3583		autorest.WithQueryParameters(queryParameters))
3584	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3585}
3586
3587// GetApplicationHealthSender sends the GetApplicationHealth request. The method will close the
3588// http.Response Body if it receives an error.
3589func (client BaseClient) GetApplicationHealthSender(req *http.Request) (*http.Response, error) {
3590	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3591}
3592
3593// GetApplicationHealthResponder handles the response to the GetApplicationHealth request. The method always
3594// closes the http.Response Body.
3595func (client BaseClient) GetApplicationHealthResponder(resp *http.Response) (result ApplicationHealth, err error) {
3596	err = autorest.Respond(
3597		resp,
3598		azure.WithErrorUnlessStatusCode(http.StatusOK),
3599		autorest.ByUnmarshallingJSON(&result),
3600		autorest.ByClosing())
3601	result.Response = autorest.Response{Response: resp}
3602	return
3603}
3604
3605// GetApplicationHealthUsingPolicy gets the health of a Service Fabric application. Use EventsHealthStateFilter to
3606// filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicies to
3607// override the health policies used to evaluate the health.
3608// Parameters:
3609// applicationID - the identity of the application. This is typically the full name of the application without
3610// the 'fabric:' URI scheme.
3611// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3612// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3613// in 6.0+ and "myapp/app1" in previous versions.
3614// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
3615// state.
3616// The possible values for this parameter include integer value of one of the following health states.
3617// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
3618// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
3619// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
3620// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
3621//
3622// - Default - Default value. Matches any HealthState. The value is zero.
3623// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3624// collection of states. The value is 1.
3625// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3626// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3627// - Error - Filter that matches input with HealthState value Error. The value is 8.
3628// - All - Filter that matches input with any HealthState value. The value is 65535.
3629// deployedApplicationsHealthStateFilter - allows filtering of the deployed applications health state objects
3630// returned in the result of application health query based on their health state.
3631// The possible values for this parameter include integer value of one of the following health states. Only
3632// deployed applications that match the filter will be returned.
3633// All deployed applications are used to evaluate the aggregated health state. If not specified, all entries
3634// are returned.
3635// The state values are flag based enumeration, so the value could be a combination of these value obtained
3636// using bitwise 'OR' operator.
3637// For example, if the provided value is 6 then health state of deployed applications with HealthState value of
3638// OK (2) and Warning (4) are returned.
3639//
3640// - Default - Default value. Matches any HealthState. The value is zero.
3641// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3642// collection of states. The value is 1.
3643// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3644// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3645// - Error - Filter that matches input with HealthState value Error. The value is 8.
3646// - All - Filter that matches input with any HealthState value. The value is 65535.
3647// servicesHealthStateFilter - allows filtering of the services health state objects returned in the result of
3648// services health query based on their health state.
3649// The possible values for this parameter include integer value of one of the following health states.
3650// Only services that match the filter are returned. All services are used to evaluate the aggregated health
3651// state.
3652// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
3653// be a combination of these value
3654// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of services
3655// with HealthState value of OK (2) and Warning (4) will be returned.
3656//
3657// - Default - Default value. Matches any HealthState. The value is zero.
3658// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3659// collection of states. The value is 1.
3660// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3661// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3662// - Error - Filter that matches input with HealthState value Error. The value is 8.
3663// - All - Filter that matches input with any HealthState value. The value is 65535.
3664// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
3665// result. False by default.
3666// The statistics show the number of children entities in health state Ok, Warning, and Error.
3667// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
3668// of its children.
3669// If not present, the health evaluation uses the health policy from application manifest or the default health
3670// policy.
3671// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3672// duration that the client is willing to wait for the requested operation to complete. The default value for
3673// this parameter is 60 seconds.
3674func (client BaseClient) GetApplicationHealthUsingPolicy(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result ApplicationHealth, err error) {
3675	if tracing.IsEnabled() {
3676		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationHealthUsingPolicy")
3677		defer func() {
3678			sc := -1
3679			if result.Response.Response != nil {
3680				sc = result.Response.Response.StatusCode
3681			}
3682			tracing.EndSpan(ctx, sc, err)
3683		}()
3684	}
3685	if err := validation.Validate([]validation.Validation{
3686		{TargetValue: timeout,
3687			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3688				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3689					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3690				}}}}}); err != nil {
3691		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", err.Error())
3692	}
3693
3694	req, err := client.GetApplicationHealthUsingPolicyPreparer(ctx, applicationID, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, applicationHealthPolicy, timeout)
3695	if err != nil {
3696		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", nil, "Failure preparing request")
3697		return
3698	}
3699
3700	resp, err := client.GetApplicationHealthUsingPolicySender(req)
3701	if err != nil {
3702		result.Response = autorest.Response{Response: resp}
3703		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", resp, "Failure sending request")
3704		return
3705	}
3706
3707	result, err = client.GetApplicationHealthUsingPolicyResponder(resp)
3708	if err != nil {
3709		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", resp, "Failure responding to request")
3710		return
3711	}
3712
3713	return
3714}
3715
3716// GetApplicationHealthUsingPolicyPreparer prepares the GetApplicationHealthUsingPolicy request.
3717func (client BaseClient) GetApplicationHealthUsingPolicyPreparer(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) {
3718	pathParameters := map[string]interface{}{
3719		"applicationId": applicationID,
3720	}
3721
3722	const APIVersion = "6.0"
3723	queryParameters := map[string]interface{}{
3724		"api-version": APIVersion,
3725	}
3726	if eventsHealthStateFilter != nil {
3727		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
3728	} else {
3729		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
3730	}
3731	if deployedApplicationsHealthStateFilter != nil {
3732		queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", *deployedApplicationsHealthStateFilter)
3733	} else {
3734		queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", 0)
3735	}
3736	if servicesHealthStateFilter != nil {
3737		queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", *servicesHealthStateFilter)
3738	} else {
3739		queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", 0)
3740	}
3741	if excludeHealthStatistics != nil {
3742		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
3743	} else {
3744		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
3745	}
3746	if timeout != nil {
3747		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3748	} else {
3749		queryParameters["timeout"] = autorest.Encode("query", 60)
3750	}
3751
3752	preparer := autorest.CreatePreparer(
3753		autorest.AsContentType("application/json; charset=utf-8"),
3754		autorest.AsPost(),
3755		autorest.WithBaseURL(client.BaseURI),
3756		autorest.WithPathParameters("/Applications/{applicationId}/$/GetHealth", pathParameters),
3757		autorest.WithQueryParameters(queryParameters))
3758	if applicationHealthPolicy != nil {
3759		preparer = autorest.DecoratePreparer(preparer,
3760			autorest.WithJSON(applicationHealthPolicy))
3761	}
3762	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3763}
3764
3765// GetApplicationHealthUsingPolicySender sends the GetApplicationHealthUsingPolicy request. The method will close the
3766// http.Response Body if it receives an error.
3767func (client BaseClient) GetApplicationHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
3768	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3769}
3770
3771// GetApplicationHealthUsingPolicyResponder handles the response to the GetApplicationHealthUsingPolicy request. The method always
3772// closes the http.Response Body.
3773func (client BaseClient) GetApplicationHealthUsingPolicyResponder(resp *http.Response) (result ApplicationHealth, err error) {
3774	err = autorest.Respond(
3775		resp,
3776		azure.WithErrorUnlessStatusCode(http.StatusOK),
3777		autorest.ByUnmarshallingJSON(&result),
3778		autorest.ByClosing())
3779	result.Response = autorest.Response{Response: resp}
3780	return
3781}
3782
3783// GetApplicationInfo returns the information about the application that was created or in the process of being created
3784// in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the
3785// name, type, status, parameters and other details about the application.
3786// Parameters:
3787// applicationID - the identity of the application. This is typically the full name of the application without
3788// the 'fabric:' URI scheme.
3789// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3790// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3791// in 6.0+ and "myapp/app1" in previous versions.
3792// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from
3793// the result.
3794// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3795// duration that the client is willing to wait for the requested operation to complete. The default value for
3796// this parameter is 60 seconds.
3797func (client BaseClient) GetApplicationInfo(ctx context.Context, applicationID string, excludeApplicationParameters *bool, timeout *int64) (result ApplicationInfo, err error) {
3798	if tracing.IsEnabled() {
3799		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationInfo")
3800		defer func() {
3801			sc := -1
3802			if result.Response.Response != nil {
3803				sc = result.Response.Response.StatusCode
3804			}
3805			tracing.EndSpan(ctx, sc, err)
3806		}()
3807	}
3808	if err := validation.Validate([]validation.Validation{
3809		{TargetValue: timeout,
3810			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3811				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3812					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3813				}}}}}); err != nil {
3814		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfo", err.Error())
3815	}
3816
3817	req, err := client.GetApplicationInfoPreparer(ctx, applicationID, excludeApplicationParameters, timeout)
3818	if err != nil {
3819		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", nil, "Failure preparing request")
3820		return
3821	}
3822
3823	resp, err := client.GetApplicationInfoSender(req)
3824	if err != nil {
3825		result.Response = autorest.Response{Response: resp}
3826		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", resp, "Failure sending request")
3827		return
3828	}
3829
3830	result, err = client.GetApplicationInfoResponder(resp)
3831	if err != nil {
3832		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", resp, "Failure responding to request")
3833		return
3834	}
3835
3836	return
3837}
3838
3839// GetApplicationInfoPreparer prepares the GetApplicationInfo request.
3840func (client BaseClient) GetApplicationInfoPreparer(ctx context.Context, applicationID string, excludeApplicationParameters *bool, timeout *int64) (*http.Request, error) {
3841	pathParameters := map[string]interface{}{
3842		"applicationId": applicationID,
3843	}
3844
3845	const APIVersion = "6.0"
3846	queryParameters := map[string]interface{}{
3847		"api-version": APIVersion,
3848	}
3849	if excludeApplicationParameters != nil {
3850		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters)
3851	} else {
3852		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false)
3853	}
3854	if timeout != nil {
3855		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3856	} else {
3857		queryParameters["timeout"] = autorest.Encode("query", 60)
3858	}
3859
3860	preparer := autorest.CreatePreparer(
3861		autorest.AsGet(),
3862		autorest.WithBaseURL(client.BaseURI),
3863		autorest.WithPathParameters("/Applications/{applicationId}", pathParameters),
3864		autorest.WithQueryParameters(queryParameters))
3865	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3866}
3867
3868// GetApplicationInfoSender sends the GetApplicationInfo request. The method will close the
3869// http.Response Body if it receives an error.
3870func (client BaseClient) GetApplicationInfoSender(req *http.Request) (*http.Response, error) {
3871	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3872}
3873
3874// GetApplicationInfoResponder handles the response to the GetApplicationInfo request. The method always
3875// closes the http.Response Body.
3876func (client BaseClient) GetApplicationInfoResponder(resp *http.Response) (result ApplicationInfo, err error) {
3877	err = autorest.Respond(
3878		resp,
3879		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
3880		autorest.ByUnmarshallingJSON(&result),
3881		autorest.ByClosing())
3882	result.Response = autorest.Response{Response: resp}
3883	return
3884}
3885
3886// GetApplicationInfoList gets the information about the applications that were created or in the process of being
3887// created in the Service Fabric cluster and match the specified filters. The response includes the name, type, status,
3888// parameters, and other details about the application. If the applications do not fit in a page, one page of results
3889// is returned as well as a continuation token which can be used to get the next page. Filters ApplicationTypeName and
3890// ApplicationDefinitionKindFilter cannot be specified at the same time.
3891// Parameters:
3892// applicationDefinitionKindFilter - used to filter on ApplicationDefinitionKind which is the mechanism used to
3893// define a Service Fabric application.
3894// - Default - Default value, which performs the same function as selecting "All". The value is 0.
3895// - All - Filter that matches input with any ApplicationDefinitionKind value. The value is 65535.
3896// - ServiceFabricApplicationDescription - Filter that matches input with ApplicationDefinitionKind value
3897// ServiceFabricApplicationDescription. The value is 1.
3898// - Compose - Filter that matches input with ApplicationDefinitionKind value Compose. The value is 2.
3899// applicationTypeName - the application type name used to filter the applications to query for. This value
3900// should not contain the application type version.
3901// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from
3902// the result.
3903// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
3904// token with a non empty value is included in the response of the API when the results from the system do not
3905// fit in a single response. When this value is passed to the next API call, the API returns next set of
3906// results. If there are no further results then the continuation token does not contain a value. The value of
3907// this parameter should not be URL encoded.
3908// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
3909// defines the upper bound on the number of results returned. The results returned can be less than the
3910// specified maximum results if they do not fit in the message as per the max message size restrictions defined
3911// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
3912// as possible that fit in the return message.
3913// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3914// duration that the client is willing to wait for the requested operation to complete. The default value for
3915// this parameter is 60 seconds.
3916func (client BaseClient) GetApplicationInfoList(ctx context.Context, applicationDefinitionKindFilter *int32, applicationTypeName string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationInfoList, err error) {
3917	if tracing.IsEnabled() {
3918		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationInfoList")
3919		defer func() {
3920			sc := -1
3921			if result.Response.Response != nil {
3922				sc = result.Response.Response.StatusCode
3923			}
3924			tracing.EndSpan(ctx, sc, err)
3925		}()
3926	}
3927	if err := validation.Validate([]validation.Validation{
3928		{TargetValue: maxResults,
3929			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
3930				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
3931		{TargetValue: timeout,
3932			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3933				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3934					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3935				}}}}}); err != nil {
3936		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfoList", err.Error())
3937	}
3938
3939	req, err := client.GetApplicationInfoListPreparer(ctx, applicationDefinitionKindFilter, applicationTypeName, excludeApplicationParameters, continuationToken, maxResults, timeout)
3940	if err != nil {
3941		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", nil, "Failure preparing request")
3942		return
3943	}
3944
3945	resp, err := client.GetApplicationInfoListSender(req)
3946	if err != nil {
3947		result.Response = autorest.Response{Response: resp}
3948		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", resp, "Failure sending request")
3949		return
3950	}
3951
3952	result, err = client.GetApplicationInfoListResponder(resp)
3953	if err != nil {
3954		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", resp, "Failure responding to request")
3955		return
3956	}
3957
3958	return
3959}
3960
3961// GetApplicationInfoListPreparer prepares the GetApplicationInfoList request.
3962func (client BaseClient) GetApplicationInfoListPreparer(ctx context.Context, applicationDefinitionKindFilter *int32, applicationTypeName string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
3963	const APIVersion = "6.1"
3964	queryParameters := map[string]interface{}{
3965		"api-version": APIVersion,
3966	}
3967	if applicationDefinitionKindFilter != nil {
3968		queryParameters["ApplicationDefinitionKindFilter"] = autorest.Encode("query", *applicationDefinitionKindFilter)
3969	} else {
3970		queryParameters["ApplicationDefinitionKindFilter"] = autorest.Encode("query", 0)
3971	}
3972	if len(applicationTypeName) > 0 {
3973		queryParameters["ApplicationTypeName"] = autorest.Encode("query", applicationTypeName)
3974	}
3975	if excludeApplicationParameters != nil {
3976		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters)
3977	} else {
3978		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false)
3979	}
3980	if len(continuationToken) > 0 {
3981		queryParameters["ContinuationToken"] = continuationToken
3982	}
3983	if maxResults != nil {
3984		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
3985	} else {
3986		queryParameters["MaxResults"] = autorest.Encode("query", 0)
3987	}
3988	if timeout != nil {
3989		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3990	} else {
3991		queryParameters["timeout"] = autorest.Encode("query", 60)
3992	}
3993
3994	preparer := autorest.CreatePreparer(
3995		autorest.AsGet(),
3996		autorest.WithBaseURL(client.BaseURI),
3997		autorest.WithPath("/Applications"),
3998		autorest.WithQueryParameters(queryParameters))
3999	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4000}
4001
4002// GetApplicationInfoListSender sends the GetApplicationInfoList request. The method will close the
4003// http.Response Body if it receives an error.
4004func (client BaseClient) GetApplicationInfoListSender(req *http.Request) (*http.Response, error) {
4005	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4006}
4007
4008// GetApplicationInfoListResponder handles the response to the GetApplicationInfoList request. The method always
4009// closes the http.Response Body.
4010func (client BaseClient) GetApplicationInfoListResponder(resp *http.Response) (result PagedApplicationInfoList, err error) {
4011	err = autorest.Respond(
4012		resp,
4013		azure.WithErrorUnlessStatusCode(http.StatusOK),
4014		autorest.ByUnmarshallingJSON(&result),
4015		autorest.ByClosing())
4016	result.Response = autorest.Response{Response: resp}
4017	return
4018}
4019
4020// GetApplicationLoadInfo returns the load information about the application that was created or in the process of
4021// being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response
4022// includes the name, minimum nodes, maximum nodes, the number of nodes the application is occupying currently, and
4023// application load metric information about the application.
4024// Parameters:
4025// applicationID - the identity of the application. This is typically the full name of the application without
4026// the 'fabric:' URI scheme.
4027// Starting from version 6.0, hierarchical names are delimited with the "~" character.
4028// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
4029// in 6.0+ and "myapp/app1" in previous versions.
4030// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4031// duration that the client is willing to wait for the requested operation to complete. The default value for
4032// this parameter is 60 seconds.
4033func (client BaseClient) GetApplicationLoadInfo(ctx context.Context, applicationID string, timeout *int64) (result ApplicationLoadInfo, err error) {
4034	if tracing.IsEnabled() {
4035		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationLoadInfo")
4036		defer func() {
4037			sc := -1
4038			if result.Response.Response != nil {
4039				sc = result.Response.Response.StatusCode
4040			}
4041			tracing.EndSpan(ctx, sc, err)
4042		}()
4043	}
4044	if err := validation.Validate([]validation.Validation{
4045		{TargetValue: timeout,
4046			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4047				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4048					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4049				}}}}}); err != nil {
4050		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationLoadInfo", err.Error())
4051	}
4052
4053	req, err := client.GetApplicationLoadInfoPreparer(ctx, applicationID, timeout)
4054	if err != nil {
4055		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", nil, "Failure preparing request")
4056		return
4057	}
4058
4059	resp, err := client.GetApplicationLoadInfoSender(req)
4060	if err != nil {
4061		result.Response = autorest.Response{Response: resp}
4062		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", resp, "Failure sending request")
4063		return
4064	}
4065
4066	result, err = client.GetApplicationLoadInfoResponder(resp)
4067	if err != nil {
4068		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", resp, "Failure responding to request")
4069		return
4070	}
4071
4072	return
4073}
4074
4075// GetApplicationLoadInfoPreparer prepares the GetApplicationLoadInfo request.
4076func (client BaseClient) GetApplicationLoadInfoPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
4077	pathParameters := map[string]interface{}{
4078		"applicationId": applicationID,
4079	}
4080
4081	const APIVersion = "6.0"
4082	queryParameters := map[string]interface{}{
4083		"api-version": APIVersion,
4084	}
4085	if timeout != nil {
4086		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4087	} else {
4088		queryParameters["timeout"] = autorest.Encode("query", 60)
4089	}
4090
4091	preparer := autorest.CreatePreparer(
4092		autorest.AsGet(),
4093		autorest.WithBaseURL(client.BaseURI),
4094		autorest.WithPathParameters("/Applications/{applicationId}/$/GetLoadInformation", pathParameters),
4095		autorest.WithQueryParameters(queryParameters))
4096	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4097}
4098
4099// GetApplicationLoadInfoSender sends the GetApplicationLoadInfo request. The method will close the
4100// http.Response Body if it receives an error.
4101func (client BaseClient) GetApplicationLoadInfoSender(req *http.Request) (*http.Response, error) {
4102	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4103}
4104
4105// GetApplicationLoadInfoResponder handles the response to the GetApplicationLoadInfo request. The method always
4106// closes the http.Response Body.
4107func (client BaseClient) GetApplicationLoadInfoResponder(resp *http.Response) (result ApplicationLoadInfo, err error) {
4108	err = autorest.Respond(
4109		resp,
4110		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
4111		autorest.ByUnmarshallingJSON(&result),
4112		autorest.ByClosing())
4113	result.Response = autorest.Response{Response: resp}
4114	return
4115}
4116
4117// GetApplicationManifest gets the manifest describing an application type. The response contains the application
4118// manifest XML as a string.
4119// Parameters:
4120// applicationTypeName - the name of the application type.
4121// applicationTypeVersion - the version of the application type.
4122// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4123// duration that the client is willing to wait for the requested operation to complete. The default value for
4124// this parameter is 60 seconds.
4125func (client BaseClient) GetApplicationManifest(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (result ApplicationTypeManifest, err error) {
4126	if tracing.IsEnabled() {
4127		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationManifest")
4128		defer func() {
4129			sc := -1
4130			if result.Response.Response != nil {
4131				sc = result.Response.Response.StatusCode
4132			}
4133			tracing.EndSpan(ctx, sc, err)
4134		}()
4135	}
4136	if err := validation.Validate([]validation.Validation{
4137		{TargetValue: timeout,
4138			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4139				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4140					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4141				}}}}}); err != nil {
4142		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationManifest", err.Error())
4143	}
4144
4145	req, err := client.GetApplicationManifestPreparer(ctx, applicationTypeName, applicationTypeVersion, timeout)
4146	if err != nil {
4147		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", nil, "Failure preparing request")
4148		return
4149	}
4150
4151	resp, err := client.GetApplicationManifestSender(req)
4152	if err != nil {
4153		result.Response = autorest.Response{Response: resp}
4154		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", resp, "Failure sending request")
4155		return
4156	}
4157
4158	result, err = client.GetApplicationManifestResponder(resp)
4159	if err != nil {
4160		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", resp, "Failure responding to request")
4161		return
4162	}
4163
4164	return
4165}
4166
4167// GetApplicationManifestPreparer prepares the GetApplicationManifest request.
4168func (client BaseClient) GetApplicationManifestPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (*http.Request, error) {
4169	pathParameters := map[string]interface{}{
4170		"applicationTypeName": autorest.Encode("path", applicationTypeName),
4171	}
4172
4173	const APIVersion = "6.0"
4174	queryParameters := map[string]interface{}{
4175		"api-version":            APIVersion,
4176		"ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion),
4177	}
4178	if timeout != nil {
4179		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4180	} else {
4181		queryParameters["timeout"] = autorest.Encode("query", 60)
4182	}
4183
4184	preparer := autorest.CreatePreparer(
4185		autorest.AsGet(),
4186		autorest.WithBaseURL(client.BaseURI),
4187		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetApplicationManifest", pathParameters),
4188		autorest.WithQueryParameters(queryParameters))
4189	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4190}
4191
4192// GetApplicationManifestSender sends the GetApplicationManifest request. The method will close the
4193// http.Response Body if it receives an error.
4194func (client BaseClient) GetApplicationManifestSender(req *http.Request) (*http.Response, error) {
4195	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4196}
4197
4198// GetApplicationManifestResponder handles the response to the GetApplicationManifest request. The method always
4199// closes the http.Response Body.
4200func (client BaseClient) GetApplicationManifestResponder(resp *http.Response) (result ApplicationTypeManifest, err error) {
4201	err = autorest.Respond(
4202		resp,
4203		azure.WithErrorUnlessStatusCode(http.StatusOK),
4204		autorest.ByUnmarshallingJSON(&result),
4205		autorest.ByClosing())
4206	result.Response = autorest.Response{Response: resp}
4207	return
4208}
4209
4210// GetApplicationNameInfo gets the name of the application for the specified service. A 404
4211// FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the provided service ID does not exist.
4212// Parameters:
4213// serviceID - the identity of the service. This is typically the full name of the service without the
4214// 'fabric:' URI scheme.
4215// Starting from version 6.0, hierarchical names are delimited with the "~" character.
4216// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
4217// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
4218// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4219// duration that the client is willing to wait for the requested operation to complete. The default value for
4220// this parameter is 60 seconds.
4221func (client BaseClient) GetApplicationNameInfo(ctx context.Context, serviceID string, timeout *int64) (result ApplicationNameInfo, err error) {
4222	if tracing.IsEnabled() {
4223		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationNameInfo")
4224		defer func() {
4225			sc := -1
4226			if result.Response.Response != nil {
4227				sc = result.Response.Response.StatusCode
4228			}
4229			tracing.EndSpan(ctx, sc, err)
4230		}()
4231	}
4232	if err := validation.Validate([]validation.Validation{
4233		{TargetValue: timeout,
4234			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4235				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4236					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4237				}}}}}); err != nil {
4238		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationNameInfo", err.Error())
4239	}
4240
4241	req, err := client.GetApplicationNameInfoPreparer(ctx, serviceID, timeout)
4242	if err != nil {
4243		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", nil, "Failure preparing request")
4244		return
4245	}
4246
4247	resp, err := client.GetApplicationNameInfoSender(req)
4248	if err != nil {
4249		result.Response = autorest.Response{Response: resp}
4250		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", resp, "Failure sending request")
4251		return
4252	}
4253
4254	result, err = client.GetApplicationNameInfoResponder(resp)
4255	if err != nil {
4256		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", resp, "Failure responding to request")
4257		return
4258	}
4259
4260	return
4261}
4262
4263// GetApplicationNameInfoPreparer prepares the GetApplicationNameInfo request.
4264func (client BaseClient) GetApplicationNameInfoPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
4265	pathParameters := map[string]interface{}{
4266		"serviceId": serviceID,
4267	}
4268
4269	const APIVersion = "6.0"
4270	queryParameters := map[string]interface{}{
4271		"api-version": APIVersion,
4272	}
4273	if timeout != nil {
4274		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4275	} else {
4276		queryParameters["timeout"] = autorest.Encode("query", 60)
4277	}
4278
4279	preparer := autorest.CreatePreparer(
4280		autorest.AsGet(),
4281		autorest.WithBaseURL(client.BaseURI),
4282		autorest.WithPathParameters("/Services/{serviceId}/$/GetApplicationName", pathParameters),
4283		autorest.WithQueryParameters(queryParameters))
4284	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4285}
4286
4287// GetApplicationNameInfoSender sends the GetApplicationNameInfo request. The method will close the
4288// http.Response Body if it receives an error.
4289func (client BaseClient) GetApplicationNameInfoSender(req *http.Request) (*http.Response, error) {
4290	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4291}
4292
4293// GetApplicationNameInfoResponder handles the response to the GetApplicationNameInfo request. The method always
4294// closes the http.Response Body.
4295func (client BaseClient) GetApplicationNameInfoResponder(resp *http.Response) (result ApplicationNameInfo, err error) {
4296	err = autorest.Respond(
4297		resp,
4298		azure.WithErrorUnlessStatusCode(http.StatusOK),
4299		autorest.ByUnmarshallingJSON(&result),
4300		autorest.ByClosing())
4301	result.Response = autorest.Response{Response: resp}
4302	return
4303}
4304
4305// GetApplicationsEventList the response is list of ApplicationEvent objects.
4306// Parameters:
4307// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
4308// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
4309// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4310// duration that the client is willing to wait for the requested operation to complete. The default value for
4311// this parameter is 60 seconds.
4312// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
4313// be included in the response.
4314// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
4315// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
4316// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
4317// populated.
4318func (client BaseClient) GetApplicationsEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListApplicationEvent, err error) {
4319	if tracing.IsEnabled() {
4320		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationsEventList")
4321		defer func() {
4322			sc := -1
4323			if result.Response.Response != nil {
4324				sc = result.Response.Response.StatusCode
4325			}
4326			tracing.EndSpan(ctx, sc, err)
4327		}()
4328	}
4329	if err := validation.Validate([]validation.Validation{
4330		{TargetValue: timeout,
4331			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4332				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4333					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4334				}}}}}); err != nil {
4335		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationsEventList", err.Error())
4336	}
4337
4338	req, err := client.GetApplicationsEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
4339	if err != nil {
4340		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", nil, "Failure preparing request")
4341		return
4342	}
4343
4344	resp, err := client.GetApplicationsEventListSender(req)
4345	if err != nil {
4346		result.Response = autorest.Response{Response: resp}
4347		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", resp, "Failure sending request")
4348		return
4349	}
4350
4351	result, err = client.GetApplicationsEventListResponder(resp)
4352	if err != nil {
4353		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", resp, "Failure responding to request")
4354		return
4355	}
4356
4357	return
4358}
4359
4360// GetApplicationsEventListPreparer prepares the GetApplicationsEventList request.
4361func (client BaseClient) GetApplicationsEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
4362	const APIVersion = "6.2-preview"
4363	queryParameters := map[string]interface{}{
4364		"api-version":  APIVersion,
4365		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
4366		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
4367	}
4368	if timeout != nil {
4369		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4370	} else {
4371		queryParameters["timeout"] = autorest.Encode("query", 60)
4372	}
4373	if len(eventsTypesFilter) > 0 {
4374		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
4375	}
4376	if excludeAnalysisEvents != nil {
4377		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
4378	}
4379	if skipCorrelationLookup != nil {
4380		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
4381	}
4382
4383	preparer := autorest.CreatePreparer(
4384		autorest.AsGet(),
4385		autorest.WithBaseURL(client.BaseURI),
4386		autorest.WithPath("/EventsStore/Applications/Events"),
4387		autorest.WithQueryParameters(queryParameters))
4388	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4389}
4390
4391// GetApplicationsEventListSender sends the GetApplicationsEventList request. The method will close the
4392// http.Response Body if it receives an error.
4393func (client BaseClient) GetApplicationsEventListSender(req *http.Request) (*http.Response, error) {
4394	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4395}
4396
4397// GetApplicationsEventListResponder handles the response to the GetApplicationsEventList request. The method always
4398// closes the http.Response Body.
4399func (client BaseClient) GetApplicationsEventListResponder(resp *http.Response) (result ListApplicationEvent, err error) {
4400	err = autorest.Respond(
4401		resp,
4402		azure.WithErrorUnlessStatusCode(http.StatusOK),
4403		autorest.ByUnmarshallingJSON(&result),
4404		autorest.ByClosing())
4405	result.Response = autorest.Response{Response: resp}
4406	return
4407}
4408
4409// GetApplicationTypeInfoList returns the information about the application types that are provisioned or in the
4410// process of being provisioned in the Service Fabric cluster. Each version of an application type is returned as one
4411// application type. The response includes the name, version, status and other details about the application type. This
4412// is a paged query, meaning that if not all of the application types fit in a page, one page of results is returned as
4413// well as a continuation token which can be used to get the next page. For example, if there are 10 application types
4414// 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
4415// rest of the results, retrieve subsequent pages by using the returned continuation token in the next query. An empty
4416// continuation token is returned if there are no subsequent pages.
4417// Parameters:
4418// applicationTypeDefinitionKindFilter - used to filter on ApplicationTypeDefinitionKind which is the mechanism
4419// used to define a Service Fabric application type.
4420// - Default - Default value, which performs the same function as selecting "All". The value is 0.
4421// - All - Filter that matches input with any ApplicationTypeDefinitionKind value. The value is 65535.
4422// - ServiceFabricApplicationPackage - Filter that matches input with ApplicationTypeDefinitionKind value
4423// ServiceFabricApplicationPackage. The value is 1.
4424// - Compose - Filter that matches input with ApplicationTypeDefinitionKind value Compose. The value is 2.
4425// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from
4426// the result.
4427// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
4428// token with a non empty value is included in the response of the API when the results from the system do not
4429// fit in a single response. When this value is passed to the next API call, the API returns next set of
4430// results. If there are no further results then the continuation token does not contain a value. The value of
4431// this parameter should not be URL encoded.
4432// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
4433// defines the upper bound on the number of results returned. The results returned can be less than the
4434// specified maximum results if they do not fit in the message as per the max message size restrictions defined
4435// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
4436// as possible that fit in the return message.
4437// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4438// duration that the client is willing to wait for the requested operation to complete. The default value for
4439// this parameter is 60 seconds.
4440func (client BaseClient) GetApplicationTypeInfoList(ctx context.Context, applicationTypeDefinitionKindFilter *int32, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationTypeInfoList, err error) {
4441	if tracing.IsEnabled() {
4442		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationTypeInfoList")
4443		defer func() {
4444			sc := -1
4445			if result.Response.Response != nil {
4446				sc = result.Response.Response.StatusCode
4447			}
4448			tracing.EndSpan(ctx, sc, err)
4449		}()
4450	}
4451	if err := validation.Validate([]validation.Validation{
4452		{TargetValue: maxResults,
4453			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
4454				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
4455		{TargetValue: timeout,
4456			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4457				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4458					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4459				}}}}}); err != nil {
4460		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoList", err.Error())
4461	}
4462
4463	req, err := client.GetApplicationTypeInfoListPreparer(ctx, applicationTypeDefinitionKindFilter, excludeApplicationParameters, continuationToken, maxResults, timeout)
4464	if err != nil {
4465		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", nil, "Failure preparing request")
4466		return
4467	}
4468
4469	resp, err := client.GetApplicationTypeInfoListSender(req)
4470	if err != nil {
4471		result.Response = autorest.Response{Response: resp}
4472		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", resp, "Failure sending request")
4473		return
4474	}
4475
4476	result, err = client.GetApplicationTypeInfoListResponder(resp)
4477	if err != nil {
4478		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", resp, "Failure responding to request")
4479		return
4480	}
4481
4482	return
4483}
4484
4485// GetApplicationTypeInfoListPreparer prepares the GetApplicationTypeInfoList request.
4486func (client BaseClient) GetApplicationTypeInfoListPreparer(ctx context.Context, applicationTypeDefinitionKindFilter *int32, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
4487	const APIVersion = "6.0"
4488	queryParameters := map[string]interface{}{
4489		"api-version": APIVersion,
4490	}
4491	if applicationTypeDefinitionKindFilter != nil {
4492		queryParameters["ApplicationTypeDefinitionKindFilter"] = autorest.Encode("query", *applicationTypeDefinitionKindFilter)
4493	} else {
4494		queryParameters["ApplicationTypeDefinitionKindFilter"] = autorest.Encode("query", 0)
4495	}
4496	if excludeApplicationParameters != nil {
4497		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters)
4498	} else {
4499		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false)
4500	}
4501	if len(continuationToken) > 0 {
4502		queryParameters["ContinuationToken"] = continuationToken
4503	}
4504	if maxResults != nil {
4505		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
4506	} else {
4507		queryParameters["MaxResults"] = autorest.Encode("query", 0)
4508	}
4509	if timeout != nil {
4510		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4511	} else {
4512		queryParameters["timeout"] = autorest.Encode("query", 60)
4513	}
4514
4515	preparer := autorest.CreatePreparer(
4516		autorest.AsGet(),
4517		autorest.WithBaseURL(client.BaseURI),
4518		autorest.WithPath("/ApplicationTypes"),
4519		autorest.WithQueryParameters(queryParameters))
4520	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4521}
4522
4523// GetApplicationTypeInfoListSender sends the GetApplicationTypeInfoList request. The method will close the
4524// http.Response Body if it receives an error.
4525func (client BaseClient) GetApplicationTypeInfoListSender(req *http.Request) (*http.Response, error) {
4526	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4527}
4528
4529// GetApplicationTypeInfoListResponder handles the response to the GetApplicationTypeInfoList request. The method always
4530// closes the http.Response Body.
4531func (client BaseClient) GetApplicationTypeInfoListResponder(resp *http.Response) (result PagedApplicationTypeInfoList, err error) {
4532	err = autorest.Respond(
4533		resp,
4534		azure.WithErrorUnlessStatusCode(http.StatusOK),
4535		autorest.ByUnmarshallingJSON(&result),
4536		autorest.ByClosing())
4537	result.Response = autorest.Response{Response: resp}
4538	return
4539}
4540
4541// GetApplicationTypeInfoListByName returns the information about the application types that are provisioned or in the
4542// process of being provisioned in the Service Fabric cluster. These results are of application types whose name match
4543// exactly the one specified as the parameter, and which comply with the given query parameters. All versions of the
4544// application type matching the application type name are returned, with each version returned as one application
4545// type. The response includes the name, version, status and other details about the application type. This is a paged
4546// query, meaning that if not all of the application types fit in a page, one page of results is returned as well as a
4547// continuation token which can be used to get the next page. For example, if there are 10 application types but a page
4548// only fits the first 3 application types, or if max results is set to 3, then 3 is returned. To access the rest of
4549// the results, retrieve subsequent pages by using the returned continuation token in the next query. An empty
4550// continuation token is returned if there are no subsequent pages.
4551// Parameters:
4552// applicationTypeName - the name of the application type.
4553// applicationTypeVersion - the version of the application type.
4554// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from
4555// the result.
4556// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
4557// token with a non empty value is included in the response of the API when the results from the system do not
4558// fit in a single response. When this value is passed to the next API call, the API returns next set of
4559// results. If there are no further results then the continuation token does not contain a value. The value of
4560// this parameter should not be URL encoded.
4561// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
4562// defines the upper bound on the number of results returned. The results returned can be less than the
4563// specified maximum results if they do not fit in the message as per the max message size restrictions defined
4564// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
4565// as possible that fit in the return message.
4566// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4567// duration that the client is willing to wait for the requested operation to complete. The default value for
4568// this parameter is 60 seconds.
4569func (client BaseClient) GetApplicationTypeInfoListByName(ctx context.Context, applicationTypeName string, applicationTypeVersion string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationTypeInfoList, err error) {
4570	if tracing.IsEnabled() {
4571		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationTypeInfoListByName")
4572		defer func() {
4573			sc := -1
4574			if result.Response.Response != nil {
4575				sc = result.Response.Response.StatusCode
4576			}
4577			tracing.EndSpan(ctx, sc, err)
4578		}()
4579	}
4580	if err := validation.Validate([]validation.Validation{
4581		{TargetValue: maxResults,
4582			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
4583				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
4584		{TargetValue: timeout,
4585			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4586				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4587					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4588				}}}}}); err != nil {
4589		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoListByName", err.Error())
4590	}
4591
4592	req, err := client.GetApplicationTypeInfoListByNamePreparer(ctx, applicationTypeName, applicationTypeVersion, excludeApplicationParameters, continuationToken, maxResults, timeout)
4593	if err != nil {
4594		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", nil, "Failure preparing request")
4595		return
4596	}
4597
4598	resp, err := client.GetApplicationTypeInfoListByNameSender(req)
4599	if err != nil {
4600		result.Response = autorest.Response{Response: resp}
4601		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", resp, "Failure sending request")
4602		return
4603	}
4604
4605	result, err = client.GetApplicationTypeInfoListByNameResponder(resp)
4606	if err != nil {
4607		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", resp, "Failure responding to request")
4608		return
4609	}
4610
4611	return
4612}
4613
4614// GetApplicationTypeInfoListByNamePreparer prepares the GetApplicationTypeInfoListByName request.
4615func (client BaseClient) GetApplicationTypeInfoListByNamePreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
4616	pathParameters := map[string]interface{}{
4617		"applicationTypeName": autorest.Encode("path", applicationTypeName),
4618	}
4619
4620	const APIVersion = "6.0"
4621	queryParameters := map[string]interface{}{
4622		"api-version": APIVersion,
4623	}
4624	if len(applicationTypeVersion) > 0 {
4625		queryParameters["ApplicationTypeVersion"] = autorest.Encode("query", applicationTypeVersion)
4626	}
4627	if excludeApplicationParameters != nil {
4628		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters)
4629	} else {
4630		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false)
4631	}
4632	if len(continuationToken) > 0 {
4633		queryParameters["ContinuationToken"] = continuationToken
4634	}
4635	if maxResults != nil {
4636		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
4637	} else {
4638		queryParameters["MaxResults"] = autorest.Encode("query", 0)
4639	}
4640	if timeout != nil {
4641		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4642	} else {
4643		queryParameters["timeout"] = autorest.Encode("query", 60)
4644	}
4645
4646	preparer := autorest.CreatePreparer(
4647		autorest.AsGet(),
4648		autorest.WithBaseURL(client.BaseURI),
4649		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}", pathParameters),
4650		autorest.WithQueryParameters(queryParameters))
4651	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4652}
4653
4654// GetApplicationTypeInfoListByNameSender sends the GetApplicationTypeInfoListByName request. The method will close the
4655// http.Response Body if it receives an error.
4656func (client BaseClient) GetApplicationTypeInfoListByNameSender(req *http.Request) (*http.Response, error) {
4657	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4658}
4659
4660// GetApplicationTypeInfoListByNameResponder handles the response to the GetApplicationTypeInfoListByName request. The method always
4661// closes the http.Response Body.
4662func (client BaseClient) GetApplicationTypeInfoListByNameResponder(resp *http.Response) (result PagedApplicationTypeInfoList, err error) {
4663	err = autorest.Respond(
4664		resp,
4665		azure.WithErrorUnlessStatusCode(http.StatusOK),
4666		autorest.ByUnmarshallingJSON(&result),
4667		autorest.ByClosing())
4668	result.Response = autorest.Response{Response: resp}
4669	return
4670}
4671
4672// GetApplicationUpgrade returns information about the state of the latest application upgrade along with details to
4673// aid debugging application health issues.
4674// Parameters:
4675// applicationID - the identity of the application. This is typically the full name of the application without
4676// the 'fabric:' URI scheme.
4677// Starting from version 6.0, hierarchical names are delimited with the "~" character.
4678// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
4679// in 6.0+ and "myapp/app1" in previous versions.
4680// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4681// duration that the client is willing to wait for the requested operation to complete. The default value for
4682// this parameter is 60 seconds.
4683func (client BaseClient) GetApplicationUpgrade(ctx context.Context, applicationID string, timeout *int64) (result ApplicationUpgradeProgressInfo, err error) {
4684	if tracing.IsEnabled() {
4685		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationUpgrade")
4686		defer func() {
4687			sc := -1
4688			if result.Response.Response != nil {
4689				sc = result.Response.Response.StatusCode
4690			}
4691			tracing.EndSpan(ctx, sc, err)
4692		}()
4693	}
4694	if err := validation.Validate([]validation.Validation{
4695		{TargetValue: timeout,
4696			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4697				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4698					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4699				}}}}}); err != nil {
4700		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationUpgrade", err.Error())
4701	}
4702
4703	req, err := client.GetApplicationUpgradePreparer(ctx, applicationID, timeout)
4704	if err != nil {
4705		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", nil, "Failure preparing request")
4706		return
4707	}
4708
4709	resp, err := client.GetApplicationUpgradeSender(req)
4710	if err != nil {
4711		result.Response = autorest.Response{Response: resp}
4712		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", resp, "Failure sending request")
4713		return
4714	}
4715
4716	result, err = client.GetApplicationUpgradeResponder(resp)
4717	if err != nil {
4718		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", resp, "Failure responding to request")
4719		return
4720	}
4721
4722	return
4723}
4724
4725// GetApplicationUpgradePreparer prepares the GetApplicationUpgrade request.
4726func (client BaseClient) GetApplicationUpgradePreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
4727	pathParameters := map[string]interface{}{
4728		"applicationId": applicationID,
4729	}
4730
4731	const APIVersion = "6.0"
4732	queryParameters := map[string]interface{}{
4733		"api-version": APIVersion,
4734	}
4735	if timeout != nil {
4736		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4737	} else {
4738		queryParameters["timeout"] = autorest.Encode("query", 60)
4739	}
4740
4741	preparer := autorest.CreatePreparer(
4742		autorest.AsGet(),
4743		autorest.WithBaseURL(client.BaseURI),
4744		autorest.WithPathParameters("/Applications/{applicationId}/$/GetUpgradeProgress", pathParameters),
4745		autorest.WithQueryParameters(queryParameters))
4746	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4747}
4748
4749// GetApplicationUpgradeSender sends the GetApplicationUpgrade request. The method will close the
4750// http.Response Body if it receives an error.
4751func (client BaseClient) GetApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
4752	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4753}
4754
4755// GetApplicationUpgradeResponder handles the response to the GetApplicationUpgrade request. The method always
4756// closes the http.Response Body.
4757func (client BaseClient) GetApplicationUpgradeResponder(resp *http.Response) (result ApplicationUpgradeProgressInfo, err error) {
4758	err = autorest.Respond(
4759		resp,
4760		azure.WithErrorUnlessStatusCode(http.StatusOK),
4761		autorest.ByUnmarshallingJSON(&result),
4762		autorest.ByClosing())
4763	result.Response = autorest.Response{Response: resp}
4764	return
4765}
4766
4767// GetBackupPolicyByName gets a particular backup policy identified by {backupPolicyName}
4768// Parameters:
4769// backupPolicyName - the name of the backup policy.
4770// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4771// duration that the client is willing to wait for the requested operation to complete. The default value for
4772// this parameter is 60 seconds.
4773func (client BaseClient) GetBackupPolicyByName(ctx context.Context, backupPolicyName string, timeout *int64) (result BackupPolicyDescription, err error) {
4774	if tracing.IsEnabled() {
4775		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupPolicyByName")
4776		defer func() {
4777			sc := -1
4778			if result.Response.Response != nil {
4779				sc = result.Response.Response.StatusCode
4780			}
4781			tracing.EndSpan(ctx, sc, err)
4782		}()
4783	}
4784	if err := validation.Validate([]validation.Validation{
4785		{TargetValue: timeout,
4786			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4787				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4788					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4789				}}}}}); err != nil {
4790		return result, validation.NewError("servicefabric.BaseClient", "GetBackupPolicyByName", err.Error())
4791	}
4792
4793	req, err := client.GetBackupPolicyByNamePreparer(ctx, backupPolicyName, timeout)
4794	if err != nil {
4795		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", nil, "Failure preparing request")
4796		return
4797	}
4798
4799	resp, err := client.GetBackupPolicyByNameSender(req)
4800	if err != nil {
4801		result.Response = autorest.Response{Response: resp}
4802		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", resp, "Failure sending request")
4803		return
4804	}
4805
4806	result, err = client.GetBackupPolicyByNameResponder(resp)
4807	if err != nil {
4808		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", resp, "Failure responding to request")
4809		return
4810	}
4811
4812	return
4813}
4814
4815// GetBackupPolicyByNamePreparer prepares the GetBackupPolicyByName request.
4816func (client BaseClient) GetBackupPolicyByNamePreparer(ctx context.Context, backupPolicyName string, timeout *int64) (*http.Request, error) {
4817	pathParameters := map[string]interface{}{
4818		"backupPolicyName": autorest.Encode("path", backupPolicyName),
4819	}
4820
4821	const APIVersion = "6.2-preview"
4822	queryParameters := map[string]interface{}{
4823		"api-version": APIVersion,
4824	}
4825	if timeout != nil {
4826		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4827	} else {
4828		queryParameters["timeout"] = autorest.Encode("query", 60)
4829	}
4830
4831	preparer := autorest.CreatePreparer(
4832		autorest.AsGet(),
4833		autorest.WithBaseURL(client.BaseURI),
4834		autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}", pathParameters),
4835		autorest.WithQueryParameters(queryParameters))
4836	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4837}
4838
4839// GetBackupPolicyByNameSender sends the GetBackupPolicyByName request. The method will close the
4840// http.Response Body if it receives an error.
4841func (client BaseClient) GetBackupPolicyByNameSender(req *http.Request) (*http.Response, error) {
4842	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4843}
4844
4845// GetBackupPolicyByNameResponder handles the response to the GetBackupPolicyByName request. The method always
4846// closes the http.Response Body.
4847func (client BaseClient) GetBackupPolicyByNameResponder(resp *http.Response) (result BackupPolicyDescription, err error) {
4848	err = autorest.Respond(
4849		resp,
4850		azure.WithErrorUnlessStatusCode(http.StatusOK),
4851		autorest.ByUnmarshallingJSON(&result),
4852		autorest.ByClosing())
4853	result.Response = autorest.Response{Response: resp}
4854	return
4855}
4856
4857// GetBackupPolicyList get a list of all the backup policies configured.
4858// Parameters:
4859// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
4860// token with a non empty value is included in the response of the API when the results from the system do not
4861// fit in a single response. When this value is passed to the next API call, the API returns next set of
4862// results. If there are no further results then the continuation token does not contain a value. The value of
4863// this parameter should not be URL encoded.
4864// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
4865// defines the upper bound on the number of results returned. The results returned can be less than the
4866// specified maximum results if they do not fit in the message as per the max message size restrictions defined
4867// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
4868// as possible that fit in the return message.
4869// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4870// duration that the client is willing to wait for the requested operation to complete. The default value for
4871// this parameter is 60 seconds.
4872func (client BaseClient) GetBackupPolicyList(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupPolicyDescriptionList, err error) {
4873	if tracing.IsEnabled() {
4874		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupPolicyList")
4875		defer func() {
4876			sc := -1
4877			if result.Response.Response != nil {
4878				sc = result.Response.Response.StatusCode
4879			}
4880			tracing.EndSpan(ctx, sc, err)
4881		}()
4882	}
4883	if err := validation.Validate([]validation.Validation{
4884		{TargetValue: maxResults,
4885			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
4886				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
4887		{TargetValue: timeout,
4888			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4889				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4890					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4891				}}}}}); err != nil {
4892		return result, validation.NewError("servicefabric.BaseClient", "GetBackupPolicyList", err.Error())
4893	}
4894
4895	req, err := client.GetBackupPolicyListPreparer(ctx, continuationToken, maxResults, timeout)
4896	if err != nil {
4897		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", nil, "Failure preparing request")
4898		return
4899	}
4900
4901	resp, err := client.GetBackupPolicyListSender(req)
4902	if err != nil {
4903		result.Response = autorest.Response{Response: resp}
4904		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", resp, "Failure sending request")
4905		return
4906	}
4907
4908	result, err = client.GetBackupPolicyListResponder(resp)
4909	if err != nil {
4910		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", resp, "Failure responding to request")
4911		return
4912	}
4913
4914	return
4915}
4916
4917// GetBackupPolicyListPreparer prepares the GetBackupPolicyList request.
4918func (client BaseClient) GetBackupPolicyListPreparer(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
4919	const APIVersion = "6.2-preview"
4920	queryParameters := map[string]interface{}{
4921		"api-version": APIVersion,
4922	}
4923	if len(continuationToken) > 0 {
4924		queryParameters["ContinuationToken"] = continuationToken
4925	}
4926	if maxResults != nil {
4927		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
4928	} else {
4929		queryParameters["MaxResults"] = autorest.Encode("query", 0)
4930	}
4931	if timeout != nil {
4932		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4933	} else {
4934		queryParameters["timeout"] = autorest.Encode("query", 60)
4935	}
4936
4937	preparer := autorest.CreatePreparer(
4938		autorest.AsGet(),
4939		autorest.WithBaseURL(client.BaseURI),
4940		autorest.WithPath("/BackupRestore/BackupPolicies"),
4941		autorest.WithQueryParameters(queryParameters))
4942	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4943}
4944
4945// GetBackupPolicyListSender sends the GetBackupPolicyList request. The method will close the
4946// http.Response Body if it receives an error.
4947func (client BaseClient) GetBackupPolicyListSender(req *http.Request) (*http.Response, error) {
4948	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4949}
4950
4951// GetBackupPolicyListResponder handles the response to the GetBackupPolicyList request. The method always
4952// closes the http.Response Body.
4953func (client BaseClient) GetBackupPolicyListResponder(resp *http.Response) (result PagedBackupPolicyDescriptionList, err error) {
4954	err = autorest.Respond(
4955		resp,
4956		azure.WithErrorUnlessStatusCode(http.StatusOK),
4957		autorest.ByUnmarshallingJSON(&result),
4958		autorest.ByClosing())
4959	result.Response = autorest.Response{Response: resp}
4960	return
4961}
4962
4963// GetBackupsFromBackupLocation gets the list of backups available for the specified backed up entity (Application,
4964// Service or Partition) at the specified backup location (FileShare or Azure Blob Storage).
4965// Parameters:
4966// getBackupByStorageQueryDescription - describes the filters and backup storage details to be used for
4967// enumerating backups.
4968// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4969// duration that the client is willing to wait for the requested operation to complete. The default value for
4970// this parameter is 60 seconds.
4971// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
4972// token with a non empty value is included in the response of the API when the results from the system do not
4973// fit in a single response. When this value is passed to the next API call, the API returns next set of
4974// results. If there are no further results then the continuation token does not contain a value. The value of
4975// this parameter should not be URL encoded.
4976// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
4977// defines the upper bound on the number of results returned. The results returned can be less than the
4978// specified maximum results if they do not fit in the message as per the max message size restrictions defined
4979// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
4980// as possible that fit in the return message.
4981func (client BaseClient) GetBackupsFromBackupLocation(ctx context.Context, getBackupByStorageQueryDescription GetBackupByStorageQueryDescription, timeout *int64, continuationToken string, maxResults *int64) (result PagedBackupInfoList, err error) {
4982	if tracing.IsEnabled() {
4983		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupsFromBackupLocation")
4984		defer func() {
4985			sc := -1
4986			if result.Response.Response != nil {
4987				sc = result.Response.Response.StatusCode
4988			}
4989			tracing.EndSpan(ctx, sc, err)
4990		}()
4991	}
4992	if err := validation.Validate([]validation.Validation{
4993		{TargetValue: timeout,
4994			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4995				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4996					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4997				}}}},
4998		{TargetValue: maxResults,
4999			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
5000				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil {
5001		return result, validation.NewError("servicefabric.BaseClient", "GetBackupsFromBackupLocation", err.Error())
5002	}
5003
5004	req, err := client.GetBackupsFromBackupLocationPreparer(ctx, getBackupByStorageQueryDescription, timeout, continuationToken, maxResults)
5005	if err != nil {
5006		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", nil, "Failure preparing request")
5007		return
5008	}
5009
5010	resp, err := client.GetBackupsFromBackupLocationSender(req)
5011	if err != nil {
5012		result.Response = autorest.Response{Response: resp}
5013		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", resp, "Failure sending request")
5014		return
5015	}
5016
5017	result, err = client.GetBackupsFromBackupLocationResponder(resp)
5018	if err != nil {
5019		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", resp, "Failure responding to request")
5020		return
5021	}
5022
5023	return
5024}
5025
5026// GetBackupsFromBackupLocationPreparer prepares the GetBackupsFromBackupLocation request.
5027func (client BaseClient) GetBackupsFromBackupLocationPreparer(ctx context.Context, getBackupByStorageQueryDescription GetBackupByStorageQueryDescription, timeout *int64, continuationToken string, maxResults *int64) (*http.Request, error) {
5028	const APIVersion = "6.2-preview"
5029	queryParameters := map[string]interface{}{
5030		"api-version": APIVersion,
5031	}
5032	if timeout != nil {
5033		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5034	} else {
5035		queryParameters["timeout"] = autorest.Encode("query", 60)
5036	}
5037	if len(continuationToken) > 0 {
5038		queryParameters["ContinuationToken"] = continuationToken
5039	}
5040	if maxResults != nil {
5041		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
5042	} else {
5043		queryParameters["MaxResults"] = autorest.Encode("query", 0)
5044	}
5045
5046	preparer := autorest.CreatePreparer(
5047		autorest.AsContentType("application/json; charset=utf-8"),
5048		autorest.AsPost(),
5049		autorest.WithBaseURL(client.BaseURI),
5050		autorest.WithPath("/BackupRestore/$/GetBackups"),
5051		autorest.WithJSON(getBackupByStorageQueryDescription),
5052		autorest.WithQueryParameters(queryParameters))
5053	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5054}
5055
5056// GetBackupsFromBackupLocationSender sends the GetBackupsFromBackupLocation request. The method will close the
5057// http.Response Body if it receives an error.
5058func (client BaseClient) GetBackupsFromBackupLocationSender(req *http.Request) (*http.Response, error) {
5059	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5060}
5061
5062// GetBackupsFromBackupLocationResponder handles the response to the GetBackupsFromBackupLocation request. The method always
5063// closes the http.Response Body.
5064func (client BaseClient) GetBackupsFromBackupLocationResponder(resp *http.Response) (result PagedBackupInfoList, err error) {
5065	err = autorest.Respond(
5066		resp,
5067		azure.WithErrorUnlessStatusCode(http.StatusOK),
5068		autorest.ByUnmarshallingJSON(&result),
5069		autorest.ByClosing())
5070	result.Response = autorest.Response{Response: resp}
5071	return
5072}
5073
5074// GetChaos get the status of Chaos indicating whether or not Chaos is running, the Chaos parameters used for running
5075// Chaos and the status of the Chaos Schedule.
5076// Parameters:
5077// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5078// duration that the client is willing to wait for the requested operation to complete. The default value for
5079// this parameter is 60 seconds.
5080func (client BaseClient) GetChaos(ctx context.Context, timeout *int64) (result Chaos, err error) {
5081	if tracing.IsEnabled() {
5082		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaos")
5083		defer func() {
5084			sc := -1
5085			if result.Response.Response != nil {
5086				sc = result.Response.Response.StatusCode
5087			}
5088			tracing.EndSpan(ctx, sc, err)
5089		}()
5090	}
5091	if err := validation.Validate([]validation.Validation{
5092		{TargetValue: timeout,
5093			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5094				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5095					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5096				}}}}}); err != nil {
5097		return result, validation.NewError("servicefabric.BaseClient", "GetChaos", err.Error())
5098	}
5099
5100	req, err := client.GetChaosPreparer(ctx, timeout)
5101	if err != nil {
5102		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", nil, "Failure preparing request")
5103		return
5104	}
5105
5106	resp, err := client.GetChaosSender(req)
5107	if err != nil {
5108		result.Response = autorest.Response{Response: resp}
5109		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", resp, "Failure sending request")
5110		return
5111	}
5112
5113	result, err = client.GetChaosResponder(resp)
5114	if err != nil {
5115		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", resp, "Failure responding to request")
5116		return
5117	}
5118
5119	return
5120}
5121
5122// GetChaosPreparer prepares the GetChaos request.
5123func (client BaseClient) GetChaosPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
5124	const APIVersion = "6.2"
5125	queryParameters := map[string]interface{}{
5126		"api-version": APIVersion,
5127	}
5128	if timeout != nil {
5129		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5130	} else {
5131		queryParameters["timeout"] = autorest.Encode("query", 60)
5132	}
5133
5134	preparer := autorest.CreatePreparer(
5135		autorest.AsGet(),
5136		autorest.WithBaseURL(client.BaseURI),
5137		autorest.WithPath("/Tools/Chaos"),
5138		autorest.WithQueryParameters(queryParameters))
5139	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5140}
5141
5142// GetChaosSender sends the GetChaos request. The method will close the
5143// http.Response Body if it receives an error.
5144func (client BaseClient) GetChaosSender(req *http.Request) (*http.Response, error) {
5145	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5146}
5147
5148// GetChaosResponder handles the response to the GetChaos request. The method always
5149// closes the http.Response Body.
5150func (client BaseClient) GetChaosResponder(resp *http.Response) (result Chaos, err error) {
5151	err = autorest.Respond(
5152		resp,
5153		azure.WithErrorUnlessStatusCode(http.StatusOK),
5154		autorest.ByUnmarshallingJSON(&result),
5155		autorest.ByClosing())
5156	result.Response = autorest.Response{Response: resp}
5157	return
5158}
5159
5160// GetChaosEvents to get the next segment of the Chaos events, you can specify the ContinuationToken. To get the start
5161// of a new segment of Chaos events, you can specify the time range
5162// through StartTimeUtc and EndTimeUtc. You cannot specify both the ContinuationToken and the time range in the same
5163// call.
5164// When there are more than 100 Chaos events, the Chaos events are returned in multiple segments where a segment
5165// contains no more than 100 Chaos events and to get the next segment you make a call to this API with the continuation
5166// token.
5167// Parameters:
5168// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
5169// token with a non empty value is included in the response of the API when the results from the system do not
5170// fit in a single response. When this value is passed to the next API call, the API returns next set of
5171// results. If there are no further results then the continuation token does not contain a value. The value of
5172// this parameter should not be URL encoded.
5173// startTimeUtc - the Windows file time representing the start time of the time range for which a Chaos report
5174// is to be generated. Please consult [DateTime.ToFileTimeUtc
5175// Method](https://msdn.microsoft.com/en-us/library/system.datetime.tofiletimeutc(v=vs.110).aspx) for details.
5176// endTimeUtc - the Windows file time representing the end time of the time range for which a Chaos report is
5177// to be generated. Please consult [DateTime.ToFileTimeUtc
5178// Method](https://msdn.microsoft.com/en-us/library/system.datetime.tofiletimeutc(v=vs.110).aspx) for details.
5179// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
5180// defines the upper bound on the number of results returned. The results returned can be less than the
5181// specified maximum results if they do not fit in the message as per the max message size restrictions defined
5182// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
5183// as possible that fit in the return message.
5184// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5185// duration that the client is willing to wait for the requested operation to complete. The default value for
5186// this parameter is 60 seconds.
5187func (client BaseClient) GetChaosEvents(ctx context.Context, continuationToken string, startTimeUtc string, endTimeUtc string, maxResults *int64, timeout *int64) (result ChaosEventsSegment, err error) {
5188	if tracing.IsEnabled() {
5189		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaosEvents")
5190		defer func() {
5191			sc := -1
5192			if result.Response.Response != nil {
5193				sc = result.Response.Response.StatusCode
5194			}
5195			tracing.EndSpan(ctx, sc, err)
5196		}()
5197	}
5198	if err := validation.Validate([]validation.Validation{
5199		{TargetValue: maxResults,
5200			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
5201				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
5202		{TargetValue: timeout,
5203			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5204				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5205					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5206				}}}}}); err != nil {
5207		return result, validation.NewError("servicefabric.BaseClient", "GetChaosEvents", err.Error())
5208	}
5209
5210	req, err := client.GetChaosEventsPreparer(ctx, continuationToken, startTimeUtc, endTimeUtc, maxResults, timeout)
5211	if err != nil {
5212		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", nil, "Failure preparing request")
5213		return
5214	}
5215
5216	resp, err := client.GetChaosEventsSender(req)
5217	if err != nil {
5218		result.Response = autorest.Response{Response: resp}
5219		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", resp, "Failure sending request")
5220		return
5221	}
5222
5223	result, err = client.GetChaosEventsResponder(resp)
5224	if err != nil {
5225		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", resp, "Failure responding to request")
5226		return
5227	}
5228
5229	return
5230}
5231
5232// GetChaosEventsPreparer prepares the GetChaosEvents request.
5233func (client BaseClient) GetChaosEventsPreparer(ctx context.Context, continuationToken string, startTimeUtc string, endTimeUtc string, maxResults *int64, timeout *int64) (*http.Request, error) {
5234	const APIVersion = "6.2"
5235	queryParameters := map[string]interface{}{
5236		"api-version": APIVersion,
5237	}
5238	if len(continuationToken) > 0 {
5239		queryParameters["ContinuationToken"] = continuationToken
5240	}
5241	if len(startTimeUtc) > 0 {
5242		queryParameters["StartTimeUtc"] = autorest.Encode("query", startTimeUtc)
5243	}
5244	if len(endTimeUtc) > 0 {
5245		queryParameters["EndTimeUtc"] = autorest.Encode("query", endTimeUtc)
5246	}
5247	if maxResults != nil {
5248		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
5249	} else {
5250		queryParameters["MaxResults"] = autorest.Encode("query", 0)
5251	}
5252	if timeout != nil {
5253		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5254	} else {
5255		queryParameters["timeout"] = autorest.Encode("query", 60)
5256	}
5257
5258	preparer := autorest.CreatePreparer(
5259		autorest.AsGet(),
5260		autorest.WithBaseURL(client.BaseURI),
5261		autorest.WithPath("/Tools/Chaos/Events"),
5262		autorest.WithQueryParameters(queryParameters))
5263	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5264}
5265
5266// GetChaosEventsSender sends the GetChaosEvents request. The method will close the
5267// http.Response Body if it receives an error.
5268func (client BaseClient) GetChaosEventsSender(req *http.Request) (*http.Response, error) {
5269	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5270}
5271
5272// GetChaosEventsResponder handles the response to the GetChaosEvents request. The method always
5273// closes the http.Response Body.
5274func (client BaseClient) GetChaosEventsResponder(resp *http.Response) (result ChaosEventsSegment, err error) {
5275	err = autorest.Respond(
5276		resp,
5277		azure.WithErrorUnlessStatusCode(http.StatusOK),
5278		autorest.ByUnmarshallingJSON(&result),
5279		autorest.ByClosing())
5280	result.Response = autorest.Response{Response: resp}
5281	return
5282}
5283
5284// GetChaosSchedule gets the version of the Chaos Schedule in use and the Chaos Schedule that defines when and how to
5285// run Chaos.
5286func (client BaseClient) GetChaosSchedule(ctx context.Context) (result ChaosScheduleDescription, err error) {
5287	if tracing.IsEnabled() {
5288		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaosSchedule")
5289		defer func() {
5290			sc := -1
5291			if result.Response.Response != nil {
5292				sc = result.Response.Response.StatusCode
5293			}
5294			tracing.EndSpan(ctx, sc, err)
5295		}()
5296	}
5297	req, err := client.GetChaosSchedulePreparer(ctx)
5298	if err != nil {
5299		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", nil, "Failure preparing request")
5300		return
5301	}
5302
5303	resp, err := client.GetChaosScheduleSender(req)
5304	if err != nil {
5305		result.Response = autorest.Response{Response: resp}
5306		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", resp, "Failure sending request")
5307		return
5308	}
5309
5310	result, err = client.GetChaosScheduleResponder(resp)
5311	if err != nil {
5312		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", resp, "Failure responding to request")
5313		return
5314	}
5315
5316	return
5317}
5318
5319// GetChaosSchedulePreparer prepares the GetChaosSchedule request.
5320func (client BaseClient) GetChaosSchedulePreparer(ctx context.Context) (*http.Request, error) {
5321	const APIVersion = "6.2"
5322	queryParameters := map[string]interface{}{
5323		"api-version": APIVersion,
5324	}
5325
5326	preparer := autorest.CreatePreparer(
5327		autorest.AsGet(),
5328		autorest.WithBaseURL(client.BaseURI),
5329		autorest.WithPath("/Tools/Chaos/Schedule"),
5330		autorest.WithQueryParameters(queryParameters))
5331	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5332}
5333
5334// GetChaosScheduleSender sends the GetChaosSchedule request. The method will close the
5335// http.Response Body if it receives an error.
5336func (client BaseClient) GetChaosScheduleSender(req *http.Request) (*http.Response, error) {
5337	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5338}
5339
5340// GetChaosScheduleResponder handles the response to the GetChaosSchedule request. The method always
5341// closes the http.Response Body.
5342func (client BaseClient) GetChaosScheduleResponder(resp *http.Response) (result ChaosScheduleDescription, err error) {
5343	err = autorest.Respond(
5344		resp,
5345		azure.WithErrorUnlessStatusCode(http.StatusOK),
5346		autorest.ByUnmarshallingJSON(&result),
5347		autorest.ByClosing())
5348	result.Response = autorest.Response{Response: resp}
5349	return
5350}
5351
5352// GetClusterConfiguration get the Service Fabric standalone cluster configuration. The cluster configuration contains
5353// properties of the cluster that include different node types on the cluster,
5354// security configurations, fault and upgrade domain topologies, etc.
5355// Parameters:
5356// configurationAPIVersion - the API version of the Standalone cluster json configuration.
5357// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5358// duration that the client is willing to wait for the requested operation to complete. The default value for
5359// this parameter is 60 seconds.
5360func (client BaseClient) GetClusterConfiguration(ctx context.Context, configurationAPIVersion string, timeout *int64) (result ClusterConfiguration, err error) {
5361	if tracing.IsEnabled() {
5362		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterConfiguration")
5363		defer func() {
5364			sc := -1
5365			if result.Response.Response != nil {
5366				sc = result.Response.Response.StatusCode
5367			}
5368			tracing.EndSpan(ctx, sc, err)
5369		}()
5370	}
5371	if err := validation.Validate([]validation.Validation{
5372		{TargetValue: timeout,
5373			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5374				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5375					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5376				}}}}}); err != nil {
5377		return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfiguration", err.Error())
5378	}
5379
5380	req, err := client.GetClusterConfigurationPreparer(ctx, configurationAPIVersion, timeout)
5381	if err != nil {
5382		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", nil, "Failure preparing request")
5383		return
5384	}
5385
5386	resp, err := client.GetClusterConfigurationSender(req)
5387	if err != nil {
5388		result.Response = autorest.Response{Response: resp}
5389		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", resp, "Failure sending request")
5390		return
5391	}
5392
5393	result, err = client.GetClusterConfigurationResponder(resp)
5394	if err != nil {
5395		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", resp, "Failure responding to request")
5396		return
5397	}
5398
5399	return
5400}
5401
5402// GetClusterConfigurationPreparer prepares the GetClusterConfiguration request.
5403func (client BaseClient) GetClusterConfigurationPreparer(ctx context.Context, configurationAPIVersion string, timeout *int64) (*http.Request, error) {
5404	const APIVersion = "6.0"
5405	queryParameters := map[string]interface{}{
5406		"api-version":             APIVersion,
5407		"ConfigurationApiVersion": autorest.Encode("query", configurationAPIVersion),
5408	}
5409	if timeout != nil {
5410		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5411	} else {
5412		queryParameters["timeout"] = autorest.Encode("query", 60)
5413	}
5414
5415	preparer := autorest.CreatePreparer(
5416		autorest.AsGet(),
5417		autorest.WithBaseURL(client.BaseURI),
5418		autorest.WithPath("/$/GetClusterConfiguration"),
5419		autorest.WithQueryParameters(queryParameters))
5420	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5421}
5422
5423// GetClusterConfigurationSender sends the GetClusterConfiguration request. The method will close the
5424// http.Response Body if it receives an error.
5425func (client BaseClient) GetClusterConfigurationSender(req *http.Request) (*http.Response, error) {
5426	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5427}
5428
5429// GetClusterConfigurationResponder handles the response to the GetClusterConfiguration request. The method always
5430// closes the http.Response Body.
5431func (client BaseClient) GetClusterConfigurationResponder(resp *http.Response) (result ClusterConfiguration, err error) {
5432	err = autorest.Respond(
5433		resp,
5434		azure.WithErrorUnlessStatusCode(http.StatusOK),
5435		autorest.ByUnmarshallingJSON(&result),
5436		autorest.ByClosing())
5437	result.Response = autorest.Response{Response: resp}
5438	return
5439}
5440
5441// GetClusterConfigurationUpgradeStatus get the cluster configuration upgrade status details of a Service Fabric
5442// standalone cluster.
5443// Parameters:
5444// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5445// duration that the client is willing to wait for the requested operation to complete. The default value for
5446// this parameter is 60 seconds.
5447func (client BaseClient) GetClusterConfigurationUpgradeStatus(ctx context.Context, timeout *int64) (result ClusterConfigurationUpgradeStatusInfo, err error) {
5448	if tracing.IsEnabled() {
5449		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterConfigurationUpgradeStatus")
5450		defer func() {
5451			sc := -1
5452			if result.Response.Response != nil {
5453				sc = result.Response.Response.StatusCode
5454			}
5455			tracing.EndSpan(ctx, sc, err)
5456		}()
5457	}
5458	if err := validation.Validate([]validation.Validation{
5459		{TargetValue: timeout,
5460			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5461				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5462					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5463				}}}}}); err != nil {
5464		return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", err.Error())
5465	}
5466
5467	req, err := client.GetClusterConfigurationUpgradeStatusPreparer(ctx, timeout)
5468	if err != nil {
5469		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", nil, "Failure preparing request")
5470		return
5471	}
5472
5473	resp, err := client.GetClusterConfigurationUpgradeStatusSender(req)
5474	if err != nil {
5475		result.Response = autorest.Response{Response: resp}
5476		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", resp, "Failure sending request")
5477		return
5478	}
5479
5480	result, err = client.GetClusterConfigurationUpgradeStatusResponder(resp)
5481	if err != nil {
5482		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", resp, "Failure responding to request")
5483		return
5484	}
5485
5486	return
5487}
5488
5489// GetClusterConfigurationUpgradeStatusPreparer prepares the GetClusterConfigurationUpgradeStatus request.
5490func (client BaseClient) GetClusterConfigurationUpgradeStatusPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
5491	const APIVersion = "6.0"
5492	queryParameters := map[string]interface{}{
5493		"api-version": APIVersion,
5494	}
5495	if timeout != nil {
5496		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5497	} else {
5498		queryParameters["timeout"] = autorest.Encode("query", 60)
5499	}
5500
5501	preparer := autorest.CreatePreparer(
5502		autorest.AsGet(),
5503		autorest.WithBaseURL(client.BaseURI),
5504		autorest.WithPath("/$/GetClusterConfigurationUpgradeStatus"),
5505		autorest.WithQueryParameters(queryParameters))
5506	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5507}
5508
5509// GetClusterConfigurationUpgradeStatusSender sends the GetClusterConfigurationUpgradeStatus request. The method will close the
5510// http.Response Body if it receives an error.
5511func (client BaseClient) GetClusterConfigurationUpgradeStatusSender(req *http.Request) (*http.Response, error) {
5512	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5513}
5514
5515// GetClusterConfigurationUpgradeStatusResponder handles the response to the GetClusterConfigurationUpgradeStatus request. The method always
5516// closes the http.Response Body.
5517func (client BaseClient) GetClusterConfigurationUpgradeStatusResponder(resp *http.Response) (result ClusterConfigurationUpgradeStatusInfo, err error) {
5518	err = autorest.Respond(
5519		resp,
5520		azure.WithErrorUnlessStatusCode(http.StatusOK),
5521		autorest.ByUnmarshallingJSON(&result),
5522		autorest.ByClosing())
5523	result.Response = autorest.Response{Response: resp}
5524	return
5525}
5526
5527// GetClusterEventList the response is list of ClusterEvent objects.
5528// Parameters:
5529// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
5530// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
5531// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5532// duration that the client is willing to wait for the requested operation to complete. The default value for
5533// this parameter is 60 seconds.
5534// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
5535// be included in the response.
5536// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
5537// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
5538// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
5539// populated.
5540func (client BaseClient) GetClusterEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListClusterEvent, err error) {
5541	if tracing.IsEnabled() {
5542		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterEventList")
5543		defer func() {
5544			sc := -1
5545			if result.Response.Response != nil {
5546				sc = result.Response.Response.StatusCode
5547			}
5548			tracing.EndSpan(ctx, sc, err)
5549		}()
5550	}
5551	if err := validation.Validate([]validation.Validation{
5552		{TargetValue: timeout,
5553			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5554				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5555					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5556				}}}}}); err != nil {
5557		return result, validation.NewError("servicefabric.BaseClient", "GetClusterEventList", err.Error())
5558	}
5559
5560	req, err := client.GetClusterEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
5561	if err != nil {
5562		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", nil, "Failure preparing request")
5563		return
5564	}
5565
5566	resp, err := client.GetClusterEventListSender(req)
5567	if err != nil {
5568		result.Response = autorest.Response{Response: resp}
5569		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", resp, "Failure sending request")
5570		return
5571	}
5572
5573	result, err = client.GetClusterEventListResponder(resp)
5574	if err != nil {
5575		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", resp, "Failure responding to request")
5576		return
5577	}
5578
5579	return
5580}
5581
5582// GetClusterEventListPreparer prepares the GetClusterEventList request.
5583func (client BaseClient) GetClusterEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
5584	const APIVersion = "6.2-preview"
5585	queryParameters := map[string]interface{}{
5586		"api-version":  APIVersion,
5587		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
5588		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
5589	}
5590	if timeout != nil {
5591		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5592	} else {
5593		queryParameters["timeout"] = autorest.Encode("query", 60)
5594	}
5595	if len(eventsTypesFilter) > 0 {
5596		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
5597	}
5598	if excludeAnalysisEvents != nil {
5599		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
5600	}
5601	if skipCorrelationLookup != nil {
5602		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
5603	}
5604
5605	preparer := autorest.CreatePreparer(
5606		autorest.AsGet(),
5607		autorest.WithBaseURL(client.BaseURI),
5608		autorest.WithPath("/EventsStore/Cluster/Events"),
5609		autorest.WithQueryParameters(queryParameters))
5610	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5611}
5612
5613// GetClusterEventListSender sends the GetClusterEventList request. The method will close the
5614// http.Response Body if it receives an error.
5615func (client BaseClient) GetClusterEventListSender(req *http.Request) (*http.Response, error) {
5616	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5617}
5618
5619// GetClusterEventListResponder handles the response to the GetClusterEventList request. The method always
5620// closes the http.Response Body.
5621func (client BaseClient) GetClusterEventListResponder(resp *http.Response) (result ListClusterEvent, err error) {
5622	err = autorest.Respond(
5623		resp,
5624		azure.WithErrorUnlessStatusCode(http.StatusOK),
5625		autorest.ByUnmarshallingJSON(&result),
5626		autorest.ByClosing())
5627	result.Response = autorest.Response{Response: resp}
5628	return
5629}
5630
5631// GetClusterHealth gets the health of a Service Fabric cluster.
5632// Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health
5633// state.
5634// Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and
5635// applications returned based on their aggregated health state.
5636// Parameters:
5637// nodesHealthStateFilter - allows filtering of the node health state objects returned in the result of cluster
5638// health query
5639// based on their health state. The possible values for this parameter include integer value of one of the
5640// following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the
5641// aggregated health state.
5642// If not specified, all entries are returned.
5643// The state values are flag based enumeration, so the value could be a combination of these values obtained
5644// using bitwise 'OR' operator.
5645// For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and
5646// Warning (4) are returned.
5647//
5648// - Default - Default value. Matches any HealthState. The value is zero.
5649// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
5650// collection of states. The value is 1.
5651// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
5652// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
5653// - Error - Filter that matches input with HealthState value Error. The value is 8.
5654// - All - Filter that matches input with any HealthState value. The value is 65535.
5655// applicationsHealthStateFilter - allows filtering of the application health state objects returned in the
5656// result of cluster health
5657// query based on their health state.
5658// The possible values for this parameter include integer value obtained from members or bitwise operations
5659// on members of HealthStateFilter enumeration. Only applications that match the filter are returned.
5660// All applications are used to evaluate the aggregated health state. If not specified, all entries are
5661// returned.
5662// The state values are flag based enumeration, so the value could be a combination of these values obtained
5663// using bitwise 'OR' operator.
5664// For example, if the provided value is 6 then health state of applications with HealthState value of OK (2)
5665// and Warning (4) are returned.
5666//
5667// - Default - Default value. Matches any HealthState. The value is zero.
5668// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
5669// collection of states. The value is 1.
5670// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
5671// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
5672// - Error - Filter that matches input with HealthState value Error. The value is 8.
5673// - All - Filter that matches input with any HealthState value. The value is 65535.
5674// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
5675// state.
5676// The possible values for this parameter include integer value of one of the following health states.
5677// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
5678// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
5679// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
5680// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
5681//
5682// - Default - Default value. Matches any HealthState. The value is zero.
5683// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
5684// collection of states. The value is 1.
5685// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
5686// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
5687// - Error - Filter that matches input with HealthState value Error. The value is 8.
5688// - All - Filter that matches input with any HealthState value. The value is 65535.
5689// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
5690// result. False by default.
5691// The statistics show the number of children entities in health state Ok, Warning, and Error.
5692// includeSystemApplicationHealthStatistics - indicates whether the health statistics should include the
5693// fabric:/System application health statistics. False by default.
5694// If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that
5695// belong to the fabric:/System application.
5696// Otherwise, the query result includes health statistics only for user applications.
5697// The health statistics must be included in the query result for this parameter to be applied.
5698// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5699// duration that the client is willing to wait for the requested operation to complete. The default value for
5700// this parameter is 60 seconds.
5701func (client BaseClient) GetClusterHealth(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, timeout *int64) (result ClusterHealth, err error) {
5702	if tracing.IsEnabled() {
5703		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealth")
5704		defer func() {
5705			sc := -1
5706			if result.Response.Response != nil {
5707				sc = result.Response.Response.StatusCode
5708			}
5709			tracing.EndSpan(ctx, sc, err)
5710		}()
5711	}
5712	if err := validation.Validate([]validation.Validation{
5713		{TargetValue: timeout,
5714			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5715				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5716					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5717				}}}}}); err != nil {
5718		return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealth", err.Error())
5719	}
5720
5721	req, err := client.GetClusterHealthPreparer(ctx, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, timeout)
5722	if err != nil {
5723		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", nil, "Failure preparing request")
5724		return
5725	}
5726
5727	resp, err := client.GetClusterHealthSender(req)
5728	if err != nil {
5729		result.Response = autorest.Response{Response: resp}
5730		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", resp, "Failure sending request")
5731		return
5732	}
5733
5734	result, err = client.GetClusterHealthResponder(resp)
5735	if err != nil {
5736		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", resp, "Failure responding to request")
5737		return
5738	}
5739
5740	return
5741}
5742
5743// GetClusterHealthPreparer prepares the GetClusterHealth request.
5744func (client BaseClient) GetClusterHealthPreparer(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, timeout *int64) (*http.Request, error) {
5745	const APIVersion = "6.0"
5746	queryParameters := map[string]interface{}{
5747		"api-version": APIVersion,
5748	}
5749	if nodesHealthStateFilter != nil {
5750		queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", *nodesHealthStateFilter)
5751	} else {
5752		queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", 0)
5753	}
5754	if applicationsHealthStateFilter != nil {
5755		queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", *applicationsHealthStateFilter)
5756	} else {
5757		queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", 0)
5758	}
5759	if eventsHealthStateFilter != nil {
5760		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
5761	} else {
5762		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
5763	}
5764	if excludeHealthStatistics != nil {
5765		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
5766	} else {
5767		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
5768	}
5769	if includeSystemApplicationHealthStatistics != nil {
5770		queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", *includeSystemApplicationHealthStatistics)
5771	} else {
5772		queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", false)
5773	}
5774	if timeout != nil {
5775		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5776	} else {
5777		queryParameters["timeout"] = autorest.Encode("query", 60)
5778	}
5779
5780	preparer := autorest.CreatePreparer(
5781		autorest.AsGet(),
5782		autorest.WithBaseURL(client.BaseURI),
5783		autorest.WithPath("/$/GetClusterHealth"),
5784		autorest.WithQueryParameters(queryParameters))
5785	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5786}
5787
5788// GetClusterHealthSender sends the GetClusterHealth request. The method will close the
5789// http.Response Body if it receives an error.
5790func (client BaseClient) GetClusterHealthSender(req *http.Request) (*http.Response, error) {
5791	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5792}
5793
5794// GetClusterHealthResponder handles the response to the GetClusterHealth request. The method always
5795// closes the http.Response Body.
5796func (client BaseClient) GetClusterHealthResponder(resp *http.Response) (result ClusterHealth, err error) {
5797	err = autorest.Respond(
5798		resp,
5799		azure.WithErrorUnlessStatusCode(http.StatusOK),
5800		autorest.ByUnmarshallingJSON(&result),
5801		autorest.ByClosing())
5802	result.Response = autorest.Response{Response: resp}
5803	return
5804}
5805
5806// GetClusterHealthChunk gets the health of a Service Fabric cluster using health chunks. Includes the aggregated
5807// health state of the cluster, but none of the cluster entities.
5808// To expand the cluster health and get the health state of all or some of the entities, use the POST URI and specify
5809// the cluster health chunk query description.
5810// Parameters:
5811// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5812// duration that the client is willing to wait for the requested operation to complete. The default value for
5813// this parameter is 60 seconds.
5814func (client BaseClient) GetClusterHealthChunk(ctx context.Context, timeout *int64) (result ClusterHealthChunk, err error) {
5815	if tracing.IsEnabled() {
5816		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthChunk")
5817		defer func() {
5818			sc := -1
5819			if result.Response.Response != nil {
5820				sc = result.Response.Response.StatusCode
5821			}
5822			tracing.EndSpan(ctx, sc, err)
5823		}()
5824	}
5825	if err := validation.Validate([]validation.Validation{
5826		{TargetValue: timeout,
5827			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5828				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5829					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5830				}}}}}); err != nil {
5831		return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunk", err.Error())
5832	}
5833
5834	req, err := client.GetClusterHealthChunkPreparer(ctx, timeout)
5835	if err != nil {
5836		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", nil, "Failure preparing request")
5837		return
5838	}
5839
5840	resp, err := client.GetClusterHealthChunkSender(req)
5841	if err != nil {
5842		result.Response = autorest.Response{Response: resp}
5843		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", resp, "Failure sending request")
5844		return
5845	}
5846
5847	result, err = client.GetClusterHealthChunkResponder(resp)
5848	if err != nil {
5849		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", resp, "Failure responding to request")
5850		return
5851	}
5852
5853	return
5854}
5855
5856// GetClusterHealthChunkPreparer prepares the GetClusterHealthChunk request.
5857func (client BaseClient) GetClusterHealthChunkPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
5858	const APIVersion = "6.0"
5859	queryParameters := map[string]interface{}{
5860		"api-version": APIVersion,
5861	}
5862	if timeout != nil {
5863		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5864	} else {
5865		queryParameters["timeout"] = autorest.Encode("query", 60)
5866	}
5867
5868	preparer := autorest.CreatePreparer(
5869		autorest.AsGet(),
5870		autorest.WithBaseURL(client.BaseURI),
5871		autorest.WithPath("/$/GetClusterHealthChunk"),
5872		autorest.WithQueryParameters(queryParameters))
5873	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5874}
5875
5876// GetClusterHealthChunkSender sends the GetClusterHealthChunk request. The method will close the
5877// http.Response Body if it receives an error.
5878func (client BaseClient) GetClusterHealthChunkSender(req *http.Request) (*http.Response, error) {
5879	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5880}
5881
5882// GetClusterHealthChunkResponder handles the response to the GetClusterHealthChunk request. The method always
5883// closes the http.Response Body.
5884func (client BaseClient) GetClusterHealthChunkResponder(resp *http.Response) (result ClusterHealthChunk, err error) {
5885	err = autorest.Respond(
5886		resp,
5887		azure.WithErrorUnlessStatusCode(http.StatusOK),
5888		autorest.ByUnmarshallingJSON(&result),
5889		autorest.ByClosing())
5890	result.Response = autorest.Response{Response: resp}
5891	return
5892}
5893
5894// GetClusterHealthChunkUsingPolicyAndAdvancedFilters gets the health of a Service Fabric cluster using health chunks.
5895// The health evaluation is done based on the input cluster health chunk query description.
5896// The query description allows users to specify health policies for evaluating the cluster and its children.
5897// Users can specify very flexible filters to select which cluster entities to return. The selection can be done based
5898// on the entities health state and based on the hierarchy.
5899// The query can return multi-level children of the entities based on the specified filters. For example, it can return
5900// one application with a specified name, and for this application, return
5901// only services that are in Error or Warning, and all partitions and replicas for one of these services.
5902// Parameters:
5903// clusterHealthChunkQueryDescription - describes the cluster and application health policies used to evaluate
5904// the cluster health and the filters to select which cluster entities to be returned.
5905// If the cluster health policy is present, it is used to evaluate the cluster events and the cluster nodes. If
5906// not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the
5907// default cluster health policy.
5908// By default, each application is evaluated using its specific application health policy, defined in the
5909// application manifest, or the default health policy, if no policy is defined in manifest.
5910// If the application health policy map is specified, and it has an entry for an application, the specified
5911// application health policy
5912// is used to evaluate the application health.
5913// Users can specify very flexible filters to select which cluster entities to include in response. The
5914// selection can be done based on the entities health state and based on the hierarchy.
5915// The query can return multi-level children of the entities based on the specified filters. For example, it
5916// can return one application with a specified name, and for this application, return
5917// only services that are in Error or Warning, and all partitions and replicas for one of these services.
5918// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5919// duration that the client is willing to wait for the requested operation to complete. The default value for
5920// this parameter is 60 seconds.
5921func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFilters(ctx context.Context, clusterHealthChunkQueryDescription *ClusterHealthChunkQueryDescription, timeout *int64) (result ClusterHealthChunk, err error) {
5922	if tracing.IsEnabled() {
5923		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthChunkUsingPolicyAndAdvancedFilters")
5924		defer func() {
5925			sc := -1
5926			if result.Response.Response != nil {
5927				sc = result.Response.Response.StatusCode
5928			}
5929			tracing.EndSpan(ctx, sc, err)
5930		}()
5931	}
5932	if err := validation.Validate([]validation.Validation{
5933		{TargetValue: timeout,
5934			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5935				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5936					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5937				}}}}}); err != nil {
5938		return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", err.Error())
5939	}
5940
5941	req, err := client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer(ctx, clusterHealthChunkQueryDescription, timeout)
5942	if err != nil {
5943		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", nil, "Failure preparing request")
5944		return
5945	}
5946
5947	resp, err := client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender(req)
5948	if err != nil {
5949		result.Response = autorest.Response{Response: resp}
5950		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", resp, "Failure sending request")
5951		return
5952	}
5953
5954	result, err = client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder(resp)
5955	if err != nil {
5956		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", resp, "Failure responding to request")
5957		return
5958	}
5959
5960	return
5961}
5962
5963// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer prepares the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request.
5964func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer(ctx context.Context, clusterHealthChunkQueryDescription *ClusterHealthChunkQueryDescription, timeout *int64) (*http.Request, error) {
5965	const APIVersion = "6.0"
5966	queryParameters := map[string]interface{}{
5967		"api-version": APIVersion,
5968	}
5969	if timeout != nil {
5970		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5971	} else {
5972		queryParameters["timeout"] = autorest.Encode("query", 60)
5973	}
5974
5975	preparer := autorest.CreatePreparer(
5976		autorest.AsContentType("application/json; charset=utf-8"),
5977		autorest.AsPost(),
5978		autorest.WithBaseURL(client.BaseURI),
5979		autorest.WithPath("/$/GetClusterHealthChunk"),
5980		autorest.WithQueryParameters(queryParameters))
5981	if clusterHealthChunkQueryDescription != nil {
5982		preparer = autorest.DecoratePreparer(preparer,
5983			autorest.WithJSON(clusterHealthChunkQueryDescription))
5984	}
5985	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5986}
5987
5988// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender sends the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. The method will close the
5989// http.Response Body if it receives an error.
5990func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender(req *http.Request) (*http.Response, error) {
5991	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5992}
5993
5994// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder handles the response to the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. The method always
5995// closes the http.Response Body.
5996func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder(resp *http.Response) (result ClusterHealthChunk, err error) {
5997	err = autorest.Respond(
5998		resp,
5999		azure.WithErrorUnlessStatusCode(http.StatusOK),
6000		autorest.ByUnmarshallingJSON(&result),
6001		autorest.ByClosing())
6002	result.Response = autorest.Response{Response: resp}
6003	return
6004}
6005
6006// GetClusterHealthUsingPolicy gets the health of a Service Fabric cluster.
6007// Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health
6008// state.
6009// Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and
6010// applications returned based on their aggregated health state.
6011// Use ClusterHealthPolicies to override the health policies used to evaluate the health.
6012// Parameters:
6013// nodesHealthStateFilter - allows filtering of the node health state objects returned in the result of cluster
6014// health query
6015// based on their health state. The possible values for this parameter include integer value of one of the
6016// following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the
6017// aggregated health state.
6018// If not specified, all entries are returned.
6019// The state values are flag based enumeration, so the value could be a combination of these values obtained
6020// using bitwise 'OR' operator.
6021// For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and
6022// Warning (4) are returned.
6023//
6024// - Default - Default value. Matches any HealthState. The value is zero.
6025// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
6026// collection of states. The value is 1.
6027// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
6028// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
6029// - Error - Filter that matches input with HealthState value Error. The value is 8.
6030// - All - Filter that matches input with any HealthState value. The value is 65535.
6031// applicationsHealthStateFilter - allows filtering of the application health state objects returned in the
6032// result of cluster health
6033// query based on their health state.
6034// The possible values for this parameter include integer value obtained from members or bitwise operations
6035// on members of HealthStateFilter enumeration. Only applications that match the filter are returned.
6036// All applications are used to evaluate the aggregated health state. If not specified, all entries are
6037// returned.
6038// The state values are flag based enumeration, so the value could be a combination of these values obtained
6039// using bitwise 'OR' operator.
6040// For example, if the provided value is 6 then health state of applications with HealthState value of OK (2)
6041// and Warning (4) are returned.
6042//
6043// - Default - Default value. Matches any HealthState. The value is zero.
6044// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
6045// collection of states. The value is 1.
6046// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
6047// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
6048// - Error - Filter that matches input with HealthState value Error. The value is 8.
6049// - All - Filter that matches input with any HealthState value. The value is 65535.
6050// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
6051// state.
6052// The possible values for this parameter include integer value of one of the following health states.
6053// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
6054// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
6055// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
6056// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
6057//
6058// - Default - Default value. Matches any HealthState. The value is zero.
6059// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
6060// collection of states. The value is 1.
6061// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
6062// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
6063// - Error - Filter that matches input with HealthState value Error. The value is 8.
6064// - All - Filter that matches input with any HealthState value. The value is 65535.
6065// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
6066// result. False by default.
6067// The statistics show the number of children entities in health state Ok, Warning, and Error.
6068// includeSystemApplicationHealthStatistics - indicates whether the health statistics should include the
6069// fabric:/System application health statistics. False by default.
6070// If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that
6071// belong to the fabric:/System application.
6072// Otherwise, the query result includes health statistics only for user applications.
6073// The health statistics must be included in the query result for this parameter to be applied.
6074// clusterHealthPolicies - describes the health policies used to evaluate the cluster health.
6075// If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the
6076// default cluster health policy.
6077// By default, each application is evaluated using its specific application health policy, defined in the
6078// application manifest, or the default health policy, if no policy is defined in manifest.
6079// If the application health policy map is specified, and it has an entry for an application, the specified
6080// application health policy
6081// is used to evaluate the application health.
6082// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6083// duration that the client is willing to wait for the requested operation to complete. The default value for
6084// this parameter is 60 seconds.
6085func (client BaseClient) GetClusterHealthUsingPolicy(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, clusterHealthPolicies *ClusterHealthPolicies, timeout *int64) (result ClusterHealth, err error) {
6086	if tracing.IsEnabled() {
6087		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthUsingPolicy")
6088		defer func() {
6089			sc := -1
6090			if result.Response.Response != nil {
6091				sc = result.Response.Response.StatusCode
6092			}
6093			tracing.EndSpan(ctx, sc, err)
6094		}()
6095	}
6096	if err := validation.Validate([]validation.Validation{
6097		{TargetValue: timeout,
6098			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6099				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6100					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6101				}}}}}); err != nil {
6102		return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthUsingPolicy", err.Error())
6103	}
6104
6105	req, err := client.GetClusterHealthUsingPolicyPreparer(ctx, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, clusterHealthPolicies, timeout)
6106	if err != nil {
6107		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", nil, "Failure preparing request")
6108		return
6109	}
6110
6111	resp, err := client.GetClusterHealthUsingPolicySender(req)
6112	if err != nil {
6113		result.Response = autorest.Response{Response: resp}
6114		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", resp, "Failure sending request")
6115		return
6116	}
6117
6118	result, err = client.GetClusterHealthUsingPolicyResponder(resp)
6119	if err != nil {
6120		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", resp, "Failure responding to request")
6121		return
6122	}
6123
6124	return
6125}
6126
6127// GetClusterHealthUsingPolicyPreparer prepares the GetClusterHealthUsingPolicy request.
6128func (client BaseClient) GetClusterHealthUsingPolicyPreparer(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, clusterHealthPolicies *ClusterHealthPolicies, timeout *int64) (*http.Request, error) {
6129	const APIVersion = "6.0"
6130	queryParameters := map[string]interface{}{
6131		"api-version": APIVersion,
6132	}
6133	if nodesHealthStateFilter != nil {
6134		queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", *nodesHealthStateFilter)
6135	} else {
6136		queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", 0)
6137	}
6138	if applicationsHealthStateFilter != nil {
6139		queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", *applicationsHealthStateFilter)
6140	} else {
6141		queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", 0)
6142	}
6143	if eventsHealthStateFilter != nil {
6144		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
6145	} else {
6146		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
6147	}
6148	if excludeHealthStatistics != nil {
6149		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
6150	} else {
6151		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
6152	}
6153	if includeSystemApplicationHealthStatistics != nil {
6154		queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", *includeSystemApplicationHealthStatistics)
6155	} else {
6156		queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", false)
6157	}
6158	if timeout != nil {
6159		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6160	} else {
6161		queryParameters["timeout"] = autorest.Encode("query", 60)
6162	}
6163
6164	preparer := autorest.CreatePreparer(
6165		autorest.AsContentType("application/json; charset=utf-8"),
6166		autorest.AsPost(),
6167		autorest.WithBaseURL(client.BaseURI),
6168		autorest.WithPath("/$/GetClusterHealth"),
6169		autorest.WithQueryParameters(queryParameters))
6170	if clusterHealthPolicies != nil {
6171		preparer = autorest.DecoratePreparer(preparer,
6172			autorest.WithJSON(clusterHealthPolicies))
6173	}
6174	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6175}
6176
6177// GetClusterHealthUsingPolicySender sends the GetClusterHealthUsingPolicy request. The method will close the
6178// http.Response Body if it receives an error.
6179func (client BaseClient) GetClusterHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
6180	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6181}
6182
6183// GetClusterHealthUsingPolicyResponder handles the response to the GetClusterHealthUsingPolicy request. The method always
6184// closes the http.Response Body.
6185func (client BaseClient) GetClusterHealthUsingPolicyResponder(resp *http.Response) (result ClusterHealth, err error) {
6186	err = autorest.Respond(
6187		resp,
6188		azure.WithErrorUnlessStatusCode(http.StatusOK),
6189		autorest.ByUnmarshallingJSON(&result),
6190		autorest.ByClosing())
6191	result.Response = autorest.Response{Response: resp}
6192	return
6193}
6194
6195// GetClusterManifest get the Service Fabric cluster manifest. The cluster manifest contains properties of the cluster
6196// that include different node types on the cluster,
6197// security configurations, fault and upgrade domain topologies, etc.
6198//
6199// These properties are specified as part of the ClusterConfig.JSON file while deploying a stand alone cluster.
6200// However, most of the information in the cluster manifest
6201// is generated internally by service fabric during cluster deployment in other deployment scenarios (e.g. when using
6202// azure portal).
6203//
6204// The contents of the cluster manifest are for informational purposes only and users are not expected to take a
6205// dependency on the format of the file contents or its interpretation.
6206// Parameters:
6207// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6208// duration that the client is willing to wait for the requested operation to complete. The default value for
6209// this parameter is 60 seconds.
6210func (client BaseClient) GetClusterManifest(ctx context.Context, timeout *int64) (result ClusterManifest, err error) {
6211	if tracing.IsEnabled() {
6212		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterManifest")
6213		defer func() {
6214			sc := -1
6215			if result.Response.Response != nil {
6216				sc = result.Response.Response.StatusCode
6217			}
6218			tracing.EndSpan(ctx, sc, err)
6219		}()
6220	}
6221	if err := validation.Validate([]validation.Validation{
6222		{TargetValue: timeout,
6223			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6224				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6225					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6226				}}}}}); err != nil {
6227		return result, validation.NewError("servicefabric.BaseClient", "GetClusterManifest", err.Error())
6228	}
6229
6230	req, err := client.GetClusterManifestPreparer(ctx, timeout)
6231	if err != nil {
6232		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", nil, "Failure preparing request")
6233		return
6234	}
6235
6236	resp, err := client.GetClusterManifestSender(req)
6237	if err != nil {
6238		result.Response = autorest.Response{Response: resp}
6239		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", resp, "Failure sending request")
6240		return
6241	}
6242
6243	result, err = client.GetClusterManifestResponder(resp)
6244	if err != nil {
6245		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", resp, "Failure responding to request")
6246		return
6247	}
6248
6249	return
6250}
6251
6252// GetClusterManifestPreparer prepares the GetClusterManifest request.
6253func (client BaseClient) GetClusterManifestPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
6254	const APIVersion = "6.0"
6255	queryParameters := map[string]interface{}{
6256		"api-version": APIVersion,
6257	}
6258	if timeout != nil {
6259		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6260	} else {
6261		queryParameters["timeout"] = autorest.Encode("query", 60)
6262	}
6263
6264	preparer := autorest.CreatePreparer(
6265		autorest.AsGet(),
6266		autorest.WithBaseURL(client.BaseURI),
6267		autorest.WithPath("/$/GetClusterManifest"),
6268		autorest.WithQueryParameters(queryParameters))
6269	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6270}
6271
6272// GetClusterManifestSender sends the GetClusterManifest request. The method will close the
6273// http.Response Body if it receives an error.
6274func (client BaseClient) GetClusterManifestSender(req *http.Request) (*http.Response, error) {
6275	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6276}
6277
6278// GetClusterManifestResponder handles the response to the GetClusterManifest request. The method always
6279// closes the http.Response Body.
6280func (client BaseClient) GetClusterManifestResponder(resp *http.Response) (result ClusterManifest, err error) {
6281	err = autorest.Respond(
6282		resp,
6283		azure.WithErrorUnlessStatusCode(http.StatusOK),
6284		autorest.ByUnmarshallingJSON(&result),
6285		autorest.ByClosing())
6286	result.Response = autorest.Response{Response: resp}
6287	return
6288}
6289
6290// GetClusterUpgradeProgress gets the current progress of the ongoing cluster upgrade. If no upgrade is currently in
6291// progress, gets the last state of the previous cluster upgrade.
6292// Parameters:
6293// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6294// duration that the client is willing to wait for the requested operation to complete. The default value for
6295// this parameter is 60 seconds.
6296func (client BaseClient) GetClusterUpgradeProgress(ctx context.Context, timeout *int64) (result ClusterUpgradeProgressObject, err error) {
6297	if tracing.IsEnabled() {
6298		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterUpgradeProgress")
6299		defer func() {
6300			sc := -1
6301			if result.Response.Response != nil {
6302				sc = result.Response.Response.StatusCode
6303			}
6304			tracing.EndSpan(ctx, sc, err)
6305		}()
6306	}
6307	if err := validation.Validate([]validation.Validation{
6308		{TargetValue: timeout,
6309			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6310				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6311					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6312				}}}}}); err != nil {
6313		return result, validation.NewError("servicefabric.BaseClient", "GetClusterUpgradeProgress", err.Error())
6314	}
6315
6316	req, err := client.GetClusterUpgradeProgressPreparer(ctx, timeout)
6317	if err != nil {
6318		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", nil, "Failure preparing request")
6319		return
6320	}
6321
6322	resp, err := client.GetClusterUpgradeProgressSender(req)
6323	if err != nil {
6324		result.Response = autorest.Response{Response: resp}
6325		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", resp, "Failure sending request")
6326		return
6327	}
6328
6329	result, err = client.GetClusterUpgradeProgressResponder(resp)
6330	if err != nil {
6331		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", resp, "Failure responding to request")
6332		return
6333	}
6334
6335	return
6336}
6337
6338// GetClusterUpgradeProgressPreparer prepares the GetClusterUpgradeProgress request.
6339func (client BaseClient) GetClusterUpgradeProgressPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
6340	const APIVersion = "6.0"
6341	queryParameters := map[string]interface{}{
6342		"api-version": APIVersion,
6343	}
6344	if timeout != nil {
6345		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6346	} else {
6347		queryParameters["timeout"] = autorest.Encode("query", 60)
6348	}
6349
6350	preparer := autorest.CreatePreparer(
6351		autorest.AsGet(),
6352		autorest.WithBaseURL(client.BaseURI),
6353		autorest.WithPath("/$/GetUpgradeProgress"),
6354		autorest.WithQueryParameters(queryParameters))
6355	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6356}
6357
6358// GetClusterUpgradeProgressSender sends the GetClusterUpgradeProgress request. The method will close the
6359// http.Response Body if it receives an error.
6360func (client BaseClient) GetClusterUpgradeProgressSender(req *http.Request) (*http.Response, error) {
6361	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6362}
6363
6364// GetClusterUpgradeProgressResponder handles the response to the GetClusterUpgradeProgress request. The method always
6365// closes the http.Response Body.
6366func (client BaseClient) GetClusterUpgradeProgressResponder(resp *http.Response) (result ClusterUpgradeProgressObject, err error) {
6367	err = autorest.Respond(
6368		resp,
6369		azure.WithErrorUnlessStatusCode(http.StatusOK),
6370		autorest.ByUnmarshallingJSON(&result),
6371		autorest.ByClosing())
6372	result.Response = autorest.Response{Response: resp}
6373	return
6374}
6375
6376// GetComposeDeploymentStatus returns the status of the compose deployment that was created or in the process of being
6377// created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response
6378// includes the name, status and other details about the deployment.
6379// Parameters:
6380// deploymentName - the identity of the deployment.
6381// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6382// duration that the client is willing to wait for the requested operation to complete. The default value for
6383// this parameter is 60 seconds.
6384func (client BaseClient) GetComposeDeploymentStatus(ctx context.Context, deploymentName string, timeout *int64) (result ComposeDeploymentStatusInfo, err error) {
6385	if tracing.IsEnabled() {
6386		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentStatus")
6387		defer func() {
6388			sc := -1
6389			if result.Response.Response != nil {
6390				sc = result.Response.Response.StatusCode
6391			}
6392			tracing.EndSpan(ctx, sc, err)
6393		}()
6394	}
6395	if err := validation.Validate([]validation.Validation{
6396		{TargetValue: timeout,
6397			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6398				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6399					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6400				}}}}}); err != nil {
6401		return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatus", err.Error())
6402	}
6403
6404	req, err := client.GetComposeDeploymentStatusPreparer(ctx, deploymentName, timeout)
6405	if err != nil {
6406		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", nil, "Failure preparing request")
6407		return
6408	}
6409
6410	resp, err := client.GetComposeDeploymentStatusSender(req)
6411	if err != nil {
6412		result.Response = autorest.Response{Response: resp}
6413		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", resp, "Failure sending request")
6414		return
6415	}
6416
6417	result, err = client.GetComposeDeploymentStatusResponder(resp)
6418	if err != nil {
6419		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", resp, "Failure responding to request")
6420		return
6421	}
6422
6423	return
6424}
6425
6426// GetComposeDeploymentStatusPreparer prepares the GetComposeDeploymentStatus request.
6427func (client BaseClient) GetComposeDeploymentStatusPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) {
6428	pathParameters := map[string]interface{}{
6429		"deploymentName": deploymentName,
6430	}
6431
6432	const APIVersion = "6.0-preview"
6433	queryParameters := map[string]interface{}{
6434		"api-version": APIVersion,
6435	}
6436	if timeout != nil {
6437		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6438	} else {
6439		queryParameters["timeout"] = autorest.Encode("query", 60)
6440	}
6441
6442	preparer := autorest.CreatePreparer(
6443		autorest.AsGet(),
6444		autorest.WithBaseURL(client.BaseURI),
6445		autorest.WithPathParameters("/ComposeDeployments/{deploymentName}", pathParameters),
6446		autorest.WithQueryParameters(queryParameters))
6447	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6448}
6449
6450// GetComposeDeploymentStatusSender sends the GetComposeDeploymentStatus request. The method will close the
6451// http.Response Body if it receives an error.
6452func (client BaseClient) GetComposeDeploymentStatusSender(req *http.Request) (*http.Response, error) {
6453	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6454}
6455
6456// GetComposeDeploymentStatusResponder handles the response to the GetComposeDeploymentStatus request. The method always
6457// closes the http.Response Body.
6458func (client BaseClient) GetComposeDeploymentStatusResponder(resp *http.Response) (result ComposeDeploymentStatusInfo, err error) {
6459	err = autorest.Respond(
6460		resp,
6461		azure.WithErrorUnlessStatusCode(http.StatusOK),
6462		autorest.ByUnmarshallingJSON(&result),
6463		autorest.ByClosing())
6464	result.Response = autorest.Response{Response: resp}
6465	return
6466}
6467
6468// GetComposeDeploymentStatusList gets the status about the compose deployments that were created or in the process of
6469// being created in the Service Fabric cluster. The response includes the name, status and other details about the
6470// compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a
6471// continuation token which can be used to get the next page.
6472// Parameters:
6473// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
6474// token with a non empty value is included in the response of the API when the results from the system do not
6475// fit in a single response. When this value is passed to the next API call, the API returns next set of
6476// results. If there are no further results then the continuation token does not contain a value. The value of
6477// this parameter should not be URL encoded.
6478// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
6479// defines the upper bound on the number of results returned. The results returned can be less than the
6480// specified maximum results if they do not fit in the message as per the max message size restrictions defined
6481// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
6482// as possible that fit in the return message.
6483// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6484// duration that the client is willing to wait for the requested operation to complete. The default value for
6485// this parameter is 60 seconds.
6486func (client BaseClient) GetComposeDeploymentStatusList(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (result PagedComposeDeploymentStatusInfoList, err error) {
6487	if tracing.IsEnabled() {
6488		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentStatusList")
6489		defer func() {
6490			sc := -1
6491			if result.Response.Response != nil {
6492				sc = result.Response.Response.StatusCode
6493			}
6494			tracing.EndSpan(ctx, sc, err)
6495		}()
6496	}
6497	if err := validation.Validate([]validation.Validation{
6498		{TargetValue: maxResults,
6499			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
6500				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
6501		{TargetValue: timeout,
6502			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6503				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6504					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6505				}}}}}); err != nil {
6506		return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatusList", err.Error())
6507	}
6508
6509	req, err := client.GetComposeDeploymentStatusListPreparer(ctx, continuationToken, maxResults, timeout)
6510	if err != nil {
6511		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", nil, "Failure preparing request")
6512		return
6513	}
6514
6515	resp, err := client.GetComposeDeploymentStatusListSender(req)
6516	if err != nil {
6517		result.Response = autorest.Response{Response: resp}
6518		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", resp, "Failure sending request")
6519		return
6520	}
6521
6522	result, err = client.GetComposeDeploymentStatusListResponder(resp)
6523	if err != nil {
6524		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", resp, "Failure responding to request")
6525		return
6526	}
6527
6528	return
6529}
6530
6531// GetComposeDeploymentStatusListPreparer prepares the GetComposeDeploymentStatusList request.
6532func (client BaseClient) GetComposeDeploymentStatusListPreparer(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
6533	const APIVersion = "6.0-preview"
6534	queryParameters := map[string]interface{}{
6535		"api-version": APIVersion,
6536	}
6537	if len(continuationToken) > 0 {
6538		queryParameters["ContinuationToken"] = continuationToken
6539	}
6540	if maxResults != nil {
6541		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
6542	} else {
6543		queryParameters["MaxResults"] = autorest.Encode("query", 0)
6544	}
6545	if timeout != nil {
6546		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6547	} else {
6548		queryParameters["timeout"] = autorest.Encode("query", 60)
6549	}
6550
6551	preparer := autorest.CreatePreparer(
6552		autorest.AsGet(),
6553		autorest.WithBaseURL(client.BaseURI),
6554		autorest.WithPath("/ComposeDeployments"),
6555		autorest.WithQueryParameters(queryParameters))
6556	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6557}
6558
6559// GetComposeDeploymentStatusListSender sends the GetComposeDeploymentStatusList request. The method will close the
6560// http.Response Body if it receives an error.
6561func (client BaseClient) GetComposeDeploymentStatusListSender(req *http.Request) (*http.Response, error) {
6562	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6563}
6564
6565// GetComposeDeploymentStatusListResponder handles the response to the GetComposeDeploymentStatusList request. The method always
6566// closes the http.Response Body.
6567func (client BaseClient) GetComposeDeploymentStatusListResponder(resp *http.Response) (result PagedComposeDeploymentStatusInfoList, err error) {
6568	err = autorest.Respond(
6569		resp,
6570		azure.WithErrorUnlessStatusCode(http.StatusOK),
6571		autorest.ByUnmarshallingJSON(&result),
6572		autorest.ByClosing())
6573	result.Response = autorest.Response{Response: resp}
6574	return
6575}
6576
6577// GetComposeDeploymentUpgradeProgress returns the information about the state of the compose deployment upgrade along
6578// with details to aid debugging application health issues.
6579// Parameters:
6580// deploymentName - the identity of the deployment.
6581// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6582// duration that the client is willing to wait for the requested operation to complete. The default value for
6583// this parameter is 60 seconds.
6584func (client BaseClient) GetComposeDeploymentUpgradeProgress(ctx context.Context, deploymentName string, timeout *int64) (result ComposeDeploymentUpgradeProgressInfo, err error) {
6585	if tracing.IsEnabled() {
6586		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentUpgradeProgress")
6587		defer func() {
6588			sc := -1
6589			if result.Response.Response != nil {
6590				sc = result.Response.Response.StatusCode
6591			}
6592			tracing.EndSpan(ctx, sc, err)
6593		}()
6594	}
6595	if err := validation.Validate([]validation.Validation{
6596		{TargetValue: timeout,
6597			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6598				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6599					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6600				}}}}}); err != nil {
6601		return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", err.Error())
6602	}
6603
6604	req, err := client.GetComposeDeploymentUpgradeProgressPreparer(ctx, deploymentName, timeout)
6605	if err != nil {
6606		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", nil, "Failure preparing request")
6607		return
6608	}
6609
6610	resp, err := client.GetComposeDeploymentUpgradeProgressSender(req)
6611	if err != nil {
6612		result.Response = autorest.Response{Response: resp}
6613		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", resp, "Failure sending request")
6614		return
6615	}
6616
6617	result, err = client.GetComposeDeploymentUpgradeProgressResponder(resp)
6618	if err != nil {
6619		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", resp, "Failure responding to request")
6620		return
6621	}
6622
6623	return
6624}
6625
6626// GetComposeDeploymentUpgradeProgressPreparer prepares the GetComposeDeploymentUpgradeProgress request.
6627func (client BaseClient) GetComposeDeploymentUpgradeProgressPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) {
6628	pathParameters := map[string]interface{}{
6629		"deploymentName": deploymentName,
6630	}
6631
6632	const APIVersion = "6.0-preview"
6633	queryParameters := map[string]interface{}{
6634		"api-version": APIVersion,
6635	}
6636	if timeout != nil {
6637		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6638	} else {
6639		queryParameters["timeout"] = autorest.Encode("query", 60)
6640	}
6641
6642	preparer := autorest.CreatePreparer(
6643		autorest.AsGet(),
6644		autorest.WithBaseURL(client.BaseURI),
6645		autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/GetUpgradeProgress", pathParameters),
6646		autorest.WithQueryParameters(queryParameters))
6647	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6648}
6649
6650// GetComposeDeploymentUpgradeProgressSender sends the GetComposeDeploymentUpgradeProgress request. The method will close the
6651// http.Response Body if it receives an error.
6652func (client BaseClient) GetComposeDeploymentUpgradeProgressSender(req *http.Request) (*http.Response, error) {
6653	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6654}
6655
6656// GetComposeDeploymentUpgradeProgressResponder handles the response to the GetComposeDeploymentUpgradeProgress request. The method always
6657// closes the http.Response Body.
6658func (client BaseClient) GetComposeDeploymentUpgradeProgressResponder(resp *http.Response) (result ComposeDeploymentUpgradeProgressInfo, err error) {
6659	err = autorest.Respond(
6660		resp,
6661		azure.WithErrorUnlessStatusCode(http.StatusOK),
6662		autorest.ByUnmarshallingJSON(&result),
6663		autorest.ByClosing())
6664	result.Response = autorest.Response{Response: resp}
6665	return
6666}
6667
6668// GetContainerLogsDeployedOnNode gets the container logs for container deployed on a Service Fabric node for the given
6669// code package.
6670// Parameters:
6671// nodeName - the name of the node.
6672// applicationID - the identity of the application. This is typically the full name of the application without
6673// the 'fabric:' URI scheme.
6674// Starting from version 6.0, hierarchical names are delimited with the "~" character.
6675// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
6676// in 6.0+ and "myapp/app1" in previous versions.
6677// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
6678// Fabric cluster.
6679// codePackageName - the name of code package specified in service manifest registered as part of an
6680// application type in a Service Fabric cluster.
6681// tail - number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs.
6682// previous - specifies whether to get container logs from exited/dead containers of the code package instance.
6683// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6684// duration that the client is willing to wait for the requested operation to complete. The default value for
6685// this parameter is 60 seconds.
6686func (client BaseClient) GetContainerLogsDeployedOnNode(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, tail string, previous *bool, timeout *int64) (result ContainerLogs, err error) {
6687	if tracing.IsEnabled() {
6688		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetContainerLogsDeployedOnNode")
6689		defer func() {
6690			sc := -1
6691			if result.Response.Response != nil {
6692				sc = result.Response.Response.StatusCode
6693			}
6694			tracing.EndSpan(ctx, sc, err)
6695		}()
6696	}
6697	if err := validation.Validate([]validation.Validation{
6698		{TargetValue: timeout,
6699			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6700				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6701					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6702				}}}}}); err != nil {
6703		return result, validation.NewError("servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", err.Error())
6704	}
6705
6706	req, err := client.GetContainerLogsDeployedOnNodePreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, tail, previous, timeout)
6707	if err != nil {
6708		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", nil, "Failure preparing request")
6709		return
6710	}
6711
6712	resp, err := client.GetContainerLogsDeployedOnNodeSender(req)
6713	if err != nil {
6714		result.Response = autorest.Response{Response: resp}
6715		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", resp, "Failure sending request")
6716		return
6717	}
6718
6719	result, err = client.GetContainerLogsDeployedOnNodeResponder(resp)
6720	if err != nil {
6721		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", resp, "Failure responding to request")
6722		return
6723	}
6724
6725	return
6726}
6727
6728// GetContainerLogsDeployedOnNodePreparer prepares the GetContainerLogsDeployedOnNode request.
6729func (client BaseClient) GetContainerLogsDeployedOnNodePreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, tail string, previous *bool, timeout *int64) (*http.Request, error) {
6730	pathParameters := map[string]interface{}{
6731		"applicationId": applicationID,
6732		"nodeName":      autorest.Encode("path", nodeName),
6733	}
6734
6735	const APIVersion = "6.2"
6736	queryParameters := map[string]interface{}{
6737		"api-version":         APIVersion,
6738		"CodePackageName":     autorest.Encode("query", codePackageName),
6739		"ServiceManifestName": autorest.Encode("query", serviceManifestName),
6740	}
6741	if len(tail) > 0 {
6742		queryParameters["Tail"] = autorest.Encode("query", tail)
6743	}
6744	if previous != nil {
6745		queryParameters["Previous"] = autorest.Encode("query", *previous)
6746	} else {
6747		queryParameters["Previous"] = autorest.Encode("query", false)
6748	}
6749	if timeout != nil {
6750		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6751	} else {
6752		queryParameters["timeout"] = autorest.Encode("query", 60)
6753	}
6754
6755	preparer := autorest.CreatePreparer(
6756		autorest.AsGet(),
6757		autorest.WithBaseURL(client.BaseURI),
6758		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerLogs", pathParameters),
6759		autorest.WithQueryParameters(queryParameters))
6760	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6761}
6762
6763// GetContainerLogsDeployedOnNodeSender sends the GetContainerLogsDeployedOnNode request. The method will close the
6764// http.Response Body if it receives an error.
6765func (client BaseClient) GetContainerLogsDeployedOnNodeSender(req *http.Request) (*http.Response, error) {
6766	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6767}
6768
6769// GetContainerLogsDeployedOnNodeResponder handles the response to the GetContainerLogsDeployedOnNode request. The method always
6770// closes the http.Response Body.
6771func (client BaseClient) GetContainerLogsDeployedOnNodeResponder(resp *http.Response) (result ContainerLogs, err error) {
6772	err = autorest.Respond(
6773		resp,
6774		azure.WithErrorUnlessStatusCode(http.StatusOK),
6775		autorest.ByUnmarshallingJSON(&result),
6776		autorest.ByClosing())
6777	result.Response = autorest.Response{Response: resp}
6778	return
6779}
6780
6781// GetContainersEventList the response is list of ContainerInstanceEvent objects.
6782// Parameters:
6783// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
6784// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
6785// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6786// duration that the client is willing to wait for the requested operation to complete. The default value for
6787// this parameter is 60 seconds.
6788// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
6789// be included in the response.
6790// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
6791// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
6792// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
6793// populated.
6794func (client BaseClient) GetContainersEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListContainerInstanceEvent, err error) {
6795	if tracing.IsEnabled() {
6796		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetContainersEventList")
6797		defer func() {
6798			sc := -1
6799			if result.Response.Response != nil {
6800				sc = result.Response.Response.StatusCode
6801			}
6802			tracing.EndSpan(ctx, sc, err)
6803		}()
6804	}
6805	if err := validation.Validate([]validation.Validation{
6806		{TargetValue: timeout,
6807			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6808				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6809					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6810				}}}}}); err != nil {
6811		return result, validation.NewError("servicefabric.BaseClient", "GetContainersEventList", err.Error())
6812	}
6813
6814	req, err := client.GetContainersEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
6815	if err != nil {
6816		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", nil, "Failure preparing request")
6817		return
6818	}
6819
6820	resp, err := client.GetContainersEventListSender(req)
6821	if err != nil {
6822		result.Response = autorest.Response{Response: resp}
6823		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", resp, "Failure sending request")
6824		return
6825	}
6826
6827	result, err = client.GetContainersEventListResponder(resp)
6828	if err != nil {
6829		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", resp, "Failure responding to request")
6830		return
6831	}
6832
6833	return
6834}
6835
6836// GetContainersEventListPreparer prepares the GetContainersEventList request.
6837func (client BaseClient) GetContainersEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
6838	const APIVersion = "6.2-preview"
6839	queryParameters := map[string]interface{}{
6840		"api-version":  APIVersion,
6841		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
6842		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
6843	}
6844	if timeout != nil {
6845		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6846	} else {
6847		queryParameters["timeout"] = autorest.Encode("query", 60)
6848	}
6849	if len(eventsTypesFilter) > 0 {
6850		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
6851	}
6852	if excludeAnalysisEvents != nil {
6853		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
6854	}
6855	if skipCorrelationLookup != nil {
6856		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
6857	}
6858
6859	preparer := autorest.CreatePreparer(
6860		autorest.AsGet(),
6861		autorest.WithBaseURL(client.BaseURI),
6862		autorest.WithPath("/EventsStore/Containers/Events"),
6863		autorest.WithQueryParameters(queryParameters))
6864	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6865}
6866
6867// GetContainersEventListSender sends the GetContainersEventList request. The method will close the
6868// http.Response Body if it receives an error.
6869func (client BaseClient) GetContainersEventListSender(req *http.Request) (*http.Response, error) {
6870	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6871}
6872
6873// GetContainersEventListResponder handles the response to the GetContainersEventList request. The method always
6874// closes the http.Response Body.
6875func (client BaseClient) GetContainersEventListResponder(resp *http.Response) (result ListContainerInstanceEvent, err error) {
6876	err = autorest.Respond(
6877		resp,
6878		azure.WithErrorUnlessStatusCode(http.StatusOK),
6879		autorest.ByUnmarshallingJSON(&result.Value),
6880		autorest.ByClosing())
6881	result.Response = autorest.Response{Response: resp}
6882	return
6883}
6884
6885// GetCorrelatedEventList the response is list of FabricEvents.
6886// Parameters:
6887// eventInstanceID - the EventInstanceId.
6888// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6889// duration that the client is willing to wait for the requested operation to complete. The default value for
6890// this parameter is 60 seconds.
6891func (client BaseClient) GetCorrelatedEventList(ctx context.Context, eventInstanceID string, timeout *int64) (result ListFabricEvent, err error) {
6892	if tracing.IsEnabled() {
6893		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCorrelatedEventList")
6894		defer func() {
6895			sc := -1
6896			if result.Response.Response != nil {
6897				sc = result.Response.Response.StatusCode
6898			}
6899			tracing.EndSpan(ctx, sc, err)
6900		}()
6901	}
6902	if err := validation.Validate([]validation.Validation{
6903		{TargetValue: timeout,
6904			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6905				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6906					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6907				}}}}}); err != nil {
6908		return result, validation.NewError("servicefabric.BaseClient", "GetCorrelatedEventList", err.Error())
6909	}
6910
6911	req, err := client.GetCorrelatedEventListPreparer(ctx, eventInstanceID, timeout)
6912	if err != nil {
6913		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", nil, "Failure preparing request")
6914		return
6915	}
6916
6917	resp, err := client.GetCorrelatedEventListSender(req)
6918	if err != nil {
6919		result.Response = autorest.Response{Response: resp}
6920		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", resp, "Failure sending request")
6921		return
6922	}
6923
6924	result, err = client.GetCorrelatedEventListResponder(resp)
6925	if err != nil {
6926		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", resp, "Failure responding to request")
6927		return
6928	}
6929
6930	return
6931}
6932
6933// GetCorrelatedEventListPreparer prepares the GetCorrelatedEventList request.
6934func (client BaseClient) GetCorrelatedEventListPreparer(ctx context.Context, eventInstanceID string, timeout *int64) (*http.Request, error) {
6935	pathParameters := map[string]interface{}{
6936		"eventInstanceId": autorest.Encode("path", eventInstanceID),
6937	}
6938
6939	const APIVersion = "6.2-preview"
6940	queryParameters := map[string]interface{}{
6941		"api-version": APIVersion,
6942	}
6943	if timeout != nil {
6944		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6945	} else {
6946		queryParameters["timeout"] = autorest.Encode("query", 60)
6947	}
6948
6949	preparer := autorest.CreatePreparer(
6950		autorest.AsGet(),
6951		autorest.WithBaseURL(client.BaseURI),
6952		autorest.WithPathParameters("/EventsStore/CorrelatedEvents/{eventInstanceId}/$/Events", pathParameters),
6953		autorest.WithQueryParameters(queryParameters))
6954	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6955}
6956
6957// GetCorrelatedEventListSender sends the GetCorrelatedEventList request. The method will close the
6958// http.Response Body if it receives an error.
6959func (client BaseClient) GetCorrelatedEventListSender(req *http.Request) (*http.Response, error) {
6960	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6961}
6962
6963// GetCorrelatedEventListResponder handles the response to the GetCorrelatedEventList request. The method always
6964// closes the http.Response Body.
6965func (client BaseClient) GetCorrelatedEventListResponder(resp *http.Response) (result ListFabricEvent, err error) {
6966	err = autorest.Respond(
6967		resp,
6968		azure.WithErrorUnlessStatusCode(http.StatusOK),
6969		autorest.ByUnmarshallingJSON(&result),
6970		autorest.ByClosing())
6971	result.Response = autorest.Response{Response: resp}
6972	return
6973}
6974
6975// GetDataLossProgress gets the progress of a data loss operation started with StartDataLoss, using the OperationId.
6976// Parameters:
6977// serviceID - the identity of the service. This is typically the full name of the service without the
6978// 'fabric:' URI scheme.
6979// Starting from version 6.0, hierarchical names are delimited with the "~" character.
6980// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
6981// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
6982// partitionID - the identity of the partition.
6983// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
6984// API
6985// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6986// duration that the client is willing to wait for the requested operation to complete. The default value for
6987// this parameter is 60 seconds.
6988func (client BaseClient) GetDataLossProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionDataLossProgress, err error) {
6989	if tracing.IsEnabled() {
6990		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDataLossProgress")
6991		defer func() {
6992			sc := -1
6993			if result.Response.Response != nil {
6994				sc = result.Response.Response.StatusCode
6995			}
6996			tracing.EndSpan(ctx, sc, err)
6997		}()
6998	}
6999	if err := validation.Validate([]validation.Validation{
7000		{TargetValue: timeout,
7001			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7002				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7003					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7004				}}}}}); err != nil {
7005		return result, validation.NewError("servicefabric.BaseClient", "GetDataLossProgress", err.Error())
7006	}
7007
7008	req, err := client.GetDataLossProgressPreparer(ctx, serviceID, partitionID, operationID, timeout)
7009	if err != nil {
7010		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", nil, "Failure preparing request")
7011		return
7012	}
7013
7014	resp, err := client.GetDataLossProgressSender(req)
7015	if err != nil {
7016		result.Response = autorest.Response{Response: resp}
7017		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", resp, "Failure sending request")
7018		return
7019	}
7020
7021	result, err = client.GetDataLossProgressResponder(resp)
7022	if err != nil {
7023		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", resp, "Failure responding to request")
7024		return
7025	}
7026
7027	return
7028}
7029
7030// GetDataLossProgressPreparer prepares the GetDataLossProgress request.
7031func (client BaseClient) GetDataLossProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) {
7032	pathParameters := map[string]interface{}{
7033		"partitionId": partitionID,
7034		"serviceId":   serviceID,
7035	}
7036
7037	const APIVersion = "6.0"
7038	queryParameters := map[string]interface{}{
7039		"api-version": APIVersion,
7040		"OperationId": autorest.Encode("query", operationID),
7041	}
7042	if timeout != nil {
7043		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7044	} else {
7045		queryParameters["timeout"] = autorest.Encode("query", 60)
7046	}
7047
7048	preparer := autorest.CreatePreparer(
7049		autorest.AsGet(),
7050		autorest.WithBaseURL(client.BaseURI),
7051		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetDataLossProgress", pathParameters),
7052		autorest.WithQueryParameters(queryParameters))
7053	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7054}
7055
7056// GetDataLossProgressSender sends the GetDataLossProgress request. The method will close the
7057// http.Response Body if it receives an error.
7058func (client BaseClient) GetDataLossProgressSender(req *http.Request) (*http.Response, error) {
7059	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7060}
7061
7062// GetDataLossProgressResponder handles the response to the GetDataLossProgress request. The method always
7063// closes the http.Response Body.
7064func (client BaseClient) GetDataLossProgressResponder(resp *http.Response) (result PartitionDataLossProgress, err error) {
7065	err = autorest.Respond(
7066		resp,
7067		azure.WithErrorUnlessStatusCode(http.StatusOK),
7068		autorest.ByUnmarshallingJSON(&result),
7069		autorest.ByClosing())
7070	result.Response = autorest.Response{Response: resp}
7071	return
7072}
7073
7074// GetDeployedApplicationHealth gets the information about health of an application deployed on a Service Fabric node.
7075// Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed
7076// application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for
7077// DeployedServicePackageHealth children based on health state.
7078// Parameters:
7079// nodeName - the name of the node.
7080// applicationID - the identity of the application. This is typically the full name of the application without
7081// the 'fabric:' URI scheme.
7082// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7083// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7084// in 6.0+ and "myapp/app1" in previous versions.
7085// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
7086// state.
7087// The possible values for this parameter include integer value of one of the following health states.
7088// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
7089// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
7090// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
7091// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
7092//
7093// - Default - Default value. Matches any HealthState. The value is zero.
7094// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7095// collection of states. The value is 1.
7096// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7097// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7098// - Error - Filter that matches input with HealthState value Error. The value is 8.
7099// - All - Filter that matches input with any HealthState value. The value is 65535.
7100// deployedServicePackagesHealthStateFilter - allows filtering of the deployed service package health state
7101// objects returned in the result of deployed application health query based on their health state.
7102// The possible values for this parameter include integer value of one of the following health states.
7103// Only deployed service packages that match the filter are returned. All deployed service packages are used to
7104// evaluate the aggregated health state of the deployed application.
7105// If not specified, all entries are returned.
7106// The state values are flag based enumeration, so the value can be a combination of these value obtained using
7107// bitwise 'OR' operator.
7108// For example, if the provided value is 6 then health state of service packages with HealthState value of OK
7109// (2) and Warning (4) are returned.
7110//
7111// - Default - Default value. Matches any HealthState. The value is zero.
7112// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7113// collection of states. The value is 1.
7114// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7115// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7116// - Error - Filter that matches input with HealthState value Error. The value is 8.
7117// - All - Filter that matches input with any HealthState value. The value is 65535.
7118// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
7119// result. False by default.
7120// The statistics show the number of children entities in health state Ok, Warning, and Error.
7121// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7122// duration that the client is willing to wait for the requested operation to complete. The default value for
7123// this parameter is 60 seconds.
7124func (client BaseClient) GetDeployedApplicationHealth(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result DeployedApplicationHealth, err error) {
7125	if tracing.IsEnabled() {
7126		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationHealth")
7127		defer func() {
7128			sc := -1
7129			if result.Response.Response != nil {
7130				sc = result.Response.Response.StatusCode
7131			}
7132			tracing.EndSpan(ctx, sc, err)
7133		}()
7134	}
7135	if err := validation.Validate([]validation.Validation{
7136		{TargetValue: timeout,
7137			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7138				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7139					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7140				}}}}}); err != nil {
7141		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealth", err.Error())
7142	}
7143
7144	req, err := client.GetDeployedApplicationHealthPreparer(ctx, nodeName, applicationID, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, excludeHealthStatistics, timeout)
7145	if err != nil {
7146		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", nil, "Failure preparing request")
7147		return
7148	}
7149
7150	resp, err := client.GetDeployedApplicationHealthSender(req)
7151	if err != nil {
7152		result.Response = autorest.Response{Response: resp}
7153		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", resp, "Failure sending request")
7154		return
7155	}
7156
7157	result, err = client.GetDeployedApplicationHealthResponder(resp)
7158	if err != nil {
7159		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", resp, "Failure responding to request")
7160		return
7161	}
7162
7163	return
7164}
7165
7166// GetDeployedApplicationHealthPreparer prepares the GetDeployedApplicationHealth request.
7167func (client BaseClient) GetDeployedApplicationHealthPreparer(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
7168	pathParameters := map[string]interface{}{
7169		"applicationId": applicationID,
7170		"nodeName":      autorest.Encode("path", nodeName),
7171	}
7172
7173	const APIVersion = "6.0"
7174	queryParameters := map[string]interface{}{
7175		"api-version": APIVersion,
7176	}
7177	if eventsHealthStateFilter != nil {
7178		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
7179	} else {
7180		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
7181	}
7182	if deployedServicePackagesHealthStateFilter != nil {
7183		queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", *deployedServicePackagesHealthStateFilter)
7184	} else {
7185		queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", 0)
7186	}
7187	if excludeHealthStatistics != nil {
7188		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
7189	} else {
7190		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
7191	}
7192	if timeout != nil {
7193		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7194	} else {
7195		queryParameters["timeout"] = autorest.Encode("query", 60)
7196	}
7197
7198	preparer := autorest.CreatePreparer(
7199		autorest.AsGet(),
7200		autorest.WithBaseURL(client.BaseURI),
7201		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetHealth", pathParameters),
7202		autorest.WithQueryParameters(queryParameters))
7203	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7204}
7205
7206// GetDeployedApplicationHealthSender sends the GetDeployedApplicationHealth request. The method will close the
7207// http.Response Body if it receives an error.
7208func (client BaseClient) GetDeployedApplicationHealthSender(req *http.Request) (*http.Response, error) {
7209	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7210}
7211
7212// GetDeployedApplicationHealthResponder handles the response to the GetDeployedApplicationHealth request. The method always
7213// closes the http.Response Body.
7214func (client BaseClient) GetDeployedApplicationHealthResponder(resp *http.Response) (result DeployedApplicationHealth, err error) {
7215	err = autorest.Respond(
7216		resp,
7217		azure.WithErrorUnlessStatusCode(http.StatusOK),
7218		autorest.ByUnmarshallingJSON(&result),
7219		autorest.ByClosing())
7220	result.Response = autorest.Response{Response: resp}
7221	return
7222}
7223
7224// GetDeployedApplicationHealthUsingPolicy gets the information about health of an application deployed on a Service
7225// Fabric node using the specified policy. Use EventsHealthStateFilter to optionally filter for the collection of
7226// HealthEvent objects reported on the deployed application based on health state. Use
7227// DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on
7228// health state. Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health.
7229// This API only uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored
7230// while evaluating the health of the deployed application.
7231// Parameters:
7232// nodeName - the name of the node.
7233// applicationID - the identity of the application. This is typically the full name of the application without
7234// the 'fabric:' URI scheme.
7235// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7236// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7237// in 6.0+ and "myapp/app1" in previous versions.
7238// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
7239// state.
7240// The possible values for this parameter include integer value of one of the following health states.
7241// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
7242// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
7243// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
7244// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
7245//
7246// - Default - Default value. Matches any HealthState. The value is zero.
7247// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7248// collection of states. The value is 1.
7249// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7250// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7251// - Error - Filter that matches input with HealthState value Error. The value is 8.
7252// - All - Filter that matches input with any HealthState value. The value is 65535.
7253// deployedServicePackagesHealthStateFilter - allows filtering of the deployed service package health state
7254// objects returned in the result of deployed application health query based on their health state.
7255// The possible values for this parameter include integer value of one of the following health states.
7256// Only deployed service packages that match the filter are returned. All deployed service packages are used to
7257// evaluate the aggregated health state of the deployed application.
7258// If not specified, all entries are returned.
7259// The state values are flag based enumeration, so the value can be a combination of these value obtained using
7260// bitwise 'OR' operator.
7261// For example, if the provided value is 6 then health state of service packages with HealthState value of OK
7262// (2) and Warning (4) are returned.
7263//
7264// - Default - Default value. Matches any HealthState. The value is zero.
7265// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7266// collection of states. The value is 1.
7267// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7268// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7269// - Error - Filter that matches input with HealthState value Error. The value is 8.
7270// - All - Filter that matches input with any HealthState value. The value is 65535.
7271// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
7272// of its children.
7273// If not present, the health evaluation uses the health policy from application manifest or the default health
7274// policy.
7275// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
7276// result. False by default.
7277// The statistics show the number of children entities in health state Ok, Warning, and Error.
7278// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7279// duration that the client is willing to wait for the requested operation to complete. The default value for
7280// this parameter is 60 seconds.
7281func (client BaseClient) GetDeployedApplicationHealthUsingPolicy(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result DeployedApplicationHealth, err error) {
7282	if tracing.IsEnabled() {
7283		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationHealthUsingPolicy")
7284		defer func() {
7285			sc := -1
7286			if result.Response.Response != nil {
7287				sc = result.Response.Response.StatusCode
7288			}
7289			tracing.EndSpan(ctx, sc, err)
7290		}()
7291	}
7292	if err := validation.Validate([]validation.Validation{
7293		{TargetValue: timeout,
7294			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7295				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7296					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7297				}}}}}); err != nil {
7298		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", err.Error())
7299	}
7300
7301	req, err := client.GetDeployedApplicationHealthUsingPolicyPreparer(ctx, nodeName, applicationID, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout)
7302	if err != nil {
7303		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", nil, "Failure preparing request")
7304		return
7305	}
7306
7307	resp, err := client.GetDeployedApplicationHealthUsingPolicySender(req)
7308	if err != nil {
7309		result.Response = autorest.Response{Response: resp}
7310		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", resp, "Failure sending request")
7311		return
7312	}
7313
7314	result, err = client.GetDeployedApplicationHealthUsingPolicyResponder(resp)
7315	if err != nil {
7316		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", resp, "Failure responding to request")
7317		return
7318	}
7319
7320	return
7321}
7322
7323// GetDeployedApplicationHealthUsingPolicyPreparer prepares the GetDeployedApplicationHealthUsingPolicy request.
7324func (client BaseClient) GetDeployedApplicationHealthUsingPolicyPreparer(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
7325	pathParameters := map[string]interface{}{
7326		"applicationId": applicationID,
7327		"nodeName":      autorest.Encode("path", nodeName),
7328	}
7329
7330	const APIVersion = "6.0"
7331	queryParameters := map[string]interface{}{
7332		"api-version": APIVersion,
7333	}
7334	if eventsHealthStateFilter != nil {
7335		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
7336	} else {
7337		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
7338	}
7339	if deployedServicePackagesHealthStateFilter != nil {
7340		queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", *deployedServicePackagesHealthStateFilter)
7341	} else {
7342		queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", 0)
7343	}
7344	if excludeHealthStatistics != nil {
7345		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
7346	} else {
7347		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
7348	}
7349	if timeout != nil {
7350		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7351	} else {
7352		queryParameters["timeout"] = autorest.Encode("query", 60)
7353	}
7354
7355	preparer := autorest.CreatePreparer(
7356		autorest.AsContentType("application/json; charset=utf-8"),
7357		autorest.AsPost(),
7358		autorest.WithBaseURL(client.BaseURI),
7359		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetHealth", pathParameters),
7360		autorest.WithQueryParameters(queryParameters))
7361	if applicationHealthPolicy != nil {
7362		preparer = autorest.DecoratePreparer(preparer,
7363			autorest.WithJSON(applicationHealthPolicy))
7364	}
7365	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7366}
7367
7368// GetDeployedApplicationHealthUsingPolicySender sends the GetDeployedApplicationHealthUsingPolicy request. The method will close the
7369// http.Response Body if it receives an error.
7370func (client BaseClient) GetDeployedApplicationHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
7371	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7372}
7373
7374// GetDeployedApplicationHealthUsingPolicyResponder handles the response to the GetDeployedApplicationHealthUsingPolicy request. The method always
7375// closes the http.Response Body.
7376func (client BaseClient) GetDeployedApplicationHealthUsingPolicyResponder(resp *http.Response) (result DeployedApplicationHealth, err error) {
7377	err = autorest.Respond(
7378		resp,
7379		azure.WithErrorUnlessStatusCode(http.StatusOK),
7380		autorest.ByUnmarshallingJSON(&result),
7381		autorest.ByClosing())
7382	result.Response = autorest.Response{Response: resp}
7383	return
7384}
7385
7386// GetDeployedApplicationInfo gets the information about an application deployed on a Service Fabric node.  This query
7387// returns system application information if the application ID provided is for system application. Results encompass
7388// deployed applications in active, activating, and downloading states. This query requires that the node name
7389// corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service
7390// Fabric nodes on the cluster.
7391// Parameters:
7392// nodeName - the name of the node.
7393// applicationID - the identity of the application. This is typically the full name of the application without
7394// the 'fabric:' URI scheme.
7395// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7396// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7397// in 6.0+ and "myapp/app1" in previous versions.
7398// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7399// duration that the client is willing to wait for the requested operation to complete. The default value for
7400// this parameter is 60 seconds.
7401// includeHealthState - include the health state of an entity.
7402// If this parameter is false or not specified, then the health state returned is "Unknown".
7403// When set to true, the query goes in parallel to the node and the health system service before the results
7404// are merged.
7405// As a result, the query is more expensive and may take a longer time.
7406func (client BaseClient) GetDeployedApplicationInfo(ctx context.Context, nodeName string, applicationID string, timeout *int64, includeHealthState *bool) (result DeployedApplicationInfo, err error) {
7407	if tracing.IsEnabled() {
7408		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationInfo")
7409		defer func() {
7410			sc := -1
7411			if result.Response.Response != nil {
7412				sc = result.Response.Response.StatusCode
7413			}
7414			tracing.EndSpan(ctx, sc, err)
7415		}()
7416	}
7417	if err := validation.Validate([]validation.Validation{
7418		{TargetValue: timeout,
7419			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7420				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7421					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7422				}}}}}); err != nil {
7423		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfo", err.Error())
7424	}
7425
7426	req, err := client.GetDeployedApplicationInfoPreparer(ctx, nodeName, applicationID, timeout, includeHealthState)
7427	if err != nil {
7428		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", nil, "Failure preparing request")
7429		return
7430	}
7431
7432	resp, err := client.GetDeployedApplicationInfoSender(req)
7433	if err != nil {
7434		result.Response = autorest.Response{Response: resp}
7435		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", resp, "Failure sending request")
7436		return
7437	}
7438
7439	result, err = client.GetDeployedApplicationInfoResponder(resp)
7440	if err != nil {
7441		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", resp, "Failure responding to request")
7442		return
7443	}
7444
7445	return
7446}
7447
7448// GetDeployedApplicationInfoPreparer prepares the GetDeployedApplicationInfo request.
7449func (client BaseClient) GetDeployedApplicationInfoPreparer(ctx context.Context, nodeName string, applicationID string, timeout *int64, includeHealthState *bool) (*http.Request, error) {
7450	pathParameters := map[string]interface{}{
7451		"applicationId": applicationID,
7452		"nodeName":      autorest.Encode("path", nodeName),
7453	}
7454
7455	const APIVersion = "6.1"
7456	queryParameters := map[string]interface{}{
7457		"api-version": APIVersion,
7458	}
7459	if timeout != nil {
7460		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7461	} else {
7462		queryParameters["timeout"] = autorest.Encode("query", 60)
7463	}
7464	if includeHealthState != nil {
7465		queryParameters["IncludeHealthState"] = autorest.Encode("query", *includeHealthState)
7466	} else {
7467		queryParameters["IncludeHealthState"] = autorest.Encode("query", false)
7468	}
7469
7470	preparer := autorest.CreatePreparer(
7471		autorest.AsGet(),
7472		autorest.WithBaseURL(client.BaseURI),
7473		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}", pathParameters),
7474		autorest.WithQueryParameters(queryParameters))
7475	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7476}
7477
7478// GetDeployedApplicationInfoSender sends the GetDeployedApplicationInfo request. The method will close the
7479// http.Response Body if it receives an error.
7480func (client BaseClient) GetDeployedApplicationInfoSender(req *http.Request) (*http.Response, error) {
7481	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7482}
7483
7484// GetDeployedApplicationInfoResponder handles the response to the GetDeployedApplicationInfo request. The method always
7485// closes the http.Response Body.
7486func (client BaseClient) GetDeployedApplicationInfoResponder(resp *http.Response) (result DeployedApplicationInfo, err error) {
7487	err = autorest.Respond(
7488		resp,
7489		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
7490		autorest.ByUnmarshallingJSON(&result),
7491		autorest.ByClosing())
7492	result.Response = autorest.Response{Response: resp}
7493	return
7494}
7495
7496// GetDeployedApplicationInfoList gets the list of applications deployed on a Service Fabric node. The results do not
7497// include information about deployed system applications unless explicitly queried for by ID. Results encompass
7498// deployed applications in active, activating, and downloading states. This query requires that the node name
7499// corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service
7500// Fabric nodes on the cluster.
7501// Parameters:
7502// nodeName - the name of the node.
7503// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7504// duration that the client is willing to wait for the requested operation to complete. The default value for
7505// this parameter is 60 seconds.
7506// includeHealthState - include the health state of an entity.
7507// If this parameter is false or not specified, then the health state returned is "Unknown".
7508// When set to true, the query goes in parallel to the node and the health system service before the results
7509// are merged.
7510// As a result, the query is more expensive and may take a longer time.
7511// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
7512// token with a non empty value is included in the response of the API when the results from the system do not
7513// fit in a single response. When this value is passed to the next API call, the API returns next set of
7514// results. If there are no further results then the continuation token does not contain a value. The value of
7515// this parameter should not be URL encoded.
7516// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
7517// defines the upper bound on the number of results returned. The results returned can be less than the
7518// specified maximum results if they do not fit in the message as per the max message size restrictions defined
7519// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
7520// as possible that fit in the return message.
7521func (client BaseClient) GetDeployedApplicationInfoList(ctx context.Context, nodeName string, timeout *int64, includeHealthState *bool, continuationToken string, maxResults *int64) (result PagedDeployedApplicationInfoList, err error) {
7522	if tracing.IsEnabled() {
7523		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationInfoList")
7524		defer func() {
7525			sc := -1
7526			if result.Response.Response != nil {
7527				sc = result.Response.Response.StatusCode
7528			}
7529			tracing.EndSpan(ctx, sc, err)
7530		}()
7531	}
7532	if err := validation.Validate([]validation.Validation{
7533		{TargetValue: timeout,
7534			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7535				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7536					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7537				}}}},
7538		{TargetValue: maxResults,
7539			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
7540				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil {
7541		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfoList", err.Error())
7542	}
7543
7544	req, err := client.GetDeployedApplicationInfoListPreparer(ctx, nodeName, timeout, includeHealthState, continuationToken, maxResults)
7545	if err != nil {
7546		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", nil, "Failure preparing request")
7547		return
7548	}
7549
7550	resp, err := client.GetDeployedApplicationInfoListSender(req)
7551	if err != nil {
7552		result.Response = autorest.Response{Response: resp}
7553		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", resp, "Failure sending request")
7554		return
7555	}
7556
7557	result, err = client.GetDeployedApplicationInfoListResponder(resp)
7558	if err != nil {
7559		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", resp, "Failure responding to request")
7560		return
7561	}
7562
7563	return
7564}
7565
7566// GetDeployedApplicationInfoListPreparer prepares the GetDeployedApplicationInfoList request.
7567func (client BaseClient) GetDeployedApplicationInfoListPreparer(ctx context.Context, nodeName string, timeout *int64, includeHealthState *bool, continuationToken string, maxResults *int64) (*http.Request, error) {
7568	pathParameters := map[string]interface{}{
7569		"nodeName": autorest.Encode("path", nodeName),
7570	}
7571
7572	const APIVersion = "6.1"
7573	queryParameters := map[string]interface{}{
7574		"api-version": APIVersion,
7575	}
7576	if timeout != nil {
7577		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7578	} else {
7579		queryParameters["timeout"] = autorest.Encode("query", 60)
7580	}
7581	if includeHealthState != nil {
7582		queryParameters["IncludeHealthState"] = autorest.Encode("query", *includeHealthState)
7583	} else {
7584		queryParameters["IncludeHealthState"] = autorest.Encode("query", false)
7585	}
7586	if len(continuationToken) > 0 {
7587		queryParameters["ContinuationToken"] = continuationToken
7588	}
7589	if maxResults != nil {
7590		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
7591	} else {
7592		queryParameters["MaxResults"] = autorest.Encode("query", 0)
7593	}
7594
7595	preparer := autorest.CreatePreparer(
7596		autorest.AsGet(),
7597		autorest.WithBaseURL(client.BaseURI),
7598		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications", pathParameters),
7599		autorest.WithQueryParameters(queryParameters))
7600	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7601}
7602
7603// GetDeployedApplicationInfoListSender sends the GetDeployedApplicationInfoList request. The method will close the
7604// http.Response Body if it receives an error.
7605func (client BaseClient) GetDeployedApplicationInfoListSender(req *http.Request) (*http.Response, error) {
7606	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7607}
7608
7609// GetDeployedApplicationInfoListResponder handles the response to the GetDeployedApplicationInfoList request. The method always
7610// closes the http.Response Body.
7611func (client BaseClient) GetDeployedApplicationInfoListResponder(resp *http.Response) (result PagedDeployedApplicationInfoList, err error) {
7612	err = autorest.Respond(
7613		resp,
7614		azure.WithErrorUnlessStatusCode(http.StatusOK),
7615		autorest.ByUnmarshallingJSON(&result),
7616		autorest.ByClosing())
7617	result.Response = autorest.Response{Response: resp}
7618	return
7619}
7620
7621// GetDeployedCodePackageInfoList gets the list of code packages deployed on a Service Fabric node for the given
7622// application.
7623// Parameters:
7624// nodeName - the name of the node.
7625// applicationID - the identity of the application. This is typically the full name of the application without
7626// the 'fabric:' URI scheme.
7627// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7628// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7629// in 6.0+ and "myapp/app1" in previous versions.
7630// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
7631// Fabric cluster.
7632// codePackageName - the name of code package specified in service manifest registered as part of an
7633// application type in a Service Fabric cluster.
7634// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7635// duration that the client is willing to wait for the requested operation to complete. The default value for
7636// this parameter is 60 seconds.
7637func (client BaseClient) GetDeployedCodePackageInfoList(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, timeout *int64) (result ListDeployedCodePackageInfo, err error) {
7638	if tracing.IsEnabled() {
7639		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedCodePackageInfoList")
7640		defer func() {
7641			sc := -1
7642			if result.Response.Response != nil {
7643				sc = result.Response.Response.StatusCode
7644			}
7645			tracing.EndSpan(ctx, sc, err)
7646		}()
7647	}
7648	if err := validation.Validate([]validation.Validation{
7649		{TargetValue: timeout,
7650			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7651				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7652					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7653				}}}}}); err != nil {
7654		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedCodePackageInfoList", err.Error())
7655	}
7656
7657	req, err := client.GetDeployedCodePackageInfoListPreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, timeout)
7658	if err != nil {
7659		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", nil, "Failure preparing request")
7660		return
7661	}
7662
7663	resp, err := client.GetDeployedCodePackageInfoListSender(req)
7664	if err != nil {
7665		result.Response = autorest.Response{Response: resp}
7666		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", resp, "Failure sending request")
7667		return
7668	}
7669
7670	result, err = client.GetDeployedCodePackageInfoListResponder(resp)
7671	if err != nil {
7672		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", resp, "Failure responding to request")
7673		return
7674	}
7675
7676	return
7677}
7678
7679// GetDeployedCodePackageInfoListPreparer prepares the GetDeployedCodePackageInfoList request.
7680func (client BaseClient) GetDeployedCodePackageInfoListPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, timeout *int64) (*http.Request, error) {
7681	pathParameters := map[string]interface{}{
7682		"applicationId": applicationID,
7683		"nodeName":      autorest.Encode("path", nodeName),
7684	}
7685
7686	const APIVersion = "6.0"
7687	queryParameters := map[string]interface{}{
7688		"api-version": APIVersion,
7689	}
7690	if len(serviceManifestName) > 0 {
7691		queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName)
7692	}
7693	if len(codePackageName) > 0 {
7694		queryParameters["CodePackageName"] = autorest.Encode("query", codePackageName)
7695	}
7696	if timeout != nil {
7697		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7698	} else {
7699		queryParameters["timeout"] = autorest.Encode("query", 60)
7700	}
7701
7702	preparer := autorest.CreatePreparer(
7703		autorest.AsGet(),
7704		autorest.WithBaseURL(client.BaseURI),
7705		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages", pathParameters),
7706		autorest.WithQueryParameters(queryParameters))
7707	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7708}
7709
7710// GetDeployedCodePackageInfoListSender sends the GetDeployedCodePackageInfoList request. The method will close the
7711// http.Response Body if it receives an error.
7712func (client BaseClient) GetDeployedCodePackageInfoListSender(req *http.Request) (*http.Response, error) {
7713	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7714}
7715
7716// GetDeployedCodePackageInfoListResponder handles the response to the GetDeployedCodePackageInfoList request. The method always
7717// closes the http.Response Body.
7718func (client BaseClient) GetDeployedCodePackageInfoListResponder(resp *http.Response) (result ListDeployedCodePackageInfo, err error) {
7719	err = autorest.Respond(
7720		resp,
7721		azure.WithErrorUnlessStatusCode(http.StatusOK),
7722		autorest.ByUnmarshallingJSON(&result.Value),
7723		autorest.ByClosing())
7724	result.Response = autorest.Response{Response: resp}
7725	return
7726}
7727
7728// GetDeployedServicePackageHealth gets the information about health of service package for a specific application
7729// deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of
7730// HealthEvent objects reported on the deployed service package based on health state.
7731// Parameters:
7732// nodeName - the name of the node.
7733// applicationID - the identity of the application. This is typically the full name of the application without
7734// the 'fabric:' URI scheme.
7735// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7736// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7737// in 6.0+ and "myapp/app1" in previous versions.
7738// servicePackageName - the name of the service package.
7739// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
7740// state.
7741// The possible values for this parameter include integer value of one of the following health states.
7742// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
7743// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
7744// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
7745// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
7746//
7747// - Default - Default value. Matches any HealthState. The value is zero.
7748// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7749// collection of states. The value is 1.
7750// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7751// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7752// - Error - Filter that matches input with HealthState value Error. The value is 8.
7753// - All - Filter that matches input with any HealthState value. The value is 65535.
7754// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7755// duration that the client is willing to wait for the requested operation to complete. The default value for
7756// this parameter is 60 seconds.
7757func (client BaseClient) GetDeployedServicePackageHealth(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, timeout *int64) (result DeployedServicePackageHealth, err error) {
7758	if tracing.IsEnabled() {
7759		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageHealth")
7760		defer func() {
7761			sc := -1
7762			if result.Response.Response != nil {
7763				sc = result.Response.Response.StatusCode
7764			}
7765			tracing.EndSpan(ctx, sc, err)
7766		}()
7767	}
7768	if err := validation.Validate([]validation.Validation{
7769		{TargetValue: timeout,
7770			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7771				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7772					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7773				}}}}}); err != nil {
7774		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealth", err.Error())
7775	}
7776
7777	req, err := client.GetDeployedServicePackageHealthPreparer(ctx, nodeName, applicationID, servicePackageName, eventsHealthStateFilter, timeout)
7778	if err != nil {
7779		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", nil, "Failure preparing request")
7780		return
7781	}
7782
7783	resp, err := client.GetDeployedServicePackageHealthSender(req)
7784	if err != nil {
7785		result.Response = autorest.Response{Response: resp}
7786		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", resp, "Failure sending request")
7787		return
7788	}
7789
7790	result, err = client.GetDeployedServicePackageHealthResponder(resp)
7791	if err != nil {
7792		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", resp, "Failure responding to request")
7793		return
7794	}
7795
7796	return
7797}
7798
7799// GetDeployedServicePackageHealthPreparer prepares the GetDeployedServicePackageHealth request.
7800func (client BaseClient) GetDeployedServicePackageHealthPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) {
7801	pathParameters := map[string]interface{}{
7802		"applicationId":      applicationID,
7803		"nodeName":           autorest.Encode("path", nodeName),
7804		"servicePackageName": servicePackageName,
7805	}
7806
7807	const APIVersion = "6.0"
7808	queryParameters := map[string]interface{}{
7809		"api-version": APIVersion,
7810	}
7811	if eventsHealthStateFilter != nil {
7812		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
7813	} else {
7814		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
7815	}
7816	if timeout != nil {
7817		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7818	} else {
7819		queryParameters["timeout"] = autorest.Encode("query", 60)
7820	}
7821
7822	preparer := autorest.CreatePreparer(
7823		autorest.AsGet(),
7824		autorest.WithBaseURL(client.BaseURI),
7825		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/GetHealth", pathParameters),
7826		autorest.WithQueryParameters(queryParameters))
7827	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7828}
7829
7830// GetDeployedServicePackageHealthSender sends the GetDeployedServicePackageHealth request. The method will close the
7831// http.Response Body if it receives an error.
7832func (client BaseClient) GetDeployedServicePackageHealthSender(req *http.Request) (*http.Response, error) {
7833	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7834}
7835
7836// GetDeployedServicePackageHealthResponder handles the response to the GetDeployedServicePackageHealth request. The method always
7837// closes the http.Response Body.
7838func (client BaseClient) GetDeployedServicePackageHealthResponder(resp *http.Response) (result DeployedServicePackageHealth, err error) {
7839	err = autorest.Respond(
7840		resp,
7841		azure.WithErrorUnlessStatusCode(http.StatusOK),
7842		autorest.ByUnmarshallingJSON(&result),
7843		autorest.ByClosing())
7844	result.Response = autorest.Response{Response: resp}
7845	return
7846}
7847
7848// GetDeployedServicePackageHealthUsingPolicy gets the information about health of an service package for a specific
7849// application deployed on a Service Fabric node. using the specified policy. Use EventsHealthStateFilter to optionally
7850// filter for the collection of HealthEvent objects reported on the deployed service package based on health state. Use
7851// ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only uses
7852// 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while evaluating
7853// the health of the deployed service package.
7854// Parameters:
7855// nodeName - the name of the node.
7856// applicationID - the identity of the application. This is typically the full name of the application without
7857// the 'fabric:' URI scheme.
7858// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7859// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7860// in 6.0+ and "myapp/app1" in previous versions.
7861// servicePackageName - the name of the service package.
7862// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
7863// state.
7864// The possible values for this parameter include integer value of one of the following health states.
7865// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
7866// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
7867// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
7868// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
7869//
7870// - Default - Default value. Matches any HealthState. The value is zero.
7871// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7872// collection of states. The value is 1.
7873// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7874// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7875// - Error - Filter that matches input with HealthState value Error. The value is 8.
7876// - All - Filter that matches input with any HealthState value. The value is 65535.
7877// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
7878// of its children.
7879// If not present, the health evaluation uses the health policy from application manifest or the default health
7880// policy.
7881// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7882// duration that the client is willing to wait for the requested operation to complete. The default value for
7883// this parameter is 60 seconds.
7884func (client BaseClient) GetDeployedServicePackageHealthUsingPolicy(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result DeployedServicePackageHealth, err error) {
7885	if tracing.IsEnabled() {
7886		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageHealthUsingPolicy")
7887		defer func() {
7888			sc := -1
7889			if result.Response.Response != nil {
7890				sc = result.Response.Response.StatusCode
7891			}
7892			tracing.EndSpan(ctx, sc, err)
7893		}()
7894	}
7895	if err := validation.Validate([]validation.Validation{
7896		{TargetValue: timeout,
7897			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7898				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7899					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7900				}}}}}); err != nil {
7901		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", err.Error())
7902	}
7903
7904	req, err := client.GetDeployedServicePackageHealthUsingPolicyPreparer(ctx, nodeName, applicationID, servicePackageName, eventsHealthStateFilter, applicationHealthPolicy, timeout)
7905	if err != nil {
7906		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", nil, "Failure preparing request")
7907		return
7908	}
7909
7910	resp, err := client.GetDeployedServicePackageHealthUsingPolicySender(req)
7911	if err != nil {
7912		result.Response = autorest.Response{Response: resp}
7913		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", resp, "Failure sending request")
7914		return
7915	}
7916
7917	result, err = client.GetDeployedServicePackageHealthUsingPolicyResponder(resp)
7918	if err != nil {
7919		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", resp, "Failure responding to request")
7920		return
7921	}
7922
7923	return
7924}
7925
7926// GetDeployedServicePackageHealthUsingPolicyPreparer prepares the GetDeployedServicePackageHealthUsingPolicy request.
7927func (client BaseClient) GetDeployedServicePackageHealthUsingPolicyPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) {
7928	pathParameters := map[string]interface{}{
7929		"applicationId":      applicationID,
7930		"nodeName":           autorest.Encode("path", nodeName),
7931		"servicePackageName": servicePackageName,
7932	}
7933
7934	const APIVersion = "6.0"
7935	queryParameters := map[string]interface{}{
7936		"api-version": APIVersion,
7937	}
7938	if eventsHealthStateFilter != nil {
7939		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
7940	} else {
7941		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
7942	}
7943	if timeout != nil {
7944		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7945	} else {
7946		queryParameters["timeout"] = autorest.Encode("query", 60)
7947	}
7948
7949	preparer := autorest.CreatePreparer(
7950		autorest.AsContentType("application/json; charset=utf-8"),
7951		autorest.AsPost(),
7952		autorest.WithBaseURL(client.BaseURI),
7953		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/GetHealth", pathParameters),
7954		autorest.WithQueryParameters(queryParameters))
7955	if applicationHealthPolicy != nil {
7956		preparer = autorest.DecoratePreparer(preparer,
7957			autorest.WithJSON(applicationHealthPolicy))
7958	}
7959	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7960}
7961
7962// GetDeployedServicePackageHealthUsingPolicySender sends the GetDeployedServicePackageHealthUsingPolicy request. The method will close the
7963// http.Response Body if it receives an error.
7964func (client BaseClient) GetDeployedServicePackageHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
7965	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7966}
7967
7968// GetDeployedServicePackageHealthUsingPolicyResponder handles the response to the GetDeployedServicePackageHealthUsingPolicy request. The method always
7969// closes the http.Response Body.
7970func (client BaseClient) GetDeployedServicePackageHealthUsingPolicyResponder(resp *http.Response) (result DeployedServicePackageHealth, err error) {
7971	err = autorest.Respond(
7972		resp,
7973		azure.WithErrorUnlessStatusCode(http.StatusOK),
7974		autorest.ByUnmarshallingJSON(&result),
7975		autorest.ByClosing())
7976	result.Response = autorest.Response{Response: resp}
7977	return
7978}
7979
7980// GetDeployedServicePackageInfoList returns the information about the service packages deployed on a Service Fabric
7981// node for the given application.
7982// Parameters:
7983// nodeName - the name of the node.
7984// applicationID - the identity of the application. This is typically the full name of the application without
7985// the 'fabric:' URI scheme.
7986// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7987// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7988// in 6.0+ and "myapp/app1" in previous versions.
7989// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7990// duration that the client is willing to wait for the requested operation to complete. The default value for
7991// this parameter is 60 seconds.
7992func (client BaseClient) GetDeployedServicePackageInfoList(ctx context.Context, nodeName string, applicationID string, timeout *int64) (result ListDeployedServicePackageInfo, err error) {
7993	if tracing.IsEnabled() {
7994		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageInfoList")
7995		defer func() {
7996			sc := -1
7997			if result.Response.Response != nil {
7998				sc = result.Response.Response.StatusCode
7999			}
8000			tracing.EndSpan(ctx, sc, err)
8001		}()
8002	}
8003	if err := validation.Validate([]validation.Validation{
8004		{TargetValue: timeout,
8005			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8006				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8007					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8008				}}}}}); err != nil {
8009		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoList", err.Error())
8010	}
8011
8012	req, err := client.GetDeployedServicePackageInfoListPreparer(ctx, nodeName, applicationID, timeout)
8013	if err != nil {
8014		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", nil, "Failure preparing request")
8015		return
8016	}
8017
8018	resp, err := client.GetDeployedServicePackageInfoListSender(req)
8019	if err != nil {
8020		result.Response = autorest.Response{Response: resp}
8021		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", resp, "Failure sending request")
8022		return
8023	}
8024
8025	result, err = client.GetDeployedServicePackageInfoListResponder(resp)
8026	if err != nil {
8027		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", resp, "Failure responding to request")
8028		return
8029	}
8030
8031	return
8032}
8033
8034// GetDeployedServicePackageInfoListPreparer prepares the GetDeployedServicePackageInfoList request.
8035func (client BaseClient) GetDeployedServicePackageInfoListPreparer(ctx context.Context, nodeName string, applicationID string, timeout *int64) (*http.Request, error) {
8036	pathParameters := map[string]interface{}{
8037		"applicationId": applicationID,
8038		"nodeName":      autorest.Encode("path", nodeName),
8039	}
8040
8041	const APIVersion = "6.0"
8042	queryParameters := map[string]interface{}{
8043		"api-version": APIVersion,
8044	}
8045	if timeout != nil {
8046		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8047	} else {
8048		queryParameters["timeout"] = autorest.Encode("query", 60)
8049	}
8050
8051	preparer := autorest.CreatePreparer(
8052		autorest.AsGet(),
8053		autorest.WithBaseURL(client.BaseURI),
8054		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages", pathParameters),
8055		autorest.WithQueryParameters(queryParameters))
8056	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8057}
8058
8059// GetDeployedServicePackageInfoListSender sends the GetDeployedServicePackageInfoList request. The method will close the
8060// http.Response Body if it receives an error.
8061func (client BaseClient) GetDeployedServicePackageInfoListSender(req *http.Request) (*http.Response, error) {
8062	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8063}
8064
8065// GetDeployedServicePackageInfoListResponder handles the response to the GetDeployedServicePackageInfoList request. The method always
8066// closes the http.Response Body.
8067func (client BaseClient) GetDeployedServicePackageInfoListResponder(resp *http.Response) (result ListDeployedServicePackageInfo, err error) {
8068	err = autorest.Respond(
8069		resp,
8070		azure.WithErrorUnlessStatusCode(http.StatusOK),
8071		autorest.ByUnmarshallingJSON(&result.Value),
8072		autorest.ByClosing())
8073	result.Response = autorest.Response{Response: resp}
8074	return
8075}
8076
8077// GetDeployedServicePackageInfoListByName returns the information about the service packages deployed on a Service
8078// Fabric node for the given application. These results are of service packages whose name match exactly the service
8079// package name specified as the parameter.
8080// Parameters:
8081// nodeName - the name of the node.
8082// applicationID - the identity of the application. This is typically the full name of the application without
8083// the 'fabric:' URI scheme.
8084// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8085// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8086// in 6.0+ and "myapp/app1" in previous versions.
8087// servicePackageName - the name of the service package.
8088// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8089// duration that the client is willing to wait for the requested operation to complete. The default value for
8090// this parameter is 60 seconds.
8091func (client BaseClient) GetDeployedServicePackageInfoListByName(ctx context.Context, nodeName string, applicationID string, servicePackageName string, timeout *int64) (result ListDeployedServicePackageInfo, err error) {
8092	if tracing.IsEnabled() {
8093		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageInfoListByName")
8094		defer func() {
8095			sc := -1
8096			if result.Response.Response != nil {
8097				sc = result.Response.Response.StatusCode
8098			}
8099			tracing.EndSpan(ctx, sc, err)
8100		}()
8101	}
8102	if err := validation.Validate([]validation.Validation{
8103		{TargetValue: timeout,
8104			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8105				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8106					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8107				}}}}}); err != nil {
8108		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", err.Error())
8109	}
8110
8111	req, err := client.GetDeployedServicePackageInfoListByNamePreparer(ctx, nodeName, applicationID, servicePackageName, timeout)
8112	if err != nil {
8113		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", nil, "Failure preparing request")
8114		return
8115	}
8116
8117	resp, err := client.GetDeployedServicePackageInfoListByNameSender(req)
8118	if err != nil {
8119		result.Response = autorest.Response{Response: resp}
8120		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", resp, "Failure sending request")
8121		return
8122	}
8123
8124	result, err = client.GetDeployedServicePackageInfoListByNameResponder(resp)
8125	if err != nil {
8126		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", resp, "Failure responding to request")
8127		return
8128	}
8129
8130	return
8131}
8132
8133// GetDeployedServicePackageInfoListByNamePreparer prepares the GetDeployedServicePackageInfoListByName request.
8134func (client BaseClient) GetDeployedServicePackageInfoListByNamePreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, timeout *int64) (*http.Request, error) {
8135	pathParameters := map[string]interface{}{
8136		"applicationId":      applicationID,
8137		"nodeName":           autorest.Encode("path", nodeName),
8138		"servicePackageName": servicePackageName,
8139	}
8140
8141	const APIVersion = "6.0"
8142	queryParameters := map[string]interface{}{
8143		"api-version": APIVersion,
8144	}
8145	if timeout != nil {
8146		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8147	} else {
8148		queryParameters["timeout"] = autorest.Encode("query", 60)
8149	}
8150
8151	preparer := autorest.CreatePreparer(
8152		autorest.AsGet(),
8153		autorest.WithBaseURL(client.BaseURI),
8154		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}", pathParameters),
8155		autorest.WithQueryParameters(queryParameters))
8156	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8157}
8158
8159// GetDeployedServicePackageInfoListByNameSender sends the GetDeployedServicePackageInfoListByName request. The method will close the
8160// http.Response Body if it receives an error.
8161func (client BaseClient) GetDeployedServicePackageInfoListByNameSender(req *http.Request) (*http.Response, error) {
8162	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8163}
8164
8165// GetDeployedServicePackageInfoListByNameResponder handles the response to the GetDeployedServicePackageInfoListByName request. The method always
8166// closes the http.Response Body.
8167func (client BaseClient) GetDeployedServicePackageInfoListByNameResponder(resp *http.Response) (result ListDeployedServicePackageInfo, err error) {
8168	err = autorest.Respond(
8169		resp,
8170		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
8171		autorest.ByUnmarshallingJSON(&result.Value),
8172		autorest.ByClosing())
8173	result.Response = autorest.Response{Response: resp}
8174	return
8175}
8176
8177// GetDeployedServiceReplicaDetailInfo gets the details of the replica deployed on a Service Fabric node. The
8178// information include service kind, service name, current service operation, current service operation start date
8179// time, partition ID, replica/instance ID, reported load, and other information.
8180// Parameters:
8181// nodeName - the name of the node.
8182// partitionID - the identity of the partition.
8183// replicaID - the identifier of the replica.
8184// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8185// duration that the client is willing to wait for the requested operation to complete. The default value for
8186// this parameter is 60 seconds.
8187func (client BaseClient) GetDeployedServiceReplicaDetailInfo(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (result DeployedServiceReplicaDetailInfoModel, err error) {
8188	if tracing.IsEnabled() {
8189		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaDetailInfo")
8190		defer func() {
8191			sc := -1
8192			if result.Response.Response != nil {
8193				sc = result.Response.Response.StatusCode
8194			}
8195			tracing.EndSpan(ctx, sc, err)
8196		}()
8197	}
8198	if err := validation.Validate([]validation.Validation{
8199		{TargetValue: timeout,
8200			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8201				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8202					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8203				}}}}}); err != nil {
8204		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", err.Error())
8205	}
8206
8207	req, err := client.GetDeployedServiceReplicaDetailInfoPreparer(ctx, nodeName, partitionID, replicaID, timeout)
8208	if err != nil {
8209		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", nil, "Failure preparing request")
8210		return
8211	}
8212
8213	resp, err := client.GetDeployedServiceReplicaDetailInfoSender(req)
8214	if err != nil {
8215		result.Response = autorest.Response{Response: resp}
8216		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", resp, "Failure sending request")
8217		return
8218	}
8219
8220	result, err = client.GetDeployedServiceReplicaDetailInfoResponder(resp)
8221	if err != nil {
8222		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", resp, "Failure responding to request")
8223		return
8224	}
8225
8226	return
8227}
8228
8229// GetDeployedServiceReplicaDetailInfoPreparer prepares the GetDeployedServiceReplicaDetailInfo request.
8230func (client BaseClient) GetDeployedServiceReplicaDetailInfoPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) {
8231	pathParameters := map[string]interface{}{
8232		"nodeName":    autorest.Encode("path", nodeName),
8233		"partitionId": partitionID,
8234		"replicaId":   replicaID,
8235	}
8236
8237	const APIVersion = "6.0"
8238	queryParameters := map[string]interface{}{
8239		"api-version": APIVersion,
8240	}
8241	if timeout != nil {
8242		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8243	} else {
8244		queryParameters["timeout"] = autorest.Encode("query", 60)
8245	}
8246
8247	preparer := autorest.CreatePreparer(
8248		autorest.AsGet(),
8249		autorest.WithBaseURL(client.BaseURI),
8250		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetDetail", pathParameters),
8251		autorest.WithQueryParameters(queryParameters))
8252	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8253}
8254
8255// GetDeployedServiceReplicaDetailInfoSender sends the GetDeployedServiceReplicaDetailInfo request. The method will close the
8256// http.Response Body if it receives an error.
8257func (client BaseClient) GetDeployedServiceReplicaDetailInfoSender(req *http.Request) (*http.Response, error) {
8258	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8259}
8260
8261// GetDeployedServiceReplicaDetailInfoResponder handles the response to the GetDeployedServiceReplicaDetailInfo request. The method always
8262// closes the http.Response Body.
8263func (client BaseClient) GetDeployedServiceReplicaDetailInfoResponder(resp *http.Response) (result DeployedServiceReplicaDetailInfoModel, err error) {
8264	err = autorest.Respond(
8265		resp,
8266		azure.WithErrorUnlessStatusCode(http.StatusOK),
8267		autorest.ByUnmarshallingJSON(&result),
8268		autorest.ByClosing())
8269	result.Response = autorest.Response{Response: resp}
8270	return
8271}
8272
8273// GetDeployedServiceReplicaDetailInfoByPartitionID gets the details of the replica deployed on a Service Fabric node.
8274// The information include service kind, service name, current service operation, current service operation start date
8275// time, partition ID, replica/instance ID, reported load, and other information.
8276// Parameters:
8277// nodeName - the name of the node.
8278// partitionID - the identity of the partition.
8279// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8280// duration that the client is willing to wait for the requested operation to complete. The default value for
8281// this parameter is 60 seconds.
8282func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionID(ctx context.Context, nodeName string, partitionID uuid.UUID, timeout *int64) (result DeployedServiceReplicaDetailInfoModel, err error) {
8283	if tracing.IsEnabled() {
8284		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaDetailInfoByPartitionID")
8285		defer func() {
8286			sc := -1
8287			if result.Response.Response != nil {
8288				sc = result.Response.Response.StatusCode
8289			}
8290			tracing.EndSpan(ctx, sc, err)
8291		}()
8292	}
8293	if err := validation.Validate([]validation.Validation{
8294		{TargetValue: timeout,
8295			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8296				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8297					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8298				}}}}}); err != nil {
8299		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", err.Error())
8300	}
8301
8302	req, err := client.GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer(ctx, nodeName, partitionID, timeout)
8303	if err != nil {
8304		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", nil, "Failure preparing request")
8305		return
8306	}
8307
8308	resp, err := client.GetDeployedServiceReplicaDetailInfoByPartitionIDSender(req)
8309	if err != nil {
8310		result.Response = autorest.Response{Response: resp}
8311		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", resp, "Failure sending request")
8312		return
8313	}
8314
8315	result, err = client.GetDeployedServiceReplicaDetailInfoByPartitionIDResponder(resp)
8316	if err != nil {
8317		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", resp, "Failure responding to request")
8318		return
8319	}
8320
8321	return
8322}
8323
8324// GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer prepares the GetDeployedServiceReplicaDetailInfoByPartitionID request.
8325func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
8326	pathParameters := map[string]interface{}{
8327		"nodeName":    autorest.Encode("path", nodeName),
8328		"partitionId": partitionID,
8329	}
8330
8331	const APIVersion = "6.0"
8332	queryParameters := map[string]interface{}{
8333		"api-version": APIVersion,
8334	}
8335	if timeout != nil {
8336		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8337	} else {
8338		queryParameters["timeout"] = autorest.Encode("query", 60)
8339	}
8340
8341	preparer := autorest.CreatePreparer(
8342		autorest.AsGet(),
8343		autorest.WithBaseURL(client.BaseURI),
8344		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas", pathParameters),
8345		autorest.WithQueryParameters(queryParameters))
8346	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8347}
8348
8349// GetDeployedServiceReplicaDetailInfoByPartitionIDSender sends the GetDeployedServiceReplicaDetailInfoByPartitionID request. The method will close the
8350// http.Response Body if it receives an error.
8351func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDSender(req *http.Request) (*http.Response, error) {
8352	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8353}
8354
8355// GetDeployedServiceReplicaDetailInfoByPartitionIDResponder handles the response to the GetDeployedServiceReplicaDetailInfoByPartitionID request. The method always
8356// closes the http.Response Body.
8357func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDResponder(resp *http.Response) (result DeployedServiceReplicaDetailInfoModel, err error) {
8358	err = autorest.Respond(
8359		resp,
8360		azure.WithErrorUnlessStatusCode(http.StatusOK),
8361		autorest.ByUnmarshallingJSON(&result),
8362		autorest.ByClosing())
8363	result.Response = autorest.Response{Response: resp}
8364	return
8365}
8366
8367// GetDeployedServiceReplicaInfoList gets the list containing the information about replicas deployed on a Service
8368// Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of
8369// the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return
8370// information about the deployed replicas matching the specified values for those parameters.
8371// Parameters:
8372// nodeName - the name of the node.
8373// applicationID - the identity of the application. This is typically the full name of the application without
8374// the 'fabric:' URI scheme.
8375// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8376// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8377// in 6.0+ and "myapp/app1" in previous versions.
8378// partitionID - the identity of the partition.
8379// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
8380// Fabric cluster.
8381// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8382// duration that the client is willing to wait for the requested operation to complete. The default value for
8383// this parameter is 60 seconds.
8384func (client BaseClient) GetDeployedServiceReplicaInfoList(ctx context.Context, nodeName string, applicationID string, partitionID *uuid.UUID, serviceManifestName string, timeout *int64) (result ListDeployedServiceReplicaInfo, err error) {
8385	if tracing.IsEnabled() {
8386		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaInfoList")
8387		defer func() {
8388			sc := -1
8389			if result.Response.Response != nil {
8390				sc = result.Response.Response.StatusCode
8391			}
8392			tracing.EndSpan(ctx, sc, err)
8393		}()
8394	}
8395	if err := validation.Validate([]validation.Validation{
8396		{TargetValue: timeout,
8397			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8398				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8399					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8400				}}}}}); err != nil {
8401		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", err.Error())
8402	}
8403
8404	req, err := client.GetDeployedServiceReplicaInfoListPreparer(ctx, nodeName, applicationID, partitionID, serviceManifestName, timeout)
8405	if err != nil {
8406		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", nil, "Failure preparing request")
8407		return
8408	}
8409
8410	resp, err := client.GetDeployedServiceReplicaInfoListSender(req)
8411	if err != nil {
8412		result.Response = autorest.Response{Response: resp}
8413		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", resp, "Failure sending request")
8414		return
8415	}
8416
8417	result, err = client.GetDeployedServiceReplicaInfoListResponder(resp)
8418	if err != nil {
8419		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", resp, "Failure responding to request")
8420		return
8421	}
8422
8423	return
8424}
8425
8426// GetDeployedServiceReplicaInfoListPreparer prepares the GetDeployedServiceReplicaInfoList request.
8427func (client BaseClient) GetDeployedServiceReplicaInfoListPreparer(ctx context.Context, nodeName string, applicationID string, partitionID *uuid.UUID, serviceManifestName string, timeout *int64) (*http.Request, error) {
8428	pathParameters := map[string]interface{}{
8429		"applicationId": applicationID,
8430		"nodeName":      autorest.Encode("path", nodeName),
8431	}
8432
8433	const APIVersion = "6.0"
8434	queryParameters := map[string]interface{}{
8435		"api-version": APIVersion,
8436	}
8437	if partitionID != nil {
8438		queryParameters["PartitionId"] = autorest.Encode("query", *partitionID)
8439	}
8440	if len(serviceManifestName) > 0 {
8441		queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName)
8442	}
8443	if timeout != nil {
8444		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8445	} else {
8446		queryParameters["timeout"] = autorest.Encode("query", 60)
8447	}
8448
8449	preparer := autorest.CreatePreparer(
8450		autorest.AsGet(),
8451		autorest.WithBaseURL(client.BaseURI),
8452		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetReplicas", pathParameters),
8453		autorest.WithQueryParameters(queryParameters))
8454	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8455}
8456
8457// GetDeployedServiceReplicaInfoListSender sends the GetDeployedServiceReplicaInfoList request. The method will close the
8458// http.Response Body if it receives an error.
8459func (client BaseClient) GetDeployedServiceReplicaInfoListSender(req *http.Request) (*http.Response, error) {
8460	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8461}
8462
8463// GetDeployedServiceReplicaInfoListResponder handles the response to the GetDeployedServiceReplicaInfoList request. The method always
8464// closes the http.Response Body.
8465func (client BaseClient) GetDeployedServiceReplicaInfoListResponder(resp *http.Response) (result ListDeployedServiceReplicaInfo, err error) {
8466	err = autorest.Respond(
8467		resp,
8468		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
8469		autorest.ByUnmarshallingJSON(&result),
8470		autorest.ByClosing())
8471	result.Response = autorest.Response{Response: resp}
8472	return
8473}
8474
8475// GetDeployedServiceTypeInfoByName gets the list containing the information about a specific service type from the
8476// applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its
8477// registration status, the code package that registered it and activation ID of the service package. Each entry
8478// represents one activation of a service type, differentiated by the activation ID.
8479// Parameters:
8480// nodeName - the name of the node.
8481// applicationID - the identity of the application. This is typically the full name of the application without
8482// the 'fabric:' URI scheme.
8483// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8484// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8485// in 6.0+ and "myapp/app1" in previous versions.
8486// serviceTypeName - specifies the name of a Service Fabric service type.
8487// serviceManifestName - the name of the service manifest to filter the list of deployed service type
8488// information. If specified, the response will only contain the information about service types that are
8489// defined in this service manifest.
8490// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8491// duration that the client is willing to wait for the requested operation to complete. The default value for
8492// this parameter is 60 seconds.
8493func (client BaseClient) GetDeployedServiceTypeInfoByName(ctx context.Context, nodeName string, applicationID string, serviceTypeName string, serviceManifestName string, timeout *int64) (result ListDeployedServiceTypeInfo, err error) {
8494	if tracing.IsEnabled() {
8495		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceTypeInfoByName")
8496		defer func() {
8497			sc := -1
8498			if result.Response.Response != nil {
8499				sc = result.Response.Response.StatusCode
8500			}
8501			tracing.EndSpan(ctx, sc, err)
8502		}()
8503	}
8504	if err := validation.Validate([]validation.Validation{
8505		{TargetValue: timeout,
8506			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8507				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8508					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8509				}}}}}); err != nil {
8510		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", err.Error())
8511	}
8512
8513	req, err := client.GetDeployedServiceTypeInfoByNamePreparer(ctx, nodeName, applicationID, serviceTypeName, serviceManifestName, timeout)
8514	if err != nil {
8515		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", nil, "Failure preparing request")
8516		return
8517	}
8518
8519	resp, err := client.GetDeployedServiceTypeInfoByNameSender(req)
8520	if err != nil {
8521		result.Response = autorest.Response{Response: resp}
8522		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", resp, "Failure sending request")
8523		return
8524	}
8525
8526	result, err = client.GetDeployedServiceTypeInfoByNameResponder(resp)
8527	if err != nil {
8528		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", resp, "Failure responding to request")
8529		return
8530	}
8531
8532	return
8533}
8534
8535// GetDeployedServiceTypeInfoByNamePreparer prepares the GetDeployedServiceTypeInfoByName request.
8536func (client BaseClient) GetDeployedServiceTypeInfoByNamePreparer(ctx context.Context, nodeName string, applicationID string, serviceTypeName string, serviceManifestName string, timeout *int64) (*http.Request, error) {
8537	pathParameters := map[string]interface{}{
8538		"applicationId":   applicationID,
8539		"nodeName":        autorest.Encode("path", nodeName),
8540		"serviceTypeName": serviceTypeName,
8541	}
8542
8543	const APIVersion = "6.0"
8544	queryParameters := map[string]interface{}{
8545		"api-version": APIVersion,
8546	}
8547	if len(serviceManifestName) > 0 {
8548		queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName)
8549	}
8550	if timeout != nil {
8551		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8552	} else {
8553		queryParameters["timeout"] = autorest.Encode("query", 60)
8554	}
8555
8556	preparer := autorest.CreatePreparer(
8557		autorest.AsGet(),
8558		autorest.WithBaseURL(client.BaseURI),
8559		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes/{serviceTypeName}", pathParameters),
8560		autorest.WithQueryParameters(queryParameters))
8561	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8562}
8563
8564// GetDeployedServiceTypeInfoByNameSender sends the GetDeployedServiceTypeInfoByName request. The method will close the
8565// http.Response Body if it receives an error.
8566func (client BaseClient) GetDeployedServiceTypeInfoByNameSender(req *http.Request) (*http.Response, error) {
8567	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8568}
8569
8570// GetDeployedServiceTypeInfoByNameResponder handles the response to the GetDeployedServiceTypeInfoByName request. The method always
8571// closes the http.Response Body.
8572func (client BaseClient) GetDeployedServiceTypeInfoByNameResponder(resp *http.Response) (result ListDeployedServiceTypeInfo, err error) {
8573	err = autorest.Respond(
8574		resp,
8575		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
8576		autorest.ByUnmarshallingJSON(&result.Value),
8577		autorest.ByClosing())
8578	result.Response = autorest.Response{Response: resp}
8579	return
8580}
8581
8582// GetDeployedServiceTypeInfoList gets the list containing the information about service types from the applications
8583// deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration
8584// status, the code package that registered it and activation ID of the service package.
8585// Parameters:
8586// nodeName - the name of the node.
8587// applicationID - the identity of the application. This is typically the full name of the application without
8588// the 'fabric:' URI scheme.
8589// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8590// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8591// in 6.0+ and "myapp/app1" in previous versions.
8592// serviceManifestName - the name of the service manifest to filter the list of deployed service type
8593// information. If specified, the response will only contain the information about service types that are
8594// defined in this service manifest.
8595// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8596// duration that the client is willing to wait for the requested operation to complete. The default value for
8597// this parameter is 60 seconds.
8598func (client BaseClient) GetDeployedServiceTypeInfoList(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, timeout *int64) (result ListDeployedServiceTypeInfo, err error) {
8599	if tracing.IsEnabled() {
8600		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceTypeInfoList")
8601		defer func() {
8602			sc := -1
8603			if result.Response.Response != nil {
8604				sc = result.Response.Response.StatusCode
8605			}
8606			tracing.EndSpan(ctx, sc, err)
8607		}()
8608	}
8609	if err := validation.Validate([]validation.Validation{
8610		{TargetValue: timeout,
8611			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8612				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8613					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8614				}}}}}); err != nil {
8615		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", err.Error())
8616	}
8617
8618	req, err := client.GetDeployedServiceTypeInfoListPreparer(ctx, nodeName, applicationID, serviceManifestName, timeout)
8619	if err != nil {
8620		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", nil, "Failure preparing request")
8621		return
8622	}
8623
8624	resp, err := client.GetDeployedServiceTypeInfoListSender(req)
8625	if err != nil {
8626		result.Response = autorest.Response{Response: resp}
8627		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", resp, "Failure sending request")
8628		return
8629	}
8630
8631	result, err = client.GetDeployedServiceTypeInfoListResponder(resp)
8632	if err != nil {
8633		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", resp, "Failure responding to request")
8634		return
8635	}
8636
8637	return
8638}
8639
8640// GetDeployedServiceTypeInfoListPreparer prepares the GetDeployedServiceTypeInfoList request.
8641func (client BaseClient) GetDeployedServiceTypeInfoListPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, timeout *int64) (*http.Request, error) {
8642	pathParameters := map[string]interface{}{
8643		"applicationId": applicationID,
8644		"nodeName":      autorest.Encode("path", nodeName),
8645	}
8646
8647	const APIVersion = "6.0"
8648	queryParameters := map[string]interface{}{
8649		"api-version": APIVersion,
8650	}
8651	if len(serviceManifestName) > 0 {
8652		queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName)
8653	}
8654	if timeout != nil {
8655		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8656	} else {
8657		queryParameters["timeout"] = autorest.Encode("query", 60)
8658	}
8659
8660	preparer := autorest.CreatePreparer(
8661		autorest.AsGet(),
8662		autorest.WithBaseURL(client.BaseURI),
8663		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes", pathParameters),
8664		autorest.WithQueryParameters(queryParameters))
8665	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8666}
8667
8668// GetDeployedServiceTypeInfoListSender sends the GetDeployedServiceTypeInfoList request. The method will close the
8669// http.Response Body if it receives an error.
8670func (client BaseClient) GetDeployedServiceTypeInfoListSender(req *http.Request) (*http.Response, error) {
8671	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8672}
8673
8674// GetDeployedServiceTypeInfoListResponder handles the response to the GetDeployedServiceTypeInfoList request. The method always
8675// closes the http.Response Body.
8676func (client BaseClient) GetDeployedServiceTypeInfoListResponder(resp *http.Response) (result ListDeployedServiceTypeInfo, err error) {
8677	err = autorest.Respond(
8678		resp,
8679		azure.WithErrorUnlessStatusCode(http.StatusOK),
8680		autorest.ByUnmarshallingJSON(&result.Value),
8681		autorest.ByClosing())
8682	result.Response = autorest.Response{Response: resp}
8683	return
8684}
8685
8686// GetFaultOperationList gets the a list of user-induced fault operations filtered by provided input.
8687// Parameters:
8688// typeFilter - used to filter on OperationType for user-induced operations.
8689// 65535 - select all
8690// 1     - select PartitionDataLoss.
8691// 2     - select PartitionQuorumLoss.
8692// 4     - select PartitionRestart.
8693// 8     - select NodeTransition.
8694// stateFilter - used to filter on OperationState's for user-induced operations.
8695// 65535 - select All
8696// 1     - select Running
8697// 2     - select RollingBack
8698// 8     - select Completed
8699// 16    - select Faulted
8700// 32    - select Cancelled
8701// 64    - select ForceCancelled
8702// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8703// duration that the client is willing to wait for the requested operation to complete. The default value for
8704// this parameter is 60 seconds.
8705func (client BaseClient) GetFaultOperationList(ctx context.Context, typeFilter int32, stateFilter int32, timeout *int64) (result ListOperationStatus, err error) {
8706	if tracing.IsEnabled() {
8707		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetFaultOperationList")
8708		defer func() {
8709			sc := -1
8710			if result.Response.Response != nil {
8711				sc = result.Response.Response.StatusCode
8712			}
8713			tracing.EndSpan(ctx, sc, err)
8714		}()
8715	}
8716	if err := validation.Validate([]validation.Validation{
8717		{TargetValue: timeout,
8718			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8719				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8720					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8721				}}}}}); err != nil {
8722		return result, validation.NewError("servicefabric.BaseClient", "GetFaultOperationList", err.Error())
8723	}
8724
8725	req, err := client.GetFaultOperationListPreparer(ctx, typeFilter, stateFilter, timeout)
8726	if err != nil {
8727		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", nil, "Failure preparing request")
8728		return
8729	}
8730
8731	resp, err := client.GetFaultOperationListSender(req)
8732	if err != nil {
8733		result.Response = autorest.Response{Response: resp}
8734		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", resp, "Failure sending request")
8735		return
8736	}
8737
8738	result, err = client.GetFaultOperationListResponder(resp)
8739	if err != nil {
8740		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", resp, "Failure responding to request")
8741		return
8742	}
8743
8744	return
8745}
8746
8747// GetFaultOperationListPreparer prepares the GetFaultOperationList request.
8748func (client BaseClient) GetFaultOperationListPreparer(ctx context.Context, typeFilter int32, stateFilter int32, timeout *int64) (*http.Request, error) {
8749	const APIVersion = "6.0"
8750	queryParameters := map[string]interface{}{
8751		"api-version": APIVersion,
8752		"StateFilter": autorest.Encode("query", stateFilter),
8753		"TypeFilter":  autorest.Encode("query", typeFilter),
8754	}
8755	if timeout != nil {
8756		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8757	} else {
8758		queryParameters["timeout"] = autorest.Encode("query", 60)
8759	}
8760
8761	preparer := autorest.CreatePreparer(
8762		autorest.AsGet(),
8763		autorest.WithBaseURL(client.BaseURI),
8764		autorest.WithPath("/Faults/"),
8765		autorest.WithQueryParameters(queryParameters))
8766	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8767}
8768
8769// GetFaultOperationListSender sends the GetFaultOperationList request. The method will close the
8770// http.Response Body if it receives an error.
8771func (client BaseClient) GetFaultOperationListSender(req *http.Request) (*http.Response, error) {
8772	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8773}
8774
8775// GetFaultOperationListResponder handles the response to the GetFaultOperationList request. The method always
8776// closes the http.Response Body.
8777func (client BaseClient) GetFaultOperationListResponder(resp *http.Response) (result ListOperationStatus, err error) {
8778	err = autorest.Respond(
8779		resp,
8780		azure.WithErrorUnlessStatusCode(http.StatusOK),
8781		autorest.ByUnmarshallingJSON(&result.Value),
8782		autorest.ByClosing())
8783	result.Response = autorest.Response{Response: resp}
8784	return
8785}
8786
8787// GetImageStoreContent returns the information about the image store content at the specified contentPath relative to
8788// the root of the image store.
8789// Parameters:
8790// contentPath - relative path to file or folder in the image store from its root.
8791// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8792// duration that the client is willing to wait for the requested operation to complete. The default value for
8793// this parameter is 60 seconds.
8794func (client BaseClient) GetImageStoreContent(ctx context.Context, contentPath string, timeout *int64) (result ImageStoreContent, err error) {
8795	if tracing.IsEnabled() {
8796		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreContent")
8797		defer func() {
8798			sc := -1
8799			if result.Response.Response != nil {
8800				sc = result.Response.Response.StatusCode
8801			}
8802			tracing.EndSpan(ctx, sc, err)
8803		}()
8804	}
8805	if err := validation.Validate([]validation.Validation{
8806		{TargetValue: timeout,
8807			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8808				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8809					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8810				}}}}}); err != nil {
8811		return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreContent", err.Error())
8812	}
8813
8814	req, err := client.GetImageStoreContentPreparer(ctx, contentPath, timeout)
8815	if err != nil {
8816		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", nil, "Failure preparing request")
8817		return
8818	}
8819
8820	resp, err := client.GetImageStoreContentSender(req)
8821	if err != nil {
8822		result.Response = autorest.Response{Response: resp}
8823		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", resp, "Failure sending request")
8824		return
8825	}
8826
8827	result, err = client.GetImageStoreContentResponder(resp)
8828	if err != nil {
8829		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", resp, "Failure responding to request")
8830		return
8831	}
8832
8833	return
8834}
8835
8836// GetImageStoreContentPreparer prepares the GetImageStoreContent request.
8837func (client BaseClient) GetImageStoreContentPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) {
8838	pathParameters := map[string]interface{}{
8839		"contentPath": autorest.Encode("path", contentPath),
8840	}
8841
8842	const APIVersion = "6.2"
8843	queryParameters := map[string]interface{}{
8844		"api-version": APIVersion,
8845	}
8846	if timeout != nil {
8847		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8848	} else {
8849		queryParameters["timeout"] = autorest.Encode("query", 60)
8850	}
8851
8852	preparer := autorest.CreatePreparer(
8853		autorest.AsGet(),
8854		autorest.WithBaseURL(client.BaseURI),
8855		autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters),
8856		autorest.WithQueryParameters(queryParameters))
8857	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8858}
8859
8860// GetImageStoreContentSender sends the GetImageStoreContent request. The method will close the
8861// http.Response Body if it receives an error.
8862func (client BaseClient) GetImageStoreContentSender(req *http.Request) (*http.Response, error) {
8863	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8864}
8865
8866// GetImageStoreContentResponder handles the response to the GetImageStoreContent request. The method always
8867// closes the http.Response Body.
8868func (client BaseClient) GetImageStoreContentResponder(resp *http.Response) (result ImageStoreContent, err error) {
8869	err = autorest.Respond(
8870		resp,
8871		azure.WithErrorUnlessStatusCode(http.StatusOK),
8872		autorest.ByUnmarshallingJSON(&result),
8873		autorest.ByClosing())
8874	result.Response = autorest.Response{Response: resp}
8875	return
8876}
8877
8878// GetImageStoreRootContent returns the information about the image store content at the root of the image store.
8879// Parameters:
8880// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8881// duration that the client is willing to wait for the requested operation to complete. The default value for
8882// this parameter is 60 seconds.
8883func (client BaseClient) GetImageStoreRootContent(ctx context.Context, timeout *int64) (result ImageStoreContent, err error) {
8884	if tracing.IsEnabled() {
8885		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreRootContent")
8886		defer func() {
8887			sc := -1
8888			if result.Response.Response != nil {
8889				sc = result.Response.Response.StatusCode
8890			}
8891			tracing.EndSpan(ctx, sc, err)
8892		}()
8893	}
8894	if err := validation.Validate([]validation.Validation{
8895		{TargetValue: timeout,
8896			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8897				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8898					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8899				}}}}}); err != nil {
8900		return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreRootContent", err.Error())
8901	}
8902
8903	req, err := client.GetImageStoreRootContentPreparer(ctx, timeout)
8904	if err != nil {
8905		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", nil, "Failure preparing request")
8906		return
8907	}
8908
8909	resp, err := client.GetImageStoreRootContentSender(req)
8910	if err != nil {
8911		result.Response = autorest.Response{Response: resp}
8912		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", resp, "Failure sending request")
8913		return
8914	}
8915
8916	result, err = client.GetImageStoreRootContentResponder(resp)
8917	if err != nil {
8918		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", resp, "Failure responding to request")
8919		return
8920	}
8921
8922	return
8923}
8924
8925// GetImageStoreRootContentPreparer prepares the GetImageStoreRootContent request.
8926func (client BaseClient) GetImageStoreRootContentPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
8927	const APIVersion = "6.0"
8928	queryParameters := map[string]interface{}{
8929		"api-version": APIVersion,
8930	}
8931	if timeout != nil {
8932		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8933	} else {
8934		queryParameters["timeout"] = autorest.Encode("query", 60)
8935	}
8936
8937	preparer := autorest.CreatePreparer(
8938		autorest.AsGet(),
8939		autorest.WithBaseURL(client.BaseURI),
8940		autorest.WithPath("/ImageStore"),
8941		autorest.WithQueryParameters(queryParameters))
8942	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8943}
8944
8945// GetImageStoreRootContentSender sends the GetImageStoreRootContent request. The method will close the
8946// http.Response Body if it receives an error.
8947func (client BaseClient) GetImageStoreRootContentSender(req *http.Request) (*http.Response, error) {
8948	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8949}
8950
8951// GetImageStoreRootContentResponder handles the response to the GetImageStoreRootContent request. The method always
8952// closes the http.Response Body.
8953func (client BaseClient) GetImageStoreRootContentResponder(resp *http.Response) (result ImageStoreContent, err error) {
8954	err = autorest.Respond(
8955		resp,
8956		azure.WithErrorUnlessStatusCode(http.StatusOK),
8957		autorest.ByUnmarshallingJSON(&result),
8958		autorest.ByClosing())
8959	result.Response = autorest.Response{Response: resp}
8960	return
8961}
8962
8963// GetImageStoreUploadSessionByID gets the image store upload session identified by the given ID. User can query the
8964// upload session at any time during uploading.
8965// Parameters:
8966// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session
8967// which keeps track of all file chunks until it is committed.
8968// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8969// duration that the client is willing to wait for the requested operation to complete. The default value for
8970// this parameter is 60 seconds.
8971func (client BaseClient) GetImageStoreUploadSessionByID(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result UploadSession, err error) {
8972	if tracing.IsEnabled() {
8973		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreUploadSessionByID")
8974		defer func() {
8975			sc := -1
8976			if result.Response.Response != nil {
8977				sc = result.Response.Response.StatusCode
8978			}
8979			tracing.EndSpan(ctx, sc, err)
8980		}()
8981	}
8982	if err := validation.Validate([]validation.Validation{
8983		{TargetValue: timeout,
8984			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8985				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8986					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8987				}}}}}); err != nil {
8988		return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreUploadSessionByID", err.Error())
8989	}
8990
8991	req, err := client.GetImageStoreUploadSessionByIDPreparer(ctx, sessionID, timeout)
8992	if err != nil {
8993		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", nil, "Failure preparing request")
8994		return
8995	}
8996
8997	resp, err := client.GetImageStoreUploadSessionByIDSender(req)
8998	if err != nil {
8999		result.Response = autorest.Response{Response: resp}
9000		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", resp, "Failure sending request")
9001		return
9002	}
9003
9004	result, err = client.GetImageStoreUploadSessionByIDResponder(resp)
9005	if err != nil {
9006		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", resp, "Failure responding to request")
9007		return
9008	}
9009
9010	return
9011}
9012
9013// GetImageStoreUploadSessionByIDPreparer prepares the GetImageStoreUploadSessionByID request.
9014func (client BaseClient) GetImageStoreUploadSessionByIDPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) {
9015	const APIVersion = "6.0"
9016	queryParameters := map[string]interface{}{
9017		"api-version": APIVersion,
9018		"session-id":  autorest.Encode("query", sessionID),
9019	}
9020	if timeout != nil {
9021		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9022	} else {
9023		queryParameters["timeout"] = autorest.Encode("query", 60)
9024	}
9025
9026	preparer := autorest.CreatePreparer(
9027		autorest.AsGet(),
9028		autorest.WithBaseURL(client.BaseURI),
9029		autorest.WithPath("/ImageStore/$/GetUploadSession"),
9030		autorest.WithQueryParameters(queryParameters))
9031	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9032}
9033
9034// GetImageStoreUploadSessionByIDSender sends the GetImageStoreUploadSessionByID request. The method will close the
9035// http.Response Body if it receives an error.
9036func (client BaseClient) GetImageStoreUploadSessionByIDSender(req *http.Request) (*http.Response, error) {
9037	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9038}
9039
9040// GetImageStoreUploadSessionByIDResponder handles the response to the GetImageStoreUploadSessionByID request. The method always
9041// closes the http.Response Body.
9042func (client BaseClient) GetImageStoreUploadSessionByIDResponder(resp *http.Response) (result UploadSession, err error) {
9043	err = autorest.Respond(
9044		resp,
9045		azure.WithErrorUnlessStatusCode(http.StatusOK),
9046		autorest.ByUnmarshallingJSON(&result),
9047		autorest.ByClosing())
9048	result.Response = autorest.Response{Response: resp}
9049	return
9050}
9051
9052// GetImageStoreUploadSessionByPath gets the image store upload session associated with the given image store relative
9053// path. User can query the upload session at any time during uploading.
9054// Parameters:
9055// contentPath - relative path to file or folder in the image store from its root.
9056// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9057// duration that the client is willing to wait for the requested operation to complete. The default value for
9058// this parameter is 60 seconds.
9059func (client BaseClient) GetImageStoreUploadSessionByPath(ctx context.Context, contentPath string, timeout *int64) (result UploadSession, err error) {
9060	if tracing.IsEnabled() {
9061		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreUploadSessionByPath")
9062		defer func() {
9063			sc := -1
9064			if result.Response.Response != nil {
9065				sc = result.Response.Response.StatusCode
9066			}
9067			tracing.EndSpan(ctx, sc, err)
9068		}()
9069	}
9070	if err := validation.Validate([]validation.Validation{
9071		{TargetValue: timeout,
9072			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9073				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9074					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9075				}}}}}); err != nil {
9076		return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", err.Error())
9077	}
9078
9079	req, err := client.GetImageStoreUploadSessionByPathPreparer(ctx, contentPath, timeout)
9080	if err != nil {
9081		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", nil, "Failure preparing request")
9082		return
9083	}
9084
9085	resp, err := client.GetImageStoreUploadSessionByPathSender(req)
9086	if err != nil {
9087		result.Response = autorest.Response{Response: resp}
9088		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", resp, "Failure sending request")
9089		return
9090	}
9091
9092	result, err = client.GetImageStoreUploadSessionByPathResponder(resp)
9093	if err != nil {
9094		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", resp, "Failure responding to request")
9095		return
9096	}
9097
9098	return
9099}
9100
9101// GetImageStoreUploadSessionByPathPreparer prepares the GetImageStoreUploadSessionByPath request.
9102func (client BaseClient) GetImageStoreUploadSessionByPathPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) {
9103	pathParameters := map[string]interface{}{
9104		"contentPath": autorest.Encode("path", contentPath),
9105	}
9106
9107	const APIVersion = "6.0"
9108	queryParameters := map[string]interface{}{
9109		"api-version": APIVersion,
9110	}
9111	if timeout != nil {
9112		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9113	} else {
9114		queryParameters["timeout"] = autorest.Encode("query", 60)
9115	}
9116
9117	preparer := autorest.CreatePreparer(
9118		autorest.AsGet(),
9119		autorest.WithBaseURL(client.BaseURI),
9120		autorest.WithPathParameters("/ImageStore/{contentPath}/$/GetUploadSession", pathParameters),
9121		autorest.WithQueryParameters(queryParameters))
9122	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9123}
9124
9125// GetImageStoreUploadSessionByPathSender sends the GetImageStoreUploadSessionByPath request. The method will close the
9126// http.Response Body if it receives an error.
9127func (client BaseClient) GetImageStoreUploadSessionByPathSender(req *http.Request) (*http.Response, error) {
9128	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9129}
9130
9131// GetImageStoreUploadSessionByPathResponder handles the response to the GetImageStoreUploadSessionByPath request. The method always
9132// closes the http.Response Body.
9133func (client BaseClient) GetImageStoreUploadSessionByPathResponder(resp *http.Response) (result UploadSession, err error) {
9134	err = autorest.Respond(
9135		resp,
9136		azure.WithErrorUnlessStatusCode(http.StatusOK),
9137		autorest.ByUnmarshallingJSON(&result),
9138		autorest.ByClosing())
9139	result.Response = autorest.Response{Response: resp}
9140	return
9141}
9142
9143// GetNameExistsInfo returns whether the specified Service Fabric name exists.
9144// Parameters:
9145// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
9146// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9147// duration that the client is willing to wait for the requested operation to complete. The default value for
9148// this parameter is 60 seconds.
9149func (client BaseClient) GetNameExistsInfo(ctx context.Context, nameID string, timeout *int64) (result autorest.Response, err error) {
9150	if tracing.IsEnabled() {
9151		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNameExistsInfo")
9152		defer func() {
9153			sc := -1
9154			if result.Response != nil {
9155				sc = result.Response.StatusCode
9156			}
9157			tracing.EndSpan(ctx, sc, err)
9158		}()
9159	}
9160	if err := validation.Validate([]validation.Validation{
9161		{TargetValue: timeout,
9162			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9163				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9164					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9165				}}}}}); err != nil {
9166		return result, validation.NewError("servicefabric.BaseClient", "GetNameExistsInfo", err.Error())
9167	}
9168
9169	req, err := client.GetNameExistsInfoPreparer(ctx, nameID, timeout)
9170	if err != nil {
9171		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", nil, "Failure preparing request")
9172		return
9173	}
9174
9175	resp, err := client.GetNameExistsInfoSender(req)
9176	if err != nil {
9177		result.Response = resp
9178		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", resp, "Failure sending request")
9179		return
9180	}
9181
9182	result, err = client.GetNameExistsInfoResponder(resp)
9183	if err != nil {
9184		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", resp, "Failure responding to request")
9185		return
9186	}
9187
9188	return
9189}
9190
9191// GetNameExistsInfoPreparer prepares the GetNameExistsInfo request.
9192func (client BaseClient) GetNameExistsInfoPreparer(ctx context.Context, nameID string, timeout *int64) (*http.Request, error) {
9193	pathParameters := map[string]interface{}{
9194		"nameId": nameID,
9195	}
9196
9197	const APIVersion = "6.0"
9198	queryParameters := map[string]interface{}{
9199		"api-version": APIVersion,
9200	}
9201	if timeout != nil {
9202		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9203	} else {
9204		queryParameters["timeout"] = autorest.Encode("query", 60)
9205	}
9206
9207	preparer := autorest.CreatePreparer(
9208		autorest.AsGet(),
9209		autorest.WithBaseURL(client.BaseURI),
9210		autorest.WithPathParameters("/Names/{nameId}", pathParameters),
9211		autorest.WithQueryParameters(queryParameters))
9212	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9213}
9214
9215// GetNameExistsInfoSender sends the GetNameExistsInfo request. The method will close the
9216// http.Response Body if it receives an error.
9217func (client BaseClient) GetNameExistsInfoSender(req *http.Request) (*http.Response, error) {
9218	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9219}
9220
9221// GetNameExistsInfoResponder handles the response to the GetNameExistsInfo request. The method always
9222// closes the http.Response Body.
9223func (client BaseClient) GetNameExistsInfoResponder(resp *http.Response) (result autorest.Response, err error) {
9224	err = autorest.Respond(
9225		resp,
9226		azure.WithErrorUnlessStatusCode(http.StatusOK),
9227		autorest.ByClosing())
9228	result.Response = resp
9229	return
9230}
9231
9232// GetNodeEventList the response is list of NodeEvent objects.
9233// Parameters:
9234// nodeName - the name of the node.
9235// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
9236// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
9237// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9238// duration that the client is willing to wait for the requested operation to complete. The default value for
9239// this parameter is 60 seconds.
9240// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
9241// be included in the response.
9242// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
9243// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
9244// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
9245// populated.
9246func (client BaseClient) GetNodeEventList(ctx context.Context, nodeName string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListNodeEvent, err error) {
9247	if tracing.IsEnabled() {
9248		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeEventList")
9249		defer func() {
9250			sc := -1
9251			if result.Response.Response != nil {
9252				sc = result.Response.Response.StatusCode
9253			}
9254			tracing.EndSpan(ctx, sc, err)
9255		}()
9256	}
9257	if err := validation.Validate([]validation.Validation{
9258		{TargetValue: timeout,
9259			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9260				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9261					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9262				}}}}}); err != nil {
9263		return result, validation.NewError("servicefabric.BaseClient", "GetNodeEventList", err.Error())
9264	}
9265
9266	req, err := client.GetNodeEventListPreparer(ctx, nodeName, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
9267	if err != nil {
9268		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", nil, "Failure preparing request")
9269		return
9270	}
9271
9272	resp, err := client.GetNodeEventListSender(req)
9273	if err != nil {
9274		result.Response = autorest.Response{Response: resp}
9275		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", resp, "Failure sending request")
9276		return
9277	}
9278
9279	result, err = client.GetNodeEventListResponder(resp)
9280	if err != nil {
9281		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", resp, "Failure responding to request")
9282		return
9283	}
9284
9285	return
9286}
9287
9288// GetNodeEventListPreparer prepares the GetNodeEventList request.
9289func (client BaseClient) GetNodeEventListPreparer(ctx context.Context, nodeName string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
9290	pathParameters := map[string]interface{}{
9291		"nodeName": autorest.Encode("path", nodeName),
9292	}
9293
9294	const APIVersion = "6.2-preview"
9295	queryParameters := map[string]interface{}{
9296		"api-version":  APIVersion,
9297		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
9298		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
9299	}
9300	if timeout != nil {
9301		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9302	} else {
9303		queryParameters["timeout"] = autorest.Encode("query", 60)
9304	}
9305	if len(eventsTypesFilter) > 0 {
9306		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
9307	}
9308	if excludeAnalysisEvents != nil {
9309		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
9310	}
9311	if skipCorrelationLookup != nil {
9312		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
9313	}
9314
9315	preparer := autorest.CreatePreparer(
9316		autorest.AsGet(),
9317		autorest.WithBaseURL(client.BaseURI),
9318		autorest.WithPathParameters("/EventsStore/Nodes/{nodeName}/$/Events", pathParameters),
9319		autorest.WithQueryParameters(queryParameters))
9320	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9321}
9322
9323// GetNodeEventListSender sends the GetNodeEventList request. The method will close the
9324// http.Response Body if it receives an error.
9325func (client BaseClient) GetNodeEventListSender(req *http.Request) (*http.Response, error) {
9326	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9327}
9328
9329// GetNodeEventListResponder handles the response to the GetNodeEventList request. The method always
9330// closes the http.Response Body.
9331func (client BaseClient) GetNodeEventListResponder(resp *http.Response) (result ListNodeEvent, err error) {
9332	err = autorest.Respond(
9333		resp,
9334		azure.WithErrorUnlessStatusCode(http.StatusOK),
9335		autorest.ByUnmarshallingJSON(&result),
9336		autorest.ByClosing())
9337	result.Response = autorest.Response{Response: resp}
9338	return
9339}
9340
9341// GetNodeHealth gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of
9342// health events reported on the node based on the health state. If the node that you specify by name does not exist in
9343// the health store, this returns an error.
9344// Parameters:
9345// nodeName - the name of the node.
9346// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
9347// state.
9348// The possible values for this parameter include integer value of one of the following health states.
9349// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
9350// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
9351// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
9352// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
9353//
9354// - Default - Default value. Matches any HealthState. The value is zero.
9355// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
9356// collection of states. The value is 1.
9357// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
9358// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
9359// - Error - Filter that matches input with HealthState value Error. The value is 8.
9360// - All - Filter that matches input with any HealthState value. The value is 65535.
9361// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9362// duration that the client is willing to wait for the requested operation to complete. The default value for
9363// this parameter is 60 seconds.
9364func (client BaseClient) GetNodeHealth(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, timeout *int64) (result NodeHealth, err error) {
9365	if tracing.IsEnabled() {
9366		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeHealth")
9367		defer func() {
9368			sc := -1
9369			if result.Response.Response != nil {
9370				sc = result.Response.Response.StatusCode
9371			}
9372			tracing.EndSpan(ctx, sc, err)
9373		}()
9374	}
9375	if err := validation.Validate([]validation.Validation{
9376		{TargetValue: timeout,
9377			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9378				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9379					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9380				}}}}}); err != nil {
9381		return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealth", err.Error())
9382	}
9383
9384	req, err := client.GetNodeHealthPreparer(ctx, nodeName, eventsHealthStateFilter, timeout)
9385	if err != nil {
9386		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", nil, "Failure preparing request")
9387		return
9388	}
9389
9390	resp, err := client.GetNodeHealthSender(req)
9391	if err != nil {
9392		result.Response = autorest.Response{Response: resp}
9393		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", resp, "Failure sending request")
9394		return
9395	}
9396
9397	result, err = client.GetNodeHealthResponder(resp)
9398	if err != nil {
9399		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", resp, "Failure responding to request")
9400		return
9401	}
9402
9403	return
9404}
9405
9406// GetNodeHealthPreparer prepares the GetNodeHealth request.
9407func (client BaseClient) GetNodeHealthPreparer(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) {
9408	pathParameters := map[string]interface{}{
9409		"nodeName": autorest.Encode("path", nodeName),
9410	}
9411
9412	const APIVersion = "6.0"
9413	queryParameters := map[string]interface{}{
9414		"api-version": APIVersion,
9415	}
9416	if eventsHealthStateFilter != nil {
9417		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
9418	} else {
9419		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
9420	}
9421	if timeout != nil {
9422		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9423	} else {
9424		queryParameters["timeout"] = autorest.Encode("query", 60)
9425	}
9426
9427	preparer := autorest.CreatePreparer(
9428		autorest.AsGet(),
9429		autorest.WithBaseURL(client.BaseURI),
9430		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetHealth", pathParameters),
9431		autorest.WithQueryParameters(queryParameters))
9432	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9433}
9434
9435// GetNodeHealthSender sends the GetNodeHealth request. The method will close the
9436// http.Response Body if it receives an error.
9437func (client BaseClient) GetNodeHealthSender(req *http.Request) (*http.Response, error) {
9438	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9439}
9440
9441// GetNodeHealthResponder handles the response to the GetNodeHealth request. The method always
9442// closes the http.Response Body.
9443func (client BaseClient) GetNodeHealthResponder(resp *http.Response) (result NodeHealth, err error) {
9444	err = autorest.Respond(
9445		resp,
9446		azure.WithErrorUnlessStatusCode(http.StatusOK),
9447		autorest.ByUnmarshallingJSON(&result),
9448		autorest.ByClosing())
9449	result.Response = autorest.Response{Response: resp}
9450	return
9451}
9452
9453// GetNodeHealthUsingPolicy gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the
9454// collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body
9455// to override the health policies used to evaluate the health. If the node that you specify by name does not exist in
9456// the health store, this returns an error.
9457// Parameters:
9458// nodeName - the name of the node.
9459// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
9460// state.
9461// The possible values for this parameter include integer value of one of the following health states.
9462// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
9463// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
9464// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
9465// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
9466//
9467// - Default - Default value. Matches any HealthState. The value is zero.
9468// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
9469// collection of states. The value is 1.
9470// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
9471// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
9472// - Error - Filter that matches input with HealthState value Error. The value is 8.
9473// - All - Filter that matches input with any HealthState value. The value is 65535.
9474// clusterHealthPolicy - describes the health policies used to evaluate the health of a cluster or node. If not
9475// present, the health evaluation uses the health policy from cluster manifest or the default health policy.
9476// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9477// duration that the client is willing to wait for the requested operation to complete. The default value for
9478// this parameter is 60 seconds.
9479func (client BaseClient) GetNodeHealthUsingPolicy(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, clusterHealthPolicy *ClusterHealthPolicy, timeout *int64) (result NodeHealth, err error) {
9480	if tracing.IsEnabled() {
9481		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeHealthUsingPolicy")
9482		defer func() {
9483			sc := -1
9484			if result.Response.Response != nil {
9485				sc = result.Response.Response.StatusCode
9486			}
9487			tracing.EndSpan(ctx, sc, err)
9488		}()
9489	}
9490	if err := validation.Validate([]validation.Validation{
9491		{TargetValue: timeout,
9492			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9493				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9494					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9495				}}}}}); err != nil {
9496		return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealthUsingPolicy", err.Error())
9497	}
9498
9499	req, err := client.GetNodeHealthUsingPolicyPreparer(ctx, nodeName, eventsHealthStateFilter, clusterHealthPolicy, timeout)
9500	if err != nil {
9501		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", nil, "Failure preparing request")
9502		return
9503	}
9504
9505	resp, err := client.GetNodeHealthUsingPolicySender(req)
9506	if err != nil {
9507		result.Response = autorest.Response{Response: resp}
9508		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", resp, "Failure sending request")
9509		return
9510	}
9511
9512	result, err = client.GetNodeHealthUsingPolicyResponder(resp)
9513	if err != nil {
9514		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", resp, "Failure responding to request")
9515		return
9516	}
9517
9518	return
9519}
9520
9521// GetNodeHealthUsingPolicyPreparer prepares the GetNodeHealthUsingPolicy request.
9522func (client BaseClient) GetNodeHealthUsingPolicyPreparer(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, clusterHealthPolicy *ClusterHealthPolicy, timeout *int64) (*http.Request, error) {
9523	pathParameters := map[string]interface{}{
9524		"nodeName": autorest.Encode("path", nodeName),
9525	}
9526
9527	const APIVersion = "6.0"
9528	queryParameters := map[string]interface{}{
9529		"api-version": APIVersion,
9530	}
9531	if eventsHealthStateFilter != nil {
9532		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
9533	} else {
9534		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
9535	}
9536	if timeout != nil {
9537		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9538	} else {
9539		queryParameters["timeout"] = autorest.Encode("query", 60)
9540	}
9541
9542	preparer := autorest.CreatePreparer(
9543		autorest.AsContentType("application/json; charset=utf-8"),
9544		autorest.AsPost(),
9545		autorest.WithBaseURL(client.BaseURI),
9546		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetHealth", pathParameters),
9547		autorest.WithQueryParameters(queryParameters))
9548	if clusterHealthPolicy != nil {
9549		preparer = autorest.DecoratePreparer(preparer,
9550			autorest.WithJSON(clusterHealthPolicy))
9551	}
9552	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9553}
9554
9555// GetNodeHealthUsingPolicySender sends the GetNodeHealthUsingPolicy request. The method will close the
9556// http.Response Body if it receives an error.
9557func (client BaseClient) GetNodeHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
9558	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9559}
9560
9561// GetNodeHealthUsingPolicyResponder handles the response to the GetNodeHealthUsingPolicy request. The method always
9562// closes the http.Response Body.
9563func (client BaseClient) GetNodeHealthUsingPolicyResponder(resp *http.Response) (result NodeHealth, err error) {
9564	err = autorest.Respond(
9565		resp,
9566		azure.WithErrorUnlessStatusCode(http.StatusOK),
9567		autorest.ByUnmarshallingJSON(&result),
9568		autorest.ByClosing())
9569	result.Response = autorest.Response{Response: resp}
9570	return
9571}
9572
9573// GetNodeInfo gets the information about a specific node in the Service Fabric Cluster. The response includes the
9574// name, status, id, health, uptime, and other details about the node.
9575// Parameters:
9576// nodeName - the name of the node.
9577// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9578// duration that the client is willing to wait for the requested operation to complete. The default value for
9579// this parameter is 60 seconds.
9580func (client BaseClient) GetNodeInfo(ctx context.Context, nodeName string, timeout *int64) (result NodeInfo, err error) {
9581	if tracing.IsEnabled() {
9582		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeInfo")
9583		defer func() {
9584			sc := -1
9585			if result.Response.Response != nil {
9586				sc = result.Response.Response.StatusCode
9587			}
9588			tracing.EndSpan(ctx, sc, err)
9589		}()
9590	}
9591	if err := validation.Validate([]validation.Validation{
9592		{TargetValue: timeout,
9593			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9594				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9595					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9596				}}}}}); err != nil {
9597		return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfo", err.Error())
9598	}
9599
9600	req, err := client.GetNodeInfoPreparer(ctx, nodeName, timeout)
9601	if err != nil {
9602		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", nil, "Failure preparing request")
9603		return
9604	}
9605
9606	resp, err := client.GetNodeInfoSender(req)
9607	if err != nil {
9608		result.Response = autorest.Response{Response: resp}
9609		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", resp, "Failure sending request")
9610		return
9611	}
9612
9613	result, err = client.GetNodeInfoResponder(resp)
9614	if err != nil {
9615		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", resp, "Failure responding to request")
9616		return
9617	}
9618
9619	return
9620}
9621
9622// GetNodeInfoPreparer prepares the GetNodeInfo request.
9623func (client BaseClient) GetNodeInfoPreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) {
9624	pathParameters := map[string]interface{}{
9625		"nodeName": autorest.Encode("path", nodeName),
9626	}
9627
9628	const APIVersion = "6.0"
9629	queryParameters := map[string]interface{}{
9630		"api-version": APIVersion,
9631	}
9632	if timeout != nil {
9633		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9634	} else {
9635		queryParameters["timeout"] = autorest.Encode("query", 60)
9636	}
9637
9638	preparer := autorest.CreatePreparer(
9639		autorest.AsGet(),
9640		autorest.WithBaseURL(client.BaseURI),
9641		autorest.WithPathParameters("/Nodes/{nodeName}", pathParameters),
9642		autorest.WithQueryParameters(queryParameters))
9643	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9644}
9645
9646// GetNodeInfoSender sends the GetNodeInfo request. The method will close the
9647// http.Response Body if it receives an error.
9648func (client BaseClient) GetNodeInfoSender(req *http.Request) (*http.Response, error) {
9649	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9650}
9651
9652// GetNodeInfoResponder handles the response to the GetNodeInfo request. The method always
9653// closes the http.Response Body.
9654func (client BaseClient) GetNodeInfoResponder(resp *http.Response) (result NodeInfo, err error) {
9655	err = autorest.Respond(
9656		resp,
9657		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
9658		autorest.ByUnmarshallingJSON(&result),
9659		autorest.ByClosing())
9660	result.Response = autorest.Response{Response: resp}
9661	return
9662}
9663
9664// GetNodeInfoList gets the list of nodes in the Service Fabric cluster. The response includes the name, status, id,
9665// health, uptime, and other details about the node.
9666// Parameters:
9667// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
9668// token with a non empty value is included in the response of the API when the results from the system do not
9669// fit in a single response. When this value is passed to the next API call, the API returns next set of
9670// results. If there are no further results then the continuation token does not contain a value. The value of
9671// this parameter should not be URL encoded.
9672// nodeStatusFilter - allows filtering the nodes based on the NodeStatus. Only the nodes that are matching the
9673// specified filter value will be returned. The filter value can be one of the following.
9674// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9675// duration that the client is willing to wait for the requested operation to complete. The default value for
9676// this parameter is 60 seconds.
9677func (client BaseClient) GetNodeInfoList(ctx context.Context, continuationToken string, nodeStatusFilter NodeStatusFilter, timeout *int64) (result PagedNodeInfoList, err error) {
9678	if tracing.IsEnabled() {
9679		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeInfoList")
9680		defer func() {
9681			sc := -1
9682			if result.Response.Response != nil {
9683				sc = result.Response.Response.StatusCode
9684			}
9685			tracing.EndSpan(ctx, sc, err)
9686		}()
9687	}
9688	if err := validation.Validate([]validation.Validation{
9689		{TargetValue: timeout,
9690			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9691				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9692					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9693				}}}}}); err != nil {
9694		return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfoList", err.Error())
9695	}
9696
9697	req, err := client.GetNodeInfoListPreparer(ctx, continuationToken, nodeStatusFilter, timeout)
9698	if err != nil {
9699		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", nil, "Failure preparing request")
9700		return
9701	}
9702
9703	resp, err := client.GetNodeInfoListSender(req)
9704	if err != nil {
9705		result.Response = autorest.Response{Response: resp}
9706		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", resp, "Failure sending request")
9707		return
9708	}
9709
9710	result, err = client.GetNodeInfoListResponder(resp)
9711	if err != nil {
9712		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", resp, "Failure responding to request")
9713		return
9714	}
9715
9716	return
9717}
9718
9719// GetNodeInfoListPreparer prepares the GetNodeInfoList request.
9720func (client BaseClient) GetNodeInfoListPreparer(ctx context.Context, continuationToken string, nodeStatusFilter NodeStatusFilter, timeout *int64) (*http.Request, error) {
9721	const APIVersion = "6.0"
9722	queryParameters := map[string]interface{}{
9723		"api-version": APIVersion,
9724	}
9725	if len(continuationToken) > 0 {
9726		queryParameters["ContinuationToken"] = continuationToken
9727	}
9728	if len(string(nodeStatusFilter)) > 0 {
9729		queryParameters["NodeStatusFilter"] = autorest.Encode("query", nodeStatusFilter)
9730	} else {
9731		queryParameters["NodeStatusFilter"] = autorest.Encode("query", "default")
9732	}
9733	if timeout != nil {
9734		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9735	} else {
9736		queryParameters["timeout"] = autorest.Encode("query", 60)
9737	}
9738
9739	preparer := autorest.CreatePreparer(
9740		autorest.AsGet(),
9741		autorest.WithBaseURL(client.BaseURI),
9742		autorest.WithPath("/Nodes"),
9743		autorest.WithQueryParameters(queryParameters))
9744	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9745}
9746
9747// GetNodeInfoListSender sends the GetNodeInfoList request. The method will close the
9748// http.Response Body if it receives an error.
9749func (client BaseClient) GetNodeInfoListSender(req *http.Request) (*http.Response, error) {
9750	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9751}
9752
9753// GetNodeInfoListResponder handles the response to the GetNodeInfoList request. The method always
9754// closes the http.Response Body.
9755func (client BaseClient) GetNodeInfoListResponder(resp *http.Response) (result PagedNodeInfoList, err error) {
9756	err = autorest.Respond(
9757		resp,
9758		azure.WithErrorUnlessStatusCode(http.StatusOK),
9759		autorest.ByUnmarshallingJSON(&result),
9760		autorest.ByClosing())
9761	result.Response = autorest.Response{Response: resp}
9762	return
9763}
9764
9765// GetNodeLoadInfo retrieves the load information of a Service Fabric node for all the metrics that have load or
9766// capacity defined.
9767// Parameters:
9768// nodeName - the name of the node.
9769// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9770// duration that the client is willing to wait for the requested operation to complete. The default value for
9771// this parameter is 60 seconds.
9772func (client BaseClient) GetNodeLoadInfo(ctx context.Context, nodeName string, timeout *int64) (result NodeLoadInfo, err error) {
9773	if tracing.IsEnabled() {
9774		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeLoadInfo")
9775		defer func() {
9776			sc := -1
9777			if result.Response.Response != nil {
9778				sc = result.Response.Response.StatusCode
9779			}
9780			tracing.EndSpan(ctx, sc, err)
9781		}()
9782	}
9783	if err := validation.Validate([]validation.Validation{
9784		{TargetValue: timeout,
9785			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9786				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9787					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9788				}}}}}); err != nil {
9789		return result, validation.NewError("servicefabric.BaseClient", "GetNodeLoadInfo", err.Error())
9790	}
9791
9792	req, err := client.GetNodeLoadInfoPreparer(ctx, nodeName, timeout)
9793	if err != nil {
9794		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", nil, "Failure preparing request")
9795		return
9796	}
9797
9798	resp, err := client.GetNodeLoadInfoSender(req)
9799	if err != nil {
9800		result.Response = autorest.Response{Response: resp}
9801		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", resp, "Failure sending request")
9802		return
9803	}
9804
9805	result, err = client.GetNodeLoadInfoResponder(resp)
9806	if err != nil {
9807		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", resp, "Failure responding to request")
9808		return
9809	}
9810
9811	return
9812}
9813
9814// GetNodeLoadInfoPreparer prepares the GetNodeLoadInfo request.
9815func (client BaseClient) GetNodeLoadInfoPreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) {
9816	pathParameters := map[string]interface{}{
9817		"nodeName": autorest.Encode("path", nodeName),
9818	}
9819
9820	const APIVersion = "6.0"
9821	queryParameters := map[string]interface{}{
9822		"api-version": APIVersion,
9823	}
9824	if timeout != nil {
9825		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9826	} else {
9827		queryParameters["timeout"] = autorest.Encode("query", 60)
9828	}
9829
9830	preparer := autorest.CreatePreparer(
9831		autorest.AsGet(),
9832		autorest.WithBaseURL(client.BaseURI),
9833		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetLoadInformation", pathParameters),
9834		autorest.WithQueryParameters(queryParameters))
9835	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9836}
9837
9838// GetNodeLoadInfoSender sends the GetNodeLoadInfo request. The method will close the
9839// http.Response Body if it receives an error.
9840func (client BaseClient) GetNodeLoadInfoSender(req *http.Request) (*http.Response, error) {
9841	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9842}
9843
9844// GetNodeLoadInfoResponder handles the response to the GetNodeLoadInfo request. The method always
9845// closes the http.Response Body.
9846func (client BaseClient) GetNodeLoadInfoResponder(resp *http.Response) (result NodeLoadInfo, err error) {
9847	err = autorest.Respond(
9848		resp,
9849		azure.WithErrorUnlessStatusCode(http.StatusOK),
9850		autorest.ByUnmarshallingJSON(&result),
9851		autorest.ByClosing())
9852	result.Response = autorest.Response{Response: resp}
9853	return
9854}
9855
9856// GetNodesEventList the response is list of NodeEvent objects.
9857// Parameters:
9858// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
9859// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
9860// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9861// duration that the client is willing to wait for the requested operation to complete. The default value for
9862// this parameter is 60 seconds.
9863// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
9864// be included in the response.
9865// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
9866// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
9867// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
9868// populated.
9869func (client BaseClient) GetNodesEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListNodeEvent, err error) {
9870	if tracing.IsEnabled() {
9871		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodesEventList")
9872		defer func() {
9873			sc := -1
9874			if result.Response.Response != nil {
9875				sc = result.Response.Response.StatusCode
9876			}
9877			tracing.EndSpan(ctx, sc, err)
9878		}()
9879	}
9880	if err := validation.Validate([]validation.Validation{
9881		{TargetValue: timeout,
9882			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9883				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9884					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9885				}}}}}); err != nil {
9886		return result, validation.NewError("servicefabric.BaseClient", "GetNodesEventList", err.Error())
9887	}
9888
9889	req, err := client.GetNodesEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
9890	if err != nil {
9891		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", nil, "Failure preparing request")
9892		return
9893	}
9894
9895	resp, err := client.GetNodesEventListSender(req)
9896	if err != nil {
9897		result.Response = autorest.Response{Response: resp}
9898		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", resp, "Failure sending request")
9899		return
9900	}
9901
9902	result, err = client.GetNodesEventListResponder(resp)
9903	if err != nil {
9904		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", resp, "Failure responding to request")
9905		return
9906	}
9907
9908	return
9909}
9910
9911// GetNodesEventListPreparer prepares the GetNodesEventList request.
9912func (client BaseClient) GetNodesEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
9913	const APIVersion = "6.2-preview"
9914	queryParameters := map[string]interface{}{
9915		"api-version":  APIVersion,
9916		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
9917		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
9918	}
9919	if timeout != nil {
9920		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9921	} else {
9922		queryParameters["timeout"] = autorest.Encode("query", 60)
9923	}
9924	if len(eventsTypesFilter) > 0 {
9925		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
9926	}
9927	if excludeAnalysisEvents != nil {
9928		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
9929	}
9930	if skipCorrelationLookup != nil {
9931		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
9932	}
9933
9934	preparer := autorest.CreatePreparer(
9935		autorest.AsGet(),
9936		autorest.WithBaseURL(client.BaseURI),
9937		autorest.WithPath("/EventsStore/Nodes/Events"),
9938		autorest.WithQueryParameters(queryParameters))
9939	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9940}
9941
9942// GetNodesEventListSender sends the GetNodesEventList request. The method will close the
9943// http.Response Body if it receives an error.
9944func (client BaseClient) GetNodesEventListSender(req *http.Request) (*http.Response, error) {
9945	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9946}
9947
9948// GetNodesEventListResponder handles the response to the GetNodesEventList request. The method always
9949// closes the http.Response Body.
9950func (client BaseClient) GetNodesEventListResponder(resp *http.Response) (result ListNodeEvent, err error) {
9951	err = autorest.Respond(
9952		resp,
9953		azure.WithErrorUnlessStatusCode(http.StatusOK),
9954		autorest.ByUnmarshallingJSON(&result),
9955		autorest.ByClosing())
9956	result.Response = autorest.Response{Response: resp}
9957	return
9958}
9959
9960// GetNodeTransitionProgress gets the progress of an operation started with StartNodeTransition using the provided
9961// OperationId.
9962// Parameters:
9963// nodeName - the name of the node.
9964// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
9965// API
9966// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9967// duration that the client is willing to wait for the requested operation to complete. The default value for
9968// this parameter is 60 seconds.
9969func (client BaseClient) GetNodeTransitionProgress(ctx context.Context, nodeName string, operationID uuid.UUID, timeout *int64) (result NodeTransitionProgress, err error) {
9970	if tracing.IsEnabled() {
9971		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeTransitionProgress")
9972		defer func() {
9973			sc := -1
9974			if result.Response.Response != nil {
9975				sc = result.Response.Response.StatusCode
9976			}
9977			tracing.EndSpan(ctx, sc, err)
9978		}()
9979	}
9980	if err := validation.Validate([]validation.Validation{
9981		{TargetValue: timeout,
9982			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9983				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9984					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9985				}}}}}); err != nil {
9986		return result, validation.NewError("servicefabric.BaseClient", "GetNodeTransitionProgress", err.Error())
9987	}
9988
9989	req, err := client.GetNodeTransitionProgressPreparer(ctx, nodeName, operationID, timeout)
9990	if err != nil {
9991		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", nil, "Failure preparing request")
9992		return
9993	}
9994
9995	resp, err := client.GetNodeTransitionProgressSender(req)
9996	if err != nil {
9997		result.Response = autorest.Response{Response: resp}
9998		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", resp, "Failure sending request")
9999		return
10000	}
10001
10002	result, err = client.GetNodeTransitionProgressResponder(resp)
10003	if err != nil {
10004		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", resp, "Failure responding to request")
10005		return
10006	}
10007
10008	return
10009}
10010
10011// GetNodeTransitionProgressPreparer prepares the GetNodeTransitionProgress request.
10012func (client BaseClient) GetNodeTransitionProgressPreparer(ctx context.Context, nodeName string, operationID uuid.UUID, timeout *int64) (*http.Request, error) {
10013	pathParameters := map[string]interface{}{
10014		"nodeName": autorest.Encode("path", nodeName),
10015	}
10016
10017	const APIVersion = "6.0"
10018	queryParameters := map[string]interface{}{
10019		"api-version": APIVersion,
10020		"OperationId": autorest.Encode("query", operationID),
10021	}
10022	if timeout != nil {
10023		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10024	} else {
10025		queryParameters["timeout"] = autorest.Encode("query", 60)
10026	}
10027
10028	preparer := autorest.CreatePreparer(
10029		autorest.AsGet(),
10030		autorest.WithBaseURL(client.BaseURI),
10031		autorest.WithPathParameters("/Faults/Nodes/{nodeName}/$/GetTransitionProgress", pathParameters),
10032		autorest.WithQueryParameters(queryParameters))
10033	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10034}
10035
10036// GetNodeTransitionProgressSender sends the GetNodeTransitionProgress request. The method will close the
10037// http.Response Body if it receives an error.
10038func (client BaseClient) GetNodeTransitionProgressSender(req *http.Request) (*http.Response, error) {
10039	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10040}
10041
10042// GetNodeTransitionProgressResponder handles the response to the GetNodeTransitionProgress request. The method always
10043// closes the http.Response Body.
10044func (client BaseClient) GetNodeTransitionProgressResponder(resp *http.Response) (result NodeTransitionProgress, err error) {
10045	err = autorest.Respond(
10046		resp,
10047		azure.WithErrorUnlessStatusCode(http.StatusOK),
10048		autorest.ByUnmarshallingJSON(&result),
10049		autorest.ByClosing())
10050	result.Response = autorest.Response{Response: resp}
10051	return
10052}
10053
10054// GetPartitionBackupConfigurationInfo gets the Service Fabric Backup configuration information for the specified
10055// partition.
10056// Parameters:
10057// partitionID - the identity of the partition.
10058// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10059// duration that the client is willing to wait for the requested operation to complete. The default value for
10060// this parameter is 60 seconds.
10061func (client BaseClient) GetPartitionBackupConfigurationInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result PartitionBackupConfigurationInfo, err error) {
10062	if tracing.IsEnabled() {
10063		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupConfigurationInfo")
10064		defer func() {
10065			sc := -1
10066			if result.Response.Response != nil {
10067				sc = result.Response.Response.StatusCode
10068			}
10069			tracing.EndSpan(ctx, sc, err)
10070		}()
10071	}
10072	if err := validation.Validate([]validation.Validation{
10073		{TargetValue: timeout,
10074			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10075				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10076					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10077				}}}}}); err != nil {
10078		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", err.Error())
10079	}
10080
10081	req, err := client.GetPartitionBackupConfigurationInfoPreparer(ctx, partitionID, timeout)
10082	if err != nil {
10083		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", nil, "Failure preparing request")
10084		return
10085	}
10086
10087	resp, err := client.GetPartitionBackupConfigurationInfoSender(req)
10088	if err != nil {
10089		result.Response = autorest.Response{Response: resp}
10090		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", resp, "Failure sending request")
10091		return
10092	}
10093
10094	result, err = client.GetPartitionBackupConfigurationInfoResponder(resp)
10095	if err != nil {
10096		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", resp, "Failure responding to request")
10097		return
10098	}
10099
10100	return
10101}
10102
10103// GetPartitionBackupConfigurationInfoPreparer prepares the GetPartitionBackupConfigurationInfo request.
10104func (client BaseClient) GetPartitionBackupConfigurationInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
10105	pathParameters := map[string]interface{}{
10106		"partitionId": partitionID,
10107	}
10108
10109	const APIVersion = "6.2-preview"
10110	queryParameters := map[string]interface{}{
10111		"api-version": APIVersion,
10112	}
10113	if timeout != nil {
10114		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10115	} else {
10116		queryParameters["timeout"] = autorest.Encode("query", 60)
10117	}
10118
10119	preparer := autorest.CreatePreparer(
10120		autorest.AsGet(),
10121		autorest.WithBaseURL(client.BaseURI),
10122		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackupConfigurationInfo", pathParameters),
10123		autorest.WithQueryParameters(queryParameters))
10124	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10125}
10126
10127// GetPartitionBackupConfigurationInfoSender sends the GetPartitionBackupConfigurationInfo request. The method will close the
10128// http.Response Body if it receives an error.
10129func (client BaseClient) GetPartitionBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) {
10130	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10131}
10132
10133// GetPartitionBackupConfigurationInfoResponder handles the response to the GetPartitionBackupConfigurationInfo request. The method always
10134// closes the http.Response Body.
10135func (client BaseClient) GetPartitionBackupConfigurationInfoResponder(resp *http.Response) (result PartitionBackupConfigurationInfo, err error) {
10136	err = autorest.Respond(
10137		resp,
10138		azure.WithErrorUnlessStatusCode(http.StatusOK),
10139		autorest.ByUnmarshallingJSON(&result),
10140		autorest.ByClosing())
10141	result.Response = autorest.Response{Response: resp}
10142	return
10143}
10144
10145// GetPartitionBackupList returns a list of backups available for the specified partition. The server enumerates all
10146// the backups available in the backup store configured in the backup policy. It also allows filtering of the result
10147// based on start and end datetime or just fetching the latest available backup for the partition.
10148// Parameters:
10149// partitionID - the identity of the partition.
10150// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10151// duration that the client is willing to wait for the requested operation to complete. The default value for
10152// this parameter is 60 seconds.
10153// latest - specifies whether to get only the most recent backup available for a partition for the specified
10154// time range.
10155// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The
10156// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups
10157// from the beginning are enumerated.
10158// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date
10159// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is
10160// done till the most recent backup.
10161func (client BaseClient) GetPartitionBackupList(ctx context.Context, partitionID uuid.UUID, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time) (result PagedBackupInfoList, err error) {
10162	if tracing.IsEnabled() {
10163		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupList")
10164		defer func() {
10165			sc := -1
10166			if result.Response.Response != nil {
10167				sc = result.Response.Response.StatusCode
10168			}
10169			tracing.EndSpan(ctx, sc, err)
10170		}()
10171	}
10172	if err := validation.Validate([]validation.Validation{
10173		{TargetValue: timeout,
10174			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10175				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10176					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10177				}}}}}); err != nil {
10178		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupList", err.Error())
10179	}
10180
10181	req, err := client.GetPartitionBackupListPreparer(ctx, partitionID, timeout, latest, startDateTimeFilter, endDateTimeFilter)
10182	if err != nil {
10183		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", nil, "Failure preparing request")
10184		return
10185	}
10186
10187	resp, err := client.GetPartitionBackupListSender(req)
10188	if err != nil {
10189		result.Response = autorest.Response{Response: resp}
10190		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", resp, "Failure sending request")
10191		return
10192	}
10193
10194	result, err = client.GetPartitionBackupListResponder(resp)
10195	if err != nil {
10196		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", resp, "Failure responding to request")
10197		return
10198	}
10199
10200	return
10201}
10202
10203// GetPartitionBackupListPreparer prepares the GetPartitionBackupList request.
10204func (client BaseClient) GetPartitionBackupListPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time) (*http.Request, error) {
10205	pathParameters := map[string]interface{}{
10206		"partitionId": partitionID,
10207	}
10208
10209	const APIVersion = "6.2-preview"
10210	queryParameters := map[string]interface{}{
10211		"api-version": APIVersion,
10212	}
10213	if timeout != nil {
10214		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10215	} else {
10216		queryParameters["timeout"] = autorest.Encode("query", 60)
10217	}
10218	if latest != nil {
10219		queryParameters["Latest"] = autorest.Encode("query", *latest)
10220	} else {
10221		queryParameters["Latest"] = autorest.Encode("query", false)
10222	}
10223	if startDateTimeFilter != nil {
10224		queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter)
10225	}
10226	if endDateTimeFilter != nil {
10227		queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter)
10228	}
10229
10230	preparer := autorest.CreatePreparer(
10231		autorest.AsGet(),
10232		autorest.WithBaseURL(client.BaseURI),
10233		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackups", pathParameters),
10234		autorest.WithQueryParameters(queryParameters))
10235	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10236}
10237
10238// GetPartitionBackupListSender sends the GetPartitionBackupList request. The method will close the
10239// http.Response Body if it receives an error.
10240func (client BaseClient) GetPartitionBackupListSender(req *http.Request) (*http.Response, error) {
10241	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10242}
10243
10244// GetPartitionBackupListResponder handles the response to the GetPartitionBackupList request. The method always
10245// closes the http.Response Body.
10246func (client BaseClient) GetPartitionBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) {
10247	err = autorest.Respond(
10248		resp,
10249		azure.WithErrorUnlessStatusCode(http.StatusOK),
10250		autorest.ByUnmarshallingJSON(&result),
10251		autorest.ByClosing())
10252	result.Response = autorest.Response{Response: resp}
10253	return
10254}
10255
10256// GetPartitionBackupProgress returns information about the state of the latest backup along with details or failure
10257// reason in case of completion.
10258// Parameters:
10259// partitionID - the identity of the partition.
10260// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10261// duration that the client is willing to wait for the requested operation to complete. The default value for
10262// this parameter is 60 seconds.
10263func (client BaseClient) GetPartitionBackupProgress(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result BackupProgressInfo, err error) {
10264	if tracing.IsEnabled() {
10265		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupProgress")
10266		defer func() {
10267			sc := -1
10268			if result.Response.Response != nil {
10269				sc = result.Response.Response.StatusCode
10270			}
10271			tracing.EndSpan(ctx, sc, err)
10272		}()
10273	}
10274	if err := validation.Validate([]validation.Validation{
10275		{TargetValue: timeout,
10276			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10277				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10278					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10279				}}}}}); err != nil {
10280		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupProgress", err.Error())
10281	}
10282
10283	req, err := client.GetPartitionBackupProgressPreparer(ctx, partitionID, timeout)
10284	if err != nil {
10285		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", nil, "Failure preparing request")
10286		return
10287	}
10288
10289	resp, err := client.GetPartitionBackupProgressSender(req)
10290	if err != nil {
10291		result.Response = autorest.Response{Response: resp}
10292		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", resp, "Failure sending request")
10293		return
10294	}
10295
10296	result, err = client.GetPartitionBackupProgressResponder(resp)
10297	if err != nil {
10298		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", resp, "Failure responding to request")
10299		return
10300	}
10301
10302	return
10303}
10304
10305// GetPartitionBackupProgressPreparer prepares the GetPartitionBackupProgress request.
10306func (client BaseClient) GetPartitionBackupProgressPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
10307	pathParameters := map[string]interface{}{
10308		"partitionId": partitionID,
10309	}
10310
10311	const APIVersion = "6.2-preview"
10312	queryParameters := map[string]interface{}{
10313		"api-version": APIVersion,
10314	}
10315	if timeout != nil {
10316		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10317	} else {
10318		queryParameters["timeout"] = autorest.Encode("query", 60)
10319	}
10320
10321	preparer := autorest.CreatePreparer(
10322		autorest.AsGet(),
10323		autorest.WithBaseURL(client.BaseURI),
10324		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackupProgress", pathParameters),
10325		autorest.WithQueryParameters(queryParameters))
10326	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10327}
10328
10329// GetPartitionBackupProgressSender sends the GetPartitionBackupProgress request. The method will close the
10330// http.Response Body if it receives an error.
10331func (client BaseClient) GetPartitionBackupProgressSender(req *http.Request) (*http.Response, error) {
10332	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10333}
10334
10335// GetPartitionBackupProgressResponder handles the response to the GetPartitionBackupProgress request. The method always
10336// closes the http.Response Body.
10337func (client BaseClient) GetPartitionBackupProgressResponder(resp *http.Response) (result BackupProgressInfo, err error) {
10338	err = autorest.Respond(
10339		resp,
10340		azure.WithErrorUnlessStatusCode(http.StatusOK),
10341		autorest.ByUnmarshallingJSON(&result),
10342		autorest.ByClosing())
10343	result.Response = autorest.Response{Response: resp}
10344	return
10345}
10346
10347// GetPartitionEventList the response is list of PartitionEvent objects.
10348// Parameters:
10349// partitionID - the identity of the partition.
10350// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
10351// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
10352// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10353// duration that the client is willing to wait for the requested operation to complete. The default value for
10354// this parameter is 60 seconds.
10355// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
10356// be included in the response.
10357// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
10358// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
10359// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
10360// populated.
10361func (client BaseClient) GetPartitionEventList(ctx context.Context, partitionID uuid.UUID, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListPartitionEvent, err error) {
10362	if tracing.IsEnabled() {
10363		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionEventList")
10364		defer func() {
10365			sc := -1
10366			if result.Response.Response != nil {
10367				sc = result.Response.Response.StatusCode
10368			}
10369			tracing.EndSpan(ctx, sc, err)
10370		}()
10371	}
10372	if err := validation.Validate([]validation.Validation{
10373		{TargetValue: timeout,
10374			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10375				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10376					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10377				}}}}}); err != nil {
10378		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionEventList", err.Error())
10379	}
10380
10381	req, err := client.GetPartitionEventListPreparer(ctx, partitionID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
10382	if err != nil {
10383		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", nil, "Failure preparing request")
10384		return
10385	}
10386
10387	resp, err := client.GetPartitionEventListSender(req)
10388	if err != nil {
10389		result.Response = autorest.Response{Response: resp}
10390		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", resp, "Failure sending request")
10391		return
10392	}
10393
10394	result, err = client.GetPartitionEventListResponder(resp)
10395	if err != nil {
10396		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", resp, "Failure responding to request")
10397		return
10398	}
10399
10400	return
10401}
10402
10403// GetPartitionEventListPreparer prepares the GetPartitionEventList request.
10404func (client BaseClient) GetPartitionEventListPreparer(ctx context.Context, partitionID uuid.UUID, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
10405	pathParameters := map[string]interface{}{
10406		"partitionId": partitionID,
10407	}
10408
10409	const APIVersion = "6.2-preview"
10410	queryParameters := map[string]interface{}{
10411		"api-version":  APIVersion,
10412		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
10413		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
10414	}
10415	if timeout != nil {
10416		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10417	} else {
10418		queryParameters["timeout"] = autorest.Encode("query", 60)
10419	}
10420	if len(eventsTypesFilter) > 0 {
10421		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
10422	}
10423	if excludeAnalysisEvents != nil {
10424		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
10425	}
10426	if skipCorrelationLookup != nil {
10427		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
10428	}
10429
10430	preparer := autorest.CreatePreparer(
10431		autorest.AsGet(),
10432		autorest.WithBaseURL(client.BaseURI),
10433		autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Events", pathParameters),
10434		autorest.WithQueryParameters(queryParameters))
10435	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10436}
10437
10438// GetPartitionEventListSender sends the GetPartitionEventList request. The method will close the
10439// http.Response Body if it receives an error.
10440func (client BaseClient) GetPartitionEventListSender(req *http.Request) (*http.Response, error) {
10441	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10442}
10443
10444// GetPartitionEventListResponder handles the response to the GetPartitionEventList request. The method always
10445// closes the http.Response Body.
10446func (client BaseClient) GetPartitionEventListResponder(resp *http.Response) (result ListPartitionEvent, err error) {
10447	err = autorest.Respond(
10448		resp,
10449		azure.WithErrorUnlessStatusCode(http.StatusOK),
10450		autorest.ByUnmarshallingJSON(&result),
10451		autorest.ByClosing())
10452	result.Response = autorest.Response{Response: resp}
10453	return
10454}
10455
10456// GetPartitionHealth gets the health information of the specified partition.
10457// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health
10458// state.
10459// Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition.
10460// If you specify a partition that does not exist in the health store, this request returns an error.
10461// Parameters:
10462// partitionID - the identity of the partition.
10463// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
10464// state.
10465// The possible values for this parameter include integer value of one of the following health states.
10466// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
10467// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
10468// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
10469// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
10470//
10471// - Default - Default value. Matches any HealthState. The value is zero.
10472// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
10473// collection of states. The value is 1.
10474// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
10475// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
10476// - Error - Filter that matches input with HealthState value Error. The value is 8.
10477// - All - Filter that matches input with any HealthState value. The value is 65535.
10478// replicasHealthStateFilter - allows filtering the collection of ReplicaHealthState objects on the partition.
10479// The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only replicas
10480// that match the filter will be returned. All replicas will be used to evaluate the aggregated health state.
10481// If not specified, all entries will be returned.The state values are flag based enumeration, so the value
10482// could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided
10483// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) will be returned. The
10484// possible values for this parameter include integer value of one of the following health states.
10485//
10486// - Default - Default value. Matches any HealthState. The value is zero.
10487// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
10488// collection of states. The value is 1.
10489// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
10490// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
10491// - Error - Filter that matches input with HealthState value Error. The value is 8.
10492// - All - Filter that matches input with any HealthState value. The value is 65535.
10493// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
10494// result. False by default.
10495// The statistics show the number of children entities in health state Ok, Warning, and Error.
10496// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10497// duration that the client is willing to wait for the requested operation to complete. The default value for
10498// this parameter is 60 seconds.
10499func (client BaseClient) GetPartitionHealth(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result PartitionHealth, err error) {
10500	if tracing.IsEnabled() {
10501		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionHealth")
10502		defer func() {
10503			sc := -1
10504			if result.Response.Response != nil {
10505				sc = result.Response.Response.StatusCode
10506			}
10507			tracing.EndSpan(ctx, sc, err)
10508		}()
10509	}
10510	if err := validation.Validate([]validation.Validation{
10511		{TargetValue: timeout,
10512			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10513				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10514					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10515				}}}}}); err != nil {
10516		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealth", err.Error())
10517	}
10518
10519	req, err := client.GetPartitionHealthPreparer(ctx, partitionID, eventsHealthStateFilter, replicasHealthStateFilter, excludeHealthStatistics, timeout)
10520	if err != nil {
10521		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", nil, "Failure preparing request")
10522		return
10523	}
10524
10525	resp, err := client.GetPartitionHealthSender(req)
10526	if err != nil {
10527		result.Response = autorest.Response{Response: resp}
10528		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", resp, "Failure sending request")
10529		return
10530	}
10531
10532	result, err = client.GetPartitionHealthResponder(resp)
10533	if err != nil {
10534		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", resp, "Failure responding to request")
10535		return
10536	}
10537
10538	return
10539}
10540
10541// GetPartitionHealthPreparer prepares the GetPartitionHealth request.
10542func (client BaseClient) GetPartitionHealthPreparer(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
10543	pathParameters := map[string]interface{}{
10544		"partitionId": partitionID,
10545	}
10546
10547	const APIVersion = "6.0"
10548	queryParameters := map[string]interface{}{
10549		"api-version": APIVersion,
10550	}
10551	if eventsHealthStateFilter != nil {
10552		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
10553	} else {
10554		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
10555	}
10556	if replicasHealthStateFilter != nil {
10557		queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", *replicasHealthStateFilter)
10558	} else {
10559		queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", 0)
10560	}
10561	if excludeHealthStatistics != nil {
10562		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
10563	} else {
10564		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
10565	}
10566	if timeout != nil {
10567		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10568	} else {
10569		queryParameters["timeout"] = autorest.Encode("query", 60)
10570	}
10571
10572	preparer := autorest.CreatePreparer(
10573		autorest.AsGet(),
10574		autorest.WithBaseURL(client.BaseURI),
10575		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetHealth", pathParameters),
10576		autorest.WithQueryParameters(queryParameters))
10577	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10578}
10579
10580// GetPartitionHealthSender sends the GetPartitionHealth request. The method will close the
10581// http.Response Body if it receives an error.
10582func (client BaseClient) GetPartitionHealthSender(req *http.Request) (*http.Response, error) {
10583	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10584}
10585
10586// GetPartitionHealthResponder handles the response to the GetPartitionHealth request. The method always
10587// closes the http.Response Body.
10588func (client BaseClient) GetPartitionHealthResponder(resp *http.Response) (result PartitionHealth, err error) {
10589	err = autorest.Respond(
10590		resp,
10591		azure.WithErrorUnlessStatusCode(http.StatusOK),
10592		autorest.ByUnmarshallingJSON(&result),
10593		autorest.ByClosing())
10594	result.Response = autorest.Response{Response: resp}
10595	return
10596}
10597
10598// GetPartitionHealthUsingPolicy gets the health information of the specified partition.
10599// If the application health policy is specified, the health evaluation uses it to get the aggregated health state.
10600// If the policy is not specified, the health evaluation uses the application health policy defined in the application
10601// manifest, or the default health policy, if no policy is defined in the manifest.
10602// Use EventsHealthStateFilter to filter the collection of health events reported on the partition based on the health
10603// state.
10604// Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. Use
10605// ApplicationHealthPolicy in the POST body to override the health policies used to evaluate the health.
10606// If you specify a partition that does not exist in the health store, this request returns an error.
10607// Parameters:
10608// partitionID - the identity of the partition.
10609// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
10610// state.
10611// The possible values for this parameter include integer value of one of the following health states.
10612// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
10613// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
10614// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
10615// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
10616//
10617// - Default - Default value. Matches any HealthState. The value is zero.
10618// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
10619// collection of states. The value is 1.
10620// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
10621// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
10622// - Error - Filter that matches input with HealthState value Error. The value is 8.
10623// - All - Filter that matches input with any HealthState value. The value is 65535.
10624// replicasHealthStateFilter - allows filtering the collection of ReplicaHealthState objects on the partition.
10625// The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only replicas
10626// that match the filter will be returned. All replicas will be used to evaluate the aggregated health state.
10627// If not specified, all entries will be returned.The state values are flag based enumeration, so the value
10628// could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided
10629// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) will be returned. The
10630// possible values for this parameter include integer value of one of the following health states.
10631//
10632// - Default - Default value. Matches any HealthState. The value is zero.
10633// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
10634// collection of states. The value is 1.
10635// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
10636// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
10637// - Error - Filter that matches input with HealthState value Error. The value is 8.
10638// - All - Filter that matches input with any HealthState value. The value is 65535.
10639// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
10640// of its children.
10641// If not present, the health evaluation uses the health policy from application manifest or the default health
10642// policy.
10643// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
10644// result. False by default.
10645// The statistics show the number of children entities in health state Ok, Warning, and Error.
10646// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10647// duration that the client is willing to wait for the requested operation to complete. The default value for
10648// this parameter is 60 seconds.
10649func (client BaseClient) GetPartitionHealthUsingPolicy(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result PartitionHealth, err error) {
10650	if tracing.IsEnabled() {
10651		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionHealthUsingPolicy")
10652		defer func() {
10653			sc := -1
10654			if result.Response.Response != nil {
10655				sc = result.Response.Response.StatusCode
10656			}
10657			tracing.EndSpan(ctx, sc, err)
10658		}()
10659	}
10660	if err := validation.Validate([]validation.Validation{
10661		{TargetValue: timeout,
10662			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10663				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10664					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10665				}}}}}); err != nil {
10666		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", err.Error())
10667	}
10668
10669	req, err := client.GetPartitionHealthUsingPolicyPreparer(ctx, partitionID, eventsHealthStateFilter, replicasHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout)
10670	if err != nil {
10671		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", nil, "Failure preparing request")
10672		return
10673	}
10674
10675	resp, err := client.GetPartitionHealthUsingPolicySender(req)
10676	if err != nil {
10677		result.Response = autorest.Response{Response: resp}
10678		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", resp, "Failure sending request")
10679		return
10680	}
10681
10682	result, err = client.GetPartitionHealthUsingPolicyResponder(resp)
10683	if err != nil {
10684		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", resp, "Failure responding to request")
10685		return
10686	}
10687
10688	return
10689}
10690
10691// GetPartitionHealthUsingPolicyPreparer prepares the GetPartitionHealthUsingPolicy request.
10692func (client BaseClient) GetPartitionHealthUsingPolicyPreparer(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
10693	pathParameters := map[string]interface{}{
10694		"partitionId": partitionID,
10695	}
10696
10697	const APIVersion = "6.0"
10698	queryParameters := map[string]interface{}{
10699		"api-version": APIVersion,
10700	}
10701	if eventsHealthStateFilter != nil {
10702		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
10703	} else {
10704		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
10705	}
10706	if replicasHealthStateFilter != nil {
10707		queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", *replicasHealthStateFilter)
10708	} else {
10709		queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", 0)
10710	}
10711	if excludeHealthStatistics != nil {
10712		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
10713	} else {
10714		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
10715	}
10716	if timeout != nil {
10717		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10718	} else {
10719		queryParameters["timeout"] = autorest.Encode("query", 60)
10720	}
10721
10722	preparer := autorest.CreatePreparer(
10723		autorest.AsContentType("application/json; charset=utf-8"),
10724		autorest.AsPost(),
10725		autorest.WithBaseURL(client.BaseURI),
10726		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetHealth", pathParameters),
10727		autorest.WithQueryParameters(queryParameters))
10728	if applicationHealthPolicy != nil {
10729		preparer = autorest.DecoratePreparer(preparer,
10730			autorest.WithJSON(applicationHealthPolicy))
10731	}
10732	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10733}
10734
10735// GetPartitionHealthUsingPolicySender sends the GetPartitionHealthUsingPolicy request. The method will close the
10736// http.Response Body if it receives an error.
10737func (client BaseClient) GetPartitionHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
10738	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10739}
10740
10741// GetPartitionHealthUsingPolicyResponder handles the response to the GetPartitionHealthUsingPolicy request. The method always
10742// closes the http.Response Body.
10743func (client BaseClient) GetPartitionHealthUsingPolicyResponder(resp *http.Response) (result PartitionHealth, err error) {
10744	err = autorest.Respond(
10745		resp,
10746		azure.WithErrorUnlessStatusCode(http.StatusOK),
10747		autorest.ByUnmarshallingJSON(&result),
10748		autorest.ByClosing())
10749	result.Response = autorest.Response{Response: resp}
10750	return
10751}
10752
10753// GetPartitionInfo gets the information about the specified partition. The response includes the partition ID,
10754// partitioning scheme information, keys supported by the partition, status, health, and other details about the
10755// partition.
10756// Parameters:
10757// partitionID - the identity of the partition.
10758// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10759// duration that the client is willing to wait for the requested operation to complete. The default value for
10760// this parameter is 60 seconds.
10761func (client BaseClient) GetPartitionInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result ServicePartitionInfoModel, err error) {
10762	if tracing.IsEnabled() {
10763		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionInfo")
10764		defer func() {
10765			sc := -1
10766			if result.Response.Response != nil {
10767				sc = result.Response.Response.StatusCode
10768			}
10769			tracing.EndSpan(ctx, sc, err)
10770		}()
10771	}
10772	if err := validation.Validate([]validation.Validation{
10773		{TargetValue: timeout,
10774			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10775				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10776					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10777				}}}}}); err != nil {
10778		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfo", err.Error())
10779	}
10780
10781	req, err := client.GetPartitionInfoPreparer(ctx, partitionID, timeout)
10782	if err != nil {
10783		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", nil, "Failure preparing request")
10784		return
10785	}
10786
10787	resp, err := client.GetPartitionInfoSender(req)
10788	if err != nil {
10789		result.Response = autorest.Response{Response: resp}
10790		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", resp, "Failure sending request")
10791		return
10792	}
10793
10794	result, err = client.GetPartitionInfoResponder(resp)
10795	if err != nil {
10796		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", resp, "Failure responding to request")
10797		return
10798	}
10799
10800	return
10801}
10802
10803// GetPartitionInfoPreparer prepares the GetPartitionInfo request.
10804func (client BaseClient) GetPartitionInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
10805	pathParameters := map[string]interface{}{
10806		"partitionId": partitionID,
10807	}
10808
10809	const APIVersion = "6.0"
10810	queryParameters := map[string]interface{}{
10811		"api-version": APIVersion,
10812	}
10813	if timeout != nil {
10814		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10815	} else {
10816		queryParameters["timeout"] = autorest.Encode("query", 60)
10817	}
10818
10819	preparer := autorest.CreatePreparer(
10820		autorest.AsGet(),
10821		autorest.WithBaseURL(client.BaseURI),
10822		autorest.WithPathParameters("/Partitions/{partitionId}", pathParameters),
10823		autorest.WithQueryParameters(queryParameters))
10824	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10825}
10826
10827// GetPartitionInfoSender sends the GetPartitionInfo request. The method will close the
10828// http.Response Body if it receives an error.
10829func (client BaseClient) GetPartitionInfoSender(req *http.Request) (*http.Response, error) {
10830	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10831}
10832
10833// GetPartitionInfoResponder handles the response to the GetPartitionInfo request. The method always
10834// closes the http.Response Body.
10835func (client BaseClient) GetPartitionInfoResponder(resp *http.Response) (result ServicePartitionInfoModel, err error) {
10836	err = autorest.Respond(
10837		resp,
10838		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
10839		autorest.ByUnmarshallingJSON(&result),
10840		autorest.ByClosing())
10841	result.Response = autorest.Response{Response: resp}
10842	return
10843}
10844
10845// GetPartitionInfoList gets the list of partitions of a Service Fabric service. The response includes the partition
10846// ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the
10847// partition.
10848// Parameters:
10849// serviceID - the identity of the service. This is typically the full name of the service without the
10850// 'fabric:' URI scheme.
10851// Starting from version 6.0, hierarchical names are delimited with the "~" character.
10852// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
10853// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
10854// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
10855// token with a non empty value is included in the response of the API when the results from the system do not
10856// fit in a single response. When this value is passed to the next API call, the API returns next set of
10857// results. If there are no further results then the continuation token does not contain a value. The value of
10858// this parameter should not be URL encoded.
10859// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10860// duration that the client is willing to wait for the requested operation to complete. The default value for
10861// this parameter is 60 seconds.
10862func (client BaseClient) GetPartitionInfoList(ctx context.Context, serviceID string, continuationToken string, timeout *int64) (result PagedServicePartitionInfoList, err error) {
10863	if tracing.IsEnabled() {
10864		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionInfoList")
10865		defer func() {
10866			sc := -1
10867			if result.Response.Response != nil {
10868				sc = result.Response.Response.StatusCode
10869			}
10870			tracing.EndSpan(ctx, sc, err)
10871		}()
10872	}
10873	if err := validation.Validate([]validation.Validation{
10874		{TargetValue: timeout,
10875			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10876				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10877					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10878				}}}}}); err != nil {
10879		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfoList", err.Error())
10880	}
10881
10882	req, err := client.GetPartitionInfoListPreparer(ctx, serviceID, continuationToken, timeout)
10883	if err != nil {
10884		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", nil, "Failure preparing request")
10885		return
10886	}
10887
10888	resp, err := client.GetPartitionInfoListSender(req)
10889	if err != nil {
10890		result.Response = autorest.Response{Response: resp}
10891		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", resp, "Failure sending request")
10892		return
10893	}
10894
10895	result, err = client.GetPartitionInfoListResponder(resp)
10896	if err != nil {
10897		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", resp, "Failure responding to request")
10898		return
10899	}
10900
10901	return
10902}
10903
10904// GetPartitionInfoListPreparer prepares the GetPartitionInfoList request.
10905func (client BaseClient) GetPartitionInfoListPreparer(ctx context.Context, serviceID string, continuationToken string, timeout *int64) (*http.Request, error) {
10906	pathParameters := map[string]interface{}{
10907		"serviceId": serviceID,
10908	}
10909
10910	const APIVersion = "6.0"
10911	queryParameters := map[string]interface{}{
10912		"api-version": APIVersion,
10913	}
10914	if len(continuationToken) > 0 {
10915		queryParameters["ContinuationToken"] = continuationToken
10916	}
10917	if timeout != nil {
10918		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10919	} else {
10920		queryParameters["timeout"] = autorest.Encode("query", 60)
10921	}
10922
10923	preparer := autorest.CreatePreparer(
10924		autorest.AsGet(),
10925		autorest.WithBaseURL(client.BaseURI),
10926		autorest.WithPathParameters("/Services/{serviceId}/$/GetPartitions", pathParameters),
10927		autorest.WithQueryParameters(queryParameters))
10928	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10929}
10930
10931// GetPartitionInfoListSender sends the GetPartitionInfoList request. The method will close the
10932// http.Response Body if it receives an error.
10933func (client BaseClient) GetPartitionInfoListSender(req *http.Request) (*http.Response, error) {
10934	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10935}
10936
10937// GetPartitionInfoListResponder handles the response to the GetPartitionInfoList request. The method always
10938// closes the http.Response Body.
10939func (client BaseClient) GetPartitionInfoListResponder(resp *http.Response) (result PagedServicePartitionInfoList, err error) {
10940	err = autorest.Respond(
10941		resp,
10942		azure.WithErrorUnlessStatusCode(http.StatusOK),
10943		autorest.ByUnmarshallingJSON(&result),
10944		autorest.ByClosing())
10945	result.Response = autorest.Response{Response: resp}
10946	return
10947}
10948
10949// GetPartitionLoadInformation returns information about the load of a specified partition.
10950// The response includes a list of load reports for a Service Fabric partition.
10951// Each report includes the load metric name, value, and last reported time in UTC.
10952// Parameters:
10953// partitionID - the identity of the partition.
10954// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10955// duration that the client is willing to wait for the requested operation to complete. The default value for
10956// this parameter is 60 seconds.
10957func (client BaseClient) GetPartitionLoadInformation(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result PartitionLoadInformation, err error) {
10958	if tracing.IsEnabled() {
10959		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionLoadInformation")
10960		defer func() {
10961			sc := -1
10962			if result.Response.Response != nil {
10963				sc = result.Response.Response.StatusCode
10964			}
10965			tracing.EndSpan(ctx, sc, err)
10966		}()
10967	}
10968	if err := validation.Validate([]validation.Validation{
10969		{TargetValue: timeout,
10970			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10971				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10972					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10973				}}}}}); err != nil {
10974		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionLoadInformation", err.Error())
10975	}
10976
10977	req, err := client.GetPartitionLoadInformationPreparer(ctx, partitionID, timeout)
10978	if err != nil {
10979		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", nil, "Failure preparing request")
10980		return
10981	}
10982
10983	resp, err := client.GetPartitionLoadInformationSender(req)
10984	if err != nil {
10985		result.Response = autorest.Response{Response: resp}
10986		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", resp, "Failure sending request")
10987		return
10988	}
10989
10990	result, err = client.GetPartitionLoadInformationResponder(resp)
10991	if err != nil {
10992		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", resp, "Failure responding to request")
10993		return
10994	}
10995
10996	return
10997}
10998
10999// GetPartitionLoadInformationPreparer prepares the GetPartitionLoadInformation request.
11000func (client BaseClient) GetPartitionLoadInformationPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
11001	pathParameters := map[string]interface{}{
11002		"partitionId": partitionID,
11003	}
11004
11005	const APIVersion = "6.0"
11006	queryParameters := map[string]interface{}{
11007		"api-version": APIVersion,
11008	}
11009	if timeout != nil {
11010		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11011	} else {
11012		queryParameters["timeout"] = autorest.Encode("query", 60)
11013	}
11014
11015	preparer := autorest.CreatePreparer(
11016		autorest.AsGet(),
11017		autorest.WithBaseURL(client.BaseURI),
11018		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetLoadInformation", pathParameters),
11019		autorest.WithQueryParameters(queryParameters))
11020	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11021}
11022
11023// GetPartitionLoadInformationSender sends the GetPartitionLoadInformation request. The method will close the
11024// http.Response Body if it receives an error.
11025func (client BaseClient) GetPartitionLoadInformationSender(req *http.Request) (*http.Response, error) {
11026	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11027}
11028
11029// GetPartitionLoadInformationResponder handles the response to the GetPartitionLoadInformation request. The method always
11030// closes the http.Response Body.
11031func (client BaseClient) GetPartitionLoadInformationResponder(resp *http.Response) (result PartitionLoadInformation, err error) {
11032	err = autorest.Respond(
11033		resp,
11034		azure.WithErrorUnlessStatusCode(http.StatusOK),
11035		autorest.ByUnmarshallingJSON(&result),
11036		autorest.ByClosing())
11037	result.Response = autorest.Response{Response: resp}
11038	return
11039}
11040
11041// GetPartitionReplicaEventList the response is list of ReplicaEvent objects.
11042// Parameters:
11043// partitionID - the identity of the partition.
11044// replicaID - the identifier of the replica.
11045// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11046// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11047// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11048// duration that the client is willing to wait for the requested operation to complete. The default value for
11049// this parameter is 60 seconds.
11050// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
11051// be included in the response.
11052// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
11053// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
11054// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
11055// populated.
11056func (client BaseClient) GetPartitionReplicaEventList(ctx context.Context, partitionID uuid.UUID, replicaID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListReplicaEvent, err error) {
11057	if tracing.IsEnabled() {
11058		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionReplicaEventList")
11059		defer func() {
11060			sc := -1
11061			if result.Response.Response != nil {
11062				sc = result.Response.Response.StatusCode
11063			}
11064			tracing.EndSpan(ctx, sc, err)
11065		}()
11066	}
11067	if err := validation.Validate([]validation.Validation{
11068		{TargetValue: timeout,
11069			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11070				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11071					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11072				}}}}}); err != nil {
11073		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionReplicaEventList", err.Error())
11074	}
11075
11076	req, err := client.GetPartitionReplicaEventListPreparer(ctx, partitionID, replicaID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
11077	if err != nil {
11078		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", nil, "Failure preparing request")
11079		return
11080	}
11081
11082	resp, err := client.GetPartitionReplicaEventListSender(req)
11083	if err != nil {
11084		result.Response = autorest.Response{Response: resp}
11085		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", resp, "Failure sending request")
11086		return
11087	}
11088
11089	result, err = client.GetPartitionReplicaEventListResponder(resp)
11090	if err != nil {
11091		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", resp, "Failure responding to request")
11092		return
11093	}
11094
11095	return
11096}
11097
11098// GetPartitionReplicaEventListPreparer prepares the GetPartitionReplicaEventList request.
11099func (client BaseClient) GetPartitionReplicaEventListPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
11100	pathParameters := map[string]interface{}{
11101		"partitionId": partitionID,
11102		"replicaId":   replicaID,
11103	}
11104
11105	const APIVersion = "6.2-preview"
11106	queryParameters := map[string]interface{}{
11107		"api-version":  APIVersion,
11108		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
11109		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
11110	}
11111	if timeout != nil {
11112		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11113	} else {
11114		queryParameters["timeout"] = autorest.Encode("query", 60)
11115	}
11116	if len(eventsTypesFilter) > 0 {
11117		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
11118	}
11119	if excludeAnalysisEvents != nil {
11120		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
11121	}
11122	if skipCorrelationLookup != nil {
11123		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
11124	}
11125
11126	preparer := autorest.CreatePreparer(
11127		autorest.AsGet(),
11128		autorest.WithBaseURL(client.BaseURI),
11129		autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Replicas/{replicaId}/$/Events", pathParameters),
11130		autorest.WithQueryParameters(queryParameters))
11131	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11132}
11133
11134// GetPartitionReplicaEventListSender sends the GetPartitionReplicaEventList request. The method will close the
11135// http.Response Body if it receives an error.
11136func (client BaseClient) GetPartitionReplicaEventListSender(req *http.Request) (*http.Response, error) {
11137	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11138}
11139
11140// GetPartitionReplicaEventListResponder handles the response to the GetPartitionReplicaEventList request. The method always
11141// closes the http.Response Body.
11142func (client BaseClient) GetPartitionReplicaEventListResponder(resp *http.Response) (result ListReplicaEvent, err error) {
11143	err = autorest.Respond(
11144		resp,
11145		azure.WithErrorUnlessStatusCode(http.StatusOK),
11146		autorest.ByUnmarshallingJSON(&result),
11147		autorest.ByClosing())
11148	result.Response = autorest.Response{Response: resp}
11149	return
11150}
11151
11152// GetPartitionReplicasEventList the response is list of ReplicaEvent objects.
11153// Parameters:
11154// partitionID - the identity of the partition.
11155// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11156// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11157// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11158// duration that the client is willing to wait for the requested operation to complete. The default value for
11159// this parameter is 60 seconds.
11160// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
11161// be included in the response.
11162// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
11163// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
11164// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
11165// populated.
11166func (client BaseClient) GetPartitionReplicasEventList(ctx context.Context, partitionID uuid.UUID, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListReplicaEvent, err error) {
11167	if tracing.IsEnabled() {
11168		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionReplicasEventList")
11169		defer func() {
11170			sc := -1
11171			if result.Response.Response != nil {
11172				sc = result.Response.Response.StatusCode
11173			}
11174			tracing.EndSpan(ctx, sc, err)
11175		}()
11176	}
11177	if err := validation.Validate([]validation.Validation{
11178		{TargetValue: timeout,
11179			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11180				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11181					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11182				}}}}}); err != nil {
11183		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionReplicasEventList", err.Error())
11184	}
11185
11186	req, err := client.GetPartitionReplicasEventListPreparer(ctx, partitionID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
11187	if err != nil {
11188		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", nil, "Failure preparing request")
11189		return
11190	}
11191
11192	resp, err := client.GetPartitionReplicasEventListSender(req)
11193	if err != nil {
11194		result.Response = autorest.Response{Response: resp}
11195		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", resp, "Failure sending request")
11196		return
11197	}
11198
11199	result, err = client.GetPartitionReplicasEventListResponder(resp)
11200	if err != nil {
11201		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", resp, "Failure responding to request")
11202		return
11203	}
11204
11205	return
11206}
11207
11208// GetPartitionReplicasEventListPreparer prepares the GetPartitionReplicasEventList request.
11209func (client BaseClient) GetPartitionReplicasEventListPreparer(ctx context.Context, partitionID uuid.UUID, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
11210	pathParameters := map[string]interface{}{
11211		"partitionId": partitionID,
11212	}
11213
11214	const APIVersion = "6.2-preview"
11215	queryParameters := map[string]interface{}{
11216		"api-version":  APIVersion,
11217		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
11218		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
11219	}
11220	if timeout != nil {
11221		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11222	} else {
11223		queryParameters["timeout"] = autorest.Encode("query", 60)
11224	}
11225	if len(eventsTypesFilter) > 0 {
11226		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
11227	}
11228	if excludeAnalysisEvents != nil {
11229		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
11230	}
11231	if skipCorrelationLookup != nil {
11232		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
11233	}
11234
11235	preparer := autorest.CreatePreparer(
11236		autorest.AsGet(),
11237		autorest.WithBaseURL(client.BaseURI),
11238		autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Replicas/Events", pathParameters),
11239		autorest.WithQueryParameters(queryParameters))
11240	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11241}
11242
11243// GetPartitionReplicasEventListSender sends the GetPartitionReplicasEventList request. The method will close the
11244// http.Response Body if it receives an error.
11245func (client BaseClient) GetPartitionReplicasEventListSender(req *http.Request) (*http.Response, error) {
11246	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11247}
11248
11249// GetPartitionReplicasEventListResponder handles the response to the GetPartitionReplicasEventList request. The method always
11250// closes the http.Response Body.
11251func (client BaseClient) GetPartitionReplicasEventListResponder(resp *http.Response) (result ListReplicaEvent, err error) {
11252	err = autorest.Respond(
11253		resp,
11254		azure.WithErrorUnlessStatusCode(http.StatusOK),
11255		autorest.ByUnmarshallingJSON(&result),
11256		autorest.ByClosing())
11257	result.Response = autorest.Response{Response: resp}
11258	return
11259}
11260
11261// GetPartitionRestartProgress gets the progress of a PartitionRestart started with StartPartitionRestart using the
11262// provided OperationId.
11263// Parameters:
11264// serviceID - the identity of the service. This is typically the full name of the service without the
11265// 'fabric:' URI scheme.
11266// Starting from version 6.0, hierarchical names are delimited with the "~" character.
11267// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
11268// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
11269// partitionID - the identity of the partition.
11270// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
11271// API
11272// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11273// duration that the client is willing to wait for the requested operation to complete. The default value for
11274// this parameter is 60 seconds.
11275func (client BaseClient) GetPartitionRestartProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionRestartProgress, err error) {
11276	if tracing.IsEnabled() {
11277		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionRestartProgress")
11278		defer func() {
11279			sc := -1
11280			if result.Response.Response != nil {
11281				sc = result.Response.Response.StatusCode
11282			}
11283			tracing.EndSpan(ctx, sc, err)
11284		}()
11285	}
11286	if err := validation.Validate([]validation.Validation{
11287		{TargetValue: timeout,
11288			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11289				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11290					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11291				}}}}}); err != nil {
11292		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestartProgress", err.Error())
11293	}
11294
11295	req, err := client.GetPartitionRestartProgressPreparer(ctx, serviceID, partitionID, operationID, timeout)
11296	if err != nil {
11297		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", nil, "Failure preparing request")
11298		return
11299	}
11300
11301	resp, err := client.GetPartitionRestartProgressSender(req)
11302	if err != nil {
11303		result.Response = autorest.Response{Response: resp}
11304		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", resp, "Failure sending request")
11305		return
11306	}
11307
11308	result, err = client.GetPartitionRestartProgressResponder(resp)
11309	if err != nil {
11310		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", resp, "Failure responding to request")
11311		return
11312	}
11313
11314	return
11315}
11316
11317// GetPartitionRestartProgressPreparer prepares the GetPartitionRestartProgress request.
11318func (client BaseClient) GetPartitionRestartProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) {
11319	pathParameters := map[string]interface{}{
11320		"partitionId": partitionID,
11321		"serviceId":   serviceID,
11322	}
11323
11324	const APIVersion = "6.0"
11325	queryParameters := map[string]interface{}{
11326		"api-version": APIVersion,
11327		"OperationId": autorest.Encode("query", operationID),
11328	}
11329	if timeout != nil {
11330		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11331	} else {
11332		queryParameters["timeout"] = autorest.Encode("query", 60)
11333	}
11334
11335	preparer := autorest.CreatePreparer(
11336		autorest.AsGet(),
11337		autorest.WithBaseURL(client.BaseURI),
11338		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetRestartProgress", pathParameters),
11339		autorest.WithQueryParameters(queryParameters))
11340	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11341}
11342
11343// GetPartitionRestartProgressSender sends the GetPartitionRestartProgress request. The method will close the
11344// http.Response Body if it receives an error.
11345func (client BaseClient) GetPartitionRestartProgressSender(req *http.Request) (*http.Response, error) {
11346	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11347}
11348
11349// GetPartitionRestartProgressResponder handles the response to the GetPartitionRestartProgress request. The method always
11350// closes the http.Response Body.
11351func (client BaseClient) GetPartitionRestartProgressResponder(resp *http.Response) (result PartitionRestartProgress, err error) {
11352	err = autorest.Respond(
11353		resp,
11354		azure.WithErrorUnlessStatusCode(http.StatusOK),
11355		autorest.ByUnmarshallingJSON(&result),
11356		autorest.ByClosing())
11357	result.Response = autorest.Response{Response: resp}
11358	return
11359}
11360
11361// GetPartitionRestoreProgress returns information about the state of the latest restore operation along with details
11362// or failure reason in case of completion.
11363// Parameters:
11364// partitionID - the identity of the partition.
11365// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11366// duration that the client is willing to wait for the requested operation to complete. The default value for
11367// this parameter is 60 seconds.
11368func (client BaseClient) GetPartitionRestoreProgress(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result RestoreProgressInfo, err error) {
11369	if tracing.IsEnabled() {
11370		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionRestoreProgress")
11371		defer func() {
11372			sc := -1
11373			if result.Response.Response != nil {
11374				sc = result.Response.Response.StatusCode
11375			}
11376			tracing.EndSpan(ctx, sc, err)
11377		}()
11378	}
11379	if err := validation.Validate([]validation.Validation{
11380		{TargetValue: timeout,
11381			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11382				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11383					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11384				}}}}}); err != nil {
11385		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestoreProgress", err.Error())
11386	}
11387
11388	req, err := client.GetPartitionRestoreProgressPreparer(ctx, partitionID, timeout)
11389	if err != nil {
11390		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", nil, "Failure preparing request")
11391		return
11392	}
11393
11394	resp, err := client.GetPartitionRestoreProgressSender(req)
11395	if err != nil {
11396		result.Response = autorest.Response{Response: resp}
11397		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", resp, "Failure sending request")
11398		return
11399	}
11400
11401	result, err = client.GetPartitionRestoreProgressResponder(resp)
11402	if err != nil {
11403		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", resp, "Failure responding to request")
11404		return
11405	}
11406
11407	return
11408}
11409
11410// GetPartitionRestoreProgressPreparer prepares the GetPartitionRestoreProgress request.
11411func (client BaseClient) GetPartitionRestoreProgressPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
11412	pathParameters := map[string]interface{}{
11413		"partitionId": partitionID,
11414	}
11415
11416	const APIVersion = "6.2-preview"
11417	queryParameters := map[string]interface{}{
11418		"api-version": APIVersion,
11419	}
11420	if timeout != nil {
11421		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11422	} else {
11423		queryParameters["timeout"] = autorest.Encode("query", 60)
11424	}
11425
11426	preparer := autorest.CreatePreparer(
11427		autorest.AsGet(),
11428		autorest.WithBaseURL(client.BaseURI),
11429		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetRestoreProgress", pathParameters),
11430		autorest.WithQueryParameters(queryParameters))
11431	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11432}
11433
11434// GetPartitionRestoreProgressSender sends the GetPartitionRestoreProgress request. The method will close the
11435// http.Response Body if it receives an error.
11436func (client BaseClient) GetPartitionRestoreProgressSender(req *http.Request) (*http.Response, error) {
11437	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11438}
11439
11440// GetPartitionRestoreProgressResponder handles the response to the GetPartitionRestoreProgress request. The method always
11441// closes the http.Response Body.
11442func (client BaseClient) GetPartitionRestoreProgressResponder(resp *http.Response) (result RestoreProgressInfo, err error) {
11443	err = autorest.Respond(
11444		resp,
11445		azure.WithErrorUnlessStatusCode(http.StatusOK),
11446		autorest.ByUnmarshallingJSON(&result),
11447		autorest.ByClosing())
11448	result.Response = autorest.Response{Response: resp}
11449	return
11450}
11451
11452// GetPartitionsEventList the response is list of PartitionEvent objects.
11453// Parameters:
11454// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11455// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11456// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11457// duration that the client is willing to wait for the requested operation to complete. The default value for
11458// this parameter is 60 seconds.
11459// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
11460// be included in the response.
11461// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
11462// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
11463// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
11464// populated.
11465func (client BaseClient) GetPartitionsEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListPartitionEvent, err error) {
11466	if tracing.IsEnabled() {
11467		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionsEventList")
11468		defer func() {
11469			sc := -1
11470			if result.Response.Response != nil {
11471				sc = result.Response.Response.StatusCode
11472			}
11473			tracing.EndSpan(ctx, sc, err)
11474		}()
11475	}
11476	if err := validation.Validate([]validation.Validation{
11477		{TargetValue: timeout,
11478			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11479				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11480					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11481				}}}}}); err != nil {
11482		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionsEventList", err.Error())
11483	}
11484
11485	req, err := client.GetPartitionsEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
11486	if err != nil {
11487		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", nil, "Failure preparing request")
11488		return
11489	}
11490
11491	resp, err := client.GetPartitionsEventListSender(req)
11492	if err != nil {
11493		result.Response = autorest.Response{Response: resp}
11494		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", resp, "Failure sending request")
11495		return
11496	}
11497
11498	result, err = client.GetPartitionsEventListResponder(resp)
11499	if err != nil {
11500		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", resp, "Failure responding to request")
11501		return
11502	}
11503
11504	return
11505}
11506
11507// GetPartitionsEventListPreparer prepares the GetPartitionsEventList request.
11508func (client BaseClient) GetPartitionsEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
11509	const APIVersion = "6.2-preview"
11510	queryParameters := map[string]interface{}{
11511		"api-version":  APIVersion,
11512		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
11513		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
11514	}
11515	if timeout != nil {
11516		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11517	} else {
11518		queryParameters["timeout"] = autorest.Encode("query", 60)
11519	}
11520	if len(eventsTypesFilter) > 0 {
11521		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
11522	}
11523	if excludeAnalysisEvents != nil {
11524		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
11525	}
11526	if skipCorrelationLookup != nil {
11527		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
11528	}
11529
11530	preparer := autorest.CreatePreparer(
11531		autorest.AsGet(),
11532		autorest.WithBaseURL(client.BaseURI),
11533		autorest.WithPath("/EventsStore/Partitions/Events"),
11534		autorest.WithQueryParameters(queryParameters))
11535	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11536}
11537
11538// GetPartitionsEventListSender sends the GetPartitionsEventList request. The method will close the
11539// http.Response Body if it receives an error.
11540func (client BaseClient) GetPartitionsEventListSender(req *http.Request) (*http.Response, error) {
11541	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11542}
11543
11544// GetPartitionsEventListResponder handles the response to the GetPartitionsEventList request. The method always
11545// closes the http.Response Body.
11546func (client BaseClient) GetPartitionsEventListResponder(resp *http.Response) (result ListPartitionEvent, err error) {
11547	err = autorest.Respond(
11548		resp,
11549		azure.WithErrorUnlessStatusCode(http.StatusOK),
11550		autorest.ByUnmarshallingJSON(&result),
11551		autorest.ByClosing())
11552	result.Response = autorest.Response{Response: resp}
11553	return
11554}
11555
11556// GetPropertyInfo gets the specified Service Fabric property under a given name. This will always return both value
11557// and metadata.
11558// Parameters:
11559// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
11560// propertyName - specifies the name of the property to get.
11561// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11562// duration that the client is willing to wait for the requested operation to complete. The default value for
11563// this parameter is 60 seconds.
11564func (client BaseClient) GetPropertyInfo(ctx context.Context, nameID string, propertyName string, timeout *int64) (result PropertyInfo, err error) {
11565	if tracing.IsEnabled() {
11566		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPropertyInfo")
11567		defer func() {
11568			sc := -1
11569			if result.Response.Response != nil {
11570				sc = result.Response.Response.StatusCode
11571			}
11572			tracing.EndSpan(ctx, sc, err)
11573		}()
11574	}
11575	if err := validation.Validate([]validation.Validation{
11576		{TargetValue: timeout,
11577			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11578				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11579					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11580				}}}}}); err != nil {
11581		return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfo", err.Error())
11582	}
11583
11584	req, err := client.GetPropertyInfoPreparer(ctx, nameID, propertyName, timeout)
11585	if err != nil {
11586		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", nil, "Failure preparing request")
11587		return
11588	}
11589
11590	resp, err := client.GetPropertyInfoSender(req)
11591	if err != nil {
11592		result.Response = autorest.Response{Response: resp}
11593		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", resp, "Failure sending request")
11594		return
11595	}
11596
11597	result, err = client.GetPropertyInfoResponder(resp)
11598	if err != nil {
11599		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", resp, "Failure responding to request")
11600		return
11601	}
11602
11603	return
11604}
11605
11606// GetPropertyInfoPreparer prepares the GetPropertyInfo request.
11607func (client BaseClient) GetPropertyInfoPreparer(ctx context.Context, nameID string, propertyName string, timeout *int64) (*http.Request, error) {
11608	pathParameters := map[string]interface{}{
11609		"nameId": nameID,
11610	}
11611
11612	const APIVersion = "6.0"
11613	queryParameters := map[string]interface{}{
11614		"api-version":  APIVersion,
11615		"PropertyName": autorest.Encode("query", propertyName),
11616	}
11617	if timeout != nil {
11618		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11619	} else {
11620		queryParameters["timeout"] = autorest.Encode("query", 60)
11621	}
11622
11623	preparer := autorest.CreatePreparer(
11624		autorest.AsGet(),
11625		autorest.WithBaseURL(client.BaseURI),
11626		autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters),
11627		autorest.WithQueryParameters(queryParameters))
11628	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11629}
11630
11631// GetPropertyInfoSender sends the GetPropertyInfo request. The method will close the
11632// http.Response Body if it receives an error.
11633func (client BaseClient) GetPropertyInfoSender(req *http.Request) (*http.Response, error) {
11634	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11635}
11636
11637// GetPropertyInfoResponder handles the response to the GetPropertyInfo request. The method always
11638// closes the http.Response Body.
11639func (client BaseClient) GetPropertyInfoResponder(resp *http.Response) (result PropertyInfo, err error) {
11640	err = autorest.Respond(
11641		resp,
11642		azure.WithErrorUnlessStatusCode(http.StatusOK),
11643		autorest.ByUnmarshallingJSON(&result),
11644		autorest.ByClosing())
11645	result.Response = autorest.Response{Response: resp}
11646	return
11647}
11648
11649// GetPropertyInfoList a Service Fabric name can have one or more named properties that stores custom information. This
11650// operation gets the information about these properties in a paged list. The information include name, value and
11651// metadata about each of the properties.
11652// Parameters:
11653// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
11654// includeValues - allows specifying whether to include the values of the properties returned. True if values
11655// should be returned with the metadata; False to return only property metadata.
11656// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
11657// token with a non empty value is included in the response of the API when the results from the system do not
11658// fit in a single response. When this value is passed to the next API call, the API returns next set of
11659// results. If there are no further results then the continuation token does not contain a value. The value of
11660// this parameter should not be URL encoded.
11661// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11662// duration that the client is willing to wait for the requested operation to complete. The default value for
11663// this parameter is 60 seconds.
11664func (client BaseClient) GetPropertyInfoList(ctx context.Context, nameID string, includeValues *bool, continuationToken string, timeout *int64) (result PagedPropertyInfoList, err error) {
11665	if tracing.IsEnabled() {
11666		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPropertyInfoList")
11667		defer func() {
11668			sc := -1
11669			if result.Response.Response != nil {
11670				sc = result.Response.Response.StatusCode
11671			}
11672			tracing.EndSpan(ctx, sc, err)
11673		}()
11674	}
11675	if err := validation.Validate([]validation.Validation{
11676		{TargetValue: timeout,
11677			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11678				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11679					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11680				}}}}}); err != nil {
11681		return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfoList", err.Error())
11682	}
11683
11684	req, err := client.GetPropertyInfoListPreparer(ctx, nameID, includeValues, continuationToken, timeout)
11685	if err != nil {
11686		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", nil, "Failure preparing request")
11687		return
11688	}
11689
11690	resp, err := client.GetPropertyInfoListSender(req)
11691	if err != nil {
11692		result.Response = autorest.Response{Response: resp}
11693		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", resp, "Failure sending request")
11694		return
11695	}
11696
11697	result, err = client.GetPropertyInfoListResponder(resp)
11698	if err != nil {
11699		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", resp, "Failure responding to request")
11700		return
11701	}
11702
11703	return
11704}
11705
11706// GetPropertyInfoListPreparer prepares the GetPropertyInfoList request.
11707func (client BaseClient) GetPropertyInfoListPreparer(ctx context.Context, nameID string, includeValues *bool, continuationToken string, timeout *int64) (*http.Request, error) {
11708	pathParameters := map[string]interface{}{
11709		"nameId": nameID,
11710	}
11711
11712	const APIVersion = "6.0"
11713	queryParameters := map[string]interface{}{
11714		"api-version": APIVersion,
11715	}
11716	if includeValues != nil {
11717		queryParameters["IncludeValues"] = autorest.Encode("query", *includeValues)
11718	} else {
11719		queryParameters["IncludeValues"] = autorest.Encode("query", false)
11720	}
11721	if len(continuationToken) > 0 {
11722		queryParameters["ContinuationToken"] = continuationToken
11723	}
11724	if timeout != nil {
11725		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11726	} else {
11727		queryParameters["timeout"] = autorest.Encode("query", 60)
11728	}
11729
11730	preparer := autorest.CreatePreparer(
11731		autorest.AsGet(),
11732		autorest.WithBaseURL(client.BaseURI),
11733		autorest.WithPathParameters("/Names/{nameId}/$/GetProperties", pathParameters),
11734		autorest.WithQueryParameters(queryParameters))
11735	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11736}
11737
11738// GetPropertyInfoListSender sends the GetPropertyInfoList request. The method will close the
11739// http.Response Body if it receives an error.
11740func (client BaseClient) GetPropertyInfoListSender(req *http.Request) (*http.Response, error) {
11741	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11742}
11743
11744// GetPropertyInfoListResponder handles the response to the GetPropertyInfoList request. The method always
11745// closes the http.Response Body.
11746func (client BaseClient) GetPropertyInfoListResponder(resp *http.Response) (result PagedPropertyInfoList, err error) {
11747	err = autorest.Respond(
11748		resp,
11749		azure.WithErrorUnlessStatusCode(http.StatusOK),
11750		autorest.ByUnmarshallingJSON(&result),
11751		autorest.ByClosing())
11752	result.Response = autorest.Response{Response: resp}
11753	return
11754}
11755
11756// GetProvisionedFabricCodeVersionInfoList gets a list of information about fabric code versions that are provisioned
11757// in the cluster. The parameter CodeVersion can be used to optionally filter the output to only that particular
11758// version.
11759// Parameters:
11760// codeVersion - the product version of Service Fabric.
11761// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11762// duration that the client is willing to wait for the requested operation to complete. The default value for
11763// this parameter is 60 seconds.
11764func (client BaseClient) GetProvisionedFabricCodeVersionInfoList(ctx context.Context, codeVersion string, timeout *int64) (result ListFabricCodeVersionInfo, err error) {
11765	if tracing.IsEnabled() {
11766		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetProvisionedFabricCodeVersionInfoList")
11767		defer func() {
11768			sc := -1
11769			if result.Response.Response != nil {
11770				sc = result.Response.Response.StatusCode
11771			}
11772			tracing.EndSpan(ctx, sc, err)
11773		}()
11774	}
11775	if err := validation.Validate([]validation.Validation{
11776		{TargetValue: timeout,
11777			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11778				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11779					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11780				}}}}}); err != nil {
11781		return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", err.Error())
11782	}
11783
11784	req, err := client.GetProvisionedFabricCodeVersionInfoListPreparer(ctx, codeVersion, timeout)
11785	if err != nil {
11786		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", nil, "Failure preparing request")
11787		return
11788	}
11789
11790	resp, err := client.GetProvisionedFabricCodeVersionInfoListSender(req)
11791	if err != nil {
11792		result.Response = autorest.Response{Response: resp}
11793		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", resp, "Failure sending request")
11794		return
11795	}
11796
11797	result, err = client.GetProvisionedFabricCodeVersionInfoListResponder(resp)
11798	if err != nil {
11799		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", resp, "Failure responding to request")
11800		return
11801	}
11802
11803	return
11804}
11805
11806// GetProvisionedFabricCodeVersionInfoListPreparer prepares the GetProvisionedFabricCodeVersionInfoList request.
11807func (client BaseClient) GetProvisionedFabricCodeVersionInfoListPreparer(ctx context.Context, codeVersion string, timeout *int64) (*http.Request, error) {
11808	const APIVersion = "6.0"
11809	queryParameters := map[string]interface{}{
11810		"api-version": APIVersion,
11811	}
11812	if len(codeVersion) > 0 {
11813		queryParameters["CodeVersion"] = autorest.Encode("query", codeVersion)
11814	}
11815	if timeout != nil {
11816		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11817	} else {
11818		queryParameters["timeout"] = autorest.Encode("query", 60)
11819	}
11820
11821	preparer := autorest.CreatePreparer(
11822		autorest.AsGet(),
11823		autorest.WithBaseURL(client.BaseURI),
11824		autorest.WithPath("/$/GetProvisionedCodeVersions"),
11825		autorest.WithQueryParameters(queryParameters))
11826	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11827}
11828
11829// GetProvisionedFabricCodeVersionInfoListSender sends the GetProvisionedFabricCodeVersionInfoList request. The method will close the
11830// http.Response Body if it receives an error.
11831func (client BaseClient) GetProvisionedFabricCodeVersionInfoListSender(req *http.Request) (*http.Response, error) {
11832	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11833}
11834
11835// GetProvisionedFabricCodeVersionInfoListResponder handles the response to the GetProvisionedFabricCodeVersionInfoList request. The method always
11836// closes the http.Response Body.
11837func (client BaseClient) GetProvisionedFabricCodeVersionInfoListResponder(resp *http.Response) (result ListFabricCodeVersionInfo, err error) {
11838	err = autorest.Respond(
11839		resp,
11840		azure.WithErrorUnlessStatusCode(http.StatusOK),
11841		autorest.ByUnmarshallingJSON(&result.Value),
11842		autorest.ByClosing())
11843	result.Response = autorest.Response{Response: resp}
11844	return
11845}
11846
11847// GetProvisionedFabricConfigVersionInfoList gets a list of information about fabric config versions that are
11848// provisioned in the cluster. The parameter ConfigVersion can be used to optionally filter the output to only that
11849// particular version.
11850// Parameters:
11851// configVersion - the config version of Service Fabric.
11852// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11853// duration that the client is willing to wait for the requested operation to complete. The default value for
11854// this parameter is 60 seconds.
11855func (client BaseClient) GetProvisionedFabricConfigVersionInfoList(ctx context.Context, configVersion string, timeout *int64) (result ListFabricConfigVersionInfo, err error) {
11856	if tracing.IsEnabled() {
11857		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetProvisionedFabricConfigVersionInfoList")
11858		defer func() {
11859			sc := -1
11860			if result.Response.Response != nil {
11861				sc = result.Response.Response.StatusCode
11862			}
11863			tracing.EndSpan(ctx, sc, err)
11864		}()
11865	}
11866	if err := validation.Validate([]validation.Validation{
11867		{TargetValue: timeout,
11868			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11869				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11870					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11871				}}}}}); err != nil {
11872		return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", err.Error())
11873	}
11874
11875	req, err := client.GetProvisionedFabricConfigVersionInfoListPreparer(ctx, configVersion, timeout)
11876	if err != nil {
11877		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", nil, "Failure preparing request")
11878		return
11879	}
11880
11881	resp, err := client.GetProvisionedFabricConfigVersionInfoListSender(req)
11882	if err != nil {
11883		result.Response = autorest.Response{Response: resp}
11884		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", resp, "Failure sending request")
11885		return
11886	}
11887
11888	result, err = client.GetProvisionedFabricConfigVersionInfoListResponder(resp)
11889	if err != nil {
11890		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", resp, "Failure responding to request")
11891		return
11892	}
11893
11894	return
11895}
11896
11897// GetProvisionedFabricConfigVersionInfoListPreparer prepares the GetProvisionedFabricConfigVersionInfoList request.
11898func (client BaseClient) GetProvisionedFabricConfigVersionInfoListPreparer(ctx context.Context, configVersion string, timeout *int64) (*http.Request, error) {
11899	const APIVersion = "6.0"
11900	queryParameters := map[string]interface{}{
11901		"api-version": APIVersion,
11902	}
11903	if len(configVersion) > 0 {
11904		queryParameters["ConfigVersion"] = autorest.Encode("query", configVersion)
11905	}
11906	if timeout != nil {
11907		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11908	} else {
11909		queryParameters["timeout"] = autorest.Encode("query", 60)
11910	}
11911
11912	preparer := autorest.CreatePreparer(
11913		autorest.AsGet(),
11914		autorest.WithBaseURL(client.BaseURI),
11915		autorest.WithPath("/$/GetProvisionedConfigVersions"),
11916		autorest.WithQueryParameters(queryParameters))
11917	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11918}
11919
11920// GetProvisionedFabricConfigVersionInfoListSender sends the GetProvisionedFabricConfigVersionInfoList request. The method will close the
11921// http.Response Body if it receives an error.
11922func (client BaseClient) GetProvisionedFabricConfigVersionInfoListSender(req *http.Request) (*http.Response, error) {
11923	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11924}
11925
11926// GetProvisionedFabricConfigVersionInfoListResponder handles the response to the GetProvisionedFabricConfigVersionInfoList request. The method always
11927// closes the http.Response Body.
11928func (client BaseClient) GetProvisionedFabricConfigVersionInfoListResponder(resp *http.Response) (result ListFabricConfigVersionInfo, err error) {
11929	err = autorest.Respond(
11930		resp,
11931		azure.WithErrorUnlessStatusCode(http.StatusOK),
11932		autorest.ByUnmarshallingJSON(&result.Value),
11933		autorest.ByClosing())
11934	result.Response = autorest.Response{Response: resp}
11935	return
11936}
11937
11938// GetQuorumLossProgress gets the progress of a quorum loss operation started with StartQuorumLoss, using the provided
11939// OperationId.
11940// Parameters:
11941// serviceID - the identity of the service. This is typically the full name of the service without the
11942// 'fabric:' URI scheme.
11943// Starting from version 6.0, hierarchical names are delimited with the "~" character.
11944// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
11945// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
11946// partitionID - the identity of the partition.
11947// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
11948// API
11949// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11950// duration that the client is willing to wait for the requested operation to complete. The default value for
11951// this parameter is 60 seconds.
11952func (client BaseClient) GetQuorumLossProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionQuorumLossProgress, err error) {
11953	if tracing.IsEnabled() {
11954		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetQuorumLossProgress")
11955		defer func() {
11956			sc := -1
11957			if result.Response.Response != nil {
11958				sc = result.Response.Response.StatusCode
11959			}
11960			tracing.EndSpan(ctx, sc, err)
11961		}()
11962	}
11963	if err := validation.Validate([]validation.Validation{
11964		{TargetValue: timeout,
11965			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11966				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11967					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11968				}}}}}); err != nil {
11969		return result, validation.NewError("servicefabric.BaseClient", "GetQuorumLossProgress", err.Error())
11970	}
11971
11972	req, err := client.GetQuorumLossProgressPreparer(ctx, serviceID, partitionID, operationID, timeout)
11973	if err != nil {
11974		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", nil, "Failure preparing request")
11975		return
11976	}
11977
11978	resp, err := client.GetQuorumLossProgressSender(req)
11979	if err != nil {
11980		result.Response = autorest.Response{Response: resp}
11981		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", resp, "Failure sending request")
11982		return
11983	}
11984
11985	result, err = client.GetQuorumLossProgressResponder(resp)
11986	if err != nil {
11987		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", resp, "Failure responding to request")
11988		return
11989	}
11990
11991	return
11992}
11993
11994// GetQuorumLossProgressPreparer prepares the GetQuorumLossProgress request.
11995func (client BaseClient) GetQuorumLossProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) {
11996	pathParameters := map[string]interface{}{
11997		"partitionId": partitionID,
11998		"serviceId":   serviceID,
11999	}
12000
12001	const APIVersion = "6.0"
12002	queryParameters := map[string]interface{}{
12003		"api-version": APIVersion,
12004		"OperationId": autorest.Encode("query", operationID),
12005	}
12006	if timeout != nil {
12007		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12008	} else {
12009		queryParameters["timeout"] = autorest.Encode("query", 60)
12010	}
12011
12012	preparer := autorest.CreatePreparer(
12013		autorest.AsGet(),
12014		autorest.WithBaseURL(client.BaseURI),
12015		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetQuorumLossProgress", pathParameters),
12016		autorest.WithQueryParameters(queryParameters))
12017	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12018}
12019
12020// GetQuorumLossProgressSender sends the GetQuorumLossProgress request. The method will close the
12021// http.Response Body if it receives an error.
12022func (client BaseClient) GetQuorumLossProgressSender(req *http.Request) (*http.Response, error) {
12023	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12024}
12025
12026// GetQuorumLossProgressResponder handles the response to the GetQuorumLossProgress request. The method always
12027// closes the http.Response Body.
12028func (client BaseClient) GetQuorumLossProgressResponder(resp *http.Response) (result PartitionQuorumLossProgress, err error) {
12029	err = autorest.Respond(
12030		resp,
12031		azure.WithErrorUnlessStatusCode(http.StatusOK),
12032		autorest.ByUnmarshallingJSON(&result),
12033		autorest.ByClosing())
12034	result.Response = autorest.Response{Response: resp}
12035	return
12036}
12037
12038// GetRepairTaskList this API supports the Service Fabric platform; it is not meant to be used directly from your code.
12039// Parameters:
12040// taskIDFilter - the repair task ID prefix to be matched.
12041// stateFilter - a bitwise-OR of the following values, specifying which task states should be included in the
12042// result list.
12043// - 1 - Created
12044// - 2 - Claimed
12045// - 4 - Preparing
12046// - 8 - Approved
12047// - 16 - Executing
12048// - 32 - Restoring
12049// - 64 - Completed
12050// executorFilter - the name of the repair executor whose claimed tasks should be included in the list.
12051func (client BaseClient) GetRepairTaskList(ctx context.Context, taskIDFilter string, stateFilter *int32, executorFilter string) (result ListRepairTask, err error) {
12052	if tracing.IsEnabled() {
12053		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetRepairTaskList")
12054		defer func() {
12055			sc := -1
12056			if result.Response.Response != nil {
12057				sc = result.Response.Response.StatusCode
12058			}
12059			tracing.EndSpan(ctx, sc, err)
12060		}()
12061	}
12062	req, err := client.GetRepairTaskListPreparer(ctx, taskIDFilter, stateFilter, executorFilter)
12063	if err != nil {
12064		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", nil, "Failure preparing request")
12065		return
12066	}
12067
12068	resp, err := client.GetRepairTaskListSender(req)
12069	if err != nil {
12070		result.Response = autorest.Response{Response: resp}
12071		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", resp, "Failure sending request")
12072		return
12073	}
12074
12075	result, err = client.GetRepairTaskListResponder(resp)
12076	if err != nil {
12077		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", resp, "Failure responding to request")
12078		return
12079	}
12080
12081	return
12082}
12083
12084// GetRepairTaskListPreparer prepares the GetRepairTaskList request.
12085func (client BaseClient) GetRepairTaskListPreparer(ctx context.Context, taskIDFilter string, stateFilter *int32, executorFilter string) (*http.Request, error) {
12086	const APIVersion = "6.0"
12087	queryParameters := map[string]interface{}{
12088		"api-version": APIVersion,
12089	}
12090	if len(taskIDFilter) > 0 {
12091		queryParameters["TaskIdFilter"] = autorest.Encode("query", taskIDFilter)
12092	}
12093	if stateFilter != nil {
12094		queryParameters["StateFilter"] = autorest.Encode("query", *stateFilter)
12095	}
12096	if len(executorFilter) > 0 {
12097		queryParameters["ExecutorFilter"] = autorest.Encode("query", executorFilter)
12098	}
12099
12100	preparer := autorest.CreatePreparer(
12101		autorest.AsGet(),
12102		autorest.WithBaseURL(client.BaseURI),
12103		autorest.WithPath("/$/GetRepairTaskList"),
12104		autorest.WithQueryParameters(queryParameters))
12105	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12106}
12107
12108// GetRepairTaskListSender sends the GetRepairTaskList request. The method will close the
12109// http.Response Body if it receives an error.
12110func (client BaseClient) GetRepairTaskListSender(req *http.Request) (*http.Response, error) {
12111	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12112}
12113
12114// GetRepairTaskListResponder handles the response to the GetRepairTaskList request. The method always
12115// closes the http.Response Body.
12116func (client BaseClient) GetRepairTaskListResponder(resp *http.Response) (result ListRepairTask, err error) {
12117	err = autorest.Respond(
12118		resp,
12119		azure.WithErrorUnlessStatusCode(http.StatusOK),
12120		autorest.ByUnmarshallingJSON(&result.Value),
12121		autorest.ByClosing())
12122	result.Response = autorest.Response{Response: resp}
12123	return
12124}
12125
12126// GetReplicaHealth gets the health of a Service Fabric replica.
12127// Use EventsHealthStateFilter to filter the collection of health events reported on the replica based on the health
12128// state.
12129// Parameters:
12130// partitionID - the identity of the partition.
12131// replicaID - the identifier of the replica.
12132// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
12133// state.
12134// The possible values for this parameter include integer value of one of the following health states.
12135// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
12136// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
12137// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
12138// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
12139//
12140// - Default - Default value. Matches any HealthState. The value is zero.
12141// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
12142// collection of states. The value is 1.
12143// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
12144// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
12145// - Error - Filter that matches input with HealthState value Error. The value is 8.
12146// - All - Filter that matches input with any HealthState value. The value is 65535.
12147// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12148// duration that the client is willing to wait for the requested operation to complete. The default value for
12149// this parameter is 60 seconds.
12150func (client BaseClient) GetReplicaHealth(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, timeout *int64) (result ReplicaHealthModel, err error) {
12151	if tracing.IsEnabled() {
12152		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaHealth")
12153		defer func() {
12154			sc := -1
12155			if result.Response.Response != nil {
12156				sc = result.Response.Response.StatusCode
12157			}
12158			tracing.EndSpan(ctx, sc, err)
12159		}()
12160	}
12161	if err := validation.Validate([]validation.Validation{
12162		{TargetValue: timeout,
12163			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12164				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12165					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12166				}}}}}); err != nil {
12167		return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealth", err.Error())
12168	}
12169
12170	req, err := client.GetReplicaHealthPreparer(ctx, partitionID, replicaID, eventsHealthStateFilter, timeout)
12171	if err != nil {
12172		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", nil, "Failure preparing request")
12173		return
12174	}
12175
12176	resp, err := client.GetReplicaHealthSender(req)
12177	if err != nil {
12178		result.Response = autorest.Response{Response: resp}
12179		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", resp, "Failure sending request")
12180		return
12181	}
12182
12183	result, err = client.GetReplicaHealthResponder(resp)
12184	if err != nil {
12185		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", resp, "Failure responding to request")
12186		return
12187	}
12188
12189	return
12190}
12191
12192// GetReplicaHealthPreparer prepares the GetReplicaHealth request.
12193func (client BaseClient) GetReplicaHealthPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) {
12194	pathParameters := map[string]interface{}{
12195		"partitionId": partitionID,
12196		"replicaId":   replicaID,
12197	}
12198
12199	const APIVersion = "6.0"
12200	queryParameters := map[string]interface{}{
12201		"api-version": APIVersion,
12202	}
12203	if eventsHealthStateFilter != nil {
12204		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
12205	} else {
12206		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
12207	}
12208	if timeout != nil {
12209		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12210	} else {
12211		queryParameters["timeout"] = autorest.Encode("query", 60)
12212	}
12213
12214	preparer := autorest.CreatePreparer(
12215		autorest.AsGet(),
12216		autorest.WithBaseURL(client.BaseURI),
12217		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth", pathParameters),
12218		autorest.WithQueryParameters(queryParameters))
12219	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12220}
12221
12222// GetReplicaHealthSender sends the GetReplicaHealth request. The method will close the
12223// http.Response Body if it receives an error.
12224func (client BaseClient) GetReplicaHealthSender(req *http.Request) (*http.Response, error) {
12225	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12226}
12227
12228// GetReplicaHealthResponder handles the response to the GetReplicaHealth request. The method always
12229// closes the http.Response Body.
12230func (client BaseClient) GetReplicaHealthResponder(resp *http.Response) (result ReplicaHealthModel, err error) {
12231	err = autorest.Respond(
12232		resp,
12233		azure.WithErrorUnlessStatusCode(http.StatusOK),
12234		autorest.ByUnmarshallingJSON(&result),
12235		autorest.ByClosing())
12236	result.Response = autorest.Response{Response: resp}
12237	return
12238}
12239
12240// GetReplicaHealthUsingPolicy gets the health of a Service Fabric stateful service replica or stateless service
12241// instance.
12242// Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health
12243// state.
12244// Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only
12245// uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while
12246// evaluating the health of the replica.
12247// Parameters:
12248// partitionID - the identity of the partition.
12249// replicaID - the identifier of the replica.
12250// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
12251// state.
12252// The possible values for this parameter include integer value of one of the following health states.
12253// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
12254// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
12255// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
12256// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
12257//
12258// - Default - Default value. Matches any HealthState. The value is zero.
12259// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
12260// collection of states. The value is 1.
12261// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
12262// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
12263// - Error - Filter that matches input with HealthState value Error. The value is 8.
12264// - All - Filter that matches input with any HealthState value. The value is 65535.
12265// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
12266// of its children.
12267// If not present, the health evaluation uses the health policy from application manifest or the default health
12268// policy.
12269// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12270// duration that the client is willing to wait for the requested operation to complete. The default value for
12271// this parameter is 60 seconds.
12272func (client BaseClient) GetReplicaHealthUsingPolicy(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result ReplicaHealthModel, err error) {
12273	if tracing.IsEnabled() {
12274		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaHealthUsingPolicy")
12275		defer func() {
12276			sc := -1
12277			if result.Response.Response != nil {
12278				sc = result.Response.Response.StatusCode
12279			}
12280			tracing.EndSpan(ctx, sc, err)
12281		}()
12282	}
12283	if err := validation.Validate([]validation.Validation{
12284		{TargetValue: timeout,
12285			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12286				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12287					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12288				}}}}}); err != nil {
12289		return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", err.Error())
12290	}
12291
12292	req, err := client.GetReplicaHealthUsingPolicyPreparer(ctx, partitionID, replicaID, eventsHealthStateFilter, applicationHealthPolicy, timeout)
12293	if err != nil {
12294		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", nil, "Failure preparing request")
12295		return
12296	}
12297
12298	resp, err := client.GetReplicaHealthUsingPolicySender(req)
12299	if err != nil {
12300		result.Response = autorest.Response{Response: resp}
12301		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", resp, "Failure sending request")
12302		return
12303	}
12304
12305	result, err = client.GetReplicaHealthUsingPolicyResponder(resp)
12306	if err != nil {
12307		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", resp, "Failure responding to request")
12308		return
12309	}
12310
12311	return
12312}
12313
12314// GetReplicaHealthUsingPolicyPreparer prepares the GetReplicaHealthUsingPolicy request.
12315func (client BaseClient) GetReplicaHealthUsingPolicyPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) {
12316	pathParameters := map[string]interface{}{
12317		"partitionId": partitionID,
12318		"replicaId":   replicaID,
12319	}
12320
12321	const APIVersion = "6.0"
12322	queryParameters := map[string]interface{}{
12323		"api-version": APIVersion,
12324	}
12325	if eventsHealthStateFilter != nil {
12326		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
12327	} else {
12328		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
12329	}
12330	if timeout != nil {
12331		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12332	} else {
12333		queryParameters["timeout"] = autorest.Encode("query", 60)
12334	}
12335
12336	preparer := autorest.CreatePreparer(
12337		autorest.AsContentType("application/json; charset=utf-8"),
12338		autorest.AsPost(),
12339		autorest.WithBaseURL(client.BaseURI),
12340		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth", pathParameters),
12341		autorest.WithQueryParameters(queryParameters))
12342	if applicationHealthPolicy != nil {
12343		preparer = autorest.DecoratePreparer(preparer,
12344			autorest.WithJSON(applicationHealthPolicy))
12345	}
12346	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12347}
12348
12349// GetReplicaHealthUsingPolicySender sends the GetReplicaHealthUsingPolicy request. The method will close the
12350// http.Response Body if it receives an error.
12351func (client BaseClient) GetReplicaHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
12352	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12353}
12354
12355// GetReplicaHealthUsingPolicyResponder handles the response to the GetReplicaHealthUsingPolicy request. The method always
12356// closes the http.Response Body.
12357func (client BaseClient) GetReplicaHealthUsingPolicyResponder(resp *http.Response) (result ReplicaHealthModel, err error) {
12358	err = autorest.Respond(
12359		resp,
12360		azure.WithErrorUnlessStatusCode(http.StatusOK),
12361		autorest.ByUnmarshallingJSON(&result),
12362		autorest.ByClosing())
12363	result.Response = autorest.Response{Response: resp}
12364	return
12365}
12366
12367// GetReplicaInfo the response includes the id, role, status, health, node name, uptime, and other details about the
12368// replica.
12369// Parameters:
12370// partitionID - the identity of the partition.
12371// replicaID - the identifier of the replica.
12372// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12373// duration that the client is willing to wait for the requested operation to complete. The default value for
12374// this parameter is 60 seconds.
12375func (client BaseClient) GetReplicaInfo(ctx context.Context, partitionID uuid.UUID, replicaID string, timeout *int64) (result ReplicaInfoModel, err error) {
12376	if tracing.IsEnabled() {
12377		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaInfo")
12378		defer func() {
12379			sc := -1
12380			if result.Response.Response != nil {
12381				sc = result.Response.Response.StatusCode
12382			}
12383			tracing.EndSpan(ctx, sc, err)
12384		}()
12385	}
12386	if err := validation.Validate([]validation.Validation{
12387		{TargetValue: timeout,
12388			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12389				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12390					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12391				}}}}}); err != nil {
12392		return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfo", err.Error())
12393	}
12394
12395	req, err := client.GetReplicaInfoPreparer(ctx, partitionID, replicaID, timeout)
12396	if err != nil {
12397		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", nil, "Failure preparing request")
12398		return
12399	}
12400
12401	resp, err := client.GetReplicaInfoSender(req)
12402	if err != nil {
12403		result.Response = autorest.Response{Response: resp}
12404		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", resp, "Failure sending request")
12405		return
12406	}
12407
12408	result, err = client.GetReplicaInfoResponder(resp)
12409	if err != nil {
12410		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", resp, "Failure responding to request")
12411		return
12412	}
12413
12414	return
12415}
12416
12417// GetReplicaInfoPreparer prepares the GetReplicaInfo request.
12418func (client BaseClient) GetReplicaInfoPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) {
12419	pathParameters := map[string]interface{}{
12420		"partitionId": partitionID,
12421		"replicaId":   replicaID,
12422	}
12423
12424	const APIVersion = "6.0"
12425	queryParameters := map[string]interface{}{
12426		"api-version": APIVersion,
12427	}
12428	if timeout != nil {
12429		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12430	} else {
12431		queryParameters["timeout"] = autorest.Encode("query", 60)
12432	}
12433
12434	preparer := autorest.CreatePreparer(
12435		autorest.AsGet(),
12436		autorest.WithBaseURL(client.BaseURI),
12437		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}", pathParameters),
12438		autorest.WithQueryParameters(queryParameters))
12439	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12440}
12441
12442// GetReplicaInfoSender sends the GetReplicaInfo request. The method will close the
12443// http.Response Body if it receives an error.
12444func (client BaseClient) GetReplicaInfoSender(req *http.Request) (*http.Response, error) {
12445	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12446}
12447
12448// GetReplicaInfoResponder handles the response to the GetReplicaInfo request. The method always
12449// closes the http.Response Body.
12450func (client BaseClient) GetReplicaInfoResponder(resp *http.Response) (result ReplicaInfoModel, err error) {
12451	err = autorest.Respond(
12452		resp,
12453		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
12454		autorest.ByUnmarshallingJSON(&result),
12455		autorest.ByClosing())
12456	result.Response = autorest.Response{Response: resp}
12457	return
12458}
12459
12460// GetReplicaInfoList the GetReplicas endpoint returns information about the replicas of the specified partition. The
12461// response includes the id, role, status, health, node name, uptime, and other details about the replica.
12462// Parameters:
12463// partitionID - the identity of the partition.
12464// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
12465// token with a non empty value is included in the response of the API when the results from the system do not
12466// fit in a single response. When this value is passed to the next API call, the API returns next set of
12467// results. If there are no further results then the continuation token does not contain a value. The value of
12468// this parameter should not be URL encoded.
12469// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12470// duration that the client is willing to wait for the requested operation to complete. The default value for
12471// this parameter is 60 seconds.
12472func (client BaseClient) GetReplicaInfoList(ctx context.Context, partitionID uuid.UUID, continuationToken string, timeout *int64) (result PagedReplicaInfoList, err error) {
12473	if tracing.IsEnabled() {
12474		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaInfoList")
12475		defer func() {
12476			sc := -1
12477			if result.Response.Response != nil {
12478				sc = result.Response.Response.StatusCode
12479			}
12480			tracing.EndSpan(ctx, sc, err)
12481		}()
12482	}
12483	if err := validation.Validate([]validation.Validation{
12484		{TargetValue: timeout,
12485			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12486				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12487					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12488				}}}}}); err != nil {
12489		return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfoList", err.Error())
12490	}
12491
12492	req, err := client.GetReplicaInfoListPreparer(ctx, partitionID, continuationToken, timeout)
12493	if err != nil {
12494		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", nil, "Failure preparing request")
12495		return
12496	}
12497
12498	resp, err := client.GetReplicaInfoListSender(req)
12499	if err != nil {
12500		result.Response = autorest.Response{Response: resp}
12501		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", resp, "Failure sending request")
12502		return
12503	}
12504
12505	result, err = client.GetReplicaInfoListResponder(resp)
12506	if err != nil {
12507		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", resp, "Failure responding to request")
12508		return
12509	}
12510
12511	return
12512}
12513
12514// GetReplicaInfoListPreparer prepares the GetReplicaInfoList request.
12515func (client BaseClient) GetReplicaInfoListPreparer(ctx context.Context, partitionID uuid.UUID, continuationToken string, timeout *int64) (*http.Request, error) {
12516	pathParameters := map[string]interface{}{
12517		"partitionId": partitionID,
12518	}
12519
12520	const APIVersion = "6.0"
12521	queryParameters := map[string]interface{}{
12522		"api-version": APIVersion,
12523	}
12524	if len(continuationToken) > 0 {
12525		queryParameters["ContinuationToken"] = continuationToken
12526	}
12527	if timeout != nil {
12528		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12529	} else {
12530		queryParameters["timeout"] = autorest.Encode("query", 60)
12531	}
12532
12533	preparer := autorest.CreatePreparer(
12534		autorest.AsGet(),
12535		autorest.WithBaseURL(client.BaseURI),
12536		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas", pathParameters),
12537		autorest.WithQueryParameters(queryParameters))
12538	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12539}
12540
12541// GetReplicaInfoListSender sends the GetReplicaInfoList request. The method will close the
12542// http.Response Body if it receives an error.
12543func (client BaseClient) GetReplicaInfoListSender(req *http.Request) (*http.Response, error) {
12544	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12545}
12546
12547// GetReplicaInfoListResponder handles the response to the GetReplicaInfoList request. The method always
12548// closes the http.Response Body.
12549func (client BaseClient) GetReplicaInfoListResponder(resp *http.Response) (result PagedReplicaInfoList, err error) {
12550	err = autorest.Respond(
12551		resp,
12552		azure.WithErrorUnlessStatusCode(http.StatusOK),
12553		autorest.ByUnmarshallingJSON(&result),
12554		autorest.ByClosing())
12555	result.Response = autorest.Response{Response: resp}
12556	return
12557}
12558
12559// GetServiceBackupConfigurationInfo gets the Service Fabric backup configuration information for the service and the
12560// partitions under this service.
12561// Parameters:
12562// serviceID - the identity of the service. This is typically the full name of the service without the
12563// 'fabric:' URI scheme.
12564// Starting from version 6.0, hierarchical names are delimited with the "~" character.
12565// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
12566// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
12567// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
12568// token with a non empty value is included in the response of the API when the results from the system do not
12569// fit in a single response. When this value is passed to the next API call, the API returns next set of
12570// results. If there are no further results then the continuation token does not contain a value. The value of
12571// this parameter should not be URL encoded.
12572// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
12573// defines the upper bound on the number of results returned. The results returned can be less than the
12574// specified maximum results if they do not fit in the message as per the max message size restrictions defined
12575// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
12576// as possible that fit in the return message.
12577// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12578// duration that the client is willing to wait for the requested operation to complete. The default value for
12579// this parameter is 60 seconds.
12580func (client BaseClient) GetServiceBackupConfigurationInfo(ctx context.Context, serviceID string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupConfigurationInfoList, err error) {
12581	if tracing.IsEnabled() {
12582		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceBackupConfigurationInfo")
12583		defer func() {
12584			sc := -1
12585			if result.Response.Response != nil {
12586				sc = result.Response.Response.StatusCode
12587			}
12588			tracing.EndSpan(ctx, sc, err)
12589		}()
12590	}
12591	if err := validation.Validate([]validation.Validation{
12592		{TargetValue: maxResults,
12593			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
12594				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
12595		{TargetValue: timeout,
12596			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12597				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12598					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12599				}}}}}); err != nil {
12600		return result, validation.NewError("servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", err.Error())
12601	}
12602
12603	req, err := client.GetServiceBackupConfigurationInfoPreparer(ctx, serviceID, continuationToken, maxResults, timeout)
12604	if err != nil {
12605		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", nil, "Failure preparing request")
12606		return
12607	}
12608
12609	resp, err := client.GetServiceBackupConfigurationInfoSender(req)
12610	if err != nil {
12611		result.Response = autorest.Response{Response: resp}
12612		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", resp, "Failure sending request")
12613		return
12614	}
12615
12616	result, err = client.GetServiceBackupConfigurationInfoResponder(resp)
12617	if err != nil {
12618		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", resp, "Failure responding to request")
12619		return
12620	}
12621
12622	return
12623}
12624
12625// GetServiceBackupConfigurationInfoPreparer prepares the GetServiceBackupConfigurationInfo request.
12626func (client BaseClient) GetServiceBackupConfigurationInfoPreparer(ctx context.Context, serviceID string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
12627	pathParameters := map[string]interface{}{
12628		"serviceId": serviceID,
12629	}
12630
12631	const APIVersion = "6.2-preview"
12632	queryParameters := map[string]interface{}{
12633		"api-version": APIVersion,
12634	}
12635	if len(continuationToken) > 0 {
12636		queryParameters["ContinuationToken"] = continuationToken
12637	}
12638	if maxResults != nil {
12639		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
12640	} else {
12641		queryParameters["MaxResults"] = autorest.Encode("query", 0)
12642	}
12643	if timeout != nil {
12644		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12645	} else {
12646		queryParameters["timeout"] = autorest.Encode("query", 60)
12647	}
12648
12649	preparer := autorest.CreatePreparer(
12650		autorest.AsGet(),
12651		autorest.WithBaseURL(client.BaseURI),
12652		autorest.WithPathParameters("/Services/{serviceId}/$/GetBackupConfigurationInfo", pathParameters),
12653		autorest.WithQueryParameters(queryParameters))
12654	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12655}
12656
12657// GetServiceBackupConfigurationInfoSender sends the GetServiceBackupConfigurationInfo request. The method will close the
12658// http.Response Body if it receives an error.
12659func (client BaseClient) GetServiceBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) {
12660	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12661}
12662
12663// GetServiceBackupConfigurationInfoResponder handles the response to the GetServiceBackupConfigurationInfo request. The method always
12664// closes the http.Response Body.
12665func (client BaseClient) GetServiceBackupConfigurationInfoResponder(resp *http.Response) (result PagedBackupConfigurationInfoList, err error) {
12666	err = autorest.Respond(
12667		resp,
12668		azure.WithErrorUnlessStatusCode(http.StatusOK),
12669		autorest.ByUnmarshallingJSON(&result),
12670		autorest.ByClosing())
12671	result.Response = autorest.Response{Response: resp}
12672	return
12673}
12674
12675// GetServiceBackupList returns a list of backups available for every partition in this Service Fabric service. The
12676// server enumerates all the backups available in the backup store configured in the backup policy. It also allows
12677// filtering of the result based on start and end datetime or just fetching the latest available backup for every
12678// partition.
12679// Parameters:
12680// serviceID - the identity of the service. This is typically the full name of the service without the
12681// 'fabric:' URI scheme.
12682// Starting from version 6.0, hierarchical names are delimited with the "~" character.
12683// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
12684// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
12685// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12686// duration that the client is willing to wait for the requested operation to complete. The default value for
12687// this parameter is 60 seconds.
12688// latest - specifies whether to get only the most recent backup available for a partition for the specified
12689// time range.
12690// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The
12691// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups
12692// from the beginning are enumerated.
12693// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date
12694// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is
12695// done till the most recent backup.
12696// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
12697// token with a non empty value is included in the response of the API when the results from the system do not
12698// fit in a single response. When this value is passed to the next API call, the API returns next set of
12699// results. If there are no further results then the continuation token does not contain a value. The value of
12700// this parameter should not be URL encoded.
12701// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
12702// defines the upper bound on the number of results returned. The results returned can be less than the
12703// specified maximum results if they do not fit in the message as per the max message size restrictions defined
12704// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
12705// as possible that fit in the return message.
12706func (client BaseClient) GetServiceBackupList(ctx context.Context, serviceID string, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time, continuationToken string, maxResults *int64) (result PagedBackupInfoList, err error) {
12707	if tracing.IsEnabled() {
12708		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceBackupList")
12709		defer func() {
12710			sc := -1
12711			if result.Response.Response != nil {
12712				sc = result.Response.Response.StatusCode
12713			}
12714			tracing.EndSpan(ctx, sc, err)
12715		}()
12716	}
12717	if err := validation.Validate([]validation.Validation{
12718		{TargetValue: timeout,
12719			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12720				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12721					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12722				}}}},
12723		{TargetValue: maxResults,
12724			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
12725				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil {
12726		return result, validation.NewError("servicefabric.BaseClient", "GetServiceBackupList", err.Error())
12727	}
12728
12729	req, err := client.GetServiceBackupListPreparer(ctx, serviceID, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults)
12730	if err != nil {
12731		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", nil, "Failure preparing request")
12732		return
12733	}
12734
12735	resp, err := client.GetServiceBackupListSender(req)
12736	if err != nil {
12737		result.Response = autorest.Response{Response: resp}
12738		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", resp, "Failure sending request")
12739		return
12740	}
12741
12742	result, err = client.GetServiceBackupListResponder(resp)
12743	if err != nil {
12744		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", resp, "Failure responding to request")
12745		return
12746	}
12747
12748	return
12749}
12750
12751// GetServiceBackupListPreparer prepares the GetServiceBackupList request.
12752func (client BaseClient) GetServiceBackupListPreparer(ctx context.Context, serviceID string, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time, continuationToken string, maxResults *int64) (*http.Request, error) {
12753	pathParameters := map[string]interface{}{
12754		"serviceId": serviceID,
12755	}
12756
12757	const APIVersion = "6.2-preview"
12758	queryParameters := map[string]interface{}{
12759		"api-version": APIVersion,
12760	}
12761	if timeout != nil {
12762		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12763	} else {
12764		queryParameters["timeout"] = autorest.Encode("query", 60)
12765	}
12766	if latest != nil {
12767		queryParameters["Latest"] = autorest.Encode("query", *latest)
12768	} else {
12769		queryParameters["Latest"] = autorest.Encode("query", false)
12770	}
12771	if startDateTimeFilter != nil {
12772		queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter)
12773	}
12774	if endDateTimeFilter != nil {
12775		queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter)
12776	}
12777	if len(continuationToken) > 0 {
12778		queryParameters["ContinuationToken"] = continuationToken
12779	}
12780	if maxResults != nil {
12781		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
12782	} else {
12783		queryParameters["MaxResults"] = autorest.Encode("query", 0)
12784	}
12785
12786	preparer := autorest.CreatePreparer(
12787		autorest.AsGet(),
12788		autorest.WithBaseURL(client.BaseURI),
12789		autorest.WithPathParameters("/Services/{serviceId}/$/GetBackups", pathParameters),
12790		autorest.WithQueryParameters(queryParameters))
12791	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12792}
12793
12794// GetServiceBackupListSender sends the GetServiceBackupList request. The method will close the
12795// http.Response Body if it receives an error.
12796func (client BaseClient) GetServiceBackupListSender(req *http.Request) (*http.Response, error) {
12797	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12798}
12799
12800// GetServiceBackupListResponder handles the response to the GetServiceBackupList request. The method always
12801// closes the http.Response Body.
12802func (client BaseClient) GetServiceBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) {
12803	err = autorest.Respond(
12804		resp,
12805		azure.WithErrorUnlessStatusCode(http.StatusOK),
12806		autorest.ByUnmarshallingJSON(&result),
12807		autorest.ByClosing())
12808	result.Response = autorest.Response{Response: resp}
12809	return
12810}
12811
12812// GetServiceDescription gets the description of an existing Service Fabric service. A service must be created before
12813// its description can be obtained.
12814// Parameters:
12815// serviceID - the identity of the service. This is typically the full name of the service without the
12816// 'fabric:' URI scheme.
12817// Starting from version 6.0, hierarchical names are delimited with the "~" character.
12818// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
12819// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
12820// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12821// duration that the client is willing to wait for the requested operation to complete. The default value for
12822// this parameter is 60 seconds.
12823func (client BaseClient) GetServiceDescription(ctx context.Context, serviceID string, timeout *int64) (result ServiceDescriptionModel, err error) {
12824	if tracing.IsEnabled() {
12825		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceDescription")
12826		defer func() {
12827			sc := -1
12828			if result.Response.Response != nil {
12829				sc = result.Response.Response.StatusCode
12830			}
12831			tracing.EndSpan(ctx, sc, err)
12832		}()
12833	}
12834	if err := validation.Validate([]validation.Validation{
12835		{TargetValue: timeout,
12836			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12837				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12838					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12839				}}}}}); err != nil {
12840		return result, validation.NewError("servicefabric.BaseClient", "GetServiceDescription", err.Error())
12841	}
12842
12843	req, err := client.GetServiceDescriptionPreparer(ctx, serviceID, timeout)
12844	if err != nil {
12845		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", nil, "Failure preparing request")
12846		return
12847	}
12848
12849	resp, err := client.GetServiceDescriptionSender(req)
12850	if err != nil {
12851		result.Response = autorest.Response{Response: resp}
12852		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", resp, "Failure sending request")
12853		return
12854	}
12855
12856	result, err = client.GetServiceDescriptionResponder(resp)
12857	if err != nil {
12858		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", resp, "Failure responding to request")
12859		return
12860	}
12861
12862	return
12863}
12864
12865// GetServiceDescriptionPreparer prepares the GetServiceDescription request.
12866func (client BaseClient) GetServiceDescriptionPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
12867	pathParameters := map[string]interface{}{
12868		"serviceId": serviceID,
12869	}
12870
12871	const APIVersion = "6.0"
12872	queryParameters := map[string]interface{}{
12873		"api-version": APIVersion,
12874	}
12875	if timeout != nil {
12876		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12877	} else {
12878		queryParameters["timeout"] = autorest.Encode("query", 60)
12879	}
12880
12881	preparer := autorest.CreatePreparer(
12882		autorest.AsGet(),
12883		autorest.WithBaseURL(client.BaseURI),
12884		autorest.WithPathParameters("/Services/{serviceId}/$/GetDescription", pathParameters),
12885		autorest.WithQueryParameters(queryParameters))
12886	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12887}
12888
12889// GetServiceDescriptionSender sends the GetServiceDescription request. The method will close the
12890// http.Response Body if it receives an error.
12891func (client BaseClient) GetServiceDescriptionSender(req *http.Request) (*http.Response, error) {
12892	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12893}
12894
12895// GetServiceDescriptionResponder handles the response to the GetServiceDescription request. The method always
12896// closes the http.Response Body.
12897func (client BaseClient) GetServiceDescriptionResponder(resp *http.Response) (result ServiceDescriptionModel, err error) {
12898	err = autorest.Respond(
12899		resp,
12900		azure.WithErrorUnlessStatusCode(http.StatusOK),
12901		autorest.ByUnmarshallingJSON(&result),
12902		autorest.ByClosing())
12903	result.Response = autorest.Response{Response: resp}
12904	return
12905}
12906
12907// GetServiceEventList the response is list of ServiceEvent objects.
12908// Parameters:
12909// serviceID - the identity of the service. This is typically the full name of the service without the
12910// 'fabric:' URI scheme.
12911// Starting from version 6.0, hierarchical names are delimited with the "~" character.
12912// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
12913// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
12914// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
12915// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
12916// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12917// duration that the client is willing to wait for the requested operation to complete. The default value for
12918// this parameter is 60 seconds.
12919// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
12920// be included in the response.
12921// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
12922// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
12923// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
12924// populated.
12925func (client BaseClient) GetServiceEventList(ctx context.Context, serviceID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListServiceEvent, err error) {
12926	if tracing.IsEnabled() {
12927		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceEventList")
12928		defer func() {
12929			sc := -1
12930			if result.Response.Response != nil {
12931				sc = result.Response.Response.StatusCode
12932			}
12933			tracing.EndSpan(ctx, sc, err)
12934		}()
12935	}
12936	if err := validation.Validate([]validation.Validation{
12937		{TargetValue: timeout,
12938			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12939				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12940					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12941				}}}}}); err != nil {
12942		return result, validation.NewError("servicefabric.BaseClient", "GetServiceEventList", err.Error())
12943	}
12944
12945	req, err := client.GetServiceEventListPreparer(ctx, serviceID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
12946	if err != nil {
12947		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", nil, "Failure preparing request")
12948		return
12949	}
12950
12951	resp, err := client.GetServiceEventListSender(req)
12952	if err != nil {
12953		result.Response = autorest.Response{Response: resp}
12954		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", resp, "Failure sending request")
12955		return
12956	}
12957
12958	result, err = client.GetServiceEventListResponder(resp)
12959	if err != nil {
12960		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", resp, "Failure responding to request")
12961		return
12962	}
12963
12964	return
12965}
12966
12967// GetServiceEventListPreparer prepares the GetServiceEventList request.
12968func (client BaseClient) GetServiceEventListPreparer(ctx context.Context, serviceID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
12969	pathParameters := map[string]interface{}{
12970		"serviceId": serviceID,
12971	}
12972
12973	const APIVersion = "6.2-preview"
12974	queryParameters := map[string]interface{}{
12975		"api-version":  APIVersion,
12976		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
12977		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
12978	}
12979	if timeout != nil {
12980		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12981	} else {
12982		queryParameters["timeout"] = autorest.Encode("query", 60)
12983	}
12984	if len(eventsTypesFilter) > 0 {
12985		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
12986	}
12987	if excludeAnalysisEvents != nil {
12988		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
12989	}
12990	if skipCorrelationLookup != nil {
12991		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
12992	}
12993
12994	preparer := autorest.CreatePreparer(
12995		autorest.AsGet(),
12996		autorest.WithBaseURL(client.BaseURI),
12997		autorest.WithPathParameters("/EventsStore/Services/{serviceId}/$/Events", pathParameters),
12998		autorest.WithQueryParameters(queryParameters))
12999	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13000}
13001
13002// GetServiceEventListSender sends the GetServiceEventList request. The method will close the
13003// http.Response Body if it receives an error.
13004func (client BaseClient) GetServiceEventListSender(req *http.Request) (*http.Response, error) {
13005	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13006}
13007
13008// GetServiceEventListResponder handles the response to the GetServiceEventList request. The method always
13009// closes the http.Response Body.
13010func (client BaseClient) GetServiceEventListResponder(resp *http.Response) (result ListServiceEvent, err error) {
13011	err = autorest.Respond(
13012		resp,
13013		azure.WithErrorUnlessStatusCode(http.StatusOK),
13014		autorest.ByUnmarshallingJSON(&result),
13015		autorest.ByClosing())
13016	result.Response = autorest.Response{Response: resp}
13017	return
13018}
13019
13020// GetServiceHealth gets the health information of the specified service.
13021// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health
13022// state.
13023// Use PartitionsHealthStateFilter to filter the collection of partitions returned.
13024// If you specify a service that does not exist in the health store, this request returns an error.
13025// Parameters:
13026// serviceID - the identity of the service. This is typically the full name of the service without the
13027// 'fabric:' URI scheme.
13028// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13029// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
13030// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
13031// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
13032// state.
13033// The possible values for this parameter include integer value of one of the following health states.
13034// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
13035// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
13036// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
13037// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
13038//
13039// - Default - Default value. Matches any HealthState. The value is zero.
13040// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
13041// collection of states. The value is 1.
13042// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
13043// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
13044// - Error - Filter that matches input with HealthState value Error. The value is 8.
13045// - All - Filter that matches input with any HealthState value. The value is 65535.
13046// partitionsHealthStateFilter - allows filtering of the partitions health state objects returned in the result
13047// of service health query based on their health state.
13048// The possible values for this parameter include integer value of one of the following health states.
13049// Only partitions that match the filter are returned. All partitions are used to evaluate the aggregated
13050// health state.
13051// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
13052// be a combination of these value
13053// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of
13054// partitions with HealthState value of OK (2) and Warning (4) will be returned.
13055//
13056// - Default - Default value. Matches any HealthState. The value is zero.
13057// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
13058// collection of states. The value is 1.
13059// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
13060// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
13061// - Error - Filter that matches input with HealthState value Error. The value is 8.
13062// - All - Filter that matches input with any HealthState value. The value is 65535.
13063// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
13064// result. False by default.
13065// The statistics show the number of children entities in health state Ok, Warning, and Error.
13066// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13067// duration that the client is willing to wait for the requested operation to complete. The default value for
13068// this parameter is 60 seconds.
13069func (client BaseClient) GetServiceHealth(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result ServiceHealth, err error) {
13070	if tracing.IsEnabled() {
13071		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceHealth")
13072		defer func() {
13073			sc := -1
13074			if result.Response.Response != nil {
13075				sc = result.Response.Response.StatusCode
13076			}
13077			tracing.EndSpan(ctx, sc, err)
13078		}()
13079	}
13080	if err := validation.Validate([]validation.Validation{
13081		{TargetValue: timeout,
13082			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13083				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13084					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13085				}}}}}); err != nil {
13086		return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealth", err.Error())
13087	}
13088
13089	req, err := client.GetServiceHealthPreparer(ctx, serviceID, eventsHealthStateFilter, partitionsHealthStateFilter, excludeHealthStatistics, timeout)
13090	if err != nil {
13091		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", nil, "Failure preparing request")
13092		return
13093	}
13094
13095	resp, err := client.GetServiceHealthSender(req)
13096	if err != nil {
13097		result.Response = autorest.Response{Response: resp}
13098		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", resp, "Failure sending request")
13099		return
13100	}
13101
13102	result, err = client.GetServiceHealthResponder(resp)
13103	if err != nil {
13104		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", resp, "Failure responding to request")
13105		return
13106	}
13107
13108	return
13109}
13110
13111// GetServiceHealthPreparer prepares the GetServiceHealth request.
13112func (client BaseClient) GetServiceHealthPreparer(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
13113	pathParameters := map[string]interface{}{
13114		"serviceId": serviceID,
13115	}
13116
13117	const APIVersion = "6.0"
13118	queryParameters := map[string]interface{}{
13119		"api-version": APIVersion,
13120	}
13121	if eventsHealthStateFilter != nil {
13122		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
13123	} else {
13124		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
13125	}
13126	if partitionsHealthStateFilter != nil {
13127		queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", *partitionsHealthStateFilter)
13128	} else {
13129		queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", 0)
13130	}
13131	if excludeHealthStatistics != nil {
13132		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
13133	} else {
13134		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
13135	}
13136	if timeout != nil {
13137		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13138	} else {
13139		queryParameters["timeout"] = autorest.Encode("query", 60)
13140	}
13141
13142	preparer := autorest.CreatePreparer(
13143		autorest.AsGet(),
13144		autorest.WithBaseURL(client.BaseURI),
13145		autorest.WithPathParameters("/Services/{serviceId}/$/GetHealth", pathParameters),
13146		autorest.WithQueryParameters(queryParameters))
13147	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13148}
13149
13150// GetServiceHealthSender sends the GetServiceHealth request. The method will close the
13151// http.Response Body if it receives an error.
13152func (client BaseClient) GetServiceHealthSender(req *http.Request) (*http.Response, error) {
13153	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13154}
13155
13156// GetServiceHealthResponder handles the response to the GetServiceHealth request. The method always
13157// closes the http.Response Body.
13158func (client BaseClient) GetServiceHealthResponder(resp *http.Response) (result ServiceHealth, err error) {
13159	err = autorest.Respond(
13160		resp,
13161		azure.WithErrorUnlessStatusCode(http.StatusOK),
13162		autorest.ByUnmarshallingJSON(&result),
13163		autorest.ByClosing())
13164	result.Response = autorest.Response{Response: resp}
13165	return
13166}
13167
13168// GetServiceHealthUsingPolicy gets the health information of the specified service.
13169// If the application health policy is specified, the health evaluation uses it to get the aggregated health state.
13170// If the policy is not specified, the health evaluation uses the application health policy defined in the application
13171// manifest, or the default health policy, if no policy is defined in the manifest.
13172// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health
13173// state.
13174// Use PartitionsHealthStateFilter to filter the collection of partitions returned.
13175// If you specify a service that does not exist in the health store, this request returns an error.
13176// Parameters:
13177// serviceID - the identity of the service. This is typically the full name of the service without the
13178// 'fabric:' URI scheme.
13179// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13180// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
13181// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
13182// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
13183// state.
13184// The possible values for this parameter include integer value of one of the following health states.
13185// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
13186// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
13187// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
13188// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
13189//
13190// - Default - Default value. Matches any HealthState. The value is zero.
13191// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
13192// collection of states. The value is 1.
13193// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
13194// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
13195// - Error - Filter that matches input with HealthState value Error. The value is 8.
13196// - All - Filter that matches input with any HealthState value. The value is 65535.
13197// partitionsHealthStateFilter - allows filtering of the partitions health state objects returned in the result
13198// of service health query based on their health state.
13199// The possible values for this parameter include integer value of one of the following health states.
13200// Only partitions that match the filter are returned. All partitions are used to evaluate the aggregated
13201// health state.
13202// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
13203// be a combination of these value
13204// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of
13205// partitions with HealthState value of OK (2) and Warning (4) will be returned.
13206//
13207// - Default - Default value. Matches any HealthState. The value is zero.
13208// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
13209// collection of states. The value is 1.
13210// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
13211// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
13212// - Error - Filter that matches input with HealthState value Error. The value is 8.
13213// - All - Filter that matches input with any HealthState value. The value is 65535.
13214// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
13215// of its children.
13216// If not present, the health evaluation uses the health policy from application manifest or the default health
13217// policy.
13218// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
13219// result. False by default.
13220// The statistics show the number of children entities in health state Ok, Warning, and Error.
13221// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13222// duration that the client is willing to wait for the requested operation to complete. The default value for
13223// this parameter is 60 seconds.
13224func (client BaseClient) GetServiceHealthUsingPolicy(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result ServiceHealth, err error) {
13225	if tracing.IsEnabled() {
13226		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceHealthUsingPolicy")
13227		defer func() {
13228			sc := -1
13229			if result.Response.Response != nil {
13230				sc = result.Response.Response.StatusCode
13231			}
13232			tracing.EndSpan(ctx, sc, err)
13233		}()
13234	}
13235	if err := validation.Validate([]validation.Validation{
13236		{TargetValue: timeout,
13237			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13238				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13239					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13240				}}}}}); err != nil {
13241		return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealthUsingPolicy", err.Error())
13242	}
13243
13244	req, err := client.GetServiceHealthUsingPolicyPreparer(ctx, serviceID, eventsHealthStateFilter, partitionsHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout)
13245	if err != nil {
13246		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", nil, "Failure preparing request")
13247		return
13248	}
13249
13250	resp, err := client.GetServiceHealthUsingPolicySender(req)
13251	if err != nil {
13252		result.Response = autorest.Response{Response: resp}
13253		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", resp, "Failure sending request")
13254		return
13255	}
13256
13257	result, err = client.GetServiceHealthUsingPolicyResponder(resp)
13258	if err != nil {
13259		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", resp, "Failure responding to request")
13260		return
13261	}
13262
13263	return
13264}
13265
13266// GetServiceHealthUsingPolicyPreparer prepares the GetServiceHealthUsingPolicy request.
13267func (client BaseClient) GetServiceHealthUsingPolicyPreparer(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
13268	pathParameters := map[string]interface{}{
13269		"serviceId": serviceID,
13270	}
13271
13272	const APIVersion = "6.0"
13273	queryParameters := map[string]interface{}{
13274		"api-version": APIVersion,
13275	}
13276	if eventsHealthStateFilter != nil {
13277		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
13278	} else {
13279		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
13280	}
13281	if partitionsHealthStateFilter != nil {
13282		queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", *partitionsHealthStateFilter)
13283	} else {
13284		queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", 0)
13285	}
13286	if excludeHealthStatistics != nil {
13287		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
13288	} else {
13289		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
13290	}
13291	if timeout != nil {
13292		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13293	} else {
13294		queryParameters["timeout"] = autorest.Encode("query", 60)
13295	}
13296
13297	preparer := autorest.CreatePreparer(
13298		autorest.AsContentType("application/json; charset=utf-8"),
13299		autorest.AsPost(),
13300		autorest.WithBaseURL(client.BaseURI),
13301		autorest.WithPathParameters("/Services/{serviceId}/$/GetHealth", pathParameters),
13302		autorest.WithQueryParameters(queryParameters))
13303	if applicationHealthPolicy != nil {
13304		preparer = autorest.DecoratePreparer(preparer,
13305			autorest.WithJSON(applicationHealthPolicy))
13306	}
13307	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13308}
13309
13310// GetServiceHealthUsingPolicySender sends the GetServiceHealthUsingPolicy request. The method will close the
13311// http.Response Body if it receives an error.
13312func (client BaseClient) GetServiceHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
13313	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13314}
13315
13316// GetServiceHealthUsingPolicyResponder handles the response to the GetServiceHealthUsingPolicy request. The method always
13317// closes the http.Response Body.
13318func (client BaseClient) GetServiceHealthUsingPolicyResponder(resp *http.Response) (result ServiceHealth, err error) {
13319	err = autorest.Respond(
13320		resp,
13321		azure.WithErrorUnlessStatusCode(http.StatusOK),
13322		autorest.ByUnmarshallingJSON(&result),
13323		autorest.ByClosing())
13324	result.Response = autorest.Response{Response: resp}
13325	return
13326}
13327
13328// GetServiceInfo returns the information about the specified service belonging to the specified Service Fabric
13329// application.
13330// Parameters:
13331// applicationID - the identity of the application. This is typically the full name of the application without
13332// the 'fabric:' URI scheme.
13333// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13334// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
13335// in 6.0+ and "myapp/app1" in previous versions.
13336// serviceID - the identity of the service. This is typically the full name of the service without the
13337// 'fabric:' URI scheme.
13338// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13339// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
13340// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
13341// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13342// duration that the client is willing to wait for the requested operation to complete. The default value for
13343// this parameter is 60 seconds.
13344func (client BaseClient) GetServiceInfo(ctx context.Context, applicationID string, serviceID string, timeout *int64) (result ServiceInfoModel, err error) {
13345	if tracing.IsEnabled() {
13346		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceInfo")
13347		defer func() {
13348			sc := -1
13349			if result.Response.Response != nil {
13350				sc = result.Response.Response.StatusCode
13351			}
13352			tracing.EndSpan(ctx, sc, err)
13353		}()
13354	}
13355	if err := validation.Validate([]validation.Validation{
13356		{TargetValue: timeout,
13357			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13358				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13359					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13360				}}}}}); err != nil {
13361		return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfo", err.Error())
13362	}
13363
13364	req, err := client.GetServiceInfoPreparer(ctx, applicationID, serviceID, timeout)
13365	if err != nil {
13366		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", nil, "Failure preparing request")
13367		return
13368	}
13369
13370	resp, err := client.GetServiceInfoSender(req)
13371	if err != nil {
13372		result.Response = autorest.Response{Response: resp}
13373		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", resp, "Failure sending request")
13374		return
13375	}
13376
13377	result, err = client.GetServiceInfoResponder(resp)
13378	if err != nil {
13379		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", resp, "Failure responding to request")
13380		return
13381	}
13382
13383	return
13384}
13385
13386// GetServiceInfoPreparer prepares the GetServiceInfo request.
13387func (client BaseClient) GetServiceInfoPreparer(ctx context.Context, applicationID string, serviceID string, timeout *int64) (*http.Request, error) {
13388	pathParameters := map[string]interface{}{
13389		"applicationId": applicationID,
13390		"serviceId":     serviceID,
13391	}
13392
13393	const APIVersion = "6.0"
13394	queryParameters := map[string]interface{}{
13395		"api-version": APIVersion,
13396	}
13397	if timeout != nil {
13398		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13399	} else {
13400		queryParameters["timeout"] = autorest.Encode("query", 60)
13401	}
13402
13403	preparer := autorest.CreatePreparer(
13404		autorest.AsGet(),
13405		autorest.WithBaseURL(client.BaseURI),
13406		autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/{serviceId}", pathParameters),
13407		autorest.WithQueryParameters(queryParameters))
13408	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13409}
13410
13411// GetServiceInfoSender sends the GetServiceInfo request. The method will close the
13412// http.Response Body if it receives an error.
13413func (client BaseClient) GetServiceInfoSender(req *http.Request) (*http.Response, error) {
13414	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13415}
13416
13417// GetServiceInfoResponder handles the response to the GetServiceInfo request. The method always
13418// closes the http.Response Body.
13419func (client BaseClient) GetServiceInfoResponder(resp *http.Response) (result ServiceInfoModel, err error) {
13420	err = autorest.Respond(
13421		resp,
13422		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
13423		autorest.ByUnmarshallingJSON(&result),
13424		autorest.ByClosing())
13425	result.Response = autorest.Response{Response: resp}
13426	return
13427}
13428
13429// GetServiceInfoList returns the information about all services belonging to the application specified by the
13430// application id.
13431// Parameters:
13432// applicationID - the identity of the application. This is typically the full name of the application without
13433// the 'fabric:' URI scheme.
13434// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13435// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
13436// in 6.0+ and "myapp/app1" in previous versions.
13437// serviceTypeName - the service type name used to filter the services to query for.
13438// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
13439// token with a non empty value is included in the response of the API when the results from the system do not
13440// fit in a single response. When this value is passed to the next API call, the API returns next set of
13441// results. If there are no further results then the continuation token does not contain a value. The value of
13442// this parameter should not be URL encoded.
13443// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13444// duration that the client is willing to wait for the requested operation to complete. The default value for
13445// this parameter is 60 seconds.
13446func (client BaseClient) GetServiceInfoList(ctx context.Context, applicationID string, serviceTypeName string, continuationToken string, timeout *int64) (result PagedServiceInfoList, err error) {
13447	if tracing.IsEnabled() {
13448		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceInfoList")
13449		defer func() {
13450			sc := -1
13451			if result.Response.Response != nil {
13452				sc = result.Response.Response.StatusCode
13453			}
13454			tracing.EndSpan(ctx, sc, err)
13455		}()
13456	}
13457	if err := validation.Validate([]validation.Validation{
13458		{TargetValue: timeout,
13459			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13460				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13461					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13462				}}}}}); err != nil {
13463		return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfoList", err.Error())
13464	}
13465
13466	req, err := client.GetServiceInfoListPreparer(ctx, applicationID, serviceTypeName, continuationToken, timeout)
13467	if err != nil {
13468		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", nil, "Failure preparing request")
13469		return
13470	}
13471
13472	resp, err := client.GetServiceInfoListSender(req)
13473	if err != nil {
13474		result.Response = autorest.Response{Response: resp}
13475		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", resp, "Failure sending request")
13476		return
13477	}
13478
13479	result, err = client.GetServiceInfoListResponder(resp)
13480	if err != nil {
13481		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", resp, "Failure responding to request")
13482		return
13483	}
13484
13485	return
13486}
13487
13488// GetServiceInfoListPreparer prepares the GetServiceInfoList request.
13489func (client BaseClient) GetServiceInfoListPreparer(ctx context.Context, applicationID string, serviceTypeName string, continuationToken string, timeout *int64) (*http.Request, error) {
13490	pathParameters := map[string]interface{}{
13491		"applicationId": applicationID,
13492	}
13493
13494	const APIVersion = "6.0"
13495	queryParameters := map[string]interface{}{
13496		"api-version": APIVersion,
13497	}
13498	if len(serviceTypeName) > 0 {
13499		queryParameters["ServiceTypeName"] = autorest.Encode("query", serviceTypeName)
13500	}
13501	if len(continuationToken) > 0 {
13502		queryParameters["ContinuationToken"] = continuationToken
13503	}
13504	if timeout != nil {
13505		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13506	} else {
13507		queryParameters["timeout"] = autorest.Encode("query", 60)
13508	}
13509
13510	preparer := autorest.CreatePreparer(
13511		autorest.AsGet(),
13512		autorest.WithBaseURL(client.BaseURI),
13513		autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices", pathParameters),
13514		autorest.WithQueryParameters(queryParameters))
13515	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13516}
13517
13518// GetServiceInfoListSender sends the GetServiceInfoList request. The method will close the
13519// http.Response Body if it receives an error.
13520func (client BaseClient) GetServiceInfoListSender(req *http.Request) (*http.Response, error) {
13521	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13522}
13523
13524// GetServiceInfoListResponder handles the response to the GetServiceInfoList request. The method always
13525// closes the http.Response Body.
13526func (client BaseClient) GetServiceInfoListResponder(resp *http.Response) (result PagedServiceInfoList, err error) {
13527	err = autorest.Respond(
13528		resp,
13529		azure.WithErrorUnlessStatusCode(http.StatusOK),
13530		autorest.ByUnmarshallingJSON(&result),
13531		autorest.ByClosing())
13532	result.Response = autorest.Response{Response: resp}
13533	return
13534}
13535
13536// GetServiceManifest gets the manifest describing a service type. The response contains the service manifest XML as a
13537// string.
13538// Parameters:
13539// applicationTypeName - the name of the application type.
13540// applicationTypeVersion - the version of the application type.
13541// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
13542// Fabric cluster.
13543// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13544// duration that the client is willing to wait for the requested operation to complete. The default value for
13545// this parameter is 60 seconds.
13546func (client BaseClient) GetServiceManifest(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceManifestName string, timeout *int64) (result ServiceTypeManifest, err error) {
13547	if tracing.IsEnabled() {
13548		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceManifest")
13549		defer func() {
13550			sc := -1
13551			if result.Response.Response != nil {
13552				sc = result.Response.Response.StatusCode
13553			}
13554			tracing.EndSpan(ctx, sc, err)
13555		}()
13556	}
13557	if err := validation.Validate([]validation.Validation{
13558		{TargetValue: timeout,
13559			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13560				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13561					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13562				}}}}}); err != nil {
13563		return result, validation.NewError("servicefabric.BaseClient", "GetServiceManifest", err.Error())
13564	}
13565
13566	req, err := client.GetServiceManifestPreparer(ctx, applicationTypeName, applicationTypeVersion, serviceManifestName, timeout)
13567	if err != nil {
13568		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", nil, "Failure preparing request")
13569		return
13570	}
13571
13572	resp, err := client.GetServiceManifestSender(req)
13573	if err != nil {
13574		result.Response = autorest.Response{Response: resp}
13575		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", resp, "Failure sending request")
13576		return
13577	}
13578
13579	result, err = client.GetServiceManifestResponder(resp)
13580	if err != nil {
13581		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", resp, "Failure responding to request")
13582		return
13583	}
13584
13585	return
13586}
13587
13588// GetServiceManifestPreparer prepares the GetServiceManifest request.
13589func (client BaseClient) GetServiceManifestPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceManifestName string, timeout *int64) (*http.Request, error) {
13590	pathParameters := map[string]interface{}{
13591		"applicationTypeName": autorest.Encode("path", applicationTypeName),
13592	}
13593
13594	const APIVersion = "6.0"
13595	queryParameters := map[string]interface{}{
13596		"api-version":            APIVersion,
13597		"ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion),
13598		"ServiceManifestName":    autorest.Encode("query", serviceManifestName),
13599	}
13600	if timeout != nil {
13601		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13602	} else {
13603		queryParameters["timeout"] = autorest.Encode("query", 60)
13604	}
13605
13606	preparer := autorest.CreatePreparer(
13607		autorest.AsGet(),
13608		autorest.WithBaseURL(client.BaseURI),
13609		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceManifest", pathParameters),
13610		autorest.WithQueryParameters(queryParameters))
13611	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13612}
13613
13614// GetServiceManifestSender sends the GetServiceManifest request. The method will close the
13615// http.Response Body if it receives an error.
13616func (client BaseClient) GetServiceManifestSender(req *http.Request) (*http.Response, error) {
13617	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13618}
13619
13620// GetServiceManifestResponder handles the response to the GetServiceManifest request. The method always
13621// closes the http.Response Body.
13622func (client BaseClient) GetServiceManifestResponder(resp *http.Response) (result ServiceTypeManifest, err error) {
13623	err = autorest.Respond(
13624		resp,
13625		azure.WithErrorUnlessStatusCode(http.StatusOK),
13626		autorest.ByUnmarshallingJSON(&result),
13627		autorest.ByClosing())
13628	result.Response = autorest.Response{Response: resp}
13629	return
13630}
13631
13632// GetServiceNameInfo gets name of the service for the specified partition. A 404 error is returned if the partition ID
13633// does not exist in the cluster.
13634// Parameters:
13635// partitionID - the identity of the partition.
13636// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13637// duration that the client is willing to wait for the requested operation to complete. The default value for
13638// this parameter is 60 seconds.
13639func (client BaseClient) GetServiceNameInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result ServiceNameInfo, err error) {
13640	if tracing.IsEnabled() {
13641		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceNameInfo")
13642		defer func() {
13643			sc := -1
13644			if result.Response.Response != nil {
13645				sc = result.Response.Response.StatusCode
13646			}
13647			tracing.EndSpan(ctx, sc, err)
13648		}()
13649	}
13650	if err := validation.Validate([]validation.Validation{
13651		{TargetValue: timeout,
13652			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13653				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13654					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13655				}}}}}); err != nil {
13656		return result, validation.NewError("servicefabric.BaseClient", "GetServiceNameInfo", err.Error())
13657	}
13658
13659	req, err := client.GetServiceNameInfoPreparer(ctx, partitionID, timeout)
13660	if err != nil {
13661		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", nil, "Failure preparing request")
13662		return
13663	}
13664
13665	resp, err := client.GetServiceNameInfoSender(req)
13666	if err != nil {
13667		result.Response = autorest.Response{Response: resp}
13668		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", resp, "Failure sending request")
13669		return
13670	}
13671
13672	result, err = client.GetServiceNameInfoResponder(resp)
13673	if err != nil {
13674		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", resp, "Failure responding to request")
13675		return
13676	}
13677
13678	return
13679}
13680
13681// GetServiceNameInfoPreparer prepares the GetServiceNameInfo request.
13682func (client BaseClient) GetServiceNameInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
13683	pathParameters := map[string]interface{}{
13684		"partitionId": partitionID,
13685	}
13686
13687	const APIVersion = "6.0"
13688	queryParameters := map[string]interface{}{
13689		"api-version": APIVersion,
13690	}
13691	if timeout != nil {
13692		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13693	} else {
13694		queryParameters["timeout"] = autorest.Encode("query", 60)
13695	}
13696
13697	preparer := autorest.CreatePreparer(
13698		autorest.AsGet(),
13699		autorest.WithBaseURL(client.BaseURI),
13700		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetServiceName", pathParameters),
13701		autorest.WithQueryParameters(queryParameters))
13702	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13703}
13704
13705// GetServiceNameInfoSender sends the GetServiceNameInfo request. The method will close the
13706// http.Response Body if it receives an error.
13707func (client BaseClient) GetServiceNameInfoSender(req *http.Request) (*http.Response, error) {
13708	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13709}
13710
13711// GetServiceNameInfoResponder handles the response to the GetServiceNameInfo request. The method always
13712// closes the http.Response Body.
13713func (client BaseClient) GetServiceNameInfoResponder(resp *http.Response) (result ServiceNameInfo, err error) {
13714	err = autorest.Respond(
13715		resp,
13716		azure.WithErrorUnlessStatusCode(http.StatusOK),
13717		autorest.ByUnmarshallingJSON(&result),
13718		autorest.ByClosing())
13719	result.Response = autorest.Response{Response: resp}
13720	return
13721}
13722
13723// GetServicesEventList the response is list of ServiceEvent objects.
13724// Parameters:
13725// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
13726// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
13727// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13728// duration that the client is willing to wait for the requested operation to complete. The default value for
13729// this parameter is 60 seconds.
13730// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
13731// be included in the response.
13732// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
13733// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
13734// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
13735// populated.
13736func (client BaseClient) GetServicesEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListServiceEvent, err error) {
13737	if tracing.IsEnabled() {
13738		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServicesEventList")
13739		defer func() {
13740			sc := -1
13741			if result.Response.Response != nil {
13742				sc = result.Response.Response.StatusCode
13743			}
13744			tracing.EndSpan(ctx, sc, err)
13745		}()
13746	}
13747	if err := validation.Validate([]validation.Validation{
13748		{TargetValue: timeout,
13749			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13750				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13751					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13752				}}}}}); err != nil {
13753		return result, validation.NewError("servicefabric.BaseClient", "GetServicesEventList", err.Error())
13754	}
13755
13756	req, err := client.GetServicesEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
13757	if err != nil {
13758		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", nil, "Failure preparing request")
13759		return
13760	}
13761
13762	resp, err := client.GetServicesEventListSender(req)
13763	if err != nil {
13764		result.Response = autorest.Response{Response: resp}
13765		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", resp, "Failure sending request")
13766		return
13767	}
13768
13769	result, err = client.GetServicesEventListResponder(resp)
13770	if err != nil {
13771		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", resp, "Failure responding to request")
13772		return
13773	}
13774
13775	return
13776}
13777
13778// GetServicesEventListPreparer prepares the GetServicesEventList request.
13779func (client BaseClient) GetServicesEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
13780	const APIVersion = "6.2-preview"
13781	queryParameters := map[string]interface{}{
13782		"api-version":  APIVersion,
13783		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
13784		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
13785	}
13786	if timeout != nil {
13787		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13788	} else {
13789		queryParameters["timeout"] = autorest.Encode("query", 60)
13790	}
13791	if len(eventsTypesFilter) > 0 {
13792		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
13793	}
13794	if excludeAnalysisEvents != nil {
13795		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
13796	}
13797	if skipCorrelationLookup != nil {
13798		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
13799	}
13800
13801	preparer := autorest.CreatePreparer(
13802		autorest.AsGet(),
13803		autorest.WithBaseURL(client.BaseURI),
13804		autorest.WithPath("/EventsStore/Services/Events"),
13805		autorest.WithQueryParameters(queryParameters))
13806	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13807}
13808
13809// GetServicesEventListSender sends the GetServicesEventList request. The method will close the
13810// http.Response Body if it receives an error.
13811func (client BaseClient) GetServicesEventListSender(req *http.Request) (*http.Response, error) {
13812	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13813}
13814
13815// GetServicesEventListResponder handles the response to the GetServicesEventList request. The method always
13816// closes the http.Response Body.
13817func (client BaseClient) GetServicesEventListResponder(resp *http.Response) (result ListServiceEvent, err error) {
13818	err = autorest.Respond(
13819		resp,
13820		azure.WithErrorUnlessStatusCode(http.StatusOK),
13821		autorest.ByUnmarshallingJSON(&result),
13822		autorest.ByClosing())
13823	result.Response = autorest.Response{Response: resp}
13824	return
13825}
13826
13827// GetServiceTypeInfoByName gets the information about a specific service type that is supported by a provisioned
13828// application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is
13829// returned. A 204 response is returned if the specified service type is not found in the cluster.
13830// Parameters:
13831// applicationTypeName - the name of the application type.
13832// applicationTypeVersion - the version of the application type.
13833// serviceTypeName - specifies the name of a Service Fabric service type.
13834// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13835// duration that the client is willing to wait for the requested operation to complete. The default value for
13836// this parameter is 60 seconds.
13837func (client BaseClient) GetServiceTypeInfoByName(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceTypeName string, timeout *int64) (result ServiceTypeInfo, err error) {
13838	if tracing.IsEnabled() {
13839		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceTypeInfoByName")
13840		defer func() {
13841			sc := -1
13842			if result.Response.Response != nil {
13843				sc = result.Response.Response.StatusCode
13844			}
13845			tracing.EndSpan(ctx, sc, err)
13846		}()
13847	}
13848	if err := validation.Validate([]validation.Validation{
13849		{TargetValue: timeout,
13850			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13851				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13852					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13853				}}}}}); err != nil {
13854		return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoByName", err.Error())
13855	}
13856
13857	req, err := client.GetServiceTypeInfoByNamePreparer(ctx, applicationTypeName, applicationTypeVersion, serviceTypeName, timeout)
13858	if err != nil {
13859		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", nil, "Failure preparing request")
13860		return
13861	}
13862
13863	resp, err := client.GetServiceTypeInfoByNameSender(req)
13864	if err != nil {
13865		result.Response = autorest.Response{Response: resp}
13866		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", resp, "Failure sending request")
13867		return
13868	}
13869
13870	result, err = client.GetServiceTypeInfoByNameResponder(resp)
13871	if err != nil {
13872		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", resp, "Failure responding to request")
13873		return
13874	}
13875
13876	return
13877}
13878
13879// GetServiceTypeInfoByNamePreparer prepares the GetServiceTypeInfoByName request.
13880func (client BaseClient) GetServiceTypeInfoByNamePreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceTypeName string, timeout *int64) (*http.Request, error) {
13881	pathParameters := map[string]interface{}{
13882		"applicationTypeName": autorest.Encode("path", applicationTypeName),
13883		"serviceTypeName":     serviceTypeName,
13884	}
13885
13886	const APIVersion = "6.0"
13887	queryParameters := map[string]interface{}{
13888		"api-version":            APIVersion,
13889		"ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion),
13890	}
13891	if timeout != nil {
13892		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13893	} else {
13894		queryParameters["timeout"] = autorest.Encode("query", 60)
13895	}
13896
13897	preparer := autorest.CreatePreparer(
13898		autorest.AsGet(),
13899		autorest.WithBaseURL(client.BaseURI),
13900		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceTypes/{serviceTypeName}", pathParameters),
13901		autorest.WithQueryParameters(queryParameters))
13902	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13903}
13904
13905// GetServiceTypeInfoByNameSender sends the GetServiceTypeInfoByName request. The method will close the
13906// http.Response Body if it receives an error.
13907func (client BaseClient) GetServiceTypeInfoByNameSender(req *http.Request) (*http.Response, error) {
13908	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13909}
13910
13911// GetServiceTypeInfoByNameResponder handles the response to the GetServiceTypeInfoByName request. The method always
13912// closes the http.Response Body.
13913func (client BaseClient) GetServiceTypeInfoByNameResponder(resp *http.Response) (result ServiceTypeInfo, err error) {
13914	err = autorest.Respond(
13915		resp,
13916		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
13917		autorest.ByUnmarshallingJSON(&result),
13918		autorest.ByClosing())
13919	result.Response = autorest.Response{Response: resp}
13920	return
13921}
13922
13923// GetServiceTypeInfoList gets the list containing the information about service types that are supported by a
13924// provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404
13925// status is returned.
13926// Parameters:
13927// applicationTypeName - the name of the application type.
13928// applicationTypeVersion - the version of the application type.
13929// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13930// duration that the client is willing to wait for the requested operation to complete. The default value for
13931// this parameter is 60 seconds.
13932func (client BaseClient) GetServiceTypeInfoList(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (result ListServiceTypeInfo, err error) {
13933	if tracing.IsEnabled() {
13934		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceTypeInfoList")
13935		defer func() {
13936			sc := -1
13937			if result.Response.Response != nil {
13938				sc = result.Response.Response.StatusCode
13939			}
13940			tracing.EndSpan(ctx, sc, err)
13941		}()
13942	}
13943	if err := validation.Validate([]validation.Validation{
13944		{TargetValue: timeout,
13945			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13946				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13947					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13948				}}}}}); err != nil {
13949		return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoList", err.Error())
13950	}
13951
13952	req, err := client.GetServiceTypeInfoListPreparer(ctx, applicationTypeName, applicationTypeVersion, timeout)
13953	if err != nil {
13954		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", nil, "Failure preparing request")
13955		return
13956	}
13957
13958	resp, err := client.GetServiceTypeInfoListSender(req)
13959	if err != nil {
13960		result.Response = autorest.Response{Response: resp}
13961		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", resp, "Failure sending request")
13962		return
13963	}
13964
13965	result, err = client.GetServiceTypeInfoListResponder(resp)
13966	if err != nil {
13967		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", resp, "Failure responding to request")
13968		return
13969	}
13970
13971	return
13972}
13973
13974// GetServiceTypeInfoListPreparer prepares the GetServiceTypeInfoList request.
13975func (client BaseClient) GetServiceTypeInfoListPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (*http.Request, error) {
13976	pathParameters := map[string]interface{}{
13977		"applicationTypeName": autorest.Encode("path", applicationTypeName),
13978	}
13979
13980	const APIVersion = "6.0"
13981	queryParameters := map[string]interface{}{
13982		"api-version":            APIVersion,
13983		"ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion),
13984	}
13985	if timeout != nil {
13986		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13987	} else {
13988		queryParameters["timeout"] = autorest.Encode("query", 60)
13989	}
13990
13991	preparer := autorest.CreatePreparer(
13992		autorest.AsGet(),
13993		autorest.WithBaseURL(client.BaseURI),
13994		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceTypes", pathParameters),
13995		autorest.WithQueryParameters(queryParameters))
13996	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13997}
13998
13999// GetServiceTypeInfoListSender sends the GetServiceTypeInfoList request. The method will close the
14000// http.Response Body if it receives an error.
14001func (client BaseClient) GetServiceTypeInfoListSender(req *http.Request) (*http.Response, error) {
14002	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14003}
14004
14005// GetServiceTypeInfoListResponder handles the response to the GetServiceTypeInfoList request. The method always
14006// closes the http.Response Body.
14007func (client BaseClient) GetServiceTypeInfoListResponder(resp *http.Response) (result ListServiceTypeInfo, err error) {
14008	err = autorest.Respond(
14009		resp,
14010		azure.WithErrorUnlessStatusCode(http.StatusOK),
14011		autorest.ByUnmarshallingJSON(&result.Value),
14012		autorest.ByClosing())
14013	result.Response = autorest.Response{Response: resp}
14014	return
14015}
14016
14017// GetSubNameInfoList enumerates all the Service Fabric names under a given name. If the subnames do not fit in a page,
14018// one page of results is returned as well as a continuation token which can be used to get the next page. Querying a
14019// name that doesn't exist will fail.
14020// Parameters:
14021// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
14022// recursive - allows specifying that the search performed should be recursive.
14023// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
14024// token with a non empty value is included in the response of the API when the results from the system do not
14025// fit in a single response. When this value is passed to the next API call, the API returns next set of
14026// results. If there are no further results then the continuation token does not contain a value. The value of
14027// this parameter should not be URL encoded.
14028// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14029// duration that the client is willing to wait for the requested operation to complete. The default value for
14030// this parameter is 60 seconds.
14031func (client BaseClient) GetSubNameInfoList(ctx context.Context, nameID string, recursive *bool, continuationToken string, timeout *int64) (result PagedSubNameInfoList, err error) {
14032	if tracing.IsEnabled() {
14033		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSubNameInfoList")
14034		defer func() {
14035			sc := -1
14036			if result.Response.Response != nil {
14037				sc = result.Response.Response.StatusCode
14038			}
14039			tracing.EndSpan(ctx, sc, err)
14040		}()
14041	}
14042	if err := validation.Validate([]validation.Validation{
14043		{TargetValue: timeout,
14044			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14045				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14046					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14047				}}}}}); err != nil {
14048		return result, validation.NewError("servicefabric.BaseClient", "GetSubNameInfoList", err.Error())
14049	}
14050
14051	req, err := client.GetSubNameInfoListPreparer(ctx, nameID, recursive, continuationToken, timeout)
14052	if err != nil {
14053		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", nil, "Failure preparing request")
14054		return
14055	}
14056
14057	resp, err := client.GetSubNameInfoListSender(req)
14058	if err != nil {
14059		result.Response = autorest.Response{Response: resp}
14060		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", resp, "Failure sending request")
14061		return
14062	}
14063
14064	result, err = client.GetSubNameInfoListResponder(resp)
14065	if err != nil {
14066		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", resp, "Failure responding to request")
14067		return
14068	}
14069
14070	return
14071}
14072
14073// GetSubNameInfoListPreparer prepares the GetSubNameInfoList request.
14074func (client BaseClient) GetSubNameInfoListPreparer(ctx context.Context, nameID string, recursive *bool, continuationToken string, timeout *int64) (*http.Request, error) {
14075	pathParameters := map[string]interface{}{
14076		"nameId": nameID,
14077	}
14078
14079	const APIVersion = "6.0"
14080	queryParameters := map[string]interface{}{
14081		"api-version": APIVersion,
14082	}
14083	if recursive != nil {
14084		queryParameters["Recursive"] = autorest.Encode("query", *recursive)
14085	} else {
14086		queryParameters["Recursive"] = autorest.Encode("query", false)
14087	}
14088	if len(continuationToken) > 0 {
14089		queryParameters["ContinuationToken"] = continuationToken
14090	}
14091	if timeout != nil {
14092		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14093	} else {
14094		queryParameters["timeout"] = autorest.Encode("query", 60)
14095	}
14096
14097	preparer := autorest.CreatePreparer(
14098		autorest.AsGet(),
14099		autorest.WithBaseURL(client.BaseURI),
14100		autorest.WithPathParameters("/Names/{nameId}/$/GetSubNames", pathParameters),
14101		autorest.WithQueryParameters(queryParameters))
14102	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14103}
14104
14105// GetSubNameInfoListSender sends the GetSubNameInfoList request. The method will close the
14106// http.Response Body if it receives an error.
14107func (client BaseClient) GetSubNameInfoListSender(req *http.Request) (*http.Response, error) {
14108	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14109}
14110
14111// GetSubNameInfoListResponder handles the response to the GetSubNameInfoList request. The method always
14112// closes the http.Response Body.
14113func (client BaseClient) GetSubNameInfoListResponder(resp *http.Response) (result PagedSubNameInfoList, err error) {
14114	err = autorest.Respond(
14115		resp,
14116		azure.WithErrorUnlessStatusCode(http.StatusOK),
14117		autorest.ByUnmarshallingJSON(&result),
14118		autorest.ByClosing())
14119	result.Response = autorest.Response{Response: resp}
14120	return
14121}
14122
14123// GetUpgradeOrchestrationServiceState get the service state of Service Fabric Upgrade Orchestration Service. This API
14124// is internally used for support purposes.
14125// Parameters:
14126// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14127// duration that the client is willing to wait for the requested operation to complete. The default value for
14128// this parameter is 60 seconds.
14129func (client BaseClient) GetUpgradeOrchestrationServiceState(ctx context.Context, timeout *int64) (result UpgradeOrchestrationServiceState, err error) {
14130	if tracing.IsEnabled() {
14131		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetUpgradeOrchestrationServiceState")
14132		defer func() {
14133			sc := -1
14134			if result.Response.Response != nil {
14135				sc = result.Response.Response.StatusCode
14136			}
14137			tracing.EndSpan(ctx, sc, err)
14138		}()
14139	}
14140	if err := validation.Validate([]validation.Validation{
14141		{TargetValue: timeout,
14142			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14143				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14144					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14145				}}}}}); err != nil {
14146		return result, validation.NewError("servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", err.Error())
14147	}
14148
14149	req, err := client.GetUpgradeOrchestrationServiceStatePreparer(ctx, timeout)
14150	if err != nil {
14151		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", nil, "Failure preparing request")
14152		return
14153	}
14154
14155	resp, err := client.GetUpgradeOrchestrationServiceStateSender(req)
14156	if err != nil {
14157		result.Response = autorest.Response{Response: resp}
14158		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", resp, "Failure sending request")
14159		return
14160	}
14161
14162	result, err = client.GetUpgradeOrchestrationServiceStateResponder(resp)
14163	if err != nil {
14164		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", resp, "Failure responding to request")
14165		return
14166	}
14167
14168	return
14169}
14170
14171// GetUpgradeOrchestrationServiceStatePreparer prepares the GetUpgradeOrchestrationServiceState request.
14172func (client BaseClient) GetUpgradeOrchestrationServiceStatePreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
14173	const APIVersion = "6.0"
14174	queryParameters := map[string]interface{}{
14175		"api-version": APIVersion,
14176	}
14177	if timeout != nil {
14178		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14179	} else {
14180		queryParameters["timeout"] = autorest.Encode("query", 60)
14181	}
14182
14183	preparer := autorest.CreatePreparer(
14184		autorest.AsGet(),
14185		autorest.WithBaseURL(client.BaseURI),
14186		autorest.WithPath("/$/GetUpgradeOrchestrationServiceState"),
14187		autorest.WithQueryParameters(queryParameters))
14188	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14189}
14190
14191// GetUpgradeOrchestrationServiceStateSender sends the GetUpgradeOrchestrationServiceState request. The method will close the
14192// http.Response Body if it receives an error.
14193func (client BaseClient) GetUpgradeOrchestrationServiceStateSender(req *http.Request) (*http.Response, error) {
14194	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14195}
14196
14197// GetUpgradeOrchestrationServiceStateResponder handles the response to the GetUpgradeOrchestrationServiceState request. The method always
14198// closes the http.Response Body.
14199func (client BaseClient) GetUpgradeOrchestrationServiceStateResponder(resp *http.Response) (result UpgradeOrchestrationServiceState, err error) {
14200	err = autorest.Respond(
14201		resp,
14202		azure.WithErrorUnlessStatusCode(http.StatusOK),
14203		autorest.ByUnmarshallingJSON(&result),
14204		autorest.ByClosing())
14205	result.Response = autorest.Response{Response: resp}
14206	return
14207}
14208
14209// InvokeContainerAPI invoke container API on a container deployed on a Service Fabric node for the given code package.
14210// Parameters:
14211// nodeName - the name of the node.
14212// applicationID - the identity of the application. This is typically the full name of the application without
14213// the 'fabric:' URI scheme.
14214// Starting from version 6.0, hierarchical names are delimited with the "~" character.
14215// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
14216// in 6.0+ and "myapp/app1" in previous versions.
14217// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
14218// Fabric cluster.
14219// codePackageName - the name of code package specified in service manifest registered as part of an
14220// application type in a Service Fabric cluster.
14221// codePackageInstanceID - ID that uniquely identifies a code package instance deployed on a service fabric
14222// node.
14223// containerAPIRequestBody - parameters for making container API call
14224// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14225// duration that the client is willing to wait for the requested operation to complete. The default value for
14226// this parameter is 60 seconds.
14227func (client BaseClient) InvokeContainerAPI(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, codePackageInstanceID string, containerAPIRequestBody ContainerAPIRequestBody, timeout *int64) (result ContainerAPIResponse, err error) {
14228	if tracing.IsEnabled() {
14229		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeContainerAPI")
14230		defer func() {
14231			sc := -1
14232			if result.Response.Response != nil {
14233				sc = result.Response.Response.StatusCode
14234			}
14235			tracing.EndSpan(ctx, sc, err)
14236		}()
14237	}
14238	if err := validation.Validate([]validation.Validation{
14239		{TargetValue: timeout,
14240			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14241				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14242					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14243				}}}},
14244		{TargetValue: containerAPIRequestBody,
14245			Constraints: []validation.Constraint{{Target: "containerAPIRequestBody.URIPath", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
14246		return result, validation.NewError("servicefabric.BaseClient", "InvokeContainerAPI", err.Error())
14247	}
14248
14249	req, err := client.InvokeContainerAPIPreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, codePackageInstanceID, containerAPIRequestBody, timeout)
14250	if err != nil {
14251		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", nil, "Failure preparing request")
14252		return
14253	}
14254
14255	resp, err := client.InvokeContainerAPISender(req)
14256	if err != nil {
14257		result.Response = autorest.Response{Response: resp}
14258		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", resp, "Failure sending request")
14259		return
14260	}
14261
14262	result, err = client.InvokeContainerAPIResponder(resp)
14263	if err != nil {
14264		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", resp, "Failure responding to request")
14265		return
14266	}
14267
14268	return
14269}
14270
14271// InvokeContainerAPIPreparer prepares the InvokeContainerAPI request.
14272func (client BaseClient) InvokeContainerAPIPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, codePackageInstanceID string, containerAPIRequestBody ContainerAPIRequestBody, timeout *int64) (*http.Request, error) {
14273	pathParameters := map[string]interface{}{
14274		"applicationId": applicationID,
14275		"nodeName":      autorest.Encode("path", nodeName),
14276	}
14277
14278	const APIVersion = "6.2"
14279	queryParameters := map[string]interface{}{
14280		"api-version":           APIVersion,
14281		"CodePackageInstanceId": autorest.Encode("query", codePackageInstanceID),
14282		"CodePackageName":       autorest.Encode("query", codePackageName),
14283		"ServiceManifestName":   autorest.Encode("query", serviceManifestName),
14284	}
14285	if timeout != nil {
14286		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14287	} else {
14288		queryParameters["timeout"] = autorest.Encode("query", 60)
14289	}
14290
14291	preparer := autorest.CreatePreparer(
14292		autorest.AsContentType("application/json; charset=utf-8"),
14293		autorest.AsPost(),
14294		autorest.WithBaseURL(client.BaseURI),
14295		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerApi", pathParameters),
14296		autorest.WithJSON(containerAPIRequestBody),
14297		autorest.WithQueryParameters(queryParameters))
14298	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14299}
14300
14301// InvokeContainerAPISender sends the InvokeContainerAPI request. The method will close the
14302// http.Response Body if it receives an error.
14303func (client BaseClient) InvokeContainerAPISender(req *http.Request) (*http.Response, error) {
14304	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14305}
14306
14307// InvokeContainerAPIResponder handles the response to the InvokeContainerAPI request. The method always
14308// closes the http.Response Body.
14309func (client BaseClient) InvokeContainerAPIResponder(resp *http.Response) (result ContainerAPIResponse, err error) {
14310	err = autorest.Respond(
14311		resp,
14312		azure.WithErrorUnlessStatusCode(http.StatusOK),
14313		autorest.ByUnmarshallingJSON(&result),
14314		autorest.ByClosing())
14315	result.Response = autorest.Response{Response: resp}
14316	return
14317}
14318
14319// InvokeInfrastructureCommand for clusters that have one or more instances of the Infrastructure Service configured,
14320// this API provides a way to send infrastructure-specific commands to a particular
14321// instance of the Infrastructure Service.
14322//
14323// Available commands and their corresponding response formats vary depending upon
14324// the infrastructure on which the cluster is running.
14325//
14326// This API supports the Service Fabric platform; it is not meant to be used directly from your code.
14327// Parameters:
14328// command - the text of the command to be invoked. The content of the command is infrastructure-specific.
14329// serviceID - the identity of the infrastructure service. This is  the full name of the infrastructure service
14330// without the 'fabric:' URI scheme. This parameter required only for the cluster that have more than one
14331// instance of infrastructure service running.
14332// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14333// duration that the client is willing to wait for the requested operation to complete. The default value for
14334// this parameter is 60 seconds.
14335func (client BaseClient) InvokeInfrastructureCommand(ctx context.Context, command string, serviceID string, timeout *int64) (result String, err error) {
14336	if tracing.IsEnabled() {
14337		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeInfrastructureCommand")
14338		defer func() {
14339			sc := -1
14340			if result.Response.Response != nil {
14341				sc = result.Response.Response.StatusCode
14342			}
14343			tracing.EndSpan(ctx, sc, err)
14344		}()
14345	}
14346	if err := validation.Validate([]validation.Validation{
14347		{TargetValue: timeout,
14348			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14349				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14350					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14351				}}}}}); err != nil {
14352		return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureCommand", err.Error())
14353	}
14354
14355	req, err := client.InvokeInfrastructureCommandPreparer(ctx, command, serviceID, timeout)
14356	if err != nil {
14357		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", nil, "Failure preparing request")
14358		return
14359	}
14360
14361	resp, err := client.InvokeInfrastructureCommandSender(req)
14362	if err != nil {
14363		result.Response = autorest.Response{Response: resp}
14364		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", resp, "Failure sending request")
14365		return
14366	}
14367
14368	result, err = client.InvokeInfrastructureCommandResponder(resp)
14369	if err != nil {
14370		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", resp, "Failure responding to request")
14371		return
14372	}
14373
14374	return
14375}
14376
14377// InvokeInfrastructureCommandPreparer prepares the InvokeInfrastructureCommand request.
14378func (client BaseClient) InvokeInfrastructureCommandPreparer(ctx context.Context, command string, serviceID string, timeout *int64) (*http.Request, error) {
14379	const APIVersion = "6.0"
14380	queryParameters := map[string]interface{}{
14381		"api-version": APIVersion,
14382		"Command":     autorest.Encode("query", command),
14383	}
14384	if len(serviceID) > 0 {
14385		queryParameters["ServiceId"] = autorest.Encode("query", serviceID)
14386	}
14387	if timeout != nil {
14388		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14389	} else {
14390		queryParameters["timeout"] = autorest.Encode("query", 60)
14391	}
14392
14393	preparer := autorest.CreatePreparer(
14394		autorest.AsPost(),
14395		autorest.WithBaseURL(client.BaseURI),
14396		autorest.WithPath("/$/InvokeInfrastructureCommand"),
14397		autorest.WithQueryParameters(queryParameters))
14398	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14399}
14400
14401// InvokeInfrastructureCommandSender sends the InvokeInfrastructureCommand request. The method will close the
14402// http.Response Body if it receives an error.
14403func (client BaseClient) InvokeInfrastructureCommandSender(req *http.Request) (*http.Response, error) {
14404	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14405}
14406
14407// InvokeInfrastructureCommandResponder handles the response to the InvokeInfrastructureCommand request. The method always
14408// closes the http.Response Body.
14409func (client BaseClient) InvokeInfrastructureCommandResponder(resp *http.Response) (result String, err error) {
14410	err = autorest.Respond(
14411		resp,
14412		azure.WithErrorUnlessStatusCode(http.StatusOK),
14413		autorest.ByUnmarshallingJSON(&result.Value),
14414		autorest.ByClosing())
14415	result.Response = autorest.Response{Response: resp}
14416	return
14417}
14418
14419// InvokeInfrastructureQuery for clusters that have one or more instances of the Infrastructure Service configured,
14420// this API provides a way to send infrastructure-specific queries to a particular
14421// instance of the Infrastructure Service.
14422//
14423// Available commands and their corresponding response formats vary depending upon
14424// the infrastructure on which the cluster is running.
14425//
14426// This API supports the Service Fabric platform; it is not meant to be used directly from your code.
14427// Parameters:
14428// command - the text of the command to be invoked. The content of the command is infrastructure-specific.
14429// serviceID - the identity of the infrastructure service. This is  the full name of the infrastructure service
14430// without the 'fabric:' URI scheme. This parameter required only for the cluster that have more than one
14431// instance of infrastructure service running.
14432// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14433// duration that the client is willing to wait for the requested operation to complete. The default value for
14434// this parameter is 60 seconds.
14435func (client BaseClient) InvokeInfrastructureQuery(ctx context.Context, command string, serviceID string, timeout *int64) (result String, err error) {
14436	if tracing.IsEnabled() {
14437		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeInfrastructureQuery")
14438		defer func() {
14439			sc := -1
14440			if result.Response.Response != nil {
14441				sc = result.Response.Response.StatusCode
14442			}
14443			tracing.EndSpan(ctx, sc, err)
14444		}()
14445	}
14446	if err := validation.Validate([]validation.Validation{
14447		{TargetValue: timeout,
14448			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14449				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14450					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14451				}}}}}); err != nil {
14452		return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureQuery", err.Error())
14453	}
14454
14455	req, err := client.InvokeInfrastructureQueryPreparer(ctx, command, serviceID, timeout)
14456	if err != nil {
14457		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", nil, "Failure preparing request")
14458		return
14459	}
14460
14461	resp, err := client.InvokeInfrastructureQuerySender(req)
14462	if err != nil {
14463		result.Response = autorest.Response{Response: resp}
14464		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", resp, "Failure sending request")
14465		return
14466	}
14467
14468	result, err = client.InvokeInfrastructureQueryResponder(resp)
14469	if err != nil {
14470		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", resp, "Failure responding to request")
14471		return
14472	}
14473
14474	return
14475}
14476
14477// InvokeInfrastructureQueryPreparer prepares the InvokeInfrastructureQuery request.
14478func (client BaseClient) InvokeInfrastructureQueryPreparer(ctx context.Context, command string, serviceID string, timeout *int64) (*http.Request, error) {
14479	const APIVersion = "6.0"
14480	queryParameters := map[string]interface{}{
14481		"api-version": APIVersion,
14482		"Command":     autorest.Encode("query", command),
14483	}
14484	if len(serviceID) > 0 {
14485		queryParameters["ServiceId"] = autorest.Encode("query", serviceID)
14486	}
14487	if timeout != nil {
14488		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14489	} else {
14490		queryParameters["timeout"] = autorest.Encode("query", 60)
14491	}
14492
14493	preparer := autorest.CreatePreparer(
14494		autorest.AsGet(),
14495		autorest.WithBaseURL(client.BaseURI),
14496		autorest.WithPath("/$/InvokeInfrastructureQuery"),
14497		autorest.WithQueryParameters(queryParameters))
14498	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14499}
14500
14501// InvokeInfrastructureQuerySender sends the InvokeInfrastructureQuery request. The method will close the
14502// http.Response Body if it receives an error.
14503func (client BaseClient) InvokeInfrastructureQuerySender(req *http.Request) (*http.Response, error) {
14504	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14505}
14506
14507// InvokeInfrastructureQueryResponder handles the response to the InvokeInfrastructureQuery request. The method always
14508// closes the http.Response Body.
14509func (client BaseClient) InvokeInfrastructureQueryResponder(resp *http.Response) (result String, err error) {
14510	err = autorest.Respond(
14511		resp,
14512		azure.WithErrorUnlessStatusCode(http.StatusOK),
14513		autorest.ByUnmarshallingJSON(&result.Value),
14514		autorest.ByClosing())
14515	result.Response = autorest.Response{Response: resp}
14516	return
14517}
14518
14519// PostChaosSchedule set the Chaos Schedule currently in use by Chaos. Chaos will automatically schedule runs based on
14520// the Chaos Schedule.
14521// The version in the provided input schedule must match the version of the Chaos Schedule on the server.
14522// If the version provided does not match the version on the server, the Chaos Schedule is not updated.
14523// If the version provided matches the version on the server, then the Chaos Schedule is updated and the version of the
14524// Chaos Schedule on the server is incremented up by one and wraps back to 0 after 2,147,483,647.
14525// If Chaos is running when this call is made, the call will fail.
14526// Parameters:
14527// chaosSchedule - describes the schedule used by Chaos.
14528func (client BaseClient) PostChaosSchedule(ctx context.Context, chaosSchedule ChaosScheduleDescription) (result autorest.Response, err error) {
14529	if tracing.IsEnabled() {
14530		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PostChaosSchedule")
14531		defer func() {
14532			sc := -1
14533			if result.Response != nil {
14534				sc = result.Response.StatusCode
14535			}
14536			tracing.EndSpan(ctx, sc, err)
14537		}()
14538	}
14539	if err := validation.Validate([]validation.Validation{
14540		{TargetValue: chaosSchedule,
14541			Constraints: []validation.Constraint{{Target: "chaosSchedule.Version", Name: validation.Null, Rule: false,
14542				Chain: []validation.Constraint{{Target: "chaosSchedule.Version", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil {
14543		return result, validation.NewError("servicefabric.BaseClient", "PostChaosSchedule", err.Error())
14544	}
14545
14546	req, err := client.PostChaosSchedulePreparer(ctx, chaosSchedule)
14547	if err != nil {
14548		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", nil, "Failure preparing request")
14549		return
14550	}
14551
14552	resp, err := client.PostChaosScheduleSender(req)
14553	if err != nil {
14554		result.Response = resp
14555		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", resp, "Failure sending request")
14556		return
14557	}
14558
14559	result, err = client.PostChaosScheduleResponder(resp)
14560	if err != nil {
14561		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", resp, "Failure responding to request")
14562		return
14563	}
14564
14565	return
14566}
14567
14568// PostChaosSchedulePreparer prepares the PostChaosSchedule request.
14569func (client BaseClient) PostChaosSchedulePreparer(ctx context.Context, chaosSchedule ChaosScheduleDescription) (*http.Request, error) {
14570	const APIVersion = "6.2"
14571	queryParameters := map[string]interface{}{
14572		"api-version": APIVersion,
14573	}
14574
14575	preparer := autorest.CreatePreparer(
14576		autorest.AsContentType("application/json; charset=utf-8"),
14577		autorest.AsPost(),
14578		autorest.WithBaseURL(client.BaseURI),
14579		autorest.WithPath("/Tools/Chaos/Schedule"),
14580		autorest.WithJSON(chaosSchedule),
14581		autorest.WithQueryParameters(queryParameters))
14582	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14583}
14584
14585// PostChaosScheduleSender sends the PostChaosSchedule request. The method will close the
14586// http.Response Body if it receives an error.
14587func (client BaseClient) PostChaosScheduleSender(req *http.Request) (*http.Response, error) {
14588	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14589}
14590
14591// PostChaosScheduleResponder handles the response to the PostChaosSchedule request. The method always
14592// closes the http.Response Body.
14593func (client BaseClient) PostChaosScheduleResponder(resp *http.Response) (result autorest.Response, err error) {
14594	err = autorest.Respond(
14595		resp,
14596		azure.WithErrorUnlessStatusCode(http.StatusOK),
14597		autorest.ByClosing())
14598	result.Response = resp
14599	return
14600}
14601
14602// ProvisionApplicationType provisions a Service Fabric application type with the cluster. The provision is required
14603// before any new applications can be instantiated.
14604// The provision operation can be performed either on the application package specified by the
14605// relativePathInImageStore, or by using the URI of the external '.sfpkg'.
14606// Parameters:
14607// provisionApplicationTypeDescriptionBaseRequiredBodyParam - the base type of provision application type
14608// description which supports either image store-based provision or external store-based provision.
14609// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14610// duration that the client is willing to wait for the requested operation to complete. The default value for
14611// this parameter is 60 seconds.
14612func (client BaseClient) ProvisionApplicationType(ctx context.Context, provisionApplicationTypeDescriptionBaseRequiredBodyParam BasicProvisionApplicationTypeDescriptionBase, timeout *int64) (result autorest.Response, err error) {
14613	if tracing.IsEnabled() {
14614		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ProvisionApplicationType")
14615		defer func() {
14616			sc := -1
14617			if result.Response != nil {
14618				sc = result.Response.StatusCode
14619			}
14620			tracing.EndSpan(ctx, sc, err)
14621		}()
14622	}
14623	if err := validation.Validate([]validation.Validation{
14624		{TargetValue: provisionApplicationTypeDescriptionBaseRequiredBodyParam,
14625			Constraints: []validation.Constraint{{Target: "provisionApplicationTypeDescriptionBaseRequiredBodyParam.Async", Name: validation.Null, Rule: true, Chain: nil}}},
14626		{TargetValue: timeout,
14627			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14628				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14629					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14630				}}}}}); err != nil {
14631		return result, validation.NewError("servicefabric.BaseClient", "ProvisionApplicationType", err.Error())
14632	}
14633
14634	req, err := client.ProvisionApplicationTypePreparer(ctx, provisionApplicationTypeDescriptionBaseRequiredBodyParam, timeout)
14635	if err != nil {
14636		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", nil, "Failure preparing request")
14637		return
14638	}
14639
14640	resp, err := client.ProvisionApplicationTypeSender(req)
14641	if err != nil {
14642		result.Response = resp
14643		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", resp, "Failure sending request")
14644		return
14645	}
14646
14647	result, err = client.ProvisionApplicationTypeResponder(resp)
14648	if err != nil {
14649		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", resp, "Failure responding to request")
14650		return
14651	}
14652
14653	return
14654}
14655
14656// ProvisionApplicationTypePreparer prepares the ProvisionApplicationType request.
14657func (client BaseClient) ProvisionApplicationTypePreparer(ctx context.Context, provisionApplicationTypeDescriptionBaseRequiredBodyParam BasicProvisionApplicationTypeDescriptionBase, timeout *int64) (*http.Request, error) {
14658	const APIVersion = "6.2"
14659	queryParameters := map[string]interface{}{
14660		"api-version": APIVersion,
14661	}
14662	if timeout != nil {
14663		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14664	} else {
14665		queryParameters["timeout"] = autorest.Encode("query", 60)
14666	}
14667
14668	preparer := autorest.CreatePreparer(
14669		autorest.AsContentType("application/json; charset=utf-8"),
14670		autorest.AsPost(),
14671		autorest.WithBaseURL(client.BaseURI),
14672		autorest.WithPath("/ApplicationTypes/$/Provision"),
14673		autorest.WithJSON(provisionApplicationTypeDescriptionBaseRequiredBodyParam),
14674		autorest.WithQueryParameters(queryParameters))
14675	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14676}
14677
14678// ProvisionApplicationTypeSender sends the ProvisionApplicationType request. The method will close the
14679// http.Response Body if it receives an error.
14680func (client BaseClient) ProvisionApplicationTypeSender(req *http.Request) (*http.Response, error) {
14681	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14682}
14683
14684// ProvisionApplicationTypeResponder handles the response to the ProvisionApplicationType request. The method always
14685// closes the http.Response Body.
14686func (client BaseClient) ProvisionApplicationTypeResponder(resp *http.Response) (result autorest.Response, err error) {
14687	err = autorest.Respond(
14688		resp,
14689		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
14690		autorest.ByClosing())
14691	result.Response = resp
14692	return
14693}
14694
14695// ProvisionCluster validate and provision the code or configuration packages of a Service Fabric cluster.
14696// Parameters:
14697// provisionFabricDescription - describes the parameters for provisioning a cluster.
14698// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14699// duration that the client is willing to wait for the requested operation to complete. The default value for
14700// this parameter is 60 seconds.
14701func (client BaseClient) ProvisionCluster(ctx context.Context, provisionFabricDescription ProvisionFabricDescription, timeout *int64) (result autorest.Response, err error) {
14702	if tracing.IsEnabled() {
14703		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ProvisionCluster")
14704		defer func() {
14705			sc := -1
14706			if result.Response != nil {
14707				sc = result.Response.StatusCode
14708			}
14709			tracing.EndSpan(ctx, sc, err)
14710		}()
14711	}
14712	if err := validation.Validate([]validation.Validation{
14713		{TargetValue: timeout,
14714			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14715				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14716					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14717				}}}}}); err != nil {
14718		return result, validation.NewError("servicefabric.BaseClient", "ProvisionCluster", err.Error())
14719	}
14720
14721	req, err := client.ProvisionClusterPreparer(ctx, provisionFabricDescription, timeout)
14722	if err != nil {
14723		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", nil, "Failure preparing request")
14724		return
14725	}
14726
14727	resp, err := client.ProvisionClusterSender(req)
14728	if err != nil {
14729		result.Response = resp
14730		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", resp, "Failure sending request")
14731		return
14732	}
14733
14734	result, err = client.ProvisionClusterResponder(resp)
14735	if err != nil {
14736		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", resp, "Failure responding to request")
14737		return
14738	}
14739
14740	return
14741}
14742
14743// ProvisionClusterPreparer prepares the ProvisionCluster request.
14744func (client BaseClient) ProvisionClusterPreparer(ctx context.Context, provisionFabricDescription ProvisionFabricDescription, timeout *int64) (*http.Request, error) {
14745	const APIVersion = "6.0"
14746	queryParameters := map[string]interface{}{
14747		"api-version": APIVersion,
14748	}
14749	if timeout != nil {
14750		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14751	} else {
14752		queryParameters["timeout"] = autorest.Encode("query", 60)
14753	}
14754
14755	preparer := autorest.CreatePreparer(
14756		autorest.AsContentType("application/json; charset=utf-8"),
14757		autorest.AsPost(),
14758		autorest.WithBaseURL(client.BaseURI),
14759		autorest.WithPath("/$/Provision"),
14760		autorest.WithJSON(provisionFabricDescription),
14761		autorest.WithQueryParameters(queryParameters))
14762	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14763}
14764
14765// ProvisionClusterSender sends the ProvisionCluster request. The method will close the
14766// http.Response Body if it receives an error.
14767func (client BaseClient) ProvisionClusterSender(req *http.Request) (*http.Response, error) {
14768	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14769}
14770
14771// ProvisionClusterResponder handles the response to the ProvisionCluster request. The method always
14772// closes the http.Response Body.
14773func (client BaseClient) ProvisionClusterResponder(resp *http.Response) (result autorest.Response, err error) {
14774	err = autorest.Respond(
14775		resp,
14776		azure.WithErrorUnlessStatusCode(http.StatusOK),
14777		autorest.ByClosing())
14778	result.Response = resp
14779	return
14780}
14781
14782// PutProperty creates or updates the specified Service Fabric property under a given name.
14783// Parameters:
14784// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
14785// propertyDescription - describes the Service Fabric property to be created.
14786// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14787// duration that the client is willing to wait for the requested operation to complete. The default value for
14788// this parameter is 60 seconds.
14789func (client BaseClient) PutProperty(ctx context.Context, nameID string, propertyDescription PropertyDescription, timeout *int64) (result autorest.Response, err error) {
14790	if tracing.IsEnabled() {
14791		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PutProperty")
14792		defer func() {
14793			sc := -1
14794			if result.Response != nil {
14795				sc = result.Response.StatusCode
14796			}
14797			tracing.EndSpan(ctx, sc, err)
14798		}()
14799	}
14800	if err := validation.Validate([]validation.Validation{
14801		{TargetValue: propertyDescription,
14802			Constraints: []validation.Constraint{{Target: "propertyDescription.PropertyName", Name: validation.Null, Rule: true, Chain: nil}}},
14803		{TargetValue: timeout,
14804			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14805				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14806					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14807				}}}}}); err != nil {
14808		return result, validation.NewError("servicefabric.BaseClient", "PutProperty", err.Error())
14809	}
14810
14811	req, err := client.PutPropertyPreparer(ctx, nameID, propertyDescription, timeout)
14812	if err != nil {
14813		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", nil, "Failure preparing request")
14814		return
14815	}
14816
14817	resp, err := client.PutPropertySender(req)
14818	if err != nil {
14819		result.Response = resp
14820		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", resp, "Failure sending request")
14821		return
14822	}
14823
14824	result, err = client.PutPropertyResponder(resp)
14825	if err != nil {
14826		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", resp, "Failure responding to request")
14827		return
14828	}
14829
14830	return
14831}
14832
14833// PutPropertyPreparer prepares the PutProperty request.
14834func (client BaseClient) PutPropertyPreparer(ctx context.Context, nameID string, propertyDescription PropertyDescription, timeout *int64) (*http.Request, error) {
14835	pathParameters := map[string]interface{}{
14836		"nameId": nameID,
14837	}
14838
14839	const APIVersion = "6.0"
14840	queryParameters := map[string]interface{}{
14841		"api-version": APIVersion,
14842	}
14843	if timeout != nil {
14844		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14845	} else {
14846		queryParameters["timeout"] = autorest.Encode("query", 60)
14847	}
14848
14849	preparer := autorest.CreatePreparer(
14850		autorest.AsContentType("application/json; charset=utf-8"),
14851		autorest.AsPut(),
14852		autorest.WithBaseURL(client.BaseURI),
14853		autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters),
14854		autorest.WithJSON(propertyDescription),
14855		autorest.WithQueryParameters(queryParameters))
14856	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14857}
14858
14859// PutPropertySender sends the PutProperty request. The method will close the
14860// http.Response Body if it receives an error.
14861func (client BaseClient) PutPropertySender(req *http.Request) (*http.Response, error) {
14862	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14863}
14864
14865// PutPropertyResponder handles the response to the PutProperty request. The method always
14866// closes the http.Response Body.
14867func (client BaseClient) PutPropertyResponder(resp *http.Response) (result autorest.Response, err error) {
14868	err = autorest.Respond(
14869		resp,
14870		azure.WithErrorUnlessStatusCode(http.StatusOK),
14871		autorest.ByClosing())
14872	result.Response = resp
14873	return
14874}
14875
14876// RecoverAllPartitions indicates to the Service Fabric cluster that it should attempt to recover any services
14877// (including system services) which are currently stuck in quorum loss. This operation should only be performed if it
14878// is known that the replicas that are down cannot be recovered. Incorrect use of this API can cause potential data
14879// loss.
14880// Parameters:
14881// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14882// duration that the client is willing to wait for the requested operation to complete. The default value for
14883// this parameter is 60 seconds.
14884func (client BaseClient) RecoverAllPartitions(ctx context.Context, timeout *int64) (result autorest.Response, err error) {
14885	if tracing.IsEnabled() {
14886		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverAllPartitions")
14887		defer func() {
14888			sc := -1
14889			if result.Response != nil {
14890				sc = result.Response.StatusCode
14891			}
14892			tracing.EndSpan(ctx, sc, err)
14893		}()
14894	}
14895	if err := validation.Validate([]validation.Validation{
14896		{TargetValue: timeout,
14897			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14898				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14899					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14900				}}}}}); err != nil {
14901		return result, validation.NewError("servicefabric.BaseClient", "RecoverAllPartitions", err.Error())
14902	}
14903
14904	req, err := client.RecoverAllPartitionsPreparer(ctx, timeout)
14905	if err != nil {
14906		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", nil, "Failure preparing request")
14907		return
14908	}
14909
14910	resp, err := client.RecoverAllPartitionsSender(req)
14911	if err != nil {
14912		result.Response = resp
14913		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", resp, "Failure sending request")
14914		return
14915	}
14916
14917	result, err = client.RecoverAllPartitionsResponder(resp)
14918	if err != nil {
14919		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", resp, "Failure responding to request")
14920		return
14921	}
14922
14923	return
14924}
14925
14926// RecoverAllPartitionsPreparer prepares the RecoverAllPartitions request.
14927func (client BaseClient) RecoverAllPartitionsPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
14928	const APIVersion = "6.0"
14929	queryParameters := map[string]interface{}{
14930		"api-version": APIVersion,
14931	}
14932	if timeout != nil {
14933		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14934	} else {
14935		queryParameters["timeout"] = autorest.Encode("query", 60)
14936	}
14937
14938	preparer := autorest.CreatePreparer(
14939		autorest.AsPost(),
14940		autorest.WithBaseURL(client.BaseURI),
14941		autorest.WithPath("/$/RecoverAllPartitions"),
14942		autorest.WithQueryParameters(queryParameters))
14943	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14944}
14945
14946// RecoverAllPartitionsSender sends the RecoverAllPartitions request. The method will close the
14947// http.Response Body if it receives an error.
14948func (client BaseClient) RecoverAllPartitionsSender(req *http.Request) (*http.Response, error) {
14949	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14950}
14951
14952// RecoverAllPartitionsResponder handles the response to the RecoverAllPartitions request. The method always
14953// closes the http.Response Body.
14954func (client BaseClient) RecoverAllPartitionsResponder(resp *http.Response) (result autorest.Response, err error) {
14955	err = autorest.Respond(
14956		resp,
14957		azure.WithErrorUnlessStatusCode(http.StatusOK),
14958		autorest.ByClosing())
14959	result.Response = resp
14960	return
14961}
14962
14963// RecoverPartition indicates to the Service Fabric cluster that it should attempt to recover a specific partition
14964// which is currently stuck in quorum loss. This operation should only be performed if it is known that the replicas
14965// that are down cannot be recovered. Incorrect use of this API can cause potential data loss.
14966// Parameters:
14967// partitionID - the identity of the partition.
14968// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14969// duration that the client is willing to wait for the requested operation to complete. The default value for
14970// this parameter is 60 seconds.
14971func (client BaseClient) RecoverPartition(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
14972	if tracing.IsEnabled() {
14973		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverPartition")
14974		defer func() {
14975			sc := -1
14976			if result.Response != nil {
14977				sc = result.Response.StatusCode
14978			}
14979			tracing.EndSpan(ctx, sc, err)
14980		}()
14981	}
14982	if err := validation.Validate([]validation.Validation{
14983		{TargetValue: timeout,
14984			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14985				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14986					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14987				}}}}}); err != nil {
14988		return result, validation.NewError("servicefabric.BaseClient", "RecoverPartition", err.Error())
14989	}
14990
14991	req, err := client.RecoverPartitionPreparer(ctx, partitionID, timeout)
14992	if err != nil {
14993		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", nil, "Failure preparing request")
14994		return
14995	}
14996
14997	resp, err := client.RecoverPartitionSender(req)
14998	if err != nil {
14999		result.Response = resp
15000		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", resp, "Failure sending request")
15001		return
15002	}
15003
15004	result, err = client.RecoverPartitionResponder(resp)
15005	if err != nil {
15006		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", resp, "Failure responding to request")
15007		return
15008	}
15009
15010	return
15011}
15012
15013// RecoverPartitionPreparer prepares the RecoverPartition request.
15014func (client BaseClient) RecoverPartitionPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
15015	pathParameters := map[string]interface{}{
15016		"partitionId": partitionID,
15017	}
15018
15019	const APIVersion = "6.0"
15020	queryParameters := map[string]interface{}{
15021		"api-version": APIVersion,
15022	}
15023	if timeout != nil {
15024		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15025	} else {
15026		queryParameters["timeout"] = autorest.Encode("query", 60)
15027	}
15028
15029	preparer := autorest.CreatePreparer(
15030		autorest.AsPost(),
15031		autorest.WithBaseURL(client.BaseURI),
15032		autorest.WithPathParameters("/Partitions/{partitionId}/$/Recover", pathParameters),
15033		autorest.WithQueryParameters(queryParameters))
15034	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15035}
15036
15037// RecoverPartitionSender sends the RecoverPartition request. The method will close the
15038// http.Response Body if it receives an error.
15039func (client BaseClient) RecoverPartitionSender(req *http.Request) (*http.Response, error) {
15040	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15041}
15042
15043// RecoverPartitionResponder handles the response to the RecoverPartition request. The method always
15044// closes the http.Response Body.
15045func (client BaseClient) RecoverPartitionResponder(resp *http.Response) (result autorest.Response, err error) {
15046	err = autorest.Respond(
15047		resp,
15048		azure.WithErrorUnlessStatusCode(http.StatusOK),
15049		autorest.ByClosing())
15050	result.Response = resp
15051	return
15052}
15053
15054// RecoverServicePartitions indicates to the Service Fabric cluster that it should attempt to recover the specified
15055// service which is currently stuck in quorum loss. This operation should only be performed if it is known that the
15056// replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss.
15057// Parameters:
15058// serviceID - the identity of the service. This is typically the full name of the service without the
15059// 'fabric:' URI scheme.
15060// Starting from version 6.0, hierarchical names are delimited with the "~" character.
15061// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
15062// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
15063// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15064// duration that the client is willing to wait for the requested operation to complete. The default value for
15065// this parameter is 60 seconds.
15066func (client BaseClient) RecoverServicePartitions(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) {
15067	if tracing.IsEnabled() {
15068		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverServicePartitions")
15069		defer func() {
15070			sc := -1
15071			if result.Response != nil {
15072				sc = result.Response.StatusCode
15073			}
15074			tracing.EndSpan(ctx, sc, err)
15075		}()
15076	}
15077	if err := validation.Validate([]validation.Validation{
15078		{TargetValue: timeout,
15079			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15080				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15081					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15082				}}}}}); err != nil {
15083		return result, validation.NewError("servicefabric.BaseClient", "RecoverServicePartitions", err.Error())
15084	}
15085
15086	req, err := client.RecoverServicePartitionsPreparer(ctx, serviceID, timeout)
15087	if err != nil {
15088		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", nil, "Failure preparing request")
15089		return
15090	}
15091
15092	resp, err := client.RecoverServicePartitionsSender(req)
15093	if err != nil {
15094		result.Response = resp
15095		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", resp, "Failure sending request")
15096		return
15097	}
15098
15099	result, err = client.RecoverServicePartitionsResponder(resp)
15100	if err != nil {
15101		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", resp, "Failure responding to request")
15102		return
15103	}
15104
15105	return
15106}
15107
15108// RecoverServicePartitionsPreparer prepares the RecoverServicePartitions request.
15109func (client BaseClient) RecoverServicePartitionsPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
15110	pathParameters := map[string]interface{}{
15111		"serviceId": serviceID,
15112	}
15113
15114	const APIVersion = "6.0"
15115	queryParameters := map[string]interface{}{
15116		"api-version": APIVersion,
15117	}
15118	if timeout != nil {
15119		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15120	} else {
15121		queryParameters["timeout"] = autorest.Encode("query", 60)
15122	}
15123
15124	preparer := autorest.CreatePreparer(
15125		autorest.AsPost(),
15126		autorest.WithBaseURL(client.BaseURI),
15127		autorest.WithPathParameters("/Services/$/{serviceId}/$/GetPartitions/$/Recover", pathParameters),
15128		autorest.WithQueryParameters(queryParameters))
15129	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15130}
15131
15132// RecoverServicePartitionsSender sends the RecoverServicePartitions request. The method will close the
15133// http.Response Body if it receives an error.
15134func (client BaseClient) RecoverServicePartitionsSender(req *http.Request) (*http.Response, error) {
15135	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15136}
15137
15138// RecoverServicePartitionsResponder handles the response to the RecoverServicePartitions request. The method always
15139// closes the http.Response Body.
15140func (client BaseClient) RecoverServicePartitionsResponder(resp *http.Response) (result autorest.Response, err error) {
15141	err = autorest.Respond(
15142		resp,
15143		azure.WithErrorUnlessStatusCode(http.StatusOK),
15144		autorest.ByClosing())
15145	result.Response = resp
15146	return
15147}
15148
15149// RecoverSystemPartitions indicates to the Service Fabric cluster that it should attempt to recover the system
15150// services which are currently stuck in quorum loss. This operation should only be performed if it is known that the
15151// replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss.
15152// Parameters:
15153// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15154// duration that the client is willing to wait for the requested operation to complete. The default value for
15155// this parameter is 60 seconds.
15156func (client BaseClient) RecoverSystemPartitions(ctx context.Context, timeout *int64) (result autorest.Response, err error) {
15157	if tracing.IsEnabled() {
15158		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverSystemPartitions")
15159		defer func() {
15160			sc := -1
15161			if result.Response != nil {
15162				sc = result.Response.StatusCode
15163			}
15164			tracing.EndSpan(ctx, sc, err)
15165		}()
15166	}
15167	if err := validation.Validate([]validation.Validation{
15168		{TargetValue: timeout,
15169			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15170				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15171					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15172				}}}}}); err != nil {
15173		return result, validation.NewError("servicefabric.BaseClient", "RecoverSystemPartitions", err.Error())
15174	}
15175
15176	req, err := client.RecoverSystemPartitionsPreparer(ctx, timeout)
15177	if err != nil {
15178		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", nil, "Failure preparing request")
15179		return
15180	}
15181
15182	resp, err := client.RecoverSystemPartitionsSender(req)
15183	if err != nil {
15184		result.Response = resp
15185		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", resp, "Failure sending request")
15186		return
15187	}
15188
15189	result, err = client.RecoverSystemPartitionsResponder(resp)
15190	if err != nil {
15191		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", resp, "Failure responding to request")
15192		return
15193	}
15194
15195	return
15196}
15197
15198// RecoverSystemPartitionsPreparer prepares the RecoverSystemPartitions request.
15199func (client BaseClient) RecoverSystemPartitionsPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
15200	const APIVersion = "6.0"
15201	queryParameters := map[string]interface{}{
15202		"api-version": APIVersion,
15203	}
15204	if timeout != nil {
15205		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15206	} else {
15207		queryParameters["timeout"] = autorest.Encode("query", 60)
15208	}
15209
15210	preparer := autorest.CreatePreparer(
15211		autorest.AsPost(),
15212		autorest.WithBaseURL(client.BaseURI),
15213		autorest.WithPath("/$/RecoverSystemPartitions"),
15214		autorest.WithQueryParameters(queryParameters))
15215	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15216}
15217
15218// RecoverSystemPartitionsSender sends the RecoverSystemPartitions request. The method will close the
15219// http.Response Body if it receives an error.
15220func (client BaseClient) RecoverSystemPartitionsSender(req *http.Request) (*http.Response, error) {
15221	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15222}
15223
15224// RecoverSystemPartitionsResponder handles the response to the RecoverSystemPartitions request. The method always
15225// closes the http.Response Body.
15226func (client BaseClient) RecoverSystemPartitionsResponder(resp *http.Response) (result autorest.Response, err error) {
15227	err = autorest.Respond(
15228		resp,
15229		azure.WithErrorUnlessStatusCode(http.StatusOK),
15230		autorest.ByClosing())
15231	result.Response = resp
15232	return
15233}
15234
15235// RemoveComposeDeployment deletes an existing Service Fabric compose deployment.
15236// Parameters:
15237// deploymentName - the identity of the deployment.
15238// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15239// duration that the client is willing to wait for the requested operation to complete. The default value for
15240// this parameter is 60 seconds.
15241func (client BaseClient) RemoveComposeDeployment(ctx context.Context, deploymentName string, timeout *int64) (result autorest.Response, err error) {
15242	if tracing.IsEnabled() {
15243		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveComposeDeployment")
15244		defer func() {
15245			sc := -1
15246			if result.Response != nil {
15247				sc = result.Response.StatusCode
15248			}
15249			tracing.EndSpan(ctx, sc, err)
15250		}()
15251	}
15252	if err := validation.Validate([]validation.Validation{
15253		{TargetValue: timeout,
15254			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15255				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15256					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15257				}}}}}); err != nil {
15258		return result, validation.NewError("servicefabric.BaseClient", "RemoveComposeDeployment", err.Error())
15259	}
15260
15261	req, err := client.RemoveComposeDeploymentPreparer(ctx, deploymentName, timeout)
15262	if err != nil {
15263		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", nil, "Failure preparing request")
15264		return
15265	}
15266
15267	resp, err := client.RemoveComposeDeploymentSender(req)
15268	if err != nil {
15269		result.Response = resp
15270		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", resp, "Failure sending request")
15271		return
15272	}
15273
15274	result, err = client.RemoveComposeDeploymentResponder(resp)
15275	if err != nil {
15276		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", resp, "Failure responding to request")
15277		return
15278	}
15279
15280	return
15281}
15282
15283// RemoveComposeDeploymentPreparer prepares the RemoveComposeDeployment request.
15284func (client BaseClient) RemoveComposeDeploymentPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) {
15285	pathParameters := map[string]interface{}{
15286		"deploymentName": deploymentName,
15287	}
15288
15289	const APIVersion = "6.0-preview"
15290	queryParameters := map[string]interface{}{
15291		"api-version": APIVersion,
15292	}
15293	if timeout != nil {
15294		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15295	} else {
15296		queryParameters["timeout"] = autorest.Encode("query", 60)
15297	}
15298
15299	preparer := autorest.CreatePreparer(
15300		autorest.AsPost(),
15301		autorest.WithBaseURL(client.BaseURI),
15302		autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/Delete", pathParameters),
15303		autorest.WithQueryParameters(queryParameters))
15304	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15305}
15306
15307// RemoveComposeDeploymentSender sends the RemoveComposeDeployment request. The method will close the
15308// http.Response Body if it receives an error.
15309func (client BaseClient) RemoveComposeDeploymentSender(req *http.Request) (*http.Response, error) {
15310	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15311}
15312
15313// RemoveComposeDeploymentResponder handles the response to the RemoveComposeDeployment request. The method always
15314// closes the http.Response Body.
15315func (client BaseClient) RemoveComposeDeploymentResponder(resp *http.Response) (result autorest.Response, err error) {
15316	err = autorest.Respond(
15317		resp,
15318		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
15319		autorest.ByClosing())
15320	result.Response = resp
15321	return
15322}
15323
15324// RemoveNodeState notifies Service Fabric that the persisted state on a node has been permanently removed or lost.
15325// This implies that it is not possible to recover the persisted state of that node. This generally happens if a hard
15326// disk has been wiped clean, or if a hard disk crashes. The node has to be down for this operation to be successful.
15327// This operation lets Service Fabric know that the replicas on that node no longer exist, and that Service Fabric
15328// should stop waiting for those replicas to come back up. Do not run this cmdlet if the state on the node has not been
15329// removed and the node can comes back up with its state intact.
15330// Parameters:
15331// nodeName - the name of the node.
15332// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15333// duration that the client is willing to wait for the requested operation to complete. The default value for
15334// this parameter is 60 seconds.
15335func (client BaseClient) RemoveNodeState(ctx context.Context, nodeName string, timeout *int64) (result autorest.Response, err error) {
15336	if tracing.IsEnabled() {
15337		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveNodeState")
15338		defer func() {
15339			sc := -1
15340			if result.Response != nil {
15341				sc = result.Response.StatusCode
15342			}
15343			tracing.EndSpan(ctx, sc, err)
15344		}()
15345	}
15346	if err := validation.Validate([]validation.Validation{
15347		{TargetValue: timeout,
15348			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15349				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15350					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15351				}}}}}); err != nil {
15352		return result, validation.NewError("servicefabric.BaseClient", "RemoveNodeState", err.Error())
15353	}
15354
15355	req, err := client.RemoveNodeStatePreparer(ctx, nodeName, timeout)
15356	if err != nil {
15357		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", nil, "Failure preparing request")
15358		return
15359	}
15360
15361	resp, err := client.RemoveNodeStateSender(req)
15362	if err != nil {
15363		result.Response = resp
15364		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", resp, "Failure sending request")
15365		return
15366	}
15367
15368	result, err = client.RemoveNodeStateResponder(resp)
15369	if err != nil {
15370		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", resp, "Failure responding to request")
15371		return
15372	}
15373
15374	return
15375}
15376
15377// RemoveNodeStatePreparer prepares the RemoveNodeState request.
15378func (client BaseClient) RemoveNodeStatePreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) {
15379	pathParameters := map[string]interface{}{
15380		"nodeName": autorest.Encode("path", nodeName),
15381	}
15382
15383	const APIVersion = "6.0"
15384	queryParameters := map[string]interface{}{
15385		"api-version": APIVersion,
15386	}
15387	if timeout != nil {
15388		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15389	} else {
15390		queryParameters["timeout"] = autorest.Encode("query", 60)
15391	}
15392
15393	preparer := autorest.CreatePreparer(
15394		autorest.AsPost(),
15395		autorest.WithBaseURL(client.BaseURI),
15396		autorest.WithPathParameters("/Nodes/{nodeName}/$/RemoveNodeState", pathParameters),
15397		autorest.WithQueryParameters(queryParameters))
15398	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15399}
15400
15401// RemoveNodeStateSender sends the RemoveNodeState request. The method will close the
15402// http.Response Body if it receives an error.
15403func (client BaseClient) RemoveNodeStateSender(req *http.Request) (*http.Response, error) {
15404	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15405}
15406
15407// RemoveNodeStateResponder handles the response to the RemoveNodeState request. The method always
15408// closes the http.Response Body.
15409func (client BaseClient) RemoveNodeStateResponder(resp *http.Response) (result autorest.Response, err error) {
15410	err = autorest.Respond(
15411		resp,
15412		azure.WithErrorUnlessStatusCode(http.StatusOK),
15413		autorest.ByClosing())
15414	result.Response = resp
15415	return
15416}
15417
15418// RemoveReplica this API simulates a Service Fabric replica failure by removing a replica from a Service Fabric
15419// cluster. The removal closes the replica, transitions the replica to the role None, and then removes all of the state
15420// information of the replica from the cluster. This API tests the replica state removal path, and simulates the report
15421// fault permanent path through client APIs. Warning - There are no safety checks performed when this API is used.
15422// Incorrect use of this API can lead to data loss for stateful services.In addition, the forceRemove flag impacts all
15423// other replicas hosted in the same process.
15424// Parameters:
15425// nodeName - the name of the node.
15426// partitionID - the identity of the partition.
15427// replicaID - the identifier of the replica.
15428// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful
15429// shutdown sequence. This parameter can be used to forcefully delete an application or service for which
15430// delete is timing out due to issues in the service code that prevents graceful close of replicas.
15431// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15432// duration that the client is willing to wait for the requested operation to complete. The default value for
15433// this parameter is 60 seconds.
15434func (client BaseClient) RemoveReplica(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) {
15435	if tracing.IsEnabled() {
15436		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveReplica")
15437		defer func() {
15438			sc := -1
15439			if result.Response != nil {
15440				sc = result.Response.StatusCode
15441			}
15442			tracing.EndSpan(ctx, sc, err)
15443		}()
15444	}
15445	if err := validation.Validate([]validation.Validation{
15446		{TargetValue: timeout,
15447			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15448				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15449					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15450				}}}}}); err != nil {
15451		return result, validation.NewError("servicefabric.BaseClient", "RemoveReplica", err.Error())
15452	}
15453
15454	req, err := client.RemoveReplicaPreparer(ctx, nodeName, partitionID, replicaID, forceRemove, timeout)
15455	if err != nil {
15456		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", nil, "Failure preparing request")
15457		return
15458	}
15459
15460	resp, err := client.RemoveReplicaSender(req)
15461	if err != nil {
15462		result.Response = resp
15463		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", resp, "Failure sending request")
15464		return
15465	}
15466
15467	result, err = client.RemoveReplicaResponder(resp)
15468	if err != nil {
15469		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", resp, "Failure responding to request")
15470		return
15471	}
15472
15473	return
15474}
15475
15476// RemoveReplicaPreparer prepares the RemoveReplica request.
15477func (client BaseClient) RemoveReplicaPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, forceRemove *bool, timeout *int64) (*http.Request, error) {
15478	pathParameters := map[string]interface{}{
15479		"nodeName":    autorest.Encode("path", nodeName),
15480		"partitionId": partitionID,
15481		"replicaId":   replicaID,
15482	}
15483
15484	const APIVersion = "6.0"
15485	queryParameters := map[string]interface{}{
15486		"api-version": APIVersion,
15487	}
15488	if forceRemove != nil {
15489		queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove)
15490	}
15491	if timeout != nil {
15492		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15493	} else {
15494		queryParameters["timeout"] = autorest.Encode("query", 60)
15495	}
15496
15497	preparer := autorest.CreatePreparer(
15498		autorest.AsPost(),
15499		autorest.WithBaseURL(client.BaseURI),
15500		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Delete", pathParameters),
15501		autorest.WithQueryParameters(queryParameters))
15502	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15503}
15504
15505// RemoveReplicaSender sends the RemoveReplica request. The method will close the
15506// http.Response Body if it receives an error.
15507func (client BaseClient) RemoveReplicaSender(req *http.Request) (*http.Response, error) {
15508	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15509}
15510
15511// RemoveReplicaResponder handles the response to the RemoveReplica request. The method always
15512// closes the http.Response Body.
15513func (client BaseClient) RemoveReplicaResponder(resp *http.Response) (result autorest.Response, err error) {
15514	err = autorest.Respond(
15515		resp,
15516		azure.WithErrorUnlessStatusCode(http.StatusOK),
15517		autorest.ByClosing())
15518	result.Response = resp
15519	return
15520}
15521
15522// ReportApplicationHealth reports health state of the specified Service Fabric application. The report must contain
15523// the information about the source of the health report and property on which it is reported.
15524// The report is sent to a Service Fabric gateway Application, which forwards to the health store.
15525// The report may be accepted by the gateway, but rejected by the health store after extra validation.
15526// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
15527// To see whether the report was applied in the health store, get application health and check that the report appears
15528// in the HealthEvents section.
15529// Parameters:
15530// applicationID - the identity of the application. This is typically the full name of the application without
15531// the 'fabric:' URI scheme.
15532// Starting from version 6.0, hierarchical names are delimited with the "~" character.
15533// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
15534// in 6.0+ and "myapp/app1" in previous versions.
15535// healthInformation - describes the health information for the health report. This information needs to be
15536// present in all of the health reports sent to the health manager.
15537// immediate - a flag which indicates whether the report should be sent immediately.
15538// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
15539// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
15540// regardless of the fabric client settings that the HTTP Gateway Application is using.
15541// This is useful for critical reports that should be sent as soon as possible.
15542// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
15543// is closed or the message doesn't reach the Gateway.
15544// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
15545// Therefore, it will be batched according to the HealthReportSendInterval configuration.
15546// This is the recommended setting because it allows the health client to optimize health reporting messages to
15547// health store as well as health report processing.
15548// By default, reports are not sent immediately.
15549// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15550// duration that the client is willing to wait for the requested operation to complete. The default value for
15551// this parameter is 60 seconds.
15552func (client BaseClient) ReportApplicationHealth(ctx context.Context, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
15553	if tracing.IsEnabled() {
15554		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportApplicationHealth")
15555		defer func() {
15556			sc := -1
15557			if result.Response != nil {
15558				sc = result.Response.StatusCode
15559			}
15560			tracing.EndSpan(ctx, sc, err)
15561		}()
15562	}
15563	if err := validation.Validate([]validation.Validation{
15564		{TargetValue: healthInformation,
15565			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
15566				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
15567		{TargetValue: timeout,
15568			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15569				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15570					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15571				}}}}}); err != nil {
15572		return result, validation.NewError("servicefabric.BaseClient", "ReportApplicationHealth", err.Error())
15573	}
15574
15575	req, err := client.ReportApplicationHealthPreparer(ctx, applicationID, healthInformation, immediate, timeout)
15576	if err != nil {
15577		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", nil, "Failure preparing request")
15578		return
15579	}
15580
15581	resp, err := client.ReportApplicationHealthSender(req)
15582	if err != nil {
15583		result.Response = resp
15584		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", resp, "Failure sending request")
15585		return
15586	}
15587
15588	result, err = client.ReportApplicationHealthResponder(resp)
15589	if err != nil {
15590		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", resp, "Failure responding to request")
15591		return
15592	}
15593
15594	return
15595}
15596
15597// ReportApplicationHealthPreparer prepares the ReportApplicationHealth request.
15598func (client BaseClient) ReportApplicationHealthPreparer(ctx context.Context, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
15599	pathParameters := map[string]interface{}{
15600		"applicationId": applicationID,
15601	}
15602
15603	const APIVersion = "6.0"
15604	queryParameters := map[string]interface{}{
15605		"api-version": APIVersion,
15606	}
15607	if immediate != nil {
15608		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
15609	} else {
15610		queryParameters["Immediate"] = autorest.Encode("query", false)
15611	}
15612	if timeout != nil {
15613		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15614	} else {
15615		queryParameters["timeout"] = autorest.Encode("query", 60)
15616	}
15617
15618	preparer := autorest.CreatePreparer(
15619		autorest.AsContentType("application/json; charset=utf-8"),
15620		autorest.AsPost(),
15621		autorest.WithBaseURL(client.BaseURI),
15622		autorest.WithPathParameters("/Applications/{applicationId}/$/ReportHealth", pathParameters),
15623		autorest.WithJSON(healthInformation),
15624		autorest.WithQueryParameters(queryParameters))
15625	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15626}
15627
15628// ReportApplicationHealthSender sends the ReportApplicationHealth request. The method will close the
15629// http.Response Body if it receives an error.
15630func (client BaseClient) ReportApplicationHealthSender(req *http.Request) (*http.Response, error) {
15631	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15632}
15633
15634// ReportApplicationHealthResponder handles the response to the ReportApplicationHealth request. The method always
15635// closes the http.Response Body.
15636func (client BaseClient) ReportApplicationHealthResponder(resp *http.Response) (result autorest.Response, err error) {
15637	err = autorest.Respond(
15638		resp,
15639		azure.WithErrorUnlessStatusCode(http.StatusOK),
15640		autorest.ByClosing())
15641	result.Response = resp
15642	return
15643}
15644
15645// ReportClusterHealth sends a health report on a Service Fabric cluster. The report must contain the information about
15646// the source of the health report and property on which it is reported.
15647// The report is sent to a Service Fabric gateway node, which forwards to the health store.
15648// The report may be accepted by the gateway, but rejected by the health store after extra validation.
15649// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
15650// To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in
15651// the HealthEvents section.
15652// Parameters:
15653// healthInformation - describes the health information for the health report. This information needs to be
15654// present in all of the health reports sent to the health manager.
15655// immediate - a flag which indicates whether the report should be sent immediately.
15656// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
15657// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
15658// regardless of the fabric client settings that the HTTP Gateway Application is using.
15659// This is useful for critical reports that should be sent as soon as possible.
15660// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
15661// is closed or the message doesn't reach the Gateway.
15662// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
15663// Therefore, it will be batched according to the HealthReportSendInterval configuration.
15664// This is the recommended setting because it allows the health client to optimize health reporting messages to
15665// health store as well as health report processing.
15666// By default, reports are not sent immediately.
15667// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15668// duration that the client is willing to wait for the requested operation to complete. The default value for
15669// this parameter is 60 seconds.
15670func (client BaseClient) ReportClusterHealth(ctx context.Context, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
15671	if tracing.IsEnabled() {
15672		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportClusterHealth")
15673		defer func() {
15674			sc := -1
15675			if result.Response != nil {
15676				sc = result.Response.StatusCode
15677			}
15678			tracing.EndSpan(ctx, sc, err)
15679		}()
15680	}
15681	if err := validation.Validate([]validation.Validation{
15682		{TargetValue: healthInformation,
15683			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
15684				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
15685		{TargetValue: timeout,
15686			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15687				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15688					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15689				}}}}}); err != nil {
15690		return result, validation.NewError("servicefabric.BaseClient", "ReportClusterHealth", err.Error())
15691	}
15692
15693	req, err := client.ReportClusterHealthPreparer(ctx, healthInformation, immediate, timeout)
15694	if err != nil {
15695		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", nil, "Failure preparing request")
15696		return
15697	}
15698
15699	resp, err := client.ReportClusterHealthSender(req)
15700	if err != nil {
15701		result.Response = resp
15702		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", resp, "Failure sending request")
15703		return
15704	}
15705
15706	result, err = client.ReportClusterHealthResponder(resp)
15707	if err != nil {
15708		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", resp, "Failure responding to request")
15709		return
15710	}
15711
15712	return
15713}
15714
15715// ReportClusterHealthPreparer prepares the ReportClusterHealth request.
15716func (client BaseClient) ReportClusterHealthPreparer(ctx context.Context, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
15717	const APIVersion = "6.0"
15718	queryParameters := map[string]interface{}{
15719		"api-version": APIVersion,
15720	}
15721	if immediate != nil {
15722		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
15723	} else {
15724		queryParameters["Immediate"] = autorest.Encode("query", false)
15725	}
15726	if timeout != nil {
15727		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15728	} else {
15729		queryParameters["timeout"] = autorest.Encode("query", 60)
15730	}
15731
15732	preparer := autorest.CreatePreparer(
15733		autorest.AsContentType("application/json; charset=utf-8"),
15734		autorest.AsPost(),
15735		autorest.WithBaseURL(client.BaseURI),
15736		autorest.WithPath("/$/ReportClusterHealth"),
15737		autorest.WithJSON(healthInformation),
15738		autorest.WithQueryParameters(queryParameters))
15739	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15740}
15741
15742// ReportClusterHealthSender sends the ReportClusterHealth request. The method will close the
15743// http.Response Body if it receives an error.
15744func (client BaseClient) ReportClusterHealthSender(req *http.Request) (*http.Response, error) {
15745	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15746}
15747
15748// ReportClusterHealthResponder handles the response to the ReportClusterHealth request. The method always
15749// closes the http.Response Body.
15750func (client BaseClient) ReportClusterHealthResponder(resp *http.Response) (result autorest.Response, err error) {
15751	err = autorest.Respond(
15752		resp,
15753		azure.WithErrorUnlessStatusCode(http.StatusOK),
15754		autorest.ByClosing())
15755	result.Response = resp
15756	return
15757}
15758
15759// ReportDeployedApplicationHealth reports health state of the application deployed on a Service Fabric node. The
15760// report must contain the information about the source of the health report and property on which it is reported.
15761// The report is sent to a Service Fabric gateway Service, which forwards to the health store.
15762// The report may be accepted by the gateway, but rejected by the health store after extra validation.
15763// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
15764// To see whether the report was applied in the health store, get deployed application health and check that the report
15765// appears in the HealthEvents section.
15766// Parameters:
15767// nodeName - the name of the node.
15768// applicationID - the identity of the application. This is typically the full name of the application without
15769// the 'fabric:' URI scheme.
15770// Starting from version 6.0, hierarchical names are delimited with the "~" character.
15771// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
15772// in 6.0+ and "myapp/app1" in previous versions.
15773// healthInformation - describes the health information for the health report. This information needs to be
15774// present in all of the health reports sent to the health manager.
15775// immediate - a flag which indicates whether the report should be sent immediately.
15776// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
15777// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
15778// regardless of the fabric client settings that the HTTP Gateway Application is using.
15779// This is useful for critical reports that should be sent as soon as possible.
15780// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
15781// is closed or the message doesn't reach the Gateway.
15782// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
15783// Therefore, it will be batched according to the HealthReportSendInterval configuration.
15784// This is the recommended setting because it allows the health client to optimize health reporting messages to
15785// health store as well as health report processing.
15786// By default, reports are not sent immediately.
15787// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15788// duration that the client is willing to wait for the requested operation to complete. The default value for
15789// this parameter is 60 seconds.
15790func (client BaseClient) ReportDeployedApplicationHealth(ctx context.Context, nodeName string, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
15791	if tracing.IsEnabled() {
15792		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportDeployedApplicationHealth")
15793		defer func() {
15794			sc := -1
15795			if result.Response != nil {
15796				sc = result.Response.StatusCode
15797			}
15798			tracing.EndSpan(ctx, sc, err)
15799		}()
15800	}
15801	if err := validation.Validate([]validation.Validation{
15802		{TargetValue: healthInformation,
15803			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
15804				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
15805		{TargetValue: timeout,
15806			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15807				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15808					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15809				}}}}}); err != nil {
15810		return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedApplicationHealth", err.Error())
15811	}
15812
15813	req, err := client.ReportDeployedApplicationHealthPreparer(ctx, nodeName, applicationID, healthInformation, immediate, timeout)
15814	if err != nil {
15815		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", nil, "Failure preparing request")
15816		return
15817	}
15818
15819	resp, err := client.ReportDeployedApplicationHealthSender(req)
15820	if err != nil {
15821		result.Response = resp
15822		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", resp, "Failure sending request")
15823		return
15824	}
15825
15826	result, err = client.ReportDeployedApplicationHealthResponder(resp)
15827	if err != nil {
15828		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", resp, "Failure responding to request")
15829		return
15830	}
15831
15832	return
15833}
15834
15835// ReportDeployedApplicationHealthPreparer prepares the ReportDeployedApplicationHealth request.
15836func (client BaseClient) ReportDeployedApplicationHealthPreparer(ctx context.Context, nodeName string, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
15837	pathParameters := map[string]interface{}{
15838		"applicationId": applicationID,
15839		"nodeName":      autorest.Encode("path", nodeName),
15840	}
15841
15842	const APIVersion = "6.0"
15843	queryParameters := map[string]interface{}{
15844		"api-version": APIVersion,
15845	}
15846	if immediate != nil {
15847		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
15848	} else {
15849		queryParameters["Immediate"] = autorest.Encode("query", false)
15850	}
15851	if timeout != nil {
15852		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15853	} else {
15854		queryParameters["timeout"] = autorest.Encode("query", 60)
15855	}
15856
15857	preparer := autorest.CreatePreparer(
15858		autorest.AsContentType("application/json; charset=utf-8"),
15859		autorest.AsPost(),
15860		autorest.WithBaseURL(client.BaseURI),
15861		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/ReportHealth", pathParameters),
15862		autorest.WithJSON(healthInformation),
15863		autorest.WithQueryParameters(queryParameters))
15864	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15865}
15866
15867// ReportDeployedApplicationHealthSender sends the ReportDeployedApplicationHealth request. The method will close the
15868// http.Response Body if it receives an error.
15869func (client BaseClient) ReportDeployedApplicationHealthSender(req *http.Request) (*http.Response, error) {
15870	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15871}
15872
15873// ReportDeployedApplicationHealthResponder handles the response to the ReportDeployedApplicationHealth request. The method always
15874// closes the http.Response Body.
15875func (client BaseClient) ReportDeployedApplicationHealthResponder(resp *http.Response) (result autorest.Response, err error) {
15876	err = autorest.Respond(
15877		resp,
15878		azure.WithErrorUnlessStatusCode(http.StatusOK),
15879		autorest.ByClosing())
15880	result.Response = resp
15881	return
15882}
15883
15884// ReportDeployedServicePackageHealth reports health state of the service package of the application deployed on a
15885// Service Fabric node. The report must contain the information about the source of the health report and property on
15886// which it is reported.
15887// The report is sent to a Service Fabric gateway Service, which forwards to the health store.
15888// The report may be accepted by the gateway, but rejected by the health store after extra validation.
15889// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
15890// To see whether the report was applied in the health store, get deployed service package health and check that the
15891// report appears in the HealthEvents section.
15892// Parameters:
15893// nodeName - the name of the node.
15894// applicationID - the identity of the application. This is typically the full name of the application without
15895// the 'fabric:' URI scheme.
15896// Starting from version 6.0, hierarchical names are delimited with the "~" character.
15897// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
15898// in 6.0+ and "myapp/app1" in previous versions.
15899// servicePackageName - the name of the service package.
15900// healthInformation - describes the health information for the health report. This information needs to be
15901// present in all of the health reports sent to the health manager.
15902// immediate - a flag which indicates whether the report should be sent immediately.
15903// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
15904// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
15905// regardless of the fabric client settings that the HTTP Gateway Application is using.
15906// This is useful for critical reports that should be sent as soon as possible.
15907// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
15908// is closed or the message doesn't reach the Gateway.
15909// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
15910// Therefore, it will be batched according to the HealthReportSendInterval configuration.
15911// This is the recommended setting because it allows the health client to optimize health reporting messages to
15912// health store as well as health report processing.
15913// By default, reports are not sent immediately.
15914// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15915// duration that the client is willing to wait for the requested operation to complete. The default value for
15916// this parameter is 60 seconds.
15917func (client BaseClient) ReportDeployedServicePackageHealth(ctx context.Context, nodeName string, applicationID string, servicePackageName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
15918	if tracing.IsEnabled() {
15919		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportDeployedServicePackageHealth")
15920		defer func() {
15921			sc := -1
15922			if result.Response != nil {
15923				sc = result.Response.StatusCode
15924			}
15925			tracing.EndSpan(ctx, sc, err)
15926		}()
15927	}
15928	if err := validation.Validate([]validation.Validation{
15929		{TargetValue: healthInformation,
15930			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
15931				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
15932		{TargetValue: timeout,
15933			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15934				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15935					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15936				}}}}}); err != nil {
15937		return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedServicePackageHealth", err.Error())
15938	}
15939
15940	req, err := client.ReportDeployedServicePackageHealthPreparer(ctx, nodeName, applicationID, servicePackageName, healthInformation, immediate, timeout)
15941	if err != nil {
15942		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", nil, "Failure preparing request")
15943		return
15944	}
15945
15946	resp, err := client.ReportDeployedServicePackageHealthSender(req)
15947	if err != nil {
15948		result.Response = resp
15949		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", resp, "Failure sending request")
15950		return
15951	}
15952
15953	result, err = client.ReportDeployedServicePackageHealthResponder(resp)
15954	if err != nil {
15955		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", resp, "Failure responding to request")
15956		return
15957	}
15958
15959	return
15960}
15961
15962// ReportDeployedServicePackageHealthPreparer prepares the ReportDeployedServicePackageHealth request.
15963func (client BaseClient) ReportDeployedServicePackageHealthPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
15964	pathParameters := map[string]interface{}{
15965		"applicationId":      applicationID,
15966		"nodeName":           autorest.Encode("path", nodeName),
15967		"servicePackageName": servicePackageName,
15968	}
15969
15970	const APIVersion = "6.0"
15971	queryParameters := map[string]interface{}{
15972		"api-version": APIVersion,
15973	}
15974	if immediate != nil {
15975		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
15976	} else {
15977		queryParameters["Immediate"] = autorest.Encode("query", false)
15978	}
15979	if timeout != nil {
15980		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15981	} else {
15982		queryParameters["timeout"] = autorest.Encode("query", 60)
15983	}
15984
15985	preparer := autorest.CreatePreparer(
15986		autorest.AsContentType("application/json; charset=utf-8"),
15987		autorest.AsPost(),
15988		autorest.WithBaseURL(client.BaseURI),
15989		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/ReportHealth", pathParameters),
15990		autorest.WithJSON(healthInformation),
15991		autorest.WithQueryParameters(queryParameters))
15992	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15993}
15994
15995// ReportDeployedServicePackageHealthSender sends the ReportDeployedServicePackageHealth request. The method will close the
15996// http.Response Body if it receives an error.
15997func (client BaseClient) ReportDeployedServicePackageHealthSender(req *http.Request) (*http.Response, error) {
15998	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15999}
16000
16001// ReportDeployedServicePackageHealthResponder handles the response to the ReportDeployedServicePackageHealth request. The method always
16002// closes the http.Response Body.
16003func (client BaseClient) ReportDeployedServicePackageHealthResponder(resp *http.Response) (result autorest.Response, err error) {
16004	err = autorest.Respond(
16005		resp,
16006		azure.WithErrorUnlessStatusCode(http.StatusOK),
16007		autorest.ByClosing())
16008	result.Response = resp
16009	return
16010}
16011
16012// ReportNodeHealth reports health state of the specified Service Fabric node. The report must contain the information
16013// about the source of the health report and property on which it is reported.
16014// The report is sent to a Service Fabric gateway node, which forwards to the health store.
16015// The report may be accepted by the gateway, but rejected by the health store after extra validation.
16016// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
16017// To see whether the report was applied in the health store, run GetNodeHealth and check that the report appears in
16018// the HealthEvents section.
16019// Parameters:
16020// nodeName - the name of the node.
16021// healthInformation - describes the health information for the health report. This information needs to be
16022// present in all of the health reports sent to the health manager.
16023// immediate - a flag which indicates whether the report should be sent immediately.
16024// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
16025// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
16026// regardless of the fabric client settings that the HTTP Gateway Application is using.
16027// This is useful for critical reports that should be sent as soon as possible.
16028// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
16029// is closed or the message doesn't reach the Gateway.
16030// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
16031// Therefore, it will be batched according to the HealthReportSendInterval configuration.
16032// This is the recommended setting because it allows the health client to optimize health reporting messages to
16033// health store as well as health report processing.
16034// By default, reports are not sent immediately.
16035// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16036// duration that the client is willing to wait for the requested operation to complete. The default value for
16037// this parameter is 60 seconds.
16038func (client BaseClient) ReportNodeHealth(ctx context.Context, nodeName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
16039	if tracing.IsEnabled() {
16040		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportNodeHealth")
16041		defer func() {
16042			sc := -1
16043			if result.Response != nil {
16044				sc = result.Response.StatusCode
16045			}
16046			tracing.EndSpan(ctx, sc, err)
16047		}()
16048	}
16049	if err := validation.Validate([]validation.Validation{
16050		{TargetValue: healthInformation,
16051			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
16052				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
16053		{TargetValue: timeout,
16054			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16055				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16056					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16057				}}}}}); err != nil {
16058		return result, validation.NewError("servicefabric.BaseClient", "ReportNodeHealth", err.Error())
16059	}
16060
16061	req, err := client.ReportNodeHealthPreparer(ctx, nodeName, healthInformation, immediate, timeout)
16062	if err != nil {
16063		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", nil, "Failure preparing request")
16064		return
16065	}
16066
16067	resp, err := client.ReportNodeHealthSender(req)
16068	if err != nil {
16069		result.Response = resp
16070		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", resp, "Failure sending request")
16071		return
16072	}
16073
16074	result, err = client.ReportNodeHealthResponder(resp)
16075	if err != nil {
16076		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", resp, "Failure responding to request")
16077		return
16078	}
16079
16080	return
16081}
16082
16083// ReportNodeHealthPreparer prepares the ReportNodeHealth request.
16084func (client BaseClient) ReportNodeHealthPreparer(ctx context.Context, nodeName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
16085	pathParameters := map[string]interface{}{
16086		"nodeName": autorest.Encode("path", nodeName),
16087	}
16088
16089	const APIVersion = "6.0"
16090	queryParameters := map[string]interface{}{
16091		"api-version": APIVersion,
16092	}
16093	if immediate != nil {
16094		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
16095	} else {
16096		queryParameters["Immediate"] = autorest.Encode("query", false)
16097	}
16098	if timeout != nil {
16099		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16100	} else {
16101		queryParameters["timeout"] = autorest.Encode("query", 60)
16102	}
16103
16104	preparer := autorest.CreatePreparer(
16105		autorest.AsContentType("application/json; charset=utf-8"),
16106		autorest.AsPost(),
16107		autorest.WithBaseURL(client.BaseURI),
16108		autorest.WithPathParameters("/Nodes/{nodeName}/$/ReportHealth", pathParameters),
16109		autorest.WithJSON(healthInformation),
16110		autorest.WithQueryParameters(queryParameters))
16111	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16112}
16113
16114// ReportNodeHealthSender sends the ReportNodeHealth request. The method will close the
16115// http.Response Body if it receives an error.
16116func (client BaseClient) ReportNodeHealthSender(req *http.Request) (*http.Response, error) {
16117	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16118}
16119
16120// ReportNodeHealthResponder handles the response to the ReportNodeHealth request. The method always
16121// closes the http.Response Body.
16122func (client BaseClient) ReportNodeHealthResponder(resp *http.Response) (result autorest.Response, err error) {
16123	err = autorest.Respond(
16124		resp,
16125		azure.WithErrorUnlessStatusCode(http.StatusOK),
16126		autorest.ByClosing())
16127	result.Response = resp
16128	return
16129}
16130
16131// ReportPartitionHealth reports health state of the specified Service Fabric partition. The report must contain the
16132// information about the source of the health report and property on which it is reported.
16133// The report is sent to a Service Fabric gateway Partition, which forwards to the health store.
16134// The report may be accepted by the gateway, but rejected by the health store after extra validation.
16135// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
16136// To see whether the report was applied in the health store, run GetPartitionHealth and check that the report appears
16137// in the HealthEvents section.
16138// Parameters:
16139// partitionID - the identity of the partition.
16140// healthInformation - describes the health information for the health report. This information needs to be
16141// present in all of the health reports sent to the health manager.
16142// immediate - a flag which indicates whether the report should be sent immediately.
16143// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
16144// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
16145// regardless of the fabric client settings that the HTTP Gateway Application is using.
16146// This is useful for critical reports that should be sent as soon as possible.
16147// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
16148// is closed or the message doesn't reach the Gateway.
16149// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
16150// Therefore, it will be batched according to the HealthReportSendInterval configuration.
16151// This is the recommended setting because it allows the health client to optimize health reporting messages to
16152// health store as well as health report processing.
16153// By default, reports are not sent immediately.
16154// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16155// duration that the client is willing to wait for the requested operation to complete. The default value for
16156// this parameter is 60 seconds.
16157func (client BaseClient) ReportPartitionHealth(ctx context.Context, partitionID uuid.UUID, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
16158	if tracing.IsEnabled() {
16159		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportPartitionHealth")
16160		defer func() {
16161			sc := -1
16162			if result.Response != nil {
16163				sc = result.Response.StatusCode
16164			}
16165			tracing.EndSpan(ctx, sc, err)
16166		}()
16167	}
16168	if err := validation.Validate([]validation.Validation{
16169		{TargetValue: healthInformation,
16170			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
16171				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
16172		{TargetValue: timeout,
16173			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16174				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16175					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16176				}}}}}); err != nil {
16177		return result, validation.NewError("servicefabric.BaseClient", "ReportPartitionHealth", err.Error())
16178	}
16179
16180	req, err := client.ReportPartitionHealthPreparer(ctx, partitionID, healthInformation, immediate, timeout)
16181	if err != nil {
16182		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", nil, "Failure preparing request")
16183		return
16184	}
16185
16186	resp, err := client.ReportPartitionHealthSender(req)
16187	if err != nil {
16188		result.Response = resp
16189		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", resp, "Failure sending request")
16190		return
16191	}
16192
16193	result, err = client.ReportPartitionHealthResponder(resp)
16194	if err != nil {
16195		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", resp, "Failure responding to request")
16196		return
16197	}
16198
16199	return
16200}
16201
16202// ReportPartitionHealthPreparer prepares the ReportPartitionHealth request.
16203func (client BaseClient) ReportPartitionHealthPreparer(ctx context.Context, partitionID uuid.UUID, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
16204	pathParameters := map[string]interface{}{
16205		"partitionId": partitionID,
16206	}
16207
16208	const APIVersion = "6.0"
16209	queryParameters := map[string]interface{}{
16210		"api-version": APIVersion,
16211	}
16212	if immediate != nil {
16213		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
16214	} else {
16215		queryParameters["Immediate"] = autorest.Encode("query", false)
16216	}
16217	if timeout != nil {
16218		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16219	} else {
16220		queryParameters["timeout"] = autorest.Encode("query", 60)
16221	}
16222
16223	preparer := autorest.CreatePreparer(
16224		autorest.AsContentType("application/json; charset=utf-8"),
16225		autorest.AsPost(),
16226		autorest.WithBaseURL(client.BaseURI),
16227		autorest.WithPathParameters("/Partitions/{partitionId}/$/ReportHealth", pathParameters),
16228		autorest.WithJSON(healthInformation),
16229		autorest.WithQueryParameters(queryParameters))
16230	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16231}
16232
16233// ReportPartitionHealthSender sends the ReportPartitionHealth request. The method will close the
16234// http.Response Body if it receives an error.
16235func (client BaseClient) ReportPartitionHealthSender(req *http.Request) (*http.Response, error) {
16236	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16237}
16238
16239// ReportPartitionHealthResponder handles the response to the ReportPartitionHealth request. The method always
16240// closes the http.Response Body.
16241func (client BaseClient) ReportPartitionHealthResponder(resp *http.Response) (result autorest.Response, err error) {
16242	err = autorest.Respond(
16243		resp,
16244		azure.WithErrorUnlessStatusCode(http.StatusOK),
16245		autorest.ByClosing())
16246	result.Response = resp
16247	return
16248}
16249
16250// ReportReplicaHealth reports health state of the specified Service Fabric replica. The report must contain the
16251// information about the source of the health report and property on which it is reported.
16252// The report is sent to a Service Fabric gateway Replica, which forwards to the health store.
16253// The report may be accepted by the gateway, but rejected by the health store after extra validation.
16254// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
16255// To see whether the report was applied in the health store, run GetReplicaHealth and check that the report appears in
16256// the HealthEvents section.
16257// Parameters:
16258// partitionID - the identity of the partition.
16259// replicaID - the identifier of the replica.
16260// replicaHealthReportServiceKind - the kind of service replica (Stateless or Stateful) for which the health is
16261// being reported. Following are the possible values.
16262// healthInformation - describes the health information for the health report. This information needs to be
16263// present in all of the health reports sent to the health manager.
16264// immediate - a flag which indicates whether the report should be sent immediately.
16265// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
16266// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
16267// regardless of the fabric client settings that the HTTP Gateway Application is using.
16268// This is useful for critical reports that should be sent as soon as possible.
16269// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
16270// is closed or the message doesn't reach the Gateway.
16271// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
16272// Therefore, it will be batched according to the HealthReportSendInterval configuration.
16273// This is the recommended setting because it allows the health client to optimize health reporting messages to
16274// health store as well as health report processing.
16275// By default, reports are not sent immediately.
16276// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16277// duration that the client is willing to wait for the requested operation to complete. The default value for
16278// this parameter is 60 seconds.
16279func (client BaseClient) ReportReplicaHealth(ctx context.Context, partitionID uuid.UUID, replicaID string, replicaHealthReportServiceKind ReplicaHealthReportServiceKind, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
16280	if tracing.IsEnabled() {
16281		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportReplicaHealth")
16282		defer func() {
16283			sc := -1
16284			if result.Response != nil {
16285				sc = result.Response.StatusCode
16286			}
16287			tracing.EndSpan(ctx, sc, err)
16288		}()
16289	}
16290	if err := validation.Validate([]validation.Validation{
16291		{TargetValue: healthInformation,
16292			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
16293				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
16294		{TargetValue: timeout,
16295			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16296				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16297					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16298				}}}}}); err != nil {
16299		return result, validation.NewError("servicefabric.BaseClient", "ReportReplicaHealth", err.Error())
16300	}
16301
16302	req, err := client.ReportReplicaHealthPreparer(ctx, partitionID, replicaID, replicaHealthReportServiceKind, healthInformation, immediate, timeout)
16303	if err != nil {
16304		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", nil, "Failure preparing request")
16305		return
16306	}
16307
16308	resp, err := client.ReportReplicaHealthSender(req)
16309	if err != nil {
16310		result.Response = resp
16311		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", resp, "Failure sending request")
16312		return
16313	}
16314
16315	result, err = client.ReportReplicaHealthResponder(resp)
16316	if err != nil {
16317		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", resp, "Failure responding to request")
16318		return
16319	}
16320
16321	return
16322}
16323
16324// ReportReplicaHealthPreparer prepares the ReportReplicaHealth request.
16325func (client BaseClient) ReportReplicaHealthPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, replicaHealthReportServiceKind ReplicaHealthReportServiceKind, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
16326	pathParameters := map[string]interface{}{
16327		"partitionId": partitionID,
16328		"replicaId":   replicaID,
16329	}
16330
16331	const APIVersion = "6.0"
16332	queryParameters := map[string]interface{}{
16333		"api-version":                    APIVersion,
16334		"ReplicaHealthReportServiceKind": autorest.Encode("query", replicaHealthReportServiceKind),
16335	}
16336	if immediate != nil {
16337		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
16338	} else {
16339		queryParameters["Immediate"] = autorest.Encode("query", false)
16340	}
16341	if timeout != nil {
16342		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16343	} else {
16344		queryParameters["timeout"] = autorest.Encode("query", 60)
16345	}
16346
16347	preparer := autorest.CreatePreparer(
16348		autorest.AsContentType("application/json; charset=utf-8"),
16349		autorest.AsPost(),
16350		autorest.WithBaseURL(client.BaseURI),
16351		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/ReportHealth", pathParameters),
16352		autorest.WithJSON(healthInformation),
16353		autorest.WithQueryParameters(queryParameters))
16354	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16355}
16356
16357// ReportReplicaHealthSender sends the ReportReplicaHealth request. The method will close the
16358// http.Response Body if it receives an error.
16359func (client BaseClient) ReportReplicaHealthSender(req *http.Request) (*http.Response, error) {
16360	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16361}
16362
16363// ReportReplicaHealthResponder handles the response to the ReportReplicaHealth request. The method always
16364// closes the http.Response Body.
16365func (client BaseClient) ReportReplicaHealthResponder(resp *http.Response) (result autorest.Response, err error) {
16366	err = autorest.Respond(
16367		resp,
16368		azure.WithErrorUnlessStatusCode(http.StatusOK),
16369		autorest.ByClosing())
16370	result.Response = resp
16371	return
16372}
16373
16374// ReportServiceHealth reports health state of the specified Service Fabric service. The report must contain the
16375// information about the source of the health report and property on which it is reported.
16376// The report is sent to a Service Fabric gateway Service, which forwards to the health store.
16377// The report may be accepted by the gateway, but rejected by the health store after extra validation.
16378// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
16379// To see whether the report was applied in the health store, run GetServiceHealth and check that the report appears in
16380// the HealthEvents section.
16381// Parameters:
16382// serviceID - the identity of the service. This is typically the full name of the service without the
16383// 'fabric:' URI scheme.
16384// Starting from version 6.0, hierarchical names are delimited with the "~" character.
16385// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
16386// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
16387// healthInformation - describes the health information for the health report. This information needs to be
16388// present in all of the health reports sent to the health manager.
16389// immediate - a flag which indicates whether the report should be sent immediately.
16390// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
16391// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
16392// regardless of the fabric client settings that the HTTP Gateway Application is using.
16393// This is useful for critical reports that should be sent as soon as possible.
16394// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
16395// is closed or the message doesn't reach the Gateway.
16396// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
16397// Therefore, it will be batched according to the HealthReportSendInterval configuration.
16398// This is the recommended setting because it allows the health client to optimize health reporting messages to
16399// health store as well as health report processing.
16400// By default, reports are not sent immediately.
16401// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16402// duration that the client is willing to wait for the requested operation to complete. The default value for
16403// this parameter is 60 seconds.
16404func (client BaseClient) ReportServiceHealth(ctx context.Context, serviceID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
16405	if tracing.IsEnabled() {
16406		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportServiceHealth")
16407		defer func() {
16408			sc := -1
16409			if result.Response != nil {
16410				sc = result.Response.StatusCode
16411			}
16412			tracing.EndSpan(ctx, sc, err)
16413		}()
16414	}
16415	if err := validation.Validate([]validation.Validation{
16416		{TargetValue: healthInformation,
16417			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
16418				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
16419		{TargetValue: timeout,
16420			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16421				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16422					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16423				}}}}}); err != nil {
16424		return result, validation.NewError("servicefabric.BaseClient", "ReportServiceHealth", err.Error())
16425	}
16426
16427	req, err := client.ReportServiceHealthPreparer(ctx, serviceID, healthInformation, immediate, timeout)
16428	if err != nil {
16429		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", nil, "Failure preparing request")
16430		return
16431	}
16432
16433	resp, err := client.ReportServiceHealthSender(req)
16434	if err != nil {
16435		result.Response = resp
16436		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", resp, "Failure sending request")
16437		return
16438	}
16439
16440	result, err = client.ReportServiceHealthResponder(resp)
16441	if err != nil {
16442		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", resp, "Failure responding to request")
16443		return
16444	}
16445
16446	return
16447}
16448
16449// ReportServiceHealthPreparer prepares the ReportServiceHealth request.
16450func (client BaseClient) ReportServiceHealthPreparer(ctx context.Context, serviceID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
16451	pathParameters := map[string]interface{}{
16452		"serviceId": serviceID,
16453	}
16454
16455	const APIVersion = "6.0"
16456	queryParameters := map[string]interface{}{
16457		"api-version": APIVersion,
16458	}
16459	if immediate != nil {
16460		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
16461	} else {
16462		queryParameters["Immediate"] = autorest.Encode("query", false)
16463	}
16464	if timeout != nil {
16465		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16466	} else {
16467		queryParameters["timeout"] = autorest.Encode("query", 60)
16468	}
16469
16470	preparer := autorest.CreatePreparer(
16471		autorest.AsContentType("application/json; charset=utf-8"),
16472		autorest.AsPost(),
16473		autorest.WithBaseURL(client.BaseURI),
16474		autorest.WithPathParameters("/Services/{serviceId}/$/ReportHealth", pathParameters),
16475		autorest.WithJSON(healthInformation),
16476		autorest.WithQueryParameters(queryParameters))
16477	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16478}
16479
16480// ReportServiceHealthSender sends the ReportServiceHealth request. The method will close the
16481// http.Response Body if it receives an error.
16482func (client BaseClient) ReportServiceHealthSender(req *http.Request) (*http.Response, error) {
16483	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16484}
16485
16486// ReportServiceHealthResponder handles the response to the ReportServiceHealth request. The method always
16487// closes the http.Response Body.
16488func (client BaseClient) ReportServiceHealthResponder(resp *http.Response) (result autorest.Response, err error) {
16489	err = autorest.Respond(
16490		resp,
16491		azure.WithErrorUnlessStatusCode(http.StatusOK),
16492		autorest.ByClosing())
16493	result.Response = resp
16494	return
16495}
16496
16497// ResetPartitionLoad resets the current load of a Service Fabric partition to the default load for the service.
16498// Parameters:
16499// partitionID - the identity of the partition.
16500// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16501// duration that the client is willing to wait for the requested operation to complete. The default value for
16502// this parameter is 60 seconds.
16503func (client BaseClient) ResetPartitionLoad(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
16504	if tracing.IsEnabled() {
16505		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResetPartitionLoad")
16506		defer func() {
16507			sc := -1
16508			if result.Response != nil {
16509				sc = result.Response.StatusCode
16510			}
16511			tracing.EndSpan(ctx, sc, err)
16512		}()
16513	}
16514	if err := validation.Validate([]validation.Validation{
16515		{TargetValue: timeout,
16516			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16517				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16518					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16519				}}}}}); err != nil {
16520		return result, validation.NewError("servicefabric.BaseClient", "ResetPartitionLoad", err.Error())
16521	}
16522
16523	req, err := client.ResetPartitionLoadPreparer(ctx, partitionID, timeout)
16524	if err != nil {
16525		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", nil, "Failure preparing request")
16526		return
16527	}
16528
16529	resp, err := client.ResetPartitionLoadSender(req)
16530	if err != nil {
16531		result.Response = resp
16532		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", resp, "Failure sending request")
16533		return
16534	}
16535
16536	result, err = client.ResetPartitionLoadResponder(resp)
16537	if err != nil {
16538		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", resp, "Failure responding to request")
16539		return
16540	}
16541
16542	return
16543}
16544
16545// ResetPartitionLoadPreparer prepares the ResetPartitionLoad request.
16546func (client BaseClient) ResetPartitionLoadPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
16547	pathParameters := map[string]interface{}{
16548		"partitionId": partitionID,
16549	}
16550
16551	const APIVersion = "6.0"
16552	queryParameters := map[string]interface{}{
16553		"api-version": APIVersion,
16554	}
16555	if timeout != nil {
16556		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16557	} else {
16558		queryParameters["timeout"] = autorest.Encode("query", 60)
16559	}
16560
16561	preparer := autorest.CreatePreparer(
16562		autorest.AsPost(),
16563		autorest.WithBaseURL(client.BaseURI),
16564		autorest.WithPathParameters("/Partitions/{partitionId}/$/ResetLoad", pathParameters),
16565		autorest.WithQueryParameters(queryParameters))
16566	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16567}
16568
16569// ResetPartitionLoadSender sends the ResetPartitionLoad request. The method will close the
16570// http.Response Body if it receives an error.
16571func (client BaseClient) ResetPartitionLoadSender(req *http.Request) (*http.Response, error) {
16572	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16573}
16574
16575// ResetPartitionLoadResponder handles the response to the ResetPartitionLoad request. The method always
16576// closes the http.Response Body.
16577func (client BaseClient) ResetPartitionLoadResponder(resp *http.Response) (result autorest.Response, err error) {
16578	err = autorest.Respond(
16579		resp,
16580		azure.WithErrorUnlessStatusCode(http.StatusOK),
16581		autorest.ByClosing())
16582	result.Response = resp
16583	return
16584}
16585
16586// ResolveService resolve a Service Fabric service partition to get the endpoints of the service replicas.
16587// Parameters:
16588// serviceID - the identity of the service. This is typically the full name of the service without the
16589// 'fabric:' URI scheme.
16590// Starting from version 6.0, hierarchical names are delimited with the "~" character.
16591// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
16592// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
16593// partitionKeyType - key type for the partition. This parameter is required if the partition scheme for the
16594// service is Int64Range or Named. The possible values are following.
16595// - None (1) - Indicates that the PartitionKeyValue parameter is not specified. This is valid for the
16596// partitions with partitioning scheme as Singleton. This is the default value. The value is 1.
16597// - Int64Range (2) - Indicates that the PartitionKeyValue parameter is an int64 partition key. This is valid
16598// for the partitions with partitioning scheme as Int64Range. The value is 2.
16599// - Named (3) - Indicates that the PartitionKeyValue parameter is a name of the partition. This is valid for
16600// the partitions with partitioning scheme as Named. The value is 3.
16601// partitionKeyValue - partition key. This is required if the partition scheme for the service is Int64Range or
16602// Named.
16603// previousRspVersion - the value in the Version field of the response that was received previously. This is
16604// required if the user knows that the result that was got previously is stale.
16605// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16606// duration that the client is willing to wait for the requested operation to complete. The default value for
16607// this parameter is 60 seconds.
16608func (client BaseClient) ResolveService(ctx context.Context, serviceID string, partitionKeyType *int32, partitionKeyValue string, previousRspVersion string, timeout *int64) (result ResolvedServicePartition, err error) {
16609	if tracing.IsEnabled() {
16610		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResolveService")
16611		defer func() {
16612			sc := -1
16613			if result.Response.Response != nil {
16614				sc = result.Response.Response.StatusCode
16615			}
16616			tracing.EndSpan(ctx, sc, err)
16617		}()
16618	}
16619	if err := validation.Validate([]validation.Validation{
16620		{TargetValue: timeout,
16621			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16622				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16623					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16624				}}}}}); err != nil {
16625		return result, validation.NewError("servicefabric.BaseClient", "ResolveService", err.Error())
16626	}
16627
16628	req, err := client.ResolveServicePreparer(ctx, serviceID, partitionKeyType, partitionKeyValue, previousRspVersion, timeout)
16629	if err != nil {
16630		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", nil, "Failure preparing request")
16631		return
16632	}
16633
16634	resp, err := client.ResolveServiceSender(req)
16635	if err != nil {
16636		result.Response = autorest.Response{Response: resp}
16637		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", resp, "Failure sending request")
16638		return
16639	}
16640
16641	result, err = client.ResolveServiceResponder(resp)
16642	if err != nil {
16643		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", resp, "Failure responding to request")
16644		return
16645	}
16646
16647	return
16648}
16649
16650// ResolveServicePreparer prepares the ResolveService request.
16651func (client BaseClient) ResolveServicePreparer(ctx context.Context, serviceID string, partitionKeyType *int32, partitionKeyValue string, previousRspVersion string, timeout *int64) (*http.Request, error) {
16652	pathParameters := map[string]interface{}{
16653		"serviceId": serviceID,
16654	}
16655
16656	const APIVersion = "6.0"
16657	queryParameters := map[string]interface{}{
16658		"api-version": APIVersion,
16659	}
16660	if partitionKeyType != nil {
16661		queryParameters["PartitionKeyType"] = autorest.Encode("query", *partitionKeyType)
16662	}
16663	if len(partitionKeyValue) > 0 {
16664		queryParameters["PartitionKeyValue"] = partitionKeyValue
16665	}
16666	if len(previousRspVersion) > 0 {
16667		queryParameters["PreviousRspVersion"] = previousRspVersion
16668	}
16669	if timeout != nil {
16670		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16671	} else {
16672		queryParameters["timeout"] = autorest.Encode("query", 60)
16673	}
16674
16675	preparer := autorest.CreatePreparer(
16676		autorest.AsGet(),
16677		autorest.WithBaseURL(client.BaseURI),
16678		autorest.WithPathParameters("/Services/{serviceId}/$/ResolvePartition", pathParameters),
16679		autorest.WithQueryParameters(queryParameters))
16680	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16681}
16682
16683// ResolveServiceSender sends the ResolveService request. The method will close the
16684// http.Response Body if it receives an error.
16685func (client BaseClient) ResolveServiceSender(req *http.Request) (*http.Response, error) {
16686	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16687}
16688
16689// ResolveServiceResponder handles the response to the ResolveService request. The method always
16690// closes the http.Response Body.
16691func (client BaseClient) ResolveServiceResponder(resp *http.Response) (result ResolvedServicePartition, err error) {
16692	err = autorest.Respond(
16693		resp,
16694		azure.WithErrorUnlessStatusCode(http.StatusOK),
16695		autorest.ByUnmarshallingJSON(&result),
16696		autorest.ByClosing())
16697	result.Response = autorest.Response{Response: resp}
16698	return
16699}
16700
16701// RestartDeployedCodePackage restarts a code package deployed on a Service Fabric node in a cluster. This aborts the
16702// code package process, which will restart all the user service replicas hosted in that process.
16703// Parameters:
16704// nodeName - the name of the node.
16705// applicationID - the identity of the application. This is typically the full name of the application without
16706// the 'fabric:' URI scheme.
16707// Starting from version 6.0, hierarchical names are delimited with the "~" character.
16708// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
16709// in 6.0+ and "myapp/app1" in previous versions.
16710// restartDeployedCodePackageDescription - describes the deployed code package on Service Fabric node to
16711// restart.
16712// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16713// duration that the client is willing to wait for the requested operation to complete. The default value for
16714// this parameter is 60 seconds.
16715func (client BaseClient) RestartDeployedCodePackage(ctx context.Context, nodeName string, applicationID string, restartDeployedCodePackageDescription RestartDeployedCodePackageDescription, timeout *int64) (result autorest.Response, err error) {
16716	if tracing.IsEnabled() {
16717		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartDeployedCodePackage")
16718		defer func() {
16719			sc := -1
16720			if result.Response != nil {
16721				sc = result.Response.StatusCode
16722			}
16723			tracing.EndSpan(ctx, sc, err)
16724		}()
16725	}
16726	if err := validation.Validate([]validation.Validation{
16727		{TargetValue: restartDeployedCodePackageDescription,
16728			Constraints: []validation.Constraint{{Target: "restartDeployedCodePackageDescription.ServiceManifestName", Name: validation.Null, Rule: true, Chain: nil},
16729				{Target: "restartDeployedCodePackageDescription.CodePackageName", Name: validation.Null, Rule: true, Chain: nil},
16730				{Target: "restartDeployedCodePackageDescription.CodePackageInstanceID", Name: validation.Null, Rule: true, Chain: nil}}},
16731		{TargetValue: timeout,
16732			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16733				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16734					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16735				}}}}}); err != nil {
16736		return result, validation.NewError("servicefabric.BaseClient", "RestartDeployedCodePackage", err.Error())
16737	}
16738
16739	req, err := client.RestartDeployedCodePackagePreparer(ctx, nodeName, applicationID, restartDeployedCodePackageDescription, timeout)
16740	if err != nil {
16741		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", nil, "Failure preparing request")
16742		return
16743	}
16744
16745	resp, err := client.RestartDeployedCodePackageSender(req)
16746	if err != nil {
16747		result.Response = resp
16748		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", resp, "Failure sending request")
16749		return
16750	}
16751
16752	result, err = client.RestartDeployedCodePackageResponder(resp)
16753	if err != nil {
16754		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", resp, "Failure responding to request")
16755		return
16756	}
16757
16758	return
16759}
16760
16761// RestartDeployedCodePackagePreparer prepares the RestartDeployedCodePackage request.
16762func (client BaseClient) RestartDeployedCodePackagePreparer(ctx context.Context, nodeName string, applicationID string, restartDeployedCodePackageDescription RestartDeployedCodePackageDescription, timeout *int64) (*http.Request, error) {
16763	pathParameters := map[string]interface{}{
16764		"applicationId": applicationID,
16765		"nodeName":      autorest.Encode("path", nodeName),
16766	}
16767
16768	const APIVersion = "6.0"
16769	queryParameters := map[string]interface{}{
16770		"api-version": APIVersion,
16771	}
16772	if timeout != nil {
16773		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16774	} else {
16775		queryParameters["timeout"] = autorest.Encode("query", 60)
16776	}
16777
16778	preparer := autorest.CreatePreparer(
16779		autorest.AsContentType("application/json; charset=utf-8"),
16780		autorest.AsPost(),
16781		autorest.WithBaseURL(client.BaseURI),
16782		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/Restart", pathParameters),
16783		autorest.WithJSON(restartDeployedCodePackageDescription),
16784		autorest.WithQueryParameters(queryParameters))
16785	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16786}
16787
16788// RestartDeployedCodePackageSender sends the RestartDeployedCodePackage request. The method will close the
16789// http.Response Body if it receives an error.
16790func (client BaseClient) RestartDeployedCodePackageSender(req *http.Request) (*http.Response, error) {
16791	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16792}
16793
16794// RestartDeployedCodePackageResponder handles the response to the RestartDeployedCodePackage request. The method always
16795// closes the http.Response Body.
16796func (client BaseClient) RestartDeployedCodePackageResponder(resp *http.Response) (result autorest.Response, err error) {
16797	err = autorest.Respond(
16798		resp,
16799		azure.WithErrorUnlessStatusCode(http.StatusOK),
16800		autorest.ByClosing())
16801	result.Response = resp
16802	return
16803}
16804
16805// RestartNode restarts a Service Fabric cluster node that is already started.
16806// Parameters:
16807// nodeName - the name of the node.
16808// restartNodeDescription - the instance of the node to be restarted and a flag indicating the need to take
16809// dump of the fabric process.
16810// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16811// duration that the client is willing to wait for the requested operation to complete. The default value for
16812// this parameter is 60 seconds.
16813func (client BaseClient) RestartNode(ctx context.Context, nodeName string, restartNodeDescription RestartNodeDescription, timeout *int64) (result autorest.Response, err error) {
16814	if tracing.IsEnabled() {
16815		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartNode")
16816		defer func() {
16817			sc := -1
16818			if result.Response != nil {
16819				sc = result.Response.StatusCode
16820			}
16821			tracing.EndSpan(ctx, sc, err)
16822		}()
16823	}
16824	if err := validation.Validate([]validation.Validation{
16825		{TargetValue: restartNodeDescription,
16826			Constraints: []validation.Constraint{{Target: "restartNodeDescription.NodeInstanceID", Name: validation.Null, Rule: true, Chain: nil}}},
16827		{TargetValue: timeout,
16828			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16829				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16830					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16831				}}}}}); err != nil {
16832		return result, validation.NewError("servicefabric.BaseClient", "RestartNode", err.Error())
16833	}
16834
16835	req, err := client.RestartNodePreparer(ctx, nodeName, restartNodeDescription, timeout)
16836	if err != nil {
16837		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", nil, "Failure preparing request")
16838		return
16839	}
16840
16841	resp, err := client.RestartNodeSender(req)
16842	if err != nil {
16843		result.Response = resp
16844		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", resp, "Failure sending request")
16845		return
16846	}
16847
16848	result, err = client.RestartNodeResponder(resp)
16849	if err != nil {
16850		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", resp, "Failure responding to request")
16851		return
16852	}
16853
16854	return
16855}
16856
16857// RestartNodePreparer prepares the RestartNode request.
16858func (client BaseClient) RestartNodePreparer(ctx context.Context, nodeName string, restartNodeDescription RestartNodeDescription, timeout *int64) (*http.Request, error) {
16859	pathParameters := map[string]interface{}{
16860		"nodeName": autorest.Encode("path", nodeName),
16861	}
16862
16863	const APIVersion = "6.0"
16864	queryParameters := map[string]interface{}{
16865		"api-version": APIVersion,
16866	}
16867	if timeout != nil {
16868		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16869	} else {
16870		queryParameters["timeout"] = autorest.Encode("query", 60)
16871	}
16872
16873	preparer := autorest.CreatePreparer(
16874		autorest.AsContentType("application/json; charset=utf-8"),
16875		autorest.AsPost(),
16876		autorest.WithBaseURL(client.BaseURI),
16877		autorest.WithPathParameters("/Nodes/{nodeName}/$/Restart", pathParameters),
16878		autorest.WithJSON(restartNodeDescription),
16879		autorest.WithQueryParameters(queryParameters))
16880	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16881}
16882
16883// RestartNodeSender sends the RestartNode request. The method will close the
16884// http.Response Body if it receives an error.
16885func (client BaseClient) RestartNodeSender(req *http.Request) (*http.Response, error) {
16886	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16887}
16888
16889// RestartNodeResponder handles the response to the RestartNode request. The method always
16890// closes the http.Response Body.
16891func (client BaseClient) RestartNodeResponder(resp *http.Response) (result autorest.Response, err error) {
16892	err = autorest.Respond(
16893		resp,
16894		azure.WithErrorUnlessStatusCode(http.StatusOK),
16895		autorest.ByClosing())
16896	result.Response = resp
16897	return
16898}
16899
16900// RestartReplica restarts a service replica of a persisted service running on a node. Warning - There are no safety
16901// checks performed when this API is used. Incorrect use of this API can lead to availability loss for stateful
16902// services.
16903// Parameters:
16904// nodeName - the name of the node.
16905// partitionID - the identity of the partition.
16906// replicaID - the identifier of the replica.
16907// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16908// duration that the client is willing to wait for the requested operation to complete. The default value for
16909// this parameter is 60 seconds.
16910func (client BaseClient) RestartReplica(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (result autorest.Response, err error) {
16911	if tracing.IsEnabled() {
16912		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartReplica")
16913		defer func() {
16914			sc := -1
16915			if result.Response != nil {
16916				sc = result.Response.StatusCode
16917			}
16918			tracing.EndSpan(ctx, sc, err)
16919		}()
16920	}
16921	if err := validation.Validate([]validation.Validation{
16922		{TargetValue: timeout,
16923			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16924				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16925					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16926				}}}}}); err != nil {
16927		return result, validation.NewError("servicefabric.BaseClient", "RestartReplica", err.Error())
16928	}
16929
16930	req, err := client.RestartReplicaPreparer(ctx, nodeName, partitionID, replicaID, timeout)
16931	if err != nil {
16932		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", nil, "Failure preparing request")
16933		return
16934	}
16935
16936	resp, err := client.RestartReplicaSender(req)
16937	if err != nil {
16938		result.Response = resp
16939		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", resp, "Failure sending request")
16940		return
16941	}
16942
16943	result, err = client.RestartReplicaResponder(resp)
16944	if err != nil {
16945		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", resp, "Failure responding to request")
16946		return
16947	}
16948
16949	return
16950}
16951
16952// RestartReplicaPreparer prepares the RestartReplica request.
16953func (client BaseClient) RestartReplicaPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) {
16954	pathParameters := map[string]interface{}{
16955		"nodeName":    autorest.Encode("path", nodeName),
16956		"partitionId": partitionID,
16957		"replicaId":   replicaID,
16958	}
16959
16960	const APIVersion = "6.0"
16961	queryParameters := map[string]interface{}{
16962		"api-version": APIVersion,
16963	}
16964	if timeout != nil {
16965		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16966	} else {
16967		queryParameters["timeout"] = autorest.Encode("query", 60)
16968	}
16969
16970	preparer := autorest.CreatePreparer(
16971		autorest.AsPost(),
16972		autorest.WithBaseURL(client.BaseURI),
16973		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Restart", pathParameters),
16974		autorest.WithQueryParameters(queryParameters))
16975	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16976}
16977
16978// RestartReplicaSender sends the RestartReplica request. The method will close the
16979// http.Response Body if it receives an error.
16980func (client BaseClient) RestartReplicaSender(req *http.Request) (*http.Response, error) {
16981	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16982}
16983
16984// RestartReplicaResponder handles the response to the RestartReplica request. The method always
16985// closes the http.Response Body.
16986func (client BaseClient) RestartReplicaResponder(resp *http.Response) (result autorest.Response, err error) {
16987	err = autorest.Respond(
16988		resp,
16989		azure.WithErrorUnlessStatusCode(http.StatusOK),
16990		autorest.ByClosing())
16991	result.Response = resp
16992	return
16993}
16994
16995// RestorePartition restores the state of a of the stateful persisted partition using the specified backup point. In
16996// case the partition is already being periodically backed up, then by default the backup point is looked for in the
16997// storage specified in backup policy. One can also override the same by specifying the backup storage details as part
16998// of the restore partition description in body. Once the restore is initiated, its progress can be tracked using the
16999// GetRestoreProgress operation.
17000// In case, the operation times out, specify a greater restore timeout value in the query parameter.
17001// Parameters:
17002// partitionID - the identity of the partition.
17003// restorePartitionDescription - describes the parameters to restore the partition.
17004// restoreTimeout - specifies the maximum amount of time to wait, in minutes, for the restore operation to
17005// complete. Post that, the operation returns back with timeout error. However, in certain corner cases it
17006// could be that the restore operation goes through even though it completes with timeout. In case of timeout
17007// error, its recommended to invoke this operation again with a greater timeout value. the default value for
17008// the same is 10 minutes.
17009// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17010// duration that the client is willing to wait for the requested operation to complete. The default value for
17011// this parameter is 60 seconds.
17012func (client BaseClient) RestorePartition(ctx context.Context, partitionID uuid.UUID, restorePartitionDescription RestorePartitionDescription, restoreTimeout *int32, timeout *int64) (result autorest.Response, err error) {
17013	if tracing.IsEnabled() {
17014		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestorePartition")
17015		defer func() {
17016			sc := -1
17017			if result.Response != nil {
17018				sc = result.Response.StatusCode
17019			}
17020			tracing.EndSpan(ctx, sc, err)
17021		}()
17022	}
17023	if err := validation.Validate([]validation.Validation{
17024		{TargetValue: restorePartitionDescription,
17025			Constraints: []validation.Constraint{{Target: "restorePartitionDescription.BackupID", Name: validation.Null, Rule: true, Chain: nil},
17026				{Target: "restorePartitionDescription.BackupLocation", Name: validation.Null, Rule: true, Chain: nil}}},
17027		{TargetValue: timeout,
17028			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17029				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17030					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17031				}}}}}); err != nil {
17032		return result, validation.NewError("servicefabric.BaseClient", "RestorePartition", err.Error())
17033	}
17034
17035	req, err := client.RestorePartitionPreparer(ctx, partitionID, restorePartitionDescription, restoreTimeout, timeout)
17036	if err != nil {
17037		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", nil, "Failure preparing request")
17038		return
17039	}
17040
17041	resp, err := client.RestorePartitionSender(req)
17042	if err != nil {
17043		result.Response = resp
17044		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", resp, "Failure sending request")
17045		return
17046	}
17047
17048	result, err = client.RestorePartitionResponder(resp)
17049	if err != nil {
17050		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", resp, "Failure responding to request")
17051		return
17052	}
17053
17054	return
17055}
17056
17057// RestorePartitionPreparer prepares the RestorePartition request.
17058func (client BaseClient) RestorePartitionPreparer(ctx context.Context, partitionID uuid.UUID, restorePartitionDescription RestorePartitionDescription, restoreTimeout *int32, timeout *int64) (*http.Request, error) {
17059	pathParameters := map[string]interface{}{
17060		"partitionId": partitionID,
17061	}
17062
17063	const APIVersion = "6.2-preview"
17064	queryParameters := map[string]interface{}{
17065		"api-version": APIVersion,
17066	}
17067	if restoreTimeout != nil {
17068		queryParameters["RestoreTimeout"] = autorest.Encode("query", *restoreTimeout)
17069	} else {
17070		queryParameters["RestoreTimeout"] = autorest.Encode("query", 10)
17071	}
17072	if timeout != nil {
17073		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17074	} else {
17075		queryParameters["timeout"] = autorest.Encode("query", 60)
17076	}
17077
17078	preparer := autorest.CreatePreparer(
17079		autorest.AsContentType("application/json; charset=utf-8"),
17080		autorest.AsPost(),
17081		autorest.WithBaseURL(client.BaseURI),
17082		autorest.WithPathParameters("/Partitions/{partitionId}/$/Restore", pathParameters),
17083		autorest.WithJSON(restorePartitionDescription),
17084		autorest.WithQueryParameters(queryParameters))
17085	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17086}
17087
17088// RestorePartitionSender sends the RestorePartition request. The method will close the
17089// http.Response Body if it receives an error.
17090func (client BaseClient) RestorePartitionSender(req *http.Request) (*http.Response, error) {
17091	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17092}
17093
17094// RestorePartitionResponder handles the response to the RestorePartition request. The method always
17095// closes the http.Response Body.
17096func (client BaseClient) RestorePartitionResponder(resp *http.Response) (result autorest.Response, err error) {
17097	err = autorest.Respond(
17098		resp,
17099		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
17100		autorest.ByClosing())
17101	result.Response = resp
17102	return
17103}
17104
17105// ResumeApplicationBackup the previously suspended Service Fabric application resumes taking periodic backup as per
17106// the backup policy currently configured for the same.
17107// Parameters:
17108// applicationID - the identity of the application. This is typically the full name of the application without
17109// the 'fabric:' URI scheme.
17110// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17111// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
17112// in 6.0+ and "myapp/app1" in previous versions.
17113// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17114// duration that the client is willing to wait for the requested operation to complete. The default value for
17115// this parameter is 60 seconds.
17116func (client BaseClient) ResumeApplicationBackup(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) {
17117	if tracing.IsEnabled() {
17118		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeApplicationBackup")
17119		defer func() {
17120			sc := -1
17121			if result.Response != nil {
17122				sc = result.Response.StatusCode
17123			}
17124			tracing.EndSpan(ctx, sc, err)
17125		}()
17126	}
17127	if err := validation.Validate([]validation.Validation{
17128		{TargetValue: timeout,
17129			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17130				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17131					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17132				}}}}}); err != nil {
17133		return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationBackup", err.Error())
17134	}
17135
17136	req, err := client.ResumeApplicationBackupPreparer(ctx, applicationID, timeout)
17137	if err != nil {
17138		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", nil, "Failure preparing request")
17139		return
17140	}
17141
17142	resp, err := client.ResumeApplicationBackupSender(req)
17143	if err != nil {
17144		result.Response = resp
17145		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", resp, "Failure sending request")
17146		return
17147	}
17148
17149	result, err = client.ResumeApplicationBackupResponder(resp)
17150	if err != nil {
17151		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", resp, "Failure responding to request")
17152		return
17153	}
17154
17155	return
17156}
17157
17158// ResumeApplicationBackupPreparer prepares the ResumeApplicationBackup request.
17159func (client BaseClient) ResumeApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
17160	pathParameters := map[string]interface{}{
17161		"applicationId": applicationID,
17162	}
17163
17164	const APIVersion = "6.2-preview"
17165	queryParameters := map[string]interface{}{
17166		"api-version": APIVersion,
17167	}
17168	if timeout != nil {
17169		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17170	} else {
17171		queryParameters["timeout"] = autorest.Encode("query", 60)
17172	}
17173
17174	preparer := autorest.CreatePreparer(
17175		autorest.AsPost(),
17176		autorest.WithBaseURL(client.BaseURI),
17177		autorest.WithPathParameters("/Applications/{applicationId}/$/ResumeBackup", pathParameters),
17178		autorest.WithQueryParameters(queryParameters))
17179	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17180}
17181
17182// ResumeApplicationBackupSender sends the ResumeApplicationBackup request. The method will close the
17183// http.Response Body if it receives an error.
17184func (client BaseClient) ResumeApplicationBackupSender(req *http.Request) (*http.Response, error) {
17185	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17186}
17187
17188// ResumeApplicationBackupResponder handles the response to the ResumeApplicationBackup request. The method always
17189// closes the http.Response Body.
17190func (client BaseClient) ResumeApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) {
17191	err = autorest.Respond(
17192		resp,
17193		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
17194		autorest.ByClosing())
17195	result.Response = resp
17196	return
17197}
17198
17199// ResumeApplicationUpgrade resumes an unmonitored manual Service Fabric application upgrade. Service Fabric upgrades
17200// one upgrade domain at a time. For unmonitored manual upgrades, after Service Fabric finishes an upgrade domain, it
17201// waits for you to call this API before proceeding to the next upgrade domain.
17202// Parameters:
17203// applicationID - the identity of the application. This is typically the full name of the application without
17204// the 'fabric:' URI scheme.
17205// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17206// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
17207// in 6.0+ and "myapp/app1" in previous versions.
17208// resumeApplicationUpgradeDescription - describes the parameters for resuming an application upgrade.
17209// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17210// duration that the client is willing to wait for the requested operation to complete. The default value for
17211// this parameter is 60 seconds.
17212func (client BaseClient) ResumeApplicationUpgrade(ctx context.Context, applicationID string, resumeApplicationUpgradeDescription ResumeApplicationUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
17213	if tracing.IsEnabled() {
17214		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeApplicationUpgrade")
17215		defer func() {
17216			sc := -1
17217			if result.Response != nil {
17218				sc = result.Response.StatusCode
17219			}
17220			tracing.EndSpan(ctx, sc, err)
17221		}()
17222	}
17223	if err := validation.Validate([]validation.Validation{
17224		{TargetValue: resumeApplicationUpgradeDescription,
17225			Constraints: []validation.Constraint{{Target: "resumeApplicationUpgradeDescription.UpgradeDomainName", Name: validation.Null, Rule: true, Chain: nil}}},
17226		{TargetValue: timeout,
17227			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17228				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17229					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17230				}}}}}); err != nil {
17231		return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationUpgrade", err.Error())
17232	}
17233
17234	req, err := client.ResumeApplicationUpgradePreparer(ctx, applicationID, resumeApplicationUpgradeDescription, timeout)
17235	if err != nil {
17236		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", nil, "Failure preparing request")
17237		return
17238	}
17239
17240	resp, err := client.ResumeApplicationUpgradeSender(req)
17241	if err != nil {
17242		result.Response = resp
17243		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", resp, "Failure sending request")
17244		return
17245	}
17246
17247	result, err = client.ResumeApplicationUpgradeResponder(resp)
17248	if err != nil {
17249		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", resp, "Failure responding to request")
17250		return
17251	}
17252
17253	return
17254}
17255
17256// ResumeApplicationUpgradePreparer prepares the ResumeApplicationUpgrade request.
17257func (client BaseClient) ResumeApplicationUpgradePreparer(ctx context.Context, applicationID string, resumeApplicationUpgradeDescription ResumeApplicationUpgradeDescription, timeout *int64) (*http.Request, error) {
17258	pathParameters := map[string]interface{}{
17259		"applicationId": applicationID,
17260	}
17261
17262	const APIVersion = "6.0"
17263	queryParameters := map[string]interface{}{
17264		"api-version": APIVersion,
17265	}
17266	if timeout != nil {
17267		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17268	} else {
17269		queryParameters["timeout"] = autorest.Encode("query", 60)
17270	}
17271
17272	preparer := autorest.CreatePreparer(
17273		autorest.AsContentType("application/json; charset=utf-8"),
17274		autorest.AsPost(),
17275		autorest.WithBaseURL(client.BaseURI),
17276		autorest.WithPathParameters("/Applications/{applicationId}/$/MoveToNextUpgradeDomain", pathParameters),
17277		autorest.WithJSON(resumeApplicationUpgradeDescription),
17278		autorest.WithQueryParameters(queryParameters))
17279	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17280}
17281
17282// ResumeApplicationUpgradeSender sends the ResumeApplicationUpgrade request. The method will close the
17283// http.Response Body if it receives an error.
17284func (client BaseClient) ResumeApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
17285	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17286}
17287
17288// ResumeApplicationUpgradeResponder handles the response to the ResumeApplicationUpgrade request. The method always
17289// closes the http.Response Body.
17290func (client BaseClient) ResumeApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
17291	err = autorest.Respond(
17292		resp,
17293		azure.WithErrorUnlessStatusCode(http.StatusOK),
17294		autorest.ByClosing())
17295	result.Response = resp
17296	return
17297}
17298
17299// ResumeClusterUpgrade make the cluster code or configuration upgrade move on to the next upgrade domain if
17300// appropriate.
17301// Parameters:
17302// resumeClusterUpgradeDescription - describes the parameters for resuming a cluster upgrade.
17303// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17304// duration that the client is willing to wait for the requested operation to complete. The default value for
17305// this parameter is 60 seconds.
17306func (client BaseClient) ResumeClusterUpgrade(ctx context.Context, resumeClusterUpgradeDescription ResumeClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
17307	if tracing.IsEnabled() {
17308		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeClusterUpgrade")
17309		defer func() {
17310			sc := -1
17311			if result.Response != nil {
17312				sc = result.Response.StatusCode
17313			}
17314			tracing.EndSpan(ctx, sc, err)
17315		}()
17316	}
17317	if err := validation.Validate([]validation.Validation{
17318		{TargetValue: resumeClusterUpgradeDescription,
17319			Constraints: []validation.Constraint{{Target: "resumeClusterUpgradeDescription.UpgradeDomain", Name: validation.Null, Rule: true, Chain: nil}}},
17320		{TargetValue: timeout,
17321			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17322				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17323					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17324				}}}}}); err != nil {
17325		return result, validation.NewError("servicefabric.BaseClient", "ResumeClusterUpgrade", err.Error())
17326	}
17327
17328	req, err := client.ResumeClusterUpgradePreparer(ctx, resumeClusterUpgradeDescription, timeout)
17329	if err != nil {
17330		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", nil, "Failure preparing request")
17331		return
17332	}
17333
17334	resp, err := client.ResumeClusterUpgradeSender(req)
17335	if err != nil {
17336		result.Response = resp
17337		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", resp, "Failure sending request")
17338		return
17339	}
17340
17341	result, err = client.ResumeClusterUpgradeResponder(resp)
17342	if err != nil {
17343		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", resp, "Failure responding to request")
17344		return
17345	}
17346
17347	return
17348}
17349
17350// ResumeClusterUpgradePreparer prepares the ResumeClusterUpgrade request.
17351func (client BaseClient) ResumeClusterUpgradePreparer(ctx context.Context, resumeClusterUpgradeDescription ResumeClusterUpgradeDescription, timeout *int64) (*http.Request, error) {
17352	const APIVersion = "6.0"
17353	queryParameters := map[string]interface{}{
17354		"api-version": APIVersion,
17355	}
17356	if timeout != nil {
17357		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17358	} else {
17359		queryParameters["timeout"] = autorest.Encode("query", 60)
17360	}
17361
17362	preparer := autorest.CreatePreparer(
17363		autorest.AsContentType("application/json; charset=utf-8"),
17364		autorest.AsPost(),
17365		autorest.WithBaseURL(client.BaseURI),
17366		autorest.WithPath("/$/MoveToNextUpgradeDomain"),
17367		autorest.WithJSON(resumeClusterUpgradeDescription),
17368		autorest.WithQueryParameters(queryParameters))
17369	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17370}
17371
17372// ResumeClusterUpgradeSender sends the ResumeClusterUpgrade request. The method will close the
17373// http.Response Body if it receives an error.
17374func (client BaseClient) ResumeClusterUpgradeSender(req *http.Request) (*http.Response, error) {
17375	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17376}
17377
17378// ResumeClusterUpgradeResponder handles the response to the ResumeClusterUpgrade request. The method always
17379// closes the http.Response Body.
17380func (client BaseClient) ResumeClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
17381	err = autorest.Respond(
17382		resp,
17383		azure.WithErrorUnlessStatusCode(http.StatusOK),
17384		autorest.ByClosing())
17385	result.Response = resp
17386	return
17387}
17388
17389// ResumePartitionBackup the previously suspended partition resumes taking periodic backup as per the backup policy
17390// currently configured for the same.
17391// Parameters:
17392// partitionID - the identity of the partition.
17393// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17394// duration that the client is willing to wait for the requested operation to complete. The default value for
17395// this parameter is 60 seconds.
17396func (client BaseClient) ResumePartitionBackup(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
17397	if tracing.IsEnabled() {
17398		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumePartitionBackup")
17399		defer func() {
17400			sc := -1
17401			if result.Response != nil {
17402				sc = result.Response.StatusCode
17403			}
17404			tracing.EndSpan(ctx, sc, err)
17405		}()
17406	}
17407	if err := validation.Validate([]validation.Validation{
17408		{TargetValue: timeout,
17409			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17410				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17411					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17412				}}}}}); err != nil {
17413		return result, validation.NewError("servicefabric.BaseClient", "ResumePartitionBackup", err.Error())
17414	}
17415
17416	req, err := client.ResumePartitionBackupPreparer(ctx, partitionID, timeout)
17417	if err != nil {
17418		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", nil, "Failure preparing request")
17419		return
17420	}
17421
17422	resp, err := client.ResumePartitionBackupSender(req)
17423	if err != nil {
17424		result.Response = resp
17425		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", resp, "Failure sending request")
17426		return
17427	}
17428
17429	result, err = client.ResumePartitionBackupResponder(resp)
17430	if err != nil {
17431		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", resp, "Failure responding to request")
17432		return
17433	}
17434
17435	return
17436}
17437
17438// ResumePartitionBackupPreparer prepares the ResumePartitionBackup request.
17439func (client BaseClient) ResumePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
17440	pathParameters := map[string]interface{}{
17441		"partitionId": partitionID,
17442	}
17443
17444	const APIVersion = "6.2-preview"
17445	queryParameters := map[string]interface{}{
17446		"api-version": APIVersion,
17447	}
17448	if timeout != nil {
17449		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17450	} else {
17451		queryParameters["timeout"] = autorest.Encode("query", 60)
17452	}
17453
17454	preparer := autorest.CreatePreparer(
17455		autorest.AsPost(),
17456		autorest.WithBaseURL(client.BaseURI),
17457		autorest.WithPathParameters("/Partitions/{partitionId}/$/ResumeBackup", pathParameters),
17458		autorest.WithQueryParameters(queryParameters))
17459	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17460}
17461
17462// ResumePartitionBackupSender sends the ResumePartitionBackup request. The method will close the
17463// http.Response Body if it receives an error.
17464func (client BaseClient) ResumePartitionBackupSender(req *http.Request) (*http.Response, error) {
17465	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17466}
17467
17468// ResumePartitionBackupResponder handles the response to the ResumePartitionBackup request. The method always
17469// closes the http.Response Body.
17470func (client BaseClient) ResumePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) {
17471	err = autorest.Respond(
17472		resp,
17473		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
17474		autorest.ByClosing())
17475	result.Response = resp
17476	return
17477}
17478
17479// ResumeServiceBackup the previously suspended Service Fabric service resumes taking periodic backup as per the backup
17480// policy currently configured for the same.
17481// Parameters:
17482// serviceID - the identity of the service. This is typically the full name of the service without the
17483// 'fabric:' URI scheme.
17484// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17485// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
17486// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
17487// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17488// duration that the client is willing to wait for the requested operation to complete. The default value for
17489// this parameter is 60 seconds.
17490func (client BaseClient) ResumeServiceBackup(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) {
17491	if tracing.IsEnabled() {
17492		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeServiceBackup")
17493		defer func() {
17494			sc := -1
17495			if result.Response != nil {
17496				sc = result.Response.StatusCode
17497			}
17498			tracing.EndSpan(ctx, sc, err)
17499		}()
17500	}
17501	if err := validation.Validate([]validation.Validation{
17502		{TargetValue: timeout,
17503			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17504				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17505					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17506				}}}}}); err != nil {
17507		return result, validation.NewError("servicefabric.BaseClient", "ResumeServiceBackup", err.Error())
17508	}
17509
17510	req, err := client.ResumeServiceBackupPreparer(ctx, serviceID, timeout)
17511	if err != nil {
17512		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", nil, "Failure preparing request")
17513		return
17514	}
17515
17516	resp, err := client.ResumeServiceBackupSender(req)
17517	if err != nil {
17518		result.Response = resp
17519		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", resp, "Failure sending request")
17520		return
17521	}
17522
17523	result, err = client.ResumeServiceBackupResponder(resp)
17524	if err != nil {
17525		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", resp, "Failure responding to request")
17526		return
17527	}
17528
17529	return
17530}
17531
17532// ResumeServiceBackupPreparer prepares the ResumeServiceBackup request.
17533func (client BaseClient) ResumeServiceBackupPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
17534	pathParameters := map[string]interface{}{
17535		"serviceId": serviceID,
17536	}
17537
17538	const APIVersion = "6.2-preview"
17539	queryParameters := map[string]interface{}{
17540		"api-version": APIVersion,
17541	}
17542	if timeout != nil {
17543		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17544	} else {
17545		queryParameters["timeout"] = autorest.Encode("query", 60)
17546	}
17547
17548	preparer := autorest.CreatePreparer(
17549		autorest.AsPost(),
17550		autorest.WithBaseURL(client.BaseURI),
17551		autorest.WithPathParameters("/Services/{serviceId}/$/ResumeBackup", pathParameters),
17552		autorest.WithQueryParameters(queryParameters))
17553	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17554}
17555
17556// ResumeServiceBackupSender sends the ResumeServiceBackup request. The method will close the
17557// http.Response Body if it receives an error.
17558func (client BaseClient) ResumeServiceBackupSender(req *http.Request) (*http.Response, error) {
17559	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17560}
17561
17562// ResumeServiceBackupResponder handles the response to the ResumeServiceBackup request. The method always
17563// closes the http.Response Body.
17564func (client BaseClient) ResumeServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) {
17565	err = autorest.Respond(
17566		resp,
17567		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
17568		autorest.ByClosing())
17569	result.Response = resp
17570	return
17571}
17572
17573// RollbackApplicationUpgrade starts rolling back the current application upgrade to the previous version. This API can
17574// only be used to rollback the current in-progress upgrade that is rolling forward to new version. If the application
17575// is not currently being upgraded use StartApplicationUpgrade API to upgrade it to desired version, including rolling
17576// back to a previous version.
17577// Parameters:
17578// applicationID - the identity of the application. This is typically the full name of the application without
17579// the 'fabric:' URI scheme.
17580// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17581// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
17582// in 6.0+ and "myapp/app1" in previous versions.
17583// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17584// duration that the client is willing to wait for the requested operation to complete. The default value for
17585// this parameter is 60 seconds.
17586func (client BaseClient) RollbackApplicationUpgrade(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) {
17587	if tracing.IsEnabled() {
17588		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RollbackApplicationUpgrade")
17589		defer func() {
17590			sc := -1
17591			if result.Response != nil {
17592				sc = result.Response.StatusCode
17593			}
17594			tracing.EndSpan(ctx, sc, err)
17595		}()
17596	}
17597	if err := validation.Validate([]validation.Validation{
17598		{TargetValue: timeout,
17599			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17600				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17601					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17602				}}}}}); err != nil {
17603		return result, validation.NewError("servicefabric.BaseClient", "RollbackApplicationUpgrade", err.Error())
17604	}
17605
17606	req, err := client.RollbackApplicationUpgradePreparer(ctx, applicationID, timeout)
17607	if err != nil {
17608		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", nil, "Failure preparing request")
17609		return
17610	}
17611
17612	resp, err := client.RollbackApplicationUpgradeSender(req)
17613	if err != nil {
17614		result.Response = resp
17615		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", resp, "Failure sending request")
17616		return
17617	}
17618
17619	result, err = client.RollbackApplicationUpgradeResponder(resp)
17620	if err != nil {
17621		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", resp, "Failure responding to request")
17622		return
17623	}
17624
17625	return
17626}
17627
17628// RollbackApplicationUpgradePreparer prepares the RollbackApplicationUpgrade request.
17629func (client BaseClient) RollbackApplicationUpgradePreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
17630	pathParameters := map[string]interface{}{
17631		"applicationId": applicationID,
17632	}
17633
17634	const APIVersion = "6.0"
17635	queryParameters := map[string]interface{}{
17636		"api-version": APIVersion,
17637	}
17638	if timeout != nil {
17639		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17640	} else {
17641		queryParameters["timeout"] = autorest.Encode("query", 60)
17642	}
17643
17644	preparer := autorest.CreatePreparer(
17645		autorest.AsPost(),
17646		autorest.WithBaseURL(client.BaseURI),
17647		autorest.WithPathParameters("/Applications/{applicationId}/$/RollbackUpgrade", pathParameters),
17648		autorest.WithQueryParameters(queryParameters))
17649	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17650}
17651
17652// RollbackApplicationUpgradeSender sends the RollbackApplicationUpgrade request. The method will close the
17653// http.Response Body if it receives an error.
17654func (client BaseClient) RollbackApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
17655	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17656}
17657
17658// RollbackApplicationUpgradeResponder handles the response to the RollbackApplicationUpgrade request. The method always
17659// closes the http.Response Body.
17660func (client BaseClient) RollbackApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
17661	err = autorest.Respond(
17662		resp,
17663		azure.WithErrorUnlessStatusCode(http.StatusOK),
17664		autorest.ByClosing())
17665	result.Response = resp
17666	return
17667}
17668
17669// RollbackClusterUpgrade rollback the code or configuration upgrade of a Service Fabric cluster.
17670// Parameters:
17671// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17672// duration that the client is willing to wait for the requested operation to complete. The default value for
17673// this parameter is 60 seconds.
17674func (client BaseClient) RollbackClusterUpgrade(ctx context.Context, timeout *int64) (result autorest.Response, err error) {
17675	if tracing.IsEnabled() {
17676		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RollbackClusterUpgrade")
17677		defer func() {
17678			sc := -1
17679			if result.Response != nil {
17680				sc = result.Response.StatusCode
17681			}
17682			tracing.EndSpan(ctx, sc, err)
17683		}()
17684	}
17685	if err := validation.Validate([]validation.Validation{
17686		{TargetValue: timeout,
17687			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17688				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17689					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17690				}}}}}); err != nil {
17691		return result, validation.NewError("servicefabric.BaseClient", "RollbackClusterUpgrade", err.Error())
17692	}
17693
17694	req, err := client.RollbackClusterUpgradePreparer(ctx, timeout)
17695	if err != nil {
17696		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", nil, "Failure preparing request")
17697		return
17698	}
17699
17700	resp, err := client.RollbackClusterUpgradeSender(req)
17701	if err != nil {
17702		result.Response = resp
17703		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", resp, "Failure sending request")
17704		return
17705	}
17706
17707	result, err = client.RollbackClusterUpgradeResponder(resp)
17708	if err != nil {
17709		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", resp, "Failure responding to request")
17710		return
17711	}
17712
17713	return
17714}
17715
17716// RollbackClusterUpgradePreparer prepares the RollbackClusterUpgrade request.
17717func (client BaseClient) RollbackClusterUpgradePreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
17718	const APIVersion = "6.0"
17719	queryParameters := map[string]interface{}{
17720		"api-version": APIVersion,
17721	}
17722	if timeout != nil {
17723		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17724	} else {
17725		queryParameters["timeout"] = autorest.Encode("query", 60)
17726	}
17727
17728	preparer := autorest.CreatePreparer(
17729		autorest.AsPost(),
17730		autorest.WithBaseURL(client.BaseURI),
17731		autorest.WithPath("/$/RollbackUpgrade"),
17732		autorest.WithQueryParameters(queryParameters))
17733	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17734}
17735
17736// RollbackClusterUpgradeSender sends the RollbackClusterUpgrade request. The method will close the
17737// http.Response Body if it receives an error.
17738func (client BaseClient) RollbackClusterUpgradeSender(req *http.Request) (*http.Response, error) {
17739	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17740}
17741
17742// RollbackClusterUpgradeResponder handles the response to the RollbackClusterUpgrade request. The method always
17743// closes the http.Response Body.
17744func (client BaseClient) RollbackClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
17745	err = autorest.Respond(
17746		resp,
17747		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
17748		autorest.ByClosing())
17749	result.Response = resp
17750	return
17751}
17752
17753// SetUpgradeOrchestrationServiceState update the service state of Service Fabric Upgrade Orchestration Service. This
17754// API is internally used for support purposes.
17755// Parameters:
17756// upgradeOrchestrationServiceState - service state of Service Fabric Upgrade Orchestration Service.
17757// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17758// duration that the client is willing to wait for the requested operation to complete. The default value for
17759// this parameter is 60 seconds.
17760func (client BaseClient) SetUpgradeOrchestrationServiceState(ctx context.Context, upgradeOrchestrationServiceState UpgradeOrchestrationServiceState, timeout *int64) (result UpgradeOrchestrationServiceStateSummary, err error) {
17761	if tracing.IsEnabled() {
17762		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SetUpgradeOrchestrationServiceState")
17763		defer func() {
17764			sc := -1
17765			if result.Response.Response != nil {
17766				sc = result.Response.Response.StatusCode
17767			}
17768			tracing.EndSpan(ctx, sc, err)
17769		}()
17770	}
17771	if err := validation.Validate([]validation.Validation{
17772		{TargetValue: timeout,
17773			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17774				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17775					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17776				}}}}}); err != nil {
17777		return result, validation.NewError("servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", err.Error())
17778	}
17779
17780	req, err := client.SetUpgradeOrchestrationServiceStatePreparer(ctx, upgradeOrchestrationServiceState, timeout)
17781	if err != nil {
17782		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", nil, "Failure preparing request")
17783		return
17784	}
17785
17786	resp, err := client.SetUpgradeOrchestrationServiceStateSender(req)
17787	if err != nil {
17788		result.Response = autorest.Response{Response: resp}
17789		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", resp, "Failure sending request")
17790		return
17791	}
17792
17793	result, err = client.SetUpgradeOrchestrationServiceStateResponder(resp)
17794	if err != nil {
17795		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", resp, "Failure responding to request")
17796		return
17797	}
17798
17799	return
17800}
17801
17802// SetUpgradeOrchestrationServiceStatePreparer prepares the SetUpgradeOrchestrationServiceState request.
17803func (client BaseClient) SetUpgradeOrchestrationServiceStatePreparer(ctx context.Context, upgradeOrchestrationServiceState UpgradeOrchestrationServiceState, timeout *int64) (*http.Request, error) {
17804	const APIVersion = "6.0"
17805	queryParameters := map[string]interface{}{
17806		"api-version": APIVersion,
17807	}
17808	if timeout != nil {
17809		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17810	} else {
17811		queryParameters["timeout"] = autorest.Encode("query", 60)
17812	}
17813
17814	preparer := autorest.CreatePreparer(
17815		autorest.AsContentType("application/json; charset=utf-8"),
17816		autorest.AsPost(),
17817		autorest.WithBaseURL(client.BaseURI),
17818		autorest.WithPath("/$/SetUpgradeOrchestrationServiceState"),
17819		autorest.WithJSON(upgradeOrchestrationServiceState),
17820		autorest.WithQueryParameters(queryParameters))
17821	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17822}
17823
17824// SetUpgradeOrchestrationServiceStateSender sends the SetUpgradeOrchestrationServiceState request. The method will close the
17825// http.Response Body if it receives an error.
17826func (client BaseClient) SetUpgradeOrchestrationServiceStateSender(req *http.Request) (*http.Response, error) {
17827	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17828}
17829
17830// SetUpgradeOrchestrationServiceStateResponder handles the response to the SetUpgradeOrchestrationServiceState request. The method always
17831// closes the http.Response Body.
17832func (client BaseClient) SetUpgradeOrchestrationServiceStateResponder(resp *http.Response) (result UpgradeOrchestrationServiceStateSummary, err error) {
17833	err = autorest.Respond(
17834		resp,
17835		azure.WithErrorUnlessStatusCode(http.StatusOK),
17836		autorest.ByUnmarshallingJSON(&result),
17837		autorest.ByClosing())
17838	result.Response = autorest.Response{Response: resp}
17839	return
17840}
17841
17842// StartApplicationUpgrade validates the supplied application upgrade parameters and starts upgrading the application
17843// if the parameters are valid.
17844// Parameters:
17845// applicationID - the identity of the application. This is typically the full name of the application without
17846// the 'fabric:' URI scheme.
17847// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17848// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
17849// in 6.0+ and "myapp/app1" in previous versions.
17850// applicationUpgradeDescription - parameters for an application upgrade.
17851// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17852// duration that the client is willing to wait for the requested operation to complete. The default value for
17853// this parameter is 60 seconds.
17854func (client BaseClient) StartApplicationUpgrade(ctx context.Context, applicationID string, applicationUpgradeDescription ApplicationUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
17855	if tracing.IsEnabled() {
17856		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartApplicationUpgrade")
17857		defer func() {
17858			sc := -1
17859			if result.Response != nil {
17860				sc = result.Response.StatusCode
17861			}
17862			tracing.EndSpan(ctx, sc, err)
17863		}()
17864	}
17865	if err := validation.Validate([]validation.Validation{
17866		{TargetValue: applicationUpgradeDescription,
17867			Constraints: []validation.Constraint{{Target: "applicationUpgradeDescription.Name", Name: validation.Null, Rule: true, Chain: nil},
17868				{Target: "applicationUpgradeDescription.TargetApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil},
17869				{Target: "applicationUpgradeDescription.Parameters", Name: validation.Null, Rule: true, Chain: nil}}},
17870		{TargetValue: timeout,
17871			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17872				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17873					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17874				}}}}}); err != nil {
17875		return result, validation.NewError("servicefabric.BaseClient", "StartApplicationUpgrade", err.Error())
17876	}
17877
17878	req, err := client.StartApplicationUpgradePreparer(ctx, applicationID, applicationUpgradeDescription, timeout)
17879	if err != nil {
17880		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", nil, "Failure preparing request")
17881		return
17882	}
17883
17884	resp, err := client.StartApplicationUpgradeSender(req)
17885	if err != nil {
17886		result.Response = resp
17887		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", resp, "Failure sending request")
17888		return
17889	}
17890
17891	result, err = client.StartApplicationUpgradeResponder(resp)
17892	if err != nil {
17893		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", resp, "Failure responding to request")
17894		return
17895	}
17896
17897	return
17898}
17899
17900// StartApplicationUpgradePreparer prepares the StartApplicationUpgrade request.
17901func (client BaseClient) StartApplicationUpgradePreparer(ctx context.Context, applicationID string, applicationUpgradeDescription ApplicationUpgradeDescription, timeout *int64) (*http.Request, error) {
17902	pathParameters := map[string]interface{}{
17903		"applicationId": applicationID,
17904	}
17905
17906	const APIVersion = "6.0"
17907	queryParameters := map[string]interface{}{
17908		"api-version": APIVersion,
17909	}
17910	if timeout != nil {
17911		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17912	} else {
17913		queryParameters["timeout"] = autorest.Encode("query", 60)
17914	}
17915
17916	preparer := autorest.CreatePreparer(
17917		autorest.AsContentType("application/json; charset=utf-8"),
17918		autorest.AsPost(),
17919		autorest.WithBaseURL(client.BaseURI),
17920		autorest.WithPathParameters("/Applications/{applicationId}/$/Upgrade", pathParameters),
17921		autorest.WithJSON(applicationUpgradeDescription),
17922		autorest.WithQueryParameters(queryParameters))
17923	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17924}
17925
17926// StartApplicationUpgradeSender sends the StartApplicationUpgrade request. The method will close the
17927// http.Response Body if it receives an error.
17928func (client BaseClient) StartApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
17929	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17930}
17931
17932// StartApplicationUpgradeResponder handles the response to the StartApplicationUpgrade request. The method always
17933// closes the http.Response Body.
17934func (client BaseClient) StartApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
17935	err = autorest.Respond(
17936		resp,
17937		azure.WithErrorUnlessStatusCode(http.StatusOK),
17938		autorest.ByClosing())
17939	result.Response = resp
17940	return
17941}
17942
17943// StartChaos if Chaos is not already running in the cluster, it starts Chaos with the passed in Chaos parameters.
17944// If Chaos is already running when this call is made, the call fails with the error code
17945// FABRIC_E_CHAOS_ALREADY_RUNNING.
17946// Please refer to the article [Induce controlled Chaos in Service Fabric
17947// clusters](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-controlled-chaos) for more details.
17948// Parameters:
17949// chaosParameters - describes all the parameters to configure a Chaos run.
17950// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17951// duration that the client is willing to wait for the requested operation to complete. The default value for
17952// this parameter is 60 seconds.
17953func (client BaseClient) StartChaos(ctx context.Context, chaosParameters ChaosParameters, timeout *int64) (result autorest.Response, err error) {
17954	if tracing.IsEnabled() {
17955		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartChaos")
17956		defer func() {
17957			sc := -1
17958			if result.Response != nil {
17959				sc = result.Response.StatusCode
17960			}
17961			tracing.EndSpan(ctx, sc, err)
17962		}()
17963	}
17964	if err := validation.Validate([]validation.Validation{
17965		{TargetValue: chaosParameters,
17966			Constraints: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.Null, Rule: false,
17967				Chain: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17968					{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
17969				}},
17970				{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.Null, Rule: false,
17971					Chain: []validation.Constraint{{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17972						{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
17973					}},
17974				{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.Null, Rule: false,
17975					Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17976						{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
17977					}},
17978				{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.Null, Rule: false,
17979					Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17980						{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
17981					}}}},
17982		{TargetValue: timeout,
17983			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17984				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17985					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17986				}}}}}); err != nil {
17987		return result, validation.NewError("servicefabric.BaseClient", "StartChaos", err.Error())
17988	}
17989
17990	req, err := client.StartChaosPreparer(ctx, chaosParameters, timeout)
17991	if err != nil {
17992		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", nil, "Failure preparing request")
17993		return
17994	}
17995
17996	resp, err := client.StartChaosSender(req)
17997	if err != nil {
17998		result.Response = resp
17999		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", resp, "Failure sending request")
18000		return
18001	}
18002
18003	result, err = client.StartChaosResponder(resp)
18004	if err != nil {
18005		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", resp, "Failure responding to request")
18006		return
18007	}
18008
18009	return
18010}
18011
18012// StartChaosPreparer prepares the StartChaos request.
18013func (client BaseClient) StartChaosPreparer(ctx context.Context, chaosParameters ChaosParameters, timeout *int64) (*http.Request, error) {
18014	const APIVersion = "6.0"
18015	queryParameters := map[string]interface{}{
18016		"api-version": APIVersion,
18017	}
18018	if timeout != nil {
18019		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18020	} else {
18021		queryParameters["timeout"] = autorest.Encode("query", 60)
18022	}
18023
18024	preparer := autorest.CreatePreparer(
18025		autorest.AsContentType("application/json; charset=utf-8"),
18026		autorest.AsPost(),
18027		autorest.WithBaseURL(client.BaseURI),
18028		autorest.WithPath("/Tools/Chaos/$/Start"),
18029		autorest.WithJSON(chaosParameters),
18030		autorest.WithQueryParameters(queryParameters))
18031	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18032}
18033
18034// StartChaosSender sends the StartChaos request. The method will close the
18035// http.Response Body if it receives an error.
18036func (client BaseClient) StartChaosSender(req *http.Request) (*http.Response, error) {
18037	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18038}
18039
18040// StartChaosResponder handles the response to the StartChaos request. The method always
18041// closes the http.Response Body.
18042func (client BaseClient) StartChaosResponder(resp *http.Response) (result autorest.Response, err error) {
18043	err = autorest.Respond(
18044		resp,
18045		azure.WithErrorUnlessStatusCode(http.StatusOK),
18046		autorest.ByClosing())
18047	result.Response = resp
18048	return
18049}
18050
18051// StartClusterConfigurationUpgrade validate the supplied configuration upgrade parameters and start upgrading the
18052// cluster configuration if the parameters are valid.
18053// Parameters:
18054// clusterConfigurationUpgradeDescription - parameters for a standalone cluster configuration upgrade.
18055// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18056// duration that the client is willing to wait for the requested operation to complete. The default value for
18057// this parameter is 60 seconds.
18058func (client BaseClient) StartClusterConfigurationUpgrade(ctx context.Context, clusterConfigurationUpgradeDescription ClusterConfigurationUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
18059	if tracing.IsEnabled() {
18060		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartClusterConfigurationUpgrade")
18061		defer func() {
18062			sc := -1
18063			if result.Response != nil {
18064				sc = result.Response.StatusCode
18065			}
18066			tracing.EndSpan(ctx, sc, err)
18067		}()
18068	}
18069	if err := validation.Validate([]validation.Validation{
18070		{TargetValue: clusterConfigurationUpgradeDescription,
18071			Constraints: []validation.Constraint{{Target: "clusterConfigurationUpgradeDescription.ClusterConfig", Name: validation.Null, Rule: true, Chain: nil}}},
18072		{TargetValue: timeout,
18073			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18074				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18075					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18076				}}}}}); err != nil {
18077		return result, validation.NewError("servicefabric.BaseClient", "StartClusterConfigurationUpgrade", err.Error())
18078	}
18079
18080	req, err := client.StartClusterConfigurationUpgradePreparer(ctx, clusterConfigurationUpgradeDescription, timeout)
18081	if err != nil {
18082		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", nil, "Failure preparing request")
18083		return
18084	}
18085
18086	resp, err := client.StartClusterConfigurationUpgradeSender(req)
18087	if err != nil {
18088		result.Response = resp
18089		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", resp, "Failure sending request")
18090		return
18091	}
18092
18093	result, err = client.StartClusterConfigurationUpgradeResponder(resp)
18094	if err != nil {
18095		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", resp, "Failure responding to request")
18096		return
18097	}
18098
18099	return
18100}
18101
18102// StartClusterConfigurationUpgradePreparer prepares the StartClusterConfigurationUpgrade request.
18103func (client BaseClient) StartClusterConfigurationUpgradePreparer(ctx context.Context, clusterConfigurationUpgradeDescription ClusterConfigurationUpgradeDescription, timeout *int64) (*http.Request, error) {
18104	const APIVersion = "6.0"
18105	queryParameters := map[string]interface{}{
18106		"api-version": APIVersion,
18107	}
18108	if timeout != nil {
18109		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18110	} else {
18111		queryParameters["timeout"] = autorest.Encode("query", 60)
18112	}
18113
18114	preparer := autorest.CreatePreparer(
18115		autorest.AsContentType("application/json; charset=utf-8"),
18116		autorest.AsPost(),
18117		autorest.WithBaseURL(client.BaseURI),
18118		autorest.WithPath("/$/StartClusterConfigurationUpgrade"),
18119		autorest.WithJSON(clusterConfigurationUpgradeDescription),
18120		autorest.WithQueryParameters(queryParameters))
18121	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18122}
18123
18124// StartClusterConfigurationUpgradeSender sends the StartClusterConfigurationUpgrade request. The method will close the
18125// http.Response Body if it receives an error.
18126func (client BaseClient) StartClusterConfigurationUpgradeSender(req *http.Request) (*http.Response, error) {
18127	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18128}
18129
18130// StartClusterConfigurationUpgradeResponder handles the response to the StartClusterConfigurationUpgrade request. The method always
18131// closes the http.Response Body.
18132func (client BaseClient) StartClusterConfigurationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
18133	err = autorest.Respond(
18134		resp,
18135		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18136		autorest.ByClosing())
18137	result.Response = resp
18138	return
18139}
18140
18141// StartClusterUpgrade validate the supplied upgrade parameters and start upgrading the code or configuration version
18142// of a Service Fabric cluster if the parameters are valid.
18143// Parameters:
18144// startClusterUpgradeDescription - describes the parameters for starting a cluster upgrade.
18145// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18146// duration that the client is willing to wait for the requested operation to complete. The default value for
18147// this parameter is 60 seconds.
18148func (client BaseClient) StartClusterUpgrade(ctx context.Context, startClusterUpgradeDescription StartClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
18149	if tracing.IsEnabled() {
18150		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartClusterUpgrade")
18151		defer func() {
18152			sc := -1
18153			if result.Response != nil {
18154				sc = result.Response.StatusCode
18155			}
18156			tracing.EndSpan(ctx, sc, err)
18157		}()
18158	}
18159	if err := validation.Validate([]validation.Validation{
18160		{TargetValue: startClusterUpgradeDescription,
18161			Constraints: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false,
18162				Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false,
18163					Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
18164						{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
18165					}},
18166					{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false,
18167						Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
18168							{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
18169						}},
18170				}}}},
18171		{TargetValue: timeout,
18172			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18173				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18174					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18175				}}}}}); err != nil {
18176		return result, validation.NewError("servicefabric.BaseClient", "StartClusterUpgrade", err.Error())
18177	}
18178
18179	req, err := client.StartClusterUpgradePreparer(ctx, startClusterUpgradeDescription, timeout)
18180	if err != nil {
18181		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", nil, "Failure preparing request")
18182		return
18183	}
18184
18185	resp, err := client.StartClusterUpgradeSender(req)
18186	if err != nil {
18187		result.Response = resp
18188		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", resp, "Failure sending request")
18189		return
18190	}
18191
18192	result, err = client.StartClusterUpgradeResponder(resp)
18193	if err != nil {
18194		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", resp, "Failure responding to request")
18195		return
18196	}
18197
18198	return
18199}
18200
18201// StartClusterUpgradePreparer prepares the StartClusterUpgrade request.
18202func (client BaseClient) StartClusterUpgradePreparer(ctx context.Context, startClusterUpgradeDescription StartClusterUpgradeDescription, timeout *int64) (*http.Request, error) {
18203	const APIVersion = "6.0"
18204	queryParameters := map[string]interface{}{
18205		"api-version": APIVersion,
18206	}
18207	if timeout != nil {
18208		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18209	} else {
18210		queryParameters["timeout"] = autorest.Encode("query", 60)
18211	}
18212
18213	preparer := autorest.CreatePreparer(
18214		autorest.AsContentType("application/json; charset=utf-8"),
18215		autorest.AsPost(),
18216		autorest.WithBaseURL(client.BaseURI),
18217		autorest.WithPath("/$/Upgrade"),
18218		autorest.WithJSON(startClusterUpgradeDescription),
18219		autorest.WithQueryParameters(queryParameters))
18220	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18221}
18222
18223// StartClusterUpgradeSender sends the StartClusterUpgrade request. The method will close the
18224// http.Response Body if it receives an error.
18225func (client BaseClient) StartClusterUpgradeSender(req *http.Request) (*http.Response, error) {
18226	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18227}
18228
18229// StartClusterUpgradeResponder handles the response to the StartClusterUpgrade request. The method always
18230// closes the http.Response Body.
18231func (client BaseClient) StartClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
18232	err = autorest.Respond(
18233		resp,
18234		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18235		autorest.ByClosing())
18236	result.Response = resp
18237	return
18238}
18239
18240// StartComposeDeploymentUpgrade validates the supplied upgrade parameters and starts upgrading the deployment if the
18241// parameters are valid.
18242// Parameters:
18243// deploymentName - the identity of the deployment.
18244// composeDeploymentUpgradeDescription - parameters for upgrading compose deployment.
18245// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18246// duration that the client is willing to wait for the requested operation to complete. The default value for
18247// this parameter is 60 seconds.
18248func (client BaseClient) StartComposeDeploymentUpgrade(ctx context.Context, deploymentName string, composeDeploymentUpgradeDescription ComposeDeploymentUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
18249	if tracing.IsEnabled() {
18250		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartComposeDeploymentUpgrade")
18251		defer func() {
18252			sc := -1
18253			if result.Response != nil {
18254				sc = result.Response.StatusCode
18255			}
18256			tracing.EndSpan(ctx, sc, err)
18257		}()
18258	}
18259	if err := validation.Validate([]validation.Validation{
18260		{TargetValue: composeDeploymentUpgradeDescription,
18261			Constraints: []validation.Constraint{{Target: "composeDeploymentUpgradeDescription.DeploymentName", Name: validation.Null, Rule: true, Chain: nil},
18262				{Target: "composeDeploymentUpgradeDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}},
18263		{TargetValue: timeout,
18264			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18265				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18266					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18267				}}}}}); err != nil {
18268		return result, validation.NewError("servicefabric.BaseClient", "StartComposeDeploymentUpgrade", err.Error())
18269	}
18270
18271	req, err := client.StartComposeDeploymentUpgradePreparer(ctx, deploymentName, composeDeploymentUpgradeDescription, timeout)
18272	if err != nil {
18273		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", nil, "Failure preparing request")
18274		return
18275	}
18276
18277	resp, err := client.StartComposeDeploymentUpgradeSender(req)
18278	if err != nil {
18279		result.Response = resp
18280		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", resp, "Failure sending request")
18281		return
18282	}
18283
18284	result, err = client.StartComposeDeploymentUpgradeResponder(resp)
18285	if err != nil {
18286		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", resp, "Failure responding to request")
18287		return
18288	}
18289
18290	return
18291}
18292
18293// StartComposeDeploymentUpgradePreparer prepares the StartComposeDeploymentUpgrade request.
18294func (client BaseClient) StartComposeDeploymentUpgradePreparer(ctx context.Context, deploymentName string, composeDeploymentUpgradeDescription ComposeDeploymentUpgradeDescription, timeout *int64) (*http.Request, error) {
18295	pathParameters := map[string]interface{}{
18296		"deploymentName": deploymentName,
18297	}
18298
18299	const APIVersion = "6.0-preview"
18300	queryParameters := map[string]interface{}{
18301		"api-version": APIVersion,
18302	}
18303	if timeout != nil {
18304		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18305	} else {
18306		queryParameters["timeout"] = autorest.Encode("query", 60)
18307	}
18308
18309	preparer := autorest.CreatePreparer(
18310		autorest.AsContentType("application/json; charset=utf-8"),
18311		autorest.AsPost(),
18312		autorest.WithBaseURL(client.BaseURI),
18313		autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/Upgrade", pathParameters),
18314		autorest.WithJSON(composeDeploymentUpgradeDescription),
18315		autorest.WithQueryParameters(queryParameters))
18316	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18317}
18318
18319// StartComposeDeploymentUpgradeSender sends the StartComposeDeploymentUpgrade request. The method will close the
18320// http.Response Body if it receives an error.
18321func (client BaseClient) StartComposeDeploymentUpgradeSender(req *http.Request) (*http.Response, error) {
18322	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18323}
18324
18325// StartComposeDeploymentUpgradeResponder handles the response to the StartComposeDeploymentUpgrade request. The method always
18326// closes the http.Response Body.
18327func (client BaseClient) StartComposeDeploymentUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
18328	err = autorest.Respond(
18329		resp,
18330		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18331		autorest.ByClosing())
18332	result.Response = resp
18333	return
18334}
18335
18336// StartDataLoss this API will induce data loss for the specified partition. It will trigger a call to the OnDataLoss
18337// API of the partition.
18338// Actual data loss will depend on the specified DataLossMode
18339// PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is triggered for the partition but actual
18340// data loss depends on the presence of in-flight replication.
18341// FullDataLoss - All replicas are removed hence all data is lost and OnDataLoss is triggered.
18342//
18343// This API should only be called with a stateful service as the target.
18344//
18345// Calling this API with a system service as the target is not advised.
18346//
18347// Note:  Once this API has been called, it cannot be reversed. Calling CancelOperation will only stop execution and
18348// clean up internal system state.
18349// It will not restore data if the command has progressed far enough to cause data loss.
18350//
18351// Call the GetDataLossProgress API with the same OperationId to return information on the operation started with this
18352// API.
18353// Parameters:
18354// serviceID - the identity of the service. This is typically the full name of the service without the
18355// 'fabric:' URI scheme.
18356// Starting from version 6.0, hierarchical names are delimited with the "~" character.
18357// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
18358// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
18359// partitionID - the identity of the partition.
18360// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
18361// API
18362// dataLossMode - this enum is passed to the StartDataLoss API to indicate what type of data loss to induce.
18363// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18364// duration that the client is willing to wait for the requested operation to complete. The default value for
18365// this parameter is 60 seconds.
18366func (client BaseClient) StartDataLoss(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, dataLossMode DataLossMode, timeout *int64) (result autorest.Response, err error) {
18367	if tracing.IsEnabled() {
18368		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartDataLoss")
18369		defer func() {
18370			sc := -1
18371			if result.Response != nil {
18372				sc = result.Response.StatusCode
18373			}
18374			tracing.EndSpan(ctx, sc, err)
18375		}()
18376	}
18377	if err := validation.Validate([]validation.Validation{
18378		{TargetValue: timeout,
18379			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18380				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18381					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18382				}}}}}); err != nil {
18383		return result, validation.NewError("servicefabric.BaseClient", "StartDataLoss", err.Error())
18384	}
18385
18386	req, err := client.StartDataLossPreparer(ctx, serviceID, partitionID, operationID, dataLossMode, timeout)
18387	if err != nil {
18388		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", nil, "Failure preparing request")
18389		return
18390	}
18391
18392	resp, err := client.StartDataLossSender(req)
18393	if err != nil {
18394		result.Response = resp
18395		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", resp, "Failure sending request")
18396		return
18397	}
18398
18399	result, err = client.StartDataLossResponder(resp)
18400	if err != nil {
18401		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", resp, "Failure responding to request")
18402		return
18403	}
18404
18405	return
18406}
18407
18408// StartDataLossPreparer prepares the StartDataLoss request.
18409func (client BaseClient) StartDataLossPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, dataLossMode DataLossMode, timeout *int64) (*http.Request, error) {
18410	pathParameters := map[string]interface{}{
18411		"partitionId": partitionID,
18412		"serviceId":   serviceID,
18413	}
18414
18415	const APIVersion = "6.0"
18416	queryParameters := map[string]interface{}{
18417		"api-version":  APIVersion,
18418		"DataLossMode": autorest.Encode("query", dataLossMode),
18419		"OperationId":  autorest.Encode("query", operationID),
18420	}
18421	if timeout != nil {
18422		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18423	} else {
18424		queryParameters["timeout"] = autorest.Encode("query", 60)
18425	}
18426
18427	preparer := autorest.CreatePreparer(
18428		autorest.AsPost(),
18429		autorest.WithBaseURL(client.BaseURI),
18430		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartDataLoss", pathParameters),
18431		autorest.WithQueryParameters(queryParameters))
18432	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18433}
18434
18435// StartDataLossSender sends the StartDataLoss request. The method will close the
18436// http.Response Body if it receives an error.
18437func (client BaseClient) StartDataLossSender(req *http.Request) (*http.Response, error) {
18438	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18439}
18440
18441// StartDataLossResponder handles the response to the StartDataLoss request. The method always
18442// closes the http.Response Body.
18443func (client BaseClient) StartDataLossResponder(resp *http.Response) (result autorest.Response, err error) {
18444	err = autorest.Respond(
18445		resp,
18446		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18447		autorest.ByClosing())
18448	result.Response = resp
18449	return
18450}
18451
18452// StartNodeTransition starts or stops a cluster node.  A cluster node is a process, not the OS instance itself.  To
18453// start a node, pass in "Start" for the NodeTransitionType parameter.
18454// To stop a node, pass in "Stop" for the NodeTransitionType parameter.  This API starts the operation - when the API
18455// returns the node may not have finished transitioning yet.
18456// Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation.
18457// Parameters:
18458// nodeName - the name of the node.
18459// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
18460// API
18461// nodeTransitionType - indicates the type of transition to perform.  NodeTransitionType.Start will start a
18462// stopped node.  NodeTransitionType.Stop will stop a node that is up.
18463// nodeInstanceID - the node instance ID of the target node.  This can be determined through GetNodeInfo API.
18464// stopDurationInSeconds - the duration, in seconds, to keep the node stopped.  The minimum value is 600, the
18465// maximum is 14400.  After this time expires, the node will automatically come back up.
18466// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18467// duration that the client is willing to wait for the requested operation to complete. The default value for
18468// this parameter is 60 seconds.
18469func (client BaseClient) StartNodeTransition(ctx context.Context, nodeName string, operationID uuid.UUID, nodeTransitionType NodeTransitionType, nodeInstanceID string, stopDurationInSeconds int32, timeout *int64) (result autorest.Response, err error) {
18470	if tracing.IsEnabled() {
18471		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartNodeTransition")
18472		defer func() {
18473			sc := -1
18474			if result.Response != nil {
18475				sc = result.Response.StatusCode
18476			}
18477			tracing.EndSpan(ctx, sc, err)
18478		}()
18479	}
18480	if err := validation.Validate([]validation.Validation{
18481		{TargetValue: stopDurationInSeconds,
18482			Constraints: []validation.Constraint{{Target: "stopDurationInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}},
18483		{TargetValue: timeout,
18484			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18485				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18486					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18487				}}}}}); err != nil {
18488		return result, validation.NewError("servicefabric.BaseClient", "StartNodeTransition", err.Error())
18489	}
18490
18491	req, err := client.StartNodeTransitionPreparer(ctx, nodeName, operationID, nodeTransitionType, nodeInstanceID, stopDurationInSeconds, timeout)
18492	if err != nil {
18493		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", nil, "Failure preparing request")
18494		return
18495	}
18496
18497	resp, err := client.StartNodeTransitionSender(req)
18498	if err != nil {
18499		result.Response = resp
18500		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", resp, "Failure sending request")
18501		return
18502	}
18503
18504	result, err = client.StartNodeTransitionResponder(resp)
18505	if err != nil {
18506		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", resp, "Failure responding to request")
18507		return
18508	}
18509
18510	return
18511}
18512
18513// StartNodeTransitionPreparer prepares the StartNodeTransition request.
18514func (client BaseClient) StartNodeTransitionPreparer(ctx context.Context, nodeName string, operationID uuid.UUID, nodeTransitionType NodeTransitionType, nodeInstanceID string, stopDurationInSeconds int32, timeout *int64) (*http.Request, error) {
18515	pathParameters := map[string]interface{}{
18516		"nodeName": autorest.Encode("path", nodeName),
18517	}
18518
18519	const APIVersion = "6.0"
18520	queryParameters := map[string]interface{}{
18521		"api-version":           APIVersion,
18522		"NodeInstanceId":        autorest.Encode("query", nodeInstanceID),
18523		"NodeTransitionType":    autorest.Encode("query", nodeTransitionType),
18524		"OperationId":           autorest.Encode("query", operationID),
18525		"StopDurationInSeconds": autorest.Encode("query", stopDurationInSeconds),
18526	}
18527	if timeout != nil {
18528		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18529	} else {
18530		queryParameters["timeout"] = autorest.Encode("query", 60)
18531	}
18532
18533	preparer := autorest.CreatePreparer(
18534		autorest.AsPost(),
18535		autorest.WithBaseURL(client.BaseURI),
18536		autorest.WithPathParameters("/Faults/Nodes/{nodeName}/$/StartTransition/", pathParameters),
18537		autorest.WithQueryParameters(queryParameters))
18538	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18539}
18540
18541// StartNodeTransitionSender sends the StartNodeTransition request. The method will close the
18542// http.Response Body if it receives an error.
18543func (client BaseClient) StartNodeTransitionSender(req *http.Request) (*http.Response, error) {
18544	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18545}
18546
18547// StartNodeTransitionResponder handles the response to the StartNodeTransition request. The method always
18548// closes the http.Response Body.
18549func (client BaseClient) StartNodeTransitionResponder(resp *http.Response) (result autorest.Response, err error) {
18550	err = autorest.Respond(
18551		resp,
18552		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18553		autorest.ByClosing())
18554	result.Response = resp
18555	return
18556}
18557
18558// StartPartitionRestart this API is useful for testing failover.
18559//
18560// If used to target a stateless service partition, RestartPartitionMode must be AllReplicasOrInstances.
18561//
18562// Call the GetPartitionRestartProgress API using the same OperationId to get the progress.
18563// Parameters:
18564// serviceID - the identity of the service. This is typically the full name of the service without the
18565// 'fabric:' URI scheme.
18566// Starting from version 6.0, hierarchical names are delimited with the "~" character.
18567// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
18568// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
18569// partitionID - the identity of the partition.
18570// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
18571// API
18572// restartPartitionMode - describe which partitions to restart.
18573// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18574// duration that the client is willing to wait for the requested operation to complete. The default value for
18575// this parameter is 60 seconds.
18576func (client BaseClient) StartPartitionRestart(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, restartPartitionMode RestartPartitionMode, timeout *int64) (result autorest.Response, err error) {
18577	if tracing.IsEnabled() {
18578		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartPartitionRestart")
18579		defer func() {
18580			sc := -1
18581			if result.Response != nil {
18582				sc = result.Response.StatusCode
18583			}
18584			tracing.EndSpan(ctx, sc, err)
18585		}()
18586	}
18587	if err := validation.Validate([]validation.Validation{
18588		{TargetValue: timeout,
18589			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18590				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18591					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18592				}}}}}); err != nil {
18593		return result, validation.NewError("servicefabric.BaseClient", "StartPartitionRestart", err.Error())
18594	}
18595
18596	req, err := client.StartPartitionRestartPreparer(ctx, serviceID, partitionID, operationID, restartPartitionMode, timeout)
18597	if err != nil {
18598		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", nil, "Failure preparing request")
18599		return
18600	}
18601
18602	resp, err := client.StartPartitionRestartSender(req)
18603	if err != nil {
18604		result.Response = resp
18605		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", resp, "Failure sending request")
18606		return
18607	}
18608
18609	result, err = client.StartPartitionRestartResponder(resp)
18610	if err != nil {
18611		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", resp, "Failure responding to request")
18612		return
18613	}
18614
18615	return
18616}
18617
18618// StartPartitionRestartPreparer prepares the StartPartitionRestart request.
18619func (client BaseClient) StartPartitionRestartPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, restartPartitionMode RestartPartitionMode, timeout *int64) (*http.Request, error) {
18620	pathParameters := map[string]interface{}{
18621		"partitionId": partitionID,
18622		"serviceId":   serviceID,
18623	}
18624
18625	const APIVersion = "6.0"
18626	queryParameters := map[string]interface{}{
18627		"api-version":          APIVersion,
18628		"OperationId":          autorest.Encode("query", operationID),
18629		"RestartPartitionMode": autorest.Encode("query", restartPartitionMode),
18630	}
18631	if timeout != nil {
18632		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18633	} else {
18634		queryParameters["timeout"] = autorest.Encode("query", 60)
18635	}
18636
18637	preparer := autorest.CreatePreparer(
18638		autorest.AsPost(),
18639		autorest.WithBaseURL(client.BaseURI),
18640		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartRestart", pathParameters),
18641		autorest.WithQueryParameters(queryParameters))
18642	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18643}
18644
18645// StartPartitionRestartSender sends the StartPartitionRestart request. The method will close the
18646// http.Response Body if it receives an error.
18647func (client BaseClient) StartPartitionRestartSender(req *http.Request) (*http.Response, error) {
18648	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18649}
18650
18651// StartPartitionRestartResponder handles the response to the StartPartitionRestart request. The method always
18652// closes the http.Response Body.
18653func (client BaseClient) StartPartitionRestartResponder(resp *http.Response) (result autorest.Response, err error) {
18654	err = autorest.Respond(
18655		resp,
18656		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18657		autorest.ByClosing())
18658	result.Response = resp
18659	return
18660}
18661
18662// StartQuorumLoss induces quorum loss for a given stateful service partition.  This API is useful for a temporary
18663// quorum loss situation on your service.
18664//
18665// Call the GetQuorumLossProgress API with the same OperationId to return information on the operation started with
18666// this API.
18667//
18668// This can only be called on stateful persisted (HasPersistedState==true) services.  Do not use this API on stateless
18669// services or stateful in-memory only services.
18670// Parameters:
18671// serviceID - the identity of the service. This is typically the full name of the service without the
18672// 'fabric:' URI scheme.
18673// Starting from version 6.0, hierarchical names are delimited with the "~" character.
18674// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
18675// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
18676// partitionID - the identity of the partition.
18677// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
18678// API
18679// quorumLossMode - this enum is passed to the StartQuorumLoss API to indicate what type of quorum loss to
18680// induce.
18681// quorumLossDuration - the amount of time for which the partition will be kept in quorum loss.  This must be
18682// specified in seconds.
18683// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18684// duration that the client is willing to wait for the requested operation to complete. The default value for
18685// this parameter is 60 seconds.
18686func (client BaseClient) StartQuorumLoss(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, quorumLossMode QuorumLossMode, quorumLossDuration int32, timeout *int64) (result autorest.Response, err error) {
18687	if tracing.IsEnabled() {
18688		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartQuorumLoss")
18689		defer func() {
18690			sc := -1
18691			if result.Response != nil {
18692				sc = result.Response.StatusCode
18693			}
18694			tracing.EndSpan(ctx, sc, err)
18695		}()
18696	}
18697	if err := validation.Validate([]validation.Validation{
18698		{TargetValue: timeout,
18699			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18700				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18701					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18702				}}}}}); err != nil {
18703		return result, validation.NewError("servicefabric.BaseClient", "StartQuorumLoss", err.Error())
18704	}
18705
18706	req, err := client.StartQuorumLossPreparer(ctx, serviceID, partitionID, operationID, quorumLossMode, quorumLossDuration, timeout)
18707	if err != nil {
18708		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", nil, "Failure preparing request")
18709		return
18710	}
18711
18712	resp, err := client.StartQuorumLossSender(req)
18713	if err != nil {
18714		result.Response = resp
18715		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", resp, "Failure sending request")
18716		return
18717	}
18718
18719	result, err = client.StartQuorumLossResponder(resp)
18720	if err != nil {
18721		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", resp, "Failure responding to request")
18722		return
18723	}
18724
18725	return
18726}
18727
18728// StartQuorumLossPreparer prepares the StartQuorumLoss request.
18729func (client BaseClient) StartQuorumLossPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, quorumLossMode QuorumLossMode, quorumLossDuration int32, timeout *int64) (*http.Request, error) {
18730	pathParameters := map[string]interface{}{
18731		"partitionId": partitionID,
18732		"serviceId":   serviceID,
18733	}
18734
18735	const APIVersion = "6.0"
18736	queryParameters := map[string]interface{}{
18737		"api-version":        APIVersion,
18738		"OperationId":        autorest.Encode("query", operationID),
18739		"QuorumLossDuration": autorest.Encode("query", quorumLossDuration),
18740		"QuorumLossMode":     autorest.Encode("query", quorumLossMode),
18741	}
18742	if timeout != nil {
18743		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18744	} else {
18745		queryParameters["timeout"] = autorest.Encode("query", 60)
18746	}
18747
18748	preparer := autorest.CreatePreparer(
18749		autorest.AsPost(),
18750		autorest.WithBaseURL(client.BaseURI),
18751		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartQuorumLoss", pathParameters),
18752		autorest.WithQueryParameters(queryParameters))
18753	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18754}
18755
18756// StartQuorumLossSender sends the StartQuorumLoss request. The method will close the
18757// http.Response Body if it receives an error.
18758func (client BaseClient) StartQuorumLossSender(req *http.Request) (*http.Response, error) {
18759	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18760}
18761
18762// StartQuorumLossResponder handles the response to the StartQuorumLoss request. The method always
18763// closes the http.Response Body.
18764func (client BaseClient) StartQuorumLossResponder(resp *http.Response) (result autorest.Response, err error) {
18765	err = autorest.Respond(
18766		resp,
18767		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18768		autorest.ByClosing())
18769	result.Response = resp
18770	return
18771}
18772
18773// StopChaos stops Chaos from executing new faults. In-flight faults will continue to execute until they are complete.
18774// The current Chaos Schedule is put into a stopped state.
18775// Once a schedule is stopped it will stay in the stopped state and not be used to Chaos Schedule new runs of Chaos. A
18776// new Chaos Schedule must be set in order to resume scheduling.
18777// Parameters:
18778// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18779// duration that the client is willing to wait for the requested operation to complete. The default value for
18780// this parameter is 60 seconds.
18781func (client BaseClient) StopChaos(ctx context.Context, timeout *int64) (result autorest.Response, err error) {
18782	if tracing.IsEnabled() {
18783		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StopChaos")
18784		defer func() {
18785			sc := -1
18786			if result.Response != nil {
18787				sc = result.Response.StatusCode
18788			}
18789			tracing.EndSpan(ctx, sc, err)
18790		}()
18791	}
18792	if err := validation.Validate([]validation.Validation{
18793		{TargetValue: timeout,
18794			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18795				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18796					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18797				}}}}}); err != nil {
18798		return result, validation.NewError("servicefabric.BaseClient", "StopChaos", err.Error())
18799	}
18800
18801	req, err := client.StopChaosPreparer(ctx, timeout)
18802	if err != nil {
18803		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", nil, "Failure preparing request")
18804		return
18805	}
18806
18807	resp, err := client.StopChaosSender(req)
18808	if err != nil {
18809		result.Response = resp
18810		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", resp, "Failure sending request")
18811		return
18812	}
18813
18814	result, err = client.StopChaosResponder(resp)
18815	if err != nil {
18816		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", resp, "Failure responding to request")
18817		return
18818	}
18819
18820	return
18821}
18822
18823// StopChaosPreparer prepares the StopChaos request.
18824func (client BaseClient) StopChaosPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
18825	const APIVersion = "6.0"
18826	queryParameters := map[string]interface{}{
18827		"api-version": APIVersion,
18828	}
18829	if timeout != nil {
18830		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18831	} else {
18832		queryParameters["timeout"] = autorest.Encode("query", 60)
18833	}
18834
18835	preparer := autorest.CreatePreparer(
18836		autorest.AsPost(),
18837		autorest.WithBaseURL(client.BaseURI),
18838		autorest.WithPath("/Tools/Chaos/$/Stop"),
18839		autorest.WithQueryParameters(queryParameters))
18840	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18841}
18842
18843// StopChaosSender sends the StopChaos request. The method will close the
18844// http.Response Body if it receives an error.
18845func (client BaseClient) StopChaosSender(req *http.Request) (*http.Response, error) {
18846	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18847}
18848
18849// StopChaosResponder handles the response to the StopChaos request. The method always
18850// closes the http.Response Body.
18851func (client BaseClient) StopChaosResponder(resp *http.Response) (result autorest.Response, err error) {
18852	err = autorest.Respond(
18853		resp,
18854		azure.WithErrorUnlessStatusCode(http.StatusOK),
18855		autorest.ByClosing())
18856	result.Response = resp
18857	return
18858}
18859
18860// SubmitPropertyBatch submits a batch of property operations. Either all or none of the operations will be committed.
18861// Parameters:
18862// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
18863// propertyBatchDescriptionList - describes the property batch operations to be submitted.
18864// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18865// duration that the client is willing to wait for the requested operation to complete. The default value for
18866// this parameter is 60 seconds.
18867func (client BaseClient) SubmitPropertyBatch(ctx context.Context, nameID string, propertyBatchDescriptionList PropertyBatchDescriptionList, timeout *int64) (result PropertyBatchInfoModel, err error) {
18868	if tracing.IsEnabled() {
18869		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SubmitPropertyBatch")
18870		defer func() {
18871			sc := -1
18872			if result.Response.Response != nil {
18873				sc = result.Response.Response.StatusCode
18874			}
18875			tracing.EndSpan(ctx, sc, err)
18876		}()
18877	}
18878	if err := validation.Validate([]validation.Validation{
18879		{TargetValue: timeout,
18880			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18881				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18882					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18883				}}}}}); err != nil {
18884		return result, validation.NewError("servicefabric.BaseClient", "SubmitPropertyBatch", err.Error())
18885	}
18886
18887	req, err := client.SubmitPropertyBatchPreparer(ctx, nameID, propertyBatchDescriptionList, timeout)
18888	if err != nil {
18889		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", nil, "Failure preparing request")
18890		return
18891	}
18892
18893	resp, err := client.SubmitPropertyBatchSender(req)
18894	if err != nil {
18895		result.Response = autorest.Response{Response: resp}
18896		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", resp, "Failure sending request")
18897		return
18898	}
18899
18900	result, err = client.SubmitPropertyBatchResponder(resp)
18901	if err != nil {
18902		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", resp, "Failure responding to request")
18903		return
18904	}
18905
18906	return
18907}
18908
18909// SubmitPropertyBatchPreparer prepares the SubmitPropertyBatch request.
18910func (client BaseClient) SubmitPropertyBatchPreparer(ctx context.Context, nameID string, propertyBatchDescriptionList PropertyBatchDescriptionList, timeout *int64) (*http.Request, error) {
18911	pathParameters := map[string]interface{}{
18912		"nameId": nameID,
18913	}
18914
18915	const APIVersion = "6.0"
18916	queryParameters := map[string]interface{}{
18917		"api-version": APIVersion,
18918	}
18919	if timeout != nil {
18920		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18921	} else {
18922		queryParameters["timeout"] = autorest.Encode("query", 60)
18923	}
18924
18925	preparer := autorest.CreatePreparer(
18926		autorest.AsContentType("application/json; charset=utf-8"),
18927		autorest.AsPost(),
18928		autorest.WithBaseURL(client.BaseURI),
18929		autorest.WithPathParameters("/Names/{nameId}/$/GetProperties/$/SubmitBatch", pathParameters),
18930		autorest.WithJSON(propertyBatchDescriptionList),
18931		autorest.WithQueryParameters(queryParameters))
18932	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18933}
18934
18935// SubmitPropertyBatchSender sends the SubmitPropertyBatch request. The method will close the
18936// http.Response Body if it receives an error.
18937func (client BaseClient) SubmitPropertyBatchSender(req *http.Request) (*http.Response, error) {
18938	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18939}
18940
18941// SubmitPropertyBatchResponder handles the response to the SubmitPropertyBatch request. The method always
18942// closes the http.Response Body.
18943func (client BaseClient) SubmitPropertyBatchResponder(resp *http.Response) (result PropertyBatchInfoModel, err error) {
18944	err = autorest.Respond(
18945		resp,
18946		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusConflict),
18947		autorest.ByUnmarshallingJSON(&result),
18948		autorest.ByClosing())
18949	result.Response = autorest.Response{Response: resp}
18950	return
18951}
18952
18953// SuspendApplicationBackup the application which is configured to take periodic backups, is suspended for taking
18954// further backups till it is resumed again. This operation applies to the entire application's hierarchy. It means all
18955// the services and partitions under this application are now suspended for backup.
18956// Parameters:
18957// applicationID - the identity of the application. This is typically the full name of the application without
18958// the 'fabric:' URI scheme.
18959// Starting from version 6.0, hierarchical names are delimited with the "~" character.
18960// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
18961// in 6.0+ and "myapp/app1" in previous versions.
18962// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18963// duration that the client is willing to wait for the requested operation to complete. The default value for
18964// this parameter is 60 seconds.
18965func (client BaseClient) SuspendApplicationBackup(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) {
18966	if tracing.IsEnabled() {
18967		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendApplicationBackup")
18968		defer func() {
18969			sc := -1
18970			if result.Response != nil {
18971				sc = result.Response.StatusCode
18972			}
18973			tracing.EndSpan(ctx, sc, err)
18974		}()
18975	}
18976	if err := validation.Validate([]validation.Validation{
18977		{TargetValue: timeout,
18978			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18979				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18980					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18981				}}}}}); err != nil {
18982		return result, validation.NewError("servicefabric.BaseClient", "SuspendApplicationBackup", err.Error())
18983	}
18984
18985	req, err := client.SuspendApplicationBackupPreparer(ctx, applicationID, timeout)
18986	if err != nil {
18987		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", nil, "Failure preparing request")
18988		return
18989	}
18990
18991	resp, err := client.SuspendApplicationBackupSender(req)
18992	if err != nil {
18993		result.Response = resp
18994		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", resp, "Failure sending request")
18995		return
18996	}
18997
18998	result, err = client.SuspendApplicationBackupResponder(resp)
18999	if err != nil {
19000		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", resp, "Failure responding to request")
19001		return
19002	}
19003
19004	return
19005}
19006
19007// SuspendApplicationBackupPreparer prepares the SuspendApplicationBackup request.
19008func (client BaseClient) SuspendApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
19009	pathParameters := map[string]interface{}{
19010		"applicationId": applicationID,
19011	}
19012
19013	const APIVersion = "6.2-preview"
19014	queryParameters := map[string]interface{}{
19015		"api-version": APIVersion,
19016	}
19017	if timeout != nil {
19018		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19019	} else {
19020		queryParameters["timeout"] = autorest.Encode("query", 60)
19021	}
19022
19023	preparer := autorest.CreatePreparer(
19024		autorest.AsPost(),
19025		autorest.WithBaseURL(client.BaseURI),
19026		autorest.WithPathParameters("/Applications/{applicationId}/$/SuspendBackup", pathParameters),
19027		autorest.WithQueryParameters(queryParameters))
19028	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19029}
19030
19031// SuspendApplicationBackupSender sends the SuspendApplicationBackup request. The method will close the
19032// http.Response Body if it receives an error.
19033func (client BaseClient) SuspendApplicationBackupSender(req *http.Request) (*http.Response, error) {
19034	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19035}
19036
19037// SuspendApplicationBackupResponder handles the response to the SuspendApplicationBackup request. The method always
19038// closes the http.Response Body.
19039func (client BaseClient) SuspendApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) {
19040	err = autorest.Respond(
19041		resp,
19042		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19043		autorest.ByClosing())
19044	result.Response = resp
19045	return
19046}
19047
19048// SuspendPartitionBackup the partition which is configured to take periodic backups, is suspended for taking further
19049// backups till it is resumed again.
19050// Parameters:
19051// partitionID - the identity of the partition.
19052// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19053// duration that the client is willing to wait for the requested operation to complete. The default value for
19054// this parameter is 60 seconds.
19055func (client BaseClient) SuspendPartitionBackup(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
19056	if tracing.IsEnabled() {
19057		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendPartitionBackup")
19058		defer func() {
19059			sc := -1
19060			if result.Response != nil {
19061				sc = result.Response.StatusCode
19062			}
19063			tracing.EndSpan(ctx, sc, err)
19064		}()
19065	}
19066	if err := validation.Validate([]validation.Validation{
19067		{TargetValue: timeout,
19068			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19069				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19070					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19071				}}}}}); err != nil {
19072		return result, validation.NewError("servicefabric.BaseClient", "SuspendPartitionBackup", err.Error())
19073	}
19074
19075	req, err := client.SuspendPartitionBackupPreparer(ctx, partitionID, timeout)
19076	if err != nil {
19077		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", nil, "Failure preparing request")
19078		return
19079	}
19080
19081	resp, err := client.SuspendPartitionBackupSender(req)
19082	if err != nil {
19083		result.Response = resp
19084		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", resp, "Failure sending request")
19085		return
19086	}
19087
19088	result, err = client.SuspendPartitionBackupResponder(resp)
19089	if err != nil {
19090		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", resp, "Failure responding to request")
19091		return
19092	}
19093
19094	return
19095}
19096
19097// SuspendPartitionBackupPreparer prepares the SuspendPartitionBackup request.
19098func (client BaseClient) SuspendPartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
19099	pathParameters := map[string]interface{}{
19100		"partitionId": partitionID,
19101	}
19102
19103	const APIVersion = "6.2-preview"
19104	queryParameters := map[string]interface{}{
19105		"api-version": APIVersion,
19106	}
19107	if timeout != nil {
19108		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19109	} else {
19110		queryParameters["timeout"] = autorest.Encode("query", 60)
19111	}
19112
19113	preparer := autorest.CreatePreparer(
19114		autorest.AsPost(),
19115		autorest.WithBaseURL(client.BaseURI),
19116		autorest.WithPathParameters("/Partitions/{partitionId}/$/SuspendBackup", pathParameters),
19117		autorest.WithQueryParameters(queryParameters))
19118	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19119}
19120
19121// SuspendPartitionBackupSender sends the SuspendPartitionBackup request. The method will close the
19122// http.Response Body if it receives an error.
19123func (client BaseClient) SuspendPartitionBackupSender(req *http.Request) (*http.Response, error) {
19124	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19125}
19126
19127// SuspendPartitionBackupResponder handles the response to the SuspendPartitionBackup request. The method always
19128// closes the http.Response Body.
19129func (client BaseClient) SuspendPartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) {
19130	err = autorest.Respond(
19131		resp,
19132		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19133		autorest.ByClosing())
19134	result.Response = resp
19135	return
19136}
19137
19138// SuspendServiceBackup the service which is configured to take periodic backups, is suspended for taking further
19139// backups till it is resumed again. This operation applies to the entire service's hierarchy. It means all the
19140// partitions under this service are now suspended for backup.
19141// Parameters:
19142// serviceID - the identity of the service. This is typically the full name of the service without the
19143// 'fabric:' URI scheme.
19144// Starting from version 6.0, hierarchical names are delimited with the "~" character.
19145// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
19146// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
19147// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19148// duration that the client is willing to wait for the requested operation to complete. The default value for
19149// this parameter is 60 seconds.
19150func (client BaseClient) SuspendServiceBackup(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) {
19151	if tracing.IsEnabled() {
19152		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendServiceBackup")
19153		defer func() {
19154			sc := -1
19155			if result.Response != nil {
19156				sc = result.Response.StatusCode
19157			}
19158			tracing.EndSpan(ctx, sc, err)
19159		}()
19160	}
19161	if err := validation.Validate([]validation.Validation{
19162		{TargetValue: timeout,
19163			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19164				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19165					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19166				}}}}}); err != nil {
19167		return result, validation.NewError("servicefabric.BaseClient", "SuspendServiceBackup", err.Error())
19168	}
19169
19170	req, err := client.SuspendServiceBackupPreparer(ctx, serviceID, timeout)
19171	if err != nil {
19172		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", nil, "Failure preparing request")
19173		return
19174	}
19175
19176	resp, err := client.SuspendServiceBackupSender(req)
19177	if err != nil {
19178		result.Response = resp
19179		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", resp, "Failure sending request")
19180		return
19181	}
19182
19183	result, err = client.SuspendServiceBackupResponder(resp)
19184	if err != nil {
19185		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", resp, "Failure responding to request")
19186		return
19187	}
19188
19189	return
19190}
19191
19192// SuspendServiceBackupPreparer prepares the SuspendServiceBackup request.
19193func (client BaseClient) SuspendServiceBackupPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
19194	pathParameters := map[string]interface{}{
19195		"serviceId": serviceID,
19196	}
19197
19198	const APIVersion = "6.2-preview"
19199	queryParameters := map[string]interface{}{
19200		"api-version": APIVersion,
19201	}
19202	if timeout != nil {
19203		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19204	} else {
19205		queryParameters["timeout"] = autorest.Encode("query", 60)
19206	}
19207
19208	preparer := autorest.CreatePreparer(
19209		autorest.AsPost(),
19210		autorest.WithBaseURL(client.BaseURI),
19211		autorest.WithPathParameters("/Services/{serviceId}/$/SuspendBackup", pathParameters),
19212		autorest.WithQueryParameters(queryParameters))
19213	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19214}
19215
19216// SuspendServiceBackupSender sends the SuspendServiceBackup request. The method will close the
19217// http.Response Body if it receives an error.
19218func (client BaseClient) SuspendServiceBackupSender(req *http.Request) (*http.Response, error) {
19219	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19220}
19221
19222// SuspendServiceBackupResponder handles the response to the SuspendServiceBackup request. The method always
19223// closes the http.Response Body.
19224func (client BaseClient) SuspendServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) {
19225	err = autorest.Respond(
19226		resp,
19227		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19228		autorest.ByClosing())
19229	result.Response = resp
19230	return
19231}
19232
19233// UnprovisionApplicationType removes or unregisters a Service Fabric application type from the cluster. This operation
19234// can only be performed if all application instances of the application type has been deleted. Once the application
19235// type is unregistered, no new application instances can be created for this particular application type.
19236// Parameters:
19237// applicationTypeName - the name of the application type.
19238// unprovisionApplicationTypeDescriptionInfo - the relative path for the application package in the image store
19239// specified during the prior copy operation.
19240// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19241// duration that the client is willing to wait for the requested operation to complete. The default value for
19242// this parameter is 60 seconds.
19243func (client BaseClient) UnprovisionApplicationType(ctx context.Context, applicationTypeName string, unprovisionApplicationTypeDescriptionInfo UnprovisionApplicationTypeDescriptionInfo, timeout *int64) (result autorest.Response, err error) {
19244	if tracing.IsEnabled() {
19245		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UnprovisionApplicationType")
19246		defer func() {
19247			sc := -1
19248			if result.Response != nil {
19249				sc = result.Response.StatusCode
19250			}
19251			tracing.EndSpan(ctx, sc, err)
19252		}()
19253	}
19254	if err := validation.Validate([]validation.Validation{
19255		{TargetValue: unprovisionApplicationTypeDescriptionInfo,
19256			Constraints: []validation.Constraint{{Target: "unprovisionApplicationTypeDescriptionInfo.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}}},
19257		{TargetValue: timeout,
19258			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19259				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19260					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19261				}}}}}); err != nil {
19262		return result, validation.NewError("servicefabric.BaseClient", "UnprovisionApplicationType", err.Error())
19263	}
19264
19265	req, err := client.UnprovisionApplicationTypePreparer(ctx, applicationTypeName, unprovisionApplicationTypeDescriptionInfo, timeout)
19266	if err != nil {
19267		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", nil, "Failure preparing request")
19268		return
19269	}
19270
19271	resp, err := client.UnprovisionApplicationTypeSender(req)
19272	if err != nil {
19273		result.Response = resp
19274		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", resp, "Failure sending request")
19275		return
19276	}
19277
19278	result, err = client.UnprovisionApplicationTypeResponder(resp)
19279	if err != nil {
19280		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", resp, "Failure responding to request")
19281		return
19282	}
19283
19284	return
19285}
19286
19287// UnprovisionApplicationTypePreparer prepares the UnprovisionApplicationType request.
19288func (client BaseClient) UnprovisionApplicationTypePreparer(ctx context.Context, applicationTypeName string, unprovisionApplicationTypeDescriptionInfo UnprovisionApplicationTypeDescriptionInfo, timeout *int64) (*http.Request, error) {
19289	pathParameters := map[string]interface{}{
19290		"applicationTypeName": autorest.Encode("path", applicationTypeName),
19291	}
19292
19293	const APIVersion = "6.0"
19294	queryParameters := map[string]interface{}{
19295		"api-version": APIVersion,
19296	}
19297	if timeout != nil {
19298		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19299	} else {
19300		queryParameters["timeout"] = autorest.Encode("query", 60)
19301	}
19302
19303	preparer := autorest.CreatePreparer(
19304		autorest.AsContentType("application/json; charset=utf-8"),
19305		autorest.AsPost(),
19306		autorest.WithBaseURL(client.BaseURI),
19307		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/Unprovision", pathParameters),
19308		autorest.WithJSON(unprovisionApplicationTypeDescriptionInfo),
19309		autorest.WithQueryParameters(queryParameters))
19310	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19311}
19312
19313// UnprovisionApplicationTypeSender sends the UnprovisionApplicationType request. The method will close the
19314// http.Response Body if it receives an error.
19315func (client BaseClient) UnprovisionApplicationTypeSender(req *http.Request) (*http.Response, error) {
19316	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19317}
19318
19319// UnprovisionApplicationTypeResponder handles the response to the UnprovisionApplicationType request. The method always
19320// closes the http.Response Body.
19321func (client BaseClient) UnprovisionApplicationTypeResponder(resp *http.Response) (result autorest.Response, err error) {
19322	err = autorest.Respond(
19323		resp,
19324		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19325		autorest.ByClosing())
19326	result.Response = resp
19327	return
19328}
19329
19330// UnprovisionCluster unprovision the code or configuration packages of a Service Fabric cluster. It is supported to
19331// unprovision code and configuration separately.
19332// Parameters:
19333// unprovisionFabricDescription - describes the parameters for unprovisioning a cluster.
19334// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19335// duration that the client is willing to wait for the requested operation to complete. The default value for
19336// this parameter is 60 seconds.
19337func (client BaseClient) UnprovisionCluster(ctx context.Context, unprovisionFabricDescription UnprovisionFabricDescription, timeout *int64) (result autorest.Response, err error) {
19338	if tracing.IsEnabled() {
19339		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UnprovisionCluster")
19340		defer func() {
19341			sc := -1
19342			if result.Response != nil {
19343				sc = result.Response.StatusCode
19344			}
19345			tracing.EndSpan(ctx, sc, err)
19346		}()
19347	}
19348	if err := validation.Validate([]validation.Validation{
19349		{TargetValue: timeout,
19350			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19351				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19352					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19353				}}}}}); err != nil {
19354		return result, validation.NewError("servicefabric.BaseClient", "UnprovisionCluster", err.Error())
19355	}
19356
19357	req, err := client.UnprovisionClusterPreparer(ctx, unprovisionFabricDescription, timeout)
19358	if err != nil {
19359		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", nil, "Failure preparing request")
19360		return
19361	}
19362
19363	resp, err := client.UnprovisionClusterSender(req)
19364	if err != nil {
19365		result.Response = resp
19366		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", resp, "Failure sending request")
19367		return
19368	}
19369
19370	result, err = client.UnprovisionClusterResponder(resp)
19371	if err != nil {
19372		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", resp, "Failure responding to request")
19373		return
19374	}
19375
19376	return
19377}
19378
19379// UnprovisionClusterPreparer prepares the UnprovisionCluster request.
19380func (client BaseClient) UnprovisionClusterPreparer(ctx context.Context, unprovisionFabricDescription UnprovisionFabricDescription, timeout *int64) (*http.Request, error) {
19381	const APIVersion = "6.0"
19382	queryParameters := map[string]interface{}{
19383		"api-version": APIVersion,
19384	}
19385	if timeout != nil {
19386		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19387	} else {
19388		queryParameters["timeout"] = autorest.Encode("query", 60)
19389	}
19390
19391	preparer := autorest.CreatePreparer(
19392		autorest.AsContentType("application/json; charset=utf-8"),
19393		autorest.AsPost(),
19394		autorest.WithBaseURL(client.BaseURI),
19395		autorest.WithPath("/$/Unprovision"),
19396		autorest.WithJSON(unprovisionFabricDescription),
19397		autorest.WithQueryParameters(queryParameters))
19398	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19399}
19400
19401// UnprovisionClusterSender sends the UnprovisionCluster request. The method will close the
19402// http.Response Body if it receives an error.
19403func (client BaseClient) UnprovisionClusterSender(req *http.Request) (*http.Response, error) {
19404	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19405}
19406
19407// UnprovisionClusterResponder handles the response to the UnprovisionCluster request. The method always
19408// closes the http.Response Body.
19409func (client BaseClient) UnprovisionClusterResponder(resp *http.Response) (result autorest.Response, err error) {
19410	err = autorest.Respond(
19411		resp,
19412		azure.WithErrorUnlessStatusCode(http.StatusOK),
19413		autorest.ByClosing())
19414	result.Response = resp
19415	return
19416}
19417
19418// UpdateApplicationUpgrade updates the parameters of an ongoing application upgrade from the ones specified at the
19419// time of starting the application upgrade. This may be required to mitigate stuck application upgrades due to
19420// incorrect parameters or issues in the application to make progress.
19421// Parameters:
19422// applicationID - the identity of the application. This is typically the full name of the application without
19423// the 'fabric:' URI scheme.
19424// Starting from version 6.0, hierarchical names are delimited with the "~" character.
19425// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
19426// in 6.0+ and "myapp/app1" in previous versions.
19427// applicationUpgradeUpdateDescription - parameters for updating an existing application upgrade.
19428// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19429// duration that the client is willing to wait for the requested operation to complete. The default value for
19430// this parameter is 60 seconds.
19431func (client BaseClient) UpdateApplicationUpgrade(ctx context.Context, applicationID string, applicationUpgradeUpdateDescription ApplicationUpgradeUpdateDescription, timeout *int64) (result autorest.Response, err error) {
19432	if tracing.IsEnabled() {
19433		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateApplicationUpgrade")
19434		defer func() {
19435			sc := -1
19436			if result.Response != nil {
19437				sc = result.Response.StatusCode
19438			}
19439			tracing.EndSpan(ctx, sc, err)
19440		}()
19441	}
19442	if err := validation.Validate([]validation.Validation{
19443		{TargetValue: applicationUpgradeUpdateDescription,
19444			Constraints: []validation.Constraint{{Target: "applicationUpgradeUpdateDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}},
19445		{TargetValue: timeout,
19446			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19447				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19448					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19449				}}}}}); err != nil {
19450		return result, validation.NewError("servicefabric.BaseClient", "UpdateApplicationUpgrade", err.Error())
19451	}
19452
19453	req, err := client.UpdateApplicationUpgradePreparer(ctx, applicationID, applicationUpgradeUpdateDescription, timeout)
19454	if err != nil {
19455		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", nil, "Failure preparing request")
19456		return
19457	}
19458
19459	resp, err := client.UpdateApplicationUpgradeSender(req)
19460	if err != nil {
19461		result.Response = resp
19462		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", resp, "Failure sending request")
19463		return
19464	}
19465
19466	result, err = client.UpdateApplicationUpgradeResponder(resp)
19467	if err != nil {
19468		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", resp, "Failure responding to request")
19469		return
19470	}
19471
19472	return
19473}
19474
19475// UpdateApplicationUpgradePreparer prepares the UpdateApplicationUpgrade request.
19476func (client BaseClient) UpdateApplicationUpgradePreparer(ctx context.Context, applicationID string, applicationUpgradeUpdateDescription ApplicationUpgradeUpdateDescription, timeout *int64) (*http.Request, error) {
19477	pathParameters := map[string]interface{}{
19478		"applicationId": applicationID,
19479	}
19480
19481	const APIVersion = "6.0"
19482	queryParameters := map[string]interface{}{
19483		"api-version": APIVersion,
19484	}
19485	if timeout != nil {
19486		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19487	} else {
19488		queryParameters["timeout"] = autorest.Encode("query", 60)
19489	}
19490
19491	preparer := autorest.CreatePreparer(
19492		autorest.AsContentType("application/json; charset=utf-8"),
19493		autorest.AsPost(),
19494		autorest.WithBaseURL(client.BaseURI),
19495		autorest.WithPathParameters("/Applications/{applicationId}/$/UpdateUpgrade", pathParameters),
19496		autorest.WithJSON(applicationUpgradeUpdateDescription),
19497		autorest.WithQueryParameters(queryParameters))
19498	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19499}
19500
19501// UpdateApplicationUpgradeSender sends the UpdateApplicationUpgrade request. The method will close the
19502// http.Response Body if it receives an error.
19503func (client BaseClient) UpdateApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
19504	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19505}
19506
19507// UpdateApplicationUpgradeResponder handles the response to the UpdateApplicationUpgrade request. The method always
19508// closes the http.Response Body.
19509func (client BaseClient) UpdateApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
19510	err = autorest.Respond(
19511		resp,
19512		azure.WithErrorUnlessStatusCode(http.StatusOK),
19513		autorest.ByClosing())
19514	result.Response = resp
19515	return
19516}
19517
19518// UpdateBackupPolicy updates the backup policy identified by {backupPolicyName}
19519// Parameters:
19520// backupPolicyDescription - describes the backup policy.
19521// backupPolicyName - the name of the backup policy.
19522// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19523// duration that the client is willing to wait for the requested operation to complete. The default value for
19524// this parameter is 60 seconds.
19525func (client BaseClient) UpdateBackupPolicy(ctx context.Context, backupPolicyDescription BackupPolicyDescription, backupPolicyName string, timeout *int64) (result autorest.Response, err error) {
19526	if tracing.IsEnabled() {
19527		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateBackupPolicy")
19528		defer func() {
19529			sc := -1
19530			if result.Response != nil {
19531				sc = result.Response.StatusCode
19532			}
19533			tracing.EndSpan(ctx, sc, err)
19534		}()
19535	}
19536	if err := validation.Validate([]validation.Validation{
19537		{TargetValue: backupPolicyDescription,
19538			Constraints: []validation.Constraint{{Target: "backupPolicyDescription.Name", Name: validation.Null, Rule: true, Chain: nil},
19539				{Target: "backupPolicyDescription.AutoRestoreOnDataLoss", Name: validation.Null, Rule: true, Chain: nil},
19540				{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.Null, Rule: true,
19541					Chain: []validation.Constraint{{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMaximum, Rule: int64(255), Chain: nil},
19542						{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
19543					}}}},
19544		{TargetValue: timeout,
19545			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19546				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19547					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19548				}}}}}); err != nil {
19549		return result, validation.NewError("servicefabric.BaseClient", "UpdateBackupPolicy", err.Error())
19550	}
19551
19552	req, err := client.UpdateBackupPolicyPreparer(ctx, backupPolicyDescription, backupPolicyName, timeout)
19553	if err != nil {
19554		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", nil, "Failure preparing request")
19555		return
19556	}
19557
19558	resp, err := client.UpdateBackupPolicySender(req)
19559	if err != nil {
19560		result.Response = resp
19561		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", resp, "Failure sending request")
19562		return
19563	}
19564
19565	result, err = client.UpdateBackupPolicyResponder(resp)
19566	if err != nil {
19567		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", resp, "Failure responding to request")
19568		return
19569	}
19570
19571	return
19572}
19573
19574// UpdateBackupPolicyPreparer prepares the UpdateBackupPolicy request.
19575func (client BaseClient) UpdateBackupPolicyPreparer(ctx context.Context, backupPolicyDescription BackupPolicyDescription, backupPolicyName string, timeout *int64) (*http.Request, error) {
19576	pathParameters := map[string]interface{}{
19577		"backupPolicyName": autorest.Encode("path", backupPolicyName),
19578	}
19579
19580	const APIVersion = "6.2-preview"
19581	queryParameters := map[string]interface{}{
19582		"api-version": APIVersion,
19583	}
19584	if timeout != nil {
19585		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19586	} else {
19587		queryParameters["timeout"] = autorest.Encode("query", 60)
19588	}
19589
19590	preparer := autorest.CreatePreparer(
19591		autorest.AsContentType("application/json; charset=utf-8"),
19592		autorest.AsPost(),
19593		autorest.WithBaseURL(client.BaseURI),
19594		autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/Update", pathParameters),
19595		autorest.WithJSON(backupPolicyDescription),
19596		autorest.WithQueryParameters(queryParameters))
19597	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19598}
19599
19600// UpdateBackupPolicySender sends the UpdateBackupPolicy request. The method will close the
19601// http.Response Body if it receives an error.
19602func (client BaseClient) UpdateBackupPolicySender(req *http.Request) (*http.Response, error) {
19603	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19604}
19605
19606// UpdateBackupPolicyResponder handles the response to the UpdateBackupPolicy request. The method always
19607// closes the http.Response Body.
19608func (client BaseClient) UpdateBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
19609	err = autorest.Respond(
19610		resp,
19611		azure.WithErrorUnlessStatusCode(http.StatusOK),
19612		autorest.ByClosing())
19613	result.Response = resp
19614	return
19615}
19616
19617// UpdateClusterUpgrade update the upgrade parameters used during a Service Fabric cluster upgrade.
19618// Parameters:
19619// updateClusterUpgradeDescription - parameters for updating a cluster upgrade.
19620// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19621// duration that the client is willing to wait for the requested operation to complete. The default value for
19622// this parameter is 60 seconds.
19623func (client BaseClient) UpdateClusterUpgrade(ctx context.Context, updateClusterUpgradeDescription UpdateClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
19624	if tracing.IsEnabled() {
19625		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateClusterUpgrade")
19626		defer func() {
19627			sc := -1
19628			if result.Response != nil {
19629				sc = result.Response.StatusCode
19630			}
19631			tracing.EndSpan(ctx, sc, err)
19632		}()
19633	}
19634	if err := validation.Validate([]validation.Validation{
19635		{TargetValue: updateClusterUpgradeDescription,
19636			Constraints: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false,
19637				Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false,
19638					Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
19639						{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
19640					}},
19641					{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false,
19642						Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
19643							{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
19644						}},
19645				}}}},
19646		{TargetValue: timeout,
19647			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19648				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19649					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19650				}}}}}); err != nil {
19651		return result, validation.NewError("servicefabric.BaseClient", "UpdateClusterUpgrade", err.Error())
19652	}
19653
19654	req, err := client.UpdateClusterUpgradePreparer(ctx, updateClusterUpgradeDescription, timeout)
19655	if err != nil {
19656		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", nil, "Failure preparing request")
19657		return
19658	}
19659
19660	resp, err := client.UpdateClusterUpgradeSender(req)
19661	if err != nil {
19662		result.Response = resp
19663		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", resp, "Failure sending request")
19664		return
19665	}
19666
19667	result, err = client.UpdateClusterUpgradeResponder(resp)
19668	if err != nil {
19669		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", resp, "Failure responding to request")
19670		return
19671	}
19672
19673	return
19674}
19675
19676// UpdateClusterUpgradePreparer prepares the UpdateClusterUpgrade request.
19677func (client BaseClient) UpdateClusterUpgradePreparer(ctx context.Context, updateClusterUpgradeDescription UpdateClusterUpgradeDescription, timeout *int64) (*http.Request, error) {
19678	const APIVersion = "6.0"
19679	queryParameters := map[string]interface{}{
19680		"api-version": APIVersion,
19681	}
19682	if timeout != nil {
19683		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19684	} else {
19685		queryParameters["timeout"] = autorest.Encode("query", 60)
19686	}
19687
19688	preparer := autorest.CreatePreparer(
19689		autorest.AsContentType("application/json; charset=utf-8"),
19690		autorest.AsPost(),
19691		autorest.WithBaseURL(client.BaseURI),
19692		autorest.WithPath("/$/UpdateUpgrade"),
19693		autorest.WithJSON(updateClusterUpgradeDescription),
19694		autorest.WithQueryParameters(queryParameters))
19695	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19696}
19697
19698// UpdateClusterUpgradeSender sends the UpdateClusterUpgrade request. The method will close the
19699// http.Response Body if it receives an error.
19700func (client BaseClient) UpdateClusterUpgradeSender(req *http.Request) (*http.Response, error) {
19701	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19702}
19703
19704// UpdateClusterUpgradeResponder handles the response to the UpdateClusterUpgrade request. The method always
19705// closes the http.Response Body.
19706func (client BaseClient) UpdateClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
19707	err = autorest.Respond(
19708		resp,
19709		azure.WithErrorUnlessStatusCode(http.StatusOK),
19710		autorest.ByClosing())
19711	result.Response = resp
19712	return
19713}
19714
19715// UpdateRepairExecutionState this API supports the Service Fabric platform; it is not meant to be used directly from
19716// your code.
19717// Parameters:
19718// repairTask - describes the repair task to be created or updated.
19719func (client BaseClient) UpdateRepairExecutionState(ctx context.Context, repairTask RepairTask) (result RepairTaskUpdateInfo, err error) {
19720	if tracing.IsEnabled() {
19721		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateRepairExecutionState")
19722		defer func() {
19723			sc := -1
19724			if result.Response.Response != nil {
19725				sc = result.Response.Response.StatusCode
19726			}
19727			tracing.EndSpan(ctx, sc, err)
19728		}()
19729	}
19730	if err := validation.Validate([]validation.Validation{
19731		{TargetValue: repairTask,
19732			Constraints: []validation.Constraint{{Target: "repairTask.TaskID", Name: validation.Null, Rule: true, Chain: nil},
19733				{Target: "repairTask.Action", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
19734		return result, validation.NewError("servicefabric.BaseClient", "UpdateRepairExecutionState", err.Error())
19735	}
19736
19737	req, err := client.UpdateRepairExecutionStatePreparer(ctx, repairTask)
19738	if err != nil {
19739		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", nil, "Failure preparing request")
19740		return
19741	}
19742
19743	resp, err := client.UpdateRepairExecutionStateSender(req)
19744	if err != nil {
19745		result.Response = autorest.Response{Response: resp}
19746		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", resp, "Failure sending request")
19747		return
19748	}
19749
19750	result, err = client.UpdateRepairExecutionStateResponder(resp)
19751	if err != nil {
19752		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", resp, "Failure responding to request")
19753		return
19754	}
19755
19756	return
19757}
19758
19759// UpdateRepairExecutionStatePreparer prepares the UpdateRepairExecutionState request.
19760func (client BaseClient) UpdateRepairExecutionStatePreparer(ctx context.Context, repairTask RepairTask) (*http.Request, error) {
19761	const APIVersion = "6.0"
19762	queryParameters := map[string]interface{}{
19763		"api-version": APIVersion,
19764	}
19765
19766	preparer := autorest.CreatePreparer(
19767		autorest.AsContentType("application/json; charset=utf-8"),
19768		autorest.AsPost(),
19769		autorest.WithBaseURL(client.BaseURI),
19770		autorest.WithPath("/$/UpdateRepairExecutionState"),
19771		autorest.WithJSON(repairTask),
19772		autorest.WithQueryParameters(queryParameters))
19773	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19774}
19775
19776// UpdateRepairExecutionStateSender sends the UpdateRepairExecutionState request. The method will close the
19777// http.Response Body if it receives an error.
19778func (client BaseClient) UpdateRepairExecutionStateSender(req *http.Request) (*http.Response, error) {
19779	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19780}
19781
19782// UpdateRepairExecutionStateResponder handles the response to the UpdateRepairExecutionState request. The method always
19783// closes the http.Response Body.
19784func (client BaseClient) UpdateRepairExecutionStateResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
19785	err = autorest.Respond(
19786		resp,
19787		azure.WithErrorUnlessStatusCode(http.StatusOK),
19788		autorest.ByUnmarshallingJSON(&result),
19789		autorest.ByClosing())
19790	result.Response = autorest.Response{Response: resp}
19791	return
19792}
19793
19794// UpdateRepairTaskHealthPolicy this API supports the Service Fabric platform; it is not meant to be used directly from
19795// your code.
19796// Parameters:
19797// repairTaskUpdateHealthPolicyDescription - describes the repair task healthy policy to be updated.
19798func (client BaseClient) UpdateRepairTaskHealthPolicy(ctx context.Context, repairTaskUpdateHealthPolicyDescription RepairTaskUpdateHealthPolicyDescription) (result RepairTaskUpdateInfo, err error) {
19799	if tracing.IsEnabled() {
19800		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateRepairTaskHealthPolicy")
19801		defer func() {
19802			sc := -1
19803			if result.Response.Response != nil {
19804				sc = result.Response.Response.StatusCode
19805			}
19806			tracing.EndSpan(ctx, sc, err)
19807		}()
19808	}
19809	if err := validation.Validate([]validation.Validation{
19810		{TargetValue: repairTaskUpdateHealthPolicyDescription,
19811			Constraints: []validation.Constraint{{Target: "repairTaskUpdateHealthPolicyDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
19812		return result, validation.NewError("servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", err.Error())
19813	}
19814
19815	req, err := client.UpdateRepairTaskHealthPolicyPreparer(ctx, repairTaskUpdateHealthPolicyDescription)
19816	if err != nil {
19817		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", nil, "Failure preparing request")
19818		return
19819	}
19820
19821	resp, err := client.UpdateRepairTaskHealthPolicySender(req)
19822	if err != nil {
19823		result.Response = autorest.Response{Response: resp}
19824		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", resp, "Failure sending request")
19825		return
19826	}
19827
19828	result, err = client.UpdateRepairTaskHealthPolicyResponder(resp)
19829	if err != nil {
19830		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", resp, "Failure responding to request")
19831		return
19832	}
19833
19834	return
19835}
19836
19837// UpdateRepairTaskHealthPolicyPreparer prepares the UpdateRepairTaskHealthPolicy request.
19838func (client BaseClient) UpdateRepairTaskHealthPolicyPreparer(ctx context.Context, repairTaskUpdateHealthPolicyDescription RepairTaskUpdateHealthPolicyDescription) (*http.Request, error) {
19839	const APIVersion = "6.0"
19840	queryParameters := map[string]interface{}{
19841		"api-version": APIVersion,
19842	}
19843
19844	preparer := autorest.CreatePreparer(
19845		autorest.AsContentType("application/json; charset=utf-8"),
19846		autorest.AsPost(),
19847		autorest.WithBaseURL(client.BaseURI),
19848		autorest.WithPath("/$/UpdateRepairTaskHealthPolicy"),
19849		autorest.WithJSON(repairTaskUpdateHealthPolicyDescription),
19850		autorest.WithQueryParameters(queryParameters))
19851	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19852}
19853
19854// UpdateRepairTaskHealthPolicySender sends the UpdateRepairTaskHealthPolicy request. The method will close the
19855// http.Response Body if it receives an error.
19856func (client BaseClient) UpdateRepairTaskHealthPolicySender(req *http.Request) (*http.Response, error) {
19857	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19858}
19859
19860// UpdateRepairTaskHealthPolicyResponder handles the response to the UpdateRepairTaskHealthPolicy request. The method always
19861// closes the http.Response Body.
19862func (client BaseClient) UpdateRepairTaskHealthPolicyResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
19863	err = autorest.Respond(
19864		resp,
19865		azure.WithErrorUnlessStatusCode(http.StatusOK),
19866		autorest.ByUnmarshallingJSON(&result),
19867		autorest.ByClosing())
19868	result.Response = autorest.Response{Response: resp}
19869	return
19870}
19871
19872// UpdateService this API allows updating properties of a running Service Fabric service. The set of properties that
19873// can be updated are a subset of the properties that were specified at the time of creating the service. The current
19874// set of properties can be obtained using `GetServiceDescription` API. Please note that updating the properties of a
19875// running service is different than upgrading your application using `StartApplicationUpgrade` API. The upgrade is a
19876// long running background operation that involves moving the application from one version to another, one upgrade
19877// domain at a time, whereas update applies the new properties immediately to the service.
19878// Parameters:
19879// serviceID - the identity of the service. This is typically the full name of the service without the
19880// 'fabric:' URI scheme.
19881// Starting from version 6.0, hierarchical names are delimited with the "~" character.
19882// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
19883// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
19884// serviceUpdateDescription - the information necessary to update a service.
19885// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19886// duration that the client is willing to wait for the requested operation to complete. The default value for
19887// this parameter is 60 seconds.
19888func (client BaseClient) UpdateService(ctx context.Context, serviceID string, serviceUpdateDescription BasicServiceUpdateDescription, timeout *int64) (result autorest.Response, err error) {
19889	if tracing.IsEnabled() {
19890		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateService")
19891		defer func() {
19892			sc := -1
19893			if result.Response != nil {
19894				sc = result.Response.StatusCode
19895			}
19896			tracing.EndSpan(ctx, sc, err)
19897		}()
19898	}
19899	if err := validation.Validate([]validation.Validation{
19900		{TargetValue: timeout,
19901			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19902				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19903					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19904				}}}}}); err != nil {
19905		return result, validation.NewError("servicefabric.BaseClient", "UpdateService", err.Error())
19906	}
19907
19908	req, err := client.UpdateServicePreparer(ctx, serviceID, serviceUpdateDescription, timeout)
19909	if err != nil {
19910		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", nil, "Failure preparing request")
19911		return
19912	}
19913
19914	resp, err := client.UpdateServiceSender(req)
19915	if err != nil {
19916		result.Response = resp
19917		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", resp, "Failure sending request")
19918		return
19919	}
19920
19921	result, err = client.UpdateServiceResponder(resp)
19922	if err != nil {
19923		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", resp, "Failure responding to request")
19924		return
19925	}
19926
19927	return
19928}
19929
19930// UpdateServicePreparer prepares the UpdateService request.
19931func (client BaseClient) UpdateServicePreparer(ctx context.Context, serviceID string, serviceUpdateDescription BasicServiceUpdateDescription, timeout *int64) (*http.Request, error) {
19932	pathParameters := map[string]interface{}{
19933		"serviceId": serviceID,
19934	}
19935
19936	const APIVersion = "6.0"
19937	queryParameters := map[string]interface{}{
19938		"api-version": APIVersion,
19939	}
19940	if timeout != nil {
19941		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19942	} else {
19943		queryParameters["timeout"] = autorest.Encode("query", 60)
19944	}
19945
19946	preparer := autorest.CreatePreparer(
19947		autorest.AsContentType("application/json; charset=utf-8"),
19948		autorest.AsPost(),
19949		autorest.WithBaseURL(client.BaseURI),
19950		autorest.WithPathParameters("/Services/{serviceId}/$/Update", pathParameters),
19951		autorest.WithJSON(serviceUpdateDescription),
19952		autorest.WithQueryParameters(queryParameters))
19953	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19954}
19955
19956// UpdateServiceSender sends the UpdateService request. The method will close the
19957// http.Response Body if it receives an error.
19958func (client BaseClient) UpdateServiceSender(req *http.Request) (*http.Response, error) {
19959	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19960}
19961
19962// UpdateServiceResponder handles the response to the UpdateService request. The method always
19963// closes the http.Response Body.
19964func (client BaseClient) UpdateServiceResponder(resp *http.Response) (result autorest.Response, err error) {
19965	err = autorest.Respond(
19966		resp,
19967		azure.WithErrorUnlessStatusCode(http.StatusOK),
19968		autorest.ByClosing())
19969	result.Response = resp
19970	return
19971}
19972
19973// UploadFile uploads contents of the file to the image store. Use this API if the file is small enough to upload again
19974// if the connection fails. The file's data needs to be added to the request body. The contents will be uploaded to the
19975// specified path. Image store service uses a mark file to indicate the availability of the folder. The mark file is an
19976// empty file named "_.dir". The mark file is generated by the image store service when all files in a folder are
19977// uploaded. When using File-by-File approach to upload application package in REST, the image store service isn't
19978// aware of the file hierarchy of the application package; you need to create a mark file per folder and upload it
19979// last, to let the image store service know that the folder is complete.
19980// Parameters:
19981// contentPath - relative path to file or folder in the image store from its root.
19982// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19983// duration that the client is willing to wait for the requested operation to complete. The default value for
19984// this parameter is 60 seconds.
19985func (client BaseClient) UploadFile(ctx context.Context, contentPath string, timeout *int64) (result autorest.Response, err error) {
19986	if tracing.IsEnabled() {
19987		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UploadFile")
19988		defer func() {
19989			sc := -1
19990			if result.Response != nil {
19991				sc = result.Response.StatusCode
19992			}
19993			tracing.EndSpan(ctx, sc, err)
19994		}()
19995	}
19996	if err := validation.Validate([]validation.Validation{
19997		{TargetValue: timeout,
19998			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19999				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
20000					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
20001				}}}}}); err != nil {
20002		return result, validation.NewError("servicefabric.BaseClient", "UploadFile", err.Error())
20003	}
20004
20005	req, err := client.UploadFilePreparer(ctx, contentPath, timeout)
20006	if err != nil {
20007		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", nil, "Failure preparing request")
20008		return
20009	}
20010
20011	resp, err := client.UploadFileSender(req)
20012	if err != nil {
20013		result.Response = resp
20014		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", resp, "Failure sending request")
20015		return
20016	}
20017
20018	result, err = client.UploadFileResponder(resp)
20019	if err != nil {
20020		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", resp, "Failure responding to request")
20021		return
20022	}
20023
20024	return
20025}
20026
20027// UploadFilePreparer prepares the UploadFile request.
20028func (client BaseClient) UploadFilePreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) {
20029	pathParameters := map[string]interface{}{
20030		"contentPath": autorest.Encode("path", contentPath),
20031	}
20032
20033	const APIVersion = "6.0"
20034	queryParameters := map[string]interface{}{
20035		"api-version": APIVersion,
20036	}
20037	if timeout != nil {
20038		queryParameters["timeout"] = autorest.Encode("query", *timeout)
20039	} else {
20040		queryParameters["timeout"] = autorest.Encode("query", 60)
20041	}
20042
20043	preparer := autorest.CreatePreparer(
20044		autorest.AsPut(),
20045		autorest.WithBaseURL(client.BaseURI),
20046		autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters),
20047		autorest.WithQueryParameters(queryParameters))
20048	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20049}
20050
20051// UploadFileSender sends the UploadFile request. The method will close the
20052// http.Response Body if it receives an error.
20053func (client BaseClient) UploadFileSender(req *http.Request) (*http.Response, error) {
20054	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20055}
20056
20057// UploadFileResponder handles the response to the UploadFile request. The method always
20058// closes the http.Response Body.
20059func (client BaseClient) UploadFileResponder(resp *http.Response) (result autorest.Response, err error) {
20060	err = autorest.Respond(
20061		resp,
20062		azure.WithErrorUnlessStatusCode(http.StatusOK),
20063		autorest.ByClosing())
20064	result.Response = resp
20065	return
20066}
20067
20068// UploadFileChunk uploads a file chunk to the image store with the specified upload session ID and image store
20069// relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file
20070// upload from scratch whenever there is a network interruption. Use this option if the file size is large.
20071//
20072// To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the
20073// image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store
20074// relative path already exists, it will be overwritten when the upload session commits.
20075// Parameters:
20076// contentPath - relative path to file or folder in the image store from its root.
20077// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session
20078// which keeps track of all file chunks until it is committed.
20079// contentRange - when uploading file chunks to the image store, the Content-Range header field need to be
20080// configured and sent with a request. The format should looks like "bytes
20081// {First-Byte-Position}-{Last-Byte-Position}/{File-Length}". For example, Content-Range:bytes 300-5000/20000
20082// indicates that user is sending bytes 300 through 5,000 and the total file length is 20,000 bytes.
20083// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
20084// duration that the client is willing to wait for the requested operation to complete. The default value for
20085// this parameter is 60 seconds.
20086func (client BaseClient) UploadFileChunk(ctx context.Context, contentPath string, sessionID uuid.UUID, contentRange string, timeout *int64) (result autorest.Response, err error) {
20087	if tracing.IsEnabled() {
20088		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UploadFileChunk")
20089		defer func() {
20090			sc := -1
20091			if result.Response != nil {
20092				sc = result.Response.StatusCode
20093			}
20094			tracing.EndSpan(ctx, sc, err)
20095		}()
20096	}
20097	if err := validation.Validate([]validation.Validation{
20098		{TargetValue: timeout,
20099			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
20100				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
20101					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
20102				}}}}}); err != nil {
20103		return result, validation.NewError("servicefabric.BaseClient", "UploadFileChunk", err.Error())
20104	}
20105
20106	req, err := client.UploadFileChunkPreparer(ctx, contentPath, sessionID, contentRange, timeout)
20107	if err != nil {
20108		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", nil, "Failure preparing request")
20109		return
20110	}
20111
20112	resp, err := client.UploadFileChunkSender(req)
20113	if err != nil {
20114		result.Response = resp
20115		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", resp, "Failure sending request")
20116		return
20117	}
20118
20119	result, err = client.UploadFileChunkResponder(resp)
20120	if err != nil {
20121		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", resp, "Failure responding to request")
20122		return
20123	}
20124
20125	return
20126}
20127
20128// UploadFileChunkPreparer prepares the UploadFileChunk request.
20129func (client BaseClient) UploadFileChunkPreparer(ctx context.Context, contentPath string, sessionID uuid.UUID, contentRange string, timeout *int64) (*http.Request, error) {
20130	pathParameters := map[string]interface{}{
20131		"contentPath": autorest.Encode("path", contentPath),
20132	}
20133
20134	const APIVersion = "6.0"
20135	queryParameters := map[string]interface{}{
20136		"api-version": APIVersion,
20137		"session-id":  autorest.Encode("query", sessionID),
20138	}
20139	if timeout != nil {
20140		queryParameters["timeout"] = autorest.Encode("query", *timeout)
20141	} else {
20142		queryParameters["timeout"] = autorest.Encode("query", 60)
20143	}
20144
20145	preparer := autorest.CreatePreparer(
20146		autorest.AsPut(),
20147		autorest.WithBaseURL(client.BaseURI),
20148		autorest.WithPathParameters("/ImageStore/{contentPath}/$/UploadChunk", pathParameters),
20149		autorest.WithQueryParameters(queryParameters),
20150		autorest.WithHeader("Content-Range", autorest.String(contentRange)))
20151	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20152}
20153
20154// UploadFileChunkSender sends the UploadFileChunk request. The method will close the
20155// http.Response Body if it receives an error.
20156func (client BaseClient) UploadFileChunkSender(req *http.Request) (*http.Response, error) {
20157	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20158}
20159
20160// UploadFileChunkResponder handles the response to the UploadFileChunk request. The method always
20161// closes the http.Response Body.
20162func (client BaseClient) UploadFileChunkResponder(resp *http.Response) (result autorest.Response, err error) {
20163	err = autorest.Respond(
20164		resp,
20165		azure.WithErrorUnlessStatusCode(http.StatusOK),
20166		autorest.ByClosing())
20167	result.Response = resp
20168	return
20169}
20170