1// Package servicefabric implements the Azure ARM Servicefabric service API version 6.3.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 APIs start fault operations that may be cancelled by using CancelOperation:
159// StartDataLoss, StartQuorumLoss, StartPartitionRestart, StartNodeTransition.
160//
161// If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up.  If force is
162// true, the command will be aborted, and some internal state
163// may be left behind.  Specifying force as true should be used with care.  Calling this API with force set to true is
164// not allowed until this API has already
165// been called on the same test command with force set to false first, or unless the test command already has an
166// OperationState of OperationState.RollingBack.
167// Clarification: OperationState.RollingBack means that the system will be/is cleaning up internal system state caused
168// by executing the command.  It will not restore data if the
169// test command was to cause data loss.  For example, if you call StartDataLoss then call this API, the system will
170// only clean up internal state from running the command.
171// It will not restore the target partition's data, if the command progressed far enough to cause data loss.
172//
173// Important note:  if this API is invoked with force==true, internal state may be left behind.
174// Parameters:
175// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
176// API
177// force - indicates whether to gracefully rollback and clean up internal system state modified by executing
178// the user-induced operation.
179// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
180// duration that the client is willing to wait for the requested operation to complete. The default value for
181// this parameter is 60 seconds.
182func (client BaseClient) CancelOperation(ctx context.Context, operationID uuid.UUID, force bool, timeout *int64) (result autorest.Response, err error) {
183	if tracing.IsEnabled() {
184		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CancelOperation")
185		defer func() {
186			sc := -1
187			if result.Response != nil {
188				sc = result.Response.StatusCode
189			}
190			tracing.EndSpan(ctx, sc, err)
191		}()
192	}
193	if err := validation.Validate([]validation.Validation{
194		{TargetValue: timeout,
195			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
196				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
197					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
198				}}}}}); err != nil {
199		return result, validation.NewError("servicefabric.BaseClient", "CancelOperation", err.Error())
200	}
201
202	req, err := client.CancelOperationPreparer(ctx, operationID, force, timeout)
203	if err != nil {
204		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", nil, "Failure preparing request")
205		return
206	}
207
208	resp, err := client.CancelOperationSender(req)
209	if err != nil {
210		result.Response = resp
211		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", resp, "Failure sending request")
212		return
213	}
214
215	result, err = client.CancelOperationResponder(resp)
216	if err != nil {
217		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", resp, "Failure responding to request")
218		return
219	}
220
221	return
222}
223
224// CancelOperationPreparer prepares the CancelOperation request.
225func (client BaseClient) CancelOperationPreparer(ctx context.Context, operationID uuid.UUID, force bool, timeout *int64) (*http.Request, error) {
226	const APIVersion = "6.0"
227	queryParameters := map[string]interface{}{
228		"api-version": APIVersion,
229		"Force":       autorest.Encode("query", force),
230		"OperationId": autorest.Encode("query", operationID),
231	}
232	if timeout != nil {
233		queryParameters["timeout"] = autorest.Encode("query", *timeout)
234	} else {
235		queryParameters["timeout"] = autorest.Encode("query", 60)
236	}
237
238	preparer := autorest.CreatePreparer(
239		autorest.AsPost(),
240		autorest.WithBaseURL(client.BaseURI),
241		autorest.WithPath("/Faults/$/Cancel"),
242		autorest.WithQueryParameters(queryParameters))
243	return preparer.Prepare((&http.Request{}).WithContext(ctx))
244}
245
246// CancelOperationSender sends the CancelOperation request. The method will close the
247// http.Response Body if it receives an error.
248func (client BaseClient) CancelOperationSender(req *http.Request) (*http.Response, error) {
249	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
250}
251
252// CancelOperationResponder handles the response to the CancelOperation request. The method always
253// closes the http.Response Body.
254func (client BaseClient) CancelOperationResponder(resp *http.Response) (result autorest.Response, err error) {
255	err = autorest.Respond(
256		resp,
257		azure.WithErrorUnlessStatusCode(http.StatusOK),
258		autorest.ByClosing())
259	result.Response = resp
260	return
261}
262
263// CancelRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your code.
264// Parameters:
265// repairTaskCancelDescription - describes the repair task to be cancelled.
266func (client BaseClient) CancelRepairTask(ctx context.Context, repairTaskCancelDescription RepairTaskCancelDescription) (result RepairTaskUpdateInfo, err error) {
267	if tracing.IsEnabled() {
268		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CancelRepairTask")
269		defer func() {
270			sc := -1
271			if result.Response.Response != nil {
272				sc = result.Response.Response.StatusCode
273			}
274			tracing.EndSpan(ctx, sc, err)
275		}()
276	}
277	if err := validation.Validate([]validation.Validation{
278		{TargetValue: repairTaskCancelDescription,
279			Constraints: []validation.Constraint{{Target: "repairTaskCancelDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
280		return result, validation.NewError("servicefabric.BaseClient", "CancelRepairTask", err.Error())
281	}
282
283	req, err := client.CancelRepairTaskPreparer(ctx, repairTaskCancelDescription)
284	if err != nil {
285		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", nil, "Failure preparing request")
286		return
287	}
288
289	resp, err := client.CancelRepairTaskSender(req)
290	if err != nil {
291		result.Response = autorest.Response{Response: resp}
292		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", resp, "Failure sending request")
293		return
294	}
295
296	result, err = client.CancelRepairTaskResponder(resp)
297	if err != nil {
298		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", resp, "Failure responding to request")
299		return
300	}
301
302	return
303}
304
305// CancelRepairTaskPreparer prepares the CancelRepairTask request.
306func (client BaseClient) CancelRepairTaskPreparer(ctx context.Context, repairTaskCancelDescription RepairTaskCancelDescription) (*http.Request, error) {
307	const APIVersion = "6.0"
308	queryParameters := map[string]interface{}{
309		"api-version": APIVersion,
310	}
311
312	preparer := autorest.CreatePreparer(
313		autorest.AsContentType("application/json; charset=utf-8"),
314		autorest.AsPost(),
315		autorest.WithBaseURL(client.BaseURI),
316		autorest.WithPath("/$/CancelRepairTask"),
317		autorest.WithJSON(repairTaskCancelDescription),
318		autorest.WithQueryParameters(queryParameters))
319	return preparer.Prepare((&http.Request{}).WithContext(ctx))
320}
321
322// CancelRepairTaskSender sends the CancelRepairTask request. The method will close the
323// http.Response Body if it receives an error.
324func (client BaseClient) CancelRepairTaskSender(req *http.Request) (*http.Response, error) {
325	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
326}
327
328// CancelRepairTaskResponder handles the response to the CancelRepairTask request. The method always
329// closes the http.Response Body.
330func (client BaseClient) CancelRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
331	err = autorest.Respond(
332		resp,
333		azure.WithErrorUnlessStatusCode(http.StatusOK),
334		autorest.ByUnmarshallingJSON(&result),
335		autorest.ByClosing())
336	result.Response = autorest.Response{Response: resp}
337	return
338}
339
340// CommitImageStoreUploadSession when all file chunks have been uploaded, the upload session needs to be committed
341// explicitly to complete the upload. Image store preserves the upload session until the expiration time, which is 30
342// minutes after the last chunk received.
343// Parameters:
344// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session
345// which keeps track of all file chunks until it is committed.
346// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
347// duration that the client is willing to wait for the requested operation to complete. The default value for
348// this parameter is 60 seconds.
349func (client BaseClient) CommitImageStoreUploadSession(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
350	if tracing.IsEnabled() {
351		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CommitImageStoreUploadSession")
352		defer func() {
353			sc := -1
354			if result.Response != nil {
355				sc = result.Response.StatusCode
356			}
357			tracing.EndSpan(ctx, sc, err)
358		}()
359	}
360	if err := validation.Validate([]validation.Validation{
361		{TargetValue: timeout,
362			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
363				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
364					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
365				}}}}}); err != nil {
366		return result, validation.NewError("servicefabric.BaseClient", "CommitImageStoreUploadSession", err.Error())
367	}
368
369	req, err := client.CommitImageStoreUploadSessionPreparer(ctx, sessionID, timeout)
370	if err != nil {
371		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", nil, "Failure preparing request")
372		return
373	}
374
375	resp, err := client.CommitImageStoreUploadSessionSender(req)
376	if err != nil {
377		result.Response = resp
378		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", resp, "Failure sending request")
379		return
380	}
381
382	result, err = client.CommitImageStoreUploadSessionResponder(resp)
383	if err != nil {
384		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", resp, "Failure responding to request")
385		return
386	}
387
388	return
389}
390
391// CommitImageStoreUploadSessionPreparer prepares the CommitImageStoreUploadSession request.
392func (client BaseClient) CommitImageStoreUploadSessionPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) {
393	const APIVersion = "6.0"
394	queryParameters := map[string]interface{}{
395		"api-version": APIVersion,
396		"session-id":  autorest.Encode("query", sessionID),
397	}
398	if timeout != nil {
399		queryParameters["timeout"] = autorest.Encode("query", *timeout)
400	} else {
401		queryParameters["timeout"] = autorest.Encode("query", 60)
402	}
403
404	preparer := autorest.CreatePreparer(
405		autorest.AsPost(),
406		autorest.WithBaseURL(client.BaseURI),
407		autorest.WithPath("/ImageStore/$/CommitUploadSession"),
408		autorest.WithQueryParameters(queryParameters))
409	return preparer.Prepare((&http.Request{}).WithContext(ctx))
410}
411
412// CommitImageStoreUploadSessionSender sends the CommitImageStoreUploadSession request. The method will close the
413// http.Response Body if it receives an error.
414func (client BaseClient) CommitImageStoreUploadSessionSender(req *http.Request) (*http.Response, error) {
415	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
416}
417
418// CommitImageStoreUploadSessionResponder handles the response to the CommitImageStoreUploadSession request. The method always
419// closes the http.Response Body.
420func (client BaseClient) CommitImageStoreUploadSessionResponder(resp *http.Response) (result autorest.Response, err error) {
421	err = autorest.Respond(
422		resp,
423		azure.WithErrorUnlessStatusCode(http.StatusOK),
424		autorest.ByClosing())
425	result.Response = resp
426	return
427}
428
429// CopyImageStoreContent copies the image store content from the source image store relative path to the destination
430// image store relative path.
431// Parameters:
432// imageStoreCopyDescription - describes the copy description for the image store.
433// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
434// duration that the client is willing to wait for the requested operation to complete. The default value for
435// this parameter is 60 seconds.
436func (client BaseClient) CopyImageStoreContent(ctx context.Context, imageStoreCopyDescription ImageStoreCopyDescription, timeout *int64) (result autorest.Response, err error) {
437	if tracing.IsEnabled() {
438		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CopyImageStoreContent")
439		defer func() {
440			sc := -1
441			if result.Response != nil {
442				sc = result.Response.StatusCode
443			}
444			tracing.EndSpan(ctx, sc, err)
445		}()
446	}
447	if err := validation.Validate([]validation.Validation{
448		{TargetValue: imageStoreCopyDescription,
449			Constraints: []validation.Constraint{{Target: "imageStoreCopyDescription.RemoteSource", Name: validation.Null, Rule: true, Chain: nil},
450				{Target: "imageStoreCopyDescription.RemoteDestination", Name: validation.Null, Rule: true, Chain: nil}}},
451		{TargetValue: timeout,
452			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
453				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
454					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
455				}}}}}); err != nil {
456		return result, validation.NewError("servicefabric.BaseClient", "CopyImageStoreContent", err.Error())
457	}
458
459	req, err := client.CopyImageStoreContentPreparer(ctx, imageStoreCopyDescription, timeout)
460	if err != nil {
461		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", nil, "Failure preparing request")
462		return
463	}
464
465	resp, err := client.CopyImageStoreContentSender(req)
466	if err != nil {
467		result.Response = resp
468		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", resp, "Failure sending request")
469		return
470	}
471
472	result, err = client.CopyImageStoreContentResponder(resp)
473	if err != nil {
474		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", resp, "Failure responding to request")
475		return
476	}
477
478	return
479}
480
481// CopyImageStoreContentPreparer prepares the CopyImageStoreContent request.
482func (client BaseClient) CopyImageStoreContentPreparer(ctx context.Context, imageStoreCopyDescription ImageStoreCopyDescription, timeout *int64) (*http.Request, error) {
483	const APIVersion = "6.0"
484	queryParameters := map[string]interface{}{
485		"api-version": APIVersion,
486	}
487	if timeout != nil {
488		queryParameters["timeout"] = autorest.Encode("query", *timeout)
489	} else {
490		queryParameters["timeout"] = autorest.Encode("query", 60)
491	}
492
493	preparer := autorest.CreatePreparer(
494		autorest.AsContentType("application/json; charset=utf-8"),
495		autorest.AsPost(),
496		autorest.WithBaseURL(client.BaseURI),
497		autorest.WithPath("/ImageStore/$/Copy"),
498		autorest.WithJSON(imageStoreCopyDescription),
499		autorest.WithQueryParameters(queryParameters))
500	return preparer.Prepare((&http.Request{}).WithContext(ctx))
501}
502
503// CopyImageStoreContentSender sends the CopyImageStoreContent request. The method will close the
504// http.Response Body if it receives an error.
505func (client BaseClient) CopyImageStoreContentSender(req *http.Request) (*http.Response, error) {
506	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
507}
508
509// CopyImageStoreContentResponder handles the response to the CopyImageStoreContent request. The method always
510// closes the http.Response Body.
511func (client BaseClient) CopyImageStoreContentResponder(resp *http.Response) (result autorest.Response, err error) {
512	err = autorest.Respond(
513		resp,
514		azure.WithErrorUnlessStatusCode(http.StatusOK),
515		autorest.ByClosing())
516	result.Response = resp
517	return
518}
519
520// CreateApplication creates a Service Fabric application using the specified description.
521// Parameters:
522// applicationDescription - description for creating an application.
523// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
524// duration that the client is willing to wait for the requested operation to complete. The default value for
525// this parameter is 60 seconds.
526func (client BaseClient) CreateApplication(ctx context.Context, applicationDescription ApplicationDescription, timeout *int64) (result autorest.Response, err error) {
527	if tracing.IsEnabled() {
528		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateApplication")
529		defer func() {
530			sc := -1
531			if result.Response != nil {
532				sc = result.Response.StatusCode
533			}
534			tracing.EndSpan(ctx, sc, err)
535		}()
536	}
537	if err := validation.Validate([]validation.Validation{
538		{TargetValue: applicationDescription,
539			Constraints: []validation.Constraint{{Target: "applicationDescription.Name", Name: validation.Null, Rule: true, Chain: nil},
540				{Target: "applicationDescription.TypeName", Name: validation.Null, Rule: true, Chain: nil},
541				{Target: "applicationDescription.TypeVersion", Name: validation.Null, Rule: true, Chain: nil},
542				{Target: "applicationDescription.ApplicationCapacity", Name: validation.Null, Rule: false,
543					Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MinimumNodes", Name: validation.Null, Rule: false,
544						Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MinimumNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}},
545						{Target: "applicationDescription.ApplicationCapacity.MaximumNodes", Name: validation.Null, Rule: false,
546							Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MaximumNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}},
547					}}}},
548		{TargetValue: timeout,
549			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
550				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
551					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
552				}}}}}); err != nil {
553		return result, validation.NewError("servicefabric.BaseClient", "CreateApplication", err.Error())
554	}
555
556	req, err := client.CreateApplicationPreparer(ctx, applicationDescription, timeout)
557	if err != nil {
558		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", nil, "Failure preparing request")
559		return
560	}
561
562	resp, err := client.CreateApplicationSender(req)
563	if err != nil {
564		result.Response = resp
565		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", resp, "Failure sending request")
566		return
567	}
568
569	result, err = client.CreateApplicationResponder(resp)
570	if err != nil {
571		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", resp, "Failure responding to request")
572		return
573	}
574
575	return
576}
577
578// CreateApplicationPreparer prepares the CreateApplication request.
579func (client BaseClient) CreateApplicationPreparer(ctx context.Context, applicationDescription ApplicationDescription, timeout *int64) (*http.Request, error) {
580	const APIVersion = "6.0"
581	queryParameters := map[string]interface{}{
582		"api-version": APIVersion,
583	}
584	if timeout != nil {
585		queryParameters["timeout"] = autorest.Encode("query", *timeout)
586	} else {
587		queryParameters["timeout"] = autorest.Encode("query", 60)
588	}
589
590	preparer := autorest.CreatePreparer(
591		autorest.AsContentType("application/json; charset=utf-8"),
592		autorest.AsPost(),
593		autorest.WithBaseURL(client.BaseURI),
594		autorest.WithPath("/Applications/$/Create"),
595		autorest.WithJSON(applicationDescription),
596		autorest.WithQueryParameters(queryParameters))
597	return preparer.Prepare((&http.Request{}).WithContext(ctx))
598}
599
600// CreateApplicationSender sends the CreateApplication request. The method will close the
601// http.Response Body if it receives an error.
602func (client BaseClient) CreateApplicationSender(req *http.Request) (*http.Response, error) {
603	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
604}
605
606// CreateApplicationResponder handles the response to the CreateApplication request. The method always
607// closes the http.Response Body.
608func (client BaseClient) CreateApplicationResponder(resp *http.Response) (result autorest.Response, err error) {
609	err = autorest.Respond(
610		resp,
611		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
612		autorest.ByClosing())
613	result.Response = resp
614	return
615}
616
617// CreateApplicationResource creates an application with the specified name and description. If an application with the
618// same name already exists, then its description are updated to the one indicated in this request.
619// Parameters:
620// applicationResourceName - service Fabric application resource name.
621// applicationResourceDescription - description for creating an application resource.
622func (client BaseClient) CreateApplicationResource(ctx context.Context, applicationResourceName string, applicationResourceDescription ApplicationResourceDescription) (result autorest.Response, err error) {
623	if tracing.IsEnabled() {
624		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateApplicationResource")
625		defer func() {
626			sc := -1
627			if result.Response != nil {
628				sc = result.Response.StatusCode
629			}
630			tracing.EndSpan(ctx, sc, err)
631		}()
632	}
633	if err := validation.Validate([]validation.Validation{
634		{TargetValue: applicationResourceDescription,
635			Constraints: []validation.Constraint{{Target: "applicationResourceDescription.ApplicationProperties", Name: validation.Null, Rule: true, Chain: nil},
636				{Target: "applicationResourceDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
637		return result, validation.NewError("servicefabric.BaseClient", "CreateApplicationResource", err.Error())
638	}
639
640	req, err := client.CreateApplicationResourcePreparer(ctx, applicationResourceName, applicationResourceDescription)
641	if err != nil {
642		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplicationResource", nil, "Failure preparing request")
643		return
644	}
645
646	resp, err := client.CreateApplicationResourceSender(req)
647	if err != nil {
648		result.Response = resp
649		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplicationResource", resp, "Failure sending request")
650		return
651	}
652
653	result, err = client.CreateApplicationResourceResponder(resp)
654	if err != nil {
655		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplicationResource", resp, "Failure responding to request")
656		return
657	}
658
659	return
660}
661
662// CreateApplicationResourcePreparer prepares the CreateApplicationResource request.
663func (client BaseClient) CreateApplicationResourcePreparer(ctx context.Context, applicationResourceName string, applicationResourceDescription ApplicationResourceDescription) (*http.Request, error) {
664	pathParameters := map[string]interface{}{
665		"applicationResourceName": applicationResourceName,
666	}
667
668	const APIVersion = "6.3-preview"
669	queryParameters := map[string]interface{}{
670		"api-version": APIVersion,
671	}
672
673	preparer := autorest.CreatePreparer(
674		autorest.AsContentType("application/json; charset=utf-8"),
675		autorest.AsPut(),
676		autorest.WithBaseURL(client.BaseURI),
677		autorest.WithPathParameters("/Resources/Applications/{applicationResourceName}", pathParameters),
678		autorest.WithJSON(applicationResourceDescription),
679		autorest.WithQueryParameters(queryParameters))
680	return preparer.Prepare((&http.Request{}).WithContext(ctx))
681}
682
683// CreateApplicationResourceSender sends the CreateApplicationResource request. The method will close the
684// http.Response Body if it receives an error.
685func (client BaseClient) CreateApplicationResourceSender(req *http.Request) (*http.Response, error) {
686	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
687}
688
689// CreateApplicationResourceResponder handles the response to the CreateApplicationResource request. The method always
690// closes the http.Response Body.
691func (client BaseClient) CreateApplicationResourceResponder(resp *http.Response) (result autorest.Response, err error) {
692	err = autorest.Respond(
693		resp,
694		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
695		autorest.ByClosing())
696	result.Response = resp
697	return
698}
699
700// CreateBackupPolicy creates a backup policy which can be associated later with a Service Fabric application, service
701// or a partition for periodic backup.
702// Parameters:
703// backupPolicyDescription - describes the backup policy.
704// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
705// duration that the client is willing to wait for the requested operation to complete. The default value for
706// this parameter is 60 seconds.
707func (client BaseClient) CreateBackupPolicy(ctx context.Context, backupPolicyDescription BackupPolicyDescription, timeout *int64) (result autorest.Response, err error) {
708	if tracing.IsEnabled() {
709		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateBackupPolicy")
710		defer func() {
711			sc := -1
712			if result.Response != nil {
713				sc = result.Response.StatusCode
714			}
715			tracing.EndSpan(ctx, sc, err)
716		}()
717	}
718	if err := validation.Validate([]validation.Validation{
719		{TargetValue: backupPolicyDescription,
720			Constraints: []validation.Constraint{{Target: "backupPolicyDescription.Name", Name: validation.Null, Rule: true, Chain: nil},
721				{Target: "backupPolicyDescription.AutoRestoreOnDataLoss", Name: validation.Null, Rule: true, Chain: nil},
722				{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.Null, Rule: true,
723					Chain: []validation.Constraint{{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMaximum, Rule: int64(255), Chain: nil},
724						{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
725					}}}},
726		{TargetValue: timeout,
727			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
728				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
729					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
730				}}}}}); err != nil {
731		return result, validation.NewError("servicefabric.BaseClient", "CreateBackupPolicy", err.Error())
732	}
733
734	req, err := client.CreateBackupPolicyPreparer(ctx, backupPolicyDescription, timeout)
735	if err != nil {
736		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", nil, "Failure preparing request")
737		return
738	}
739
740	resp, err := client.CreateBackupPolicySender(req)
741	if err != nil {
742		result.Response = resp
743		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", resp, "Failure sending request")
744		return
745	}
746
747	result, err = client.CreateBackupPolicyResponder(resp)
748	if err != nil {
749		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", resp, "Failure responding to request")
750		return
751	}
752
753	return
754}
755
756// CreateBackupPolicyPreparer prepares the CreateBackupPolicy request.
757func (client BaseClient) CreateBackupPolicyPreparer(ctx context.Context, backupPolicyDescription BackupPolicyDescription, timeout *int64) (*http.Request, error) {
758	const APIVersion = "6.2-preview"
759	queryParameters := map[string]interface{}{
760		"api-version": APIVersion,
761	}
762	if timeout != nil {
763		queryParameters["timeout"] = autorest.Encode("query", *timeout)
764	} else {
765		queryParameters["timeout"] = autorest.Encode("query", 60)
766	}
767
768	preparer := autorest.CreatePreparer(
769		autorest.AsContentType("application/json; charset=utf-8"),
770		autorest.AsPost(),
771		autorest.WithBaseURL(client.BaseURI),
772		autorest.WithPath("/BackupRestore/BackupPolicies/$/Create"),
773		autorest.WithJSON(backupPolicyDescription),
774		autorest.WithQueryParameters(queryParameters))
775	return preparer.Prepare((&http.Request{}).WithContext(ctx))
776}
777
778// CreateBackupPolicySender sends the CreateBackupPolicy request. The method will close the
779// http.Response Body if it receives an error.
780func (client BaseClient) CreateBackupPolicySender(req *http.Request) (*http.Response, error) {
781	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
782}
783
784// CreateBackupPolicyResponder handles the response to the CreateBackupPolicy request. The method always
785// closes the http.Response Body.
786func (client BaseClient) CreateBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
787	err = autorest.Respond(
788		resp,
789		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
790		autorest.ByClosing())
791	result.Response = resp
792	return
793}
794
795// CreateComposeDeployment compose is a file format that describes multi-container applications. This API allows
796// deploying container based applications defined in compose format in a Service Fabric cluster. Once the deployment is
797// created, its status can be tracked via the `GetComposeDeploymentStatus` API.
798// Parameters:
799// createComposeDeploymentDescription - describes the compose deployment that needs to be created.
800// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
801// duration that the client is willing to wait for the requested operation to complete. The default value for
802// this parameter is 60 seconds.
803func (client BaseClient) CreateComposeDeployment(ctx context.Context, createComposeDeploymentDescription CreateComposeDeploymentDescription, timeout *int64) (result autorest.Response, err error) {
804	if tracing.IsEnabled() {
805		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateComposeDeployment")
806		defer func() {
807			sc := -1
808			if result.Response != nil {
809				sc = result.Response.StatusCode
810			}
811			tracing.EndSpan(ctx, sc, err)
812		}()
813	}
814	if err := validation.Validate([]validation.Validation{
815		{TargetValue: createComposeDeploymentDescription,
816			Constraints: []validation.Constraint{{Target: "createComposeDeploymentDescription.DeploymentName", Name: validation.Null, Rule: true, Chain: nil},
817				{Target: "createComposeDeploymentDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}},
818		{TargetValue: timeout,
819			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
820				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
821					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
822				}}}}}); err != nil {
823		return result, validation.NewError("servicefabric.BaseClient", "CreateComposeDeployment", err.Error())
824	}
825
826	req, err := client.CreateComposeDeploymentPreparer(ctx, createComposeDeploymentDescription, timeout)
827	if err != nil {
828		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", nil, "Failure preparing request")
829		return
830	}
831
832	resp, err := client.CreateComposeDeploymentSender(req)
833	if err != nil {
834		result.Response = resp
835		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", resp, "Failure sending request")
836		return
837	}
838
839	result, err = client.CreateComposeDeploymentResponder(resp)
840	if err != nil {
841		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", resp, "Failure responding to request")
842		return
843	}
844
845	return
846}
847
848// CreateComposeDeploymentPreparer prepares the CreateComposeDeployment request.
849func (client BaseClient) CreateComposeDeploymentPreparer(ctx context.Context, createComposeDeploymentDescription CreateComposeDeploymentDescription, timeout *int64) (*http.Request, error) {
850	const APIVersion = "6.0-preview"
851	queryParameters := map[string]interface{}{
852		"api-version": APIVersion,
853	}
854	if timeout != nil {
855		queryParameters["timeout"] = autorest.Encode("query", *timeout)
856	} else {
857		queryParameters["timeout"] = autorest.Encode("query", 60)
858	}
859
860	preparer := autorest.CreatePreparer(
861		autorest.AsContentType("application/json; charset=utf-8"),
862		autorest.AsPut(),
863		autorest.WithBaseURL(client.BaseURI),
864		autorest.WithPath("/ComposeDeployments/$/Create"),
865		autorest.WithJSON(createComposeDeploymentDescription),
866		autorest.WithQueryParameters(queryParameters))
867	return preparer.Prepare((&http.Request{}).WithContext(ctx))
868}
869
870// CreateComposeDeploymentSender sends the CreateComposeDeployment request. The method will close the
871// http.Response Body if it receives an error.
872func (client BaseClient) CreateComposeDeploymentSender(req *http.Request) (*http.Response, error) {
873	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
874}
875
876// CreateComposeDeploymentResponder handles the response to the CreateComposeDeployment request. The method always
877// closes the http.Response Body.
878func (client BaseClient) CreateComposeDeploymentResponder(resp *http.Response) (result autorest.Response, err error) {
879	err = autorest.Respond(
880		resp,
881		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
882		autorest.ByClosing())
883	result.Response = resp
884	return
885}
886
887// CreateName creates the specified Service Fabric name.
888// Parameters:
889// nameDescription - describes the Service Fabric name to be created.
890// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
891// duration that the client is willing to wait for the requested operation to complete. The default value for
892// this parameter is 60 seconds.
893func (client BaseClient) CreateName(ctx context.Context, nameDescription NameDescription, timeout *int64) (result autorest.Response, err error) {
894	if tracing.IsEnabled() {
895		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateName")
896		defer func() {
897			sc := -1
898			if result.Response != nil {
899				sc = result.Response.StatusCode
900			}
901			tracing.EndSpan(ctx, sc, err)
902		}()
903	}
904	if err := validation.Validate([]validation.Validation{
905		{TargetValue: nameDescription,
906			Constraints: []validation.Constraint{{Target: "nameDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}},
907		{TargetValue: timeout,
908			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
909				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
910					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
911				}}}}}); err != nil {
912		return result, validation.NewError("servicefabric.BaseClient", "CreateName", err.Error())
913	}
914
915	req, err := client.CreateNamePreparer(ctx, nameDescription, timeout)
916	if err != nil {
917		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", nil, "Failure preparing request")
918		return
919	}
920
921	resp, err := client.CreateNameSender(req)
922	if err != nil {
923		result.Response = resp
924		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", resp, "Failure sending request")
925		return
926	}
927
928	result, err = client.CreateNameResponder(resp)
929	if err != nil {
930		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", resp, "Failure responding to request")
931		return
932	}
933
934	return
935}
936
937// CreateNamePreparer prepares the CreateName request.
938func (client BaseClient) CreateNamePreparer(ctx context.Context, nameDescription NameDescription, timeout *int64) (*http.Request, error) {
939	const APIVersion = "6.0"
940	queryParameters := map[string]interface{}{
941		"api-version": APIVersion,
942	}
943	if timeout != nil {
944		queryParameters["timeout"] = autorest.Encode("query", *timeout)
945	} else {
946		queryParameters["timeout"] = autorest.Encode("query", 60)
947	}
948
949	preparer := autorest.CreatePreparer(
950		autorest.AsContentType("application/json; charset=utf-8"),
951		autorest.AsPost(),
952		autorest.WithBaseURL(client.BaseURI),
953		autorest.WithPath("/Names/$/Create"),
954		autorest.WithJSON(nameDescription),
955		autorest.WithQueryParameters(queryParameters))
956	return preparer.Prepare((&http.Request{}).WithContext(ctx))
957}
958
959// CreateNameSender sends the CreateName request. The method will close the
960// http.Response Body if it receives an error.
961func (client BaseClient) CreateNameSender(req *http.Request) (*http.Response, error) {
962	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
963}
964
965// CreateNameResponder handles the response to the CreateName request. The method always
966// closes the http.Response Body.
967func (client BaseClient) CreateNameResponder(resp *http.Response) (result autorest.Response, err error) {
968	err = autorest.Respond(
969		resp,
970		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
971		autorest.ByClosing())
972	result.Response = resp
973	return
974}
975
976// CreateRepairTask for clusters that have the Repair Manager Service configured,
977// this API provides a way to create repair tasks that run automatically or manually.
978// For repair tasks that run automatically, an appropriate repair executor
979// must be running for each repair action to run automatically.
980// These are currently only available in specially-configured Azure Cloud Services.
981//
982// To create a manual repair task, provide the set of impacted node names and the
983// expected impact. When the state of the created repair task changes to approved,
984// you can safely perform repair actions on those nodes.
985//
986// This API supports the Service Fabric platform; it is not meant to be used directly from your code.
987// Parameters:
988// repairTask - describes the repair task to be created or updated.
989func (client BaseClient) CreateRepairTask(ctx context.Context, repairTask RepairTask) (result RepairTaskUpdateInfo, err error) {
990	if tracing.IsEnabled() {
991		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateRepairTask")
992		defer func() {
993			sc := -1
994			if result.Response.Response != nil {
995				sc = result.Response.Response.StatusCode
996			}
997			tracing.EndSpan(ctx, sc, err)
998		}()
999	}
1000	if err := validation.Validate([]validation.Validation{
1001		{TargetValue: repairTask,
1002			Constraints: []validation.Constraint{{Target: "repairTask.TaskID", Name: validation.Null, Rule: true, Chain: nil},
1003				{Target: "repairTask.Action", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
1004		return result, validation.NewError("servicefabric.BaseClient", "CreateRepairTask", err.Error())
1005	}
1006
1007	req, err := client.CreateRepairTaskPreparer(ctx, repairTask)
1008	if err != nil {
1009		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", nil, "Failure preparing request")
1010		return
1011	}
1012
1013	resp, err := client.CreateRepairTaskSender(req)
1014	if err != nil {
1015		result.Response = autorest.Response{Response: resp}
1016		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", resp, "Failure sending request")
1017		return
1018	}
1019
1020	result, err = client.CreateRepairTaskResponder(resp)
1021	if err != nil {
1022		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", resp, "Failure responding to request")
1023		return
1024	}
1025
1026	return
1027}
1028
1029// CreateRepairTaskPreparer prepares the CreateRepairTask request.
1030func (client BaseClient) CreateRepairTaskPreparer(ctx context.Context, repairTask RepairTask) (*http.Request, error) {
1031	const APIVersion = "6.0"
1032	queryParameters := map[string]interface{}{
1033		"api-version": APIVersion,
1034	}
1035
1036	preparer := autorest.CreatePreparer(
1037		autorest.AsContentType("application/json; charset=utf-8"),
1038		autorest.AsPost(),
1039		autorest.WithBaseURL(client.BaseURI),
1040		autorest.WithPath("/$/CreateRepairTask"),
1041		autorest.WithJSON(repairTask),
1042		autorest.WithQueryParameters(queryParameters))
1043	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1044}
1045
1046// CreateRepairTaskSender sends the CreateRepairTask request. The method will close the
1047// http.Response Body if it receives an error.
1048func (client BaseClient) CreateRepairTaskSender(req *http.Request) (*http.Response, error) {
1049	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1050}
1051
1052// CreateRepairTaskResponder handles the response to the CreateRepairTask request. The method always
1053// closes the http.Response Body.
1054func (client BaseClient) CreateRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
1055	err = autorest.Respond(
1056		resp,
1057		azure.WithErrorUnlessStatusCode(http.StatusOK),
1058		autorest.ByUnmarshallingJSON(&result),
1059		autorest.ByClosing())
1060	result.Response = autorest.Response{Response: resp}
1061	return
1062}
1063
1064// CreateService this api allows creating a new Service Fabric stateless or stateful service under a specified Service
1065// Fabric application. The description for creating the service includes partitioning information and optional
1066// properties for placement and load balancing. Some of the properties can later be modified using `UpdateService` API.
1067// Parameters:
1068// applicationID - the identity of the application. This is typically the full name of the application without
1069// the 'fabric:' URI scheme.
1070// Starting from version 6.0, hierarchical names are delimited with the "~" character.
1071// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
1072// in 6.0+ and "myapp/app1" in previous versions.
1073// serviceDescription - the information necessary to create a service.
1074// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1075// duration that the client is willing to wait for the requested operation to complete. The default value for
1076// this parameter is 60 seconds.
1077func (client BaseClient) CreateService(ctx context.Context, applicationID string, serviceDescription BasicServiceDescription, timeout *int64) (result autorest.Response, err error) {
1078	if tracing.IsEnabled() {
1079		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateService")
1080		defer func() {
1081			sc := -1
1082			if result.Response != nil {
1083				sc = result.Response.StatusCode
1084			}
1085			tracing.EndSpan(ctx, sc, err)
1086		}()
1087	}
1088	if err := validation.Validate([]validation.Validation{
1089		{TargetValue: serviceDescription,
1090			Constraints: []validation.Constraint{{Target: "serviceDescription.ServiceName", Name: validation.Null, Rule: true, Chain: nil},
1091				{Target: "serviceDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}}},
1092		{TargetValue: timeout,
1093			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1094				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1095					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1096				}}}}}); err != nil {
1097		return result, validation.NewError("servicefabric.BaseClient", "CreateService", err.Error())
1098	}
1099
1100	req, err := client.CreateServicePreparer(ctx, applicationID, serviceDescription, timeout)
1101	if err != nil {
1102		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", nil, "Failure preparing request")
1103		return
1104	}
1105
1106	resp, err := client.CreateServiceSender(req)
1107	if err != nil {
1108		result.Response = resp
1109		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", resp, "Failure sending request")
1110		return
1111	}
1112
1113	result, err = client.CreateServiceResponder(resp)
1114	if err != nil {
1115		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", resp, "Failure responding to request")
1116		return
1117	}
1118
1119	return
1120}
1121
1122// CreateServicePreparer prepares the CreateService request.
1123func (client BaseClient) CreateServicePreparer(ctx context.Context, applicationID string, serviceDescription BasicServiceDescription, timeout *int64) (*http.Request, error) {
1124	pathParameters := map[string]interface{}{
1125		"applicationId": applicationID,
1126	}
1127
1128	const APIVersion = "6.0"
1129	queryParameters := map[string]interface{}{
1130		"api-version": APIVersion,
1131	}
1132	if timeout != nil {
1133		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1134	} else {
1135		queryParameters["timeout"] = autorest.Encode("query", 60)
1136	}
1137
1138	preparer := autorest.CreatePreparer(
1139		autorest.AsContentType("application/json; charset=utf-8"),
1140		autorest.AsPost(),
1141		autorest.WithBaseURL(client.BaseURI),
1142		autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/$/Create", pathParameters),
1143		autorest.WithJSON(serviceDescription),
1144		autorest.WithQueryParameters(queryParameters))
1145	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1146}
1147
1148// CreateServiceSender sends the CreateService request. The method will close the
1149// http.Response Body if it receives an error.
1150func (client BaseClient) CreateServiceSender(req *http.Request) (*http.Response, error) {
1151	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1152}
1153
1154// CreateServiceResponder handles the response to the CreateService request. The method always
1155// closes the http.Response Body.
1156func (client BaseClient) CreateServiceResponder(resp *http.Response) (result autorest.Response, err error) {
1157	err = autorest.Respond(
1158		resp,
1159		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
1160		autorest.ByClosing())
1161	result.Response = resp
1162	return
1163}
1164
1165// CreateServiceFromTemplate creates a Service Fabric service from the service template defined in the application
1166// manifest. A service template contains the properties that will be same for the service instance of the same type.
1167// The API allows overriding the properties that are usually different for different services of the same service type.
1168// Parameters:
1169// applicationID - the identity of the application. This is typically the full name of the application without
1170// the 'fabric:' URI scheme.
1171// Starting from version 6.0, hierarchical names are delimited with the "~" character.
1172// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
1173// in 6.0+ and "myapp/app1" in previous versions.
1174// serviceFromTemplateDescription - describes the service that needs to be created from the template defined in
1175// the application manifest.
1176// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1177// duration that the client is willing to wait for the requested operation to complete. The default value for
1178// this parameter is 60 seconds.
1179func (client BaseClient) CreateServiceFromTemplate(ctx context.Context, applicationID string, serviceFromTemplateDescription ServiceFromTemplateDescription, timeout *int64) (result autorest.Response, err error) {
1180	if tracing.IsEnabled() {
1181		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateServiceFromTemplate")
1182		defer func() {
1183			sc := -1
1184			if result.Response != nil {
1185				sc = result.Response.StatusCode
1186			}
1187			tracing.EndSpan(ctx, sc, err)
1188		}()
1189	}
1190	if err := validation.Validate([]validation.Validation{
1191		{TargetValue: serviceFromTemplateDescription,
1192			Constraints: []validation.Constraint{{Target: "serviceFromTemplateDescription.ApplicationName", Name: validation.Null, Rule: true, Chain: nil},
1193				{Target: "serviceFromTemplateDescription.ServiceName", Name: validation.Null, Rule: true, Chain: nil},
1194				{Target: "serviceFromTemplateDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}}},
1195		{TargetValue: timeout,
1196			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1197				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1198					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1199				}}}}}); err != nil {
1200		return result, validation.NewError("servicefabric.BaseClient", "CreateServiceFromTemplate", err.Error())
1201	}
1202
1203	req, err := client.CreateServiceFromTemplatePreparer(ctx, applicationID, serviceFromTemplateDescription, timeout)
1204	if err != nil {
1205		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", nil, "Failure preparing request")
1206		return
1207	}
1208
1209	resp, err := client.CreateServiceFromTemplateSender(req)
1210	if err != nil {
1211		result.Response = resp
1212		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", resp, "Failure sending request")
1213		return
1214	}
1215
1216	result, err = client.CreateServiceFromTemplateResponder(resp)
1217	if err != nil {
1218		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", resp, "Failure responding to request")
1219		return
1220	}
1221
1222	return
1223}
1224
1225// CreateServiceFromTemplatePreparer prepares the CreateServiceFromTemplate request.
1226func (client BaseClient) CreateServiceFromTemplatePreparer(ctx context.Context, applicationID string, serviceFromTemplateDescription ServiceFromTemplateDescription, timeout *int64) (*http.Request, error) {
1227	pathParameters := map[string]interface{}{
1228		"applicationId": applicationID,
1229	}
1230
1231	const APIVersion = "6.0"
1232	queryParameters := map[string]interface{}{
1233		"api-version": APIVersion,
1234	}
1235	if timeout != nil {
1236		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1237	} else {
1238		queryParameters["timeout"] = autorest.Encode("query", 60)
1239	}
1240
1241	preparer := autorest.CreatePreparer(
1242		autorest.AsContentType("application/json; charset=utf-8"),
1243		autorest.AsPost(),
1244		autorest.WithBaseURL(client.BaseURI),
1245		autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/$/CreateFromTemplate", pathParameters),
1246		autorest.WithJSON(serviceFromTemplateDescription),
1247		autorest.WithQueryParameters(queryParameters))
1248	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1249}
1250
1251// CreateServiceFromTemplateSender sends the CreateServiceFromTemplate request. The method will close the
1252// http.Response Body if it receives an error.
1253func (client BaseClient) CreateServiceFromTemplateSender(req *http.Request) (*http.Response, error) {
1254	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1255}
1256
1257// CreateServiceFromTemplateResponder handles the response to the CreateServiceFromTemplate request. The method always
1258// closes the http.Response Body.
1259func (client BaseClient) CreateServiceFromTemplateResponder(resp *http.Response) (result autorest.Response, err error) {
1260	err = autorest.Respond(
1261		resp,
1262		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
1263		autorest.ByClosing())
1264	result.Response = resp
1265	return
1266}
1267
1268// CreateVolumeResource creates a volume resource with the specified name and description. If a volume with the same
1269// name already exists, then its description is updated to the one indicated in this request.
1270// Parameters:
1271// volumeResourceName - service Fabric volume resource name.
1272// volumeResourceDescription - description for creating a volume resource.
1273func (client BaseClient) CreateVolumeResource(ctx context.Context, volumeResourceName string, volumeResourceDescription VolumeResourceDescription) (result autorest.Response, err error) {
1274	if tracing.IsEnabled() {
1275		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateVolumeResource")
1276		defer func() {
1277			sc := -1
1278			if result.Response != nil {
1279				sc = result.Response.StatusCode
1280			}
1281			tracing.EndSpan(ctx, sc, err)
1282		}()
1283	}
1284	if err := validation.Validate([]validation.Validation{
1285		{TargetValue: volumeResourceDescription,
1286			Constraints: []validation.Constraint{{Target: "volumeResourceDescription.VolumeProperties", Name: validation.Null, Rule: true,
1287				Chain: []validation.Constraint{{Target: "volumeResourceDescription.VolumeProperties.Provider", Name: validation.Null, Rule: true, Chain: nil},
1288					{Target: "volumeResourceDescription.VolumeProperties.AzureFileParameters", Name: validation.Null, Rule: false,
1289						Chain: []validation.Constraint{{Target: "volumeResourceDescription.VolumeProperties.AzureFileParameters.AccountName", Name: validation.Null, Rule: true, Chain: nil},
1290							{Target: "volumeResourceDescription.VolumeProperties.AzureFileParameters.ShareName", Name: validation.Null, Rule: true, Chain: nil},
1291						}},
1292				}},
1293				{Target: "volumeResourceDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
1294		return result, validation.NewError("servicefabric.BaseClient", "CreateVolumeResource", err.Error())
1295	}
1296
1297	req, err := client.CreateVolumeResourcePreparer(ctx, volumeResourceName, volumeResourceDescription)
1298	if err != nil {
1299		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateVolumeResource", nil, "Failure preparing request")
1300		return
1301	}
1302
1303	resp, err := client.CreateVolumeResourceSender(req)
1304	if err != nil {
1305		result.Response = resp
1306		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateVolumeResource", resp, "Failure sending request")
1307		return
1308	}
1309
1310	result, err = client.CreateVolumeResourceResponder(resp)
1311	if err != nil {
1312		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateVolumeResource", resp, "Failure responding to request")
1313		return
1314	}
1315
1316	return
1317}
1318
1319// CreateVolumeResourcePreparer prepares the CreateVolumeResource request.
1320func (client BaseClient) CreateVolumeResourcePreparer(ctx context.Context, volumeResourceName string, volumeResourceDescription VolumeResourceDescription) (*http.Request, error) {
1321	pathParameters := map[string]interface{}{
1322		"volumeResourceName": volumeResourceName,
1323	}
1324
1325	const APIVersion = "6.3-preview"
1326	queryParameters := map[string]interface{}{
1327		"api-version": APIVersion,
1328	}
1329
1330	preparer := autorest.CreatePreparer(
1331		autorest.AsContentType("application/json; charset=utf-8"),
1332		autorest.AsPut(),
1333		autorest.WithBaseURL(client.BaseURI),
1334		autorest.WithPathParameters("/Resources/Volumes/{volumeResourceName}", pathParameters),
1335		autorest.WithJSON(volumeResourceDescription),
1336		autorest.WithQueryParameters(queryParameters))
1337	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1338}
1339
1340// CreateVolumeResourceSender sends the CreateVolumeResource request. The method will close the
1341// http.Response Body if it receives an error.
1342func (client BaseClient) CreateVolumeResourceSender(req *http.Request) (*http.Response, error) {
1343	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1344}
1345
1346// CreateVolumeResourceResponder handles the response to the CreateVolumeResource request. The method always
1347// closes the http.Response Body.
1348func (client BaseClient) CreateVolumeResourceResponder(resp *http.Response) (result autorest.Response, err error) {
1349	err = autorest.Respond(
1350		resp,
1351		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
1352		autorest.ByClosing())
1353	result.Response = resp
1354	return
1355}
1356
1357// DeleteApplication an application must be created before it can be deleted. Deleting an application will delete all
1358// services that are part of that application. By default, Service Fabric will try to close service replicas in a
1359// graceful manner and then delete the service. However, if a service is having issues closing the replica gracefully,
1360// the delete operation may take a long time or get stuck. Use the optional ForceRemove flag to skip the graceful close
1361// sequence and forcefully delete the application and all of its services.
1362// Parameters:
1363// applicationID - the identity of the application. This is typically the full name of the application without
1364// the 'fabric:' URI scheme.
1365// Starting from version 6.0, hierarchical names are delimited with the "~" character.
1366// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
1367// in 6.0+ and "myapp/app1" in previous versions.
1368// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful
1369// shutdown sequence. This parameter can be used to forcefully delete an application or service for which
1370// delete is timing out due to issues in the service code that prevents graceful close of replicas.
1371// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1372// duration that the client is willing to wait for the requested operation to complete. The default value for
1373// this parameter is 60 seconds.
1374func (client BaseClient) DeleteApplication(ctx context.Context, applicationID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) {
1375	if tracing.IsEnabled() {
1376		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteApplication")
1377		defer func() {
1378			sc := -1
1379			if result.Response != nil {
1380				sc = result.Response.StatusCode
1381			}
1382			tracing.EndSpan(ctx, sc, err)
1383		}()
1384	}
1385	if err := validation.Validate([]validation.Validation{
1386		{TargetValue: timeout,
1387			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1388				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1389					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1390				}}}}}); err != nil {
1391		return result, validation.NewError("servicefabric.BaseClient", "DeleteApplication", err.Error())
1392	}
1393
1394	req, err := client.DeleteApplicationPreparer(ctx, applicationID, forceRemove, timeout)
1395	if err != nil {
1396		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", nil, "Failure preparing request")
1397		return
1398	}
1399
1400	resp, err := client.DeleteApplicationSender(req)
1401	if err != nil {
1402		result.Response = resp
1403		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", resp, "Failure sending request")
1404		return
1405	}
1406
1407	result, err = client.DeleteApplicationResponder(resp)
1408	if err != nil {
1409		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", resp, "Failure responding to request")
1410		return
1411	}
1412
1413	return
1414}
1415
1416// DeleteApplicationPreparer prepares the DeleteApplication request.
1417func (client BaseClient) DeleteApplicationPreparer(ctx context.Context, applicationID string, forceRemove *bool, timeout *int64) (*http.Request, error) {
1418	pathParameters := map[string]interface{}{
1419		"applicationId": applicationID,
1420	}
1421
1422	const APIVersion = "6.0"
1423	queryParameters := map[string]interface{}{
1424		"api-version": APIVersion,
1425	}
1426	if forceRemove != nil {
1427		queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove)
1428	}
1429	if timeout != nil {
1430		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1431	} else {
1432		queryParameters["timeout"] = autorest.Encode("query", 60)
1433	}
1434
1435	preparer := autorest.CreatePreparer(
1436		autorest.AsPost(),
1437		autorest.WithBaseURL(client.BaseURI),
1438		autorest.WithPathParameters("/Applications/{applicationId}/$/Delete", pathParameters),
1439		autorest.WithQueryParameters(queryParameters))
1440	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1441}
1442
1443// DeleteApplicationSender sends the DeleteApplication request. The method will close the
1444// http.Response Body if it receives an error.
1445func (client BaseClient) DeleteApplicationSender(req *http.Request) (*http.Response, error) {
1446	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1447}
1448
1449// DeleteApplicationResponder handles the response to the DeleteApplication request. The method always
1450// closes the http.Response Body.
1451func (client BaseClient) DeleteApplicationResponder(resp *http.Response) (result autorest.Response, err error) {
1452	err = autorest.Respond(
1453		resp,
1454		azure.WithErrorUnlessStatusCode(http.StatusOK),
1455		autorest.ByClosing())
1456	result.Response = resp
1457	return
1458}
1459
1460// DeleteApplicationResource deletes the application identified by the name.
1461// Parameters:
1462// applicationResourceName - service Fabric application resource name.
1463func (client BaseClient) DeleteApplicationResource(ctx context.Context, applicationResourceName string) (result autorest.Response, err error) {
1464	if tracing.IsEnabled() {
1465		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteApplicationResource")
1466		defer func() {
1467			sc := -1
1468			if result.Response != nil {
1469				sc = result.Response.StatusCode
1470			}
1471			tracing.EndSpan(ctx, sc, err)
1472		}()
1473	}
1474	req, err := client.DeleteApplicationResourcePreparer(ctx, applicationResourceName)
1475	if err != nil {
1476		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplicationResource", nil, "Failure preparing request")
1477		return
1478	}
1479
1480	resp, err := client.DeleteApplicationResourceSender(req)
1481	if err != nil {
1482		result.Response = resp
1483		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplicationResource", resp, "Failure sending request")
1484		return
1485	}
1486
1487	result, err = client.DeleteApplicationResourceResponder(resp)
1488	if err != nil {
1489		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplicationResource", resp, "Failure responding to request")
1490		return
1491	}
1492
1493	return
1494}
1495
1496// DeleteApplicationResourcePreparer prepares the DeleteApplicationResource request.
1497func (client BaseClient) DeleteApplicationResourcePreparer(ctx context.Context, applicationResourceName string) (*http.Request, error) {
1498	pathParameters := map[string]interface{}{
1499		"applicationResourceName": applicationResourceName,
1500	}
1501
1502	const APIVersion = "6.3-preview"
1503	queryParameters := map[string]interface{}{
1504		"api-version": APIVersion,
1505	}
1506
1507	preparer := autorest.CreatePreparer(
1508		autorest.AsDelete(),
1509		autorest.WithBaseURL(client.BaseURI),
1510		autorest.WithPathParameters("/Resources/Applications/{applicationResourceName}", pathParameters),
1511		autorest.WithQueryParameters(queryParameters))
1512	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1513}
1514
1515// DeleteApplicationResourceSender sends the DeleteApplicationResource request. The method will close the
1516// http.Response Body if it receives an error.
1517func (client BaseClient) DeleteApplicationResourceSender(req *http.Request) (*http.Response, error) {
1518	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1519}
1520
1521// DeleteApplicationResourceResponder handles the response to the DeleteApplicationResource request. The method always
1522// closes the http.Response Body.
1523func (client BaseClient) DeleteApplicationResourceResponder(resp *http.Response) (result autorest.Response, err error) {
1524	err = autorest.Respond(
1525		resp,
1526		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
1527		autorest.ByClosing())
1528	result.Response = resp
1529	return
1530}
1531
1532// DeleteBackupPolicy deletes an existing backup policy. A backup policy must be created before it can be deleted. A
1533// currently active backup policy, associated with any Service Fabric application, service or partition, cannot be
1534// deleted without first deleting the mapping.
1535// Parameters:
1536// backupPolicyName - the name of the backup policy.
1537// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1538// duration that the client is willing to wait for the requested operation to complete. The default value for
1539// this parameter is 60 seconds.
1540func (client BaseClient) DeleteBackupPolicy(ctx context.Context, backupPolicyName string, timeout *int64) (result autorest.Response, err error) {
1541	if tracing.IsEnabled() {
1542		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteBackupPolicy")
1543		defer func() {
1544			sc := -1
1545			if result.Response != nil {
1546				sc = result.Response.StatusCode
1547			}
1548			tracing.EndSpan(ctx, sc, err)
1549		}()
1550	}
1551	if err := validation.Validate([]validation.Validation{
1552		{TargetValue: timeout,
1553			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1554				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1555					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1556				}}}}}); err != nil {
1557		return result, validation.NewError("servicefabric.BaseClient", "DeleteBackupPolicy", err.Error())
1558	}
1559
1560	req, err := client.DeleteBackupPolicyPreparer(ctx, backupPolicyName, timeout)
1561	if err != nil {
1562		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", nil, "Failure preparing request")
1563		return
1564	}
1565
1566	resp, err := client.DeleteBackupPolicySender(req)
1567	if err != nil {
1568		result.Response = resp
1569		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", resp, "Failure sending request")
1570		return
1571	}
1572
1573	result, err = client.DeleteBackupPolicyResponder(resp)
1574	if err != nil {
1575		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", resp, "Failure responding to request")
1576		return
1577	}
1578
1579	return
1580}
1581
1582// DeleteBackupPolicyPreparer prepares the DeleteBackupPolicy request.
1583func (client BaseClient) DeleteBackupPolicyPreparer(ctx context.Context, backupPolicyName string, timeout *int64) (*http.Request, error) {
1584	pathParameters := map[string]interface{}{
1585		"backupPolicyName": autorest.Encode("path", backupPolicyName),
1586	}
1587
1588	const APIVersion = "6.2-preview"
1589	queryParameters := map[string]interface{}{
1590		"api-version": APIVersion,
1591	}
1592	if timeout != nil {
1593		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1594	} else {
1595		queryParameters["timeout"] = autorest.Encode("query", 60)
1596	}
1597
1598	preparer := autorest.CreatePreparer(
1599		autorest.AsPost(),
1600		autorest.WithBaseURL(client.BaseURI),
1601		autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/Delete", pathParameters),
1602		autorest.WithQueryParameters(queryParameters))
1603	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1604}
1605
1606// DeleteBackupPolicySender sends the DeleteBackupPolicy request. The method will close the
1607// http.Response Body if it receives an error.
1608func (client BaseClient) DeleteBackupPolicySender(req *http.Request) (*http.Response, error) {
1609	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1610}
1611
1612// DeleteBackupPolicyResponder handles the response to the DeleteBackupPolicy request. The method always
1613// closes the http.Response Body.
1614func (client BaseClient) DeleteBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
1615	err = autorest.Respond(
1616		resp,
1617		azure.WithErrorUnlessStatusCode(http.StatusOK),
1618		autorest.ByClosing())
1619	result.Response = resp
1620	return
1621}
1622
1623// DeleteImageStoreContent deletes existing image store content being found within the given image store relative path.
1624// This can be used to delete uploaded application packages once they are provisioned.
1625// Parameters:
1626// contentPath - relative path to file or folder in the image store from its root.
1627// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1628// duration that the client is willing to wait for the requested operation to complete. The default value for
1629// this parameter is 60 seconds.
1630func (client BaseClient) DeleteImageStoreContent(ctx context.Context, contentPath string, timeout *int64) (result autorest.Response, err error) {
1631	if tracing.IsEnabled() {
1632		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImageStoreContent")
1633		defer func() {
1634			sc := -1
1635			if result.Response != nil {
1636				sc = result.Response.StatusCode
1637			}
1638			tracing.EndSpan(ctx, sc, err)
1639		}()
1640	}
1641	if err := validation.Validate([]validation.Validation{
1642		{TargetValue: timeout,
1643			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1644				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1645					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1646				}}}}}); err != nil {
1647		return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreContent", err.Error())
1648	}
1649
1650	req, err := client.DeleteImageStoreContentPreparer(ctx, contentPath, timeout)
1651	if err != nil {
1652		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", nil, "Failure preparing request")
1653		return
1654	}
1655
1656	resp, err := client.DeleteImageStoreContentSender(req)
1657	if err != nil {
1658		result.Response = resp
1659		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", resp, "Failure sending request")
1660		return
1661	}
1662
1663	result, err = client.DeleteImageStoreContentResponder(resp)
1664	if err != nil {
1665		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", resp, "Failure responding to request")
1666		return
1667	}
1668
1669	return
1670}
1671
1672// DeleteImageStoreContentPreparer prepares the DeleteImageStoreContent request.
1673func (client BaseClient) DeleteImageStoreContentPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) {
1674	pathParameters := map[string]interface{}{
1675		"contentPath": autorest.Encode("path", contentPath),
1676	}
1677
1678	const APIVersion = "6.0"
1679	queryParameters := map[string]interface{}{
1680		"api-version": APIVersion,
1681	}
1682	if timeout != nil {
1683		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1684	} else {
1685		queryParameters["timeout"] = autorest.Encode("query", 60)
1686	}
1687
1688	preparer := autorest.CreatePreparer(
1689		autorest.AsDelete(),
1690		autorest.WithBaseURL(client.BaseURI),
1691		autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters),
1692		autorest.WithQueryParameters(queryParameters))
1693	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1694}
1695
1696// DeleteImageStoreContentSender sends the DeleteImageStoreContent request. The method will close the
1697// http.Response Body if it receives an error.
1698func (client BaseClient) DeleteImageStoreContentSender(req *http.Request) (*http.Response, error) {
1699	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1700}
1701
1702// DeleteImageStoreContentResponder handles the response to the DeleteImageStoreContent request. The method always
1703// closes the http.Response Body.
1704func (client BaseClient) DeleteImageStoreContentResponder(resp *http.Response) (result autorest.Response, err error) {
1705	err = autorest.Respond(
1706		resp,
1707		azure.WithErrorUnlessStatusCode(http.StatusOK),
1708		autorest.ByClosing())
1709	result.Response = resp
1710	return
1711}
1712
1713// DeleteImageStoreUploadSession the DELETE request will cause the existing upload session to expire and remove any
1714// previously uploaded file chunks.
1715// Parameters:
1716// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session
1717// which keeps track of all file chunks until it is committed.
1718// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1719// duration that the client is willing to wait for the requested operation to complete. The default value for
1720// this parameter is 60 seconds.
1721func (client BaseClient) DeleteImageStoreUploadSession(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
1722	if tracing.IsEnabled() {
1723		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImageStoreUploadSession")
1724		defer func() {
1725			sc := -1
1726			if result.Response != nil {
1727				sc = result.Response.StatusCode
1728			}
1729			tracing.EndSpan(ctx, sc, err)
1730		}()
1731	}
1732	if err := validation.Validate([]validation.Validation{
1733		{TargetValue: timeout,
1734			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1735				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1736					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1737				}}}}}); err != nil {
1738		return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreUploadSession", err.Error())
1739	}
1740
1741	req, err := client.DeleteImageStoreUploadSessionPreparer(ctx, sessionID, timeout)
1742	if err != nil {
1743		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", nil, "Failure preparing request")
1744		return
1745	}
1746
1747	resp, err := client.DeleteImageStoreUploadSessionSender(req)
1748	if err != nil {
1749		result.Response = resp
1750		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", resp, "Failure sending request")
1751		return
1752	}
1753
1754	result, err = client.DeleteImageStoreUploadSessionResponder(resp)
1755	if err != nil {
1756		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", resp, "Failure responding to request")
1757		return
1758	}
1759
1760	return
1761}
1762
1763// DeleteImageStoreUploadSessionPreparer prepares the DeleteImageStoreUploadSession request.
1764func (client BaseClient) DeleteImageStoreUploadSessionPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) {
1765	const APIVersion = "6.0"
1766	queryParameters := map[string]interface{}{
1767		"api-version": APIVersion,
1768		"session-id":  autorest.Encode("query", sessionID),
1769	}
1770	if timeout != nil {
1771		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1772	} else {
1773		queryParameters["timeout"] = autorest.Encode("query", 60)
1774	}
1775
1776	preparer := autorest.CreatePreparer(
1777		autorest.AsDelete(),
1778		autorest.WithBaseURL(client.BaseURI),
1779		autorest.WithPath("/ImageStore/$/DeleteUploadSession"),
1780		autorest.WithQueryParameters(queryParameters))
1781	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1782}
1783
1784// DeleteImageStoreUploadSessionSender sends the DeleteImageStoreUploadSession request. The method will close the
1785// http.Response Body if it receives an error.
1786func (client BaseClient) DeleteImageStoreUploadSessionSender(req *http.Request) (*http.Response, error) {
1787	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1788}
1789
1790// DeleteImageStoreUploadSessionResponder handles the response to the DeleteImageStoreUploadSession request. The method always
1791// closes the http.Response Body.
1792func (client BaseClient) DeleteImageStoreUploadSessionResponder(resp *http.Response) (result autorest.Response, err error) {
1793	err = autorest.Respond(
1794		resp,
1795		azure.WithErrorUnlessStatusCode(http.StatusOK),
1796		autorest.ByClosing())
1797	result.Response = resp
1798	return
1799}
1800
1801// DeleteName deletes the specified Service Fabric name. A name must be created before it can be deleted. Deleting a
1802// name with child properties will fail.
1803// Parameters:
1804// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
1805// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1806// duration that the client is willing to wait for the requested operation to complete. The default value for
1807// this parameter is 60 seconds.
1808func (client BaseClient) DeleteName(ctx context.Context, nameID string, timeout *int64) (result autorest.Response, err error) {
1809	if tracing.IsEnabled() {
1810		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteName")
1811		defer func() {
1812			sc := -1
1813			if result.Response != nil {
1814				sc = result.Response.StatusCode
1815			}
1816			tracing.EndSpan(ctx, sc, err)
1817		}()
1818	}
1819	if err := validation.Validate([]validation.Validation{
1820		{TargetValue: timeout,
1821			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1822				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1823					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1824				}}}}}); err != nil {
1825		return result, validation.NewError("servicefabric.BaseClient", "DeleteName", err.Error())
1826	}
1827
1828	req, err := client.DeleteNamePreparer(ctx, nameID, timeout)
1829	if err != nil {
1830		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", nil, "Failure preparing request")
1831		return
1832	}
1833
1834	resp, err := client.DeleteNameSender(req)
1835	if err != nil {
1836		result.Response = resp
1837		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", resp, "Failure sending request")
1838		return
1839	}
1840
1841	result, err = client.DeleteNameResponder(resp)
1842	if err != nil {
1843		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", resp, "Failure responding to request")
1844		return
1845	}
1846
1847	return
1848}
1849
1850// DeleteNamePreparer prepares the DeleteName request.
1851func (client BaseClient) DeleteNamePreparer(ctx context.Context, nameID string, timeout *int64) (*http.Request, error) {
1852	pathParameters := map[string]interface{}{
1853		"nameId": nameID,
1854	}
1855
1856	const APIVersion = "6.0"
1857	queryParameters := map[string]interface{}{
1858		"api-version": APIVersion,
1859	}
1860	if timeout != nil {
1861		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1862	} else {
1863		queryParameters["timeout"] = autorest.Encode("query", 60)
1864	}
1865
1866	preparer := autorest.CreatePreparer(
1867		autorest.AsDelete(),
1868		autorest.WithBaseURL(client.BaseURI),
1869		autorest.WithPathParameters("/Names/{nameId}", pathParameters),
1870		autorest.WithQueryParameters(queryParameters))
1871	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1872}
1873
1874// DeleteNameSender sends the DeleteName request. The method will close the
1875// http.Response Body if it receives an error.
1876func (client BaseClient) DeleteNameSender(req *http.Request) (*http.Response, error) {
1877	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1878}
1879
1880// DeleteNameResponder handles the response to the DeleteName request. The method always
1881// closes the http.Response Body.
1882func (client BaseClient) DeleteNameResponder(resp *http.Response) (result autorest.Response, err error) {
1883	err = autorest.Respond(
1884		resp,
1885		azure.WithErrorUnlessStatusCode(http.StatusOK),
1886		autorest.ByClosing())
1887	result.Response = resp
1888	return
1889}
1890
1891// DeleteProperty deletes the specified Service Fabric property under a given name. A property must be created before
1892// it can be deleted.
1893// Parameters:
1894// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
1895// propertyName - specifies the name of the property to get.
1896// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1897// duration that the client is willing to wait for the requested operation to complete. The default value for
1898// this parameter is 60 seconds.
1899func (client BaseClient) DeleteProperty(ctx context.Context, nameID string, propertyName string, timeout *int64) (result autorest.Response, err error) {
1900	if tracing.IsEnabled() {
1901		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteProperty")
1902		defer func() {
1903			sc := -1
1904			if result.Response != nil {
1905				sc = result.Response.StatusCode
1906			}
1907			tracing.EndSpan(ctx, sc, err)
1908		}()
1909	}
1910	if err := validation.Validate([]validation.Validation{
1911		{TargetValue: timeout,
1912			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1913				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1914					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1915				}}}}}); err != nil {
1916		return result, validation.NewError("servicefabric.BaseClient", "DeleteProperty", err.Error())
1917	}
1918
1919	req, err := client.DeletePropertyPreparer(ctx, nameID, propertyName, timeout)
1920	if err != nil {
1921		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", nil, "Failure preparing request")
1922		return
1923	}
1924
1925	resp, err := client.DeletePropertySender(req)
1926	if err != nil {
1927		result.Response = resp
1928		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", resp, "Failure sending request")
1929		return
1930	}
1931
1932	result, err = client.DeletePropertyResponder(resp)
1933	if err != nil {
1934		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", resp, "Failure responding to request")
1935		return
1936	}
1937
1938	return
1939}
1940
1941// DeletePropertyPreparer prepares the DeleteProperty request.
1942func (client BaseClient) DeletePropertyPreparer(ctx context.Context, nameID string, propertyName string, timeout *int64) (*http.Request, error) {
1943	pathParameters := map[string]interface{}{
1944		"nameId": nameID,
1945	}
1946
1947	const APIVersion = "6.0"
1948	queryParameters := map[string]interface{}{
1949		"api-version":  APIVersion,
1950		"PropertyName": autorest.Encode("query", propertyName),
1951	}
1952	if timeout != nil {
1953		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1954	} else {
1955		queryParameters["timeout"] = autorest.Encode("query", 60)
1956	}
1957
1958	preparer := autorest.CreatePreparer(
1959		autorest.AsDelete(),
1960		autorest.WithBaseURL(client.BaseURI),
1961		autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters),
1962		autorest.WithQueryParameters(queryParameters))
1963	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1964}
1965
1966// DeletePropertySender sends the DeleteProperty request. The method will close the
1967// http.Response Body if it receives an error.
1968func (client BaseClient) DeletePropertySender(req *http.Request) (*http.Response, error) {
1969	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1970}
1971
1972// DeletePropertyResponder handles the response to the DeleteProperty request. The method always
1973// closes the http.Response Body.
1974func (client BaseClient) DeletePropertyResponder(resp *http.Response) (result autorest.Response, err error) {
1975	err = autorest.Respond(
1976		resp,
1977		azure.WithErrorUnlessStatusCode(http.StatusOK),
1978		autorest.ByClosing())
1979	result.Response = resp
1980	return
1981}
1982
1983// DeleteRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your code.
1984// Parameters:
1985// repairTaskDeleteDescription - describes the repair task to be deleted.
1986func (client BaseClient) DeleteRepairTask(ctx context.Context, repairTaskDeleteDescription RepairTaskDeleteDescription) (result autorest.Response, err error) {
1987	if tracing.IsEnabled() {
1988		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteRepairTask")
1989		defer func() {
1990			sc := -1
1991			if result.Response != nil {
1992				sc = result.Response.StatusCode
1993			}
1994			tracing.EndSpan(ctx, sc, err)
1995		}()
1996	}
1997	if err := validation.Validate([]validation.Validation{
1998		{TargetValue: repairTaskDeleteDescription,
1999			Constraints: []validation.Constraint{{Target: "repairTaskDeleteDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
2000		return result, validation.NewError("servicefabric.BaseClient", "DeleteRepairTask", err.Error())
2001	}
2002
2003	req, err := client.DeleteRepairTaskPreparer(ctx, repairTaskDeleteDescription)
2004	if err != nil {
2005		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", nil, "Failure preparing request")
2006		return
2007	}
2008
2009	resp, err := client.DeleteRepairTaskSender(req)
2010	if err != nil {
2011		result.Response = resp
2012		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", resp, "Failure sending request")
2013		return
2014	}
2015
2016	result, err = client.DeleteRepairTaskResponder(resp)
2017	if err != nil {
2018		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", resp, "Failure responding to request")
2019		return
2020	}
2021
2022	return
2023}
2024
2025// DeleteRepairTaskPreparer prepares the DeleteRepairTask request.
2026func (client BaseClient) DeleteRepairTaskPreparer(ctx context.Context, repairTaskDeleteDescription RepairTaskDeleteDescription) (*http.Request, error) {
2027	const APIVersion = "6.0"
2028	queryParameters := map[string]interface{}{
2029		"api-version": APIVersion,
2030	}
2031
2032	preparer := autorest.CreatePreparer(
2033		autorest.AsContentType("application/json; charset=utf-8"),
2034		autorest.AsPost(),
2035		autorest.WithBaseURL(client.BaseURI),
2036		autorest.WithPath("/$/DeleteRepairTask"),
2037		autorest.WithJSON(repairTaskDeleteDescription),
2038		autorest.WithQueryParameters(queryParameters))
2039	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2040}
2041
2042// DeleteRepairTaskSender sends the DeleteRepairTask request. The method will close the
2043// http.Response Body if it receives an error.
2044func (client BaseClient) DeleteRepairTaskSender(req *http.Request) (*http.Response, error) {
2045	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2046}
2047
2048// DeleteRepairTaskResponder handles the response to the DeleteRepairTask request. The method always
2049// closes the http.Response Body.
2050func (client BaseClient) DeleteRepairTaskResponder(resp *http.Response) (result autorest.Response, err error) {
2051	err = autorest.Respond(
2052		resp,
2053		azure.WithErrorUnlessStatusCode(http.StatusOK),
2054		autorest.ByClosing())
2055	result.Response = resp
2056	return
2057}
2058
2059// DeleteService a service must be created before it can be deleted. By default, Service Fabric will try to close
2060// service replicas in a graceful manner and then delete the service. However, if the service is having issues closing
2061// the replica gracefully, the delete operation may take a long time or get stuck. Use the optional ForceRemove flag to
2062// skip the graceful close sequence and forcefully delete the service.
2063// Parameters:
2064// serviceID - the identity of the service. This ID is typically the full name of the service without the
2065// 'fabric:' URI scheme.
2066// Starting from version 6.0, hierarchical names are delimited with the "~" character.
2067// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
2068// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
2069// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful
2070// shutdown sequence. This parameter can be used to forcefully delete an application or service for which
2071// delete is timing out due to issues in the service code that prevents graceful close of replicas.
2072// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2073// duration that the client is willing to wait for the requested operation to complete. The default value for
2074// this parameter is 60 seconds.
2075func (client BaseClient) DeleteService(ctx context.Context, serviceID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) {
2076	if tracing.IsEnabled() {
2077		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteService")
2078		defer func() {
2079			sc := -1
2080			if result.Response != nil {
2081				sc = result.Response.StatusCode
2082			}
2083			tracing.EndSpan(ctx, sc, err)
2084		}()
2085	}
2086	if err := validation.Validate([]validation.Validation{
2087		{TargetValue: timeout,
2088			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2089				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2090					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2091				}}}}}); err != nil {
2092		return result, validation.NewError("servicefabric.BaseClient", "DeleteService", err.Error())
2093	}
2094
2095	req, err := client.DeleteServicePreparer(ctx, serviceID, forceRemove, timeout)
2096	if err != nil {
2097		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", nil, "Failure preparing request")
2098		return
2099	}
2100
2101	resp, err := client.DeleteServiceSender(req)
2102	if err != nil {
2103		result.Response = resp
2104		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", resp, "Failure sending request")
2105		return
2106	}
2107
2108	result, err = client.DeleteServiceResponder(resp)
2109	if err != nil {
2110		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", resp, "Failure responding to request")
2111		return
2112	}
2113
2114	return
2115}
2116
2117// DeleteServicePreparer prepares the DeleteService request.
2118func (client BaseClient) DeleteServicePreparer(ctx context.Context, serviceID string, forceRemove *bool, timeout *int64) (*http.Request, error) {
2119	pathParameters := map[string]interface{}{
2120		"serviceId": serviceID,
2121	}
2122
2123	const APIVersion = "6.0"
2124	queryParameters := map[string]interface{}{
2125		"api-version": APIVersion,
2126	}
2127	if forceRemove != nil {
2128		queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove)
2129	}
2130	if timeout != nil {
2131		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2132	} else {
2133		queryParameters["timeout"] = autorest.Encode("query", 60)
2134	}
2135
2136	preparer := autorest.CreatePreparer(
2137		autorest.AsPost(),
2138		autorest.WithBaseURL(client.BaseURI),
2139		autorest.WithPathParameters("/Services/{serviceId}/$/Delete", pathParameters),
2140		autorest.WithQueryParameters(queryParameters))
2141	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2142}
2143
2144// DeleteServiceSender sends the DeleteService request. The method will close the
2145// http.Response Body if it receives an error.
2146func (client BaseClient) DeleteServiceSender(req *http.Request) (*http.Response, error) {
2147	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2148}
2149
2150// DeleteServiceResponder handles the response to the DeleteService request. The method always
2151// closes the http.Response Body.
2152func (client BaseClient) DeleteServiceResponder(resp *http.Response) (result autorest.Response, err error) {
2153	err = autorest.Respond(
2154		resp,
2155		azure.WithErrorUnlessStatusCode(http.StatusOK),
2156		autorest.ByClosing())
2157	result.Response = resp
2158	return
2159}
2160
2161// DeleteVolumeResource deletes the volume identified by the name.
2162// Parameters:
2163// volumeResourceName - service Fabric volume resource name.
2164func (client BaseClient) DeleteVolumeResource(ctx context.Context, volumeResourceName string) (result autorest.Response, err error) {
2165	if tracing.IsEnabled() {
2166		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteVolumeResource")
2167		defer func() {
2168			sc := -1
2169			if result.Response != nil {
2170				sc = result.Response.StatusCode
2171			}
2172			tracing.EndSpan(ctx, sc, err)
2173		}()
2174	}
2175	req, err := client.DeleteVolumeResourcePreparer(ctx, volumeResourceName)
2176	if err != nil {
2177		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteVolumeResource", nil, "Failure preparing request")
2178		return
2179	}
2180
2181	resp, err := client.DeleteVolumeResourceSender(req)
2182	if err != nil {
2183		result.Response = resp
2184		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteVolumeResource", resp, "Failure sending request")
2185		return
2186	}
2187
2188	result, err = client.DeleteVolumeResourceResponder(resp)
2189	if err != nil {
2190		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteVolumeResource", resp, "Failure responding to request")
2191		return
2192	}
2193
2194	return
2195}
2196
2197// DeleteVolumeResourcePreparer prepares the DeleteVolumeResource request.
2198func (client BaseClient) DeleteVolumeResourcePreparer(ctx context.Context, volumeResourceName string) (*http.Request, error) {
2199	pathParameters := map[string]interface{}{
2200		"volumeResourceName": volumeResourceName,
2201	}
2202
2203	const APIVersion = "6.3-preview"
2204	queryParameters := map[string]interface{}{
2205		"api-version": APIVersion,
2206	}
2207
2208	preparer := autorest.CreatePreparer(
2209		autorest.AsDelete(),
2210		autorest.WithBaseURL(client.BaseURI),
2211		autorest.WithPathParameters("/Resources/Volumes/{volumeResourceName}", pathParameters),
2212		autorest.WithQueryParameters(queryParameters))
2213	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2214}
2215
2216// DeleteVolumeResourceSender sends the DeleteVolumeResource request. The method will close the
2217// http.Response Body if it receives an error.
2218func (client BaseClient) DeleteVolumeResourceSender(req *http.Request) (*http.Response, error) {
2219	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2220}
2221
2222// DeleteVolumeResourceResponder handles the response to the DeleteVolumeResource request. The method always
2223// closes the http.Response Body.
2224func (client BaseClient) DeleteVolumeResourceResponder(resp *http.Response) (result autorest.Response, err error) {
2225	err = autorest.Respond(
2226		resp,
2227		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
2228		autorest.ByClosing())
2229	result.Response = resp
2230	return
2231}
2232
2233// DeployServicePackageToNode this API provides a way to download code packages including the container images on a
2234// specific node outside of the normal application deployment and upgrade path. This is useful for the large code
2235// packages and container images to be present on the node before the actual application deployment and upgrade, thus
2236// significantly reducing the total time required for the deployment or upgrade.
2237// Parameters:
2238// nodeName - the name of the node.
2239// deployServicePackageToNodeDescription - describes information for deploying a service package to a Service
2240// Fabric node.
2241// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2242// duration that the client is willing to wait for the requested operation to complete. The default value for
2243// this parameter is 60 seconds.
2244func (client BaseClient) DeployServicePackageToNode(ctx context.Context, nodeName string, deployServicePackageToNodeDescription DeployServicePackageToNodeDescription, timeout *int64) (result autorest.Response, err error) {
2245	if tracing.IsEnabled() {
2246		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeployServicePackageToNode")
2247		defer func() {
2248			sc := -1
2249			if result.Response != nil {
2250				sc = result.Response.StatusCode
2251			}
2252			tracing.EndSpan(ctx, sc, err)
2253		}()
2254	}
2255	if err := validation.Validate([]validation.Validation{
2256		{TargetValue: deployServicePackageToNodeDescription,
2257			Constraints: []validation.Constraint{{Target: "deployServicePackageToNodeDescription.ServiceManifestName", Name: validation.Null, Rule: true, Chain: nil},
2258				{Target: "deployServicePackageToNodeDescription.ApplicationTypeName", Name: validation.Null, Rule: true, Chain: nil},
2259				{Target: "deployServicePackageToNodeDescription.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil},
2260				{Target: "deployServicePackageToNodeDescription.NodeName", Name: validation.Null, Rule: true, Chain: nil}}},
2261		{TargetValue: timeout,
2262			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2263				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2264					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2265				}}}}}); err != nil {
2266		return result, validation.NewError("servicefabric.BaseClient", "DeployServicePackageToNode", err.Error())
2267	}
2268
2269	req, err := client.DeployServicePackageToNodePreparer(ctx, nodeName, deployServicePackageToNodeDescription, timeout)
2270	if err != nil {
2271		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", nil, "Failure preparing request")
2272		return
2273	}
2274
2275	resp, err := client.DeployServicePackageToNodeSender(req)
2276	if err != nil {
2277		result.Response = resp
2278		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", resp, "Failure sending request")
2279		return
2280	}
2281
2282	result, err = client.DeployServicePackageToNodeResponder(resp)
2283	if err != nil {
2284		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", resp, "Failure responding to request")
2285		return
2286	}
2287
2288	return
2289}
2290
2291// DeployServicePackageToNodePreparer prepares the DeployServicePackageToNode request.
2292func (client BaseClient) DeployServicePackageToNodePreparer(ctx context.Context, nodeName string, deployServicePackageToNodeDescription DeployServicePackageToNodeDescription, timeout *int64) (*http.Request, error) {
2293	pathParameters := map[string]interface{}{
2294		"nodeName": autorest.Encode("path", nodeName),
2295	}
2296
2297	const APIVersion = "6.0"
2298	queryParameters := map[string]interface{}{
2299		"api-version": APIVersion,
2300	}
2301	if timeout != nil {
2302		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2303	} else {
2304		queryParameters["timeout"] = autorest.Encode("query", 60)
2305	}
2306
2307	preparer := autorest.CreatePreparer(
2308		autorest.AsContentType("application/json; charset=utf-8"),
2309		autorest.AsPost(),
2310		autorest.WithBaseURL(client.BaseURI),
2311		autorest.WithPathParameters("/Nodes/{nodeName}/$/DeployServicePackage", pathParameters),
2312		autorest.WithJSON(deployServicePackageToNodeDescription),
2313		autorest.WithQueryParameters(queryParameters))
2314	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2315}
2316
2317// DeployServicePackageToNodeSender sends the DeployServicePackageToNode request. The method will close the
2318// http.Response Body if it receives an error.
2319func (client BaseClient) DeployServicePackageToNodeSender(req *http.Request) (*http.Response, error) {
2320	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2321}
2322
2323// DeployServicePackageToNodeResponder handles the response to the DeployServicePackageToNode request. The method always
2324// closes the http.Response Body.
2325func (client BaseClient) DeployServicePackageToNodeResponder(resp *http.Response) (result autorest.Response, err error) {
2326	err = autorest.Respond(
2327		resp,
2328		azure.WithErrorUnlessStatusCode(http.StatusOK),
2329		autorest.ByClosing())
2330	result.Response = resp
2331	return
2332}
2333
2334// DisableApplicationBackup disables periodic backup of Service Fabric application which was previously enabled.
2335// Parameters:
2336// applicationID - the identity of the application. This is typically the full name of the application without
2337// the 'fabric:' URI scheme.
2338// Starting from version 6.0, hierarchical names are delimited with the "~" character.
2339// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
2340// in 6.0+ and "myapp/app1" in previous versions.
2341// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2342// duration that the client is willing to wait for the requested operation to complete. The default value for
2343// this parameter is 60 seconds.
2344func (client BaseClient) DisableApplicationBackup(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) {
2345	if tracing.IsEnabled() {
2346		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableApplicationBackup")
2347		defer func() {
2348			sc := -1
2349			if result.Response != nil {
2350				sc = result.Response.StatusCode
2351			}
2352			tracing.EndSpan(ctx, sc, err)
2353		}()
2354	}
2355	if err := validation.Validate([]validation.Validation{
2356		{TargetValue: timeout,
2357			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2358				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2359					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2360				}}}}}); err != nil {
2361		return result, validation.NewError("servicefabric.BaseClient", "DisableApplicationBackup", err.Error())
2362	}
2363
2364	req, err := client.DisableApplicationBackupPreparer(ctx, applicationID, timeout)
2365	if err != nil {
2366		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", nil, "Failure preparing request")
2367		return
2368	}
2369
2370	resp, err := client.DisableApplicationBackupSender(req)
2371	if err != nil {
2372		result.Response = resp
2373		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", resp, "Failure sending request")
2374		return
2375	}
2376
2377	result, err = client.DisableApplicationBackupResponder(resp)
2378	if err != nil {
2379		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", resp, "Failure responding to request")
2380		return
2381	}
2382
2383	return
2384}
2385
2386// DisableApplicationBackupPreparer prepares the DisableApplicationBackup request.
2387func (client BaseClient) DisableApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
2388	pathParameters := map[string]interface{}{
2389		"applicationId": applicationID,
2390	}
2391
2392	const APIVersion = "6.2-preview"
2393	queryParameters := map[string]interface{}{
2394		"api-version": APIVersion,
2395	}
2396	if timeout != nil {
2397		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2398	} else {
2399		queryParameters["timeout"] = autorest.Encode("query", 60)
2400	}
2401
2402	preparer := autorest.CreatePreparer(
2403		autorest.AsPost(),
2404		autorest.WithBaseURL(client.BaseURI),
2405		autorest.WithPathParameters("/Applications/{applicationId}/$/DisableBackup", pathParameters),
2406		autorest.WithQueryParameters(queryParameters))
2407	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2408}
2409
2410// DisableApplicationBackupSender sends the DisableApplicationBackup request. The method will close the
2411// http.Response Body if it receives an error.
2412func (client BaseClient) DisableApplicationBackupSender(req *http.Request) (*http.Response, error) {
2413	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2414}
2415
2416// DisableApplicationBackupResponder handles the response to the DisableApplicationBackup request. The method always
2417// closes the http.Response Body.
2418func (client BaseClient) DisableApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2419	err = autorest.Respond(
2420		resp,
2421		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2422		autorest.ByClosing())
2423	result.Response = resp
2424	return
2425}
2426
2427// DisableNode deactivate a Service Fabric cluster node with the specified deactivation intent. Once the deactivation
2428// is in progress, the deactivation intent can be increased, but not decreased (for example, a node that is deactivated
2429// with the Pause intent can be deactivated further with Restart, but not the other way around. Nodes may be
2430// reactivated using the Activate a node operation any time after they are deactivated. If the deactivation is not
2431// complete, this will cancel the deactivation. A node that goes down and comes back up while deactivated will still
2432// need to be reactivated before services will be placed on that node.
2433// Parameters:
2434// nodeName - the name of the node.
2435// deactivationIntentDescription - describes the intent or reason for deactivating the node.
2436// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2437// duration that the client is willing to wait for the requested operation to complete. The default value for
2438// this parameter is 60 seconds.
2439func (client BaseClient) DisableNode(ctx context.Context, nodeName string, deactivationIntentDescription DeactivationIntentDescription, timeout *int64) (result autorest.Response, err error) {
2440	if tracing.IsEnabled() {
2441		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableNode")
2442		defer func() {
2443			sc := -1
2444			if result.Response != nil {
2445				sc = result.Response.StatusCode
2446			}
2447			tracing.EndSpan(ctx, sc, err)
2448		}()
2449	}
2450	if err := validation.Validate([]validation.Validation{
2451		{TargetValue: timeout,
2452			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2453				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2454					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2455				}}}}}); err != nil {
2456		return result, validation.NewError("servicefabric.BaseClient", "DisableNode", err.Error())
2457	}
2458
2459	req, err := client.DisableNodePreparer(ctx, nodeName, deactivationIntentDescription, timeout)
2460	if err != nil {
2461		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", nil, "Failure preparing request")
2462		return
2463	}
2464
2465	resp, err := client.DisableNodeSender(req)
2466	if err != nil {
2467		result.Response = resp
2468		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", resp, "Failure sending request")
2469		return
2470	}
2471
2472	result, err = client.DisableNodeResponder(resp)
2473	if err != nil {
2474		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", resp, "Failure responding to request")
2475		return
2476	}
2477
2478	return
2479}
2480
2481// DisableNodePreparer prepares the DisableNode request.
2482func (client BaseClient) DisableNodePreparer(ctx context.Context, nodeName string, deactivationIntentDescription DeactivationIntentDescription, timeout *int64) (*http.Request, error) {
2483	pathParameters := map[string]interface{}{
2484		"nodeName": autorest.Encode("path", nodeName),
2485	}
2486
2487	const APIVersion = "6.0"
2488	queryParameters := map[string]interface{}{
2489		"api-version": APIVersion,
2490	}
2491	if timeout != nil {
2492		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2493	} else {
2494		queryParameters["timeout"] = autorest.Encode("query", 60)
2495	}
2496
2497	preparer := autorest.CreatePreparer(
2498		autorest.AsContentType("application/json; charset=utf-8"),
2499		autorest.AsPost(),
2500		autorest.WithBaseURL(client.BaseURI),
2501		autorest.WithPathParameters("/Nodes/{nodeName}/$/Deactivate", pathParameters),
2502		autorest.WithJSON(deactivationIntentDescription),
2503		autorest.WithQueryParameters(queryParameters))
2504	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2505}
2506
2507// DisableNodeSender sends the DisableNode request. The method will close the
2508// http.Response Body if it receives an error.
2509func (client BaseClient) DisableNodeSender(req *http.Request) (*http.Response, error) {
2510	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2511}
2512
2513// DisableNodeResponder handles the response to the DisableNode request. The method always
2514// closes the http.Response Body.
2515func (client BaseClient) DisableNodeResponder(resp *http.Response) (result autorest.Response, err error) {
2516	err = autorest.Respond(
2517		resp,
2518		azure.WithErrorUnlessStatusCode(http.StatusOK),
2519		autorest.ByClosing())
2520	result.Response = resp
2521	return
2522}
2523
2524// DisablePartitionBackup disables periodic backup of partition which was previously enabled. Backup must be explicitly
2525// enabled before it can be disabled.
2526// In case the backup is enabled for the Service Fabric application or service, which this partition is part of, this
2527// partition would continue to be periodically backed up as per the policy mapped at the higher level entity.
2528// Parameters:
2529// partitionID - the identity of the partition.
2530// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2531// duration that the client is willing to wait for the requested operation to complete. The default value for
2532// this parameter is 60 seconds.
2533func (client BaseClient) DisablePartitionBackup(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
2534	if tracing.IsEnabled() {
2535		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisablePartitionBackup")
2536		defer func() {
2537			sc := -1
2538			if result.Response != nil {
2539				sc = result.Response.StatusCode
2540			}
2541			tracing.EndSpan(ctx, sc, err)
2542		}()
2543	}
2544	if err := validation.Validate([]validation.Validation{
2545		{TargetValue: timeout,
2546			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2547				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2548					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2549				}}}}}); err != nil {
2550		return result, validation.NewError("servicefabric.BaseClient", "DisablePartitionBackup", err.Error())
2551	}
2552
2553	req, err := client.DisablePartitionBackupPreparer(ctx, partitionID, timeout)
2554	if err != nil {
2555		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", nil, "Failure preparing request")
2556		return
2557	}
2558
2559	resp, err := client.DisablePartitionBackupSender(req)
2560	if err != nil {
2561		result.Response = resp
2562		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", resp, "Failure sending request")
2563		return
2564	}
2565
2566	result, err = client.DisablePartitionBackupResponder(resp)
2567	if err != nil {
2568		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", resp, "Failure responding to request")
2569		return
2570	}
2571
2572	return
2573}
2574
2575// DisablePartitionBackupPreparer prepares the DisablePartitionBackup request.
2576func (client BaseClient) DisablePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
2577	pathParameters := map[string]interface{}{
2578		"partitionId": partitionID,
2579	}
2580
2581	const APIVersion = "6.2-preview"
2582	queryParameters := map[string]interface{}{
2583		"api-version": APIVersion,
2584	}
2585	if timeout != nil {
2586		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2587	} else {
2588		queryParameters["timeout"] = autorest.Encode("query", 60)
2589	}
2590
2591	preparer := autorest.CreatePreparer(
2592		autorest.AsPost(),
2593		autorest.WithBaseURL(client.BaseURI),
2594		autorest.WithPathParameters("/Partitions/{partitionId}/$/DisableBackup", pathParameters),
2595		autorest.WithQueryParameters(queryParameters))
2596	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2597}
2598
2599// DisablePartitionBackupSender sends the DisablePartitionBackup request. The method will close the
2600// http.Response Body if it receives an error.
2601func (client BaseClient) DisablePartitionBackupSender(req *http.Request) (*http.Response, error) {
2602	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2603}
2604
2605// DisablePartitionBackupResponder handles the response to the DisablePartitionBackup request. The method always
2606// closes the http.Response Body.
2607func (client BaseClient) DisablePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2608	err = autorest.Respond(
2609		resp,
2610		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2611		autorest.ByClosing())
2612	result.Response = resp
2613	return
2614}
2615
2616// DisableServiceBackup disables periodic backup of Service Fabric service which was previously enabled. Backup must be
2617// explicitly enabled before it can be disabled.
2618// In case the backup is enabled for the Service Fabric application, which this service is part of, this service would
2619// continue to be periodically backed up as per the policy mapped at the application level.
2620// Parameters:
2621// serviceID - the identity of the service. This ID is typically the full name of the service without the
2622// 'fabric:' URI scheme.
2623// Starting from version 6.0, hierarchical names are delimited with the "~" character.
2624// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
2625// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
2626// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2627// duration that the client is willing to wait for the requested operation to complete. The default value for
2628// this parameter is 60 seconds.
2629func (client BaseClient) DisableServiceBackup(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) {
2630	if tracing.IsEnabled() {
2631		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableServiceBackup")
2632		defer func() {
2633			sc := -1
2634			if result.Response != nil {
2635				sc = result.Response.StatusCode
2636			}
2637			tracing.EndSpan(ctx, sc, err)
2638		}()
2639	}
2640	if err := validation.Validate([]validation.Validation{
2641		{TargetValue: timeout,
2642			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2643				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2644					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2645				}}}}}); err != nil {
2646		return result, validation.NewError("servicefabric.BaseClient", "DisableServiceBackup", err.Error())
2647	}
2648
2649	req, err := client.DisableServiceBackupPreparer(ctx, serviceID, timeout)
2650	if err != nil {
2651		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", nil, "Failure preparing request")
2652		return
2653	}
2654
2655	resp, err := client.DisableServiceBackupSender(req)
2656	if err != nil {
2657		result.Response = resp
2658		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", resp, "Failure sending request")
2659		return
2660	}
2661
2662	result, err = client.DisableServiceBackupResponder(resp)
2663	if err != nil {
2664		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", resp, "Failure responding to request")
2665		return
2666	}
2667
2668	return
2669}
2670
2671// DisableServiceBackupPreparer prepares the DisableServiceBackup request.
2672func (client BaseClient) DisableServiceBackupPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
2673	pathParameters := map[string]interface{}{
2674		"serviceId": serviceID,
2675	}
2676
2677	const APIVersion = "6.2-preview"
2678	queryParameters := map[string]interface{}{
2679		"api-version": APIVersion,
2680	}
2681	if timeout != nil {
2682		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2683	} else {
2684		queryParameters["timeout"] = autorest.Encode("query", 60)
2685	}
2686
2687	preparer := autorest.CreatePreparer(
2688		autorest.AsPost(),
2689		autorest.WithBaseURL(client.BaseURI),
2690		autorest.WithPathParameters("/Services/{serviceId}/$/DisableBackup", pathParameters),
2691		autorest.WithQueryParameters(queryParameters))
2692	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2693}
2694
2695// DisableServiceBackupSender sends the DisableServiceBackup request. The method will close the
2696// http.Response Body if it receives an error.
2697func (client BaseClient) DisableServiceBackupSender(req *http.Request) (*http.Response, error) {
2698	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2699}
2700
2701// DisableServiceBackupResponder handles the response to the DisableServiceBackup request. The method always
2702// closes the http.Response Body.
2703func (client BaseClient) DisableServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2704	err = autorest.Respond(
2705		resp,
2706		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2707		autorest.ByClosing())
2708	result.Response = resp
2709	return
2710}
2711
2712// EnableApplicationBackup enables periodic backup of stateful partitions which are part of this Service Fabric
2713// application. Each partition is backed up individually as per the specified backup policy description.
2714// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup.
2715// Parameters:
2716// applicationID - the identity of the application. This is typically the full name of the application without
2717// the 'fabric:' URI scheme.
2718// Starting from version 6.0, hierarchical names are delimited with the "~" character.
2719// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
2720// in 6.0+ and "myapp/app1" in previous versions.
2721// enableBackupDescription - specifies the parameters for enabling backup.
2722// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2723// duration that the client is willing to wait for the requested operation to complete. The default value for
2724// this parameter is 60 seconds.
2725func (client BaseClient) EnableApplicationBackup(ctx context.Context, applicationID string, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) {
2726	if tracing.IsEnabled() {
2727		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableApplicationBackup")
2728		defer func() {
2729			sc := -1
2730			if result.Response != nil {
2731				sc = result.Response.StatusCode
2732			}
2733			tracing.EndSpan(ctx, sc, err)
2734		}()
2735	}
2736	if err := validation.Validate([]validation.Validation{
2737		{TargetValue: enableBackupDescription,
2738			Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}},
2739		{TargetValue: timeout,
2740			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2741				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2742					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2743				}}}}}); err != nil {
2744		return result, validation.NewError("servicefabric.BaseClient", "EnableApplicationBackup", err.Error())
2745	}
2746
2747	req, err := client.EnableApplicationBackupPreparer(ctx, applicationID, enableBackupDescription, timeout)
2748	if err != nil {
2749		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", nil, "Failure preparing request")
2750		return
2751	}
2752
2753	resp, err := client.EnableApplicationBackupSender(req)
2754	if err != nil {
2755		result.Response = resp
2756		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", resp, "Failure sending request")
2757		return
2758	}
2759
2760	result, err = client.EnableApplicationBackupResponder(resp)
2761	if err != nil {
2762		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", resp, "Failure responding to request")
2763		return
2764	}
2765
2766	return
2767}
2768
2769// EnableApplicationBackupPreparer prepares the EnableApplicationBackup request.
2770func (client BaseClient) EnableApplicationBackupPreparer(ctx context.Context, applicationID string, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) {
2771	pathParameters := map[string]interface{}{
2772		"applicationId": applicationID,
2773	}
2774
2775	const APIVersion = "6.2-preview"
2776	queryParameters := map[string]interface{}{
2777		"api-version": APIVersion,
2778	}
2779	if timeout != nil {
2780		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2781	} else {
2782		queryParameters["timeout"] = autorest.Encode("query", 60)
2783	}
2784
2785	preparer := autorest.CreatePreparer(
2786		autorest.AsContentType("application/json; charset=utf-8"),
2787		autorest.AsPost(),
2788		autorest.WithBaseURL(client.BaseURI),
2789		autorest.WithPathParameters("/Applications/{applicationId}/$/EnableBackup", pathParameters),
2790		autorest.WithJSON(enableBackupDescription),
2791		autorest.WithQueryParameters(queryParameters))
2792	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2793}
2794
2795// EnableApplicationBackupSender sends the EnableApplicationBackup request. The method will close the
2796// http.Response Body if it receives an error.
2797func (client BaseClient) EnableApplicationBackupSender(req *http.Request) (*http.Response, error) {
2798	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2799}
2800
2801// EnableApplicationBackupResponder handles the response to the EnableApplicationBackup request. The method always
2802// closes the http.Response Body.
2803func (client BaseClient) EnableApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2804	err = autorest.Respond(
2805		resp,
2806		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2807		autorest.ByClosing())
2808	result.Response = resp
2809	return
2810}
2811
2812// EnableNode activates a Service Fabric cluster node that is currently deactivated. Once activated, the node will
2813// again become a viable target for placing new replicas, and any deactivated replicas remaining on the node will be
2814// reactivated.
2815// Parameters:
2816// nodeName - the name of the node.
2817// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2818// duration that the client is willing to wait for the requested operation to complete. The default value for
2819// this parameter is 60 seconds.
2820func (client BaseClient) EnableNode(ctx context.Context, nodeName string, timeout *int64) (result autorest.Response, err error) {
2821	if tracing.IsEnabled() {
2822		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableNode")
2823		defer func() {
2824			sc := -1
2825			if result.Response != nil {
2826				sc = result.Response.StatusCode
2827			}
2828			tracing.EndSpan(ctx, sc, err)
2829		}()
2830	}
2831	if err := validation.Validate([]validation.Validation{
2832		{TargetValue: timeout,
2833			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2834				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2835					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2836				}}}}}); err != nil {
2837		return result, validation.NewError("servicefabric.BaseClient", "EnableNode", err.Error())
2838	}
2839
2840	req, err := client.EnableNodePreparer(ctx, nodeName, timeout)
2841	if err != nil {
2842		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", nil, "Failure preparing request")
2843		return
2844	}
2845
2846	resp, err := client.EnableNodeSender(req)
2847	if err != nil {
2848		result.Response = resp
2849		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", resp, "Failure sending request")
2850		return
2851	}
2852
2853	result, err = client.EnableNodeResponder(resp)
2854	if err != nil {
2855		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", resp, "Failure responding to request")
2856		return
2857	}
2858
2859	return
2860}
2861
2862// EnableNodePreparer prepares the EnableNode request.
2863func (client BaseClient) EnableNodePreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) {
2864	pathParameters := map[string]interface{}{
2865		"nodeName": autorest.Encode("path", nodeName),
2866	}
2867
2868	const APIVersion = "6.0"
2869	queryParameters := map[string]interface{}{
2870		"api-version": APIVersion,
2871	}
2872	if timeout != nil {
2873		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2874	} else {
2875		queryParameters["timeout"] = autorest.Encode("query", 60)
2876	}
2877
2878	preparer := autorest.CreatePreparer(
2879		autorest.AsPost(),
2880		autorest.WithBaseURL(client.BaseURI),
2881		autorest.WithPathParameters("/Nodes/{nodeName}/$/Activate", pathParameters),
2882		autorest.WithQueryParameters(queryParameters))
2883	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2884}
2885
2886// EnableNodeSender sends the EnableNode request. The method will close the
2887// http.Response Body if it receives an error.
2888func (client BaseClient) EnableNodeSender(req *http.Request) (*http.Response, error) {
2889	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2890}
2891
2892// EnableNodeResponder handles the response to the EnableNode request. The method always
2893// closes the http.Response Body.
2894func (client BaseClient) EnableNodeResponder(resp *http.Response) (result autorest.Response, err error) {
2895	err = autorest.Respond(
2896		resp,
2897		azure.WithErrorUnlessStatusCode(http.StatusOK),
2898		autorest.ByClosing())
2899	result.Response = resp
2900	return
2901}
2902
2903// EnablePartitionBackup enables periodic backup of stateful persisted partition. Each partition is backed up as per
2904// the specified backup policy description. In case the application or service, which is partition is part of, is
2905// already enabled for backup then this operation would override the policy being used to take the periodic backup of
2906// this partition.
2907// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup.
2908// Parameters:
2909// partitionID - the identity of the partition.
2910// enableBackupDescription - specifies the parameters for enabling backup.
2911// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2912// duration that the client is willing to wait for the requested operation to complete. The default value for
2913// this parameter is 60 seconds.
2914func (client BaseClient) EnablePartitionBackup(ctx context.Context, partitionID uuid.UUID, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) {
2915	if tracing.IsEnabled() {
2916		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnablePartitionBackup")
2917		defer func() {
2918			sc := -1
2919			if result.Response != nil {
2920				sc = result.Response.StatusCode
2921			}
2922			tracing.EndSpan(ctx, sc, err)
2923		}()
2924	}
2925	if err := validation.Validate([]validation.Validation{
2926		{TargetValue: enableBackupDescription,
2927			Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}},
2928		{TargetValue: timeout,
2929			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2930				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2931					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2932				}}}}}); err != nil {
2933		return result, validation.NewError("servicefabric.BaseClient", "EnablePartitionBackup", err.Error())
2934	}
2935
2936	req, err := client.EnablePartitionBackupPreparer(ctx, partitionID, enableBackupDescription, timeout)
2937	if err != nil {
2938		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", nil, "Failure preparing request")
2939		return
2940	}
2941
2942	resp, err := client.EnablePartitionBackupSender(req)
2943	if err != nil {
2944		result.Response = resp
2945		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", resp, "Failure sending request")
2946		return
2947	}
2948
2949	result, err = client.EnablePartitionBackupResponder(resp)
2950	if err != nil {
2951		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", resp, "Failure responding to request")
2952		return
2953	}
2954
2955	return
2956}
2957
2958// EnablePartitionBackupPreparer prepares the EnablePartitionBackup request.
2959func (client BaseClient) EnablePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) {
2960	pathParameters := map[string]interface{}{
2961		"partitionId": partitionID,
2962	}
2963
2964	const APIVersion = "6.2-preview"
2965	queryParameters := map[string]interface{}{
2966		"api-version": APIVersion,
2967	}
2968	if timeout != nil {
2969		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2970	} else {
2971		queryParameters["timeout"] = autorest.Encode("query", 60)
2972	}
2973
2974	preparer := autorest.CreatePreparer(
2975		autorest.AsContentType("application/json; charset=utf-8"),
2976		autorest.AsPost(),
2977		autorest.WithBaseURL(client.BaseURI),
2978		autorest.WithPathParameters("/Partitions/{partitionId}/$/EnableBackup", pathParameters),
2979		autorest.WithJSON(enableBackupDescription),
2980		autorest.WithQueryParameters(queryParameters))
2981	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2982}
2983
2984// EnablePartitionBackupSender sends the EnablePartitionBackup request. The method will close the
2985// http.Response Body if it receives an error.
2986func (client BaseClient) EnablePartitionBackupSender(req *http.Request) (*http.Response, error) {
2987	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2988}
2989
2990// EnablePartitionBackupResponder handles the response to the EnablePartitionBackup request. The method always
2991// closes the http.Response Body.
2992func (client BaseClient) EnablePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2993	err = autorest.Respond(
2994		resp,
2995		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2996		autorest.ByClosing())
2997	result.Response = resp
2998	return
2999}
3000
3001// EnableServiceBackup enables periodic backup of stateful partitions which are part of this Service Fabric service.
3002// Each partition is backed up individually as per the specified backup policy description. In case the application,
3003// which the service is part of, is already enabled for backup then this operation would override the policy being used
3004// to take the periodic backup for this service and its partitions (unless explicitly overridden at the partition
3005// level).
3006// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup.
3007// Parameters:
3008// serviceID - the identity of the service. This ID is typically the full name of the service without the
3009// 'fabric:' URI scheme.
3010// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3011// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
3012// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
3013// enableBackupDescription - specifies the parameters for enabling backup.
3014// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3015// duration that the client is willing to wait for the requested operation to complete. The default value for
3016// this parameter is 60 seconds.
3017func (client BaseClient) EnableServiceBackup(ctx context.Context, serviceID string, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) {
3018	if tracing.IsEnabled() {
3019		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableServiceBackup")
3020		defer func() {
3021			sc := -1
3022			if result.Response != nil {
3023				sc = result.Response.StatusCode
3024			}
3025			tracing.EndSpan(ctx, sc, err)
3026		}()
3027	}
3028	if err := validation.Validate([]validation.Validation{
3029		{TargetValue: enableBackupDescription,
3030			Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}},
3031		{TargetValue: timeout,
3032			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3033				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3034					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3035				}}}}}); err != nil {
3036		return result, validation.NewError("servicefabric.BaseClient", "EnableServiceBackup", err.Error())
3037	}
3038
3039	req, err := client.EnableServiceBackupPreparer(ctx, serviceID, enableBackupDescription, timeout)
3040	if err != nil {
3041		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", nil, "Failure preparing request")
3042		return
3043	}
3044
3045	resp, err := client.EnableServiceBackupSender(req)
3046	if err != nil {
3047		result.Response = resp
3048		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", resp, "Failure sending request")
3049		return
3050	}
3051
3052	result, err = client.EnableServiceBackupResponder(resp)
3053	if err != nil {
3054		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", resp, "Failure responding to request")
3055		return
3056	}
3057
3058	return
3059}
3060
3061// EnableServiceBackupPreparer prepares the EnableServiceBackup request.
3062func (client BaseClient) EnableServiceBackupPreparer(ctx context.Context, serviceID string, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) {
3063	pathParameters := map[string]interface{}{
3064		"serviceId": serviceID,
3065	}
3066
3067	const APIVersion = "6.2-preview"
3068	queryParameters := map[string]interface{}{
3069		"api-version": APIVersion,
3070	}
3071	if timeout != nil {
3072		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3073	} else {
3074		queryParameters["timeout"] = autorest.Encode("query", 60)
3075	}
3076
3077	preparer := autorest.CreatePreparer(
3078		autorest.AsContentType("application/json; charset=utf-8"),
3079		autorest.AsPost(),
3080		autorest.WithBaseURL(client.BaseURI),
3081		autorest.WithPathParameters("/Services/{serviceId}/$/EnableBackup", pathParameters),
3082		autorest.WithJSON(enableBackupDescription),
3083		autorest.WithQueryParameters(queryParameters))
3084	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3085}
3086
3087// EnableServiceBackupSender sends the EnableServiceBackup request. The method will close the
3088// http.Response Body if it receives an error.
3089func (client BaseClient) EnableServiceBackupSender(req *http.Request) (*http.Response, error) {
3090	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3091}
3092
3093// EnableServiceBackupResponder handles the response to the EnableServiceBackup request. The method always
3094// closes the http.Response Body.
3095func (client BaseClient) EnableServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) {
3096	err = autorest.Respond(
3097		resp,
3098		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
3099		autorest.ByClosing())
3100	result.Response = resp
3101	return
3102}
3103
3104// ForceApproveRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your
3105// code.
3106// Parameters:
3107// repairTaskApproveDescription - describes the repair task to be approved.
3108func (client BaseClient) ForceApproveRepairTask(ctx context.Context, repairTaskApproveDescription RepairTaskApproveDescription) (result RepairTaskUpdateInfo, err error) {
3109	if tracing.IsEnabled() {
3110		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ForceApproveRepairTask")
3111		defer func() {
3112			sc := -1
3113			if result.Response.Response != nil {
3114				sc = result.Response.Response.StatusCode
3115			}
3116			tracing.EndSpan(ctx, sc, err)
3117		}()
3118	}
3119	if err := validation.Validate([]validation.Validation{
3120		{TargetValue: repairTaskApproveDescription,
3121			Constraints: []validation.Constraint{{Target: "repairTaskApproveDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
3122		return result, validation.NewError("servicefabric.BaseClient", "ForceApproveRepairTask", err.Error())
3123	}
3124
3125	req, err := client.ForceApproveRepairTaskPreparer(ctx, repairTaskApproveDescription)
3126	if err != nil {
3127		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", nil, "Failure preparing request")
3128		return
3129	}
3130
3131	resp, err := client.ForceApproveRepairTaskSender(req)
3132	if err != nil {
3133		result.Response = autorest.Response{Response: resp}
3134		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", resp, "Failure sending request")
3135		return
3136	}
3137
3138	result, err = client.ForceApproveRepairTaskResponder(resp)
3139	if err != nil {
3140		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", resp, "Failure responding to request")
3141		return
3142	}
3143
3144	return
3145}
3146
3147// ForceApproveRepairTaskPreparer prepares the ForceApproveRepairTask request.
3148func (client BaseClient) ForceApproveRepairTaskPreparer(ctx context.Context, repairTaskApproveDescription RepairTaskApproveDescription) (*http.Request, error) {
3149	const APIVersion = "6.0"
3150	queryParameters := map[string]interface{}{
3151		"api-version": APIVersion,
3152	}
3153
3154	preparer := autorest.CreatePreparer(
3155		autorest.AsContentType("application/json; charset=utf-8"),
3156		autorest.AsPost(),
3157		autorest.WithBaseURL(client.BaseURI),
3158		autorest.WithPath("/$/ForceApproveRepairTask"),
3159		autorest.WithJSON(repairTaskApproveDescription),
3160		autorest.WithQueryParameters(queryParameters))
3161	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3162}
3163
3164// ForceApproveRepairTaskSender sends the ForceApproveRepairTask request. The method will close the
3165// http.Response Body if it receives an error.
3166func (client BaseClient) ForceApproveRepairTaskSender(req *http.Request) (*http.Response, error) {
3167	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3168}
3169
3170// ForceApproveRepairTaskResponder handles the response to the ForceApproveRepairTask request. The method always
3171// closes the http.Response Body.
3172func (client BaseClient) ForceApproveRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
3173	err = autorest.Respond(
3174		resp,
3175		azure.WithErrorUnlessStatusCode(http.StatusOK),
3176		autorest.ByUnmarshallingJSON(&result),
3177		autorest.ByClosing())
3178	result.Response = autorest.Response{Response: resp}
3179	return
3180}
3181
3182// GetAadMetadata gets the Azure Active Directory metadata used for secured connection to cluster.
3183// This API is not supposed to be called separately. It provides information needed to set up an Azure Active Directory
3184// secured connection with a Service Fabric cluster.
3185// Parameters:
3186// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3187// duration that the client is willing to wait for the requested operation to complete. The default value for
3188// this parameter is 60 seconds.
3189func (client BaseClient) GetAadMetadata(ctx context.Context, timeout *int64) (result AadMetadataObject, err error) {
3190	if tracing.IsEnabled() {
3191		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetAadMetadata")
3192		defer func() {
3193			sc := -1
3194			if result.Response.Response != nil {
3195				sc = result.Response.Response.StatusCode
3196			}
3197			tracing.EndSpan(ctx, sc, err)
3198		}()
3199	}
3200	if err := validation.Validate([]validation.Validation{
3201		{TargetValue: timeout,
3202			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3203				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3204					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3205				}}}}}); err != nil {
3206		return result, validation.NewError("servicefabric.BaseClient", "GetAadMetadata", err.Error())
3207	}
3208
3209	req, err := client.GetAadMetadataPreparer(ctx, timeout)
3210	if err != nil {
3211		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", nil, "Failure preparing request")
3212		return
3213	}
3214
3215	resp, err := client.GetAadMetadataSender(req)
3216	if err != nil {
3217		result.Response = autorest.Response{Response: resp}
3218		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", resp, "Failure sending request")
3219		return
3220	}
3221
3222	result, err = client.GetAadMetadataResponder(resp)
3223	if err != nil {
3224		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", resp, "Failure responding to request")
3225		return
3226	}
3227
3228	return
3229}
3230
3231// GetAadMetadataPreparer prepares the GetAadMetadata request.
3232func (client BaseClient) GetAadMetadataPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
3233	const APIVersion = "6.0"
3234	queryParameters := map[string]interface{}{
3235		"api-version": APIVersion,
3236	}
3237	if timeout != nil {
3238		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3239	} else {
3240		queryParameters["timeout"] = autorest.Encode("query", 60)
3241	}
3242
3243	preparer := autorest.CreatePreparer(
3244		autorest.AsGet(),
3245		autorest.WithBaseURL(client.BaseURI),
3246		autorest.WithPath("/$/GetAadMetadata"),
3247		autorest.WithQueryParameters(queryParameters))
3248	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3249}
3250
3251// GetAadMetadataSender sends the GetAadMetadata request. The method will close the
3252// http.Response Body if it receives an error.
3253func (client BaseClient) GetAadMetadataSender(req *http.Request) (*http.Response, error) {
3254	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3255}
3256
3257// GetAadMetadataResponder handles the response to the GetAadMetadata request. The method always
3258// closes the http.Response Body.
3259func (client BaseClient) GetAadMetadataResponder(resp *http.Response) (result AadMetadataObject, err error) {
3260	err = autorest.Respond(
3261		resp,
3262		azure.WithErrorUnlessStatusCode(http.StatusOK),
3263		autorest.ByUnmarshallingJSON(&result),
3264		autorest.ByClosing())
3265	result.Response = autorest.Response{Response: resp}
3266	return
3267}
3268
3269// GetAllEntitiesBackedUpByPolicy returns a list of Service Fabric application, service or partition which are
3270// associated with this backup policy.
3271// Parameters:
3272// backupPolicyName - the name of the backup policy.
3273// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
3274// token with a non-empty value is included in the response of the API when the results from the system do not
3275// fit in a single response. When this value is passed to the next API call, the API returns next set of
3276// results. If there are no further results, then the continuation token does not contain a value. The value of
3277// this parameter should not be URL encoded.
3278// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
3279// defines the upper bound on the number of results returned. The results returned can be less than the
3280// specified maximum results if they do not fit in the message as per the max message size restrictions defined
3281// in the configuration. If this parameter is zero or not specified, the paged query includes as many results
3282// as possible that fit in the return message.
3283// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3284// duration that the client is willing to wait for the requested operation to complete. The default value for
3285// this parameter is 60 seconds.
3286func (client BaseClient) GetAllEntitiesBackedUpByPolicy(ctx context.Context, backupPolicyName string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupEntityList, err error) {
3287	if tracing.IsEnabled() {
3288		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetAllEntitiesBackedUpByPolicy")
3289		defer func() {
3290			sc := -1
3291			if result.Response.Response != nil {
3292				sc = result.Response.Response.StatusCode
3293			}
3294			tracing.EndSpan(ctx, sc, err)
3295		}()
3296	}
3297	if err := validation.Validate([]validation.Validation{
3298		{TargetValue: maxResults,
3299			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
3300				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
3301		{TargetValue: timeout,
3302			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3303				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3304					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3305				}}}}}); err != nil {
3306		return result, validation.NewError("servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", err.Error())
3307	}
3308
3309	req, err := client.GetAllEntitiesBackedUpByPolicyPreparer(ctx, backupPolicyName, continuationToken, maxResults, timeout)
3310	if err != nil {
3311		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", nil, "Failure preparing request")
3312		return
3313	}
3314
3315	resp, err := client.GetAllEntitiesBackedUpByPolicySender(req)
3316	if err != nil {
3317		result.Response = autorest.Response{Response: resp}
3318		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", resp, "Failure sending request")
3319		return
3320	}
3321
3322	result, err = client.GetAllEntitiesBackedUpByPolicyResponder(resp)
3323	if err != nil {
3324		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", resp, "Failure responding to request")
3325		return
3326	}
3327
3328	return
3329}
3330
3331// GetAllEntitiesBackedUpByPolicyPreparer prepares the GetAllEntitiesBackedUpByPolicy request.
3332func (client BaseClient) GetAllEntitiesBackedUpByPolicyPreparer(ctx context.Context, backupPolicyName string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
3333	pathParameters := map[string]interface{}{
3334		"backupPolicyName": autorest.Encode("path", backupPolicyName),
3335	}
3336
3337	const APIVersion = "6.2-preview"
3338	queryParameters := map[string]interface{}{
3339		"api-version": APIVersion,
3340	}
3341	if len(continuationToken) > 0 {
3342		queryParameters["ContinuationToken"] = continuationToken
3343	}
3344	if maxResults != nil {
3345		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
3346	} else {
3347		queryParameters["MaxResults"] = autorest.Encode("query", 0)
3348	}
3349	if timeout != nil {
3350		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3351	} else {
3352		queryParameters["timeout"] = autorest.Encode("query", 60)
3353	}
3354
3355	preparer := autorest.CreatePreparer(
3356		autorest.AsGet(),
3357		autorest.WithBaseURL(client.BaseURI),
3358		autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/GetBackupEnabledEntities", pathParameters),
3359		autorest.WithQueryParameters(queryParameters))
3360	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3361}
3362
3363// GetAllEntitiesBackedUpByPolicySender sends the GetAllEntitiesBackedUpByPolicy request. The method will close the
3364// http.Response Body if it receives an error.
3365func (client BaseClient) GetAllEntitiesBackedUpByPolicySender(req *http.Request) (*http.Response, error) {
3366	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3367}
3368
3369// GetAllEntitiesBackedUpByPolicyResponder handles the response to the GetAllEntitiesBackedUpByPolicy request. The method always
3370// closes the http.Response Body.
3371func (client BaseClient) GetAllEntitiesBackedUpByPolicyResponder(resp *http.Response) (result PagedBackupEntityList, err error) {
3372	err = autorest.Respond(
3373		resp,
3374		azure.WithErrorUnlessStatusCode(http.StatusOK),
3375		autorest.ByUnmarshallingJSON(&result),
3376		autorest.ByClosing())
3377	result.Response = autorest.Response{Response: resp}
3378	return
3379}
3380
3381// GetApplicationBackupConfigurationInfo gets the Service Fabric backup configuration information for the application
3382// and the services and partitions under this application.
3383// Parameters:
3384// applicationID - the identity of the application. This is typically the full name of the application without
3385// the 'fabric:' URI scheme.
3386// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3387// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3388// in 6.0+ and "myapp/app1" in previous versions.
3389// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
3390// token with a non-empty value is included in the response of the API when the results from the system do not
3391// fit in a single response. When this value is passed to the next API call, the API returns next set of
3392// results. If there are no further results, then the continuation token does not contain a value. The value of
3393// this parameter should not be URL encoded.
3394// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
3395// defines the upper bound on the number of results returned. The results returned can be less than the
3396// specified maximum results if they do not fit in the message as per the max message size restrictions defined
3397// in the configuration. If this parameter is zero or not specified, the paged query includes as many results
3398// as possible that fit in the return message.
3399// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3400// duration that the client is willing to wait for the requested operation to complete. The default value for
3401// this parameter is 60 seconds.
3402func (client BaseClient) GetApplicationBackupConfigurationInfo(ctx context.Context, applicationID string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupConfigurationInfoList, err error) {
3403	if tracing.IsEnabled() {
3404		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationBackupConfigurationInfo")
3405		defer func() {
3406			sc := -1
3407			if result.Response.Response != nil {
3408				sc = result.Response.Response.StatusCode
3409			}
3410			tracing.EndSpan(ctx, sc, err)
3411		}()
3412	}
3413	if err := validation.Validate([]validation.Validation{
3414		{TargetValue: maxResults,
3415			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
3416				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
3417		{TargetValue: timeout,
3418			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3419				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3420					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3421				}}}}}); err != nil {
3422		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", err.Error())
3423	}
3424
3425	req, err := client.GetApplicationBackupConfigurationInfoPreparer(ctx, applicationID, continuationToken, maxResults, timeout)
3426	if err != nil {
3427		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", nil, "Failure preparing request")
3428		return
3429	}
3430
3431	resp, err := client.GetApplicationBackupConfigurationInfoSender(req)
3432	if err != nil {
3433		result.Response = autorest.Response{Response: resp}
3434		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", resp, "Failure sending request")
3435		return
3436	}
3437
3438	result, err = client.GetApplicationBackupConfigurationInfoResponder(resp)
3439	if err != nil {
3440		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", resp, "Failure responding to request")
3441		return
3442	}
3443
3444	return
3445}
3446
3447// GetApplicationBackupConfigurationInfoPreparer prepares the GetApplicationBackupConfigurationInfo request.
3448func (client BaseClient) GetApplicationBackupConfigurationInfoPreparer(ctx context.Context, applicationID string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
3449	pathParameters := map[string]interface{}{
3450		"applicationId": applicationID,
3451	}
3452
3453	const APIVersion = "6.2-preview"
3454	queryParameters := map[string]interface{}{
3455		"api-version": APIVersion,
3456	}
3457	if len(continuationToken) > 0 {
3458		queryParameters["ContinuationToken"] = continuationToken
3459	}
3460	if maxResults != nil {
3461		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
3462	} else {
3463		queryParameters["MaxResults"] = autorest.Encode("query", 0)
3464	}
3465	if timeout != nil {
3466		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3467	} else {
3468		queryParameters["timeout"] = autorest.Encode("query", 60)
3469	}
3470
3471	preparer := autorest.CreatePreparer(
3472		autorest.AsGet(),
3473		autorest.WithBaseURL(client.BaseURI),
3474		autorest.WithPathParameters("/Applications/{applicationId}/$/GetBackupConfigurationInfo", pathParameters),
3475		autorest.WithQueryParameters(queryParameters))
3476	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3477}
3478
3479// GetApplicationBackupConfigurationInfoSender sends the GetApplicationBackupConfigurationInfo request. The method will close the
3480// http.Response Body if it receives an error.
3481func (client BaseClient) GetApplicationBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) {
3482	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3483}
3484
3485// GetApplicationBackupConfigurationInfoResponder handles the response to the GetApplicationBackupConfigurationInfo request. The method always
3486// closes the http.Response Body.
3487func (client BaseClient) GetApplicationBackupConfigurationInfoResponder(resp *http.Response) (result PagedBackupConfigurationInfoList, err error) {
3488	err = autorest.Respond(
3489		resp,
3490		azure.WithErrorUnlessStatusCode(http.StatusOK),
3491		autorest.ByUnmarshallingJSON(&result),
3492		autorest.ByClosing())
3493	result.Response = autorest.Response{Response: resp}
3494	return
3495}
3496
3497// GetApplicationBackupList returns a list of backups available for every partition in this Service Fabric application.
3498// The server enumerates all the backups available at the backup location configured in the backup policy. It also
3499// allows filtering of the result based on start and end datetime or just fetching the latest available backup for
3500// every partition.
3501// Parameters:
3502// applicationID - the identity of the application. This is typically the full name of the application without
3503// the 'fabric:' URI scheme.
3504// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3505// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3506// in 6.0+ and "myapp/app1" in previous versions.
3507// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3508// duration that the client is willing to wait for the requested operation to complete. The default value for
3509// this parameter is 60 seconds.
3510// latest - specifies whether to get only the most recent backup available for a partition for the specified
3511// time range.
3512// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The
3513// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups
3514// from the beginning are enumerated.
3515// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date
3516// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is
3517// done till the most recent backup.
3518// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
3519// token with a non-empty value is included in the response of the API when the results from the system do not
3520// fit in a single response. When this value is passed to the next API call, the API returns next set of
3521// results. If there are no further results, then the continuation token does not contain a value. The value of
3522// this parameter should not be URL encoded.
3523// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
3524// defines the upper bound on the number of results returned. The results returned can be less than the
3525// specified maximum results if they do not fit in the message as per the max message size restrictions defined
3526// in the configuration. If this parameter is zero or not specified, the paged query includes as many results
3527// as possible that fit in the return message.
3528func (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) {
3529	if tracing.IsEnabled() {
3530		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationBackupList")
3531		defer func() {
3532			sc := -1
3533			if result.Response.Response != nil {
3534				sc = result.Response.Response.StatusCode
3535			}
3536			tracing.EndSpan(ctx, sc, err)
3537		}()
3538	}
3539	if err := validation.Validate([]validation.Validation{
3540		{TargetValue: timeout,
3541			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3542				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3543					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3544				}}}},
3545		{TargetValue: maxResults,
3546			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
3547				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil {
3548		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationBackupList", err.Error())
3549	}
3550
3551	req, err := client.GetApplicationBackupListPreparer(ctx, applicationID, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults)
3552	if err != nil {
3553		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", nil, "Failure preparing request")
3554		return
3555	}
3556
3557	resp, err := client.GetApplicationBackupListSender(req)
3558	if err != nil {
3559		result.Response = autorest.Response{Response: resp}
3560		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", resp, "Failure sending request")
3561		return
3562	}
3563
3564	result, err = client.GetApplicationBackupListResponder(resp)
3565	if err != nil {
3566		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", resp, "Failure responding to request")
3567		return
3568	}
3569
3570	return
3571}
3572
3573// GetApplicationBackupListPreparer prepares the GetApplicationBackupList request.
3574func (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) {
3575	pathParameters := map[string]interface{}{
3576		"applicationId": applicationID,
3577	}
3578
3579	const APIVersion = "6.2-preview"
3580	queryParameters := map[string]interface{}{
3581		"api-version": APIVersion,
3582	}
3583	if timeout != nil {
3584		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3585	} else {
3586		queryParameters["timeout"] = autorest.Encode("query", 60)
3587	}
3588	if latest != nil {
3589		queryParameters["Latest"] = autorest.Encode("query", *latest)
3590	} else {
3591		queryParameters["Latest"] = autorest.Encode("query", false)
3592	}
3593	if startDateTimeFilter != nil {
3594		queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter)
3595	}
3596	if endDateTimeFilter != nil {
3597		queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter)
3598	}
3599	if len(continuationToken) > 0 {
3600		queryParameters["ContinuationToken"] = continuationToken
3601	}
3602	if maxResults != nil {
3603		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
3604	} else {
3605		queryParameters["MaxResults"] = autorest.Encode("query", 0)
3606	}
3607
3608	preparer := autorest.CreatePreparer(
3609		autorest.AsGet(),
3610		autorest.WithBaseURL(client.BaseURI),
3611		autorest.WithPathParameters("/Applications/{applicationId}/$/GetBackups", pathParameters),
3612		autorest.WithQueryParameters(queryParameters))
3613	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3614}
3615
3616// GetApplicationBackupListSender sends the GetApplicationBackupList request. The method will close the
3617// http.Response Body if it receives an error.
3618func (client BaseClient) GetApplicationBackupListSender(req *http.Request) (*http.Response, error) {
3619	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3620}
3621
3622// GetApplicationBackupListResponder handles the response to the GetApplicationBackupList request. The method always
3623// closes the http.Response Body.
3624func (client BaseClient) GetApplicationBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) {
3625	err = autorest.Respond(
3626		resp,
3627		azure.WithErrorUnlessStatusCode(http.StatusOK),
3628		autorest.ByUnmarshallingJSON(&result),
3629		autorest.ByClosing())
3630	result.Response = autorest.Response{Response: resp}
3631	return
3632}
3633
3634// GetApplicationEventList the response is list of ApplicationEvent objects.
3635// Parameters:
3636// applicationID - the identity of the application. This is typically the full name of the application without
3637// the 'fabric:' URI scheme.
3638// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3639// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3640// in 6.0+ and "myapp/app1" in previous versions.
3641// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
3642// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
3643// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3644// duration that the client is willing to wait for the requested operation to complete. The default value for
3645// this parameter is 60 seconds.
3646// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
3647// be included in the response.
3648// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
3649// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
3650// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
3651// populated.
3652func (client BaseClient) GetApplicationEventList(ctx context.Context, applicationID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListApplicationEvent, err error) {
3653	if tracing.IsEnabled() {
3654		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationEventList")
3655		defer func() {
3656			sc := -1
3657			if result.Response.Response != nil {
3658				sc = result.Response.Response.StatusCode
3659			}
3660			tracing.EndSpan(ctx, sc, err)
3661		}()
3662	}
3663	if err := validation.Validate([]validation.Validation{
3664		{TargetValue: timeout,
3665			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3666				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3667					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3668				}}}}}); err != nil {
3669		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationEventList", err.Error())
3670	}
3671
3672	req, err := client.GetApplicationEventListPreparer(ctx, applicationID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
3673	if err != nil {
3674		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", nil, "Failure preparing request")
3675		return
3676	}
3677
3678	resp, err := client.GetApplicationEventListSender(req)
3679	if err != nil {
3680		result.Response = autorest.Response{Response: resp}
3681		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", resp, "Failure sending request")
3682		return
3683	}
3684
3685	result, err = client.GetApplicationEventListResponder(resp)
3686	if err != nil {
3687		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", resp, "Failure responding to request")
3688		return
3689	}
3690
3691	return
3692}
3693
3694// GetApplicationEventListPreparer prepares the GetApplicationEventList request.
3695func (client BaseClient) GetApplicationEventListPreparer(ctx context.Context, applicationID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
3696	pathParameters := map[string]interface{}{
3697		"applicationId": applicationID,
3698	}
3699
3700	const APIVersion = "6.2-preview"
3701	queryParameters := map[string]interface{}{
3702		"api-version":  APIVersion,
3703		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
3704		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
3705	}
3706	if timeout != nil {
3707		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3708	} else {
3709		queryParameters["timeout"] = autorest.Encode("query", 60)
3710	}
3711	if len(eventsTypesFilter) > 0 {
3712		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
3713	}
3714	if excludeAnalysisEvents != nil {
3715		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
3716	}
3717	if skipCorrelationLookup != nil {
3718		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
3719	}
3720
3721	preparer := autorest.CreatePreparer(
3722		autorest.AsGet(),
3723		autorest.WithBaseURL(client.BaseURI),
3724		autorest.WithPathParameters("/EventsStore/Applications/{applicationId}/$/Events", pathParameters),
3725		autorest.WithQueryParameters(queryParameters))
3726	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3727}
3728
3729// GetApplicationEventListSender sends the GetApplicationEventList request. The method will close the
3730// http.Response Body if it receives an error.
3731func (client BaseClient) GetApplicationEventListSender(req *http.Request) (*http.Response, error) {
3732	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3733}
3734
3735// GetApplicationEventListResponder handles the response to the GetApplicationEventList request. The method always
3736// closes the http.Response Body.
3737func (client BaseClient) GetApplicationEventListResponder(resp *http.Response) (result ListApplicationEvent, err error) {
3738	err = autorest.Respond(
3739		resp,
3740		azure.WithErrorUnlessStatusCode(http.StatusOK),
3741		autorest.ByUnmarshallingJSON(&result),
3742		autorest.ByClosing())
3743	result.Response = autorest.Response{Response: resp}
3744	return
3745}
3746
3747// GetApplicationHealth returns the heath state of the service fabric application. The response reports either Ok,
3748// Error or Warning health state. If the entity is not found in the health store, it will return Error.
3749// Parameters:
3750// applicationID - the identity of the application. This is typically the full name of the application without
3751// the 'fabric:' URI scheme.
3752// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3753// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3754// in 6.0+ and "myapp/app1" in previous versions.
3755// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
3756// state.
3757// The possible values for this parameter include integer value of one of the following health states.
3758// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
3759// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
3760// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
3761// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
3762//
3763// - Default - Default value. Matches any HealthState. The value is zero.
3764// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3765// collection of states. The value is 1.
3766// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3767// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3768// - Error - Filter that matches input with HealthState value Error. The value is 8.
3769// - All - Filter that matches input with any HealthState value. The value is 65535.
3770// deployedApplicationsHealthStateFilter - allows filtering of the deployed applications health state objects
3771// returned in the result of application health query based on their health state.
3772// The possible values for this parameter include integer value of one of the following health states. Only
3773// deployed applications that match the filter will be returned.
3774// All deployed applications are used to evaluate the aggregated health state. If not specified, all entries
3775// are returned.
3776// The state values are flag-based enumeration, so the value could be a combination of these values, obtained
3777// using bitwise 'OR' operator.
3778// For example, if the provided value is 6 then health state of deployed applications with HealthState value of
3779// OK (2) and Warning (4) are returned.
3780//
3781// - Default - Default value. Matches any HealthState. The value is zero.
3782// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3783// collection of states. The value is 1.
3784// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3785// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3786// - Error - Filter that matches input with HealthState value Error. The value is 8.
3787// - All - Filter that matches input with any HealthState value. The value is 65535.
3788// servicesHealthStateFilter - allows filtering of the services health state objects returned in the result of
3789// services health query based on their health state.
3790// The possible values for this parameter include integer value of one of the following health states.
3791// Only services that match the filter are returned. All services are used to evaluate the aggregated health
3792// state.
3793// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
3794// be a combination of these values,
3795// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of services
3796// with HealthState value of OK (2) and Warning (4) will be returned.
3797//
3798// - Default - Default value. Matches any HealthState. The value is zero.
3799// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3800// collection of states. The value is 1.
3801// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3802// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3803// - Error - Filter that matches input with HealthState value Error. The value is 8.
3804// - All - Filter that matches input with any HealthState value. The value is 65535.
3805// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
3806// result. False by default.
3807// The statistics show the number of children entities in health state Ok, Warning, and Error.
3808// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3809// duration that the client is willing to wait for the requested operation to complete. The default value for
3810// this parameter is 60 seconds.
3811func (client BaseClient) GetApplicationHealth(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result ApplicationHealth, err error) {
3812	if tracing.IsEnabled() {
3813		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationHealth")
3814		defer func() {
3815			sc := -1
3816			if result.Response.Response != nil {
3817				sc = result.Response.Response.StatusCode
3818			}
3819			tracing.EndSpan(ctx, sc, err)
3820		}()
3821	}
3822	if err := validation.Validate([]validation.Validation{
3823		{TargetValue: timeout,
3824			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3825				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3826					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3827				}}}}}); err != nil {
3828		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealth", err.Error())
3829	}
3830
3831	req, err := client.GetApplicationHealthPreparer(ctx, applicationID, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, timeout)
3832	if err != nil {
3833		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", nil, "Failure preparing request")
3834		return
3835	}
3836
3837	resp, err := client.GetApplicationHealthSender(req)
3838	if err != nil {
3839		result.Response = autorest.Response{Response: resp}
3840		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", resp, "Failure sending request")
3841		return
3842	}
3843
3844	result, err = client.GetApplicationHealthResponder(resp)
3845	if err != nil {
3846		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", resp, "Failure responding to request")
3847		return
3848	}
3849
3850	return
3851}
3852
3853// GetApplicationHealthPreparer prepares the GetApplicationHealth request.
3854func (client BaseClient) GetApplicationHealthPreparer(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
3855	pathParameters := map[string]interface{}{
3856		"applicationId": applicationID,
3857	}
3858
3859	const APIVersion = "6.0"
3860	queryParameters := map[string]interface{}{
3861		"api-version": APIVersion,
3862	}
3863	if eventsHealthStateFilter != nil {
3864		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
3865	} else {
3866		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
3867	}
3868	if deployedApplicationsHealthStateFilter != nil {
3869		queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", *deployedApplicationsHealthStateFilter)
3870	} else {
3871		queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", 0)
3872	}
3873	if servicesHealthStateFilter != nil {
3874		queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", *servicesHealthStateFilter)
3875	} else {
3876		queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", 0)
3877	}
3878	if excludeHealthStatistics != nil {
3879		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
3880	} else {
3881		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
3882	}
3883	if timeout != nil {
3884		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3885	} else {
3886		queryParameters["timeout"] = autorest.Encode("query", 60)
3887	}
3888
3889	preparer := autorest.CreatePreparer(
3890		autorest.AsGet(),
3891		autorest.WithBaseURL(client.BaseURI),
3892		autorest.WithPathParameters("/Applications/{applicationId}/$/GetHealth", pathParameters),
3893		autorest.WithQueryParameters(queryParameters))
3894	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3895}
3896
3897// GetApplicationHealthSender sends the GetApplicationHealth request. The method will close the
3898// http.Response Body if it receives an error.
3899func (client BaseClient) GetApplicationHealthSender(req *http.Request) (*http.Response, error) {
3900	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3901}
3902
3903// GetApplicationHealthResponder handles the response to the GetApplicationHealth request. The method always
3904// closes the http.Response Body.
3905func (client BaseClient) GetApplicationHealthResponder(resp *http.Response) (result ApplicationHealth, err error) {
3906	err = autorest.Respond(
3907		resp,
3908		azure.WithErrorUnlessStatusCode(http.StatusOK),
3909		autorest.ByUnmarshallingJSON(&result),
3910		autorest.ByClosing())
3911	result.Response = autorest.Response{Response: resp}
3912	return
3913}
3914
3915// GetApplicationHealthUsingPolicy gets the health of a Service Fabric application. Use EventsHealthStateFilter to
3916// filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicies to
3917// override the health policies used to evaluate the health.
3918// Parameters:
3919// applicationID - the identity of the application. This is typically the full name of the application without
3920// the 'fabric:' URI scheme.
3921// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3922// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3923// in 6.0+ and "myapp/app1" in previous versions.
3924// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
3925// state.
3926// The possible values for this parameter include integer value of one of the following health states.
3927// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
3928// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
3929// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
3930// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
3931//
3932// - Default - Default value. Matches any HealthState. The value is zero.
3933// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3934// collection of states. The value is 1.
3935// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3936// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3937// - Error - Filter that matches input with HealthState value Error. The value is 8.
3938// - All - Filter that matches input with any HealthState value. The value is 65535.
3939// deployedApplicationsHealthStateFilter - allows filtering of the deployed applications health state objects
3940// returned in the result of application health query based on their health state.
3941// The possible values for this parameter include integer value of one of the following health states. Only
3942// deployed applications that match the filter will be returned.
3943// All deployed applications are used to evaluate the aggregated health state. If not specified, all entries
3944// are returned.
3945// The state values are flag-based enumeration, so the value could be a combination of these values, obtained
3946// using bitwise 'OR' operator.
3947// For example, if the provided value is 6 then health state of deployed applications with HealthState value of
3948// OK (2) and Warning (4) are returned.
3949//
3950// - Default - Default value. Matches any HealthState. The value is zero.
3951// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3952// collection of states. The value is 1.
3953// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3954// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3955// - Error - Filter that matches input with HealthState value Error. The value is 8.
3956// - All - Filter that matches input with any HealthState value. The value is 65535.
3957// servicesHealthStateFilter - allows filtering of the services health state objects returned in the result of
3958// services health query based on their health state.
3959// The possible values for this parameter include integer value of one of the following health states.
3960// Only services that match the filter are returned. All services are used to evaluate the aggregated health
3961// state.
3962// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
3963// be a combination of these values,
3964// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of services
3965// with HealthState value of OK (2) and Warning (4) will be returned.
3966//
3967// - Default - Default value. Matches any HealthState. The value is zero.
3968// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3969// collection of states. The value is 1.
3970// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3971// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3972// - Error - Filter that matches input with HealthState value Error. The value is 8.
3973// - All - Filter that matches input with any HealthState value. The value is 65535.
3974// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
3975// result. False by default.
3976// The statistics show the number of children entities in health state Ok, Warning, and Error.
3977// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
3978// of its children.
3979// If not present, the health evaluation uses the health policy from application manifest or the default health
3980// policy.
3981// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3982// duration that the client is willing to wait for the requested operation to complete. The default value for
3983// this parameter is 60 seconds.
3984func (client BaseClient) GetApplicationHealthUsingPolicy(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result ApplicationHealth, err error) {
3985	if tracing.IsEnabled() {
3986		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationHealthUsingPolicy")
3987		defer func() {
3988			sc := -1
3989			if result.Response.Response != nil {
3990				sc = result.Response.Response.StatusCode
3991			}
3992			tracing.EndSpan(ctx, sc, err)
3993		}()
3994	}
3995	if err := validation.Validate([]validation.Validation{
3996		{TargetValue: timeout,
3997			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3998				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3999					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4000				}}}}}); err != nil {
4001		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", err.Error())
4002	}
4003
4004	req, err := client.GetApplicationHealthUsingPolicyPreparer(ctx, applicationID, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, applicationHealthPolicy, timeout)
4005	if err != nil {
4006		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", nil, "Failure preparing request")
4007		return
4008	}
4009
4010	resp, err := client.GetApplicationHealthUsingPolicySender(req)
4011	if err != nil {
4012		result.Response = autorest.Response{Response: resp}
4013		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", resp, "Failure sending request")
4014		return
4015	}
4016
4017	result, err = client.GetApplicationHealthUsingPolicyResponder(resp)
4018	if err != nil {
4019		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", resp, "Failure responding to request")
4020		return
4021	}
4022
4023	return
4024}
4025
4026// GetApplicationHealthUsingPolicyPreparer prepares the GetApplicationHealthUsingPolicy request.
4027func (client BaseClient) GetApplicationHealthUsingPolicyPreparer(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) {
4028	pathParameters := map[string]interface{}{
4029		"applicationId": applicationID,
4030	}
4031
4032	const APIVersion = "6.0"
4033	queryParameters := map[string]interface{}{
4034		"api-version": APIVersion,
4035	}
4036	if eventsHealthStateFilter != nil {
4037		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
4038	} else {
4039		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
4040	}
4041	if deployedApplicationsHealthStateFilter != nil {
4042		queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", *deployedApplicationsHealthStateFilter)
4043	} else {
4044		queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", 0)
4045	}
4046	if servicesHealthStateFilter != nil {
4047		queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", *servicesHealthStateFilter)
4048	} else {
4049		queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", 0)
4050	}
4051	if excludeHealthStatistics != nil {
4052		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
4053	} else {
4054		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
4055	}
4056	if timeout != nil {
4057		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4058	} else {
4059		queryParameters["timeout"] = autorest.Encode("query", 60)
4060	}
4061
4062	preparer := autorest.CreatePreparer(
4063		autorest.AsContentType("application/json; charset=utf-8"),
4064		autorest.AsPost(),
4065		autorest.WithBaseURL(client.BaseURI),
4066		autorest.WithPathParameters("/Applications/{applicationId}/$/GetHealth", pathParameters),
4067		autorest.WithQueryParameters(queryParameters))
4068	if applicationHealthPolicy != nil {
4069		preparer = autorest.DecoratePreparer(preparer,
4070			autorest.WithJSON(applicationHealthPolicy))
4071	}
4072	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4073}
4074
4075// GetApplicationHealthUsingPolicySender sends the GetApplicationHealthUsingPolicy request. The method will close the
4076// http.Response Body if it receives an error.
4077func (client BaseClient) GetApplicationHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
4078	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4079}
4080
4081// GetApplicationHealthUsingPolicyResponder handles the response to the GetApplicationHealthUsingPolicy request. The method always
4082// closes the http.Response Body.
4083func (client BaseClient) GetApplicationHealthUsingPolicyResponder(resp *http.Response) (result ApplicationHealth, err error) {
4084	err = autorest.Respond(
4085		resp,
4086		azure.WithErrorUnlessStatusCode(http.StatusOK),
4087		autorest.ByUnmarshallingJSON(&result),
4088		autorest.ByClosing())
4089	result.Response = autorest.Response{Response: resp}
4090	return
4091}
4092
4093// GetApplicationInfo returns the information about the application that was created or in the process of being created
4094// in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the
4095// name, type, status, parameters, and other details about the application.
4096// Parameters:
4097// applicationID - the identity of the application. This is typically the full name of the application without
4098// the 'fabric:' URI scheme.
4099// Starting from version 6.0, hierarchical names are delimited with the "~" character.
4100// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
4101// in 6.0+ and "myapp/app1" in previous versions.
4102// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from
4103// the result.
4104// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4105// duration that the client is willing to wait for the requested operation to complete. The default value for
4106// this parameter is 60 seconds.
4107func (client BaseClient) GetApplicationInfo(ctx context.Context, applicationID string, excludeApplicationParameters *bool, timeout *int64) (result ApplicationInfo, err error) {
4108	if tracing.IsEnabled() {
4109		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationInfo")
4110		defer func() {
4111			sc := -1
4112			if result.Response.Response != nil {
4113				sc = result.Response.Response.StatusCode
4114			}
4115			tracing.EndSpan(ctx, sc, err)
4116		}()
4117	}
4118	if err := validation.Validate([]validation.Validation{
4119		{TargetValue: timeout,
4120			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4121				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4122					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4123				}}}}}); err != nil {
4124		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfo", err.Error())
4125	}
4126
4127	req, err := client.GetApplicationInfoPreparer(ctx, applicationID, excludeApplicationParameters, timeout)
4128	if err != nil {
4129		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", nil, "Failure preparing request")
4130		return
4131	}
4132
4133	resp, err := client.GetApplicationInfoSender(req)
4134	if err != nil {
4135		result.Response = autorest.Response{Response: resp}
4136		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", resp, "Failure sending request")
4137		return
4138	}
4139
4140	result, err = client.GetApplicationInfoResponder(resp)
4141	if err != nil {
4142		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", resp, "Failure responding to request")
4143		return
4144	}
4145
4146	return
4147}
4148
4149// GetApplicationInfoPreparer prepares the GetApplicationInfo request.
4150func (client BaseClient) GetApplicationInfoPreparer(ctx context.Context, applicationID string, excludeApplicationParameters *bool, timeout *int64) (*http.Request, error) {
4151	pathParameters := map[string]interface{}{
4152		"applicationId": applicationID,
4153	}
4154
4155	const APIVersion = "6.0"
4156	queryParameters := map[string]interface{}{
4157		"api-version": APIVersion,
4158	}
4159	if excludeApplicationParameters != nil {
4160		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters)
4161	} else {
4162		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false)
4163	}
4164	if timeout != nil {
4165		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4166	} else {
4167		queryParameters["timeout"] = autorest.Encode("query", 60)
4168	}
4169
4170	preparer := autorest.CreatePreparer(
4171		autorest.AsGet(),
4172		autorest.WithBaseURL(client.BaseURI),
4173		autorest.WithPathParameters("/Applications/{applicationId}", pathParameters),
4174		autorest.WithQueryParameters(queryParameters))
4175	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4176}
4177
4178// GetApplicationInfoSender sends the GetApplicationInfo request. The method will close the
4179// http.Response Body if it receives an error.
4180func (client BaseClient) GetApplicationInfoSender(req *http.Request) (*http.Response, error) {
4181	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4182}
4183
4184// GetApplicationInfoResponder handles the response to the GetApplicationInfo request. The method always
4185// closes the http.Response Body.
4186func (client BaseClient) GetApplicationInfoResponder(resp *http.Response) (result ApplicationInfo, err error) {
4187	err = autorest.Respond(
4188		resp,
4189		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
4190		autorest.ByUnmarshallingJSON(&result),
4191		autorest.ByClosing())
4192	result.Response = autorest.Response{Response: resp}
4193	return
4194}
4195
4196// GetApplicationInfoList gets the information about the applications that were created or in the process of being
4197// created in the Service Fabric cluster and match the specified filters. The response includes the name, type, status,
4198// parameters, and other details about the application. If the applications do not fit in a page, one page of results
4199// is returned as well as a continuation token, which can be used to get the next page. Filters ApplicationTypeName and
4200// ApplicationDefinitionKindFilter cannot be specified at the same time.
4201// Parameters:
4202// applicationDefinitionKindFilter - used to filter on ApplicationDefinitionKind, which is the mechanism used
4203// to define a Service Fabric application.
4204// - Default - Default value, which performs the same function as selecting "All". The value is 0.
4205// - All - Filter that matches input with any ApplicationDefinitionKind value. The value is 65535.
4206// - ServiceFabricApplicationDescription - Filter that matches input with ApplicationDefinitionKind value
4207// ServiceFabricApplicationDescription. The value is 1.
4208// - Compose - Filter that matches input with ApplicationDefinitionKind value Compose. The value is 2.
4209// applicationTypeName - the application type name used to filter the applications to query for. This value
4210// should not contain the application type version.
4211// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from
4212// the result.
4213// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
4214// token with a non-empty value is included in the response of the API when the results from the system do not
4215// fit in a single response. When this value is passed to the next API call, the API returns next set of
4216// results. If there are no further results, then the continuation token does not contain a value. The value of
4217// this parameter should not be URL encoded.
4218// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
4219// defines the upper bound on the number of results returned. The results returned can be less than the
4220// specified maximum results if they do not fit in the message as per the max message size restrictions defined
4221// in the configuration. If this parameter is zero or not specified, the paged query includes as many results
4222// as possible that fit in the return message.
4223// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4224// duration that the client is willing to wait for the requested operation to complete. The default value for
4225// this parameter is 60 seconds.
4226func (client BaseClient) GetApplicationInfoList(ctx context.Context, applicationDefinitionKindFilter *int32, applicationTypeName string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationInfoList, err error) {
4227	if tracing.IsEnabled() {
4228		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationInfoList")
4229		defer func() {
4230			sc := -1
4231			if result.Response.Response != nil {
4232				sc = result.Response.Response.StatusCode
4233			}
4234			tracing.EndSpan(ctx, sc, err)
4235		}()
4236	}
4237	if err := validation.Validate([]validation.Validation{
4238		{TargetValue: maxResults,
4239			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
4240				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
4241		{TargetValue: timeout,
4242			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4243				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4244					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4245				}}}}}); err != nil {
4246		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfoList", err.Error())
4247	}
4248
4249	req, err := client.GetApplicationInfoListPreparer(ctx, applicationDefinitionKindFilter, applicationTypeName, excludeApplicationParameters, continuationToken, maxResults, timeout)
4250	if err != nil {
4251		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", nil, "Failure preparing request")
4252		return
4253	}
4254
4255	resp, err := client.GetApplicationInfoListSender(req)
4256	if err != nil {
4257		result.Response = autorest.Response{Response: resp}
4258		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", resp, "Failure sending request")
4259		return
4260	}
4261
4262	result, err = client.GetApplicationInfoListResponder(resp)
4263	if err != nil {
4264		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", resp, "Failure responding to request")
4265		return
4266	}
4267
4268	return
4269}
4270
4271// GetApplicationInfoListPreparer prepares the GetApplicationInfoList request.
4272func (client BaseClient) GetApplicationInfoListPreparer(ctx context.Context, applicationDefinitionKindFilter *int32, applicationTypeName string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
4273	const APIVersion = "6.1"
4274	queryParameters := map[string]interface{}{
4275		"api-version": APIVersion,
4276	}
4277	if applicationDefinitionKindFilter != nil {
4278		queryParameters["ApplicationDefinitionKindFilter"] = autorest.Encode("query", *applicationDefinitionKindFilter)
4279	} else {
4280		queryParameters["ApplicationDefinitionKindFilter"] = autorest.Encode("query", 0)
4281	}
4282	if len(applicationTypeName) > 0 {
4283		queryParameters["ApplicationTypeName"] = autorest.Encode("query", applicationTypeName)
4284	}
4285	if excludeApplicationParameters != nil {
4286		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters)
4287	} else {
4288		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false)
4289	}
4290	if len(continuationToken) > 0 {
4291		queryParameters["ContinuationToken"] = continuationToken
4292	}
4293	if maxResults != nil {
4294		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
4295	} else {
4296		queryParameters["MaxResults"] = autorest.Encode("query", 0)
4297	}
4298	if timeout != nil {
4299		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4300	} else {
4301		queryParameters["timeout"] = autorest.Encode("query", 60)
4302	}
4303
4304	preparer := autorest.CreatePreparer(
4305		autorest.AsGet(),
4306		autorest.WithBaseURL(client.BaseURI),
4307		autorest.WithPath("/Applications"),
4308		autorest.WithQueryParameters(queryParameters))
4309	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4310}
4311
4312// GetApplicationInfoListSender sends the GetApplicationInfoList request. The method will close the
4313// http.Response Body if it receives an error.
4314func (client BaseClient) GetApplicationInfoListSender(req *http.Request) (*http.Response, error) {
4315	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4316}
4317
4318// GetApplicationInfoListResponder handles the response to the GetApplicationInfoList request. The method always
4319// closes the http.Response Body.
4320func (client BaseClient) GetApplicationInfoListResponder(resp *http.Response) (result PagedApplicationInfoList, err error) {
4321	err = autorest.Respond(
4322		resp,
4323		azure.WithErrorUnlessStatusCode(http.StatusOK),
4324		autorest.ByUnmarshallingJSON(&result),
4325		autorest.ByClosing())
4326	result.Response = autorest.Response{Response: resp}
4327	return
4328}
4329
4330// GetApplicationLoadInfo returns the load information about the application that was created or in the process of
4331// being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response
4332// includes the name, minimum nodes, maximum nodes, the number of nodes the application is occupying currently, and
4333// application load metric information about the application.
4334// Parameters:
4335// applicationID - the identity of the application. This is typically the full name of the application without
4336// the 'fabric:' URI scheme.
4337// Starting from version 6.0, hierarchical names are delimited with the "~" character.
4338// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
4339// in 6.0+ and "myapp/app1" in previous versions.
4340// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4341// duration that the client is willing to wait for the requested operation to complete. The default value for
4342// this parameter is 60 seconds.
4343func (client BaseClient) GetApplicationLoadInfo(ctx context.Context, applicationID string, timeout *int64) (result ApplicationLoadInfo, err error) {
4344	if tracing.IsEnabled() {
4345		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationLoadInfo")
4346		defer func() {
4347			sc := -1
4348			if result.Response.Response != nil {
4349				sc = result.Response.Response.StatusCode
4350			}
4351			tracing.EndSpan(ctx, sc, err)
4352		}()
4353	}
4354	if err := validation.Validate([]validation.Validation{
4355		{TargetValue: timeout,
4356			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4357				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4358					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4359				}}}}}); err != nil {
4360		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationLoadInfo", err.Error())
4361	}
4362
4363	req, err := client.GetApplicationLoadInfoPreparer(ctx, applicationID, timeout)
4364	if err != nil {
4365		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", nil, "Failure preparing request")
4366		return
4367	}
4368
4369	resp, err := client.GetApplicationLoadInfoSender(req)
4370	if err != nil {
4371		result.Response = autorest.Response{Response: resp}
4372		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", resp, "Failure sending request")
4373		return
4374	}
4375
4376	result, err = client.GetApplicationLoadInfoResponder(resp)
4377	if err != nil {
4378		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", resp, "Failure responding to request")
4379		return
4380	}
4381
4382	return
4383}
4384
4385// GetApplicationLoadInfoPreparer prepares the GetApplicationLoadInfo request.
4386func (client BaseClient) GetApplicationLoadInfoPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
4387	pathParameters := map[string]interface{}{
4388		"applicationId": applicationID,
4389	}
4390
4391	const APIVersion = "6.0"
4392	queryParameters := map[string]interface{}{
4393		"api-version": APIVersion,
4394	}
4395	if timeout != nil {
4396		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4397	} else {
4398		queryParameters["timeout"] = autorest.Encode("query", 60)
4399	}
4400
4401	preparer := autorest.CreatePreparer(
4402		autorest.AsGet(),
4403		autorest.WithBaseURL(client.BaseURI),
4404		autorest.WithPathParameters("/Applications/{applicationId}/$/GetLoadInformation", pathParameters),
4405		autorest.WithQueryParameters(queryParameters))
4406	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4407}
4408
4409// GetApplicationLoadInfoSender sends the GetApplicationLoadInfo request. The method will close the
4410// http.Response Body if it receives an error.
4411func (client BaseClient) GetApplicationLoadInfoSender(req *http.Request) (*http.Response, error) {
4412	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4413}
4414
4415// GetApplicationLoadInfoResponder handles the response to the GetApplicationLoadInfo request. The method always
4416// closes the http.Response Body.
4417func (client BaseClient) GetApplicationLoadInfoResponder(resp *http.Response) (result ApplicationLoadInfo, err error) {
4418	err = autorest.Respond(
4419		resp,
4420		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
4421		autorest.ByUnmarshallingJSON(&result),
4422		autorest.ByClosing())
4423	result.Response = autorest.Response{Response: resp}
4424	return
4425}
4426
4427// GetApplicationManifest the response contains the application manifest XML as a string.
4428// Parameters:
4429// applicationTypeName - the name of the application type.
4430// applicationTypeVersion - the version of the application type.
4431// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4432// duration that the client is willing to wait for the requested operation to complete. The default value for
4433// this parameter is 60 seconds.
4434func (client BaseClient) GetApplicationManifest(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (result ApplicationTypeManifest, err error) {
4435	if tracing.IsEnabled() {
4436		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationManifest")
4437		defer func() {
4438			sc := -1
4439			if result.Response.Response != nil {
4440				sc = result.Response.Response.StatusCode
4441			}
4442			tracing.EndSpan(ctx, sc, err)
4443		}()
4444	}
4445	if err := validation.Validate([]validation.Validation{
4446		{TargetValue: timeout,
4447			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4448				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4449					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4450				}}}}}); err != nil {
4451		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationManifest", err.Error())
4452	}
4453
4454	req, err := client.GetApplicationManifestPreparer(ctx, applicationTypeName, applicationTypeVersion, timeout)
4455	if err != nil {
4456		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", nil, "Failure preparing request")
4457		return
4458	}
4459
4460	resp, err := client.GetApplicationManifestSender(req)
4461	if err != nil {
4462		result.Response = autorest.Response{Response: resp}
4463		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", resp, "Failure sending request")
4464		return
4465	}
4466
4467	result, err = client.GetApplicationManifestResponder(resp)
4468	if err != nil {
4469		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", resp, "Failure responding to request")
4470		return
4471	}
4472
4473	return
4474}
4475
4476// GetApplicationManifestPreparer prepares the GetApplicationManifest request.
4477func (client BaseClient) GetApplicationManifestPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (*http.Request, error) {
4478	pathParameters := map[string]interface{}{
4479		"applicationTypeName": autorest.Encode("path", applicationTypeName),
4480	}
4481
4482	const APIVersion = "6.0"
4483	queryParameters := map[string]interface{}{
4484		"api-version":            APIVersion,
4485		"ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion),
4486	}
4487	if timeout != nil {
4488		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4489	} else {
4490		queryParameters["timeout"] = autorest.Encode("query", 60)
4491	}
4492
4493	preparer := autorest.CreatePreparer(
4494		autorest.AsGet(),
4495		autorest.WithBaseURL(client.BaseURI),
4496		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetApplicationManifest", pathParameters),
4497		autorest.WithQueryParameters(queryParameters))
4498	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4499}
4500
4501// GetApplicationManifestSender sends the GetApplicationManifest request. The method will close the
4502// http.Response Body if it receives an error.
4503func (client BaseClient) GetApplicationManifestSender(req *http.Request) (*http.Response, error) {
4504	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4505}
4506
4507// GetApplicationManifestResponder handles the response to the GetApplicationManifest request. The method always
4508// closes the http.Response Body.
4509func (client BaseClient) GetApplicationManifestResponder(resp *http.Response) (result ApplicationTypeManifest, err error) {
4510	err = autorest.Respond(
4511		resp,
4512		azure.WithErrorUnlessStatusCode(http.StatusOK),
4513		autorest.ByUnmarshallingJSON(&result),
4514		autorest.ByClosing())
4515	result.Response = autorest.Response{Response: resp}
4516	return
4517}
4518
4519// GetApplicationNameInfo gets the name of the application for the specified service. A 404
4520// FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the provided service ID does not exist.
4521// Parameters:
4522// serviceID - the identity of the service. This ID is typically the full name of the service without the
4523// 'fabric:' URI scheme.
4524// Starting from version 6.0, hierarchical names are delimited with the "~" character.
4525// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
4526// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
4527// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4528// duration that the client is willing to wait for the requested operation to complete. The default value for
4529// this parameter is 60 seconds.
4530func (client BaseClient) GetApplicationNameInfo(ctx context.Context, serviceID string, timeout *int64) (result ApplicationNameInfo, err error) {
4531	if tracing.IsEnabled() {
4532		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationNameInfo")
4533		defer func() {
4534			sc := -1
4535			if result.Response.Response != nil {
4536				sc = result.Response.Response.StatusCode
4537			}
4538			tracing.EndSpan(ctx, sc, err)
4539		}()
4540	}
4541	if err := validation.Validate([]validation.Validation{
4542		{TargetValue: timeout,
4543			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4544				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4545					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4546				}}}}}); err != nil {
4547		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationNameInfo", err.Error())
4548	}
4549
4550	req, err := client.GetApplicationNameInfoPreparer(ctx, serviceID, timeout)
4551	if err != nil {
4552		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", nil, "Failure preparing request")
4553		return
4554	}
4555
4556	resp, err := client.GetApplicationNameInfoSender(req)
4557	if err != nil {
4558		result.Response = autorest.Response{Response: resp}
4559		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", resp, "Failure sending request")
4560		return
4561	}
4562
4563	result, err = client.GetApplicationNameInfoResponder(resp)
4564	if err != nil {
4565		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", resp, "Failure responding to request")
4566		return
4567	}
4568
4569	return
4570}
4571
4572// GetApplicationNameInfoPreparer prepares the GetApplicationNameInfo request.
4573func (client BaseClient) GetApplicationNameInfoPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
4574	pathParameters := map[string]interface{}{
4575		"serviceId": serviceID,
4576	}
4577
4578	const APIVersion = "6.0"
4579	queryParameters := map[string]interface{}{
4580		"api-version": APIVersion,
4581	}
4582	if timeout != nil {
4583		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4584	} else {
4585		queryParameters["timeout"] = autorest.Encode("query", 60)
4586	}
4587
4588	preparer := autorest.CreatePreparer(
4589		autorest.AsGet(),
4590		autorest.WithBaseURL(client.BaseURI),
4591		autorest.WithPathParameters("/Services/{serviceId}/$/GetApplicationName", pathParameters),
4592		autorest.WithQueryParameters(queryParameters))
4593	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4594}
4595
4596// GetApplicationNameInfoSender sends the GetApplicationNameInfo request. The method will close the
4597// http.Response Body if it receives an error.
4598func (client BaseClient) GetApplicationNameInfoSender(req *http.Request) (*http.Response, error) {
4599	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4600}
4601
4602// GetApplicationNameInfoResponder handles the response to the GetApplicationNameInfo request. The method always
4603// closes the http.Response Body.
4604func (client BaseClient) GetApplicationNameInfoResponder(resp *http.Response) (result ApplicationNameInfo, err error) {
4605	err = autorest.Respond(
4606		resp,
4607		azure.WithErrorUnlessStatusCode(http.StatusOK),
4608		autorest.ByUnmarshallingJSON(&result),
4609		autorest.ByClosing())
4610	result.Response = autorest.Response{Response: resp}
4611	return
4612}
4613
4614// GetApplicationResource gets the application with the given name. This includes the information about the
4615// application's services and other runtime information.
4616// Parameters:
4617// applicationResourceName - service Fabric application resource name.
4618func (client BaseClient) GetApplicationResource(ctx context.Context, applicationResourceName string) (result ApplicationResourceDescription, err error) {
4619	if tracing.IsEnabled() {
4620		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationResource")
4621		defer func() {
4622			sc := -1
4623			if result.Response.Response != nil {
4624				sc = result.Response.Response.StatusCode
4625			}
4626			tracing.EndSpan(ctx, sc, err)
4627		}()
4628	}
4629	req, err := client.GetApplicationResourcePreparer(ctx, applicationResourceName)
4630	if err != nil {
4631		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationResource", nil, "Failure preparing request")
4632		return
4633	}
4634
4635	resp, err := client.GetApplicationResourceSender(req)
4636	if err != nil {
4637		result.Response = autorest.Response{Response: resp}
4638		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationResource", resp, "Failure sending request")
4639		return
4640	}
4641
4642	result, err = client.GetApplicationResourceResponder(resp)
4643	if err != nil {
4644		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationResource", resp, "Failure responding to request")
4645		return
4646	}
4647
4648	return
4649}
4650
4651// GetApplicationResourcePreparer prepares the GetApplicationResource request.
4652func (client BaseClient) GetApplicationResourcePreparer(ctx context.Context, applicationResourceName string) (*http.Request, error) {
4653	pathParameters := map[string]interface{}{
4654		"applicationResourceName": applicationResourceName,
4655	}
4656
4657	const APIVersion = "6.3-preview"
4658	queryParameters := map[string]interface{}{
4659		"api-version": APIVersion,
4660	}
4661
4662	preparer := autorest.CreatePreparer(
4663		autorest.AsGet(),
4664		autorest.WithBaseURL(client.BaseURI),
4665		autorest.WithPathParameters("/Resources/Applications/{applicationResourceName}", pathParameters),
4666		autorest.WithQueryParameters(queryParameters))
4667	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4668}
4669
4670// GetApplicationResourceSender sends the GetApplicationResource request. The method will close the
4671// http.Response Body if it receives an error.
4672func (client BaseClient) GetApplicationResourceSender(req *http.Request) (*http.Response, error) {
4673	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4674}
4675
4676// GetApplicationResourceResponder handles the response to the GetApplicationResource request. The method always
4677// closes the http.Response Body.
4678func (client BaseClient) GetApplicationResourceResponder(resp *http.Response) (result ApplicationResourceDescription, err error) {
4679	err = autorest.Respond(
4680		resp,
4681		azure.WithErrorUnlessStatusCode(http.StatusOK),
4682		autorest.ByUnmarshallingJSON(&result),
4683		autorest.ByClosing())
4684	result.Response = autorest.Response{Response: resp}
4685	return
4686}
4687
4688// GetApplicationsEventList the response is list of ApplicationEvent objects.
4689// Parameters:
4690// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
4691// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
4692// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4693// duration that the client is willing to wait for the requested operation to complete. The default value for
4694// this parameter is 60 seconds.
4695// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
4696// be included in the response.
4697// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
4698// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
4699// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
4700// populated.
4701func (client BaseClient) GetApplicationsEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListApplicationEvent, err error) {
4702	if tracing.IsEnabled() {
4703		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationsEventList")
4704		defer func() {
4705			sc := -1
4706			if result.Response.Response != nil {
4707				sc = result.Response.Response.StatusCode
4708			}
4709			tracing.EndSpan(ctx, sc, err)
4710		}()
4711	}
4712	if err := validation.Validate([]validation.Validation{
4713		{TargetValue: timeout,
4714			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4715				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4716					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4717				}}}}}); err != nil {
4718		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationsEventList", err.Error())
4719	}
4720
4721	req, err := client.GetApplicationsEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
4722	if err != nil {
4723		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", nil, "Failure preparing request")
4724		return
4725	}
4726
4727	resp, err := client.GetApplicationsEventListSender(req)
4728	if err != nil {
4729		result.Response = autorest.Response{Response: resp}
4730		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", resp, "Failure sending request")
4731		return
4732	}
4733
4734	result, err = client.GetApplicationsEventListResponder(resp)
4735	if err != nil {
4736		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", resp, "Failure responding to request")
4737		return
4738	}
4739
4740	return
4741}
4742
4743// GetApplicationsEventListPreparer prepares the GetApplicationsEventList request.
4744func (client BaseClient) GetApplicationsEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
4745	const APIVersion = "6.2-preview"
4746	queryParameters := map[string]interface{}{
4747		"api-version":  APIVersion,
4748		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
4749		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
4750	}
4751	if timeout != nil {
4752		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4753	} else {
4754		queryParameters["timeout"] = autorest.Encode("query", 60)
4755	}
4756	if len(eventsTypesFilter) > 0 {
4757		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
4758	}
4759	if excludeAnalysisEvents != nil {
4760		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
4761	}
4762	if skipCorrelationLookup != nil {
4763		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
4764	}
4765
4766	preparer := autorest.CreatePreparer(
4767		autorest.AsGet(),
4768		autorest.WithBaseURL(client.BaseURI),
4769		autorest.WithPath("/EventsStore/Applications/Events"),
4770		autorest.WithQueryParameters(queryParameters))
4771	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4772}
4773
4774// GetApplicationsEventListSender sends the GetApplicationsEventList request. The method will close the
4775// http.Response Body if it receives an error.
4776func (client BaseClient) GetApplicationsEventListSender(req *http.Request) (*http.Response, error) {
4777	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4778}
4779
4780// GetApplicationsEventListResponder handles the response to the GetApplicationsEventList request. The method always
4781// closes the http.Response Body.
4782func (client BaseClient) GetApplicationsEventListResponder(resp *http.Response) (result ListApplicationEvent, err error) {
4783	err = autorest.Respond(
4784		resp,
4785		azure.WithErrorUnlessStatusCode(http.StatusOK),
4786		autorest.ByUnmarshallingJSON(&result),
4787		autorest.ByClosing())
4788	result.Response = autorest.Response{Response: resp}
4789	return
4790}
4791
4792// GetApplicationTypeInfoList returns the information about the application types that are provisioned or in the
4793// process of being provisioned in the Service Fabric cluster. Each version of an application type is returned as one
4794// application type. The response includes the name, version, status, and other details about the application type.
4795// This is a paged query, meaning that if not all of the application types fit in a page, one page of results is
4796// returned as well as a continuation token, which can be used to get the next page. For example, if there are 10
4797// application types but a page only fits the first three application types, or if max results is set to 3, then three
4798// is returned. To access the rest of the results, retrieve subsequent pages by using the returned continuation token
4799// in the next query. An empty continuation token is returned if there are no subsequent pages.
4800// Parameters:
4801// applicationTypeDefinitionKindFilter - used to filter on ApplicationTypeDefinitionKind which is the mechanism
4802// used to define a Service Fabric application type.
4803// - Default - Default value, which performs the same function as selecting "All". The value is 0.
4804// - All - Filter that matches input with any ApplicationTypeDefinitionKind value. The value is 65535.
4805// - ServiceFabricApplicationPackage - Filter that matches input with ApplicationTypeDefinitionKind value
4806// ServiceFabricApplicationPackage. The value is 1.
4807// - Compose - Filter that matches input with ApplicationTypeDefinitionKind value Compose. The value is 2.
4808// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from
4809// the result.
4810// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
4811// token with a non-empty value is included in the response of the API when the results from the system do not
4812// fit in a single response. When this value is passed to the next API call, the API returns next set of
4813// results. If there are no further results, then the continuation token does not contain a value. The value of
4814// this parameter should not be URL encoded.
4815// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
4816// defines the upper bound on the number of results returned. The results returned can be less than the
4817// specified maximum results if they do not fit in the message as per the max message size restrictions defined
4818// in the configuration. If this parameter is zero or not specified, the paged query includes as many results
4819// as possible that fit in the return message.
4820// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4821// duration that the client is willing to wait for the requested operation to complete. The default value for
4822// this parameter is 60 seconds.
4823func (client BaseClient) GetApplicationTypeInfoList(ctx context.Context, applicationTypeDefinitionKindFilter *int32, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationTypeInfoList, err error) {
4824	if tracing.IsEnabled() {
4825		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationTypeInfoList")
4826		defer func() {
4827			sc := -1
4828			if result.Response.Response != nil {
4829				sc = result.Response.Response.StatusCode
4830			}
4831			tracing.EndSpan(ctx, sc, err)
4832		}()
4833	}
4834	if err := validation.Validate([]validation.Validation{
4835		{TargetValue: maxResults,
4836			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
4837				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
4838		{TargetValue: timeout,
4839			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4840				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4841					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4842				}}}}}); err != nil {
4843		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoList", err.Error())
4844	}
4845
4846	req, err := client.GetApplicationTypeInfoListPreparer(ctx, applicationTypeDefinitionKindFilter, excludeApplicationParameters, continuationToken, maxResults, timeout)
4847	if err != nil {
4848		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", nil, "Failure preparing request")
4849		return
4850	}
4851
4852	resp, err := client.GetApplicationTypeInfoListSender(req)
4853	if err != nil {
4854		result.Response = autorest.Response{Response: resp}
4855		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", resp, "Failure sending request")
4856		return
4857	}
4858
4859	result, err = client.GetApplicationTypeInfoListResponder(resp)
4860	if err != nil {
4861		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", resp, "Failure responding to request")
4862		return
4863	}
4864
4865	return
4866}
4867
4868// GetApplicationTypeInfoListPreparer prepares the GetApplicationTypeInfoList request.
4869func (client BaseClient) GetApplicationTypeInfoListPreparer(ctx context.Context, applicationTypeDefinitionKindFilter *int32, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
4870	const APIVersion = "6.0"
4871	queryParameters := map[string]interface{}{
4872		"api-version": APIVersion,
4873	}
4874	if applicationTypeDefinitionKindFilter != nil {
4875		queryParameters["ApplicationTypeDefinitionKindFilter"] = autorest.Encode("query", *applicationTypeDefinitionKindFilter)
4876	} else {
4877		queryParameters["ApplicationTypeDefinitionKindFilter"] = autorest.Encode("query", 0)
4878	}
4879	if excludeApplicationParameters != nil {
4880		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters)
4881	} else {
4882		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false)
4883	}
4884	if len(continuationToken) > 0 {
4885		queryParameters["ContinuationToken"] = continuationToken
4886	}
4887	if maxResults != nil {
4888		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
4889	} else {
4890		queryParameters["MaxResults"] = autorest.Encode("query", 0)
4891	}
4892	if timeout != nil {
4893		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4894	} else {
4895		queryParameters["timeout"] = autorest.Encode("query", 60)
4896	}
4897
4898	preparer := autorest.CreatePreparer(
4899		autorest.AsGet(),
4900		autorest.WithBaseURL(client.BaseURI),
4901		autorest.WithPath("/ApplicationTypes"),
4902		autorest.WithQueryParameters(queryParameters))
4903	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4904}
4905
4906// GetApplicationTypeInfoListSender sends the GetApplicationTypeInfoList request. The method will close the
4907// http.Response Body if it receives an error.
4908func (client BaseClient) GetApplicationTypeInfoListSender(req *http.Request) (*http.Response, error) {
4909	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4910}
4911
4912// GetApplicationTypeInfoListResponder handles the response to the GetApplicationTypeInfoList request. The method always
4913// closes the http.Response Body.
4914func (client BaseClient) GetApplicationTypeInfoListResponder(resp *http.Response) (result PagedApplicationTypeInfoList, err error) {
4915	err = autorest.Respond(
4916		resp,
4917		azure.WithErrorUnlessStatusCode(http.StatusOK),
4918		autorest.ByUnmarshallingJSON(&result),
4919		autorest.ByClosing())
4920	result.Response = autorest.Response{Response: resp}
4921	return
4922}
4923
4924// GetApplicationTypeInfoListByName returns the information about the application types that are provisioned or in the
4925// process of being provisioned in the Service Fabric cluster. These results are of application types whose name match
4926// exactly the one specified as the parameter, and which comply with the given query parameters. All versions of the
4927// application type matching the application type name are returned, with each version returned as one application
4928// type. The response includes the name, version, status, and other details about the application type. This is a paged
4929// query, meaning that if not all of the application types fit in a page, one page of results is returned as well as a
4930// continuation token, which can be used to get the next page. For example, if there are 10 application types but a
4931// page only fits the first three application types, or if max results is set to 3, then three is returned. To access
4932// the rest of the results, retrieve subsequent pages by using the returned continuation token in the next query. An
4933// empty continuation token is returned if there are no subsequent pages.
4934// Parameters:
4935// applicationTypeName - the name of the application type.
4936// applicationTypeVersion - the version of the application type.
4937// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from
4938// the result.
4939// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
4940// token with a non-empty value is included in the response of the API when the results from the system do not
4941// fit in a single response. When this value is passed to the next API call, the API returns next set of
4942// results. If there are no further results, then the continuation token does not contain a value. The value of
4943// this parameter should not be URL encoded.
4944// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
4945// defines the upper bound on the number of results returned. The results returned can be less than the
4946// specified maximum results if they do not fit in the message as per the max message size restrictions defined
4947// in the configuration. If this parameter is zero or not specified, the paged query includes as many results
4948// as possible that fit in the return message.
4949// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4950// duration that the client is willing to wait for the requested operation to complete. The default value for
4951// this parameter is 60 seconds.
4952func (client BaseClient) GetApplicationTypeInfoListByName(ctx context.Context, applicationTypeName string, applicationTypeVersion string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationTypeInfoList, err error) {
4953	if tracing.IsEnabled() {
4954		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationTypeInfoListByName")
4955		defer func() {
4956			sc := -1
4957			if result.Response.Response != nil {
4958				sc = result.Response.Response.StatusCode
4959			}
4960			tracing.EndSpan(ctx, sc, err)
4961		}()
4962	}
4963	if err := validation.Validate([]validation.Validation{
4964		{TargetValue: maxResults,
4965			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
4966				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
4967		{TargetValue: timeout,
4968			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4969				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4970					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4971				}}}}}); err != nil {
4972		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoListByName", err.Error())
4973	}
4974
4975	req, err := client.GetApplicationTypeInfoListByNamePreparer(ctx, applicationTypeName, applicationTypeVersion, excludeApplicationParameters, continuationToken, maxResults, timeout)
4976	if err != nil {
4977		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", nil, "Failure preparing request")
4978		return
4979	}
4980
4981	resp, err := client.GetApplicationTypeInfoListByNameSender(req)
4982	if err != nil {
4983		result.Response = autorest.Response{Response: resp}
4984		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", resp, "Failure sending request")
4985		return
4986	}
4987
4988	result, err = client.GetApplicationTypeInfoListByNameResponder(resp)
4989	if err != nil {
4990		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", resp, "Failure responding to request")
4991		return
4992	}
4993
4994	return
4995}
4996
4997// GetApplicationTypeInfoListByNamePreparer prepares the GetApplicationTypeInfoListByName request.
4998func (client BaseClient) GetApplicationTypeInfoListByNamePreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
4999	pathParameters := map[string]interface{}{
5000		"applicationTypeName": autorest.Encode("path", applicationTypeName),
5001	}
5002
5003	const APIVersion = "6.0"
5004	queryParameters := map[string]interface{}{
5005		"api-version": APIVersion,
5006	}
5007	if len(applicationTypeVersion) > 0 {
5008		queryParameters["ApplicationTypeVersion"] = autorest.Encode("query", applicationTypeVersion)
5009	}
5010	if excludeApplicationParameters != nil {
5011		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters)
5012	} else {
5013		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false)
5014	}
5015	if len(continuationToken) > 0 {
5016		queryParameters["ContinuationToken"] = continuationToken
5017	}
5018	if maxResults != nil {
5019		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
5020	} else {
5021		queryParameters["MaxResults"] = autorest.Encode("query", 0)
5022	}
5023	if timeout != nil {
5024		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5025	} else {
5026		queryParameters["timeout"] = autorest.Encode("query", 60)
5027	}
5028
5029	preparer := autorest.CreatePreparer(
5030		autorest.AsGet(),
5031		autorest.WithBaseURL(client.BaseURI),
5032		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}", pathParameters),
5033		autorest.WithQueryParameters(queryParameters))
5034	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5035}
5036
5037// GetApplicationTypeInfoListByNameSender sends the GetApplicationTypeInfoListByName request. The method will close the
5038// http.Response Body if it receives an error.
5039func (client BaseClient) GetApplicationTypeInfoListByNameSender(req *http.Request) (*http.Response, error) {
5040	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5041}
5042
5043// GetApplicationTypeInfoListByNameResponder handles the response to the GetApplicationTypeInfoListByName request. The method always
5044// closes the http.Response Body.
5045func (client BaseClient) GetApplicationTypeInfoListByNameResponder(resp *http.Response) (result PagedApplicationTypeInfoList, err error) {
5046	err = autorest.Respond(
5047		resp,
5048		azure.WithErrorUnlessStatusCode(http.StatusOK),
5049		autorest.ByUnmarshallingJSON(&result),
5050		autorest.ByClosing())
5051	result.Response = autorest.Response{Response: resp}
5052	return
5053}
5054
5055// GetApplicationUpgrade returns information about the state of the latest application upgrade along with details to
5056// aid debugging application health issues.
5057// Parameters:
5058// applicationID - the identity of the application. This is typically the full name of the application without
5059// the 'fabric:' URI scheme.
5060// Starting from version 6.0, hierarchical names are delimited with the "~" character.
5061// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
5062// in 6.0+ and "myapp/app1" in previous versions.
5063// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5064// duration that the client is willing to wait for the requested operation to complete. The default value for
5065// this parameter is 60 seconds.
5066func (client BaseClient) GetApplicationUpgrade(ctx context.Context, applicationID string, timeout *int64) (result ApplicationUpgradeProgressInfo, err error) {
5067	if tracing.IsEnabled() {
5068		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationUpgrade")
5069		defer func() {
5070			sc := -1
5071			if result.Response.Response != nil {
5072				sc = result.Response.Response.StatusCode
5073			}
5074			tracing.EndSpan(ctx, sc, err)
5075		}()
5076	}
5077	if err := validation.Validate([]validation.Validation{
5078		{TargetValue: timeout,
5079			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5080				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5081					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5082				}}}}}); err != nil {
5083		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationUpgrade", err.Error())
5084	}
5085
5086	req, err := client.GetApplicationUpgradePreparer(ctx, applicationID, timeout)
5087	if err != nil {
5088		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", nil, "Failure preparing request")
5089		return
5090	}
5091
5092	resp, err := client.GetApplicationUpgradeSender(req)
5093	if err != nil {
5094		result.Response = autorest.Response{Response: resp}
5095		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", resp, "Failure sending request")
5096		return
5097	}
5098
5099	result, err = client.GetApplicationUpgradeResponder(resp)
5100	if err != nil {
5101		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", resp, "Failure responding to request")
5102		return
5103	}
5104
5105	return
5106}
5107
5108// GetApplicationUpgradePreparer prepares the GetApplicationUpgrade request.
5109func (client BaseClient) GetApplicationUpgradePreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
5110	pathParameters := map[string]interface{}{
5111		"applicationId": applicationID,
5112	}
5113
5114	const APIVersion = "6.0"
5115	queryParameters := map[string]interface{}{
5116		"api-version": APIVersion,
5117	}
5118	if timeout != nil {
5119		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5120	} else {
5121		queryParameters["timeout"] = autorest.Encode("query", 60)
5122	}
5123
5124	preparer := autorest.CreatePreparer(
5125		autorest.AsGet(),
5126		autorest.WithBaseURL(client.BaseURI),
5127		autorest.WithPathParameters("/Applications/{applicationId}/$/GetUpgradeProgress", pathParameters),
5128		autorest.WithQueryParameters(queryParameters))
5129	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5130}
5131
5132// GetApplicationUpgradeSender sends the GetApplicationUpgrade request. The method will close the
5133// http.Response Body if it receives an error.
5134func (client BaseClient) GetApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
5135	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5136}
5137
5138// GetApplicationUpgradeResponder handles the response to the GetApplicationUpgrade request. The method always
5139// closes the http.Response Body.
5140func (client BaseClient) GetApplicationUpgradeResponder(resp *http.Response) (result ApplicationUpgradeProgressInfo, err error) {
5141	err = autorest.Respond(
5142		resp,
5143		azure.WithErrorUnlessStatusCode(http.StatusOK),
5144		autorest.ByUnmarshallingJSON(&result),
5145		autorest.ByClosing())
5146	result.Response = autorest.Response{Response: resp}
5147	return
5148}
5149
5150// GetBackupPolicyByName gets a particular backup policy identified by {backupPolicyName}
5151// Parameters:
5152// backupPolicyName - the name of the backup policy.
5153// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5154// duration that the client is willing to wait for the requested operation to complete. The default value for
5155// this parameter is 60 seconds.
5156func (client BaseClient) GetBackupPolicyByName(ctx context.Context, backupPolicyName string, timeout *int64) (result BackupPolicyDescription, err error) {
5157	if tracing.IsEnabled() {
5158		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupPolicyByName")
5159		defer func() {
5160			sc := -1
5161			if result.Response.Response != nil {
5162				sc = result.Response.Response.StatusCode
5163			}
5164			tracing.EndSpan(ctx, sc, err)
5165		}()
5166	}
5167	if err := validation.Validate([]validation.Validation{
5168		{TargetValue: timeout,
5169			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5170				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5171					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5172				}}}}}); err != nil {
5173		return result, validation.NewError("servicefabric.BaseClient", "GetBackupPolicyByName", err.Error())
5174	}
5175
5176	req, err := client.GetBackupPolicyByNamePreparer(ctx, backupPolicyName, timeout)
5177	if err != nil {
5178		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", nil, "Failure preparing request")
5179		return
5180	}
5181
5182	resp, err := client.GetBackupPolicyByNameSender(req)
5183	if err != nil {
5184		result.Response = autorest.Response{Response: resp}
5185		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", resp, "Failure sending request")
5186		return
5187	}
5188
5189	result, err = client.GetBackupPolicyByNameResponder(resp)
5190	if err != nil {
5191		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", resp, "Failure responding to request")
5192		return
5193	}
5194
5195	return
5196}
5197
5198// GetBackupPolicyByNamePreparer prepares the GetBackupPolicyByName request.
5199func (client BaseClient) GetBackupPolicyByNamePreparer(ctx context.Context, backupPolicyName string, timeout *int64) (*http.Request, error) {
5200	pathParameters := map[string]interface{}{
5201		"backupPolicyName": autorest.Encode("path", backupPolicyName),
5202	}
5203
5204	const APIVersion = "6.2-preview"
5205	queryParameters := map[string]interface{}{
5206		"api-version": APIVersion,
5207	}
5208	if timeout != nil {
5209		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5210	} else {
5211		queryParameters["timeout"] = autorest.Encode("query", 60)
5212	}
5213
5214	preparer := autorest.CreatePreparer(
5215		autorest.AsGet(),
5216		autorest.WithBaseURL(client.BaseURI),
5217		autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}", pathParameters),
5218		autorest.WithQueryParameters(queryParameters))
5219	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5220}
5221
5222// GetBackupPolicyByNameSender sends the GetBackupPolicyByName request. The method will close the
5223// http.Response Body if it receives an error.
5224func (client BaseClient) GetBackupPolicyByNameSender(req *http.Request) (*http.Response, error) {
5225	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5226}
5227
5228// GetBackupPolicyByNameResponder handles the response to the GetBackupPolicyByName request. The method always
5229// closes the http.Response Body.
5230func (client BaseClient) GetBackupPolicyByNameResponder(resp *http.Response) (result BackupPolicyDescription, err error) {
5231	err = autorest.Respond(
5232		resp,
5233		azure.WithErrorUnlessStatusCode(http.StatusOK),
5234		autorest.ByUnmarshallingJSON(&result),
5235		autorest.ByClosing())
5236	result.Response = autorest.Response{Response: resp}
5237	return
5238}
5239
5240// GetBackupPolicyList get a list of all the backup policies configured.
5241// Parameters:
5242// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
5243// token with a non-empty value is included in the response of the API when the results from the system do not
5244// fit in a single response. When this value is passed to the next API call, the API returns next set of
5245// results. If there are no further results, then the continuation token does not contain a value. The value of
5246// this parameter should not be URL encoded.
5247// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
5248// defines the upper bound on the number of results returned. The results returned can be less than the
5249// specified maximum results if they do not fit in the message as per the max message size restrictions defined
5250// in the configuration. If this parameter is zero or not specified, the paged query includes as many results
5251// as possible that fit in the return message.
5252// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5253// duration that the client is willing to wait for the requested operation to complete. The default value for
5254// this parameter is 60 seconds.
5255func (client BaseClient) GetBackupPolicyList(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupPolicyDescriptionList, err error) {
5256	if tracing.IsEnabled() {
5257		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupPolicyList")
5258		defer func() {
5259			sc := -1
5260			if result.Response.Response != nil {
5261				sc = result.Response.Response.StatusCode
5262			}
5263			tracing.EndSpan(ctx, sc, err)
5264		}()
5265	}
5266	if err := validation.Validate([]validation.Validation{
5267		{TargetValue: maxResults,
5268			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
5269				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
5270		{TargetValue: timeout,
5271			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5272				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5273					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5274				}}}}}); err != nil {
5275		return result, validation.NewError("servicefabric.BaseClient", "GetBackupPolicyList", err.Error())
5276	}
5277
5278	req, err := client.GetBackupPolicyListPreparer(ctx, continuationToken, maxResults, timeout)
5279	if err != nil {
5280		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", nil, "Failure preparing request")
5281		return
5282	}
5283
5284	resp, err := client.GetBackupPolicyListSender(req)
5285	if err != nil {
5286		result.Response = autorest.Response{Response: resp}
5287		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", resp, "Failure sending request")
5288		return
5289	}
5290
5291	result, err = client.GetBackupPolicyListResponder(resp)
5292	if err != nil {
5293		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", resp, "Failure responding to request")
5294		return
5295	}
5296
5297	return
5298}
5299
5300// GetBackupPolicyListPreparer prepares the GetBackupPolicyList request.
5301func (client BaseClient) GetBackupPolicyListPreparer(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
5302	const APIVersion = "6.2-preview"
5303	queryParameters := map[string]interface{}{
5304		"api-version": APIVersion,
5305	}
5306	if len(continuationToken) > 0 {
5307		queryParameters["ContinuationToken"] = continuationToken
5308	}
5309	if maxResults != nil {
5310		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
5311	} else {
5312		queryParameters["MaxResults"] = autorest.Encode("query", 0)
5313	}
5314	if timeout != nil {
5315		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5316	} else {
5317		queryParameters["timeout"] = autorest.Encode("query", 60)
5318	}
5319
5320	preparer := autorest.CreatePreparer(
5321		autorest.AsGet(),
5322		autorest.WithBaseURL(client.BaseURI),
5323		autorest.WithPath("/BackupRestore/BackupPolicies"),
5324		autorest.WithQueryParameters(queryParameters))
5325	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5326}
5327
5328// GetBackupPolicyListSender sends the GetBackupPolicyList request. The method will close the
5329// http.Response Body if it receives an error.
5330func (client BaseClient) GetBackupPolicyListSender(req *http.Request) (*http.Response, error) {
5331	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5332}
5333
5334// GetBackupPolicyListResponder handles the response to the GetBackupPolicyList request. The method always
5335// closes the http.Response Body.
5336func (client BaseClient) GetBackupPolicyListResponder(resp *http.Response) (result PagedBackupPolicyDescriptionList, err error) {
5337	err = autorest.Respond(
5338		resp,
5339		azure.WithErrorUnlessStatusCode(http.StatusOK),
5340		autorest.ByUnmarshallingJSON(&result),
5341		autorest.ByClosing())
5342	result.Response = autorest.Response{Response: resp}
5343	return
5344}
5345
5346// GetBackupsFromBackupLocation gets the list of backups available for the specified backed up entity (Application,
5347// Service or Partition) at the specified backup location (FileShare or Azure Blob Storage).
5348// Parameters:
5349// getBackupByStorageQueryDescription - describes the filters and backup storage details to be used for
5350// enumerating backups.
5351// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5352// duration that the client is willing to wait for the requested operation to complete. The default value for
5353// this parameter is 60 seconds.
5354// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
5355// token with a non-empty value is included in the response of the API when the results from the system do not
5356// fit in a single response. When this value is passed to the next API call, the API returns next set of
5357// results. If there are no further results, then the continuation token does not contain a value. The value of
5358// this parameter should not be URL encoded.
5359// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
5360// defines the upper bound on the number of results returned. The results returned can be less than the
5361// specified maximum results if they do not fit in the message as per the max message size restrictions defined
5362// in the configuration. If this parameter is zero or not specified, the paged query includes as many results
5363// as possible that fit in the return message.
5364func (client BaseClient) GetBackupsFromBackupLocation(ctx context.Context, getBackupByStorageQueryDescription GetBackupByStorageQueryDescription, timeout *int64, continuationToken string, maxResults *int64) (result PagedBackupInfoList, err error) {
5365	if tracing.IsEnabled() {
5366		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupsFromBackupLocation")
5367		defer func() {
5368			sc := -1
5369			if result.Response.Response != nil {
5370				sc = result.Response.Response.StatusCode
5371			}
5372			tracing.EndSpan(ctx, sc, err)
5373		}()
5374	}
5375	if err := validation.Validate([]validation.Validation{
5376		{TargetValue: timeout,
5377			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5378				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5379					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5380				}}}},
5381		{TargetValue: maxResults,
5382			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
5383				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil {
5384		return result, validation.NewError("servicefabric.BaseClient", "GetBackupsFromBackupLocation", err.Error())
5385	}
5386
5387	req, err := client.GetBackupsFromBackupLocationPreparer(ctx, getBackupByStorageQueryDescription, timeout, continuationToken, maxResults)
5388	if err != nil {
5389		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", nil, "Failure preparing request")
5390		return
5391	}
5392
5393	resp, err := client.GetBackupsFromBackupLocationSender(req)
5394	if err != nil {
5395		result.Response = autorest.Response{Response: resp}
5396		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", resp, "Failure sending request")
5397		return
5398	}
5399
5400	result, err = client.GetBackupsFromBackupLocationResponder(resp)
5401	if err != nil {
5402		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", resp, "Failure responding to request")
5403		return
5404	}
5405
5406	return
5407}
5408
5409// GetBackupsFromBackupLocationPreparer prepares the GetBackupsFromBackupLocation request.
5410func (client BaseClient) GetBackupsFromBackupLocationPreparer(ctx context.Context, getBackupByStorageQueryDescription GetBackupByStorageQueryDescription, timeout *int64, continuationToken string, maxResults *int64) (*http.Request, error) {
5411	const APIVersion = "6.2-preview"
5412	queryParameters := map[string]interface{}{
5413		"api-version": APIVersion,
5414	}
5415	if timeout != nil {
5416		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5417	} else {
5418		queryParameters["timeout"] = autorest.Encode("query", 60)
5419	}
5420	if len(continuationToken) > 0 {
5421		queryParameters["ContinuationToken"] = continuationToken
5422	}
5423	if maxResults != nil {
5424		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
5425	} else {
5426		queryParameters["MaxResults"] = autorest.Encode("query", 0)
5427	}
5428
5429	preparer := autorest.CreatePreparer(
5430		autorest.AsContentType("application/json; charset=utf-8"),
5431		autorest.AsPost(),
5432		autorest.WithBaseURL(client.BaseURI),
5433		autorest.WithPath("/BackupRestore/$/GetBackups"),
5434		autorest.WithJSON(getBackupByStorageQueryDescription),
5435		autorest.WithQueryParameters(queryParameters))
5436	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5437}
5438
5439// GetBackupsFromBackupLocationSender sends the GetBackupsFromBackupLocation request. The method will close the
5440// http.Response Body if it receives an error.
5441func (client BaseClient) GetBackupsFromBackupLocationSender(req *http.Request) (*http.Response, error) {
5442	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5443}
5444
5445// GetBackupsFromBackupLocationResponder handles the response to the GetBackupsFromBackupLocation request. The method always
5446// closes the http.Response Body.
5447func (client BaseClient) GetBackupsFromBackupLocationResponder(resp *http.Response) (result PagedBackupInfoList, err error) {
5448	err = autorest.Respond(
5449		resp,
5450		azure.WithErrorUnlessStatusCode(http.StatusOK),
5451		autorest.ByUnmarshallingJSON(&result),
5452		autorest.ByClosing())
5453	result.Response = autorest.Response{Response: resp}
5454	return
5455}
5456
5457// GetChaos get the status of Chaos indicating whether or not Chaos is running, the Chaos parameters used for running
5458// Chaos and the status of the Chaos Schedule.
5459// Parameters:
5460// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5461// duration that the client is willing to wait for the requested operation to complete. The default value for
5462// this parameter is 60 seconds.
5463func (client BaseClient) GetChaos(ctx context.Context, timeout *int64) (result Chaos, err error) {
5464	if tracing.IsEnabled() {
5465		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaos")
5466		defer func() {
5467			sc := -1
5468			if result.Response.Response != nil {
5469				sc = result.Response.Response.StatusCode
5470			}
5471			tracing.EndSpan(ctx, sc, err)
5472		}()
5473	}
5474	if err := validation.Validate([]validation.Validation{
5475		{TargetValue: timeout,
5476			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5477				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5478					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5479				}}}}}); err != nil {
5480		return result, validation.NewError("servicefabric.BaseClient", "GetChaos", err.Error())
5481	}
5482
5483	req, err := client.GetChaosPreparer(ctx, timeout)
5484	if err != nil {
5485		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", nil, "Failure preparing request")
5486		return
5487	}
5488
5489	resp, err := client.GetChaosSender(req)
5490	if err != nil {
5491		result.Response = autorest.Response{Response: resp}
5492		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", resp, "Failure sending request")
5493		return
5494	}
5495
5496	result, err = client.GetChaosResponder(resp)
5497	if err != nil {
5498		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", resp, "Failure responding to request")
5499		return
5500	}
5501
5502	return
5503}
5504
5505// GetChaosPreparer prepares the GetChaos request.
5506func (client BaseClient) GetChaosPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
5507	const APIVersion = "6.2"
5508	queryParameters := map[string]interface{}{
5509		"api-version": APIVersion,
5510	}
5511	if timeout != nil {
5512		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5513	} else {
5514		queryParameters["timeout"] = autorest.Encode("query", 60)
5515	}
5516
5517	preparer := autorest.CreatePreparer(
5518		autorest.AsGet(),
5519		autorest.WithBaseURL(client.BaseURI),
5520		autorest.WithPath("/Tools/Chaos"),
5521		autorest.WithQueryParameters(queryParameters))
5522	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5523}
5524
5525// GetChaosSender sends the GetChaos request. The method will close the
5526// http.Response Body if it receives an error.
5527func (client BaseClient) GetChaosSender(req *http.Request) (*http.Response, error) {
5528	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5529}
5530
5531// GetChaosResponder handles the response to the GetChaos request. The method always
5532// closes the http.Response Body.
5533func (client BaseClient) GetChaosResponder(resp *http.Response) (result Chaos, err error) {
5534	err = autorest.Respond(
5535		resp,
5536		azure.WithErrorUnlessStatusCode(http.StatusOK),
5537		autorest.ByUnmarshallingJSON(&result),
5538		autorest.ByClosing())
5539	result.Response = autorest.Response{Response: resp}
5540	return
5541}
5542
5543// GetChaosEvents to get the next segment of the Chaos events, you can specify the ContinuationToken. To get the start
5544// of a new segment of Chaos events, you can specify the time range
5545// through StartTimeUtc and EndTimeUtc. You cannot specify both the ContinuationToken and the time range in the same
5546// call.
5547// When there are more than 100 Chaos events, the Chaos events are returned in multiple segments where a segment
5548// contains no more than 100 Chaos events and to get the next segment you make a call to this API with the continuation
5549// token.
5550// Parameters:
5551// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
5552// token with a non-empty value is included in the response of the API when the results from the system do not
5553// fit in a single response. When this value is passed to the next API call, the API returns next set of
5554// results. If there are no further results, then the continuation token does not contain a value. The value of
5555// this parameter should not be URL encoded.
5556// startTimeUtc - the Windows file time representing the start time of the time range for which a Chaos report
5557// is to be generated. Consult [DateTime.ToFileTimeUtc
5558// Method](https://msdn.microsoft.com/library/system.datetime.tofiletimeutc(v=vs.110).aspx) for details.
5559// endTimeUtc - the Windows file time representing the end time of the time range for which a Chaos report is
5560// to be generated. Consult [DateTime.ToFileTimeUtc
5561// Method](https://msdn.microsoft.com/library/system.datetime.tofiletimeutc(v=vs.110).aspx) for details.
5562// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
5563// defines the upper bound on the number of results returned. The results returned can be less than the
5564// specified maximum results if they do not fit in the message as per the max message size restrictions defined
5565// in the configuration. If this parameter is zero or not specified, the paged query includes as many results
5566// as possible that fit in the return message.
5567// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5568// duration that the client is willing to wait for the requested operation to complete. The default value for
5569// this parameter is 60 seconds.
5570func (client BaseClient) GetChaosEvents(ctx context.Context, continuationToken string, startTimeUtc string, endTimeUtc string, maxResults *int64, timeout *int64) (result ChaosEventsSegment, err error) {
5571	if tracing.IsEnabled() {
5572		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaosEvents")
5573		defer func() {
5574			sc := -1
5575			if result.Response.Response != nil {
5576				sc = result.Response.Response.StatusCode
5577			}
5578			tracing.EndSpan(ctx, sc, err)
5579		}()
5580	}
5581	if err := validation.Validate([]validation.Validation{
5582		{TargetValue: maxResults,
5583			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
5584				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
5585		{TargetValue: timeout,
5586			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5587				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5588					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5589				}}}}}); err != nil {
5590		return result, validation.NewError("servicefabric.BaseClient", "GetChaosEvents", err.Error())
5591	}
5592
5593	req, err := client.GetChaosEventsPreparer(ctx, continuationToken, startTimeUtc, endTimeUtc, maxResults, timeout)
5594	if err != nil {
5595		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", nil, "Failure preparing request")
5596		return
5597	}
5598
5599	resp, err := client.GetChaosEventsSender(req)
5600	if err != nil {
5601		result.Response = autorest.Response{Response: resp}
5602		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", resp, "Failure sending request")
5603		return
5604	}
5605
5606	result, err = client.GetChaosEventsResponder(resp)
5607	if err != nil {
5608		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", resp, "Failure responding to request")
5609		return
5610	}
5611
5612	return
5613}
5614
5615// GetChaosEventsPreparer prepares the GetChaosEvents request.
5616func (client BaseClient) GetChaosEventsPreparer(ctx context.Context, continuationToken string, startTimeUtc string, endTimeUtc string, maxResults *int64, timeout *int64) (*http.Request, error) {
5617	const APIVersion = "6.2"
5618	queryParameters := map[string]interface{}{
5619		"api-version": APIVersion,
5620	}
5621	if len(continuationToken) > 0 {
5622		queryParameters["ContinuationToken"] = continuationToken
5623	}
5624	if len(startTimeUtc) > 0 {
5625		queryParameters["StartTimeUtc"] = autorest.Encode("query", startTimeUtc)
5626	}
5627	if len(endTimeUtc) > 0 {
5628		queryParameters["EndTimeUtc"] = autorest.Encode("query", endTimeUtc)
5629	}
5630	if maxResults != nil {
5631		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
5632	} else {
5633		queryParameters["MaxResults"] = autorest.Encode("query", 0)
5634	}
5635	if timeout != nil {
5636		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5637	} else {
5638		queryParameters["timeout"] = autorest.Encode("query", 60)
5639	}
5640
5641	preparer := autorest.CreatePreparer(
5642		autorest.AsGet(),
5643		autorest.WithBaseURL(client.BaseURI),
5644		autorest.WithPath("/Tools/Chaos/Events"),
5645		autorest.WithQueryParameters(queryParameters))
5646	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5647}
5648
5649// GetChaosEventsSender sends the GetChaosEvents request. The method will close the
5650// http.Response Body if it receives an error.
5651func (client BaseClient) GetChaosEventsSender(req *http.Request) (*http.Response, error) {
5652	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5653}
5654
5655// GetChaosEventsResponder handles the response to the GetChaosEvents request. The method always
5656// closes the http.Response Body.
5657func (client BaseClient) GetChaosEventsResponder(resp *http.Response) (result ChaosEventsSegment, err error) {
5658	err = autorest.Respond(
5659		resp,
5660		azure.WithErrorUnlessStatusCode(http.StatusOK),
5661		autorest.ByUnmarshallingJSON(&result),
5662		autorest.ByClosing())
5663	result.Response = autorest.Response{Response: resp}
5664	return
5665}
5666
5667// GetChaosSchedule gets the version of the Chaos Schedule in use and the Chaos Schedule that defines when and how to
5668// run Chaos.
5669// Parameters:
5670// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5671// duration that the client is willing to wait for the requested operation to complete. The default value for
5672// this parameter is 60 seconds.
5673func (client BaseClient) GetChaosSchedule(ctx context.Context, timeout *int64) (result ChaosScheduleDescription, err error) {
5674	if tracing.IsEnabled() {
5675		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaosSchedule")
5676		defer func() {
5677			sc := -1
5678			if result.Response.Response != nil {
5679				sc = result.Response.Response.StatusCode
5680			}
5681			tracing.EndSpan(ctx, sc, err)
5682		}()
5683	}
5684	if err := validation.Validate([]validation.Validation{
5685		{TargetValue: timeout,
5686			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5687				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5688					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5689				}}}}}); err != nil {
5690		return result, validation.NewError("servicefabric.BaseClient", "GetChaosSchedule", err.Error())
5691	}
5692
5693	req, err := client.GetChaosSchedulePreparer(ctx, timeout)
5694	if err != nil {
5695		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", nil, "Failure preparing request")
5696		return
5697	}
5698
5699	resp, err := client.GetChaosScheduleSender(req)
5700	if err != nil {
5701		result.Response = autorest.Response{Response: resp}
5702		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", resp, "Failure sending request")
5703		return
5704	}
5705
5706	result, err = client.GetChaosScheduleResponder(resp)
5707	if err != nil {
5708		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", resp, "Failure responding to request")
5709		return
5710	}
5711
5712	return
5713}
5714
5715// GetChaosSchedulePreparer prepares the GetChaosSchedule request.
5716func (client BaseClient) GetChaosSchedulePreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
5717	const APIVersion = "6.2"
5718	queryParameters := map[string]interface{}{
5719		"api-version": APIVersion,
5720	}
5721	if timeout != nil {
5722		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5723	} else {
5724		queryParameters["timeout"] = autorest.Encode("query", 60)
5725	}
5726
5727	preparer := autorest.CreatePreparer(
5728		autorest.AsGet(),
5729		autorest.WithBaseURL(client.BaseURI),
5730		autorest.WithPath("/Tools/Chaos/Schedule"),
5731		autorest.WithQueryParameters(queryParameters))
5732	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5733}
5734
5735// GetChaosScheduleSender sends the GetChaosSchedule request. The method will close the
5736// http.Response Body if it receives an error.
5737func (client BaseClient) GetChaosScheduleSender(req *http.Request) (*http.Response, error) {
5738	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5739}
5740
5741// GetChaosScheduleResponder handles the response to the GetChaosSchedule request. The method always
5742// closes the http.Response Body.
5743func (client BaseClient) GetChaosScheduleResponder(resp *http.Response) (result ChaosScheduleDescription, err error) {
5744	err = autorest.Respond(
5745		resp,
5746		azure.WithErrorUnlessStatusCode(http.StatusOK),
5747		autorest.ByUnmarshallingJSON(&result),
5748		autorest.ByClosing())
5749	result.Response = autorest.Response{Response: resp}
5750	return
5751}
5752
5753// GetClusterConfiguration the cluster configuration contains properties of the cluster that include different node
5754// types on the cluster,
5755// security configurations, fault, and upgrade domain topologies, etc.
5756// Parameters:
5757// configurationAPIVersion - the API version of the Standalone cluster json configuration.
5758// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5759// duration that the client is willing to wait for the requested operation to complete. The default value for
5760// this parameter is 60 seconds.
5761func (client BaseClient) GetClusterConfiguration(ctx context.Context, configurationAPIVersion string, timeout *int64) (result ClusterConfiguration, err error) {
5762	if tracing.IsEnabled() {
5763		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterConfiguration")
5764		defer func() {
5765			sc := -1
5766			if result.Response.Response != nil {
5767				sc = result.Response.Response.StatusCode
5768			}
5769			tracing.EndSpan(ctx, sc, err)
5770		}()
5771	}
5772	if err := validation.Validate([]validation.Validation{
5773		{TargetValue: timeout,
5774			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5775				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5776					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5777				}}}}}); err != nil {
5778		return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfiguration", err.Error())
5779	}
5780
5781	req, err := client.GetClusterConfigurationPreparer(ctx, configurationAPIVersion, timeout)
5782	if err != nil {
5783		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", nil, "Failure preparing request")
5784		return
5785	}
5786
5787	resp, err := client.GetClusterConfigurationSender(req)
5788	if err != nil {
5789		result.Response = autorest.Response{Response: resp}
5790		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", resp, "Failure sending request")
5791		return
5792	}
5793
5794	result, err = client.GetClusterConfigurationResponder(resp)
5795	if err != nil {
5796		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", resp, "Failure responding to request")
5797		return
5798	}
5799
5800	return
5801}
5802
5803// GetClusterConfigurationPreparer prepares the GetClusterConfiguration request.
5804func (client BaseClient) GetClusterConfigurationPreparer(ctx context.Context, configurationAPIVersion string, timeout *int64) (*http.Request, error) {
5805	const APIVersion = "6.0"
5806	queryParameters := map[string]interface{}{
5807		"api-version":             APIVersion,
5808		"ConfigurationApiVersion": autorest.Encode("query", configurationAPIVersion),
5809	}
5810	if timeout != nil {
5811		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5812	} else {
5813		queryParameters["timeout"] = autorest.Encode("query", 60)
5814	}
5815
5816	preparer := autorest.CreatePreparer(
5817		autorest.AsGet(),
5818		autorest.WithBaseURL(client.BaseURI),
5819		autorest.WithPath("/$/GetClusterConfiguration"),
5820		autorest.WithQueryParameters(queryParameters))
5821	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5822}
5823
5824// GetClusterConfigurationSender sends the GetClusterConfiguration request. The method will close the
5825// http.Response Body if it receives an error.
5826func (client BaseClient) GetClusterConfigurationSender(req *http.Request) (*http.Response, error) {
5827	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5828}
5829
5830// GetClusterConfigurationResponder handles the response to the GetClusterConfiguration request. The method always
5831// closes the http.Response Body.
5832func (client BaseClient) GetClusterConfigurationResponder(resp *http.Response) (result ClusterConfiguration, err error) {
5833	err = autorest.Respond(
5834		resp,
5835		azure.WithErrorUnlessStatusCode(http.StatusOK),
5836		autorest.ByUnmarshallingJSON(&result),
5837		autorest.ByClosing())
5838	result.Response = autorest.Response{Response: resp}
5839	return
5840}
5841
5842// GetClusterConfigurationUpgradeStatus get the cluster configuration upgrade status details of a Service Fabric
5843// standalone cluster.
5844// Parameters:
5845// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5846// duration that the client is willing to wait for the requested operation to complete. The default value for
5847// this parameter is 60 seconds.
5848func (client BaseClient) GetClusterConfigurationUpgradeStatus(ctx context.Context, timeout *int64) (result ClusterConfigurationUpgradeStatusInfo, err error) {
5849	if tracing.IsEnabled() {
5850		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterConfigurationUpgradeStatus")
5851		defer func() {
5852			sc := -1
5853			if result.Response.Response != nil {
5854				sc = result.Response.Response.StatusCode
5855			}
5856			tracing.EndSpan(ctx, sc, err)
5857		}()
5858	}
5859	if err := validation.Validate([]validation.Validation{
5860		{TargetValue: timeout,
5861			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5862				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5863					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5864				}}}}}); err != nil {
5865		return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", err.Error())
5866	}
5867
5868	req, err := client.GetClusterConfigurationUpgradeStatusPreparer(ctx, timeout)
5869	if err != nil {
5870		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", nil, "Failure preparing request")
5871		return
5872	}
5873
5874	resp, err := client.GetClusterConfigurationUpgradeStatusSender(req)
5875	if err != nil {
5876		result.Response = autorest.Response{Response: resp}
5877		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", resp, "Failure sending request")
5878		return
5879	}
5880
5881	result, err = client.GetClusterConfigurationUpgradeStatusResponder(resp)
5882	if err != nil {
5883		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", resp, "Failure responding to request")
5884		return
5885	}
5886
5887	return
5888}
5889
5890// GetClusterConfigurationUpgradeStatusPreparer prepares the GetClusterConfigurationUpgradeStatus request.
5891func (client BaseClient) GetClusterConfigurationUpgradeStatusPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
5892	const APIVersion = "6.0"
5893	queryParameters := map[string]interface{}{
5894		"api-version": APIVersion,
5895	}
5896	if timeout != nil {
5897		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5898	} else {
5899		queryParameters["timeout"] = autorest.Encode("query", 60)
5900	}
5901
5902	preparer := autorest.CreatePreparer(
5903		autorest.AsGet(),
5904		autorest.WithBaseURL(client.BaseURI),
5905		autorest.WithPath("/$/GetClusterConfigurationUpgradeStatus"),
5906		autorest.WithQueryParameters(queryParameters))
5907	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5908}
5909
5910// GetClusterConfigurationUpgradeStatusSender sends the GetClusterConfigurationUpgradeStatus request. The method will close the
5911// http.Response Body if it receives an error.
5912func (client BaseClient) GetClusterConfigurationUpgradeStatusSender(req *http.Request) (*http.Response, error) {
5913	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5914}
5915
5916// GetClusterConfigurationUpgradeStatusResponder handles the response to the GetClusterConfigurationUpgradeStatus request. The method always
5917// closes the http.Response Body.
5918func (client BaseClient) GetClusterConfigurationUpgradeStatusResponder(resp *http.Response) (result ClusterConfigurationUpgradeStatusInfo, err error) {
5919	err = autorest.Respond(
5920		resp,
5921		azure.WithErrorUnlessStatusCode(http.StatusOK),
5922		autorest.ByUnmarshallingJSON(&result),
5923		autorest.ByClosing())
5924	result.Response = autorest.Response{Response: resp}
5925	return
5926}
5927
5928// GetClusterEventList the response is list of ClusterEvent objects.
5929// Parameters:
5930// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
5931// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
5932// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5933// duration that the client is willing to wait for the requested operation to complete. The default value for
5934// this parameter is 60 seconds.
5935// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
5936// be included in the response.
5937// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
5938// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
5939// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
5940// populated.
5941func (client BaseClient) GetClusterEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListClusterEvent, err error) {
5942	if tracing.IsEnabled() {
5943		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterEventList")
5944		defer func() {
5945			sc := -1
5946			if result.Response.Response != nil {
5947				sc = result.Response.Response.StatusCode
5948			}
5949			tracing.EndSpan(ctx, sc, err)
5950		}()
5951	}
5952	if err := validation.Validate([]validation.Validation{
5953		{TargetValue: timeout,
5954			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5955				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5956					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5957				}}}}}); err != nil {
5958		return result, validation.NewError("servicefabric.BaseClient", "GetClusterEventList", err.Error())
5959	}
5960
5961	req, err := client.GetClusterEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
5962	if err != nil {
5963		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", nil, "Failure preparing request")
5964		return
5965	}
5966
5967	resp, err := client.GetClusterEventListSender(req)
5968	if err != nil {
5969		result.Response = autorest.Response{Response: resp}
5970		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", resp, "Failure sending request")
5971		return
5972	}
5973
5974	result, err = client.GetClusterEventListResponder(resp)
5975	if err != nil {
5976		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", resp, "Failure responding to request")
5977		return
5978	}
5979
5980	return
5981}
5982
5983// GetClusterEventListPreparer prepares the GetClusterEventList request.
5984func (client BaseClient) GetClusterEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
5985	const APIVersion = "6.2-preview"
5986	queryParameters := map[string]interface{}{
5987		"api-version":  APIVersion,
5988		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
5989		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
5990	}
5991	if timeout != nil {
5992		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5993	} else {
5994		queryParameters["timeout"] = autorest.Encode("query", 60)
5995	}
5996	if len(eventsTypesFilter) > 0 {
5997		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
5998	}
5999	if excludeAnalysisEvents != nil {
6000		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
6001	}
6002	if skipCorrelationLookup != nil {
6003		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
6004	}
6005
6006	preparer := autorest.CreatePreparer(
6007		autorest.AsGet(),
6008		autorest.WithBaseURL(client.BaseURI),
6009		autorest.WithPath("/EventsStore/Cluster/Events"),
6010		autorest.WithQueryParameters(queryParameters))
6011	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6012}
6013
6014// GetClusterEventListSender sends the GetClusterEventList request. The method will close the
6015// http.Response Body if it receives an error.
6016func (client BaseClient) GetClusterEventListSender(req *http.Request) (*http.Response, error) {
6017	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6018}
6019
6020// GetClusterEventListResponder handles the response to the GetClusterEventList request. The method always
6021// closes the http.Response Body.
6022func (client BaseClient) GetClusterEventListResponder(resp *http.Response) (result ListClusterEvent, err error) {
6023	err = autorest.Respond(
6024		resp,
6025		azure.WithErrorUnlessStatusCode(http.StatusOK),
6026		autorest.ByUnmarshallingJSON(&result),
6027		autorest.ByClosing())
6028	result.Response = autorest.Response{Response: resp}
6029	return
6030}
6031
6032// GetClusterHealth use EventsHealthStateFilter to filter the collection of health events reported on the cluster based
6033// on the health state.
6034// Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and
6035// applications returned based on their aggregated health state.
6036// Parameters:
6037// nodesHealthStateFilter - allows filtering of the node health state objects returned in the result of cluster
6038// health query
6039// based on their health state. The possible values for this parameter include integer value of one of the
6040// following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the
6041// aggregated health state.
6042// If not specified, all entries are returned.
6043// The state values are flag-based enumeration, so the value could be a combination of these values obtained
6044// using bitwise 'OR' operator.
6045// For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and
6046// Warning (4) are returned.
6047//
6048// - Default - Default value. Matches any HealthState. The value is zero.
6049// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
6050// collection of states. The value is 1.
6051// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
6052// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
6053// - Error - Filter that matches input with HealthState value Error. The value is 8.
6054// - All - Filter that matches input with any HealthState value. The value is 65535.
6055// applicationsHealthStateFilter - allows filtering of the application health state objects returned in the
6056// result of cluster health
6057// query based on their health state.
6058// The possible values for this parameter include integer value obtained from members or bitwise operations
6059// on members of HealthStateFilter enumeration. Only applications that match the filter are returned.
6060// All applications are used to evaluate the aggregated health state. If not specified, all entries are
6061// returned.
6062// The state values are flag-based enumeration, so the value could be a combination of these values obtained
6063// using bitwise 'OR' operator.
6064// For example, if the provided value is 6 then health state of applications with HealthState value of OK (2)
6065// and Warning (4) are returned.
6066//
6067// - Default - Default value. Matches any HealthState. The value is zero.
6068// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
6069// collection of states. The value is 1.
6070// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
6071// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
6072// - Error - Filter that matches input with HealthState value Error. The value is 8.
6073// - All - Filter that matches input with any HealthState value. The value is 65535.
6074// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
6075// state.
6076// The possible values for this parameter include integer value of one of the following health states.
6077// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
6078// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
6079// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
6080// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
6081//
6082// - Default - Default value. Matches any HealthState. The value is zero.
6083// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
6084// collection of states. The value is 1.
6085// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
6086// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
6087// - Error - Filter that matches input with HealthState value Error. The value is 8.
6088// - All - Filter that matches input with any HealthState value. The value is 65535.
6089// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
6090// result. False by default.
6091// The statistics show the number of children entities in health state Ok, Warning, and Error.
6092// includeSystemApplicationHealthStatistics - indicates whether the health statistics should include the
6093// fabric:/System application health statistics. False by default.
6094// If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that
6095// belong to the fabric:/System application.
6096// Otherwise, the query result includes health statistics only for user applications.
6097// The health statistics must be included in the query result for this parameter to be applied.
6098// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6099// duration that the client is willing to wait for the requested operation to complete. The default value for
6100// this parameter is 60 seconds.
6101func (client BaseClient) GetClusterHealth(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, timeout *int64) (result ClusterHealth, err error) {
6102	if tracing.IsEnabled() {
6103		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealth")
6104		defer func() {
6105			sc := -1
6106			if result.Response.Response != nil {
6107				sc = result.Response.Response.StatusCode
6108			}
6109			tracing.EndSpan(ctx, sc, err)
6110		}()
6111	}
6112	if err := validation.Validate([]validation.Validation{
6113		{TargetValue: timeout,
6114			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6115				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6116					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6117				}}}}}); err != nil {
6118		return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealth", err.Error())
6119	}
6120
6121	req, err := client.GetClusterHealthPreparer(ctx, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, timeout)
6122	if err != nil {
6123		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", nil, "Failure preparing request")
6124		return
6125	}
6126
6127	resp, err := client.GetClusterHealthSender(req)
6128	if err != nil {
6129		result.Response = autorest.Response{Response: resp}
6130		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", resp, "Failure sending request")
6131		return
6132	}
6133
6134	result, err = client.GetClusterHealthResponder(resp)
6135	if err != nil {
6136		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", resp, "Failure responding to request")
6137		return
6138	}
6139
6140	return
6141}
6142
6143// GetClusterHealthPreparer prepares the GetClusterHealth request.
6144func (client BaseClient) GetClusterHealthPreparer(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, timeout *int64) (*http.Request, error) {
6145	const APIVersion = "6.0"
6146	queryParameters := map[string]interface{}{
6147		"api-version": APIVersion,
6148	}
6149	if nodesHealthStateFilter != nil {
6150		queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", *nodesHealthStateFilter)
6151	} else {
6152		queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", 0)
6153	}
6154	if applicationsHealthStateFilter != nil {
6155		queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", *applicationsHealthStateFilter)
6156	} else {
6157		queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", 0)
6158	}
6159	if eventsHealthStateFilter != nil {
6160		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
6161	} else {
6162		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
6163	}
6164	if excludeHealthStatistics != nil {
6165		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
6166	} else {
6167		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
6168	}
6169	if includeSystemApplicationHealthStatistics != nil {
6170		queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", *includeSystemApplicationHealthStatistics)
6171	} else {
6172		queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", false)
6173	}
6174	if timeout != nil {
6175		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6176	} else {
6177		queryParameters["timeout"] = autorest.Encode("query", 60)
6178	}
6179
6180	preparer := autorest.CreatePreparer(
6181		autorest.AsGet(),
6182		autorest.WithBaseURL(client.BaseURI),
6183		autorest.WithPath("/$/GetClusterHealth"),
6184		autorest.WithQueryParameters(queryParameters))
6185	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6186}
6187
6188// GetClusterHealthSender sends the GetClusterHealth request. The method will close the
6189// http.Response Body if it receives an error.
6190func (client BaseClient) GetClusterHealthSender(req *http.Request) (*http.Response, error) {
6191	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6192}
6193
6194// GetClusterHealthResponder handles the response to the GetClusterHealth request. The method always
6195// closes the http.Response Body.
6196func (client BaseClient) GetClusterHealthResponder(resp *http.Response) (result ClusterHealth, err error) {
6197	err = autorest.Respond(
6198		resp,
6199		azure.WithErrorUnlessStatusCode(http.StatusOK),
6200		autorest.ByUnmarshallingJSON(&result),
6201		autorest.ByClosing())
6202	result.Response = autorest.Response{Response: resp}
6203	return
6204}
6205
6206// GetClusterHealthChunk gets the health of a Service Fabric cluster using health chunks. Includes the aggregated
6207// health state of the cluster, but none of the cluster entities.
6208// To expand the cluster health and get the health state of all or some of the entities, use the POST URI and specify
6209// the cluster health chunk query description.
6210// Parameters:
6211// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6212// duration that the client is willing to wait for the requested operation to complete. The default value for
6213// this parameter is 60 seconds.
6214func (client BaseClient) GetClusterHealthChunk(ctx context.Context, timeout *int64) (result ClusterHealthChunk, err error) {
6215	if tracing.IsEnabled() {
6216		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthChunk")
6217		defer func() {
6218			sc := -1
6219			if result.Response.Response != nil {
6220				sc = result.Response.Response.StatusCode
6221			}
6222			tracing.EndSpan(ctx, sc, err)
6223		}()
6224	}
6225	if err := validation.Validate([]validation.Validation{
6226		{TargetValue: timeout,
6227			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6228				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6229					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6230				}}}}}); err != nil {
6231		return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunk", err.Error())
6232	}
6233
6234	req, err := client.GetClusterHealthChunkPreparer(ctx, timeout)
6235	if err != nil {
6236		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", nil, "Failure preparing request")
6237		return
6238	}
6239
6240	resp, err := client.GetClusterHealthChunkSender(req)
6241	if err != nil {
6242		result.Response = autorest.Response{Response: resp}
6243		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", resp, "Failure sending request")
6244		return
6245	}
6246
6247	result, err = client.GetClusterHealthChunkResponder(resp)
6248	if err != nil {
6249		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", resp, "Failure responding to request")
6250		return
6251	}
6252
6253	return
6254}
6255
6256// GetClusterHealthChunkPreparer prepares the GetClusterHealthChunk request.
6257func (client BaseClient) GetClusterHealthChunkPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
6258	const APIVersion = "6.0"
6259	queryParameters := map[string]interface{}{
6260		"api-version": APIVersion,
6261	}
6262	if timeout != nil {
6263		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6264	} else {
6265		queryParameters["timeout"] = autorest.Encode("query", 60)
6266	}
6267
6268	preparer := autorest.CreatePreparer(
6269		autorest.AsGet(),
6270		autorest.WithBaseURL(client.BaseURI),
6271		autorest.WithPath("/$/GetClusterHealthChunk"),
6272		autorest.WithQueryParameters(queryParameters))
6273	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6274}
6275
6276// GetClusterHealthChunkSender sends the GetClusterHealthChunk request. The method will close the
6277// http.Response Body if it receives an error.
6278func (client BaseClient) GetClusterHealthChunkSender(req *http.Request) (*http.Response, error) {
6279	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6280}
6281
6282// GetClusterHealthChunkResponder handles the response to the GetClusterHealthChunk request. The method always
6283// closes the http.Response Body.
6284func (client BaseClient) GetClusterHealthChunkResponder(resp *http.Response) (result ClusterHealthChunk, err error) {
6285	err = autorest.Respond(
6286		resp,
6287		azure.WithErrorUnlessStatusCode(http.StatusOK),
6288		autorest.ByUnmarshallingJSON(&result),
6289		autorest.ByClosing())
6290	result.Response = autorest.Response{Response: resp}
6291	return
6292}
6293
6294// GetClusterHealthChunkUsingPolicyAndAdvancedFilters gets the health of a Service Fabric cluster using health chunks.
6295// The health evaluation is done based on the input cluster health chunk query description.
6296// The query description allows users to specify health policies for evaluating the cluster and its children.
6297// Users can specify very flexible filters to select which cluster entities to return. The selection can be done based
6298// on the entities health state and based on the hierarchy.
6299// The query can return multi-level children of the entities based on the specified filters. For example, it can return
6300// one application with a specified name, and for this application, return
6301// only services that are in Error or Warning, and all partitions and replicas for one of these services.
6302// Parameters:
6303// clusterHealthChunkQueryDescription - describes the cluster and application health policies used to evaluate
6304// the cluster health and the filters to select which cluster entities to be returned.
6305// If the cluster health policy is present, it is used to evaluate the cluster events and the cluster nodes. If
6306// not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the
6307// default cluster health policy.
6308// By default, each application is evaluated using its specific application health policy, defined in the
6309// application manifest, or the default health policy, if no policy is defined in manifest.
6310// If the application health policy map is specified, and it has an entry for an application, the specified
6311// application health policy
6312// is used to evaluate the application health.
6313// Users can specify very flexible filters to select which cluster entities to include in response. The
6314// selection can be done based on the entities health state and based on the hierarchy.
6315// The query can return multi-level children of the entities based on the specified filters. For example, it
6316// can return one application with a specified name, and for this application, return
6317// only services that are in Error or Warning, and all partitions and replicas for one of these services.
6318// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6319// duration that the client is willing to wait for the requested operation to complete. The default value for
6320// this parameter is 60 seconds.
6321func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFilters(ctx context.Context, clusterHealthChunkQueryDescription *ClusterHealthChunkQueryDescription, timeout *int64) (result ClusterHealthChunk, err error) {
6322	if tracing.IsEnabled() {
6323		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthChunkUsingPolicyAndAdvancedFilters")
6324		defer func() {
6325			sc := -1
6326			if result.Response.Response != nil {
6327				sc = result.Response.Response.StatusCode
6328			}
6329			tracing.EndSpan(ctx, sc, err)
6330		}()
6331	}
6332	if err := validation.Validate([]validation.Validation{
6333		{TargetValue: timeout,
6334			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6335				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6336					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6337				}}}}}); err != nil {
6338		return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", err.Error())
6339	}
6340
6341	req, err := client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer(ctx, clusterHealthChunkQueryDescription, timeout)
6342	if err != nil {
6343		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", nil, "Failure preparing request")
6344		return
6345	}
6346
6347	resp, err := client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender(req)
6348	if err != nil {
6349		result.Response = autorest.Response{Response: resp}
6350		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", resp, "Failure sending request")
6351		return
6352	}
6353
6354	result, err = client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder(resp)
6355	if err != nil {
6356		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", resp, "Failure responding to request")
6357		return
6358	}
6359
6360	return
6361}
6362
6363// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer prepares the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request.
6364func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer(ctx context.Context, clusterHealthChunkQueryDescription *ClusterHealthChunkQueryDescription, timeout *int64) (*http.Request, error) {
6365	const APIVersion = "6.0"
6366	queryParameters := map[string]interface{}{
6367		"api-version": APIVersion,
6368	}
6369	if timeout != nil {
6370		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6371	} else {
6372		queryParameters["timeout"] = autorest.Encode("query", 60)
6373	}
6374
6375	preparer := autorest.CreatePreparer(
6376		autorest.AsContentType("application/json; charset=utf-8"),
6377		autorest.AsPost(),
6378		autorest.WithBaseURL(client.BaseURI),
6379		autorest.WithPath("/$/GetClusterHealthChunk"),
6380		autorest.WithQueryParameters(queryParameters))
6381	if clusterHealthChunkQueryDescription != nil {
6382		preparer = autorest.DecoratePreparer(preparer,
6383			autorest.WithJSON(clusterHealthChunkQueryDescription))
6384	}
6385	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6386}
6387
6388// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender sends the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. The method will close the
6389// http.Response Body if it receives an error.
6390func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender(req *http.Request) (*http.Response, error) {
6391	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6392}
6393
6394// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder handles the response to the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. The method always
6395// closes the http.Response Body.
6396func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder(resp *http.Response) (result ClusterHealthChunk, err error) {
6397	err = autorest.Respond(
6398		resp,
6399		azure.WithErrorUnlessStatusCode(http.StatusOK),
6400		autorest.ByUnmarshallingJSON(&result),
6401		autorest.ByClosing())
6402	result.Response = autorest.Response{Response: resp}
6403	return
6404}
6405
6406// GetClusterHealthUsingPolicy use EventsHealthStateFilter to filter the collection of health events reported on the
6407// cluster based on the health state.
6408// Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and
6409// applications returned based on their aggregated health state.
6410// Use ClusterHealthPolicies to override the health policies used to evaluate the health.
6411// Parameters:
6412// nodesHealthStateFilter - allows filtering of the node health state objects returned in the result of cluster
6413// health query
6414// based on their health state. The possible values for this parameter include integer value of one of the
6415// following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the
6416// aggregated health state.
6417// If not specified, all entries are returned.
6418// The state values are flag-based enumeration, so the value could be a combination of these values obtained
6419// using bitwise 'OR' operator.
6420// For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and
6421// Warning (4) are returned.
6422//
6423// - Default - Default value. Matches any HealthState. The value is zero.
6424// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
6425// collection of states. The value is 1.
6426// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
6427// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
6428// - Error - Filter that matches input with HealthState value Error. The value is 8.
6429// - All - Filter that matches input with any HealthState value. The value is 65535.
6430// applicationsHealthStateFilter - allows filtering of the application health state objects returned in the
6431// result of cluster health
6432// query based on their health state.
6433// The possible values for this parameter include integer value obtained from members or bitwise operations
6434// on members of HealthStateFilter enumeration. Only applications that match the filter are returned.
6435// All applications are used to evaluate the aggregated health state. If not specified, all entries are
6436// returned.
6437// The state values are flag-based enumeration, so the value could be a combination of these values obtained
6438// using bitwise 'OR' operator.
6439// For example, if the provided value is 6 then health state of applications with HealthState value of OK (2)
6440// and Warning (4) are returned.
6441//
6442// - Default - Default value. Matches any HealthState. The value is zero.
6443// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
6444// collection of states. The value is 1.
6445// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
6446// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
6447// - Error - Filter that matches input with HealthState value Error. The value is 8.
6448// - All - Filter that matches input with any HealthState value. The value is 65535.
6449// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
6450// state.
6451// The possible values for this parameter include integer value of one of the following health states.
6452// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
6453// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
6454// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
6455// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
6456//
6457// - Default - Default value. Matches any HealthState. The value is zero.
6458// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
6459// collection of states. The value is 1.
6460// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
6461// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
6462// - Error - Filter that matches input with HealthState value Error. The value is 8.
6463// - All - Filter that matches input with any HealthState value. The value is 65535.
6464// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
6465// result. False by default.
6466// The statistics show the number of children entities in health state Ok, Warning, and Error.
6467// includeSystemApplicationHealthStatistics - indicates whether the health statistics should include the
6468// fabric:/System application health statistics. False by default.
6469// If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that
6470// belong to the fabric:/System application.
6471// Otherwise, the query result includes health statistics only for user applications.
6472// The health statistics must be included in the query result for this parameter to be applied.
6473// clusterHealthPolicies - describes the health policies used to evaluate the cluster health.
6474// If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the
6475// default cluster health policy.
6476// By default, each application is evaluated using its specific application health policy, defined in the
6477// application manifest, or the default health policy, if no policy is defined in manifest.
6478// If the application health policy map is specified, and it has an entry for an application, the specified
6479// application health policy
6480// is used to evaluate the application health.
6481// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6482// duration that the client is willing to wait for the requested operation to complete. The default value for
6483// this parameter is 60 seconds.
6484func (client BaseClient) GetClusterHealthUsingPolicy(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, clusterHealthPolicies *ClusterHealthPolicies, timeout *int64) (result ClusterHealth, err error) {
6485	if tracing.IsEnabled() {
6486		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthUsingPolicy")
6487		defer func() {
6488			sc := -1
6489			if result.Response.Response != nil {
6490				sc = result.Response.Response.StatusCode
6491			}
6492			tracing.EndSpan(ctx, sc, err)
6493		}()
6494	}
6495	if err := validation.Validate([]validation.Validation{
6496		{TargetValue: timeout,
6497			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6498				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6499					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6500				}}}}}); err != nil {
6501		return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthUsingPolicy", err.Error())
6502	}
6503
6504	req, err := client.GetClusterHealthUsingPolicyPreparer(ctx, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, clusterHealthPolicies, timeout)
6505	if err != nil {
6506		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", nil, "Failure preparing request")
6507		return
6508	}
6509
6510	resp, err := client.GetClusterHealthUsingPolicySender(req)
6511	if err != nil {
6512		result.Response = autorest.Response{Response: resp}
6513		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", resp, "Failure sending request")
6514		return
6515	}
6516
6517	result, err = client.GetClusterHealthUsingPolicyResponder(resp)
6518	if err != nil {
6519		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", resp, "Failure responding to request")
6520		return
6521	}
6522
6523	return
6524}
6525
6526// GetClusterHealthUsingPolicyPreparer prepares the GetClusterHealthUsingPolicy request.
6527func (client BaseClient) GetClusterHealthUsingPolicyPreparer(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, clusterHealthPolicies *ClusterHealthPolicies, timeout *int64) (*http.Request, error) {
6528	const APIVersion = "6.0"
6529	queryParameters := map[string]interface{}{
6530		"api-version": APIVersion,
6531	}
6532	if nodesHealthStateFilter != nil {
6533		queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", *nodesHealthStateFilter)
6534	} else {
6535		queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", 0)
6536	}
6537	if applicationsHealthStateFilter != nil {
6538		queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", *applicationsHealthStateFilter)
6539	} else {
6540		queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", 0)
6541	}
6542	if eventsHealthStateFilter != nil {
6543		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
6544	} else {
6545		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
6546	}
6547	if excludeHealthStatistics != nil {
6548		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
6549	} else {
6550		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
6551	}
6552	if includeSystemApplicationHealthStatistics != nil {
6553		queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", *includeSystemApplicationHealthStatistics)
6554	} else {
6555		queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", false)
6556	}
6557	if timeout != nil {
6558		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6559	} else {
6560		queryParameters["timeout"] = autorest.Encode("query", 60)
6561	}
6562
6563	preparer := autorest.CreatePreparer(
6564		autorest.AsContentType("application/json; charset=utf-8"),
6565		autorest.AsPost(),
6566		autorest.WithBaseURL(client.BaseURI),
6567		autorest.WithPath("/$/GetClusterHealth"),
6568		autorest.WithQueryParameters(queryParameters))
6569	if clusterHealthPolicies != nil {
6570		preparer = autorest.DecoratePreparer(preparer,
6571			autorest.WithJSON(clusterHealthPolicies))
6572	}
6573	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6574}
6575
6576// GetClusterHealthUsingPolicySender sends the GetClusterHealthUsingPolicy request. The method will close the
6577// http.Response Body if it receives an error.
6578func (client BaseClient) GetClusterHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
6579	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6580}
6581
6582// GetClusterHealthUsingPolicyResponder handles the response to the GetClusterHealthUsingPolicy request. The method always
6583// closes the http.Response Body.
6584func (client BaseClient) GetClusterHealthUsingPolicyResponder(resp *http.Response) (result ClusterHealth, err error) {
6585	err = autorest.Respond(
6586		resp,
6587		azure.WithErrorUnlessStatusCode(http.StatusOK),
6588		autorest.ByUnmarshallingJSON(&result),
6589		autorest.ByClosing())
6590	result.Response = autorest.Response{Response: resp}
6591	return
6592}
6593
6594// GetClusterManifest get the Service Fabric cluster manifest. The cluster manifest contains properties of the cluster
6595// that include different node types on the cluster,
6596// security configurations, fault, and upgrade domain topologies, etc.
6597//
6598// These properties are specified as part of the ClusterConfig.JSON file while deploying a stand-alone cluster.
6599// However, most of the information in the cluster manifest
6600// is generated internally by service fabric during cluster deployment in other deployment scenarios (e.g. when using
6601// Azure portal).
6602//
6603// The contents of the cluster manifest are for informational purposes only and users are not expected to take a
6604// dependency on the format of the file contents or its interpretation.
6605// Parameters:
6606// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6607// duration that the client is willing to wait for the requested operation to complete. The default value for
6608// this parameter is 60 seconds.
6609func (client BaseClient) GetClusterManifest(ctx context.Context, timeout *int64) (result ClusterManifest, err error) {
6610	if tracing.IsEnabled() {
6611		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterManifest")
6612		defer func() {
6613			sc := -1
6614			if result.Response.Response != nil {
6615				sc = result.Response.Response.StatusCode
6616			}
6617			tracing.EndSpan(ctx, sc, err)
6618		}()
6619	}
6620	if err := validation.Validate([]validation.Validation{
6621		{TargetValue: timeout,
6622			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6623				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6624					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6625				}}}}}); err != nil {
6626		return result, validation.NewError("servicefabric.BaseClient", "GetClusterManifest", err.Error())
6627	}
6628
6629	req, err := client.GetClusterManifestPreparer(ctx, timeout)
6630	if err != nil {
6631		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", nil, "Failure preparing request")
6632		return
6633	}
6634
6635	resp, err := client.GetClusterManifestSender(req)
6636	if err != nil {
6637		result.Response = autorest.Response{Response: resp}
6638		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", resp, "Failure sending request")
6639		return
6640	}
6641
6642	result, err = client.GetClusterManifestResponder(resp)
6643	if err != nil {
6644		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", resp, "Failure responding to request")
6645		return
6646	}
6647
6648	return
6649}
6650
6651// GetClusterManifestPreparer prepares the GetClusterManifest request.
6652func (client BaseClient) GetClusterManifestPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
6653	const APIVersion = "6.0"
6654	queryParameters := map[string]interface{}{
6655		"api-version": APIVersion,
6656	}
6657	if timeout != nil {
6658		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6659	} else {
6660		queryParameters["timeout"] = autorest.Encode("query", 60)
6661	}
6662
6663	preparer := autorest.CreatePreparer(
6664		autorest.AsGet(),
6665		autorest.WithBaseURL(client.BaseURI),
6666		autorest.WithPath("/$/GetClusterManifest"),
6667		autorest.WithQueryParameters(queryParameters))
6668	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6669}
6670
6671// GetClusterManifestSender sends the GetClusterManifest request. The method will close the
6672// http.Response Body if it receives an error.
6673func (client BaseClient) GetClusterManifestSender(req *http.Request) (*http.Response, error) {
6674	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6675}
6676
6677// GetClusterManifestResponder handles the response to the GetClusterManifest request. The method always
6678// closes the http.Response Body.
6679func (client BaseClient) GetClusterManifestResponder(resp *http.Response) (result ClusterManifest, err error) {
6680	err = autorest.Respond(
6681		resp,
6682		azure.WithErrorUnlessStatusCode(http.StatusOK),
6683		autorest.ByUnmarshallingJSON(&result),
6684		autorest.ByClosing())
6685	result.Response = autorest.Response{Response: resp}
6686	return
6687}
6688
6689// GetClusterUpgradeProgress gets the current progress of the ongoing cluster upgrade. If no upgrade is currently in
6690// progress, get the last state of the previous cluster upgrade.
6691// Parameters:
6692// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6693// duration that the client is willing to wait for the requested operation to complete. The default value for
6694// this parameter is 60 seconds.
6695func (client BaseClient) GetClusterUpgradeProgress(ctx context.Context, timeout *int64) (result ClusterUpgradeProgressObject, err error) {
6696	if tracing.IsEnabled() {
6697		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterUpgradeProgress")
6698		defer func() {
6699			sc := -1
6700			if result.Response.Response != nil {
6701				sc = result.Response.Response.StatusCode
6702			}
6703			tracing.EndSpan(ctx, sc, err)
6704		}()
6705	}
6706	if err := validation.Validate([]validation.Validation{
6707		{TargetValue: timeout,
6708			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6709				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6710					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6711				}}}}}); err != nil {
6712		return result, validation.NewError("servicefabric.BaseClient", "GetClusterUpgradeProgress", err.Error())
6713	}
6714
6715	req, err := client.GetClusterUpgradeProgressPreparer(ctx, timeout)
6716	if err != nil {
6717		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", nil, "Failure preparing request")
6718		return
6719	}
6720
6721	resp, err := client.GetClusterUpgradeProgressSender(req)
6722	if err != nil {
6723		result.Response = autorest.Response{Response: resp}
6724		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", resp, "Failure sending request")
6725		return
6726	}
6727
6728	result, err = client.GetClusterUpgradeProgressResponder(resp)
6729	if err != nil {
6730		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", resp, "Failure responding to request")
6731		return
6732	}
6733
6734	return
6735}
6736
6737// GetClusterUpgradeProgressPreparer prepares the GetClusterUpgradeProgress request.
6738func (client BaseClient) GetClusterUpgradeProgressPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
6739	const APIVersion = "6.0"
6740	queryParameters := map[string]interface{}{
6741		"api-version": APIVersion,
6742	}
6743	if timeout != nil {
6744		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6745	} else {
6746		queryParameters["timeout"] = autorest.Encode("query", 60)
6747	}
6748
6749	preparer := autorest.CreatePreparer(
6750		autorest.AsGet(),
6751		autorest.WithBaseURL(client.BaseURI),
6752		autorest.WithPath("/$/GetUpgradeProgress"),
6753		autorest.WithQueryParameters(queryParameters))
6754	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6755}
6756
6757// GetClusterUpgradeProgressSender sends the GetClusterUpgradeProgress request. The method will close the
6758// http.Response Body if it receives an error.
6759func (client BaseClient) GetClusterUpgradeProgressSender(req *http.Request) (*http.Response, error) {
6760	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6761}
6762
6763// GetClusterUpgradeProgressResponder handles the response to the GetClusterUpgradeProgress request. The method always
6764// closes the http.Response Body.
6765func (client BaseClient) GetClusterUpgradeProgressResponder(resp *http.Response) (result ClusterUpgradeProgressObject, err error) {
6766	err = autorest.Respond(
6767		resp,
6768		azure.WithErrorUnlessStatusCode(http.StatusOK),
6769		autorest.ByUnmarshallingJSON(&result),
6770		autorest.ByClosing())
6771	result.Response = autorest.Response{Response: resp}
6772	return
6773}
6774
6775// GetComposeDeploymentStatus returns the status of the compose deployment that was created or in the process of being
6776// created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response
6777// includes the name, status, and other details about the deployment.
6778// Parameters:
6779// deploymentName - the identity of the deployment.
6780// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6781// duration that the client is willing to wait for the requested operation to complete. The default value for
6782// this parameter is 60 seconds.
6783func (client BaseClient) GetComposeDeploymentStatus(ctx context.Context, deploymentName string, timeout *int64) (result ComposeDeploymentStatusInfo, err error) {
6784	if tracing.IsEnabled() {
6785		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentStatus")
6786		defer func() {
6787			sc := -1
6788			if result.Response.Response != nil {
6789				sc = result.Response.Response.StatusCode
6790			}
6791			tracing.EndSpan(ctx, sc, err)
6792		}()
6793	}
6794	if err := validation.Validate([]validation.Validation{
6795		{TargetValue: timeout,
6796			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6797				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6798					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6799				}}}}}); err != nil {
6800		return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatus", err.Error())
6801	}
6802
6803	req, err := client.GetComposeDeploymentStatusPreparer(ctx, deploymentName, timeout)
6804	if err != nil {
6805		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", nil, "Failure preparing request")
6806		return
6807	}
6808
6809	resp, err := client.GetComposeDeploymentStatusSender(req)
6810	if err != nil {
6811		result.Response = autorest.Response{Response: resp}
6812		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", resp, "Failure sending request")
6813		return
6814	}
6815
6816	result, err = client.GetComposeDeploymentStatusResponder(resp)
6817	if err != nil {
6818		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", resp, "Failure responding to request")
6819		return
6820	}
6821
6822	return
6823}
6824
6825// GetComposeDeploymentStatusPreparer prepares the GetComposeDeploymentStatus request.
6826func (client BaseClient) GetComposeDeploymentStatusPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) {
6827	pathParameters := map[string]interface{}{
6828		"deploymentName": deploymentName,
6829	}
6830
6831	const APIVersion = "6.0-preview"
6832	queryParameters := map[string]interface{}{
6833		"api-version": APIVersion,
6834	}
6835	if timeout != nil {
6836		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6837	} else {
6838		queryParameters["timeout"] = autorest.Encode("query", 60)
6839	}
6840
6841	preparer := autorest.CreatePreparer(
6842		autorest.AsGet(),
6843		autorest.WithBaseURL(client.BaseURI),
6844		autorest.WithPathParameters("/ComposeDeployments/{deploymentName}", pathParameters),
6845		autorest.WithQueryParameters(queryParameters))
6846	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6847}
6848
6849// GetComposeDeploymentStatusSender sends the GetComposeDeploymentStatus request. The method will close the
6850// http.Response Body if it receives an error.
6851func (client BaseClient) GetComposeDeploymentStatusSender(req *http.Request) (*http.Response, error) {
6852	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6853}
6854
6855// GetComposeDeploymentStatusResponder handles the response to the GetComposeDeploymentStatus request. The method always
6856// closes the http.Response Body.
6857func (client BaseClient) GetComposeDeploymentStatusResponder(resp *http.Response) (result ComposeDeploymentStatusInfo, err error) {
6858	err = autorest.Respond(
6859		resp,
6860		azure.WithErrorUnlessStatusCode(http.StatusOK),
6861		autorest.ByUnmarshallingJSON(&result),
6862		autorest.ByClosing())
6863	result.Response = autorest.Response{Response: resp}
6864	return
6865}
6866
6867// GetComposeDeploymentStatusList gets the status about the compose deployments that were created or in the process of
6868// being created in the Service Fabric cluster. The response includes the name, status, and other details about the
6869// compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a
6870// continuation token, which can be used to get the next page.
6871// Parameters:
6872// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
6873// token with a non-empty value is included in the response of the API when the results from the system do not
6874// fit in a single response. When this value is passed to the next API call, the API returns next set of
6875// results. If there are no further results, then the continuation token does not contain a value. The value of
6876// this parameter should not be URL encoded.
6877// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
6878// defines the upper bound on the number of results returned. The results returned can be less than the
6879// specified maximum results if they do not fit in the message as per the max message size restrictions defined
6880// in the configuration. If this parameter is zero or not specified, the paged query includes as many results
6881// as possible that fit in the return message.
6882// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6883// duration that the client is willing to wait for the requested operation to complete. The default value for
6884// this parameter is 60 seconds.
6885func (client BaseClient) GetComposeDeploymentStatusList(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (result PagedComposeDeploymentStatusInfoList, err error) {
6886	if tracing.IsEnabled() {
6887		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentStatusList")
6888		defer func() {
6889			sc := -1
6890			if result.Response.Response != nil {
6891				sc = result.Response.Response.StatusCode
6892			}
6893			tracing.EndSpan(ctx, sc, err)
6894		}()
6895	}
6896	if err := validation.Validate([]validation.Validation{
6897		{TargetValue: maxResults,
6898			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
6899				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
6900		{TargetValue: timeout,
6901			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6902				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6903					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6904				}}}}}); err != nil {
6905		return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatusList", err.Error())
6906	}
6907
6908	req, err := client.GetComposeDeploymentStatusListPreparer(ctx, continuationToken, maxResults, timeout)
6909	if err != nil {
6910		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", nil, "Failure preparing request")
6911		return
6912	}
6913
6914	resp, err := client.GetComposeDeploymentStatusListSender(req)
6915	if err != nil {
6916		result.Response = autorest.Response{Response: resp}
6917		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", resp, "Failure sending request")
6918		return
6919	}
6920
6921	result, err = client.GetComposeDeploymentStatusListResponder(resp)
6922	if err != nil {
6923		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", resp, "Failure responding to request")
6924		return
6925	}
6926
6927	return
6928}
6929
6930// GetComposeDeploymentStatusListPreparer prepares the GetComposeDeploymentStatusList request.
6931func (client BaseClient) GetComposeDeploymentStatusListPreparer(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
6932	const APIVersion = "6.0-preview"
6933	queryParameters := map[string]interface{}{
6934		"api-version": APIVersion,
6935	}
6936	if len(continuationToken) > 0 {
6937		queryParameters["ContinuationToken"] = continuationToken
6938	}
6939	if maxResults != nil {
6940		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
6941	} else {
6942		queryParameters["MaxResults"] = autorest.Encode("query", 0)
6943	}
6944	if timeout != nil {
6945		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6946	} else {
6947		queryParameters["timeout"] = autorest.Encode("query", 60)
6948	}
6949
6950	preparer := autorest.CreatePreparer(
6951		autorest.AsGet(),
6952		autorest.WithBaseURL(client.BaseURI),
6953		autorest.WithPath("/ComposeDeployments"),
6954		autorest.WithQueryParameters(queryParameters))
6955	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6956}
6957
6958// GetComposeDeploymentStatusListSender sends the GetComposeDeploymentStatusList request. The method will close the
6959// http.Response Body if it receives an error.
6960func (client BaseClient) GetComposeDeploymentStatusListSender(req *http.Request) (*http.Response, error) {
6961	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6962}
6963
6964// GetComposeDeploymentStatusListResponder handles the response to the GetComposeDeploymentStatusList request. The method always
6965// closes the http.Response Body.
6966func (client BaseClient) GetComposeDeploymentStatusListResponder(resp *http.Response) (result PagedComposeDeploymentStatusInfoList, err error) {
6967	err = autorest.Respond(
6968		resp,
6969		azure.WithErrorUnlessStatusCode(http.StatusOK),
6970		autorest.ByUnmarshallingJSON(&result),
6971		autorest.ByClosing())
6972	result.Response = autorest.Response{Response: resp}
6973	return
6974}
6975
6976// GetComposeDeploymentUpgradeProgress returns the information about the state of the compose deployment upgrade along
6977// with details to aid debugging application health issues.
6978// Parameters:
6979// deploymentName - the identity of the deployment.
6980// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6981// duration that the client is willing to wait for the requested operation to complete. The default value for
6982// this parameter is 60 seconds.
6983func (client BaseClient) GetComposeDeploymentUpgradeProgress(ctx context.Context, deploymentName string, timeout *int64) (result ComposeDeploymentUpgradeProgressInfo, err error) {
6984	if tracing.IsEnabled() {
6985		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentUpgradeProgress")
6986		defer func() {
6987			sc := -1
6988			if result.Response.Response != nil {
6989				sc = result.Response.Response.StatusCode
6990			}
6991			tracing.EndSpan(ctx, sc, err)
6992		}()
6993	}
6994	if err := validation.Validate([]validation.Validation{
6995		{TargetValue: timeout,
6996			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6997				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6998					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6999				}}}}}); err != nil {
7000		return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", err.Error())
7001	}
7002
7003	req, err := client.GetComposeDeploymentUpgradeProgressPreparer(ctx, deploymentName, timeout)
7004	if err != nil {
7005		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", nil, "Failure preparing request")
7006		return
7007	}
7008
7009	resp, err := client.GetComposeDeploymentUpgradeProgressSender(req)
7010	if err != nil {
7011		result.Response = autorest.Response{Response: resp}
7012		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", resp, "Failure sending request")
7013		return
7014	}
7015
7016	result, err = client.GetComposeDeploymentUpgradeProgressResponder(resp)
7017	if err != nil {
7018		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", resp, "Failure responding to request")
7019		return
7020	}
7021
7022	return
7023}
7024
7025// GetComposeDeploymentUpgradeProgressPreparer prepares the GetComposeDeploymentUpgradeProgress request.
7026func (client BaseClient) GetComposeDeploymentUpgradeProgressPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) {
7027	pathParameters := map[string]interface{}{
7028		"deploymentName": deploymentName,
7029	}
7030
7031	const APIVersion = "6.0-preview"
7032	queryParameters := map[string]interface{}{
7033		"api-version": APIVersion,
7034	}
7035	if timeout != nil {
7036		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7037	} else {
7038		queryParameters["timeout"] = autorest.Encode("query", 60)
7039	}
7040
7041	preparer := autorest.CreatePreparer(
7042		autorest.AsGet(),
7043		autorest.WithBaseURL(client.BaseURI),
7044		autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/GetUpgradeProgress", pathParameters),
7045		autorest.WithQueryParameters(queryParameters))
7046	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7047}
7048
7049// GetComposeDeploymentUpgradeProgressSender sends the GetComposeDeploymentUpgradeProgress request. The method will close the
7050// http.Response Body if it receives an error.
7051func (client BaseClient) GetComposeDeploymentUpgradeProgressSender(req *http.Request) (*http.Response, error) {
7052	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7053}
7054
7055// GetComposeDeploymentUpgradeProgressResponder handles the response to the GetComposeDeploymentUpgradeProgress request. The method always
7056// closes the http.Response Body.
7057func (client BaseClient) GetComposeDeploymentUpgradeProgressResponder(resp *http.Response) (result ComposeDeploymentUpgradeProgressInfo, err error) {
7058	err = autorest.Respond(
7059		resp,
7060		azure.WithErrorUnlessStatusCode(http.StatusOK),
7061		autorest.ByUnmarshallingJSON(&result),
7062		autorest.ByClosing())
7063	result.Response = autorest.Response{Response: resp}
7064	return
7065}
7066
7067// GetContainerLogsDeployedOnNode gets the container logs for container deployed on a Service Fabric node for the given
7068// code package.
7069// Parameters:
7070// nodeName - the name of the node.
7071// applicationID - the identity of the application. This is typically the full name of the application without
7072// the 'fabric:' URI scheme.
7073// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7074// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7075// in 6.0+ and "myapp/app1" in previous versions.
7076// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
7077// Fabric cluster.
7078// codePackageName - the name of code package specified in service manifest registered as part of an
7079// application type in a Service Fabric cluster.
7080// tail - number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs.
7081// previous - specifies whether to get container logs from exited/dead containers of the code package instance.
7082// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7083// duration that the client is willing to wait for the requested operation to complete. The default value for
7084// this parameter is 60 seconds.
7085func (client BaseClient) GetContainerLogsDeployedOnNode(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, tail string, previous *bool, timeout *int64) (result ContainerLogs, err error) {
7086	if tracing.IsEnabled() {
7087		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetContainerLogsDeployedOnNode")
7088		defer func() {
7089			sc := -1
7090			if result.Response.Response != nil {
7091				sc = result.Response.Response.StatusCode
7092			}
7093			tracing.EndSpan(ctx, sc, err)
7094		}()
7095	}
7096	if err := validation.Validate([]validation.Validation{
7097		{TargetValue: timeout,
7098			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7099				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7100					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7101				}}}}}); err != nil {
7102		return result, validation.NewError("servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", err.Error())
7103	}
7104
7105	req, err := client.GetContainerLogsDeployedOnNodePreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, tail, previous, timeout)
7106	if err != nil {
7107		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", nil, "Failure preparing request")
7108		return
7109	}
7110
7111	resp, err := client.GetContainerLogsDeployedOnNodeSender(req)
7112	if err != nil {
7113		result.Response = autorest.Response{Response: resp}
7114		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", resp, "Failure sending request")
7115		return
7116	}
7117
7118	result, err = client.GetContainerLogsDeployedOnNodeResponder(resp)
7119	if err != nil {
7120		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", resp, "Failure responding to request")
7121		return
7122	}
7123
7124	return
7125}
7126
7127// GetContainerLogsDeployedOnNodePreparer prepares the GetContainerLogsDeployedOnNode request.
7128func (client BaseClient) GetContainerLogsDeployedOnNodePreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, tail string, previous *bool, timeout *int64) (*http.Request, error) {
7129	pathParameters := map[string]interface{}{
7130		"applicationId": applicationID,
7131		"nodeName":      autorest.Encode("path", nodeName),
7132	}
7133
7134	const APIVersion = "6.2"
7135	queryParameters := map[string]interface{}{
7136		"api-version":         APIVersion,
7137		"CodePackageName":     autorest.Encode("query", codePackageName),
7138		"ServiceManifestName": autorest.Encode("query", serviceManifestName),
7139	}
7140	if len(tail) > 0 {
7141		queryParameters["Tail"] = autorest.Encode("query", tail)
7142	}
7143	if previous != nil {
7144		queryParameters["Previous"] = autorest.Encode("query", *previous)
7145	} else {
7146		queryParameters["Previous"] = autorest.Encode("query", false)
7147	}
7148	if timeout != nil {
7149		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7150	} else {
7151		queryParameters["timeout"] = autorest.Encode("query", 60)
7152	}
7153
7154	preparer := autorest.CreatePreparer(
7155		autorest.AsGet(),
7156		autorest.WithBaseURL(client.BaseURI),
7157		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerLogs", pathParameters),
7158		autorest.WithQueryParameters(queryParameters))
7159	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7160}
7161
7162// GetContainerLogsDeployedOnNodeSender sends the GetContainerLogsDeployedOnNode request. The method will close the
7163// http.Response Body if it receives an error.
7164func (client BaseClient) GetContainerLogsDeployedOnNodeSender(req *http.Request) (*http.Response, error) {
7165	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7166}
7167
7168// GetContainerLogsDeployedOnNodeResponder handles the response to the GetContainerLogsDeployedOnNode request. The method always
7169// closes the http.Response Body.
7170func (client BaseClient) GetContainerLogsDeployedOnNodeResponder(resp *http.Response) (result ContainerLogs, err error) {
7171	err = autorest.Respond(
7172		resp,
7173		azure.WithErrorUnlessStatusCode(http.StatusOK),
7174		autorest.ByUnmarshallingJSON(&result),
7175		autorest.ByClosing())
7176	result.Response = autorest.Response{Response: resp}
7177	return
7178}
7179
7180// GetContainersEventList the response is list of ContainerInstanceEvent objects.
7181// Parameters:
7182// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
7183// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
7184// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7185// duration that the client is willing to wait for the requested operation to complete. The default value for
7186// this parameter is 60 seconds.
7187// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
7188// be included in the response.
7189// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
7190// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
7191// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
7192// populated.
7193func (client BaseClient) GetContainersEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListContainerInstanceEvent, err error) {
7194	if tracing.IsEnabled() {
7195		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetContainersEventList")
7196		defer func() {
7197			sc := -1
7198			if result.Response.Response != nil {
7199				sc = result.Response.Response.StatusCode
7200			}
7201			tracing.EndSpan(ctx, sc, err)
7202		}()
7203	}
7204	if err := validation.Validate([]validation.Validation{
7205		{TargetValue: timeout,
7206			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7207				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7208					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7209				}}}}}); err != nil {
7210		return result, validation.NewError("servicefabric.BaseClient", "GetContainersEventList", err.Error())
7211	}
7212
7213	req, err := client.GetContainersEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
7214	if err != nil {
7215		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", nil, "Failure preparing request")
7216		return
7217	}
7218
7219	resp, err := client.GetContainersEventListSender(req)
7220	if err != nil {
7221		result.Response = autorest.Response{Response: resp}
7222		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", resp, "Failure sending request")
7223		return
7224	}
7225
7226	result, err = client.GetContainersEventListResponder(resp)
7227	if err != nil {
7228		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", resp, "Failure responding to request")
7229		return
7230	}
7231
7232	return
7233}
7234
7235// GetContainersEventListPreparer prepares the GetContainersEventList request.
7236func (client BaseClient) GetContainersEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
7237	const APIVersion = "6.2-preview"
7238	queryParameters := map[string]interface{}{
7239		"api-version":  APIVersion,
7240		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
7241		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
7242	}
7243	if timeout != nil {
7244		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7245	} else {
7246		queryParameters["timeout"] = autorest.Encode("query", 60)
7247	}
7248	if len(eventsTypesFilter) > 0 {
7249		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
7250	}
7251	if excludeAnalysisEvents != nil {
7252		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
7253	}
7254	if skipCorrelationLookup != nil {
7255		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
7256	}
7257
7258	preparer := autorest.CreatePreparer(
7259		autorest.AsGet(),
7260		autorest.WithBaseURL(client.BaseURI),
7261		autorest.WithPath("/EventsStore/Containers/Events"),
7262		autorest.WithQueryParameters(queryParameters))
7263	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7264}
7265
7266// GetContainersEventListSender sends the GetContainersEventList request. The method will close the
7267// http.Response Body if it receives an error.
7268func (client BaseClient) GetContainersEventListSender(req *http.Request) (*http.Response, error) {
7269	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7270}
7271
7272// GetContainersEventListResponder handles the response to the GetContainersEventList request. The method always
7273// closes the http.Response Body.
7274func (client BaseClient) GetContainersEventListResponder(resp *http.Response) (result ListContainerInstanceEvent, err error) {
7275	err = autorest.Respond(
7276		resp,
7277		azure.WithErrorUnlessStatusCode(http.StatusOK),
7278		autorest.ByUnmarshallingJSON(&result.Value),
7279		autorest.ByClosing())
7280	result.Response = autorest.Response{Response: resp}
7281	return
7282}
7283
7284// GetCorrelatedEventList the response is list of FabricEvents.
7285// Parameters:
7286// eventInstanceID - the EventInstanceId.
7287// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7288// duration that the client is willing to wait for the requested operation to complete. The default value for
7289// this parameter is 60 seconds.
7290func (client BaseClient) GetCorrelatedEventList(ctx context.Context, eventInstanceID string, timeout *int64) (result ListFabricEvent, err error) {
7291	if tracing.IsEnabled() {
7292		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCorrelatedEventList")
7293		defer func() {
7294			sc := -1
7295			if result.Response.Response != nil {
7296				sc = result.Response.Response.StatusCode
7297			}
7298			tracing.EndSpan(ctx, sc, err)
7299		}()
7300	}
7301	if err := validation.Validate([]validation.Validation{
7302		{TargetValue: timeout,
7303			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7304				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7305					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7306				}}}}}); err != nil {
7307		return result, validation.NewError("servicefabric.BaseClient", "GetCorrelatedEventList", err.Error())
7308	}
7309
7310	req, err := client.GetCorrelatedEventListPreparer(ctx, eventInstanceID, timeout)
7311	if err != nil {
7312		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", nil, "Failure preparing request")
7313		return
7314	}
7315
7316	resp, err := client.GetCorrelatedEventListSender(req)
7317	if err != nil {
7318		result.Response = autorest.Response{Response: resp}
7319		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", resp, "Failure sending request")
7320		return
7321	}
7322
7323	result, err = client.GetCorrelatedEventListResponder(resp)
7324	if err != nil {
7325		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", resp, "Failure responding to request")
7326		return
7327	}
7328
7329	return
7330}
7331
7332// GetCorrelatedEventListPreparer prepares the GetCorrelatedEventList request.
7333func (client BaseClient) GetCorrelatedEventListPreparer(ctx context.Context, eventInstanceID string, timeout *int64) (*http.Request, error) {
7334	pathParameters := map[string]interface{}{
7335		"eventInstanceId": autorest.Encode("path", eventInstanceID),
7336	}
7337
7338	const APIVersion = "6.2-preview"
7339	queryParameters := map[string]interface{}{
7340		"api-version": APIVersion,
7341	}
7342	if timeout != nil {
7343		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7344	} else {
7345		queryParameters["timeout"] = autorest.Encode("query", 60)
7346	}
7347
7348	preparer := autorest.CreatePreparer(
7349		autorest.AsGet(),
7350		autorest.WithBaseURL(client.BaseURI),
7351		autorest.WithPathParameters("/EventsStore/CorrelatedEvents/{eventInstanceId}/$/Events", pathParameters),
7352		autorest.WithQueryParameters(queryParameters))
7353	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7354}
7355
7356// GetCorrelatedEventListSender sends the GetCorrelatedEventList request. The method will close the
7357// http.Response Body if it receives an error.
7358func (client BaseClient) GetCorrelatedEventListSender(req *http.Request) (*http.Response, error) {
7359	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7360}
7361
7362// GetCorrelatedEventListResponder handles the response to the GetCorrelatedEventList request. The method always
7363// closes the http.Response Body.
7364func (client BaseClient) GetCorrelatedEventListResponder(resp *http.Response) (result ListFabricEvent, err error) {
7365	err = autorest.Respond(
7366		resp,
7367		azure.WithErrorUnlessStatusCode(http.StatusOK),
7368		autorest.ByUnmarshallingJSON(&result),
7369		autorest.ByClosing())
7370	result.Response = autorest.Response{Response: resp}
7371	return
7372}
7373
7374// GetDataLossProgress gets the progress of a data loss operation started with StartDataLoss, using the OperationId.
7375// Parameters:
7376// serviceID - the identity of the service. This ID is typically the full name of the service without the
7377// 'fabric:' URI scheme.
7378// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7379// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
7380// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
7381// partitionID - the identity of the partition.
7382// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
7383// API
7384// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7385// duration that the client is willing to wait for the requested operation to complete. The default value for
7386// this parameter is 60 seconds.
7387func (client BaseClient) GetDataLossProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionDataLossProgress, err error) {
7388	if tracing.IsEnabled() {
7389		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDataLossProgress")
7390		defer func() {
7391			sc := -1
7392			if result.Response.Response != nil {
7393				sc = result.Response.Response.StatusCode
7394			}
7395			tracing.EndSpan(ctx, sc, err)
7396		}()
7397	}
7398	if err := validation.Validate([]validation.Validation{
7399		{TargetValue: timeout,
7400			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7401				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7402					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7403				}}}}}); err != nil {
7404		return result, validation.NewError("servicefabric.BaseClient", "GetDataLossProgress", err.Error())
7405	}
7406
7407	req, err := client.GetDataLossProgressPreparer(ctx, serviceID, partitionID, operationID, timeout)
7408	if err != nil {
7409		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", nil, "Failure preparing request")
7410		return
7411	}
7412
7413	resp, err := client.GetDataLossProgressSender(req)
7414	if err != nil {
7415		result.Response = autorest.Response{Response: resp}
7416		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", resp, "Failure sending request")
7417		return
7418	}
7419
7420	result, err = client.GetDataLossProgressResponder(resp)
7421	if err != nil {
7422		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", resp, "Failure responding to request")
7423		return
7424	}
7425
7426	return
7427}
7428
7429// GetDataLossProgressPreparer prepares the GetDataLossProgress request.
7430func (client BaseClient) GetDataLossProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) {
7431	pathParameters := map[string]interface{}{
7432		"partitionId": partitionID,
7433		"serviceId":   serviceID,
7434	}
7435
7436	const APIVersion = "6.0"
7437	queryParameters := map[string]interface{}{
7438		"api-version": APIVersion,
7439		"OperationId": autorest.Encode("query", operationID),
7440	}
7441	if timeout != nil {
7442		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7443	} else {
7444		queryParameters["timeout"] = autorest.Encode("query", 60)
7445	}
7446
7447	preparer := autorest.CreatePreparer(
7448		autorest.AsGet(),
7449		autorest.WithBaseURL(client.BaseURI),
7450		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetDataLossProgress", pathParameters),
7451		autorest.WithQueryParameters(queryParameters))
7452	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7453}
7454
7455// GetDataLossProgressSender sends the GetDataLossProgress request. The method will close the
7456// http.Response Body if it receives an error.
7457func (client BaseClient) GetDataLossProgressSender(req *http.Request) (*http.Response, error) {
7458	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7459}
7460
7461// GetDataLossProgressResponder handles the response to the GetDataLossProgress request. The method always
7462// closes the http.Response Body.
7463func (client BaseClient) GetDataLossProgressResponder(resp *http.Response) (result PartitionDataLossProgress, err error) {
7464	err = autorest.Respond(
7465		resp,
7466		azure.WithErrorUnlessStatusCode(http.StatusOK),
7467		autorest.ByUnmarshallingJSON(&result),
7468		autorest.ByClosing())
7469	result.Response = autorest.Response{Response: resp}
7470	return
7471}
7472
7473// GetDeployedApplicationHealth gets the information about health of an application deployed on a Service Fabric node.
7474// Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed
7475// application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for
7476// DeployedServicePackageHealth children based on health state.
7477// Parameters:
7478// nodeName - the name of the node.
7479// applicationID - the identity of the application. This is typically the full name of the application without
7480// the 'fabric:' URI scheme.
7481// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7482// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7483// in 6.0+ and "myapp/app1" in previous versions.
7484// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
7485// state.
7486// The possible values for this parameter include integer value of one of the following health states.
7487// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
7488// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
7489// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
7490// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
7491//
7492// - Default - Default value. Matches any HealthState. The value is zero.
7493// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7494// collection of states. The value is 1.
7495// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7496// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7497// - Error - Filter that matches input with HealthState value Error. The value is 8.
7498// - All - Filter that matches input with any HealthState value. The value is 65535.
7499// deployedServicePackagesHealthStateFilter - allows filtering of the deployed service package health state
7500// objects returned in the result of deployed application health query based on their health state.
7501// The possible values for this parameter include integer value of one of the following health states.
7502// Only deployed service packages that match the filter are returned. All deployed service packages are used to
7503// evaluate the aggregated health state of the deployed application.
7504// If not specified, all entries are returned.
7505// The state values are flag-based enumeration, so the value can be a combination of these values, obtained
7506// using the bitwise 'OR' operator.
7507// For example, if the provided value is 6 then health state of service packages with HealthState value of OK
7508// (2) and Warning (4) are returned.
7509//
7510// - Default - Default value. Matches any HealthState. The value is zero.
7511// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7512// collection of states. The value is 1.
7513// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7514// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7515// - Error - Filter that matches input with HealthState value Error. The value is 8.
7516// - All - Filter that matches input with any HealthState value. The value is 65535.
7517// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
7518// result. False by default.
7519// The statistics show the number of children entities in health state Ok, Warning, and Error.
7520// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7521// duration that the client is willing to wait for the requested operation to complete. The default value for
7522// this parameter is 60 seconds.
7523func (client BaseClient) GetDeployedApplicationHealth(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result DeployedApplicationHealth, err error) {
7524	if tracing.IsEnabled() {
7525		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationHealth")
7526		defer func() {
7527			sc := -1
7528			if result.Response.Response != nil {
7529				sc = result.Response.Response.StatusCode
7530			}
7531			tracing.EndSpan(ctx, sc, err)
7532		}()
7533	}
7534	if err := validation.Validate([]validation.Validation{
7535		{TargetValue: timeout,
7536			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7537				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7538					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7539				}}}}}); err != nil {
7540		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealth", err.Error())
7541	}
7542
7543	req, err := client.GetDeployedApplicationHealthPreparer(ctx, nodeName, applicationID, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, excludeHealthStatistics, timeout)
7544	if err != nil {
7545		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", nil, "Failure preparing request")
7546		return
7547	}
7548
7549	resp, err := client.GetDeployedApplicationHealthSender(req)
7550	if err != nil {
7551		result.Response = autorest.Response{Response: resp}
7552		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", resp, "Failure sending request")
7553		return
7554	}
7555
7556	result, err = client.GetDeployedApplicationHealthResponder(resp)
7557	if err != nil {
7558		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", resp, "Failure responding to request")
7559		return
7560	}
7561
7562	return
7563}
7564
7565// GetDeployedApplicationHealthPreparer prepares the GetDeployedApplicationHealth request.
7566func (client BaseClient) GetDeployedApplicationHealthPreparer(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
7567	pathParameters := map[string]interface{}{
7568		"applicationId": applicationID,
7569		"nodeName":      autorest.Encode("path", nodeName),
7570	}
7571
7572	const APIVersion = "6.0"
7573	queryParameters := map[string]interface{}{
7574		"api-version": APIVersion,
7575	}
7576	if eventsHealthStateFilter != nil {
7577		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
7578	} else {
7579		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
7580	}
7581	if deployedServicePackagesHealthStateFilter != nil {
7582		queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", *deployedServicePackagesHealthStateFilter)
7583	} else {
7584		queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", 0)
7585	}
7586	if excludeHealthStatistics != nil {
7587		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
7588	} else {
7589		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
7590	}
7591	if timeout != nil {
7592		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7593	} else {
7594		queryParameters["timeout"] = autorest.Encode("query", 60)
7595	}
7596
7597	preparer := autorest.CreatePreparer(
7598		autorest.AsGet(),
7599		autorest.WithBaseURL(client.BaseURI),
7600		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetHealth", pathParameters),
7601		autorest.WithQueryParameters(queryParameters))
7602	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7603}
7604
7605// GetDeployedApplicationHealthSender sends the GetDeployedApplicationHealth request. The method will close the
7606// http.Response Body if it receives an error.
7607func (client BaseClient) GetDeployedApplicationHealthSender(req *http.Request) (*http.Response, error) {
7608	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7609}
7610
7611// GetDeployedApplicationHealthResponder handles the response to the GetDeployedApplicationHealth request. The method always
7612// closes the http.Response Body.
7613func (client BaseClient) GetDeployedApplicationHealthResponder(resp *http.Response) (result DeployedApplicationHealth, err error) {
7614	err = autorest.Respond(
7615		resp,
7616		azure.WithErrorUnlessStatusCode(http.StatusOK),
7617		autorest.ByUnmarshallingJSON(&result),
7618		autorest.ByClosing())
7619	result.Response = autorest.Response{Response: resp}
7620	return
7621}
7622
7623// GetDeployedApplicationHealthUsingPolicy gets the information about health of an application deployed on a Service
7624// Fabric node using the specified policy. Use EventsHealthStateFilter to optionally filter for the collection of
7625// HealthEvent objects reported on the deployed application based on health state. Use
7626// DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on
7627// health state. Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health.
7628// This API only uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored
7629// while evaluating the health of the deployed application.
7630// Parameters:
7631// nodeName - the name of the node.
7632// applicationID - the identity of the application. This is typically the full name of the application without
7633// the 'fabric:' URI scheme.
7634// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7635// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7636// in 6.0+ and "myapp/app1" in previous versions.
7637// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
7638// state.
7639// The possible values for this parameter include integer value of one of the following health states.
7640// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
7641// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
7642// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
7643// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
7644//
7645// - Default - Default value. Matches any HealthState. The value is zero.
7646// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7647// collection of states. The value is 1.
7648// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7649// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7650// - Error - Filter that matches input with HealthState value Error. The value is 8.
7651// - All - Filter that matches input with any HealthState value. The value is 65535.
7652// deployedServicePackagesHealthStateFilter - allows filtering of the deployed service package health state
7653// objects returned in the result of deployed application health query based on their health state.
7654// The possible values for this parameter include integer value of one of the following health states.
7655// Only deployed service packages that match the filter are returned. All deployed service packages are used to
7656// evaluate the aggregated health state of the deployed application.
7657// If not specified, all entries are returned.
7658// The state values are flag-based enumeration, so the value can be a combination of these values, obtained
7659// using the bitwise 'OR' operator.
7660// For example, if the provided value is 6 then health state of service packages with HealthState value of OK
7661// (2) and Warning (4) are returned.
7662//
7663// - Default - Default value. Matches any HealthState. The value is zero.
7664// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7665// collection of states. The value is 1.
7666// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7667// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7668// - Error - Filter that matches input with HealthState value Error. The value is 8.
7669// - All - Filter that matches input with any HealthState value. The value is 65535.
7670// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
7671// of its children.
7672// If not present, the health evaluation uses the health policy from application manifest or the default health
7673// policy.
7674// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
7675// result. False by default.
7676// The statistics show the number of children entities in health state Ok, Warning, and Error.
7677// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7678// duration that the client is willing to wait for the requested operation to complete. The default value for
7679// this parameter is 60 seconds.
7680func (client BaseClient) GetDeployedApplicationHealthUsingPolicy(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result DeployedApplicationHealth, err error) {
7681	if tracing.IsEnabled() {
7682		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationHealthUsingPolicy")
7683		defer func() {
7684			sc := -1
7685			if result.Response.Response != nil {
7686				sc = result.Response.Response.StatusCode
7687			}
7688			tracing.EndSpan(ctx, sc, err)
7689		}()
7690	}
7691	if err := validation.Validate([]validation.Validation{
7692		{TargetValue: timeout,
7693			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7694				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7695					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7696				}}}}}); err != nil {
7697		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", err.Error())
7698	}
7699
7700	req, err := client.GetDeployedApplicationHealthUsingPolicyPreparer(ctx, nodeName, applicationID, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout)
7701	if err != nil {
7702		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", nil, "Failure preparing request")
7703		return
7704	}
7705
7706	resp, err := client.GetDeployedApplicationHealthUsingPolicySender(req)
7707	if err != nil {
7708		result.Response = autorest.Response{Response: resp}
7709		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", resp, "Failure sending request")
7710		return
7711	}
7712
7713	result, err = client.GetDeployedApplicationHealthUsingPolicyResponder(resp)
7714	if err != nil {
7715		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", resp, "Failure responding to request")
7716		return
7717	}
7718
7719	return
7720}
7721
7722// GetDeployedApplicationHealthUsingPolicyPreparer prepares the GetDeployedApplicationHealthUsingPolicy request.
7723func (client BaseClient) GetDeployedApplicationHealthUsingPolicyPreparer(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
7724	pathParameters := map[string]interface{}{
7725		"applicationId": applicationID,
7726		"nodeName":      autorest.Encode("path", nodeName),
7727	}
7728
7729	const APIVersion = "6.0"
7730	queryParameters := map[string]interface{}{
7731		"api-version": APIVersion,
7732	}
7733	if eventsHealthStateFilter != nil {
7734		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
7735	} else {
7736		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
7737	}
7738	if deployedServicePackagesHealthStateFilter != nil {
7739		queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", *deployedServicePackagesHealthStateFilter)
7740	} else {
7741		queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", 0)
7742	}
7743	if excludeHealthStatistics != nil {
7744		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
7745	} else {
7746		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
7747	}
7748	if timeout != nil {
7749		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7750	} else {
7751		queryParameters["timeout"] = autorest.Encode("query", 60)
7752	}
7753
7754	preparer := autorest.CreatePreparer(
7755		autorest.AsContentType("application/json; charset=utf-8"),
7756		autorest.AsPost(),
7757		autorest.WithBaseURL(client.BaseURI),
7758		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetHealth", pathParameters),
7759		autorest.WithQueryParameters(queryParameters))
7760	if applicationHealthPolicy != nil {
7761		preparer = autorest.DecoratePreparer(preparer,
7762			autorest.WithJSON(applicationHealthPolicy))
7763	}
7764	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7765}
7766
7767// GetDeployedApplicationHealthUsingPolicySender sends the GetDeployedApplicationHealthUsingPolicy request. The method will close the
7768// http.Response Body if it receives an error.
7769func (client BaseClient) GetDeployedApplicationHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
7770	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7771}
7772
7773// GetDeployedApplicationHealthUsingPolicyResponder handles the response to the GetDeployedApplicationHealthUsingPolicy request. The method always
7774// closes the http.Response Body.
7775func (client BaseClient) GetDeployedApplicationHealthUsingPolicyResponder(resp *http.Response) (result DeployedApplicationHealth, err error) {
7776	err = autorest.Respond(
7777		resp,
7778		azure.WithErrorUnlessStatusCode(http.StatusOK),
7779		autorest.ByUnmarshallingJSON(&result),
7780		autorest.ByClosing())
7781	result.Response = autorest.Response{Response: resp}
7782	return
7783}
7784
7785// GetDeployedApplicationInfo this query returns system application information if the application ID provided is for
7786// system application. Results encompass deployed applications in active, activating, and downloading states. This
7787// query requires that the node name corresponds to a node on the cluster. The query fails if the provided node name
7788// does not point to any active Service Fabric nodes on the cluster.
7789// Parameters:
7790// nodeName - the name of the node.
7791// applicationID - the identity of the application. This is typically the full name of the application without
7792// the 'fabric:' URI scheme.
7793// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7794// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7795// in 6.0+ and "myapp/app1" in previous versions.
7796// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7797// duration that the client is willing to wait for the requested operation to complete. The default value for
7798// this parameter is 60 seconds.
7799// includeHealthState - include the health state of an entity.
7800// If this parameter is false or not specified, then the health state returned is "Unknown".
7801// When set to true, the query goes in parallel to the node and the health system service before the results
7802// are merged.
7803// As a result, the query is more expensive and may take a longer time.
7804func (client BaseClient) GetDeployedApplicationInfo(ctx context.Context, nodeName string, applicationID string, timeout *int64, includeHealthState *bool) (result DeployedApplicationInfo, err error) {
7805	if tracing.IsEnabled() {
7806		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationInfo")
7807		defer func() {
7808			sc := -1
7809			if result.Response.Response != nil {
7810				sc = result.Response.Response.StatusCode
7811			}
7812			tracing.EndSpan(ctx, sc, err)
7813		}()
7814	}
7815	if err := validation.Validate([]validation.Validation{
7816		{TargetValue: timeout,
7817			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7818				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7819					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7820				}}}}}); err != nil {
7821		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfo", err.Error())
7822	}
7823
7824	req, err := client.GetDeployedApplicationInfoPreparer(ctx, nodeName, applicationID, timeout, includeHealthState)
7825	if err != nil {
7826		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", nil, "Failure preparing request")
7827		return
7828	}
7829
7830	resp, err := client.GetDeployedApplicationInfoSender(req)
7831	if err != nil {
7832		result.Response = autorest.Response{Response: resp}
7833		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", resp, "Failure sending request")
7834		return
7835	}
7836
7837	result, err = client.GetDeployedApplicationInfoResponder(resp)
7838	if err != nil {
7839		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", resp, "Failure responding to request")
7840		return
7841	}
7842
7843	return
7844}
7845
7846// GetDeployedApplicationInfoPreparer prepares the GetDeployedApplicationInfo request.
7847func (client BaseClient) GetDeployedApplicationInfoPreparer(ctx context.Context, nodeName string, applicationID string, timeout *int64, includeHealthState *bool) (*http.Request, error) {
7848	pathParameters := map[string]interface{}{
7849		"applicationId": applicationID,
7850		"nodeName":      autorest.Encode("path", nodeName),
7851	}
7852
7853	const APIVersion = "6.1"
7854	queryParameters := map[string]interface{}{
7855		"api-version": APIVersion,
7856	}
7857	if timeout != nil {
7858		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7859	} else {
7860		queryParameters["timeout"] = autorest.Encode("query", 60)
7861	}
7862	if includeHealthState != nil {
7863		queryParameters["IncludeHealthState"] = autorest.Encode("query", *includeHealthState)
7864	} else {
7865		queryParameters["IncludeHealthState"] = autorest.Encode("query", false)
7866	}
7867
7868	preparer := autorest.CreatePreparer(
7869		autorest.AsGet(),
7870		autorest.WithBaseURL(client.BaseURI),
7871		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}", pathParameters),
7872		autorest.WithQueryParameters(queryParameters))
7873	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7874}
7875
7876// GetDeployedApplicationInfoSender sends the GetDeployedApplicationInfo request. The method will close the
7877// http.Response Body if it receives an error.
7878func (client BaseClient) GetDeployedApplicationInfoSender(req *http.Request) (*http.Response, error) {
7879	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7880}
7881
7882// GetDeployedApplicationInfoResponder handles the response to the GetDeployedApplicationInfo request. The method always
7883// closes the http.Response Body.
7884func (client BaseClient) GetDeployedApplicationInfoResponder(resp *http.Response) (result DeployedApplicationInfo, err error) {
7885	err = autorest.Respond(
7886		resp,
7887		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
7888		autorest.ByUnmarshallingJSON(&result),
7889		autorest.ByClosing())
7890	result.Response = autorest.Response{Response: resp}
7891	return
7892}
7893
7894// GetDeployedApplicationInfoList gets the list of applications deployed on a Service Fabric node. The results do not
7895// include information about deployed system applications unless explicitly queried for by ID. Results encompass
7896// deployed applications in active, activating, and downloading states. This query requires that the node name
7897// corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service
7898// Fabric nodes on the cluster.
7899// Parameters:
7900// nodeName - the name of the node.
7901// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7902// duration that the client is willing to wait for the requested operation to complete. The default value for
7903// this parameter is 60 seconds.
7904// includeHealthState - include the health state of an entity.
7905// If this parameter is false or not specified, then the health state returned is "Unknown".
7906// When set to true, the query goes in parallel to the node and the health system service before the results
7907// are merged.
7908// As a result, the query is more expensive and may take a longer time.
7909// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
7910// token with a non-empty value is included in the response of the API when the results from the system do not
7911// fit in a single response. When this value is passed to the next API call, the API returns next set of
7912// results. If there are no further results, then the continuation token does not contain a value. The value of
7913// this parameter should not be URL encoded.
7914// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
7915// defines the upper bound on the number of results returned. The results returned can be less than the
7916// specified maximum results if they do not fit in the message as per the max message size restrictions defined
7917// in the configuration. If this parameter is zero or not specified, the paged query includes as many results
7918// as possible that fit in the return message.
7919func (client BaseClient) GetDeployedApplicationInfoList(ctx context.Context, nodeName string, timeout *int64, includeHealthState *bool, continuationToken string, maxResults *int64) (result PagedDeployedApplicationInfoList, err error) {
7920	if tracing.IsEnabled() {
7921		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationInfoList")
7922		defer func() {
7923			sc := -1
7924			if result.Response.Response != nil {
7925				sc = result.Response.Response.StatusCode
7926			}
7927			tracing.EndSpan(ctx, sc, err)
7928		}()
7929	}
7930	if err := validation.Validate([]validation.Validation{
7931		{TargetValue: timeout,
7932			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7933				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7934					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7935				}}}},
7936		{TargetValue: maxResults,
7937			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
7938				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil {
7939		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfoList", err.Error())
7940	}
7941
7942	req, err := client.GetDeployedApplicationInfoListPreparer(ctx, nodeName, timeout, includeHealthState, continuationToken, maxResults)
7943	if err != nil {
7944		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", nil, "Failure preparing request")
7945		return
7946	}
7947
7948	resp, err := client.GetDeployedApplicationInfoListSender(req)
7949	if err != nil {
7950		result.Response = autorest.Response{Response: resp}
7951		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", resp, "Failure sending request")
7952		return
7953	}
7954
7955	result, err = client.GetDeployedApplicationInfoListResponder(resp)
7956	if err != nil {
7957		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", resp, "Failure responding to request")
7958		return
7959	}
7960
7961	return
7962}
7963
7964// GetDeployedApplicationInfoListPreparer prepares the GetDeployedApplicationInfoList request.
7965func (client BaseClient) GetDeployedApplicationInfoListPreparer(ctx context.Context, nodeName string, timeout *int64, includeHealthState *bool, continuationToken string, maxResults *int64) (*http.Request, error) {
7966	pathParameters := map[string]interface{}{
7967		"nodeName": autorest.Encode("path", nodeName),
7968	}
7969
7970	const APIVersion = "6.1"
7971	queryParameters := map[string]interface{}{
7972		"api-version": APIVersion,
7973	}
7974	if timeout != nil {
7975		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7976	} else {
7977		queryParameters["timeout"] = autorest.Encode("query", 60)
7978	}
7979	if includeHealthState != nil {
7980		queryParameters["IncludeHealthState"] = autorest.Encode("query", *includeHealthState)
7981	} else {
7982		queryParameters["IncludeHealthState"] = autorest.Encode("query", false)
7983	}
7984	if len(continuationToken) > 0 {
7985		queryParameters["ContinuationToken"] = continuationToken
7986	}
7987	if maxResults != nil {
7988		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
7989	} else {
7990		queryParameters["MaxResults"] = autorest.Encode("query", 0)
7991	}
7992
7993	preparer := autorest.CreatePreparer(
7994		autorest.AsGet(),
7995		autorest.WithBaseURL(client.BaseURI),
7996		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications", pathParameters),
7997		autorest.WithQueryParameters(queryParameters))
7998	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7999}
8000
8001// GetDeployedApplicationInfoListSender sends the GetDeployedApplicationInfoList request. The method will close the
8002// http.Response Body if it receives an error.
8003func (client BaseClient) GetDeployedApplicationInfoListSender(req *http.Request) (*http.Response, error) {
8004	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8005}
8006
8007// GetDeployedApplicationInfoListResponder handles the response to the GetDeployedApplicationInfoList request. The method always
8008// closes the http.Response Body.
8009func (client BaseClient) GetDeployedApplicationInfoListResponder(resp *http.Response) (result PagedDeployedApplicationInfoList, err error) {
8010	err = autorest.Respond(
8011		resp,
8012		azure.WithErrorUnlessStatusCode(http.StatusOK),
8013		autorest.ByUnmarshallingJSON(&result),
8014		autorest.ByClosing())
8015	result.Response = autorest.Response{Response: resp}
8016	return
8017}
8018
8019// GetDeployedCodePackageInfoList gets the list of code packages deployed on a Service Fabric node for the given
8020// application.
8021// Parameters:
8022// nodeName - the name of the node.
8023// applicationID - the identity of the application. This is typically the full name of the application without
8024// the 'fabric:' URI scheme.
8025// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8026// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8027// in 6.0+ and "myapp/app1" in previous versions.
8028// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
8029// Fabric cluster.
8030// codePackageName - the name of code package specified in service manifest registered as part of an
8031// application type in a Service Fabric cluster.
8032// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8033// duration that the client is willing to wait for the requested operation to complete. The default value for
8034// this parameter is 60 seconds.
8035func (client BaseClient) GetDeployedCodePackageInfoList(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, timeout *int64) (result ListDeployedCodePackageInfo, err error) {
8036	if tracing.IsEnabled() {
8037		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedCodePackageInfoList")
8038		defer func() {
8039			sc := -1
8040			if result.Response.Response != nil {
8041				sc = result.Response.Response.StatusCode
8042			}
8043			tracing.EndSpan(ctx, sc, err)
8044		}()
8045	}
8046	if err := validation.Validate([]validation.Validation{
8047		{TargetValue: timeout,
8048			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8049				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8050					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8051				}}}}}); err != nil {
8052		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedCodePackageInfoList", err.Error())
8053	}
8054
8055	req, err := client.GetDeployedCodePackageInfoListPreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, timeout)
8056	if err != nil {
8057		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", nil, "Failure preparing request")
8058		return
8059	}
8060
8061	resp, err := client.GetDeployedCodePackageInfoListSender(req)
8062	if err != nil {
8063		result.Response = autorest.Response{Response: resp}
8064		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", resp, "Failure sending request")
8065		return
8066	}
8067
8068	result, err = client.GetDeployedCodePackageInfoListResponder(resp)
8069	if err != nil {
8070		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", resp, "Failure responding to request")
8071		return
8072	}
8073
8074	return
8075}
8076
8077// GetDeployedCodePackageInfoListPreparer prepares the GetDeployedCodePackageInfoList request.
8078func (client BaseClient) GetDeployedCodePackageInfoListPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, timeout *int64) (*http.Request, error) {
8079	pathParameters := map[string]interface{}{
8080		"applicationId": applicationID,
8081		"nodeName":      autorest.Encode("path", nodeName),
8082	}
8083
8084	const APIVersion = "6.0"
8085	queryParameters := map[string]interface{}{
8086		"api-version": APIVersion,
8087	}
8088	if len(serviceManifestName) > 0 {
8089		queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName)
8090	}
8091	if len(codePackageName) > 0 {
8092		queryParameters["CodePackageName"] = autorest.Encode("query", codePackageName)
8093	}
8094	if timeout != nil {
8095		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8096	} else {
8097		queryParameters["timeout"] = autorest.Encode("query", 60)
8098	}
8099
8100	preparer := autorest.CreatePreparer(
8101		autorest.AsGet(),
8102		autorest.WithBaseURL(client.BaseURI),
8103		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages", pathParameters),
8104		autorest.WithQueryParameters(queryParameters))
8105	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8106}
8107
8108// GetDeployedCodePackageInfoListSender sends the GetDeployedCodePackageInfoList request. The method will close the
8109// http.Response Body if it receives an error.
8110func (client BaseClient) GetDeployedCodePackageInfoListSender(req *http.Request) (*http.Response, error) {
8111	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8112}
8113
8114// GetDeployedCodePackageInfoListResponder handles the response to the GetDeployedCodePackageInfoList request. The method always
8115// closes the http.Response Body.
8116func (client BaseClient) GetDeployedCodePackageInfoListResponder(resp *http.Response) (result ListDeployedCodePackageInfo, err error) {
8117	err = autorest.Respond(
8118		resp,
8119		azure.WithErrorUnlessStatusCode(http.StatusOK),
8120		autorest.ByUnmarshallingJSON(&result.Value),
8121		autorest.ByClosing())
8122	result.Response = autorest.Response{Response: resp}
8123	return
8124}
8125
8126// GetDeployedServicePackageHealth gets the information about health of a service package for a specific application
8127// deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of
8128// HealthEvent objects reported on the deployed service package based on health state.
8129// Parameters:
8130// nodeName - the name of the node.
8131// applicationID - the identity of the application. This is typically the full name of the application without
8132// the 'fabric:' URI scheme.
8133// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8134// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8135// in 6.0+ and "myapp/app1" in previous versions.
8136// servicePackageName - the name of the service package.
8137// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
8138// state.
8139// The possible values for this parameter include integer value of one of the following health states.
8140// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
8141// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
8142// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
8143// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
8144//
8145// - Default - Default value. Matches any HealthState. The value is zero.
8146// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
8147// collection of states. The value is 1.
8148// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
8149// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
8150// - Error - Filter that matches input with HealthState value Error. The value is 8.
8151// - All - Filter that matches input with any HealthState value. The value is 65535.
8152// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8153// duration that the client is willing to wait for the requested operation to complete. The default value for
8154// this parameter is 60 seconds.
8155func (client BaseClient) GetDeployedServicePackageHealth(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, timeout *int64) (result DeployedServicePackageHealth, err error) {
8156	if tracing.IsEnabled() {
8157		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageHealth")
8158		defer func() {
8159			sc := -1
8160			if result.Response.Response != nil {
8161				sc = result.Response.Response.StatusCode
8162			}
8163			tracing.EndSpan(ctx, sc, err)
8164		}()
8165	}
8166	if err := validation.Validate([]validation.Validation{
8167		{TargetValue: timeout,
8168			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8169				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8170					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8171				}}}}}); err != nil {
8172		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealth", err.Error())
8173	}
8174
8175	req, err := client.GetDeployedServicePackageHealthPreparer(ctx, nodeName, applicationID, servicePackageName, eventsHealthStateFilter, timeout)
8176	if err != nil {
8177		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", nil, "Failure preparing request")
8178		return
8179	}
8180
8181	resp, err := client.GetDeployedServicePackageHealthSender(req)
8182	if err != nil {
8183		result.Response = autorest.Response{Response: resp}
8184		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", resp, "Failure sending request")
8185		return
8186	}
8187
8188	result, err = client.GetDeployedServicePackageHealthResponder(resp)
8189	if err != nil {
8190		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", resp, "Failure responding to request")
8191		return
8192	}
8193
8194	return
8195}
8196
8197// GetDeployedServicePackageHealthPreparer prepares the GetDeployedServicePackageHealth request.
8198func (client BaseClient) GetDeployedServicePackageHealthPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) {
8199	pathParameters := map[string]interface{}{
8200		"applicationId":      applicationID,
8201		"nodeName":           autorest.Encode("path", nodeName),
8202		"servicePackageName": servicePackageName,
8203	}
8204
8205	const APIVersion = "6.0"
8206	queryParameters := map[string]interface{}{
8207		"api-version": APIVersion,
8208	}
8209	if eventsHealthStateFilter != nil {
8210		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
8211	} else {
8212		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
8213	}
8214	if timeout != nil {
8215		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8216	} else {
8217		queryParameters["timeout"] = autorest.Encode("query", 60)
8218	}
8219
8220	preparer := autorest.CreatePreparer(
8221		autorest.AsGet(),
8222		autorest.WithBaseURL(client.BaseURI),
8223		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/GetHealth", pathParameters),
8224		autorest.WithQueryParameters(queryParameters))
8225	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8226}
8227
8228// GetDeployedServicePackageHealthSender sends the GetDeployedServicePackageHealth request. The method will close the
8229// http.Response Body if it receives an error.
8230func (client BaseClient) GetDeployedServicePackageHealthSender(req *http.Request) (*http.Response, error) {
8231	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8232}
8233
8234// GetDeployedServicePackageHealthResponder handles the response to the GetDeployedServicePackageHealth request. The method always
8235// closes the http.Response Body.
8236func (client BaseClient) GetDeployedServicePackageHealthResponder(resp *http.Response) (result DeployedServicePackageHealth, err error) {
8237	err = autorest.Respond(
8238		resp,
8239		azure.WithErrorUnlessStatusCode(http.StatusOK),
8240		autorest.ByUnmarshallingJSON(&result),
8241		autorest.ByClosing())
8242	result.Response = autorest.Response{Response: resp}
8243	return
8244}
8245
8246// GetDeployedServicePackageHealthUsingPolicy gets the information about health of a service package for a specific
8247// application deployed on a Service Fabric node. using the specified policy. Use EventsHealthStateFilter to optionally
8248// filter for the collection of HealthEvent objects reported on the deployed service package based on health state. Use
8249// ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only uses
8250// 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while evaluating
8251// the health of the deployed service package.
8252// Parameters:
8253// nodeName - the name of the node.
8254// applicationID - the identity of the application. This is typically the full name of the application without
8255// the 'fabric:' URI scheme.
8256// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8257// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8258// in 6.0+ and "myapp/app1" in previous versions.
8259// servicePackageName - the name of the service package.
8260// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
8261// state.
8262// The possible values for this parameter include integer value of one of the following health states.
8263// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
8264// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
8265// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
8266// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
8267//
8268// - Default - Default value. Matches any HealthState. The value is zero.
8269// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
8270// collection of states. The value is 1.
8271// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
8272// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
8273// - Error - Filter that matches input with HealthState value Error. The value is 8.
8274// - All - Filter that matches input with any HealthState value. The value is 65535.
8275// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
8276// of its children.
8277// If not present, the health evaluation uses the health policy from application manifest or the default health
8278// policy.
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) GetDeployedServicePackageHealthUsingPolicy(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result DeployedServicePackageHealth, err error) {
8283	if tracing.IsEnabled() {
8284		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageHealthUsingPolicy")
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", "GetDeployedServicePackageHealthUsingPolicy", err.Error())
8300	}
8301
8302	req, err := client.GetDeployedServicePackageHealthUsingPolicyPreparer(ctx, nodeName, applicationID, servicePackageName, eventsHealthStateFilter, applicationHealthPolicy, timeout)
8303	if err != nil {
8304		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", nil, "Failure preparing request")
8305		return
8306	}
8307
8308	resp, err := client.GetDeployedServicePackageHealthUsingPolicySender(req)
8309	if err != nil {
8310		result.Response = autorest.Response{Response: resp}
8311		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", resp, "Failure sending request")
8312		return
8313	}
8314
8315	result, err = client.GetDeployedServicePackageHealthUsingPolicyResponder(resp)
8316	if err != nil {
8317		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", resp, "Failure responding to request")
8318		return
8319	}
8320
8321	return
8322}
8323
8324// GetDeployedServicePackageHealthUsingPolicyPreparer prepares the GetDeployedServicePackageHealthUsingPolicy request.
8325func (client BaseClient) GetDeployedServicePackageHealthUsingPolicyPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) {
8326	pathParameters := map[string]interface{}{
8327		"applicationId":      applicationID,
8328		"nodeName":           autorest.Encode("path", nodeName),
8329		"servicePackageName": servicePackageName,
8330	}
8331
8332	const APIVersion = "6.0"
8333	queryParameters := map[string]interface{}{
8334		"api-version": APIVersion,
8335	}
8336	if eventsHealthStateFilter != nil {
8337		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
8338	} else {
8339		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
8340	}
8341	if timeout != nil {
8342		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8343	} else {
8344		queryParameters["timeout"] = autorest.Encode("query", 60)
8345	}
8346
8347	preparer := autorest.CreatePreparer(
8348		autorest.AsContentType("application/json; charset=utf-8"),
8349		autorest.AsPost(),
8350		autorest.WithBaseURL(client.BaseURI),
8351		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/GetHealth", pathParameters),
8352		autorest.WithQueryParameters(queryParameters))
8353	if applicationHealthPolicy != nil {
8354		preparer = autorest.DecoratePreparer(preparer,
8355			autorest.WithJSON(applicationHealthPolicy))
8356	}
8357	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8358}
8359
8360// GetDeployedServicePackageHealthUsingPolicySender sends the GetDeployedServicePackageHealthUsingPolicy request. The method will close the
8361// http.Response Body if it receives an error.
8362func (client BaseClient) GetDeployedServicePackageHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
8363	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8364}
8365
8366// GetDeployedServicePackageHealthUsingPolicyResponder handles the response to the GetDeployedServicePackageHealthUsingPolicy request. The method always
8367// closes the http.Response Body.
8368func (client BaseClient) GetDeployedServicePackageHealthUsingPolicyResponder(resp *http.Response) (result DeployedServicePackageHealth, err error) {
8369	err = autorest.Respond(
8370		resp,
8371		azure.WithErrorUnlessStatusCode(http.StatusOK),
8372		autorest.ByUnmarshallingJSON(&result),
8373		autorest.ByClosing())
8374	result.Response = autorest.Response{Response: resp}
8375	return
8376}
8377
8378// GetDeployedServicePackageInfoList returns the information about the service packages deployed on a Service Fabric
8379// node for the given application.
8380// Parameters:
8381// nodeName - the name of the node.
8382// applicationID - the identity of the application. This is typically the full name of the application without
8383// the 'fabric:' URI scheme.
8384// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8385// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8386// in 6.0+ and "myapp/app1" in previous versions.
8387// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8388// duration that the client is willing to wait for the requested operation to complete. The default value for
8389// this parameter is 60 seconds.
8390func (client BaseClient) GetDeployedServicePackageInfoList(ctx context.Context, nodeName string, applicationID string, timeout *int64) (result ListDeployedServicePackageInfo, err error) {
8391	if tracing.IsEnabled() {
8392		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageInfoList")
8393		defer func() {
8394			sc := -1
8395			if result.Response.Response != nil {
8396				sc = result.Response.Response.StatusCode
8397			}
8398			tracing.EndSpan(ctx, sc, err)
8399		}()
8400	}
8401	if err := validation.Validate([]validation.Validation{
8402		{TargetValue: timeout,
8403			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8404				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8405					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8406				}}}}}); err != nil {
8407		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoList", err.Error())
8408	}
8409
8410	req, err := client.GetDeployedServicePackageInfoListPreparer(ctx, nodeName, applicationID, timeout)
8411	if err != nil {
8412		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", nil, "Failure preparing request")
8413		return
8414	}
8415
8416	resp, err := client.GetDeployedServicePackageInfoListSender(req)
8417	if err != nil {
8418		result.Response = autorest.Response{Response: resp}
8419		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", resp, "Failure sending request")
8420		return
8421	}
8422
8423	result, err = client.GetDeployedServicePackageInfoListResponder(resp)
8424	if err != nil {
8425		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", resp, "Failure responding to request")
8426		return
8427	}
8428
8429	return
8430}
8431
8432// GetDeployedServicePackageInfoListPreparer prepares the GetDeployedServicePackageInfoList request.
8433func (client BaseClient) GetDeployedServicePackageInfoListPreparer(ctx context.Context, nodeName string, applicationID string, timeout *int64) (*http.Request, error) {
8434	pathParameters := map[string]interface{}{
8435		"applicationId": applicationID,
8436		"nodeName":      autorest.Encode("path", nodeName),
8437	}
8438
8439	const APIVersion = "6.0"
8440	queryParameters := map[string]interface{}{
8441		"api-version": APIVersion,
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}/$/GetServicePackages", pathParameters),
8453		autorest.WithQueryParameters(queryParameters))
8454	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8455}
8456
8457// GetDeployedServicePackageInfoListSender sends the GetDeployedServicePackageInfoList request. The method will close the
8458// http.Response Body if it receives an error.
8459func (client BaseClient) GetDeployedServicePackageInfoListSender(req *http.Request) (*http.Response, error) {
8460	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8461}
8462
8463// GetDeployedServicePackageInfoListResponder handles the response to the GetDeployedServicePackageInfoList request. The method always
8464// closes the http.Response Body.
8465func (client BaseClient) GetDeployedServicePackageInfoListResponder(resp *http.Response) (result ListDeployedServicePackageInfo, err error) {
8466	err = autorest.Respond(
8467		resp,
8468		azure.WithErrorUnlessStatusCode(http.StatusOK),
8469		autorest.ByUnmarshallingJSON(&result.Value),
8470		autorest.ByClosing())
8471	result.Response = autorest.Response{Response: resp}
8472	return
8473}
8474
8475// GetDeployedServicePackageInfoListByName returns the information about the service packages deployed on a Service
8476// Fabric node for the given application. These results are of service packages whose name match exactly the service
8477// package name specified as the parameter.
8478// Parameters:
8479// nodeName - the name of the node.
8480// applicationID - the identity of the application. This is typically the full name of the application without
8481// the 'fabric:' URI scheme.
8482// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8483// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8484// in 6.0+ and "myapp/app1" in previous versions.
8485// servicePackageName - the name of the service package.
8486// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8487// duration that the client is willing to wait for the requested operation to complete. The default value for
8488// this parameter is 60 seconds.
8489func (client BaseClient) GetDeployedServicePackageInfoListByName(ctx context.Context, nodeName string, applicationID string, servicePackageName string, timeout *int64) (result ListDeployedServicePackageInfo, err error) {
8490	if tracing.IsEnabled() {
8491		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageInfoListByName")
8492		defer func() {
8493			sc := -1
8494			if result.Response.Response != nil {
8495				sc = result.Response.Response.StatusCode
8496			}
8497			tracing.EndSpan(ctx, sc, err)
8498		}()
8499	}
8500	if err := validation.Validate([]validation.Validation{
8501		{TargetValue: timeout,
8502			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8503				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8504					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8505				}}}}}); err != nil {
8506		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", err.Error())
8507	}
8508
8509	req, err := client.GetDeployedServicePackageInfoListByNamePreparer(ctx, nodeName, applicationID, servicePackageName, timeout)
8510	if err != nil {
8511		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", nil, "Failure preparing request")
8512		return
8513	}
8514
8515	resp, err := client.GetDeployedServicePackageInfoListByNameSender(req)
8516	if err != nil {
8517		result.Response = autorest.Response{Response: resp}
8518		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", resp, "Failure sending request")
8519		return
8520	}
8521
8522	result, err = client.GetDeployedServicePackageInfoListByNameResponder(resp)
8523	if err != nil {
8524		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", resp, "Failure responding to request")
8525		return
8526	}
8527
8528	return
8529}
8530
8531// GetDeployedServicePackageInfoListByNamePreparer prepares the GetDeployedServicePackageInfoListByName request.
8532func (client BaseClient) GetDeployedServicePackageInfoListByNamePreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, timeout *int64) (*http.Request, error) {
8533	pathParameters := map[string]interface{}{
8534		"applicationId":      applicationID,
8535		"nodeName":           autorest.Encode("path", nodeName),
8536		"servicePackageName": servicePackageName,
8537	}
8538
8539	const APIVersion = "6.0"
8540	queryParameters := map[string]interface{}{
8541		"api-version": APIVersion,
8542	}
8543	if timeout != nil {
8544		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8545	} else {
8546		queryParameters["timeout"] = autorest.Encode("query", 60)
8547	}
8548
8549	preparer := autorest.CreatePreparer(
8550		autorest.AsGet(),
8551		autorest.WithBaseURL(client.BaseURI),
8552		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}", pathParameters),
8553		autorest.WithQueryParameters(queryParameters))
8554	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8555}
8556
8557// GetDeployedServicePackageInfoListByNameSender sends the GetDeployedServicePackageInfoListByName request. The method will close the
8558// http.Response Body if it receives an error.
8559func (client BaseClient) GetDeployedServicePackageInfoListByNameSender(req *http.Request) (*http.Response, error) {
8560	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8561}
8562
8563// GetDeployedServicePackageInfoListByNameResponder handles the response to the GetDeployedServicePackageInfoListByName request. The method always
8564// closes the http.Response Body.
8565func (client BaseClient) GetDeployedServicePackageInfoListByNameResponder(resp *http.Response) (result ListDeployedServicePackageInfo, err error) {
8566	err = autorest.Respond(
8567		resp,
8568		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
8569		autorest.ByUnmarshallingJSON(&result.Value),
8570		autorest.ByClosing())
8571	result.Response = autorest.Response{Response: resp}
8572	return
8573}
8574
8575// GetDeployedServiceReplicaDetailInfo gets the details of the replica deployed on a Service Fabric node. The
8576// information includes service kind, service name, current service operation, current service operation start date
8577// time, partition ID, replica/instance ID, reported load, and other information.
8578// Parameters:
8579// nodeName - the name of the node.
8580// partitionID - the identity of the partition.
8581// replicaID - the identifier of the replica.
8582// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8583// duration that the client is willing to wait for the requested operation to complete. The default value for
8584// this parameter is 60 seconds.
8585func (client BaseClient) GetDeployedServiceReplicaDetailInfo(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (result DeployedServiceReplicaDetailInfoModel, err error) {
8586	if tracing.IsEnabled() {
8587		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaDetailInfo")
8588		defer func() {
8589			sc := -1
8590			if result.Response.Response != nil {
8591				sc = result.Response.Response.StatusCode
8592			}
8593			tracing.EndSpan(ctx, sc, err)
8594		}()
8595	}
8596	if err := validation.Validate([]validation.Validation{
8597		{TargetValue: timeout,
8598			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8599				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8600					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8601				}}}}}); err != nil {
8602		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", err.Error())
8603	}
8604
8605	req, err := client.GetDeployedServiceReplicaDetailInfoPreparer(ctx, nodeName, partitionID, replicaID, timeout)
8606	if err != nil {
8607		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", nil, "Failure preparing request")
8608		return
8609	}
8610
8611	resp, err := client.GetDeployedServiceReplicaDetailInfoSender(req)
8612	if err != nil {
8613		result.Response = autorest.Response{Response: resp}
8614		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", resp, "Failure sending request")
8615		return
8616	}
8617
8618	result, err = client.GetDeployedServiceReplicaDetailInfoResponder(resp)
8619	if err != nil {
8620		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", resp, "Failure responding to request")
8621		return
8622	}
8623
8624	return
8625}
8626
8627// GetDeployedServiceReplicaDetailInfoPreparer prepares the GetDeployedServiceReplicaDetailInfo request.
8628func (client BaseClient) GetDeployedServiceReplicaDetailInfoPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) {
8629	pathParameters := map[string]interface{}{
8630		"nodeName":    autorest.Encode("path", nodeName),
8631		"partitionId": partitionID,
8632		"replicaId":   replicaID,
8633	}
8634
8635	const APIVersion = "6.0"
8636	queryParameters := map[string]interface{}{
8637		"api-version": APIVersion,
8638	}
8639	if timeout != nil {
8640		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8641	} else {
8642		queryParameters["timeout"] = autorest.Encode("query", 60)
8643	}
8644
8645	preparer := autorest.CreatePreparer(
8646		autorest.AsGet(),
8647		autorest.WithBaseURL(client.BaseURI),
8648		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetDetail", pathParameters),
8649		autorest.WithQueryParameters(queryParameters))
8650	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8651}
8652
8653// GetDeployedServiceReplicaDetailInfoSender sends the GetDeployedServiceReplicaDetailInfo request. The method will close the
8654// http.Response Body if it receives an error.
8655func (client BaseClient) GetDeployedServiceReplicaDetailInfoSender(req *http.Request) (*http.Response, error) {
8656	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8657}
8658
8659// GetDeployedServiceReplicaDetailInfoResponder handles the response to the GetDeployedServiceReplicaDetailInfo request. The method always
8660// closes the http.Response Body.
8661func (client BaseClient) GetDeployedServiceReplicaDetailInfoResponder(resp *http.Response) (result DeployedServiceReplicaDetailInfoModel, err error) {
8662	err = autorest.Respond(
8663		resp,
8664		azure.WithErrorUnlessStatusCode(http.StatusOK),
8665		autorest.ByUnmarshallingJSON(&result),
8666		autorest.ByClosing())
8667	result.Response = autorest.Response{Response: resp}
8668	return
8669}
8670
8671// GetDeployedServiceReplicaDetailInfoByPartitionID gets the details of the replica deployed on a Service Fabric node.
8672// The information includes service kind, service name, current service operation, current service operation start date
8673// time, partition ID, replica/instance ID, reported load, and other information.
8674// Parameters:
8675// nodeName - the name of the node.
8676// partitionID - the identity of the partition.
8677// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8678// duration that the client is willing to wait for the requested operation to complete. The default value for
8679// this parameter is 60 seconds.
8680func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionID(ctx context.Context, nodeName string, partitionID uuid.UUID, timeout *int64) (result DeployedServiceReplicaDetailInfoModel, err error) {
8681	if tracing.IsEnabled() {
8682		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaDetailInfoByPartitionID")
8683		defer func() {
8684			sc := -1
8685			if result.Response.Response != nil {
8686				sc = result.Response.Response.StatusCode
8687			}
8688			tracing.EndSpan(ctx, sc, err)
8689		}()
8690	}
8691	if err := validation.Validate([]validation.Validation{
8692		{TargetValue: timeout,
8693			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8694				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8695					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8696				}}}}}); err != nil {
8697		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", err.Error())
8698	}
8699
8700	req, err := client.GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer(ctx, nodeName, partitionID, timeout)
8701	if err != nil {
8702		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", nil, "Failure preparing request")
8703		return
8704	}
8705
8706	resp, err := client.GetDeployedServiceReplicaDetailInfoByPartitionIDSender(req)
8707	if err != nil {
8708		result.Response = autorest.Response{Response: resp}
8709		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", resp, "Failure sending request")
8710		return
8711	}
8712
8713	result, err = client.GetDeployedServiceReplicaDetailInfoByPartitionIDResponder(resp)
8714	if err != nil {
8715		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", resp, "Failure responding to request")
8716		return
8717	}
8718
8719	return
8720}
8721
8722// GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer prepares the GetDeployedServiceReplicaDetailInfoByPartitionID request.
8723func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
8724	pathParameters := map[string]interface{}{
8725		"nodeName":    autorest.Encode("path", nodeName),
8726		"partitionId": partitionID,
8727	}
8728
8729	const APIVersion = "6.0"
8730	queryParameters := map[string]interface{}{
8731		"api-version": APIVersion,
8732	}
8733	if timeout != nil {
8734		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8735	} else {
8736		queryParameters["timeout"] = autorest.Encode("query", 60)
8737	}
8738
8739	preparer := autorest.CreatePreparer(
8740		autorest.AsGet(),
8741		autorest.WithBaseURL(client.BaseURI),
8742		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas", pathParameters),
8743		autorest.WithQueryParameters(queryParameters))
8744	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8745}
8746
8747// GetDeployedServiceReplicaDetailInfoByPartitionIDSender sends the GetDeployedServiceReplicaDetailInfoByPartitionID request. The method will close the
8748// http.Response Body if it receives an error.
8749func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDSender(req *http.Request) (*http.Response, error) {
8750	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8751}
8752
8753// GetDeployedServiceReplicaDetailInfoByPartitionIDResponder handles the response to the GetDeployedServiceReplicaDetailInfoByPartitionID request. The method always
8754// closes the http.Response Body.
8755func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDResponder(resp *http.Response) (result DeployedServiceReplicaDetailInfoModel, err error) {
8756	err = autorest.Respond(
8757		resp,
8758		azure.WithErrorUnlessStatusCode(http.StatusOK),
8759		autorest.ByUnmarshallingJSON(&result),
8760		autorest.ByClosing())
8761	result.Response = autorest.Response{Response: resp}
8762	return
8763}
8764
8765// GetDeployedServiceReplicaInfoList gets the list containing the information about replicas deployed on a Service
8766// Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of
8767// the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return
8768// information about the deployed replicas matching the specified values for those parameters.
8769// Parameters:
8770// nodeName - the name of the node.
8771// applicationID - the identity of the application. This is typically the full name of the application without
8772// the 'fabric:' URI scheme.
8773// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8774// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8775// in 6.0+ and "myapp/app1" in previous versions.
8776// partitionID - the identity of the partition.
8777// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
8778// Fabric cluster.
8779// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8780// duration that the client is willing to wait for the requested operation to complete. The default value for
8781// this parameter is 60 seconds.
8782func (client BaseClient) GetDeployedServiceReplicaInfoList(ctx context.Context, nodeName string, applicationID string, partitionID *uuid.UUID, serviceManifestName string, timeout *int64) (result ListDeployedServiceReplicaInfo, err error) {
8783	if tracing.IsEnabled() {
8784		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaInfoList")
8785		defer func() {
8786			sc := -1
8787			if result.Response.Response != nil {
8788				sc = result.Response.Response.StatusCode
8789			}
8790			tracing.EndSpan(ctx, sc, err)
8791		}()
8792	}
8793	if err := validation.Validate([]validation.Validation{
8794		{TargetValue: timeout,
8795			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8796				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8797					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8798				}}}}}); err != nil {
8799		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", err.Error())
8800	}
8801
8802	req, err := client.GetDeployedServiceReplicaInfoListPreparer(ctx, nodeName, applicationID, partitionID, serviceManifestName, timeout)
8803	if err != nil {
8804		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", nil, "Failure preparing request")
8805		return
8806	}
8807
8808	resp, err := client.GetDeployedServiceReplicaInfoListSender(req)
8809	if err != nil {
8810		result.Response = autorest.Response{Response: resp}
8811		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", resp, "Failure sending request")
8812		return
8813	}
8814
8815	result, err = client.GetDeployedServiceReplicaInfoListResponder(resp)
8816	if err != nil {
8817		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", resp, "Failure responding to request")
8818		return
8819	}
8820
8821	return
8822}
8823
8824// GetDeployedServiceReplicaInfoListPreparer prepares the GetDeployedServiceReplicaInfoList request.
8825func (client BaseClient) GetDeployedServiceReplicaInfoListPreparer(ctx context.Context, nodeName string, applicationID string, partitionID *uuid.UUID, serviceManifestName string, timeout *int64) (*http.Request, error) {
8826	pathParameters := map[string]interface{}{
8827		"applicationId": applicationID,
8828		"nodeName":      autorest.Encode("path", nodeName),
8829	}
8830
8831	const APIVersion = "6.0"
8832	queryParameters := map[string]interface{}{
8833		"api-version": APIVersion,
8834	}
8835	if partitionID != nil {
8836		queryParameters["PartitionId"] = autorest.Encode("query", *partitionID)
8837	}
8838	if len(serviceManifestName) > 0 {
8839		queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName)
8840	}
8841	if timeout != nil {
8842		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8843	} else {
8844		queryParameters["timeout"] = autorest.Encode("query", 60)
8845	}
8846
8847	preparer := autorest.CreatePreparer(
8848		autorest.AsGet(),
8849		autorest.WithBaseURL(client.BaseURI),
8850		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetReplicas", pathParameters),
8851		autorest.WithQueryParameters(queryParameters))
8852	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8853}
8854
8855// GetDeployedServiceReplicaInfoListSender sends the GetDeployedServiceReplicaInfoList request. The method will close the
8856// http.Response Body if it receives an error.
8857func (client BaseClient) GetDeployedServiceReplicaInfoListSender(req *http.Request) (*http.Response, error) {
8858	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8859}
8860
8861// GetDeployedServiceReplicaInfoListResponder handles the response to the GetDeployedServiceReplicaInfoList request. The method always
8862// closes the http.Response Body.
8863func (client BaseClient) GetDeployedServiceReplicaInfoListResponder(resp *http.Response) (result ListDeployedServiceReplicaInfo, err error) {
8864	err = autorest.Respond(
8865		resp,
8866		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
8867		autorest.ByUnmarshallingJSON(&result),
8868		autorest.ByClosing())
8869	result.Response = autorest.Response{Response: resp}
8870	return
8871}
8872
8873// GetDeployedServiceTypeInfoByName gets the list containing the information about a specific service type from the
8874// applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its
8875// registration status, the code package that registered it and activation ID of the service package. Each entry
8876// represents one activation of a service type, differentiated by the activation ID.
8877// Parameters:
8878// nodeName - the name of the node.
8879// applicationID - the identity of the application. This is typically the full name of the application without
8880// the 'fabric:' URI scheme.
8881// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8882// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8883// in 6.0+ and "myapp/app1" in previous versions.
8884// serviceTypeName - specifies the name of a Service Fabric service type.
8885// serviceManifestName - the name of the service manifest to filter the list of deployed service type
8886// information. If specified, the response will only contain the information about service types that are
8887// defined in this service manifest.
8888// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8889// duration that the client is willing to wait for the requested operation to complete. The default value for
8890// this parameter is 60 seconds.
8891func (client BaseClient) GetDeployedServiceTypeInfoByName(ctx context.Context, nodeName string, applicationID string, serviceTypeName string, serviceManifestName string, timeout *int64) (result ListDeployedServiceTypeInfo, err error) {
8892	if tracing.IsEnabled() {
8893		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceTypeInfoByName")
8894		defer func() {
8895			sc := -1
8896			if result.Response.Response != nil {
8897				sc = result.Response.Response.StatusCode
8898			}
8899			tracing.EndSpan(ctx, sc, err)
8900		}()
8901	}
8902	if err := validation.Validate([]validation.Validation{
8903		{TargetValue: timeout,
8904			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8905				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8906					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8907				}}}}}); err != nil {
8908		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", err.Error())
8909	}
8910
8911	req, err := client.GetDeployedServiceTypeInfoByNamePreparer(ctx, nodeName, applicationID, serviceTypeName, serviceManifestName, timeout)
8912	if err != nil {
8913		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", nil, "Failure preparing request")
8914		return
8915	}
8916
8917	resp, err := client.GetDeployedServiceTypeInfoByNameSender(req)
8918	if err != nil {
8919		result.Response = autorest.Response{Response: resp}
8920		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", resp, "Failure sending request")
8921		return
8922	}
8923
8924	result, err = client.GetDeployedServiceTypeInfoByNameResponder(resp)
8925	if err != nil {
8926		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", resp, "Failure responding to request")
8927		return
8928	}
8929
8930	return
8931}
8932
8933// GetDeployedServiceTypeInfoByNamePreparer prepares the GetDeployedServiceTypeInfoByName request.
8934func (client BaseClient) GetDeployedServiceTypeInfoByNamePreparer(ctx context.Context, nodeName string, applicationID string, serviceTypeName string, serviceManifestName string, timeout *int64) (*http.Request, error) {
8935	pathParameters := map[string]interface{}{
8936		"applicationId":   applicationID,
8937		"nodeName":        autorest.Encode("path", nodeName),
8938		"serviceTypeName": serviceTypeName,
8939	}
8940
8941	const APIVersion = "6.0"
8942	queryParameters := map[string]interface{}{
8943		"api-version": APIVersion,
8944	}
8945	if len(serviceManifestName) > 0 {
8946		queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName)
8947	}
8948	if timeout != nil {
8949		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8950	} else {
8951		queryParameters["timeout"] = autorest.Encode("query", 60)
8952	}
8953
8954	preparer := autorest.CreatePreparer(
8955		autorest.AsGet(),
8956		autorest.WithBaseURL(client.BaseURI),
8957		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes/{serviceTypeName}", pathParameters),
8958		autorest.WithQueryParameters(queryParameters))
8959	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8960}
8961
8962// GetDeployedServiceTypeInfoByNameSender sends the GetDeployedServiceTypeInfoByName request. The method will close the
8963// http.Response Body if it receives an error.
8964func (client BaseClient) GetDeployedServiceTypeInfoByNameSender(req *http.Request) (*http.Response, error) {
8965	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8966}
8967
8968// GetDeployedServiceTypeInfoByNameResponder handles the response to the GetDeployedServiceTypeInfoByName request. The method always
8969// closes the http.Response Body.
8970func (client BaseClient) GetDeployedServiceTypeInfoByNameResponder(resp *http.Response) (result ListDeployedServiceTypeInfo, err error) {
8971	err = autorest.Respond(
8972		resp,
8973		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
8974		autorest.ByUnmarshallingJSON(&result.Value),
8975		autorest.ByClosing())
8976	result.Response = autorest.Response{Response: resp}
8977	return
8978}
8979
8980// GetDeployedServiceTypeInfoList gets the list containing the information about service types from the applications
8981// deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration
8982// status, the code package that registered it and activation ID of the service package.
8983// Parameters:
8984// nodeName - the name of the node.
8985// applicationID - the identity of the application. This is typically the full name of the application without
8986// the 'fabric:' URI scheme.
8987// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8988// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8989// in 6.0+ and "myapp/app1" in previous versions.
8990// serviceManifestName - the name of the service manifest to filter the list of deployed service type
8991// information. If specified, the response will only contain the information about service types that are
8992// defined in this service manifest.
8993// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8994// duration that the client is willing to wait for the requested operation to complete. The default value for
8995// this parameter is 60 seconds.
8996func (client BaseClient) GetDeployedServiceTypeInfoList(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, timeout *int64) (result ListDeployedServiceTypeInfo, err error) {
8997	if tracing.IsEnabled() {
8998		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceTypeInfoList")
8999		defer func() {
9000			sc := -1
9001			if result.Response.Response != nil {
9002				sc = result.Response.Response.StatusCode
9003			}
9004			tracing.EndSpan(ctx, sc, err)
9005		}()
9006	}
9007	if err := validation.Validate([]validation.Validation{
9008		{TargetValue: timeout,
9009			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9010				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9011					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9012				}}}}}); err != nil {
9013		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", err.Error())
9014	}
9015
9016	req, err := client.GetDeployedServiceTypeInfoListPreparer(ctx, nodeName, applicationID, serviceManifestName, timeout)
9017	if err != nil {
9018		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", nil, "Failure preparing request")
9019		return
9020	}
9021
9022	resp, err := client.GetDeployedServiceTypeInfoListSender(req)
9023	if err != nil {
9024		result.Response = autorest.Response{Response: resp}
9025		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", resp, "Failure sending request")
9026		return
9027	}
9028
9029	result, err = client.GetDeployedServiceTypeInfoListResponder(resp)
9030	if err != nil {
9031		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", resp, "Failure responding to request")
9032		return
9033	}
9034
9035	return
9036}
9037
9038// GetDeployedServiceTypeInfoListPreparer prepares the GetDeployedServiceTypeInfoList request.
9039func (client BaseClient) GetDeployedServiceTypeInfoListPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, timeout *int64) (*http.Request, error) {
9040	pathParameters := map[string]interface{}{
9041		"applicationId": applicationID,
9042		"nodeName":      autorest.Encode("path", nodeName),
9043	}
9044
9045	const APIVersion = "6.0"
9046	queryParameters := map[string]interface{}{
9047		"api-version": APIVersion,
9048	}
9049	if len(serviceManifestName) > 0 {
9050		queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName)
9051	}
9052	if timeout != nil {
9053		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9054	} else {
9055		queryParameters["timeout"] = autorest.Encode("query", 60)
9056	}
9057
9058	preparer := autorest.CreatePreparer(
9059		autorest.AsGet(),
9060		autorest.WithBaseURL(client.BaseURI),
9061		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes", pathParameters),
9062		autorest.WithQueryParameters(queryParameters))
9063	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9064}
9065
9066// GetDeployedServiceTypeInfoListSender sends the GetDeployedServiceTypeInfoList request. The method will close the
9067// http.Response Body if it receives an error.
9068func (client BaseClient) GetDeployedServiceTypeInfoListSender(req *http.Request) (*http.Response, error) {
9069	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9070}
9071
9072// GetDeployedServiceTypeInfoListResponder handles the response to the GetDeployedServiceTypeInfoList request. The method always
9073// closes the http.Response Body.
9074func (client BaseClient) GetDeployedServiceTypeInfoListResponder(resp *http.Response) (result ListDeployedServiceTypeInfo, err error) {
9075	err = autorest.Respond(
9076		resp,
9077		azure.WithErrorUnlessStatusCode(http.StatusOK),
9078		autorest.ByUnmarshallingJSON(&result.Value),
9079		autorest.ByClosing())
9080	result.Response = autorest.Response{Response: resp}
9081	return
9082}
9083
9084// GetFaultOperationList gets the a list of user-induced fault operations filtered by provided input.
9085// Parameters:
9086// typeFilter - used to filter on OperationType for user-induced operations.
9087//
9088// - 65535 - select all
9089// - 1 - select PartitionDataLoss.
9090// - 2 - select PartitionQuorumLoss.
9091// - 4 - select PartitionRestart.
9092// - 8 - select NodeTransition.
9093// stateFilter - used to filter on OperationState's for user-induced operations.
9094//
9095// - 65535 - select All
9096// - 1 - select Running
9097// - 2 - select RollingBack
9098// - 8 - select Completed
9099// - 16 - select Faulted
9100// - 32 - select Cancelled
9101// - 64 - select ForceCancelled
9102// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9103// duration that the client is willing to wait for the requested operation to complete. The default value for
9104// this parameter is 60 seconds.
9105func (client BaseClient) GetFaultOperationList(ctx context.Context, typeFilter int32, stateFilter int32, timeout *int64) (result ListOperationStatus, err error) {
9106	if tracing.IsEnabled() {
9107		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetFaultOperationList")
9108		defer func() {
9109			sc := -1
9110			if result.Response.Response != nil {
9111				sc = result.Response.Response.StatusCode
9112			}
9113			tracing.EndSpan(ctx, sc, err)
9114		}()
9115	}
9116	if err := validation.Validate([]validation.Validation{
9117		{TargetValue: timeout,
9118			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9119				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9120					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9121				}}}}}); err != nil {
9122		return result, validation.NewError("servicefabric.BaseClient", "GetFaultOperationList", err.Error())
9123	}
9124
9125	req, err := client.GetFaultOperationListPreparer(ctx, typeFilter, stateFilter, timeout)
9126	if err != nil {
9127		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", nil, "Failure preparing request")
9128		return
9129	}
9130
9131	resp, err := client.GetFaultOperationListSender(req)
9132	if err != nil {
9133		result.Response = autorest.Response{Response: resp}
9134		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", resp, "Failure sending request")
9135		return
9136	}
9137
9138	result, err = client.GetFaultOperationListResponder(resp)
9139	if err != nil {
9140		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", resp, "Failure responding to request")
9141		return
9142	}
9143
9144	return
9145}
9146
9147// GetFaultOperationListPreparer prepares the GetFaultOperationList request.
9148func (client BaseClient) GetFaultOperationListPreparer(ctx context.Context, typeFilter int32, stateFilter int32, timeout *int64) (*http.Request, error) {
9149	const APIVersion = "6.0"
9150	queryParameters := map[string]interface{}{
9151		"api-version": APIVersion,
9152		"StateFilter": autorest.Encode("query", stateFilter),
9153		"TypeFilter":  autorest.Encode("query", typeFilter),
9154	}
9155	if timeout != nil {
9156		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9157	} else {
9158		queryParameters["timeout"] = autorest.Encode("query", 60)
9159	}
9160
9161	preparer := autorest.CreatePreparer(
9162		autorest.AsGet(),
9163		autorest.WithBaseURL(client.BaseURI),
9164		autorest.WithPath("/Faults/"),
9165		autorest.WithQueryParameters(queryParameters))
9166	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9167}
9168
9169// GetFaultOperationListSender sends the GetFaultOperationList request. The method will close the
9170// http.Response Body if it receives an error.
9171func (client BaseClient) GetFaultOperationListSender(req *http.Request) (*http.Response, error) {
9172	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9173}
9174
9175// GetFaultOperationListResponder handles the response to the GetFaultOperationList request. The method always
9176// closes the http.Response Body.
9177func (client BaseClient) GetFaultOperationListResponder(resp *http.Response) (result ListOperationStatus, err error) {
9178	err = autorest.Respond(
9179		resp,
9180		azure.WithErrorUnlessStatusCode(http.StatusOK),
9181		autorest.ByUnmarshallingJSON(&result.Value),
9182		autorest.ByClosing())
9183	result.Response = autorest.Response{Response: resp}
9184	return
9185}
9186
9187// GetImageStoreContent returns the information about the image store content at the specified contentPath. The
9188// contentPath is relative to the root of the image store.
9189// Parameters:
9190// contentPath - relative path to file or folder in the image store from its root.
9191// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9192// duration that the client is willing to wait for the requested operation to complete. The default value for
9193// this parameter is 60 seconds.
9194func (client BaseClient) GetImageStoreContent(ctx context.Context, contentPath string, timeout *int64) (result ImageStoreContent, err error) {
9195	if tracing.IsEnabled() {
9196		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreContent")
9197		defer func() {
9198			sc := -1
9199			if result.Response.Response != nil {
9200				sc = result.Response.Response.StatusCode
9201			}
9202			tracing.EndSpan(ctx, sc, err)
9203		}()
9204	}
9205	if err := validation.Validate([]validation.Validation{
9206		{TargetValue: timeout,
9207			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9208				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9209					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9210				}}}}}); err != nil {
9211		return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreContent", err.Error())
9212	}
9213
9214	req, err := client.GetImageStoreContentPreparer(ctx, contentPath, timeout)
9215	if err != nil {
9216		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", nil, "Failure preparing request")
9217		return
9218	}
9219
9220	resp, err := client.GetImageStoreContentSender(req)
9221	if err != nil {
9222		result.Response = autorest.Response{Response: resp}
9223		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", resp, "Failure sending request")
9224		return
9225	}
9226
9227	result, err = client.GetImageStoreContentResponder(resp)
9228	if err != nil {
9229		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", resp, "Failure responding to request")
9230		return
9231	}
9232
9233	return
9234}
9235
9236// GetImageStoreContentPreparer prepares the GetImageStoreContent request.
9237func (client BaseClient) GetImageStoreContentPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) {
9238	pathParameters := map[string]interface{}{
9239		"contentPath": autorest.Encode("path", contentPath),
9240	}
9241
9242	const APIVersion = "6.2"
9243	queryParameters := map[string]interface{}{
9244		"api-version": APIVersion,
9245	}
9246	if timeout != nil {
9247		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9248	} else {
9249		queryParameters["timeout"] = autorest.Encode("query", 60)
9250	}
9251
9252	preparer := autorest.CreatePreparer(
9253		autorest.AsGet(),
9254		autorest.WithBaseURL(client.BaseURI),
9255		autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters),
9256		autorest.WithQueryParameters(queryParameters))
9257	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9258}
9259
9260// GetImageStoreContentSender sends the GetImageStoreContent request. The method will close the
9261// http.Response Body if it receives an error.
9262func (client BaseClient) GetImageStoreContentSender(req *http.Request) (*http.Response, error) {
9263	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9264}
9265
9266// GetImageStoreContentResponder handles the response to the GetImageStoreContent request. The method always
9267// closes the http.Response Body.
9268func (client BaseClient) GetImageStoreContentResponder(resp *http.Response) (result ImageStoreContent, err error) {
9269	err = autorest.Respond(
9270		resp,
9271		azure.WithErrorUnlessStatusCode(http.StatusOK),
9272		autorest.ByUnmarshallingJSON(&result),
9273		autorest.ByClosing())
9274	result.Response = autorest.Response{Response: resp}
9275	return
9276}
9277
9278// GetImageStoreRootContent returns the information about the image store content at the root of the image store.
9279// Parameters:
9280// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9281// duration that the client is willing to wait for the requested operation to complete. The default value for
9282// this parameter is 60 seconds.
9283func (client BaseClient) GetImageStoreRootContent(ctx context.Context, timeout *int64) (result ImageStoreContent, err error) {
9284	if tracing.IsEnabled() {
9285		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreRootContent")
9286		defer func() {
9287			sc := -1
9288			if result.Response.Response != nil {
9289				sc = result.Response.Response.StatusCode
9290			}
9291			tracing.EndSpan(ctx, sc, err)
9292		}()
9293	}
9294	if err := validation.Validate([]validation.Validation{
9295		{TargetValue: timeout,
9296			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9297				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9298					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9299				}}}}}); err != nil {
9300		return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreRootContent", err.Error())
9301	}
9302
9303	req, err := client.GetImageStoreRootContentPreparer(ctx, timeout)
9304	if err != nil {
9305		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", nil, "Failure preparing request")
9306		return
9307	}
9308
9309	resp, err := client.GetImageStoreRootContentSender(req)
9310	if err != nil {
9311		result.Response = autorest.Response{Response: resp}
9312		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", resp, "Failure sending request")
9313		return
9314	}
9315
9316	result, err = client.GetImageStoreRootContentResponder(resp)
9317	if err != nil {
9318		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", resp, "Failure responding to request")
9319		return
9320	}
9321
9322	return
9323}
9324
9325// GetImageStoreRootContentPreparer prepares the GetImageStoreRootContent request.
9326func (client BaseClient) GetImageStoreRootContentPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
9327	const APIVersion = "6.0"
9328	queryParameters := map[string]interface{}{
9329		"api-version": APIVersion,
9330	}
9331	if timeout != nil {
9332		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9333	} else {
9334		queryParameters["timeout"] = autorest.Encode("query", 60)
9335	}
9336
9337	preparer := autorest.CreatePreparer(
9338		autorest.AsGet(),
9339		autorest.WithBaseURL(client.BaseURI),
9340		autorest.WithPath("/ImageStore"),
9341		autorest.WithQueryParameters(queryParameters))
9342	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9343}
9344
9345// GetImageStoreRootContentSender sends the GetImageStoreRootContent request. The method will close the
9346// http.Response Body if it receives an error.
9347func (client BaseClient) GetImageStoreRootContentSender(req *http.Request) (*http.Response, error) {
9348	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9349}
9350
9351// GetImageStoreRootContentResponder handles the response to the GetImageStoreRootContent request. The method always
9352// closes the http.Response Body.
9353func (client BaseClient) GetImageStoreRootContentResponder(resp *http.Response) (result ImageStoreContent, err error) {
9354	err = autorest.Respond(
9355		resp,
9356		azure.WithErrorUnlessStatusCode(http.StatusOK),
9357		autorest.ByUnmarshallingJSON(&result),
9358		autorest.ByClosing())
9359	result.Response = autorest.Response{Response: resp}
9360	return
9361}
9362
9363// GetImageStoreUploadSessionByID gets the image store upload session identified by the given ID. User can query the
9364// upload session at any time during uploading.
9365// Parameters:
9366// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session
9367// which keeps track of all file chunks until it is committed.
9368// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9369// duration that the client is willing to wait for the requested operation to complete. The default value for
9370// this parameter is 60 seconds.
9371func (client BaseClient) GetImageStoreUploadSessionByID(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result UploadSession, err error) {
9372	if tracing.IsEnabled() {
9373		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreUploadSessionByID")
9374		defer func() {
9375			sc := -1
9376			if result.Response.Response != nil {
9377				sc = result.Response.Response.StatusCode
9378			}
9379			tracing.EndSpan(ctx, sc, err)
9380		}()
9381	}
9382	if err := validation.Validate([]validation.Validation{
9383		{TargetValue: timeout,
9384			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9385				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9386					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9387				}}}}}); err != nil {
9388		return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreUploadSessionByID", err.Error())
9389	}
9390
9391	req, err := client.GetImageStoreUploadSessionByIDPreparer(ctx, sessionID, timeout)
9392	if err != nil {
9393		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", nil, "Failure preparing request")
9394		return
9395	}
9396
9397	resp, err := client.GetImageStoreUploadSessionByIDSender(req)
9398	if err != nil {
9399		result.Response = autorest.Response{Response: resp}
9400		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", resp, "Failure sending request")
9401		return
9402	}
9403
9404	result, err = client.GetImageStoreUploadSessionByIDResponder(resp)
9405	if err != nil {
9406		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", resp, "Failure responding to request")
9407		return
9408	}
9409
9410	return
9411}
9412
9413// GetImageStoreUploadSessionByIDPreparer prepares the GetImageStoreUploadSessionByID request.
9414func (client BaseClient) GetImageStoreUploadSessionByIDPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) {
9415	const APIVersion = "6.0"
9416	queryParameters := map[string]interface{}{
9417		"api-version": APIVersion,
9418		"session-id":  autorest.Encode("query", sessionID),
9419	}
9420	if timeout != nil {
9421		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9422	} else {
9423		queryParameters["timeout"] = autorest.Encode("query", 60)
9424	}
9425
9426	preparer := autorest.CreatePreparer(
9427		autorest.AsGet(),
9428		autorest.WithBaseURL(client.BaseURI),
9429		autorest.WithPath("/ImageStore/$/GetUploadSession"),
9430		autorest.WithQueryParameters(queryParameters))
9431	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9432}
9433
9434// GetImageStoreUploadSessionByIDSender sends the GetImageStoreUploadSessionByID request. The method will close the
9435// http.Response Body if it receives an error.
9436func (client BaseClient) GetImageStoreUploadSessionByIDSender(req *http.Request) (*http.Response, error) {
9437	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9438}
9439
9440// GetImageStoreUploadSessionByIDResponder handles the response to the GetImageStoreUploadSessionByID request. The method always
9441// closes the http.Response Body.
9442func (client BaseClient) GetImageStoreUploadSessionByIDResponder(resp *http.Response) (result UploadSession, err error) {
9443	err = autorest.Respond(
9444		resp,
9445		azure.WithErrorUnlessStatusCode(http.StatusOK),
9446		autorest.ByUnmarshallingJSON(&result),
9447		autorest.ByClosing())
9448	result.Response = autorest.Response{Response: resp}
9449	return
9450}
9451
9452// GetImageStoreUploadSessionByPath gets the image store upload session associated with the given image store relative
9453// path. User can query the upload session at any time during uploading.
9454// Parameters:
9455// contentPath - relative path to file or folder in the image store from its root.
9456// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9457// duration that the client is willing to wait for the requested operation to complete. The default value for
9458// this parameter is 60 seconds.
9459func (client BaseClient) GetImageStoreUploadSessionByPath(ctx context.Context, contentPath string, timeout *int64) (result UploadSession, err error) {
9460	if tracing.IsEnabled() {
9461		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreUploadSessionByPath")
9462		defer func() {
9463			sc := -1
9464			if result.Response.Response != nil {
9465				sc = result.Response.Response.StatusCode
9466			}
9467			tracing.EndSpan(ctx, sc, err)
9468		}()
9469	}
9470	if err := validation.Validate([]validation.Validation{
9471		{TargetValue: timeout,
9472			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9473				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9474					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9475				}}}}}); err != nil {
9476		return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", err.Error())
9477	}
9478
9479	req, err := client.GetImageStoreUploadSessionByPathPreparer(ctx, contentPath, timeout)
9480	if err != nil {
9481		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", nil, "Failure preparing request")
9482		return
9483	}
9484
9485	resp, err := client.GetImageStoreUploadSessionByPathSender(req)
9486	if err != nil {
9487		result.Response = autorest.Response{Response: resp}
9488		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", resp, "Failure sending request")
9489		return
9490	}
9491
9492	result, err = client.GetImageStoreUploadSessionByPathResponder(resp)
9493	if err != nil {
9494		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", resp, "Failure responding to request")
9495		return
9496	}
9497
9498	return
9499}
9500
9501// GetImageStoreUploadSessionByPathPreparer prepares the GetImageStoreUploadSessionByPath request.
9502func (client BaseClient) GetImageStoreUploadSessionByPathPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) {
9503	pathParameters := map[string]interface{}{
9504		"contentPath": autorest.Encode("path", contentPath),
9505	}
9506
9507	const APIVersion = "6.0"
9508	queryParameters := map[string]interface{}{
9509		"api-version": APIVersion,
9510	}
9511	if timeout != nil {
9512		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9513	} else {
9514		queryParameters["timeout"] = autorest.Encode("query", 60)
9515	}
9516
9517	preparer := autorest.CreatePreparer(
9518		autorest.AsGet(),
9519		autorest.WithBaseURL(client.BaseURI),
9520		autorest.WithPathParameters("/ImageStore/{contentPath}/$/GetUploadSession", pathParameters),
9521		autorest.WithQueryParameters(queryParameters))
9522	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9523}
9524
9525// GetImageStoreUploadSessionByPathSender sends the GetImageStoreUploadSessionByPath request. The method will close the
9526// http.Response Body if it receives an error.
9527func (client BaseClient) GetImageStoreUploadSessionByPathSender(req *http.Request) (*http.Response, error) {
9528	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9529}
9530
9531// GetImageStoreUploadSessionByPathResponder handles the response to the GetImageStoreUploadSessionByPath request. The method always
9532// closes the http.Response Body.
9533func (client BaseClient) GetImageStoreUploadSessionByPathResponder(resp *http.Response) (result UploadSession, err error) {
9534	err = autorest.Respond(
9535		resp,
9536		azure.WithErrorUnlessStatusCode(http.StatusOK),
9537		autorest.ByUnmarshallingJSON(&result),
9538		autorest.ByClosing())
9539	result.Response = autorest.Response{Response: resp}
9540	return
9541}
9542
9543// GetNameExistsInfo returns whether the specified Service Fabric name exists.
9544// Parameters:
9545// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
9546// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9547// duration that the client is willing to wait for the requested operation to complete. The default value for
9548// this parameter is 60 seconds.
9549func (client BaseClient) GetNameExistsInfo(ctx context.Context, nameID string, timeout *int64) (result autorest.Response, err error) {
9550	if tracing.IsEnabled() {
9551		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNameExistsInfo")
9552		defer func() {
9553			sc := -1
9554			if result.Response != nil {
9555				sc = result.Response.StatusCode
9556			}
9557			tracing.EndSpan(ctx, sc, err)
9558		}()
9559	}
9560	if err := validation.Validate([]validation.Validation{
9561		{TargetValue: timeout,
9562			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9563				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9564					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9565				}}}}}); err != nil {
9566		return result, validation.NewError("servicefabric.BaseClient", "GetNameExistsInfo", err.Error())
9567	}
9568
9569	req, err := client.GetNameExistsInfoPreparer(ctx, nameID, timeout)
9570	if err != nil {
9571		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", nil, "Failure preparing request")
9572		return
9573	}
9574
9575	resp, err := client.GetNameExistsInfoSender(req)
9576	if err != nil {
9577		result.Response = resp
9578		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", resp, "Failure sending request")
9579		return
9580	}
9581
9582	result, err = client.GetNameExistsInfoResponder(resp)
9583	if err != nil {
9584		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", resp, "Failure responding to request")
9585		return
9586	}
9587
9588	return
9589}
9590
9591// GetNameExistsInfoPreparer prepares the GetNameExistsInfo request.
9592func (client BaseClient) GetNameExistsInfoPreparer(ctx context.Context, nameID string, timeout *int64) (*http.Request, error) {
9593	pathParameters := map[string]interface{}{
9594		"nameId": nameID,
9595	}
9596
9597	const APIVersion = "6.0"
9598	queryParameters := map[string]interface{}{
9599		"api-version": APIVersion,
9600	}
9601	if timeout != nil {
9602		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9603	} else {
9604		queryParameters["timeout"] = autorest.Encode("query", 60)
9605	}
9606
9607	preparer := autorest.CreatePreparer(
9608		autorest.AsGet(),
9609		autorest.WithBaseURL(client.BaseURI),
9610		autorest.WithPathParameters("/Names/{nameId}", pathParameters),
9611		autorest.WithQueryParameters(queryParameters))
9612	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9613}
9614
9615// GetNameExistsInfoSender sends the GetNameExistsInfo request. The method will close the
9616// http.Response Body if it receives an error.
9617func (client BaseClient) GetNameExistsInfoSender(req *http.Request) (*http.Response, error) {
9618	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9619}
9620
9621// GetNameExistsInfoResponder handles the response to the GetNameExistsInfo request. The method always
9622// closes the http.Response Body.
9623func (client BaseClient) GetNameExistsInfoResponder(resp *http.Response) (result autorest.Response, err error) {
9624	err = autorest.Respond(
9625		resp,
9626		azure.WithErrorUnlessStatusCode(http.StatusOK),
9627		autorest.ByClosing())
9628	result.Response = resp
9629	return
9630}
9631
9632// GetNodeEventList the response is list of NodeEvent objects.
9633// Parameters:
9634// nodeName - the name of the node.
9635// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
9636// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
9637// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9638// duration that the client is willing to wait for the requested operation to complete. The default value for
9639// this parameter is 60 seconds.
9640// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
9641// be included in the response.
9642// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
9643// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
9644// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
9645// populated.
9646func (client BaseClient) GetNodeEventList(ctx context.Context, nodeName string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListNodeEvent, err error) {
9647	if tracing.IsEnabled() {
9648		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeEventList")
9649		defer func() {
9650			sc := -1
9651			if result.Response.Response != nil {
9652				sc = result.Response.Response.StatusCode
9653			}
9654			tracing.EndSpan(ctx, sc, err)
9655		}()
9656	}
9657	if err := validation.Validate([]validation.Validation{
9658		{TargetValue: timeout,
9659			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9660				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9661					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9662				}}}}}); err != nil {
9663		return result, validation.NewError("servicefabric.BaseClient", "GetNodeEventList", err.Error())
9664	}
9665
9666	req, err := client.GetNodeEventListPreparer(ctx, nodeName, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
9667	if err != nil {
9668		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", nil, "Failure preparing request")
9669		return
9670	}
9671
9672	resp, err := client.GetNodeEventListSender(req)
9673	if err != nil {
9674		result.Response = autorest.Response{Response: resp}
9675		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", resp, "Failure sending request")
9676		return
9677	}
9678
9679	result, err = client.GetNodeEventListResponder(resp)
9680	if err != nil {
9681		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", resp, "Failure responding to request")
9682		return
9683	}
9684
9685	return
9686}
9687
9688// GetNodeEventListPreparer prepares the GetNodeEventList request.
9689func (client BaseClient) GetNodeEventListPreparer(ctx context.Context, nodeName string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
9690	pathParameters := map[string]interface{}{
9691		"nodeName": autorest.Encode("path", nodeName),
9692	}
9693
9694	const APIVersion = "6.2-preview"
9695	queryParameters := map[string]interface{}{
9696		"api-version":  APIVersion,
9697		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
9698		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
9699	}
9700	if timeout != nil {
9701		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9702	} else {
9703		queryParameters["timeout"] = autorest.Encode("query", 60)
9704	}
9705	if len(eventsTypesFilter) > 0 {
9706		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
9707	}
9708	if excludeAnalysisEvents != nil {
9709		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
9710	}
9711	if skipCorrelationLookup != nil {
9712		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
9713	}
9714
9715	preparer := autorest.CreatePreparer(
9716		autorest.AsGet(),
9717		autorest.WithBaseURL(client.BaseURI),
9718		autorest.WithPathParameters("/EventsStore/Nodes/{nodeName}/$/Events", pathParameters),
9719		autorest.WithQueryParameters(queryParameters))
9720	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9721}
9722
9723// GetNodeEventListSender sends the GetNodeEventList request. The method will close the
9724// http.Response Body if it receives an error.
9725func (client BaseClient) GetNodeEventListSender(req *http.Request) (*http.Response, error) {
9726	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9727}
9728
9729// GetNodeEventListResponder handles the response to the GetNodeEventList request. The method always
9730// closes the http.Response Body.
9731func (client BaseClient) GetNodeEventListResponder(resp *http.Response) (result ListNodeEvent, err error) {
9732	err = autorest.Respond(
9733		resp,
9734		azure.WithErrorUnlessStatusCode(http.StatusOK),
9735		autorest.ByUnmarshallingJSON(&result),
9736		autorest.ByClosing())
9737	result.Response = autorest.Response{Response: resp}
9738	return
9739}
9740
9741// GetNodeHealth gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of
9742// health events reported on the node based on the health state. If the node that you specify by name does not exist in
9743// the health store, this returns an error.
9744// Parameters:
9745// nodeName - the name of the node.
9746// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
9747// state.
9748// The possible values for this parameter include integer value of one of the following health states.
9749// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
9750// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
9751// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
9752// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
9753//
9754// - Default - Default value. Matches any HealthState. The value is zero.
9755// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
9756// collection of states. The value is 1.
9757// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
9758// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
9759// - Error - Filter that matches input with HealthState value Error. The value is 8.
9760// - All - Filter that matches input with any HealthState value. The value is 65535.
9761// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9762// duration that the client is willing to wait for the requested operation to complete. The default value for
9763// this parameter is 60 seconds.
9764func (client BaseClient) GetNodeHealth(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, timeout *int64) (result NodeHealth, err error) {
9765	if tracing.IsEnabled() {
9766		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeHealth")
9767		defer func() {
9768			sc := -1
9769			if result.Response.Response != nil {
9770				sc = result.Response.Response.StatusCode
9771			}
9772			tracing.EndSpan(ctx, sc, err)
9773		}()
9774	}
9775	if err := validation.Validate([]validation.Validation{
9776		{TargetValue: timeout,
9777			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9778				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9779					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9780				}}}}}); err != nil {
9781		return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealth", err.Error())
9782	}
9783
9784	req, err := client.GetNodeHealthPreparer(ctx, nodeName, eventsHealthStateFilter, timeout)
9785	if err != nil {
9786		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", nil, "Failure preparing request")
9787		return
9788	}
9789
9790	resp, err := client.GetNodeHealthSender(req)
9791	if err != nil {
9792		result.Response = autorest.Response{Response: resp}
9793		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", resp, "Failure sending request")
9794		return
9795	}
9796
9797	result, err = client.GetNodeHealthResponder(resp)
9798	if err != nil {
9799		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", resp, "Failure responding to request")
9800		return
9801	}
9802
9803	return
9804}
9805
9806// GetNodeHealthPreparer prepares the GetNodeHealth request.
9807func (client BaseClient) GetNodeHealthPreparer(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) {
9808	pathParameters := map[string]interface{}{
9809		"nodeName": autorest.Encode("path", nodeName),
9810	}
9811
9812	const APIVersion = "6.0"
9813	queryParameters := map[string]interface{}{
9814		"api-version": APIVersion,
9815	}
9816	if eventsHealthStateFilter != nil {
9817		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
9818	} else {
9819		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
9820	}
9821	if timeout != nil {
9822		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9823	} else {
9824		queryParameters["timeout"] = autorest.Encode("query", 60)
9825	}
9826
9827	preparer := autorest.CreatePreparer(
9828		autorest.AsGet(),
9829		autorest.WithBaseURL(client.BaseURI),
9830		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetHealth", pathParameters),
9831		autorest.WithQueryParameters(queryParameters))
9832	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9833}
9834
9835// GetNodeHealthSender sends the GetNodeHealth request. The method will close the
9836// http.Response Body if it receives an error.
9837func (client BaseClient) GetNodeHealthSender(req *http.Request) (*http.Response, error) {
9838	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9839}
9840
9841// GetNodeHealthResponder handles the response to the GetNodeHealth request. The method always
9842// closes the http.Response Body.
9843func (client BaseClient) GetNodeHealthResponder(resp *http.Response) (result NodeHealth, err error) {
9844	err = autorest.Respond(
9845		resp,
9846		azure.WithErrorUnlessStatusCode(http.StatusOK),
9847		autorest.ByUnmarshallingJSON(&result),
9848		autorest.ByClosing())
9849	result.Response = autorest.Response{Response: resp}
9850	return
9851}
9852
9853// GetNodeHealthUsingPolicy gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the
9854// collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body
9855// to override the health policies used to evaluate the health. If the node that you specify by name does not exist in
9856// the health store, this returns an error.
9857// Parameters:
9858// nodeName - the name of the node.
9859// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
9860// state.
9861// The possible values for this parameter include integer value of one of the following health states.
9862// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
9863// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
9864// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
9865// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
9866//
9867// - Default - Default value. Matches any HealthState. The value is zero.
9868// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
9869// collection of states. The value is 1.
9870// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
9871// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
9872// - Error - Filter that matches input with HealthState value Error. The value is 8.
9873// - All - Filter that matches input with any HealthState value. The value is 65535.
9874// clusterHealthPolicy - describes the health policies used to evaluate the health of a cluster or node. If not
9875// present, the health evaluation uses the health policy from cluster manifest or the default health policy.
9876// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9877// duration that the client is willing to wait for the requested operation to complete. The default value for
9878// this parameter is 60 seconds.
9879func (client BaseClient) GetNodeHealthUsingPolicy(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, clusterHealthPolicy *ClusterHealthPolicy, timeout *int64) (result NodeHealth, err error) {
9880	if tracing.IsEnabled() {
9881		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeHealthUsingPolicy")
9882		defer func() {
9883			sc := -1
9884			if result.Response.Response != nil {
9885				sc = result.Response.Response.StatusCode
9886			}
9887			tracing.EndSpan(ctx, sc, err)
9888		}()
9889	}
9890	if err := validation.Validate([]validation.Validation{
9891		{TargetValue: timeout,
9892			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9893				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9894					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9895				}}}}}); err != nil {
9896		return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealthUsingPolicy", err.Error())
9897	}
9898
9899	req, err := client.GetNodeHealthUsingPolicyPreparer(ctx, nodeName, eventsHealthStateFilter, clusterHealthPolicy, timeout)
9900	if err != nil {
9901		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", nil, "Failure preparing request")
9902		return
9903	}
9904
9905	resp, err := client.GetNodeHealthUsingPolicySender(req)
9906	if err != nil {
9907		result.Response = autorest.Response{Response: resp}
9908		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", resp, "Failure sending request")
9909		return
9910	}
9911
9912	result, err = client.GetNodeHealthUsingPolicyResponder(resp)
9913	if err != nil {
9914		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", resp, "Failure responding to request")
9915		return
9916	}
9917
9918	return
9919}
9920
9921// GetNodeHealthUsingPolicyPreparer prepares the GetNodeHealthUsingPolicy request.
9922func (client BaseClient) GetNodeHealthUsingPolicyPreparer(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, clusterHealthPolicy *ClusterHealthPolicy, timeout *int64) (*http.Request, error) {
9923	pathParameters := map[string]interface{}{
9924		"nodeName": autorest.Encode("path", nodeName),
9925	}
9926
9927	const APIVersion = "6.0"
9928	queryParameters := map[string]interface{}{
9929		"api-version": APIVersion,
9930	}
9931	if eventsHealthStateFilter != nil {
9932		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
9933	} else {
9934		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
9935	}
9936	if timeout != nil {
9937		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9938	} else {
9939		queryParameters["timeout"] = autorest.Encode("query", 60)
9940	}
9941
9942	preparer := autorest.CreatePreparer(
9943		autorest.AsContentType("application/json; charset=utf-8"),
9944		autorest.AsPost(),
9945		autorest.WithBaseURL(client.BaseURI),
9946		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetHealth", pathParameters),
9947		autorest.WithQueryParameters(queryParameters))
9948	if clusterHealthPolicy != nil {
9949		preparer = autorest.DecoratePreparer(preparer,
9950			autorest.WithJSON(clusterHealthPolicy))
9951	}
9952	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9953}
9954
9955// GetNodeHealthUsingPolicySender sends the GetNodeHealthUsingPolicy request. The method will close the
9956// http.Response Body if it receives an error.
9957func (client BaseClient) GetNodeHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
9958	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9959}
9960
9961// GetNodeHealthUsingPolicyResponder handles the response to the GetNodeHealthUsingPolicy request. The method always
9962// closes the http.Response Body.
9963func (client BaseClient) GetNodeHealthUsingPolicyResponder(resp *http.Response) (result NodeHealth, err error) {
9964	err = autorest.Respond(
9965		resp,
9966		azure.WithErrorUnlessStatusCode(http.StatusOK),
9967		autorest.ByUnmarshallingJSON(&result),
9968		autorest.ByClosing())
9969	result.Response = autorest.Response{Response: resp}
9970	return
9971}
9972
9973// GetNodeInfo the response includes the name, status, ID, health, uptime, and other details about the node.
9974// Parameters:
9975// nodeName - the name of the node.
9976// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9977// duration that the client is willing to wait for the requested operation to complete. The default value for
9978// this parameter is 60 seconds.
9979func (client BaseClient) GetNodeInfo(ctx context.Context, nodeName string, timeout *int64) (result NodeInfo, err error) {
9980	if tracing.IsEnabled() {
9981		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeInfo")
9982		defer func() {
9983			sc := -1
9984			if result.Response.Response != nil {
9985				sc = result.Response.Response.StatusCode
9986			}
9987			tracing.EndSpan(ctx, sc, err)
9988		}()
9989	}
9990	if err := validation.Validate([]validation.Validation{
9991		{TargetValue: timeout,
9992			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9993				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9994					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9995				}}}}}); err != nil {
9996		return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfo", err.Error())
9997	}
9998
9999	req, err := client.GetNodeInfoPreparer(ctx, nodeName, timeout)
10000	if err != nil {
10001		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", nil, "Failure preparing request")
10002		return
10003	}
10004
10005	resp, err := client.GetNodeInfoSender(req)
10006	if err != nil {
10007		result.Response = autorest.Response{Response: resp}
10008		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", resp, "Failure sending request")
10009		return
10010	}
10011
10012	result, err = client.GetNodeInfoResponder(resp)
10013	if err != nil {
10014		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", resp, "Failure responding to request")
10015		return
10016	}
10017
10018	return
10019}
10020
10021// GetNodeInfoPreparer prepares the GetNodeInfo request.
10022func (client BaseClient) GetNodeInfoPreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) {
10023	pathParameters := map[string]interface{}{
10024		"nodeName": autorest.Encode("path", nodeName),
10025	}
10026
10027	const APIVersion = "6.0"
10028	queryParameters := map[string]interface{}{
10029		"api-version": APIVersion,
10030	}
10031	if timeout != nil {
10032		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10033	} else {
10034		queryParameters["timeout"] = autorest.Encode("query", 60)
10035	}
10036
10037	preparer := autorest.CreatePreparer(
10038		autorest.AsGet(),
10039		autorest.WithBaseURL(client.BaseURI),
10040		autorest.WithPathParameters("/Nodes/{nodeName}", pathParameters),
10041		autorest.WithQueryParameters(queryParameters))
10042	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10043}
10044
10045// GetNodeInfoSender sends the GetNodeInfo request. The method will close the
10046// http.Response Body if it receives an error.
10047func (client BaseClient) GetNodeInfoSender(req *http.Request) (*http.Response, error) {
10048	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10049}
10050
10051// GetNodeInfoResponder handles the response to the GetNodeInfo request. The method always
10052// closes the http.Response Body.
10053func (client BaseClient) GetNodeInfoResponder(resp *http.Response) (result NodeInfo, err error) {
10054	err = autorest.Respond(
10055		resp,
10056		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
10057		autorest.ByUnmarshallingJSON(&result),
10058		autorest.ByClosing())
10059	result.Response = autorest.Response{Response: resp}
10060	return
10061}
10062
10063// GetNodeInfoList the response includes the name, status, ID, health, uptime, and other details about the nodes.
10064// Parameters:
10065// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
10066// token with a non-empty value is included in the response of the API when the results from the system do not
10067// fit in a single response. When this value is passed to the next API call, the API returns next set of
10068// results. If there are no further results, then the continuation token does not contain a value. The value of
10069// this parameter should not be URL encoded.
10070// nodeStatusFilter - allows filtering the nodes based on the NodeStatus. Only the nodes that are matching the
10071// specified filter value will be returned. The filter value can be one of the following.
10072// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
10073// defines the upper bound on the number of results returned. The results returned can be less than the
10074// specified maximum results if they do not fit in the message as per the max message size restrictions defined
10075// in the configuration. If this parameter is zero or not specified, the paged query includes as many results
10076// as possible that fit in the return message.
10077// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10078// duration that the client is willing to wait for the requested operation to complete. The default value for
10079// this parameter is 60 seconds.
10080func (client BaseClient) GetNodeInfoList(ctx context.Context, continuationToken string, nodeStatusFilter NodeStatusFilter, maxResults *int64, timeout *int64) (result PagedNodeInfoList, err error) {
10081	if tracing.IsEnabled() {
10082		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeInfoList")
10083		defer func() {
10084			sc := -1
10085			if result.Response.Response != nil {
10086				sc = result.Response.Response.StatusCode
10087			}
10088			tracing.EndSpan(ctx, sc, err)
10089		}()
10090	}
10091	if err := validation.Validate([]validation.Validation{
10092		{TargetValue: maxResults,
10093			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
10094				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
10095		{TargetValue: timeout,
10096			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10097				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10098					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10099				}}}}}); err != nil {
10100		return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfoList", err.Error())
10101	}
10102
10103	req, err := client.GetNodeInfoListPreparer(ctx, continuationToken, nodeStatusFilter, maxResults, timeout)
10104	if err != nil {
10105		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", nil, "Failure preparing request")
10106		return
10107	}
10108
10109	resp, err := client.GetNodeInfoListSender(req)
10110	if err != nil {
10111		result.Response = autorest.Response{Response: resp}
10112		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", resp, "Failure sending request")
10113		return
10114	}
10115
10116	result, err = client.GetNodeInfoListResponder(resp)
10117	if err != nil {
10118		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", resp, "Failure responding to request")
10119		return
10120	}
10121
10122	return
10123}
10124
10125// GetNodeInfoListPreparer prepares the GetNodeInfoList request.
10126func (client BaseClient) GetNodeInfoListPreparer(ctx context.Context, continuationToken string, nodeStatusFilter NodeStatusFilter, maxResults *int64, timeout *int64) (*http.Request, error) {
10127	const APIVersion = "6.3"
10128	queryParameters := map[string]interface{}{
10129		"api-version": APIVersion,
10130	}
10131	if len(continuationToken) > 0 {
10132		queryParameters["ContinuationToken"] = continuationToken
10133	}
10134	if len(string(nodeStatusFilter)) > 0 {
10135		queryParameters["NodeStatusFilter"] = autorest.Encode("query", nodeStatusFilter)
10136	} else {
10137		queryParameters["NodeStatusFilter"] = autorest.Encode("query", "default")
10138	}
10139	if maxResults != nil {
10140		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
10141	} else {
10142		queryParameters["MaxResults"] = autorest.Encode("query", 0)
10143	}
10144	if timeout != nil {
10145		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10146	} else {
10147		queryParameters["timeout"] = autorest.Encode("query", 60)
10148	}
10149
10150	preparer := autorest.CreatePreparer(
10151		autorest.AsGet(),
10152		autorest.WithBaseURL(client.BaseURI),
10153		autorest.WithPath("/Nodes"),
10154		autorest.WithQueryParameters(queryParameters))
10155	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10156}
10157
10158// GetNodeInfoListSender sends the GetNodeInfoList request. The method will close the
10159// http.Response Body if it receives an error.
10160func (client BaseClient) GetNodeInfoListSender(req *http.Request) (*http.Response, error) {
10161	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10162}
10163
10164// GetNodeInfoListResponder handles the response to the GetNodeInfoList request. The method always
10165// closes the http.Response Body.
10166func (client BaseClient) GetNodeInfoListResponder(resp *http.Response) (result PagedNodeInfoList, err error) {
10167	err = autorest.Respond(
10168		resp,
10169		azure.WithErrorUnlessStatusCode(http.StatusOK),
10170		autorest.ByUnmarshallingJSON(&result),
10171		autorest.ByClosing())
10172	result.Response = autorest.Response{Response: resp}
10173	return
10174}
10175
10176// GetNodeLoadInfo retrieves the load information of a Service Fabric node for all the metrics that have load or
10177// capacity defined.
10178// Parameters:
10179// nodeName - the name of the node.
10180// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10181// duration that the client is willing to wait for the requested operation to complete. The default value for
10182// this parameter is 60 seconds.
10183func (client BaseClient) GetNodeLoadInfo(ctx context.Context, nodeName string, timeout *int64) (result NodeLoadInfo, err error) {
10184	if tracing.IsEnabled() {
10185		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeLoadInfo")
10186		defer func() {
10187			sc := -1
10188			if result.Response.Response != nil {
10189				sc = result.Response.Response.StatusCode
10190			}
10191			tracing.EndSpan(ctx, sc, err)
10192		}()
10193	}
10194	if err := validation.Validate([]validation.Validation{
10195		{TargetValue: timeout,
10196			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10197				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10198					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10199				}}}}}); err != nil {
10200		return result, validation.NewError("servicefabric.BaseClient", "GetNodeLoadInfo", err.Error())
10201	}
10202
10203	req, err := client.GetNodeLoadInfoPreparer(ctx, nodeName, timeout)
10204	if err != nil {
10205		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", nil, "Failure preparing request")
10206		return
10207	}
10208
10209	resp, err := client.GetNodeLoadInfoSender(req)
10210	if err != nil {
10211		result.Response = autorest.Response{Response: resp}
10212		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", resp, "Failure sending request")
10213		return
10214	}
10215
10216	result, err = client.GetNodeLoadInfoResponder(resp)
10217	if err != nil {
10218		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", resp, "Failure responding to request")
10219		return
10220	}
10221
10222	return
10223}
10224
10225// GetNodeLoadInfoPreparer prepares the GetNodeLoadInfo request.
10226func (client BaseClient) GetNodeLoadInfoPreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) {
10227	pathParameters := map[string]interface{}{
10228		"nodeName": autorest.Encode("path", nodeName),
10229	}
10230
10231	const APIVersion = "6.0"
10232	queryParameters := map[string]interface{}{
10233		"api-version": APIVersion,
10234	}
10235	if timeout != nil {
10236		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10237	} else {
10238		queryParameters["timeout"] = autorest.Encode("query", 60)
10239	}
10240
10241	preparer := autorest.CreatePreparer(
10242		autorest.AsGet(),
10243		autorest.WithBaseURL(client.BaseURI),
10244		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetLoadInformation", pathParameters),
10245		autorest.WithQueryParameters(queryParameters))
10246	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10247}
10248
10249// GetNodeLoadInfoSender sends the GetNodeLoadInfo request. The method will close the
10250// http.Response Body if it receives an error.
10251func (client BaseClient) GetNodeLoadInfoSender(req *http.Request) (*http.Response, error) {
10252	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10253}
10254
10255// GetNodeLoadInfoResponder handles the response to the GetNodeLoadInfo request. The method always
10256// closes the http.Response Body.
10257func (client BaseClient) GetNodeLoadInfoResponder(resp *http.Response) (result NodeLoadInfo, err error) {
10258	err = autorest.Respond(
10259		resp,
10260		azure.WithErrorUnlessStatusCode(http.StatusOK),
10261		autorest.ByUnmarshallingJSON(&result),
10262		autorest.ByClosing())
10263	result.Response = autorest.Response{Response: resp}
10264	return
10265}
10266
10267// GetNodesEventList the response is list of NodeEvent objects.
10268// Parameters:
10269// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
10270// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
10271// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10272// duration that the client is willing to wait for the requested operation to complete. The default value for
10273// this parameter is 60 seconds.
10274// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
10275// be included in the response.
10276// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
10277// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
10278// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
10279// populated.
10280func (client BaseClient) GetNodesEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListNodeEvent, err error) {
10281	if tracing.IsEnabled() {
10282		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodesEventList")
10283		defer func() {
10284			sc := -1
10285			if result.Response.Response != nil {
10286				sc = result.Response.Response.StatusCode
10287			}
10288			tracing.EndSpan(ctx, sc, err)
10289		}()
10290	}
10291	if err := validation.Validate([]validation.Validation{
10292		{TargetValue: timeout,
10293			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10294				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10295					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10296				}}}}}); err != nil {
10297		return result, validation.NewError("servicefabric.BaseClient", "GetNodesEventList", err.Error())
10298	}
10299
10300	req, err := client.GetNodesEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
10301	if err != nil {
10302		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", nil, "Failure preparing request")
10303		return
10304	}
10305
10306	resp, err := client.GetNodesEventListSender(req)
10307	if err != nil {
10308		result.Response = autorest.Response{Response: resp}
10309		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", resp, "Failure sending request")
10310		return
10311	}
10312
10313	result, err = client.GetNodesEventListResponder(resp)
10314	if err != nil {
10315		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", resp, "Failure responding to request")
10316		return
10317	}
10318
10319	return
10320}
10321
10322// GetNodesEventListPreparer prepares the GetNodesEventList request.
10323func (client BaseClient) GetNodesEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
10324	const APIVersion = "6.2-preview"
10325	queryParameters := map[string]interface{}{
10326		"api-version":  APIVersion,
10327		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
10328		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
10329	}
10330	if timeout != nil {
10331		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10332	} else {
10333		queryParameters["timeout"] = autorest.Encode("query", 60)
10334	}
10335	if len(eventsTypesFilter) > 0 {
10336		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
10337	}
10338	if excludeAnalysisEvents != nil {
10339		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
10340	}
10341	if skipCorrelationLookup != nil {
10342		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
10343	}
10344
10345	preparer := autorest.CreatePreparer(
10346		autorest.AsGet(),
10347		autorest.WithBaseURL(client.BaseURI),
10348		autorest.WithPath("/EventsStore/Nodes/Events"),
10349		autorest.WithQueryParameters(queryParameters))
10350	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10351}
10352
10353// GetNodesEventListSender sends the GetNodesEventList request. The method will close the
10354// http.Response Body if it receives an error.
10355func (client BaseClient) GetNodesEventListSender(req *http.Request) (*http.Response, error) {
10356	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10357}
10358
10359// GetNodesEventListResponder handles the response to the GetNodesEventList request. The method always
10360// closes the http.Response Body.
10361func (client BaseClient) GetNodesEventListResponder(resp *http.Response) (result ListNodeEvent, err error) {
10362	err = autorest.Respond(
10363		resp,
10364		azure.WithErrorUnlessStatusCode(http.StatusOK),
10365		autorest.ByUnmarshallingJSON(&result),
10366		autorest.ByClosing())
10367	result.Response = autorest.Response{Response: resp}
10368	return
10369}
10370
10371// GetNodeTransitionProgress gets the progress of an operation started with StartNodeTransition using the provided
10372// OperationId.
10373// Parameters:
10374// nodeName - the name of the node.
10375// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
10376// API
10377// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10378// duration that the client is willing to wait for the requested operation to complete. The default value for
10379// this parameter is 60 seconds.
10380func (client BaseClient) GetNodeTransitionProgress(ctx context.Context, nodeName string, operationID uuid.UUID, timeout *int64) (result NodeTransitionProgress, err error) {
10381	if tracing.IsEnabled() {
10382		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeTransitionProgress")
10383		defer func() {
10384			sc := -1
10385			if result.Response.Response != nil {
10386				sc = result.Response.Response.StatusCode
10387			}
10388			tracing.EndSpan(ctx, sc, err)
10389		}()
10390	}
10391	if err := validation.Validate([]validation.Validation{
10392		{TargetValue: timeout,
10393			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10394				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10395					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10396				}}}}}); err != nil {
10397		return result, validation.NewError("servicefabric.BaseClient", "GetNodeTransitionProgress", err.Error())
10398	}
10399
10400	req, err := client.GetNodeTransitionProgressPreparer(ctx, nodeName, operationID, timeout)
10401	if err != nil {
10402		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", nil, "Failure preparing request")
10403		return
10404	}
10405
10406	resp, err := client.GetNodeTransitionProgressSender(req)
10407	if err != nil {
10408		result.Response = autorest.Response{Response: resp}
10409		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", resp, "Failure sending request")
10410		return
10411	}
10412
10413	result, err = client.GetNodeTransitionProgressResponder(resp)
10414	if err != nil {
10415		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", resp, "Failure responding to request")
10416		return
10417	}
10418
10419	return
10420}
10421
10422// GetNodeTransitionProgressPreparer prepares the GetNodeTransitionProgress request.
10423func (client BaseClient) GetNodeTransitionProgressPreparer(ctx context.Context, nodeName string, operationID uuid.UUID, timeout *int64) (*http.Request, error) {
10424	pathParameters := map[string]interface{}{
10425		"nodeName": autorest.Encode("path", nodeName),
10426	}
10427
10428	const APIVersion = "6.0"
10429	queryParameters := map[string]interface{}{
10430		"api-version": APIVersion,
10431		"OperationId": autorest.Encode("query", operationID),
10432	}
10433	if timeout != nil {
10434		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10435	} else {
10436		queryParameters["timeout"] = autorest.Encode("query", 60)
10437	}
10438
10439	preparer := autorest.CreatePreparer(
10440		autorest.AsGet(),
10441		autorest.WithBaseURL(client.BaseURI),
10442		autorest.WithPathParameters("/Faults/Nodes/{nodeName}/$/GetTransitionProgress", pathParameters),
10443		autorest.WithQueryParameters(queryParameters))
10444	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10445}
10446
10447// GetNodeTransitionProgressSender sends the GetNodeTransitionProgress request. The method will close the
10448// http.Response Body if it receives an error.
10449func (client BaseClient) GetNodeTransitionProgressSender(req *http.Request) (*http.Response, error) {
10450	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10451}
10452
10453// GetNodeTransitionProgressResponder handles the response to the GetNodeTransitionProgress request. The method always
10454// closes the http.Response Body.
10455func (client BaseClient) GetNodeTransitionProgressResponder(resp *http.Response) (result NodeTransitionProgress, err error) {
10456	err = autorest.Respond(
10457		resp,
10458		azure.WithErrorUnlessStatusCode(http.StatusOK),
10459		autorest.ByUnmarshallingJSON(&result),
10460		autorest.ByClosing())
10461	result.Response = autorest.Response{Response: resp}
10462	return
10463}
10464
10465// GetPartitionBackupConfigurationInfo gets the Service Fabric Backup configuration information for the specified
10466// partition.
10467// Parameters:
10468// partitionID - the identity of the partition.
10469// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10470// duration that the client is willing to wait for the requested operation to complete. The default value for
10471// this parameter is 60 seconds.
10472func (client BaseClient) GetPartitionBackupConfigurationInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result PartitionBackupConfigurationInfo, err error) {
10473	if tracing.IsEnabled() {
10474		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupConfigurationInfo")
10475		defer func() {
10476			sc := -1
10477			if result.Response.Response != nil {
10478				sc = result.Response.Response.StatusCode
10479			}
10480			tracing.EndSpan(ctx, sc, err)
10481		}()
10482	}
10483	if err := validation.Validate([]validation.Validation{
10484		{TargetValue: timeout,
10485			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10486				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10487					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10488				}}}}}); err != nil {
10489		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", err.Error())
10490	}
10491
10492	req, err := client.GetPartitionBackupConfigurationInfoPreparer(ctx, partitionID, timeout)
10493	if err != nil {
10494		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", nil, "Failure preparing request")
10495		return
10496	}
10497
10498	resp, err := client.GetPartitionBackupConfigurationInfoSender(req)
10499	if err != nil {
10500		result.Response = autorest.Response{Response: resp}
10501		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", resp, "Failure sending request")
10502		return
10503	}
10504
10505	result, err = client.GetPartitionBackupConfigurationInfoResponder(resp)
10506	if err != nil {
10507		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", resp, "Failure responding to request")
10508		return
10509	}
10510
10511	return
10512}
10513
10514// GetPartitionBackupConfigurationInfoPreparer prepares the GetPartitionBackupConfigurationInfo request.
10515func (client BaseClient) GetPartitionBackupConfigurationInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
10516	pathParameters := map[string]interface{}{
10517		"partitionId": partitionID,
10518	}
10519
10520	const APIVersion = "6.2-preview"
10521	queryParameters := map[string]interface{}{
10522		"api-version": APIVersion,
10523	}
10524	if timeout != nil {
10525		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10526	} else {
10527		queryParameters["timeout"] = autorest.Encode("query", 60)
10528	}
10529
10530	preparer := autorest.CreatePreparer(
10531		autorest.AsGet(),
10532		autorest.WithBaseURL(client.BaseURI),
10533		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackupConfigurationInfo", pathParameters),
10534		autorest.WithQueryParameters(queryParameters))
10535	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10536}
10537
10538// GetPartitionBackupConfigurationInfoSender sends the GetPartitionBackupConfigurationInfo request. The method will close the
10539// http.Response Body if it receives an error.
10540func (client BaseClient) GetPartitionBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) {
10541	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10542}
10543
10544// GetPartitionBackupConfigurationInfoResponder handles the response to the GetPartitionBackupConfigurationInfo request. The method always
10545// closes the http.Response Body.
10546func (client BaseClient) GetPartitionBackupConfigurationInfoResponder(resp *http.Response) (result PartitionBackupConfigurationInfo, err error) {
10547	err = autorest.Respond(
10548		resp,
10549		azure.WithErrorUnlessStatusCode(http.StatusOK),
10550		autorest.ByUnmarshallingJSON(&result),
10551		autorest.ByClosing())
10552	result.Response = autorest.Response{Response: resp}
10553	return
10554}
10555
10556// GetPartitionBackupList returns a list of backups available for the specified partition. The server enumerates all
10557// the backups available in the backup store configured in the backup policy. It also allows filtering of the result
10558// based on start and end datetime or just fetching the latest available backup for the partition.
10559// Parameters:
10560// partitionID - the identity of the partition.
10561// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10562// duration that the client is willing to wait for the requested operation to complete. The default value for
10563// this parameter is 60 seconds.
10564// latest - specifies whether to get only the most recent backup available for a partition for the specified
10565// time range.
10566// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The
10567// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups
10568// from the beginning are enumerated.
10569// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date
10570// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is
10571// done till the most recent backup.
10572func (client BaseClient) GetPartitionBackupList(ctx context.Context, partitionID uuid.UUID, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time) (result PagedBackupInfoList, err error) {
10573	if tracing.IsEnabled() {
10574		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupList")
10575		defer func() {
10576			sc := -1
10577			if result.Response.Response != nil {
10578				sc = result.Response.Response.StatusCode
10579			}
10580			tracing.EndSpan(ctx, sc, err)
10581		}()
10582	}
10583	if err := validation.Validate([]validation.Validation{
10584		{TargetValue: timeout,
10585			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10586				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10587					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10588				}}}}}); err != nil {
10589		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupList", err.Error())
10590	}
10591
10592	req, err := client.GetPartitionBackupListPreparer(ctx, partitionID, timeout, latest, startDateTimeFilter, endDateTimeFilter)
10593	if err != nil {
10594		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", nil, "Failure preparing request")
10595		return
10596	}
10597
10598	resp, err := client.GetPartitionBackupListSender(req)
10599	if err != nil {
10600		result.Response = autorest.Response{Response: resp}
10601		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", resp, "Failure sending request")
10602		return
10603	}
10604
10605	result, err = client.GetPartitionBackupListResponder(resp)
10606	if err != nil {
10607		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", resp, "Failure responding to request")
10608		return
10609	}
10610
10611	return
10612}
10613
10614// GetPartitionBackupListPreparer prepares the GetPartitionBackupList request.
10615func (client BaseClient) GetPartitionBackupListPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time) (*http.Request, error) {
10616	pathParameters := map[string]interface{}{
10617		"partitionId": partitionID,
10618	}
10619
10620	const APIVersion = "6.2-preview"
10621	queryParameters := map[string]interface{}{
10622		"api-version": APIVersion,
10623	}
10624	if timeout != nil {
10625		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10626	} else {
10627		queryParameters["timeout"] = autorest.Encode("query", 60)
10628	}
10629	if latest != nil {
10630		queryParameters["Latest"] = autorest.Encode("query", *latest)
10631	} else {
10632		queryParameters["Latest"] = autorest.Encode("query", false)
10633	}
10634	if startDateTimeFilter != nil {
10635		queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter)
10636	}
10637	if endDateTimeFilter != nil {
10638		queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter)
10639	}
10640
10641	preparer := autorest.CreatePreparer(
10642		autorest.AsGet(),
10643		autorest.WithBaseURL(client.BaseURI),
10644		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackups", pathParameters),
10645		autorest.WithQueryParameters(queryParameters))
10646	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10647}
10648
10649// GetPartitionBackupListSender sends the GetPartitionBackupList request. The method will close the
10650// http.Response Body if it receives an error.
10651func (client BaseClient) GetPartitionBackupListSender(req *http.Request) (*http.Response, error) {
10652	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10653}
10654
10655// GetPartitionBackupListResponder handles the response to the GetPartitionBackupList request. The method always
10656// closes the http.Response Body.
10657func (client BaseClient) GetPartitionBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) {
10658	err = autorest.Respond(
10659		resp,
10660		azure.WithErrorUnlessStatusCode(http.StatusOK),
10661		autorest.ByUnmarshallingJSON(&result),
10662		autorest.ByClosing())
10663	result.Response = autorest.Response{Response: resp}
10664	return
10665}
10666
10667// GetPartitionBackupProgress returns information about the state of the latest backup along with details or failure
10668// reason in case of completion.
10669// Parameters:
10670// partitionID - the identity of the partition.
10671// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10672// duration that the client is willing to wait for the requested operation to complete. The default value for
10673// this parameter is 60 seconds.
10674func (client BaseClient) GetPartitionBackupProgress(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result BackupProgressInfo, err error) {
10675	if tracing.IsEnabled() {
10676		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupProgress")
10677		defer func() {
10678			sc := -1
10679			if result.Response.Response != nil {
10680				sc = result.Response.Response.StatusCode
10681			}
10682			tracing.EndSpan(ctx, sc, err)
10683		}()
10684	}
10685	if err := validation.Validate([]validation.Validation{
10686		{TargetValue: timeout,
10687			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10688				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10689					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10690				}}}}}); err != nil {
10691		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupProgress", err.Error())
10692	}
10693
10694	req, err := client.GetPartitionBackupProgressPreparer(ctx, partitionID, timeout)
10695	if err != nil {
10696		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", nil, "Failure preparing request")
10697		return
10698	}
10699
10700	resp, err := client.GetPartitionBackupProgressSender(req)
10701	if err != nil {
10702		result.Response = autorest.Response{Response: resp}
10703		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", resp, "Failure sending request")
10704		return
10705	}
10706
10707	result, err = client.GetPartitionBackupProgressResponder(resp)
10708	if err != nil {
10709		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", resp, "Failure responding to request")
10710		return
10711	}
10712
10713	return
10714}
10715
10716// GetPartitionBackupProgressPreparer prepares the GetPartitionBackupProgress request.
10717func (client BaseClient) GetPartitionBackupProgressPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
10718	pathParameters := map[string]interface{}{
10719		"partitionId": partitionID,
10720	}
10721
10722	const APIVersion = "6.2-preview"
10723	queryParameters := map[string]interface{}{
10724		"api-version": APIVersion,
10725	}
10726	if timeout != nil {
10727		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10728	} else {
10729		queryParameters["timeout"] = autorest.Encode("query", 60)
10730	}
10731
10732	preparer := autorest.CreatePreparer(
10733		autorest.AsGet(),
10734		autorest.WithBaseURL(client.BaseURI),
10735		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackupProgress", pathParameters),
10736		autorest.WithQueryParameters(queryParameters))
10737	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10738}
10739
10740// GetPartitionBackupProgressSender sends the GetPartitionBackupProgress request. The method will close the
10741// http.Response Body if it receives an error.
10742func (client BaseClient) GetPartitionBackupProgressSender(req *http.Request) (*http.Response, error) {
10743	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10744}
10745
10746// GetPartitionBackupProgressResponder handles the response to the GetPartitionBackupProgress request. The method always
10747// closes the http.Response Body.
10748func (client BaseClient) GetPartitionBackupProgressResponder(resp *http.Response) (result BackupProgressInfo, err error) {
10749	err = autorest.Respond(
10750		resp,
10751		azure.WithErrorUnlessStatusCode(http.StatusOK),
10752		autorest.ByUnmarshallingJSON(&result),
10753		autorest.ByClosing())
10754	result.Response = autorest.Response{Response: resp}
10755	return
10756}
10757
10758// GetPartitionEventList the response is list of PartitionEvent objects.
10759// Parameters:
10760// partitionID - the identity of the partition.
10761// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
10762// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
10763// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10764// duration that the client is willing to wait for the requested operation to complete. The default value for
10765// this parameter is 60 seconds.
10766// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
10767// be included in the response.
10768// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
10769// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
10770// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
10771// populated.
10772func (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) {
10773	if tracing.IsEnabled() {
10774		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionEventList")
10775		defer func() {
10776			sc := -1
10777			if result.Response.Response != nil {
10778				sc = result.Response.Response.StatusCode
10779			}
10780			tracing.EndSpan(ctx, sc, err)
10781		}()
10782	}
10783	if err := validation.Validate([]validation.Validation{
10784		{TargetValue: timeout,
10785			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10786				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10787					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10788				}}}}}); err != nil {
10789		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionEventList", err.Error())
10790	}
10791
10792	req, err := client.GetPartitionEventListPreparer(ctx, partitionID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
10793	if err != nil {
10794		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", nil, "Failure preparing request")
10795		return
10796	}
10797
10798	resp, err := client.GetPartitionEventListSender(req)
10799	if err != nil {
10800		result.Response = autorest.Response{Response: resp}
10801		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", resp, "Failure sending request")
10802		return
10803	}
10804
10805	result, err = client.GetPartitionEventListResponder(resp)
10806	if err != nil {
10807		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", resp, "Failure responding to request")
10808		return
10809	}
10810
10811	return
10812}
10813
10814// GetPartitionEventListPreparer prepares the GetPartitionEventList request.
10815func (client BaseClient) GetPartitionEventListPreparer(ctx context.Context, partitionID uuid.UUID, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
10816	pathParameters := map[string]interface{}{
10817		"partitionId": partitionID,
10818	}
10819
10820	const APIVersion = "6.2-preview"
10821	queryParameters := map[string]interface{}{
10822		"api-version":  APIVersion,
10823		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
10824		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
10825	}
10826	if timeout != nil {
10827		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10828	} else {
10829		queryParameters["timeout"] = autorest.Encode("query", 60)
10830	}
10831	if len(eventsTypesFilter) > 0 {
10832		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
10833	}
10834	if excludeAnalysisEvents != nil {
10835		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
10836	}
10837	if skipCorrelationLookup != nil {
10838		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
10839	}
10840
10841	preparer := autorest.CreatePreparer(
10842		autorest.AsGet(),
10843		autorest.WithBaseURL(client.BaseURI),
10844		autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Events", pathParameters),
10845		autorest.WithQueryParameters(queryParameters))
10846	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10847}
10848
10849// GetPartitionEventListSender sends the GetPartitionEventList request. The method will close the
10850// http.Response Body if it receives an error.
10851func (client BaseClient) GetPartitionEventListSender(req *http.Request) (*http.Response, error) {
10852	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10853}
10854
10855// GetPartitionEventListResponder handles the response to the GetPartitionEventList request. The method always
10856// closes the http.Response Body.
10857func (client BaseClient) GetPartitionEventListResponder(resp *http.Response) (result ListPartitionEvent, err error) {
10858	err = autorest.Respond(
10859		resp,
10860		azure.WithErrorUnlessStatusCode(http.StatusOK),
10861		autorest.ByUnmarshallingJSON(&result),
10862		autorest.ByClosing())
10863	result.Response = autorest.Response{Response: resp}
10864	return
10865}
10866
10867// GetPartitionHealth use EventsHealthStateFilter to filter the collection of health events reported on the service
10868// based on the health state.
10869// Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition.
10870// If you specify a partition that does not exist in the health store, this request returns an error.
10871// Parameters:
10872// partitionID - the identity of the partition.
10873// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
10874// state.
10875// The possible values for this parameter include integer value of one of the following health states.
10876// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
10877// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
10878// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
10879// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
10880//
10881// - Default - Default value. Matches any HealthState. The value is zero.
10882// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
10883// collection of states. The value is 1.
10884// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
10885// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
10886// - Error - Filter that matches input with HealthState value Error. The value is 8.
10887// - All - Filter that matches input with any HealthState value. The value is 65535.
10888// replicasHealthStateFilter - allows filtering the collection of ReplicaHealthState objects on the partition.
10889// The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only replicas
10890// that match the filter will be returned. All replicas will be used to evaluate the aggregated health state.
10891// If not specified, all entries will be returned.The state values are flag-based enumeration, so the value
10892// could be a combination of these values obtained using bitwise 'OR' operator. For example, If the provided
10893// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) will be returned. The
10894// possible values for this parameter include integer value of one of the following health states.
10895//
10896// - Default - Default value. Matches any HealthState. The value is zero.
10897// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
10898// collection of states. The value is 1.
10899// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
10900// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
10901// - Error - Filter that matches input with HealthState value Error. The value is 8.
10902// - All - Filter that matches input with any HealthState value. The value is 65535.
10903// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
10904// result. False by default.
10905// The statistics show the number of children entities in health state Ok, Warning, and Error.
10906// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10907// duration that the client is willing to wait for the requested operation to complete. The default value for
10908// this parameter is 60 seconds.
10909func (client BaseClient) GetPartitionHealth(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result PartitionHealth, err error) {
10910	if tracing.IsEnabled() {
10911		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionHealth")
10912		defer func() {
10913			sc := -1
10914			if result.Response.Response != nil {
10915				sc = result.Response.Response.StatusCode
10916			}
10917			tracing.EndSpan(ctx, sc, err)
10918		}()
10919	}
10920	if err := validation.Validate([]validation.Validation{
10921		{TargetValue: timeout,
10922			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10923				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10924					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10925				}}}}}); err != nil {
10926		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealth", err.Error())
10927	}
10928
10929	req, err := client.GetPartitionHealthPreparer(ctx, partitionID, eventsHealthStateFilter, replicasHealthStateFilter, excludeHealthStatistics, timeout)
10930	if err != nil {
10931		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", nil, "Failure preparing request")
10932		return
10933	}
10934
10935	resp, err := client.GetPartitionHealthSender(req)
10936	if err != nil {
10937		result.Response = autorest.Response{Response: resp}
10938		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", resp, "Failure sending request")
10939		return
10940	}
10941
10942	result, err = client.GetPartitionHealthResponder(resp)
10943	if err != nil {
10944		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", resp, "Failure responding to request")
10945		return
10946	}
10947
10948	return
10949}
10950
10951// GetPartitionHealthPreparer prepares the GetPartitionHealth request.
10952func (client BaseClient) GetPartitionHealthPreparer(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
10953	pathParameters := map[string]interface{}{
10954		"partitionId": partitionID,
10955	}
10956
10957	const APIVersion = "6.0"
10958	queryParameters := map[string]interface{}{
10959		"api-version": APIVersion,
10960	}
10961	if eventsHealthStateFilter != nil {
10962		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
10963	} else {
10964		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
10965	}
10966	if replicasHealthStateFilter != nil {
10967		queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", *replicasHealthStateFilter)
10968	} else {
10969		queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", 0)
10970	}
10971	if excludeHealthStatistics != nil {
10972		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
10973	} else {
10974		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
10975	}
10976	if timeout != nil {
10977		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10978	} else {
10979		queryParameters["timeout"] = autorest.Encode("query", 60)
10980	}
10981
10982	preparer := autorest.CreatePreparer(
10983		autorest.AsGet(),
10984		autorest.WithBaseURL(client.BaseURI),
10985		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetHealth", pathParameters),
10986		autorest.WithQueryParameters(queryParameters))
10987	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10988}
10989
10990// GetPartitionHealthSender sends the GetPartitionHealth request. The method will close the
10991// http.Response Body if it receives an error.
10992func (client BaseClient) GetPartitionHealthSender(req *http.Request) (*http.Response, error) {
10993	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10994}
10995
10996// GetPartitionHealthResponder handles the response to the GetPartitionHealth request. The method always
10997// closes the http.Response Body.
10998func (client BaseClient) GetPartitionHealthResponder(resp *http.Response) (result PartitionHealth, err error) {
10999	err = autorest.Respond(
11000		resp,
11001		azure.WithErrorUnlessStatusCode(http.StatusOK),
11002		autorest.ByUnmarshallingJSON(&result),
11003		autorest.ByClosing())
11004	result.Response = autorest.Response{Response: resp}
11005	return
11006}
11007
11008// GetPartitionHealthUsingPolicy gets the health information of the specified partition.
11009// If the application health policy is specified, the health evaluation uses it to get the aggregated health state.
11010// If the policy is not specified, the health evaluation uses the application health policy defined in the application
11011// manifest, or the default health policy, if no policy is defined in the manifest.
11012// Use EventsHealthStateFilter to filter the collection of health events reported on the partition based on the health
11013// state.
11014// Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. Use
11015// ApplicationHealthPolicy in the POST body to override the health policies used to evaluate the health.
11016// If you specify a partition that does not exist in the health store, this request returns an error.
11017// Parameters:
11018// partitionID - the identity of the partition.
11019// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
11020// state.
11021// The possible values for this parameter include integer value of one of the following health states.
11022// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
11023// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
11024// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
11025// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
11026//
11027// - Default - Default value. Matches any HealthState. The value is zero.
11028// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
11029// collection of states. The value is 1.
11030// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
11031// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
11032// - Error - Filter that matches input with HealthState value Error. The value is 8.
11033// - All - Filter that matches input with any HealthState value. The value is 65535.
11034// replicasHealthStateFilter - allows filtering the collection of ReplicaHealthState objects on the partition.
11035// The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only replicas
11036// that match the filter will be returned. All replicas will be used to evaluate the aggregated health state.
11037// If not specified, all entries will be returned.The state values are flag-based enumeration, so the value
11038// could be a combination of these values obtained using bitwise 'OR' operator. For example, If the provided
11039// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) will be returned. The
11040// possible values for this parameter include integer value of one of the following health states.
11041//
11042// - Default - Default value. Matches any HealthState. The value is zero.
11043// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
11044// collection of states. The value is 1.
11045// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
11046// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
11047// - Error - Filter that matches input with HealthState value Error. The value is 8.
11048// - All - Filter that matches input with any HealthState value. The value is 65535.
11049// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
11050// of its children.
11051// If not present, the health evaluation uses the health policy from application manifest or the default health
11052// policy.
11053// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
11054// result. False by default.
11055// The statistics show the number of children entities in health state Ok, Warning, and Error.
11056// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11057// duration that the client is willing to wait for the requested operation to complete. The default value for
11058// this parameter is 60 seconds.
11059func (client BaseClient) GetPartitionHealthUsingPolicy(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result PartitionHealth, err error) {
11060	if tracing.IsEnabled() {
11061		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionHealthUsingPolicy")
11062		defer func() {
11063			sc := -1
11064			if result.Response.Response != nil {
11065				sc = result.Response.Response.StatusCode
11066			}
11067			tracing.EndSpan(ctx, sc, err)
11068		}()
11069	}
11070	if err := validation.Validate([]validation.Validation{
11071		{TargetValue: timeout,
11072			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11073				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11074					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11075				}}}}}); err != nil {
11076		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", err.Error())
11077	}
11078
11079	req, err := client.GetPartitionHealthUsingPolicyPreparer(ctx, partitionID, eventsHealthStateFilter, replicasHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout)
11080	if err != nil {
11081		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", nil, "Failure preparing request")
11082		return
11083	}
11084
11085	resp, err := client.GetPartitionHealthUsingPolicySender(req)
11086	if err != nil {
11087		result.Response = autorest.Response{Response: resp}
11088		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", resp, "Failure sending request")
11089		return
11090	}
11091
11092	result, err = client.GetPartitionHealthUsingPolicyResponder(resp)
11093	if err != nil {
11094		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", resp, "Failure responding to request")
11095		return
11096	}
11097
11098	return
11099}
11100
11101// GetPartitionHealthUsingPolicyPreparer prepares the GetPartitionHealthUsingPolicy request.
11102func (client BaseClient) GetPartitionHealthUsingPolicyPreparer(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
11103	pathParameters := map[string]interface{}{
11104		"partitionId": partitionID,
11105	}
11106
11107	const APIVersion = "6.0"
11108	queryParameters := map[string]interface{}{
11109		"api-version": APIVersion,
11110	}
11111	if eventsHealthStateFilter != nil {
11112		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
11113	} else {
11114		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
11115	}
11116	if replicasHealthStateFilter != nil {
11117		queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", *replicasHealthStateFilter)
11118	} else {
11119		queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", 0)
11120	}
11121	if excludeHealthStatistics != nil {
11122		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
11123	} else {
11124		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
11125	}
11126	if timeout != nil {
11127		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11128	} else {
11129		queryParameters["timeout"] = autorest.Encode("query", 60)
11130	}
11131
11132	preparer := autorest.CreatePreparer(
11133		autorest.AsContentType("application/json; charset=utf-8"),
11134		autorest.AsPost(),
11135		autorest.WithBaseURL(client.BaseURI),
11136		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetHealth", pathParameters),
11137		autorest.WithQueryParameters(queryParameters))
11138	if applicationHealthPolicy != nil {
11139		preparer = autorest.DecoratePreparer(preparer,
11140			autorest.WithJSON(applicationHealthPolicy))
11141	}
11142	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11143}
11144
11145// GetPartitionHealthUsingPolicySender sends the GetPartitionHealthUsingPolicy request. The method will close the
11146// http.Response Body if it receives an error.
11147func (client BaseClient) GetPartitionHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
11148	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11149}
11150
11151// GetPartitionHealthUsingPolicyResponder handles the response to the GetPartitionHealthUsingPolicy request. The method always
11152// closes the http.Response Body.
11153func (client BaseClient) GetPartitionHealthUsingPolicyResponder(resp *http.Response) (result PartitionHealth, err error) {
11154	err = autorest.Respond(
11155		resp,
11156		azure.WithErrorUnlessStatusCode(http.StatusOK),
11157		autorest.ByUnmarshallingJSON(&result),
11158		autorest.ByClosing())
11159	result.Response = autorest.Response{Response: resp}
11160	return
11161}
11162
11163// GetPartitionInfo gets the information about the specified partition. The response includes the partition ID,
11164// partitioning scheme information, keys supported by the partition, status, health, and other details about the
11165// partition.
11166// Parameters:
11167// partitionID - the identity of the partition.
11168// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11169// duration that the client is willing to wait for the requested operation to complete. The default value for
11170// this parameter is 60 seconds.
11171func (client BaseClient) GetPartitionInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result ServicePartitionInfoModel, err error) {
11172	if tracing.IsEnabled() {
11173		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionInfo")
11174		defer func() {
11175			sc := -1
11176			if result.Response.Response != nil {
11177				sc = result.Response.Response.StatusCode
11178			}
11179			tracing.EndSpan(ctx, sc, err)
11180		}()
11181	}
11182	if err := validation.Validate([]validation.Validation{
11183		{TargetValue: timeout,
11184			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11185				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11186					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11187				}}}}}); err != nil {
11188		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfo", err.Error())
11189	}
11190
11191	req, err := client.GetPartitionInfoPreparer(ctx, partitionID, timeout)
11192	if err != nil {
11193		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", nil, "Failure preparing request")
11194		return
11195	}
11196
11197	resp, err := client.GetPartitionInfoSender(req)
11198	if err != nil {
11199		result.Response = autorest.Response{Response: resp}
11200		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", resp, "Failure sending request")
11201		return
11202	}
11203
11204	result, err = client.GetPartitionInfoResponder(resp)
11205	if err != nil {
11206		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", resp, "Failure responding to request")
11207		return
11208	}
11209
11210	return
11211}
11212
11213// GetPartitionInfoPreparer prepares the GetPartitionInfo request.
11214func (client BaseClient) GetPartitionInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
11215	pathParameters := map[string]interface{}{
11216		"partitionId": partitionID,
11217	}
11218
11219	const APIVersion = "6.0"
11220	queryParameters := map[string]interface{}{
11221		"api-version": APIVersion,
11222	}
11223	if timeout != nil {
11224		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11225	} else {
11226		queryParameters["timeout"] = autorest.Encode("query", 60)
11227	}
11228
11229	preparer := autorest.CreatePreparer(
11230		autorest.AsGet(),
11231		autorest.WithBaseURL(client.BaseURI),
11232		autorest.WithPathParameters("/Partitions/{partitionId}", pathParameters),
11233		autorest.WithQueryParameters(queryParameters))
11234	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11235}
11236
11237// GetPartitionInfoSender sends the GetPartitionInfo request. The method will close the
11238// http.Response Body if it receives an error.
11239func (client BaseClient) GetPartitionInfoSender(req *http.Request) (*http.Response, error) {
11240	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11241}
11242
11243// GetPartitionInfoResponder handles the response to the GetPartitionInfo request. The method always
11244// closes the http.Response Body.
11245func (client BaseClient) GetPartitionInfoResponder(resp *http.Response) (result ServicePartitionInfoModel, err error) {
11246	err = autorest.Respond(
11247		resp,
11248		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
11249		autorest.ByUnmarshallingJSON(&result),
11250		autorest.ByClosing())
11251	result.Response = autorest.Response{Response: resp}
11252	return
11253}
11254
11255// GetPartitionInfoList the response includes the partition ID, partitioning scheme information, keys supported by the
11256// partition, status, health, and other details about the partition.
11257// Parameters:
11258// serviceID - the identity of the service. This ID is typically the full name of the service without the
11259// 'fabric:' URI scheme.
11260// Starting from version 6.0, hierarchical names are delimited with the "~" character.
11261// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
11262// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
11263// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
11264// token with a non-empty value is included in the response of the API when the results from the system do not
11265// fit in a single response. When this value is passed to the next API call, the API returns next set of
11266// results. If there are no further results, then the continuation token does not contain a value. The value of
11267// this parameter should not be URL encoded.
11268// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11269// duration that the client is willing to wait for the requested operation to complete. The default value for
11270// this parameter is 60 seconds.
11271func (client BaseClient) GetPartitionInfoList(ctx context.Context, serviceID string, continuationToken string, timeout *int64) (result PagedServicePartitionInfoList, err error) {
11272	if tracing.IsEnabled() {
11273		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionInfoList")
11274		defer func() {
11275			sc := -1
11276			if result.Response.Response != nil {
11277				sc = result.Response.Response.StatusCode
11278			}
11279			tracing.EndSpan(ctx, sc, err)
11280		}()
11281	}
11282	if err := validation.Validate([]validation.Validation{
11283		{TargetValue: timeout,
11284			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11285				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11286					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11287				}}}}}); err != nil {
11288		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfoList", err.Error())
11289	}
11290
11291	req, err := client.GetPartitionInfoListPreparer(ctx, serviceID, continuationToken, timeout)
11292	if err != nil {
11293		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", nil, "Failure preparing request")
11294		return
11295	}
11296
11297	resp, err := client.GetPartitionInfoListSender(req)
11298	if err != nil {
11299		result.Response = autorest.Response{Response: resp}
11300		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", resp, "Failure sending request")
11301		return
11302	}
11303
11304	result, err = client.GetPartitionInfoListResponder(resp)
11305	if err != nil {
11306		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", resp, "Failure responding to request")
11307		return
11308	}
11309
11310	return
11311}
11312
11313// GetPartitionInfoListPreparer prepares the GetPartitionInfoList request.
11314func (client BaseClient) GetPartitionInfoListPreparer(ctx context.Context, serviceID string, continuationToken string, timeout *int64) (*http.Request, error) {
11315	pathParameters := map[string]interface{}{
11316		"serviceId": serviceID,
11317	}
11318
11319	const APIVersion = "6.0"
11320	queryParameters := map[string]interface{}{
11321		"api-version": APIVersion,
11322	}
11323	if len(continuationToken) > 0 {
11324		queryParameters["ContinuationToken"] = continuationToken
11325	}
11326	if timeout != nil {
11327		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11328	} else {
11329		queryParameters["timeout"] = autorest.Encode("query", 60)
11330	}
11331
11332	preparer := autorest.CreatePreparer(
11333		autorest.AsGet(),
11334		autorest.WithBaseURL(client.BaseURI),
11335		autorest.WithPathParameters("/Services/{serviceId}/$/GetPartitions", pathParameters),
11336		autorest.WithQueryParameters(queryParameters))
11337	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11338}
11339
11340// GetPartitionInfoListSender sends the GetPartitionInfoList request. The method will close the
11341// http.Response Body if it receives an error.
11342func (client BaseClient) GetPartitionInfoListSender(req *http.Request) (*http.Response, error) {
11343	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11344}
11345
11346// GetPartitionInfoListResponder handles the response to the GetPartitionInfoList request. The method always
11347// closes the http.Response Body.
11348func (client BaseClient) GetPartitionInfoListResponder(resp *http.Response) (result PagedServicePartitionInfoList, err error) {
11349	err = autorest.Respond(
11350		resp,
11351		azure.WithErrorUnlessStatusCode(http.StatusOK),
11352		autorest.ByUnmarshallingJSON(&result),
11353		autorest.ByClosing())
11354	result.Response = autorest.Response{Response: resp}
11355	return
11356}
11357
11358// GetPartitionLoadInformation returns information about the load of a specified partition.
11359// The response includes a list of load reports for a Service Fabric partition.
11360// Each report includes the load metric name, value, and last reported time in UTC.
11361// Parameters:
11362// partitionID - the identity of the partition.
11363// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11364// duration that the client is willing to wait for the requested operation to complete. The default value for
11365// this parameter is 60 seconds.
11366func (client BaseClient) GetPartitionLoadInformation(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result PartitionLoadInformation, err error) {
11367	if tracing.IsEnabled() {
11368		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionLoadInformation")
11369		defer func() {
11370			sc := -1
11371			if result.Response.Response != nil {
11372				sc = result.Response.Response.StatusCode
11373			}
11374			tracing.EndSpan(ctx, sc, err)
11375		}()
11376	}
11377	if err := validation.Validate([]validation.Validation{
11378		{TargetValue: timeout,
11379			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11380				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11381					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11382				}}}}}); err != nil {
11383		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionLoadInformation", err.Error())
11384	}
11385
11386	req, err := client.GetPartitionLoadInformationPreparer(ctx, partitionID, timeout)
11387	if err != nil {
11388		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", nil, "Failure preparing request")
11389		return
11390	}
11391
11392	resp, err := client.GetPartitionLoadInformationSender(req)
11393	if err != nil {
11394		result.Response = autorest.Response{Response: resp}
11395		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", resp, "Failure sending request")
11396		return
11397	}
11398
11399	result, err = client.GetPartitionLoadInformationResponder(resp)
11400	if err != nil {
11401		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", resp, "Failure responding to request")
11402		return
11403	}
11404
11405	return
11406}
11407
11408// GetPartitionLoadInformationPreparer prepares the GetPartitionLoadInformation request.
11409func (client BaseClient) GetPartitionLoadInformationPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
11410	pathParameters := map[string]interface{}{
11411		"partitionId": partitionID,
11412	}
11413
11414	const APIVersion = "6.0"
11415	queryParameters := map[string]interface{}{
11416		"api-version": APIVersion,
11417	}
11418	if timeout != nil {
11419		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11420	} else {
11421		queryParameters["timeout"] = autorest.Encode("query", 60)
11422	}
11423
11424	preparer := autorest.CreatePreparer(
11425		autorest.AsGet(),
11426		autorest.WithBaseURL(client.BaseURI),
11427		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetLoadInformation", pathParameters),
11428		autorest.WithQueryParameters(queryParameters))
11429	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11430}
11431
11432// GetPartitionLoadInformationSender sends the GetPartitionLoadInformation request. The method will close the
11433// http.Response Body if it receives an error.
11434func (client BaseClient) GetPartitionLoadInformationSender(req *http.Request) (*http.Response, error) {
11435	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11436}
11437
11438// GetPartitionLoadInformationResponder handles the response to the GetPartitionLoadInformation request. The method always
11439// closes the http.Response Body.
11440func (client BaseClient) GetPartitionLoadInformationResponder(resp *http.Response) (result PartitionLoadInformation, err error) {
11441	err = autorest.Respond(
11442		resp,
11443		azure.WithErrorUnlessStatusCode(http.StatusOK),
11444		autorest.ByUnmarshallingJSON(&result),
11445		autorest.ByClosing())
11446	result.Response = autorest.Response{Response: resp}
11447	return
11448}
11449
11450// GetPartitionReplicaEventList the response is list of ReplicaEvent objects.
11451// Parameters:
11452// partitionID - the identity of the partition.
11453// replicaID - the identifier of the replica.
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) 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) {
11466	if tracing.IsEnabled() {
11467		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionReplicaEventList")
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", "GetPartitionReplicaEventList", err.Error())
11483	}
11484
11485	req, err := client.GetPartitionReplicaEventListPreparer(ctx, partitionID, replicaID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
11486	if err != nil {
11487		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", nil, "Failure preparing request")
11488		return
11489	}
11490
11491	resp, err := client.GetPartitionReplicaEventListSender(req)
11492	if err != nil {
11493		result.Response = autorest.Response{Response: resp}
11494		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", resp, "Failure sending request")
11495		return
11496	}
11497
11498	result, err = client.GetPartitionReplicaEventListResponder(resp)
11499	if err != nil {
11500		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", resp, "Failure responding to request")
11501		return
11502	}
11503
11504	return
11505}
11506
11507// GetPartitionReplicaEventListPreparer prepares the GetPartitionReplicaEventList request.
11508func (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) {
11509	pathParameters := map[string]interface{}{
11510		"partitionId": partitionID,
11511		"replicaId":   replicaID,
11512	}
11513
11514	const APIVersion = "6.2-preview"
11515	queryParameters := map[string]interface{}{
11516		"api-version":  APIVersion,
11517		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
11518		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
11519	}
11520	if timeout != nil {
11521		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11522	} else {
11523		queryParameters["timeout"] = autorest.Encode("query", 60)
11524	}
11525	if len(eventsTypesFilter) > 0 {
11526		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
11527	}
11528	if excludeAnalysisEvents != nil {
11529		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
11530	}
11531	if skipCorrelationLookup != nil {
11532		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
11533	}
11534
11535	preparer := autorest.CreatePreparer(
11536		autorest.AsGet(),
11537		autorest.WithBaseURL(client.BaseURI),
11538		autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Replicas/{replicaId}/$/Events", pathParameters),
11539		autorest.WithQueryParameters(queryParameters))
11540	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11541}
11542
11543// GetPartitionReplicaEventListSender sends the GetPartitionReplicaEventList request. The method will close the
11544// http.Response Body if it receives an error.
11545func (client BaseClient) GetPartitionReplicaEventListSender(req *http.Request) (*http.Response, error) {
11546	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11547}
11548
11549// GetPartitionReplicaEventListResponder handles the response to the GetPartitionReplicaEventList request. The method always
11550// closes the http.Response Body.
11551func (client BaseClient) GetPartitionReplicaEventListResponder(resp *http.Response) (result ListReplicaEvent, err error) {
11552	err = autorest.Respond(
11553		resp,
11554		azure.WithErrorUnlessStatusCode(http.StatusOK),
11555		autorest.ByUnmarshallingJSON(&result),
11556		autorest.ByClosing())
11557	result.Response = autorest.Response{Response: resp}
11558	return
11559}
11560
11561// GetPartitionReplicasEventList the response is list of ReplicaEvent objects.
11562// Parameters:
11563// partitionID - the identity of the partition.
11564// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11565// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11566// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11567// duration that the client is willing to wait for the requested operation to complete. The default value for
11568// this parameter is 60 seconds.
11569// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
11570// be included in the response.
11571// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
11572// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
11573// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
11574// populated.
11575func (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) {
11576	if tracing.IsEnabled() {
11577		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionReplicasEventList")
11578		defer func() {
11579			sc := -1
11580			if result.Response.Response != nil {
11581				sc = result.Response.Response.StatusCode
11582			}
11583			tracing.EndSpan(ctx, sc, err)
11584		}()
11585	}
11586	if err := validation.Validate([]validation.Validation{
11587		{TargetValue: timeout,
11588			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11589				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11590					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11591				}}}}}); err != nil {
11592		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionReplicasEventList", err.Error())
11593	}
11594
11595	req, err := client.GetPartitionReplicasEventListPreparer(ctx, partitionID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
11596	if err != nil {
11597		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", nil, "Failure preparing request")
11598		return
11599	}
11600
11601	resp, err := client.GetPartitionReplicasEventListSender(req)
11602	if err != nil {
11603		result.Response = autorest.Response{Response: resp}
11604		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", resp, "Failure sending request")
11605		return
11606	}
11607
11608	result, err = client.GetPartitionReplicasEventListResponder(resp)
11609	if err != nil {
11610		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", resp, "Failure responding to request")
11611		return
11612	}
11613
11614	return
11615}
11616
11617// GetPartitionReplicasEventListPreparer prepares the GetPartitionReplicasEventList request.
11618func (client BaseClient) GetPartitionReplicasEventListPreparer(ctx context.Context, partitionID uuid.UUID, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
11619	pathParameters := map[string]interface{}{
11620		"partitionId": partitionID,
11621	}
11622
11623	const APIVersion = "6.2-preview"
11624	queryParameters := map[string]interface{}{
11625		"api-version":  APIVersion,
11626		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
11627		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
11628	}
11629	if timeout != nil {
11630		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11631	} else {
11632		queryParameters["timeout"] = autorest.Encode("query", 60)
11633	}
11634	if len(eventsTypesFilter) > 0 {
11635		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
11636	}
11637	if excludeAnalysisEvents != nil {
11638		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
11639	}
11640	if skipCorrelationLookup != nil {
11641		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
11642	}
11643
11644	preparer := autorest.CreatePreparer(
11645		autorest.AsGet(),
11646		autorest.WithBaseURL(client.BaseURI),
11647		autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Replicas/Events", pathParameters),
11648		autorest.WithQueryParameters(queryParameters))
11649	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11650}
11651
11652// GetPartitionReplicasEventListSender sends the GetPartitionReplicasEventList request. The method will close the
11653// http.Response Body if it receives an error.
11654func (client BaseClient) GetPartitionReplicasEventListSender(req *http.Request) (*http.Response, error) {
11655	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11656}
11657
11658// GetPartitionReplicasEventListResponder handles the response to the GetPartitionReplicasEventList request. The method always
11659// closes the http.Response Body.
11660func (client BaseClient) GetPartitionReplicasEventListResponder(resp *http.Response) (result ListReplicaEvent, err error) {
11661	err = autorest.Respond(
11662		resp,
11663		azure.WithErrorUnlessStatusCode(http.StatusOK),
11664		autorest.ByUnmarshallingJSON(&result),
11665		autorest.ByClosing())
11666	result.Response = autorest.Response{Response: resp}
11667	return
11668}
11669
11670// GetPartitionRestartProgress gets the progress of a PartitionRestart started with StartPartitionRestart using the
11671// provided OperationId.
11672// Parameters:
11673// serviceID - the identity of the service. This ID is typically the full name of the service without the
11674// 'fabric:' URI scheme.
11675// Starting from version 6.0, hierarchical names are delimited with the "~" character.
11676// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
11677// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
11678// partitionID - the identity of the partition.
11679// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
11680// API
11681// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11682// duration that the client is willing to wait for the requested operation to complete. The default value for
11683// this parameter is 60 seconds.
11684func (client BaseClient) GetPartitionRestartProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionRestartProgress, err error) {
11685	if tracing.IsEnabled() {
11686		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionRestartProgress")
11687		defer func() {
11688			sc := -1
11689			if result.Response.Response != nil {
11690				sc = result.Response.Response.StatusCode
11691			}
11692			tracing.EndSpan(ctx, sc, err)
11693		}()
11694	}
11695	if err := validation.Validate([]validation.Validation{
11696		{TargetValue: timeout,
11697			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11698				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11699					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11700				}}}}}); err != nil {
11701		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestartProgress", err.Error())
11702	}
11703
11704	req, err := client.GetPartitionRestartProgressPreparer(ctx, serviceID, partitionID, operationID, timeout)
11705	if err != nil {
11706		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", nil, "Failure preparing request")
11707		return
11708	}
11709
11710	resp, err := client.GetPartitionRestartProgressSender(req)
11711	if err != nil {
11712		result.Response = autorest.Response{Response: resp}
11713		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", resp, "Failure sending request")
11714		return
11715	}
11716
11717	result, err = client.GetPartitionRestartProgressResponder(resp)
11718	if err != nil {
11719		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", resp, "Failure responding to request")
11720		return
11721	}
11722
11723	return
11724}
11725
11726// GetPartitionRestartProgressPreparer prepares the GetPartitionRestartProgress request.
11727func (client BaseClient) GetPartitionRestartProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) {
11728	pathParameters := map[string]interface{}{
11729		"partitionId": partitionID,
11730		"serviceId":   serviceID,
11731	}
11732
11733	const APIVersion = "6.0"
11734	queryParameters := map[string]interface{}{
11735		"api-version": APIVersion,
11736		"OperationId": autorest.Encode("query", operationID),
11737	}
11738	if timeout != nil {
11739		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11740	} else {
11741		queryParameters["timeout"] = autorest.Encode("query", 60)
11742	}
11743
11744	preparer := autorest.CreatePreparer(
11745		autorest.AsGet(),
11746		autorest.WithBaseURL(client.BaseURI),
11747		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetRestartProgress", pathParameters),
11748		autorest.WithQueryParameters(queryParameters))
11749	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11750}
11751
11752// GetPartitionRestartProgressSender sends the GetPartitionRestartProgress request. The method will close the
11753// http.Response Body if it receives an error.
11754func (client BaseClient) GetPartitionRestartProgressSender(req *http.Request) (*http.Response, error) {
11755	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11756}
11757
11758// GetPartitionRestartProgressResponder handles the response to the GetPartitionRestartProgress request. The method always
11759// closes the http.Response Body.
11760func (client BaseClient) GetPartitionRestartProgressResponder(resp *http.Response) (result PartitionRestartProgress, err error) {
11761	err = autorest.Respond(
11762		resp,
11763		azure.WithErrorUnlessStatusCode(http.StatusOK),
11764		autorest.ByUnmarshallingJSON(&result),
11765		autorest.ByClosing())
11766	result.Response = autorest.Response{Response: resp}
11767	return
11768}
11769
11770// GetPartitionRestoreProgress returns information about the state of the latest restore operation along with details
11771// or failure reason in case of completion.
11772// Parameters:
11773// partitionID - the identity of the partition.
11774// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11775// duration that the client is willing to wait for the requested operation to complete. The default value for
11776// this parameter is 60 seconds.
11777func (client BaseClient) GetPartitionRestoreProgress(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result RestoreProgressInfo, err error) {
11778	if tracing.IsEnabled() {
11779		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionRestoreProgress")
11780		defer func() {
11781			sc := -1
11782			if result.Response.Response != nil {
11783				sc = result.Response.Response.StatusCode
11784			}
11785			tracing.EndSpan(ctx, sc, err)
11786		}()
11787	}
11788	if err := validation.Validate([]validation.Validation{
11789		{TargetValue: timeout,
11790			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11791				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11792					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11793				}}}}}); err != nil {
11794		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestoreProgress", err.Error())
11795	}
11796
11797	req, err := client.GetPartitionRestoreProgressPreparer(ctx, partitionID, timeout)
11798	if err != nil {
11799		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", nil, "Failure preparing request")
11800		return
11801	}
11802
11803	resp, err := client.GetPartitionRestoreProgressSender(req)
11804	if err != nil {
11805		result.Response = autorest.Response{Response: resp}
11806		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", resp, "Failure sending request")
11807		return
11808	}
11809
11810	result, err = client.GetPartitionRestoreProgressResponder(resp)
11811	if err != nil {
11812		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", resp, "Failure responding to request")
11813		return
11814	}
11815
11816	return
11817}
11818
11819// GetPartitionRestoreProgressPreparer prepares the GetPartitionRestoreProgress request.
11820func (client BaseClient) GetPartitionRestoreProgressPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
11821	pathParameters := map[string]interface{}{
11822		"partitionId": partitionID,
11823	}
11824
11825	const APIVersion = "6.2-preview"
11826	queryParameters := map[string]interface{}{
11827		"api-version": APIVersion,
11828	}
11829	if timeout != nil {
11830		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11831	} else {
11832		queryParameters["timeout"] = autorest.Encode("query", 60)
11833	}
11834
11835	preparer := autorest.CreatePreparer(
11836		autorest.AsGet(),
11837		autorest.WithBaseURL(client.BaseURI),
11838		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetRestoreProgress", pathParameters),
11839		autorest.WithQueryParameters(queryParameters))
11840	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11841}
11842
11843// GetPartitionRestoreProgressSender sends the GetPartitionRestoreProgress request. The method will close the
11844// http.Response Body if it receives an error.
11845func (client BaseClient) GetPartitionRestoreProgressSender(req *http.Request) (*http.Response, error) {
11846	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11847}
11848
11849// GetPartitionRestoreProgressResponder handles the response to the GetPartitionRestoreProgress request. The method always
11850// closes the http.Response Body.
11851func (client BaseClient) GetPartitionRestoreProgressResponder(resp *http.Response) (result RestoreProgressInfo, err error) {
11852	err = autorest.Respond(
11853		resp,
11854		azure.WithErrorUnlessStatusCode(http.StatusOK),
11855		autorest.ByUnmarshallingJSON(&result),
11856		autorest.ByClosing())
11857	result.Response = autorest.Response{Response: resp}
11858	return
11859}
11860
11861// GetPartitionsEventList the response is list of PartitionEvent objects.
11862// Parameters:
11863// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11864// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11865// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11866// duration that the client is willing to wait for the requested operation to complete. The default value for
11867// this parameter is 60 seconds.
11868// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
11869// be included in the response.
11870// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
11871// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
11872// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
11873// populated.
11874func (client BaseClient) GetPartitionsEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListPartitionEvent, err error) {
11875	if tracing.IsEnabled() {
11876		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionsEventList")
11877		defer func() {
11878			sc := -1
11879			if result.Response.Response != nil {
11880				sc = result.Response.Response.StatusCode
11881			}
11882			tracing.EndSpan(ctx, sc, err)
11883		}()
11884	}
11885	if err := validation.Validate([]validation.Validation{
11886		{TargetValue: timeout,
11887			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11888				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11889					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11890				}}}}}); err != nil {
11891		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionsEventList", err.Error())
11892	}
11893
11894	req, err := client.GetPartitionsEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
11895	if err != nil {
11896		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", nil, "Failure preparing request")
11897		return
11898	}
11899
11900	resp, err := client.GetPartitionsEventListSender(req)
11901	if err != nil {
11902		result.Response = autorest.Response{Response: resp}
11903		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", resp, "Failure sending request")
11904		return
11905	}
11906
11907	result, err = client.GetPartitionsEventListResponder(resp)
11908	if err != nil {
11909		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", resp, "Failure responding to request")
11910		return
11911	}
11912
11913	return
11914}
11915
11916// GetPartitionsEventListPreparer prepares the GetPartitionsEventList request.
11917func (client BaseClient) GetPartitionsEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
11918	const APIVersion = "6.2-preview"
11919	queryParameters := map[string]interface{}{
11920		"api-version":  APIVersion,
11921		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
11922		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
11923	}
11924	if timeout != nil {
11925		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11926	} else {
11927		queryParameters["timeout"] = autorest.Encode("query", 60)
11928	}
11929	if len(eventsTypesFilter) > 0 {
11930		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
11931	}
11932	if excludeAnalysisEvents != nil {
11933		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
11934	}
11935	if skipCorrelationLookup != nil {
11936		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
11937	}
11938
11939	preparer := autorest.CreatePreparer(
11940		autorest.AsGet(),
11941		autorest.WithBaseURL(client.BaseURI),
11942		autorest.WithPath("/EventsStore/Partitions/Events"),
11943		autorest.WithQueryParameters(queryParameters))
11944	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11945}
11946
11947// GetPartitionsEventListSender sends the GetPartitionsEventList request. The method will close the
11948// http.Response Body if it receives an error.
11949func (client BaseClient) GetPartitionsEventListSender(req *http.Request) (*http.Response, error) {
11950	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11951}
11952
11953// GetPartitionsEventListResponder handles the response to the GetPartitionsEventList request. The method always
11954// closes the http.Response Body.
11955func (client BaseClient) GetPartitionsEventListResponder(resp *http.Response) (result ListPartitionEvent, err error) {
11956	err = autorest.Respond(
11957		resp,
11958		azure.WithErrorUnlessStatusCode(http.StatusOK),
11959		autorest.ByUnmarshallingJSON(&result),
11960		autorest.ByClosing())
11961	result.Response = autorest.Response{Response: resp}
11962	return
11963}
11964
11965// GetPropertyInfo gets the specified Service Fabric property under a given name. This will always return both value
11966// and metadata.
11967// Parameters:
11968// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
11969// propertyName - specifies the name of the property to get.
11970// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11971// duration that the client is willing to wait for the requested operation to complete. The default value for
11972// this parameter is 60 seconds.
11973func (client BaseClient) GetPropertyInfo(ctx context.Context, nameID string, propertyName string, timeout *int64) (result PropertyInfo, err error) {
11974	if tracing.IsEnabled() {
11975		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPropertyInfo")
11976		defer func() {
11977			sc := -1
11978			if result.Response.Response != nil {
11979				sc = result.Response.Response.StatusCode
11980			}
11981			tracing.EndSpan(ctx, sc, err)
11982		}()
11983	}
11984	if err := validation.Validate([]validation.Validation{
11985		{TargetValue: timeout,
11986			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11987				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11988					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11989				}}}}}); err != nil {
11990		return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfo", err.Error())
11991	}
11992
11993	req, err := client.GetPropertyInfoPreparer(ctx, nameID, propertyName, timeout)
11994	if err != nil {
11995		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", nil, "Failure preparing request")
11996		return
11997	}
11998
11999	resp, err := client.GetPropertyInfoSender(req)
12000	if err != nil {
12001		result.Response = autorest.Response{Response: resp}
12002		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", resp, "Failure sending request")
12003		return
12004	}
12005
12006	result, err = client.GetPropertyInfoResponder(resp)
12007	if err != nil {
12008		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", resp, "Failure responding to request")
12009		return
12010	}
12011
12012	return
12013}
12014
12015// GetPropertyInfoPreparer prepares the GetPropertyInfo request.
12016func (client BaseClient) GetPropertyInfoPreparer(ctx context.Context, nameID string, propertyName string, timeout *int64) (*http.Request, error) {
12017	pathParameters := map[string]interface{}{
12018		"nameId": nameID,
12019	}
12020
12021	const APIVersion = "6.0"
12022	queryParameters := map[string]interface{}{
12023		"api-version":  APIVersion,
12024		"PropertyName": autorest.Encode("query", propertyName),
12025	}
12026	if timeout != nil {
12027		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12028	} else {
12029		queryParameters["timeout"] = autorest.Encode("query", 60)
12030	}
12031
12032	preparer := autorest.CreatePreparer(
12033		autorest.AsGet(),
12034		autorest.WithBaseURL(client.BaseURI),
12035		autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters),
12036		autorest.WithQueryParameters(queryParameters))
12037	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12038}
12039
12040// GetPropertyInfoSender sends the GetPropertyInfo request. The method will close the
12041// http.Response Body if it receives an error.
12042func (client BaseClient) GetPropertyInfoSender(req *http.Request) (*http.Response, error) {
12043	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12044}
12045
12046// GetPropertyInfoResponder handles the response to the GetPropertyInfo request. The method always
12047// closes the http.Response Body.
12048func (client BaseClient) GetPropertyInfoResponder(resp *http.Response) (result PropertyInfo, err error) {
12049	err = autorest.Respond(
12050		resp,
12051		azure.WithErrorUnlessStatusCode(http.StatusOK),
12052		autorest.ByUnmarshallingJSON(&result),
12053		autorest.ByClosing())
12054	result.Response = autorest.Response{Response: resp}
12055	return
12056}
12057
12058// GetPropertyInfoList a Service Fabric name can have one or more named properties that store custom information. This
12059// operation gets the information about these properties in a paged list. The information includes name, value, and
12060// metadata about each of the properties.
12061// Parameters:
12062// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
12063// includeValues - allows specifying whether to include the values of the properties returned. True if values
12064// should be returned with the metadata; False to return only property metadata.
12065// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
12066// token with a non-empty value is included in the response of the API when the results from the system do not
12067// fit in a single response. When this value is passed to the next API call, the API returns next set of
12068// results. If there are no further results, then the continuation token does not contain a value. The value of
12069// this parameter should not be URL encoded.
12070// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12071// duration that the client is willing to wait for the requested operation to complete. The default value for
12072// this parameter is 60 seconds.
12073func (client BaseClient) GetPropertyInfoList(ctx context.Context, nameID string, includeValues *bool, continuationToken string, timeout *int64) (result PagedPropertyInfoList, err error) {
12074	if tracing.IsEnabled() {
12075		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPropertyInfoList")
12076		defer func() {
12077			sc := -1
12078			if result.Response.Response != nil {
12079				sc = result.Response.Response.StatusCode
12080			}
12081			tracing.EndSpan(ctx, sc, err)
12082		}()
12083	}
12084	if err := validation.Validate([]validation.Validation{
12085		{TargetValue: timeout,
12086			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12087				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12088					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12089				}}}}}); err != nil {
12090		return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfoList", err.Error())
12091	}
12092
12093	req, err := client.GetPropertyInfoListPreparer(ctx, nameID, includeValues, continuationToken, timeout)
12094	if err != nil {
12095		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", nil, "Failure preparing request")
12096		return
12097	}
12098
12099	resp, err := client.GetPropertyInfoListSender(req)
12100	if err != nil {
12101		result.Response = autorest.Response{Response: resp}
12102		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", resp, "Failure sending request")
12103		return
12104	}
12105
12106	result, err = client.GetPropertyInfoListResponder(resp)
12107	if err != nil {
12108		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", resp, "Failure responding to request")
12109		return
12110	}
12111
12112	return
12113}
12114
12115// GetPropertyInfoListPreparer prepares the GetPropertyInfoList request.
12116func (client BaseClient) GetPropertyInfoListPreparer(ctx context.Context, nameID string, includeValues *bool, continuationToken string, timeout *int64) (*http.Request, error) {
12117	pathParameters := map[string]interface{}{
12118		"nameId": nameID,
12119	}
12120
12121	const APIVersion = "6.0"
12122	queryParameters := map[string]interface{}{
12123		"api-version": APIVersion,
12124	}
12125	if includeValues != nil {
12126		queryParameters["IncludeValues"] = autorest.Encode("query", *includeValues)
12127	} else {
12128		queryParameters["IncludeValues"] = autorest.Encode("query", false)
12129	}
12130	if len(continuationToken) > 0 {
12131		queryParameters["ContinuationToken"] = continuationToken
12132	}
12133	if timeout != nil {
12134		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12135	} else {
12136		queryParameters["timeout"] = autorest.Encode("query", 60)
12137	}
12138
12139	preparer := autorest.CreatePreparer(
12140		autorest.AsGet(),
12141		autorest.WithBaseURL(client.BaseURI),
12142		autorest.WithPathParameters("/Names/{nameId}/$/GetProperties", pathParameters),
12143		autorest.WithQueryParameters(queryParameters))
12144	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12145}
12146
12147// GetPropertyInfoListSender sends the GetPropertyInfoList request. The method will close the
12148// http.Response Body if it receives an error.
12149func (client BaseClient) GetPropertyInfoListSender(req *http.Request) (*http.Response, error) {
12150	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12151}
12152
12153// GetPropertyInfoListResponder handles the response to the GetPropertyInfoList request. The method always
12154// closes the http.Response Body.
12155func (client BaseClient) GetPropertyInfoListResponder(resp *http.Response) (result PagedPropertyInfoList, err error) {
12156	err = autorest.Respond(
12157		resp,
12158		azure.WithErrorUnlessStatusCode(http.StatusOK),
12159		autorest.ByUnmarshallingJSON(&result),
12160		autorest.ByClosing())
12161	result.Response = autorest.Response{Response: resp}
12162	return
12163}
12164
12165// GetProvisionedFabricCodeVersionInfoList gets a list of information about fabric code versions that are provisioned
12166// in the cluster. The parameter CodeVersion can be used to optionally filter the output to only that particular
12167// version.
12168// Parameters:
12169// codeVersion - the product version of Service Fabric.
12170// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12171// duration that the client is willing to wait for the requested operation to complete. The default value for
12172// this parameter is 60 seconds.
12173func (client BaseClient) GetProvisionedFabricCodeVersionInfoList(ctx context.Context, codeVersion string, timeout *int64) (result ListFabricCodeVersionInfo, err error) {
12174	if tracing.IsEnabled() {
12175		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetProvisionedFabricCodeVersionInfoList")
12176		defer func() {
12177			sc := -1
12178			if result.Response.Response != nil {
12179				sc = result.Response.Response.StatusCode
12180			}
12181			tracing.EndSpan(ctx, sc, err)
12182		}()
12183	}
12184	if err := validation.Validate([]validation.Validation{
12185		{TargetValue: timeout,
12186			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12187				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12188					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12189				}}}}}); err != nil {
12190		return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", err.Error())
12191	}
12192
12193	req, err := client.GetProvisionedFabricCodeVersionInfoListPreparer(ctx, codeVersion, timeout)
12194	if err != nil {
12195		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", nil, "Failure preparing request")
12196		return
12197	}
12198
12199	resp, err := client.GetProvisionedFabricCodeVersionInfoListSender(req)
12200	if err != nil {
12201		result.Response = autorest.Response{Response: resp}
12202		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", resp, "Failure sending request")
12203		return
12204	}
12205
12206	result, err = client.GetProvisionedFabricCodeVersionInfoListResponder(resp)
12207	if err != nil {
12208		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", resp, "Failure responding to request")
12209		return
12210	}
12211
12212	return
12213}
12214
12215// GetProvisionedFabricCodeVersionInfoListPreparer prepares the GetProvisionedFabricCodeVersionInfoList request.
12216func (client BaseClient) GetProvisionedFabricCodeVersionInfoListPreparer(ctx context.Context, codeVersion string, timeout *int64) (*http.Request, error) {
12217	const APIVersion = "6.0"
12218	queryParameters := map[string]interface{}{
12219		"api-version": APIVersion,
12220	}
12221	if len(codeVersion) > 0 {
12222		queryParameters["CodeVersion"] = autorest.Encode("query", codeVersion)
12223	}
12224	if timeout != nil {
12225		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12226	} else {
12227		queryParameters["timeout"] = autorest.Encode("query", 60)
12228	}
12229
12230	preparer := autorest.CreatePreparer(
12231		autorest.AsGet(),
12232		autorest.WithBaseURL(client.BaseURI),
12233		autorest.WithPath("/$/GetProvisionedCodeVersions"),
12234		autorest.WithQueryParameters(queryParameters))
12235	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12236}
12237
12238// GetProvisionedFabricCodeVersionInfoListSender sends the GetProvisionedFabricCodeVersionInfoList request. The method will close the
12239// http.Response Body if it receives an error.
12240func (client BaseClient) GetProvisionedFabricCodeVersionInfoListSender(req *http.Request) (*http.Response, error) {
12241	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12242}
12243
12244// GetProvisionedFabricCodeVersionInfoListResponder handles the response to the GetProvisionedFabricCodeVersionInfoList request. The method always
12245// closes the http.Response Body.
12246func (client BaseClient) GetProvisionedFabricCodeVersionInfoListResponder(resp *http.Response) (result ListFabricCodeVersionInfo, err error) {
12247	err = autorest.Respond(
12248		resp,
12249		azure.WithErrorUnlessStatusCode(http.StatusOK),
12250		autorest.ByUnmarshallingJSON(&result.Value),
12251		autorest.ByClosing())
12252	result.Response = autorest.Response{Response: resp}
12253	return
12254}
12255
12256// GetProvisionedFabricConfigVersionInfoList gets a list of information about fabric config versions that are
12257// provisioned in the cluster. The parameter ConfigVersion can be used to optionally filter the output to only that
12258// particular version.
12259// Parameters:
12260// configVersion - the config version of Service Fabric.
12261// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12262// duration that the client is willing to wait for the requested operation to complete. The default value for
12263// this parameter is 60 seconds.
12264func (client BaseClient) GetProvisionedFabricConfigVersionInfoList(ctx context.Context, configVersion string, timeout *int64) (result ListFabricConfigVersionInfo, err error) {
12265	if tracing.IsEnabled() {
12266		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetProvisionedFabricConfigVersionInfoList")
12267		defer func() {
12268			sc := -1
12269			if result.Response.Response != nil {
12270				sc = result.Response.Response.StatusCode
12271			}
12272			tracing.EndSpan(ctx, sc, err)
12273		}()
12274	}
12275	if err := validation.Validate([]validation.Validation{
12276		{TargetValue: timeout,
12277			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12278				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12279					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12280				}}}}}); err != nil {
12281		return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", err.Error())
12282	}
12283
12284	req, err := client.GetProvisionedFabricConfigVersionInfoListPreparer(ctx, configVersion, timeout)
12285	if err != nil {
12286		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", nil, "Failure preparing request")
12287		return
12288	}
12289
12290	resp, err := client.GetProvisionedFabricConfigVersionInfoListSender(req)
12291	if err != nil {
12292		result.Response = autorest.Response{Response: resp}
12293		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", resp, "Failure sending request")
12294		return
12295	}
12296
12297	result, err = client.GetProvisionedFabricConfigVersionInfoListResponder(resp)
12298	if err != nil {
12299		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", resp, "Failure responding to request")
12300		return
12301	}
12302
12303	return
12304}
12305
12306// GetProvisionedFabricConfigVersionInfoListPreparer prepares the GetProvisionedFabricConfigVersionInfoList request.
12307func (client BaseClient) GetProvisionedFabricConfigVersionInfoListPreparer(ctx context.Context, configVersion string, timeout *int64) (*http.Request, error) {
12308	const APIVersion = "6.0"
12309	queryParameters := map[string]interface{}{
12310		"api-version": APIVersion,
12311	}
12312	if len(configVersion) > 0 {
12313		queryParameters["ConfigVersion"] = autorest.Encode("query", configVersion)
12314	}
12315	if timeout != nil {
12316		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12317	} else {
12318		queryParameters["timeout"] = autorest.Encode("query", 60)
12319	}
12320
12321	preparer := autorest.CreatePreparer(
12322		autorest.AsGet(),
12323		autorest.WithBaseURL(client.BaseURI),
12324		autorest.WithPath("/$/GetProvisionedConfigVersions"),
12325		autorest.WithQueryParameters(queryParameters))
12326	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12327}
12328
12329// GetProvisionedFabricConfigVersionInfoListSender sends the GetProvisionedFabricConfigVersionInfoList request. The method will close the
12330// http.Response Body if it receives an error.
12331func (client BaseClient) GetProvisionedFabricConfigVersionInfoListSender(req *http.Request) (*http.Response, error) {
12332	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12333}
12334
12335// GetProvisionedFabricConfigVersionInfoListResponder handles the response to the GetProvisionedFabricConfigVersionInfoList request. The method always
12336// closes the http.Response Body.
12337func (client BaseClient) GetProvisionedFabricConfigVersionInfoListResponder(resp *http.Response) (result ListFabricConfigVersionInfo, err error) {
12338	err = autorest.Respond(
12339		resp,
12340		azure.WithErrorUnlessStatusCode(http.StatusOK),
12341		autorest.ByUnmarshallingJSON(&result.Value),
12342		autorest.ByClosing())
12343	result.Response = autorest.Response{Response: resp}
12344	return
12345}
12346
12347// GetQuorumLossProgress gets the progress of a quorum loss operation started with StartQuorumLoss, using the provided
12348// OperationId.
12349// Parameters:
12350// serviceID - the identity of the service. This ID is typically the full name of the service without the
12351// 'fabric:' URI scheme.
12352// Starting from version 6.0, hierarchical names are delimited with the "~" character.
12353// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
12354// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
12355// partitionID - the identity of the partition.
12356// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
12357// API
12358// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12359// duration that the client is willing to wait for the requested operation to complete. The default value for
12360// this parameter is 60 seconds.
12361func (client BaseClient) GetQuorumLossProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionQuorumLossProgress, err error) {
12362	if tracing.IsEnabled() {
12363		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetQuorumLossProgress")
12364		defer func() {
12365			sc := -1
12366			if result.Response.Response != nil {
12367				sc = result.Response.Response.StatusCode
12368			}
12369			tracing.EndSpan(ctx, sc, err)
12370		}()
12371	}
12372	if err := validation.Validate([]validation.Validation{
12373		{TargetValue: timeout,
12374			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12375				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12376					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12377				}}}}}); err != nil {
12378		return result, validation.NewError("servicefabric.BaseClient", "GetQuorumLossProgress", err.Error())
12379	}
12380
12381	req, err := client.GetQuorumLossProgressPreparer(ctx, serviceID, partitionID, operationID, timeout)
12382	if err != nil {
12383		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", nil, "Failure preparing request")
12384		return
12385	}
12386
12387	resp, err := client.GetQuorumLossProgressSender(req)
12388	if err != nil {
12389		result.Response = autorest.Response{Response: resp}
12390		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", resp, "Failure sending request")
12391		return
12392	}
12393
12394	result, err = client.GetQuorumLossProgressResponder(resp)
12395	if err != nil {
12396		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", resp, "Failure responding to request")
12397		return
12398	}
12399
12400	return
12401}
12402
12403// GetQuorumLossProgressPreparer prepares the GetQuorumLossProgress request.
12404func (client BaseClient) GetQuorumLossProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) {
12405	pathParameters := map[string]interface{}{
12406		"partitionId": partitionID,
12407		"serviceId":   serviceID,
12408	}
12409
12410	const APIVersion = "6.0"
12411	queryParameters := map[string]interface{}{
12412		"api-version": APIVersion,
12413		"OperationId": autorest.Encode("query", operationID),
12414	}
12415	if timeout != nil {
12416		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12417	} else {
12418		queryParameters["timeout"] = autorest.Encode("query", 60)
12419	}
12420
12421	preparer := autorest.CreatePreparer(
12422		autorest.AsGet(),
12423		autorest.WithBaseURL(client.BaseURI),
12424		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetQuorumLossProgress", pathParameters),
12425		autorest.WithQueryParameters(queryParameters))
12426	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12427}
12428
12429// GetQuorumLossProgressSender sends the GetQuorumLossProgress request. The method will close the
12430// http.Response Body if it receives an error.
12431func (client BaseClient) GetQuorumLossProgressSender(req *http.Request) (*http.Response, error) {
12432	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12433}
12434
12435// GetQuorumLossProgressResponder handles the response to the GetQuorumLossProgress request. The method always
12436// closes the http.Response Body.
12437func (client BaseClient) GetQuorumLossProgressResponder(resp *http.Response) (result PartitionQuorumLossProgress, err error) {
12438	err = autorest.Respond(
12439		resp,
12440		azure.WithErrorUnlessStatusCode(http.StatusOK),
12441		autorest.ByUnmarshallingJSON(&result),
12442		autorest.ByClosing())
12443	result.Response = autorest.Response{Response: resp}
12444	return
12445}
12446
12447// GetRepairTaskList this API supports the Service Fabric platform; it is not meant to be used directly from your code.
12448// Parameters:
12449// taskIDFilter - the repair task ID prefix to be matched.
12450// stateFilter - a bitwise-OR of the following values, specifying which task states should be included in the
12451// result list.
12452//
12453// - 1 - Created
12454// - 2 - Claimed
12455// - 4 - Preparing
12456// - 8 - Approved
12457// - 16 - Executing
12458// - 32 - Restoring
12459// - 64 - Completed
12460// executorFilter - the name of the repair executor whose claimed tasks should be included in the list.
12461func (client BaseClient) GetRepairTaskList(ctx context.Context, taskIDFilter string, stateFilter *int32, executorFilter string) (result ListRepairTask, err error) {
12462	if tracing.IsEnabled() {
12463		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetRepairTaskList")
12464		defer func() {
12465			sc := -1
12466			if result.Response.Response != nil {
12467				sc = result.Response.Response.StatusCode
12468			}
12469			tracing.EndSpan(ctx, sc, err)
12470		}()
12471	}
12472	req, err := client.GetRepairTaskListPreparer(ctx, taskIDFilter, stateFilter, executorFilter)
12473	if err != nil {
12474		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", nil, "Failure preparing request")
12475		return
12476	}
12477
12478	resp, err := client.GetRepairTaskListSender(req)
12479	if err != nil {
12480		result.Response = autorest.Response{Response: resp}
12481		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", resp, "Failure sending request")
12482		return
12483	}
12484
12485	result, err = client.GetRepairTaskListResponder(resp)
12486	if err != nil {
12487		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", resp, "Failure responding to request")
12488		return
12489	}
12490
12491	return
12492}
12493
12494// GetRepairTaskListPreparer prepares the GetRepairTaskList request.
12495func (client BaseClient) GetRepairTaskListPreparer(ctx context.Context, taskIDFilter string, stateFilter *int32, executorFilter string) (*http.Request, error) {
12496	const APIVersion = "6.0"
12497	queryParameters := map[string]interface{}{
12498		"api-version": APIVersion,
12499	}
12500	if len(taskIDFilter) > 0 {
12501		queryParameters["TaskIdFilter"] = autorest.Encode("query", taskIDFilter)
12502	}
12503	if stateFilter != nil {
12504		queryParameters["StateFilter"] = autorest.Encode("query", *stateFilter)
12505	}
12506	if len(executorFilter) > 0 {
12507		queryParameters["ExecutorFilter"] = autorest.Encode("query", executorFilter)
12508	}
12509
12510	preparer := autorest.CreatePreparer(
12511		autorest.AsGet(),
12512		autorest.WithBaseURL(client.BaseURI),
12513		autorest.WithPath("/$/GetRepairTaskList"),
12514		autorest.WithQueryParameters(queryParameters))
12515	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12516}
12517
12518// GetRepairTaskListSender sends the GetRepairTaskList request. The method will close the
12519// http.Response Body if it receives an error.
12520func (client BaseClient) GetRepairTaskListSender(req *http.Request) (*http.Response, error) {
12521	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12522}
12523
12524// GetRepairTaskListResponder handles the response to the GetRepairTaskList request. The method always
12525// closes the http.Response Body.
12526func (client BaseClient) GetRepairTaskListResponder(resp *http.Response) (result ListRepairTask, err error) {
12527	err = autorest.Respond(
12528		resp,
12529		azure.WithErrorUnlessStatusCode(http.StatusOK),
12530		autorest.ByUnmarshallingJSON(&result.Value),
12531		autorest.ByClosing())
12532	result.Response = autorest.Response{Response: resp}
12533	return
12534}
12535
12536// GetReplica gets the information about the specified replica of a given service of an application. The information
12537// includes the runtime properties of the replica instance.
12538// Parameters:
12539// applicationResourceName - service Fabric application resource name.
12540// serviceResourceName - service Fabric service resource name.
12541// replicaName - service Fabric replica name.
12542func (client BaseClient) GetReplica(ctx context.Context, applicationResourceName string, serviceResourceName string, replicaName string) (result ServiceResourceReplicaDescription, err error) {
12543	if tracing.IsEnabled() {
12544		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplica")
12545		defer func() {
12546			sc := -1
12547			if result.Response.Response != nil {
12548				sc = result.Response.Response.StatusCode
12549			}
12550			tracing.EndSpan(ctx, sc, err)
12551		}()
12552	}
12553	req, err := client.GetReplicaPreparer(ctx, applicationResourceName, serviceResourceName, replicaName)
12554	if err != nil {
12555		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplica", nil, "Failure preparing request")
12556		return
12557	}
12558
12559	resp, err := client.GetReplicaSender(req)
12560	if err != nil {
12561		result.Response = autorest.Response{Response: resp}
12562		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplica", resp, "Failure sending request")
12563		return
12564	}
12565
12566	result, err = client.GetReplicaResponder(resp)
12567	if err != nil {
12568		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplica", resp, "Failure responding to request")
12569		return
12570	}
12571
12572	return
12573}
12574
12575// GetReplicaPreparer prepares the GetReplica request.
12576func (client BaseClient) GetReplicaPreparer(ctx context.Context, applicationResourceName string, serviceResourceName string, replicaName string) (*http.Request, error) {
12577	pathParameters := map[string]interface{}{
12578		"applicationResourceName": applicationResourceName,
12579		"replicaName":             replicaName,
12580		"serviceResourceName":     serviceResourceName,
12581	}
12582
12583	const APIVersion = "6.3-preview"
12584	queryParameters := map[string]interface{}{
12585		"api-version": APIVersion,
12586	}
12587
12588	preparer := autorest.CreatePreparer(
12589		autorest.AsGet(),
12590		autorest.WithBaseURL(client.BaseURI),
12591		autorest.WithPathParameters("/Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}/Replicas/{replicaName}", pathParameters),
12592		autorest.WithQueryParameters(queryParameters))
12593	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12594}
12595
12596// GetReplicaSender sends the GetReplica request. The method will close the
12597// http.Response Body if it receives an error.
12598func (client BaseClient) GetReplicaSender(req *http.Request) (*http.Response, error) {
12599	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12600}
12601
12602// GetReplicaResponder handles the response to the GetReplica request. The method always
12603// closes the http.Response Body.
12604func (client BaseClient) GetReplicaResponder(resp *http.Response) (result ServiceResourceReplicaDescription, err error) {
12605	err = autorest.Respond(
12606		resp,
12607		azure.WithErrorUnlessStatusCode(http.StatusOK),
12608		autorest.ByUnmarshallingJSON(&result),
12609		autorest.ByClosing())
12610	result.Response = autorest.Response{Response: resp}
12611	return
12612}
12613
12614// GetReplicaHealth gets the health of a Service Fabric replica.
12615// Use EventsHealthStateFilter to filter the collection of health events reported on the replica based on the health
12616// state.
12617// Parameters:
12618// partitionID - the identity of the partition.
12619// replicaID - the identifier of the replica.
12620// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
12621// state.
12622// The possible values for this parameter include integer value of one of the following health states.
12623// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
12624// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
12625// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
12626// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
12627//
12628// - Default - Default value. Matches any HealthState. The value is zero.
12629// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
12630// collection of states. The value is 1.
12631// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
12632// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
12633// - Error - Filter that matches input with HealthState value Error. The value is 8.
12634// - All - Filter that matches input with any HealthState value. The value is 65535.
12635// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12636// duration that the client is willing to wait for the requested operation to complete. The default value for
12637// this parameter is 60 seconds.
12638func (client BaseClient) GetReplicaHealth(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, timeout *int64) (result ReplicaHealthModel, err error) {
12639	if tracing.IsEnabled() {
12640		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaHealth")
12641		defer func() {
12642			sc := -1
12643			if result.Response.Response != nil {
12644				sc = result.Response.Response.StatusCode
12645			}
12646			tracing.EndSpan(ctx, sc, err)
12647		}()
12648	}
12649	if err := validation.Validate([]validation.Validation{
12650		{TargetValue: timeout,
12651			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12652				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12653					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12654				}}}}}); err != nil {
12655		return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealth", err.Error())
12656	}
12657
12658	req, err := client.GetReplicaHealthPreparer(ctx, partitionID, replicaID, eventsHealthStateFilter, timeout)
12659	if err != nil {
12660		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", nil, "Failure preparing request")
12661		return
12662	}
12663
12664	resp, err := client.GetReplicaHealthSender(req)
12665	if err != nil {
12666		result.Response = autorest.Response{Response: resp}
12667		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", resp, "Failure sending request")
12668		return
12669	}
12670
12671	result, err = client.GetReplicaHealthResponder(resp)
12672	if err != nil {
12673		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", resp, "Failure responding to request")
12674		return
12675	}
12676
12677	return
12678}
12679
12680// GetReplicaHealthPreparer prepares the GetReplicaHealth request.
12681func (client BaseClient) GetReplicaHealthPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) {
12682	pathParameters := map[string]interface{}{
12683		"partitionId": partitionID,
12684		"replicaId":   replicaID,
12685	}
12686
12687	const APIVersion = "6.0"
12688	queryParameters := map[string]interface{}{
12689		"api-version": APIVersion,
12690	}
12691	if eventsHealthStateFilter != nil {
12692		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
12693	} else {
12694		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
12695	}
12696	if timeout != nil {
12697		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12698	} else {
12699		queryParameters["timeout"] = autorest.Encode("query", 60)
12700	}
12701
12702	preparer := autorest.CreatePreparer(
12703		autorest.AsGet(),
12704		autorest.WithBaseURL(client.BaseURI),
12705		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth", pathParameters),
12706		autorest.WithQueryParameters(queryParameters))
12707	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12708}
12709
12710// GetReplicaHealthSender sends the GetReplicaHealth request. The method will close the
12711// http.Response Body if it receives an error.
12712func (client BaseClient) GetReplicaHealthSender(req *http.Request) (*http.Response, error) {
12713	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12714}
12715
12716// GetReplicaHealthResponder handles the response to the GetReplicaHealth request. The method always
12717// closes the http.Response Body.
12718func (client BaseClient) GetReplicaHealthResponder(resp *http.Response) (result ReplicaHealthModel, err error) {
12719	err = autorest.Respond(
12720		resp,
12721		azure.WithErrorUnlessStatusCode(http.StatusOK),
12722		autorest.ByUnmarshallingJSON(&result),
12723		autorest.ByClosing())
12724	result.Response = autorest.Response{Response: resp}
12725	return
12726}
12727
12728// GetReplicaHealthUsingPolicy gets the health of a Service Fabric stateful service replica or stateless service
12729// instance.
12730// Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health
12731// state.
12732// Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only
12733// uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while
12734// evaluating the health of the replica.
12735// Parameters:
12736// partitionID - the identity of the partition.
12737// replicaID - the identifier of the replica.
12738// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
12739// state.
12740// The possible values for this parameter include integer value of one of the following health states.
12741// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
12742// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
12743// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
12744// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
12745//
12746// - Default - Default value. Matches any HealthState. The value is zero.
12747// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
12748// collection of states. The value is 1.
12749// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
12750// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
12751// - Error - Filter that matches input with HealthState value Error. The value is 8.
12752// - All - Filter that matches input with any HealthState value. The value is 65535.
12753// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
12754// of its children.
12755// If not present, the health evaluation uses the health policy from application manifest or the default health
12756// policy.
12757// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12758// duration that the client is willing to wait for the requested operation to complete. The default value for
12759// this parameter is 60 seconds.
12760func (client BaseClient) GetReplicaHealthUsingPolicy(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result ReplicaHealthModel, err error) {
12761	if tracing.IsEnabled() {
12762		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaHealthUsingPolicy")
12763		defer func() {
12764			sc := -1
12765			if result.Response.Response != nil {
12766				sc = result.Response.Response.StatusCode
12767			}
12768			tracing.EndSpan(ctx, sc, err)
12769		}()
12770	}
12771	if err := validation.Validate([]validation.Validation{
12772		{TargetValue: timeout,
12773			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12774				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12775					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12776				}}}}}); err != nil {
12777		return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", err.Error())
12778	}
12779
12780	req, err := client.GetReplicaHealthUsingPolicyPreparer(ctx, partitionID, replicaID, eventsHealthStateFilter, applicationHealthPolicy, timeout)
12781	if err != nil {
12782		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", nil, "Failure preparing request")
12783		return
12784	}
12785
12786	resp, err := client.GetReplicaHealthUsingPolicySender(req)
12787	if err != nil {
12788		result.Response = autorest.Response{Response: resp}
12789		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", resp, "Failure sending request")
12790		return
12791	}
12792
12793	result, err = client.GetReplicaHealthUsingPolicyResponder(resp)
12794	if err != nil {
12795		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", resp, "Failure responding to request")
12796		return
12797	}
12798
12799	return
12800}
12801
12802// GetReplicaHealthUsingPolicyPreparer prepares the GetReplicaHealthUsingPolicy request.
12803func (client BaseClient) GetReplicaHealthUsingPolicyPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) {
12804	pathParameters := map[string]interface{}{
12805		"partitionId": partitionID,
12806		"replicaId":   replicaID,
12807	}
12808
12809	const APIVersion = "6.0"
12810	queryParameters := map[string]interface{}{
12811		"api-version": APIVersion,
12812	}
12813	if eventsHealthStateFilter != nil {
12814		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
12815	} else {
12816		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
12817	}
12818	if timeout != nil {
12819		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12820	} else {
12821		queryParameters["timeout"] = autorest.Encode("query", 60)
12822	}
12823
12824	preparer := autorest.CreatePreparer(
12825		autorest.AsContentType("application/json; charset=utf-8"),
12826		autorest.AsPost(),
12827		autorest.WithBaseURL(client.BaseURI),
12828		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth", pathParameters),
12829		autorest.WithQueryParameters(queryParameters))
12830	if applicationHealthPolicy != nil {
12831		preparer = autorest.DecoratePreparer(preparer,
12832			autorest.WithJSON(applicationHealthPolicy))
12833	}
12834	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12835}
12836
12837// GetReplicaHealthUsingPolicySender sends the GetReplicaHealthUsingPolicy request. The method will close the
12838// http.Response Body if it receives an error.
12839func (client BaseClient) GetReplicaHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
12840	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12841}
12842
12843// GetReplicaHealthUsingPolicyResponder handles the response to the GetReplicaHealthUsingPolicy request. The method always
12844// closes the http.Response Body.
12845func (client BaseClient) GetReplicaHealthUsingPolicyResponder(resp *http.Response) (result ReplicaHealthModel, err error) {
12846	err = autorest.Respond(
12847		resp,
12848		azure.WithErrorUnlessStatusCode(http.StatusOK),
12849		autorest.ByUnmarshallingJSON(&result),
12850		autorest.ByClosing())
12851	result.Response = autorest.Response{Response: resp}
12852	return
12853}
12854
12855// GetReplicaInfo the response includes the ID, role, status, health, node name, uptime, and other details about the
12856// replica.
12857// Parameters:
12858// partitionID - the identity of the partition.
12859// replicaID - the identifier of the replica.
12860// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12861// duration that the client is willing to wait for the requested operation to complete. The default value for
12862// this parameter is 60 seconds.
12863func (client BaseClient) GetReplicaInfo(ctx context.Context, partitionID uuid.UUID, replicaID string, timeout *int64) (result ReplicaInfoModel, err error) {
12864	if tracing.IsEnabled() {
12865		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaInfo")
12866		defer func() {
12867			sc := -1
12868			if result.Response.Response != nil {
12869				sc = result.Response.Response.StatusCode
12870			}
12871			tracing.EndSpan(ctx, sc, err)
12872		}()
12873	}
12874	if err := validation.Validate([]validation.Validation{
12875		{TargetValue: timeout,
12876			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12877				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12878					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12879				}}}}}); err != nil {
12880		return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfo", err.Error())
12881	}
12882
12883	req, err := client.GetReplicaInfoPreparer(ctx, partitionID, replicaID, timeout)
12884	if err != nil {
12885		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", nil, "Failure preparing request")
12886		return
12887	}
12888
12889	resp, err := client.GetReplicaInfoSender(req)
12890	if err != nil {
12891		result.Response = autorest.Response{Response: resp}
12892		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", resp, "Failure sending request")
12893		return
12894	}
12895
12896	result, err = client.GetReplicaInfoResponder(resp)
12897	if err != nil {
12898		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", resp, "Failure responding to request")
12899		return
12900	}
12901
12902	return
12903}
12904
12905// GetReplicaInfoPreparer prepares the GetReplicaInfo request.
12906func (client BaseClient) GetReplicaInfoPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) {
12907	pathParameters := map[string]interface{}{
12908		"partitionId": partitionID,
12909		"replicaId":   replicaID,
12910	}
12911
12912	const APIVersion = "6.0"
12913	queryParameters := map[string]interface{}{
12914		"api-version": APIVersion,
12915	}
12916	if timeout != nil {
12917		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12918	} else {
12919		queryParameters["timeout"] = autorest.Encode("query", 60)
12920	}
12921
12922	preparer := autorest.CreatePreparer(
12923		autorest.AsGet(),
12924		autorest.WithBaseURL(client.BaseURI),
12925		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}", pathParameters),
12926		autorest.WithQueryParameters(queryParameters))
12927	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12928}
12929
12930// GetReplicaInfoSender sends the GetReplicaInfo request. The method will close the
12931// http.Response Body if it receives an error.
12932func (client BaseClient) GetReplicaInfoSender(req *http.Request) (*http.Response, error) {
12933	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12934}
12935
12936// GetReplicaInfoResponder handles the response to the GetReplicaInfo request. The method always
12937// closes the http.Response Body.
12938func (client BaseClient) GetReplicaInfoResponder(resp *http.Response) (result ReplicaInfoModel, err error) {
12939	err = autorest.Respond(
12940		resp,
12941		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
12942		autorest.ByUnmarshallingJSON(&result),
12943		autorest.ByClosing())
12944	result.Response = autorest.Response{Response: resp}
12945	return
12946}
12947
12948// GetReplicaInfoList the GetReplicas endpoint returns information about the replicas of the specified partition. The
12949// response includes the ID, role, status, health, node name, uptime, and other details about the replica.
12950// Parameters:
12951// partitionID - the identity of the partition.
12952// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
12953// token with a non-empty value is included in the response of the API when the results from the system do not
12954// fit in a single response. When this value is passed to the next API call, the API returns next set of
12955// results. If there are no further results, then the continuation token does not contain a value. The value of
12956// this parameter should not be URL encoded.
12957// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12958// duration that the client is willing to wait for the requested operation to complete. The default value for
12959// this parameter is 60 seconds.
12960func (client BaseClient) GetReplicaInfoList(ctx context.Context, partitionID uuid.UUID, continuationToken string, timeout *int64) (result PagedReplicaInfoList, err error) {
12961	if tracing.IsEnabled() {
12962		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaInfoList")
12963		defer func() {
12964			sc := -1
12965			if result.Response.Response != nil {
12966				sc = result.Response.Response.StatusCode
12967			}
12968			tracing.EndSpan(ctx, sc, err)
12969		}()
12970	}
12971	if err := validation.Validate([]validation.Validation{
12972		{TargetValue: timeout,
12973			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12974				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12975					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12976				}}}}}); err != nil {
12977		return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfoList", err.Error())
12978	}
12979
12980	req, err := client.GetReplicaInfoListPreparer(ctx, partitionID, continuationToken, timeout)
12981	if err != nil {
12982		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", nil, "Failure preparing request")
12983		return
12984	}
12985
12986	resp, err := client.GetReplicaInfoListSender(req)
12987	if err != nil {
12988		result.Response = autorest.Response{Response: resp}
12989		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", resp, "Failure sending request")
12990		return
12991	}
12992
12993	result, err = client.GetReplicaInfoListResponder(resp)
12994	if err != nil {
12995		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", resp, "Failure responding to request")
12996		return
12997	}
12998
12999	return
13000}
13001
13002// GetReplicaInfoListPreparer prepares the GetReplicaInfoList request.
13003func (client BaseClient) GetReplicaInfoListPreparer(ctx context.Context, partitionID uuid.UUID, continuationToken string, timeout *int64) (*http.Request, error) {
13004	pathParameters := map[string]interface{}{
13005		"partitionId": partitionID,
13006	}
13007
13008	const APIVersion = "6.0"
13009	queryParameters := map[string]interface{}{
13010		"api-version": APIVersion,
13011	}
13012	if len(continuationToken) > 0 {
13013		queryParameters["ContinuationToken"] = continuationToken
13014	}
13015	if timeout != nil {
13016		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13017	} else {
13018		queryParameters["timeout"] = autorest.Encode("query", 60)
13019	}
13020
13021	preparer := autorest.CreatePreparer(
13022		autorest.AsGet(),
13023		autorest.WithBaseURL(client.BaseURI),
13024		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas", pathParameters),
13025		autorest.WithQueryParameters(queryParameters))
13026	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13027}
13028
13029// GetReplicaInfoListSender sends the GetReplicaInfoList request. The method will close the
13030// http.Response Body if it receives an error.
13031func (client BaseClient) GetReplicaInfoListSender(req *http.Request) (*http.Response, error) {
13032	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13033}
13034
13035// GetReplicaInfoListResponder handles the response to the GetReplicaInfoList request. The method always
13036// closes the http.Response Body.
13037func (client BaseClient) GetReplicaInfoListResponder(resp *http.Response) (result PagedReplicaInfoList, err error) {
13038	err = autorest.Respond(
13039		resp,
13040		azure.WithErrorUnlessStatusCode(http.StatusOK),
13041		autorest.ByUnmarshallingJSON(&result),
13042		autorest.ByClosing())
13043	result.Response = autorest.Response{Response: resp}
13044	return
13045}
13046
13047// GetReplicas gets the information about all replicas of a given service of an application. The information includes
13048// the runtime properties of the replica instance.
13049// Parameters:
13050// applicationResourceName - service Fabric application resource name.
13051// serviceResourceName - service Fabric service resource name.
13052func (client BaseClient) GetReplicas(ctx context.Context, applicationResourceName string, serviceResourceName string) (result PagedServiceResourceReplicaDescriptionList, err error) {
13053	if tracing.IsEnabled() {
13054		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicas")
13055		defer func() {
13056			sc := -1
13057			if result.Response.Response != nil {
13058				sc = result.Response.Response.StatusCode
13059			}
13060			tracing.EndSpan(ctx, sc, err)
13061		}()
13062	}
13063	req, err := client.GetReplicasPreparer(ctx, applicationResourceName, serviceResourceName)
13064	if err != nil {
13065		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicas", nil, "Failure preparing request")
13066		return
13067	}
13068
13069	resp, err := client.GetReplicasSender(req)
13070	if err != nil {
13071		result.Response = autorest.Response{Response: resp}
13072		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicas", resp, "Failure sending request")
13073		return
13074	}
13075
13076	result, err = client.GetReplicasResponder(resp)
13077	if err != nil {
13078		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicas", resp, "Failure responding to request")
13079		return
13080	}
13081
13082	return
13083}
13084
13085// GetReplicasPreparer prepares the GetReplicas request.
13086func (client BaseClient) GetReplicasPreparer(ctx context.Context, applicationResourceName string, serviceResourceName string) (*http.Request, error) {
13087	pathParameters := map[string]interface{}{
13088		"applicationResourceName": applicationResourceName,
13089		"serviceResourceName":     serviceResourceName,
13090	}
13091
13092	const APIVersion = "6.3-preview"
13093	queryParameters := map[string]interface{}{
13094		"api-version": APIVersion,
13095	}
13096
13097	preparer := autorest.CreatePreparer(
13098		autorest.AsGet(),
13099		autorest.WithBaseURL(client.BaseURI),
13100		autorest.WithPathParameters("/Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}/replicas", pathParameters),
13101		autorest.WithQueryParameters(queryParameters))
13102	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13103}
13104
13105// GetReplicasSender sends the GetReplicas request. The method will close the
13106// http.Response Body if it receives an error.
13107func (client BaseClient) GetReplicasSender(req *http.Request) (*http.Response, error) {
13108	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13109}
13110
13111// GetReplicasResponder handles the response to the GetReplicas request. The method always
13112// closes the http.Response Body.
13113func (client BaseClient) GetReplicasResponder(resp *http.Response) (result PagedServiceResourceReplicaDescriptionList, err error) {
13114	err = autorest.Respond(
13115		resp,
13116		azure.WithErrorUnlessStatusCode(http.StatusOK),
13117		autorest.ByUnmarshallingJSON(&result),
13118		autorest.ByClosing())
13119	result.Response = autorest.Response{Response: resp}
13120	return
13121}
13122
13123// GetService gets the description of the service resource.
13124// Parameters:
13125// applicationResourceName - service Fabric application resource name.
13126// serviceResourceName - service Fabric service resource name.
13127func (client BaseClient) GetService(ctx context.Context, applicationResourceName string, serviceResourceName string) (result ServiceResourceDescription, err error) {
13128	if tracing.IsEnabled() {
13129		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetService")
13130		defer func() {
13131			sc := -1
13132			if result.Response.Response != nil {
13133				sc = result.Response.Response.StatusCode
13134			}
13135			tracing.EndSpan(ctx, sc, err)
13136		}()
13137	}
13138	req, err := client.GetServicePreparer(ctx, applicationResourceName, serviceResourceName)
13139	if err != nil {
13140		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetService", nil, "Failure preparing request")
13141		return
13142	}
13143
13144	resp, err := client.GetServiceSender(req)
13145	if err != nil {
13146		result.Response = autorest.Response{Response: resp}
13147		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetService", resp, "Failure sending request")
13148		return
13149	}
13150
13151	result, err = client.GetServiceResponder(resp)
13152	if err != nil {
13153		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetService", resp, "Failure responding to request")
13154		return
13155	}
13156
13157	return
13158}
13159
13160// GetServicePreparer prepares the GetService request.
13161func (client BaseClient) GetServicePreparer(ctx context.Context, applicationResourceName string, serviceResourceName string) (*http.Request, error) {
13162	pathParameters := map[string]interface{}{
13163		"applicationResourceName": applicationResourceName,
13164		"serviceResourceName":     serviceResourceName,
13165	}
13166
13167	const APIVersion = "6.3-preview"
13168	queryParameters := map[string]interface{}{
13169		"api-version": APIVersion,
13170	}
13171
13172	preparer := autorest.CreatePreparer(
13173		autorest.AsGet(),
13174		autorest.WithBaseURL(client.BaseURI),
13175		autorest.WithPathParameters("/Resources/Applications/{applicationResourceName}/Services/{serviceResourceName}", pathParameters),
13176		autorest.WithQueryParameters(queryParameters))
13177	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13178}
13179
13180// GetServiceSender sends the GetService request. The method will close the
13181// http.Response Body if it receives an error.
13182func (client BaseClient) GetServiceSender(req *http.Request) (*http.Response, error) {
13183	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13184}
13185
13186// GetServiceResponder handles the response to the GetService request. The method always
13187// closes the http.Response Body.
13188func (client BaseClient) GetServiceResponder(resp *http.Response) (result ServiceResourceDescription, err error) {
13189	err = autorest.Respond(
13190		resp,
13191		azure.WithErrorUnlessStatusCode(http.StatusOK),
13192		autorest.ByUnmarshallingJSON(&result),
13193		autorest.ByClosing())
13194	result.Response = autorest.Response{Response: resp}
13195	return
13196}
13197
13198// GetServiceBackupConfigurationInfo gets the Service Fabric backup configuration information for the service and the
13199// partitions under this service.
13200// Parameters:
13201// serviceID - the identity of the service. This ID is typically the full name of the service without the
13202// 'fabric:' URI scheme.
13203// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13204// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
13205// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
13206// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
13207// token with a non-empty value is included in the response of the API when the results from the system do not
13208// fit in a single response. When this value is passed to the next API call, the API returns next set of
13209// results. If there are no further results, then the continuation token does not contain a value. The value of
13210// this parameter should not be URL encoded.
13211// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
13212// defines the upper bound on the number of results returned. The results returned can be less than the
13213// specified maximum results if they do not fit in the message as per the max message size restrictions defined
13214// in the configuration. If this parameter is zero or not specified, the paged query includes as many results
13215// as possible that fit in the return message.
13216// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13217// duration that the client is willing to wait for the requested operation to complete. The default value for
13218// this parameter is 60 seconds.
13219func (client BaseClient) GetServiceBackupConfigurationInfo(ctx context.Context, serviceID string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupConfigurationInfoList, err error) {
13220	if tracing.IsEnabled() {
13221		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceBackupConfigurationInfo")
13222		defer func() {
13223			sc := -1
13224			if result.Response.Response != nil {
13225				sc = result.Response.Response.StatusCode
13226			}
13227			tracing.EndSpan(ctx, sc, err)
13228		}()
13229	}
13230	if err := validation.Validate([]validation.Validation{
13231		{TargetValue: maxResults,
13232			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
13233				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
13234		{TargetValue: timeout,
13235			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13236				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13237					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13238				}}}}}); err != nil {
13239		return result, validation.NewError("servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", err.Error())
13240	}
13241
13242	req, err := client.GetServiceBackupConfigurationInfoPreparer(ctx, serviceID, continuationToken, maxResults, timeout)
13243	if err != nil {
13244		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", nil, "Failure preparing request")
13245		return
13246	}
13247
13248	resp, err := client.GetServiceBackupConfigurationInfoSender(req)
13249	if err != nil {
13250		result.Response = autorest.Response{Response: resp}
13251		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", resp, "Failure sending request")
13252		return
13253	}
13254
13255	result, err = client.GetServiceBackupConfigurationInfoResponder(resp)
13256	if err != nil {
13257		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", resp, "Failure responding to request")
13258		return
13259	}
13260
13261	return
13262}
13263
13264// GetServiceBackupConfigurationInfoPreparer prepares the GetServiceBackupConfigurationInfo request.
13265func (client BaseClient) GetServiceBackupConfigurationInfoPreparer(ctx context.Context, serviceID string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
13266	pathParameters := map[string]interface{}{
13267		"serviceId": serviceID,
13268	}
13269
13270	const APIVersion = "6.2-preview"
13271	queryParameters := map[string]interface{}{
13272		"api-version": APIVersion,
13273	}
13274	if len(continuationToken) > 0 {
13275		queryParameters["ContinuationToken"] = continuationToken
13276	}
13277	if maxResults != nil {
13278		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
13279	} else {
13280		queryParameters["MaxResults"] = autorest.Encode("query", 0)
13281	}
13282	if timeout != nil {
13283		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13284	} else {
13285		queryParameters["timeout"] = autorest.Encode("query", 60)
13286	}
13287
13288	preparer := autorest.CreatePreparer(
13289		autorest.AsGet(),
13290		autorest.WithBaseURL(client.BaseURI),
13291		autorest.WithPathParameters("/Services/{serviceId}/$/GetBackupConfigurationInfo", pathParameters),
13292		autorest.WithQueryParameters(queryParameters))
13293	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13294}
13295
13296// GetServiceBackupConfigurationInfoSender sends the GetServiceBackupConfigurationInfo request. The method will close the
13297// http.Response Body if it receives an error.
13298func (client BaseClient) GetServiceBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) {
13299	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13300}
13301
13302// GetServiceBackupConfigurationInfoResponder handles the response to the GetServiceBackupConfigurationInfo request. The method always
13303// closes the http.Response Body.
13304func (client BaseClient) GetServiceBackupConfigurationInfoResponder(resp *http.Response) (result PagedBackupConfigurationInfoList, err error) {
13305	err = autorest.Respond(
13306		resp,
13307		azure.WithErrorUnlessStatusCode(http.StatusOK),
13308		autorest.ByUnmarshallingJSON(&result),
13309		autorest.ByClosing())
13310	result.Response = autorest.Response{Response: resp}
13311	return
13312}
13313
13314// GetServiceBackupList returns a list of backups available for every partition in this Service Fabric service. The
13315// server enumerates all the backups available in the backup store configured in the backup policy. It also allows
13316// filtering of the result based on start and end datetime or just fetching the latest available backup for every
13317// partition.
13318// Parameters:
13319// serviceID - the identity of the service. This ID is typically the full name of the service without the
13320// 'fabric:' URI scheme.
13321// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13322// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
13323// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
13324// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13325// duration that the client is willing to wait for the requested operation to complete. The default value for
13326// this parameter is 60 seconds.
13327// latest - specifies whether to get only the most recent backup available for a partition for the specified
13328// time range.
13329// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The
13330// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups
13331// from the beginning are enumerated.
13332// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date
13333// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is
13334// done till the most recent backup.
13335// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
13336// token with a non-empty value is included in the response of the API when the results from the system do not
13337// fit in a single response. When this value is passed to the next API call, the API returns next set of
13338// results. If there are no further results, then the continuation token does not contain a value. The value of
13339// this parameter should not be URL encoded.
13340// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
13341// defines the upper bound on the number of results returned. The results returned can be less than the
13342// specified maximum results if they do not fit in the message as per the max message size restrictions defined
13343// in the configuration. If this parameter is zero or not specified, the paged query includes as many results
13344// as possible that fit in the return message.
13345func (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) {
13346	if tracing.IsEnabled() {
13347		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceBackupList")
13348		defer func() {
13349			sc := -1
13350			if result.Response.Response != nil {
13351				sc = result.Response.Response.StatusCode
13352			}
13353			tracing.EndSpan(ctx, sc, err)
13354		}()
13355	}
13356	if err := validation.Validate([]validation.Validation{
13357		{TargetValue: timeout,
13358			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13359				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13360					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13361				}}}},
13362		{TargetValue: maxResults,
13363			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
13364				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil {
13365		return result, validation.NewError("servicefabric.BaseClient", "GetServiceBackupList", err.Error())
13366	}
13367
13368	req, err := client.GetServiceBackupListPreparer(ctx, serviceID, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults)
13369	if err != nil {
13370		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", nil, "Failure preparing request")
13371		return
13372	}
13373
13374	resp, err := client.GetServiceBackupListSender(req)
13375	if err != nil {
13376		result.Response = autorest.Response{Response: resp}
13377		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", resp, "Failure sending request")
13378		return
13379	}
13380
13381	result, err = client.GetServiceBackupListResponder(resp)
13382	if err != nil {
13383		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", resp, "Failure responding to request")
13384		return
13385	}
13386
13387	return
13388}
13389
13390// GetServiceBackupListPreparer prepares the GetServiceBackupList request.
13391func (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) {
13392	pathParameters := map[string]interface{}{
13393		"serviceId": serviceID,
13394	}
13395
13396	const APIVersion = "6.2-preview"
13397	queryParameters := map[string]interface{}{
13398		"api-version": APIVersion,
13399	}
13400	if timeout != nil {
13401		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13402	} else {
13403		queryParameters["timeout"] = autorest.Encode("query", 60)
13404	}
13405	if latest != nil {
13406		queryParameters["Latest"] = autorest.Encode("query", *latest)
13407	} else {
13408		queryParameters["Latest"] = autorest.Encode("query", false)
13409	}
13410	if startDateTimeFilter != nil {
13411		queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter)
13412	}
13413	if endDateTimeFilter != nil {
13414		queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter)
13415	}
13416	if len(continuationToken) > 0 {
13417		queryParameters["ContinuationToken"] = continuationToken
13418	}
13419	if maxResults != nil {
13420		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
13421	} else {
13422		queryParameters["MaxResults"] = autorest.Encode("query", 0)
13423	}
13424
13425	preparer := autorest.CreatePreparer(
13426		autorest.AsGet(),
13427		autorest.WithBaseURL(client.BaseURI),
13428		autorest.WithPathParameters("/Services/{serviceId}/$/GetBackups", pathParameters),
13429		autorest.WithQueryParameters(queryParameters))
13430	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13431}
13432
13433// GetServiceBackupListSender sends the GetServiceBackupList request. The method will close the
13434// http.Response Body if it receives an error.
13435func (client BaseClient) GetServiceBackupListSender(req *http.Request) (*http.Response, error) {
13436	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13437}
13438
13439// GetServiceBackupListResponder handles the response to the GetServiceBackupList request. The method always
13440// closes the http.Response Body.
13441func (client BaseClient) GetServiceBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) {
13442	err = autorest.Respond(
13443		resp,
13444		azure.WithErrorUnlessStatusCode(http.StatusOK),
13445		autorest.ByUnmarshallingJSON(&result),
13446		autorest.ByClosing())
13447	result.Response = autorest.Response{Response: resp}
13448	return
13449}
13450
13451// GetServiceDescription gets the description of an existing Service Fabric service. A service must be created before
13452// its description can be obtained.
13453// Parameters:
13454// serviceID - the identity of the service. This ID is typically the full name of the service without the
13455// 'fabric:' URI scheme.
13456// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13457// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
13458// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
13459// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13460// duration that the client is willing to wait for the requested operation to complete. The default value for
13461// this parameter is 60 seconds.
13462func (client BaseClient) GetServiceDescription(ctx context.Context, serviceID string, timeout *int64) (result ServiceDescriptionModel, err error) {
13463	if tracing.IsEnabled() {
13464		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceDescription")
13465		defer func() {
13466			sc := -1
13467			if result.Response.Response != nil {
13468				sc = result.Response.Response.StatusCode
13469			}
13470			tracing.EndSpan(ctx, sc, err)
13471		}()
13472	}
13473	if err := validation.Validate([]validation.Validation{
13474		{TargetValue: timeout,
13475			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13476				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13477					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13478				}}}}}); err != nil {
13479		return result, validation.NewError("servicefabric.BaseClient", "GetServiceDescription", err.Error())
13480	}
13481
13482	req, err := client.GetServiceDescriptionPreparer(ctx, serviceID, timeout)
13483	if err != nil {
13484		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", nil, "Failure preparing request")
13485		return
13486	}
13487
13488	resp, err := client.GetServiceDescriptionSender(req)
13489	if err != nil {
13490		result.Response = autorest.Response{Response: resp}
13491		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", resp, "Failure sending request")
13492		return
13493	}
13494
13495	result, err = client.GetServiceDescriptionResponder(resp)
13496	if err != nil {
13497		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", resp, "Failure responding to request")
13498		return
13499	}
13500
13501	return
13502}
13503
13504// GetServiceDescriptionPreparer prepares the GetServiceDescription request.
13505func (client BaseClient) GetServiceDescriptionPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
13506	pathParameters := map[string]interface{}{
13507		"serviceId": serviceID,
13508	}
13509
13510	const APIVersion = "6.0"
13511	queryParameters := map[string]interface{}{
13512		"api-version": APIVersion,
13513	}
13514	if timeout != nil {
13515		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13516	} else {
13517		queryParameters["timeout"] = autorest.Encode("query", 60)
13518	}
13519
13520	preparer := autorest.CreatePreparer(
13521		autorest.AsGet(),
13522		autorest.WithBaseURL(client.BaseURI),
13523		autorest.WithPathParameters("/Services/{serviceId}/$/GetDescription", pathParameters),
13524		autorest.WithQueryParameters(queryParameters))
13525	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13526}
13527
13528// GetServiceDescriptionSender sends the GetServiceDescription request. The method will close the
13529// http.Response Body if it receives an error.
13530func (client BaseClient) GetServiceDescriptionSender(req *http.Request) (*http.Response, error) {
13531	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13532}
13533
13534// GetServiceDescriptionResponder handles the response to the GetServiceDescription request. The method always
13535// closes the http.Response Body.
13536func (client BaseClient) GetServiceDescriptionResponder(resp *http.Response) (result ServiceDescriptionModel, err error) {
13537	err = autorest.Respond(
13538		resp,
13539		azure.WithErrorUnlessStatusCode(http.StatusOK),
13540		autorest.ByUnmarshallingJSON(&result),
13541		autorest.ByClosing())
13542	result.Response = autorest.Response{Response: resp}
13543	return
13544}
13545
13546// GetServiceEventList the response is list of ServiceEvent objects.
13547// Parameters:
13548// serviceID - the identity of the service. This ID is typically the full name of the service without the
13549// 'fabric:' URI scheme.
13550// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13551// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
13552// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
13553// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
13554// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
13555// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13556// duration that the client is willing to wait for the requested operation to complete. The default value for
13557// this parameter is 60 seconds.
13558// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
13559// be included in the response.
13560// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
13561// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
13562// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
13563// populated.
13564func (client BaseClient) GetServiceEventList(ctx context.Context, serviceID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListServiceEvent, err error) {
13565	if tracing.IsEnabled() {
13566		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceEventList")
13567		defer func() {
13568			sc := -1
13569			if result.Response.Response != nil {
13570				sc = result.Response.Response.StatusCode
13571			}
13572			tracing.EndSpan(ctx, sc, err)
13573		}()
13574	}
13575	if err := validation.Validate([]validation.Validation{
13576		{TargetValue: timeout,
13577			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13578				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13579					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13580				}}}}}); err != nil {
13581		return result, validation.NewError("servicefabric.BaseClient", "GetServiceEventList", err.Error())
13582	}
13583
13584	req, err := client.GetServiceEventListPreparer(ctx, serviceID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
13585	if err != nil {
13586		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", nil, "Failure preparing request")
13587		return
13588	}
13589
13590	resp, err := client.GetServiceEventListSender(req)
13591	if err != nil {
13592		result.Response = autorest.Response{Response: resp}
13593		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", resp, "Failure sending request")
13594		return
13595	}
13596
13597	result, err = client.GetServiceEventListResponder(resp)
13598	if err != nil {
13599		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", resp, "Failure responding to request")
13600		return
13601	}
13602
13603	return
13604}
13605
13606// GetServiceEventListPreparer prepares the GetServiceEventList request.
13607func (client BaseClient) GetServiceEventListPreparer(ctx context.Context, serviceID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
13608	pathParameters := map[string]interface{}{
13609		"serviceId": serviceID,
13610	}
13611
13612	const APIVersion = "6.2-preview"
13613	queryParameters := map[string]interface{}{
13614		"api-version":  APIVersion,
13615		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
13616		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
13617	}
13618	if timeout != nil {
13619		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13620	} else {
13621		queryParameters["timeout"] = autorest.Encode("query", 60)
13622	}
13623	if len(eventsTypesFilter) > 0 {
13624		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
13625	}
13626	if excludeAnalysisEvents != nil {
13627		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
13628	}
13629	if skipCorrelationLookup != nil {
13630		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
13631	}
13632
13633	preparer := autorest.CreatePreparer(
13634		autorest.AsGet(),
13635		autorest.WithBaseURL(client.BaseURI),
13636		autorest.WithPathParameters("/EventsStore/Services/{serviceId}/$/Events", pathParameters),
13637		autorest.WithQueryParameters(queryParameters))
13638	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13639}
13640
13641// GetServiceEventListSender sends the GetServiceEventList request. The method will close the
13642// http.Response Body if it receives an error.
13643func (client BaseClient) GetServiceEventListSender(req *http.Request) (*http.Response, error) {
13644	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13645}
13646
13647// GetServiceEventListResponder handles the response to the GetServiceEventList request. The method always
13648// closes the http.Response Body.
13649func (client BaseClient) GetServiceEventListResponder(resp *http.Response) (result ListServiceEvent, err error) {
13650	err = autorest.Respond(
13651		resp,
13652		azure.WithErrorUnlessStatusCode(http.StatusOK),
13653		autorest.ByUnmarshallingJSON(&result),
13654		autorest.ByClosing())
13655	result.Response = autorest.Response{Response: resp}
13656	return
13657}
13658
13659// GetServiceHealth gets the health information of the specified service.
13660// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health
13661// state.
13662// Use PartitionsHealthStateFilter to filter the collection of partitions returned.
13663// If you specify a service that does not exist in the health store, this request returns an error.
13664// Parameters:
13665// serviceID - the identity of the service. This ID is typically the full name of the service without the
13666// 'fabric:' URI scheme.
13667// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13668// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
13669// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
13670// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
13671// state.
13672// The possible values for this parameter include integer value of one of the following health states.
13673// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
13674// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
13675// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
13676// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
13677//
13678// - Default - Default value. Matches any HealthState. The value is zero.
13679// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
13680// collection of states. The value is 1.
13681// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
13682// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
13683// - Error - Filter that matches input with HealthState value Error. The value is 8.
13684// - All - Filter that matches input with any HealthState value. The value is 65535.
13685// partitionsHealthStateFilter - allows filtering of the partitions health state objects returned in the result
13686// of service health query based on their health state.
13687// The possible values for this parameter include integer value of one of the following health states.
13688// Only partitions that match the filter are returned. All partitions are used to evaluate the aggregated
13689// health state.
13690// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
13691// be a combination of these value
13692// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of
13693// partitions with HealthState value of OK (2) and Warning (4) will be returned.
13694//
13695// - Default - Default value. Matches any HealthState. The value is zero.
13696// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
13697// collection of states. The value is 1.
13698// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
13699// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
13700// - Error - Filter that matches input with HealthState value Error. The value is 8.
13701// - All - Filter that matches input with any HealthState value. The value is 65535.
13702// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
13703// result. False by default.
13704// The statistics show the number of children entities in health state Ok, Warning, and Error.
13705// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13706// duration that the client is willing to wait for the requested operation to complete. The default value for
13707// this parameter is 60 seconds.
13708func (client BaseClient) GetServiceHealth(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result ServiceHealth, err error) {
13709	if tracing.IsEnabled() {
13710		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceHealth")
13711		defer func() {
13712			sc := -1
13713			if result.Response.Response != nil {
13714				sc = result.Response.Response.StatusCode
13715			}
13716			tracing.EndSpan(ctx, sc, err)
13717		}()
13718	}
13719	if err := validation.Validate([]validation.Validation{
13720		{TargetValue: timeout,
13721			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13722				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13723					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13724				}}}}}); err != nil {
13725		return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealth", err.Error())
13726	}
13727
13728	req, err := client.GetServiceHealthPreparer(ctx, serviceID, eventsHealthStateFilter, partitionsHealthStateFilter, excludeHealthStatistics, timeout)
13729	if err != nil {
13730		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", nil, "Failure preparing request")
13731		return
13732	}
13733
13734	resp, err := client.GetServiceHealthSender(req)
13735	if err != nil {
13736		result.Response = autorest.Response{Response: resp}
13737		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", resp, "Failure sending request")
13738		return
13739	}
13740
13741	result, err = client.GetServiceHealthResponder(resp)
13742	if err != nil {
13743		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", resp, "Failure responding to request")
13744		return
13745	}
13746
13747	return
13748}
13749
13750// GetServiceHealthPreparer prepares the GetServiceHealth request.
13751func (client BaseClient) GetServiceHealthPreparer(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
13752	pathParameters := map[string]interface{}{
13753		"serviceId": serviceID,
13754	}
13755
13756	const APIVersion = "6.0"
13757	queryParameters := map[string]interface{}{
13758		"api-version": APIVersion,
13759	}
13760	if eventsHealthStateFilter != nil {
13761		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
13762	} else {
13763		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
13764	}
13765	if partitionsHealthStateFilter != nil {
13766		queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", *partitionsHealthStateFilter)
13767	} else {
13768		queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", 0)
13769	}
13770	if excludeHealthStatistics != nil {
13771		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
13772	} else {
13773		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
13774	}
13775	if timeout != nil {
13776		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13777	} else {
13778		queryParameters["timeout"] = autorest.Encode("query", 60)
13779	}
13780
13781	preparer := autorest.CreatePreparer(
13782		autorest.AsGet(),
13783		autorest.WithBaseURL(client.BaseURI),
13784		autorest.WithPathParameters("/Services/{serviceId}/$/GetHealth", pathParameters),
13785		autorest.WithQueryParameters(queryParameters))
13786	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13787}
13788
13789// GetServiceHealthSender sends the GetServiceHealth request. The method will close the
13790// http.Response Body if it receives an error.
13791func (client BaseClient) GetServiceHealthSender(req *http.Request) (*http.Response, error) {
13792	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13793}
13794
13795// GetServiceHealthResponder handles the response to the GetServiceHealth request. The method always
13796// closes the http.Response Body.
13797func (client BaseClient) GetServiceHealthResponder(resp *http.Response) (result ServiceHealth, err error) {
13798	err = autorest.Respond(
13799		resp,
13800		azure.WithErrorUnlessStatusCode(http.StatusOK),
13801		autorest.ByUnmarshallingJSON(&result),
13802		autorest.ByClosing())
13803	result.Response = autorest.Response{Response: resp}
13804	return
13805}
13806
13807// GetServiceHealthUsingPolicy gets the health information of the specified service.
13808// If the application health policy is specified, the health evaluation uses it to get the aggregated health state.
13809// If the policy is not specified, the health evaluation uses the application health policy defined in the application
13810// manifest, or the default health policy, if no policy is defined in the manifest.
13811// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health
13812// state.
13813// Use PartitionsHealthStateFilter to filter the collection of partitions returned.
13814// If you specify a service that does not exist in the health store, this request returns an error.
13815// Parameters:
13816// serviceID - the identity of the service. This ID is typically the full name of the service without the
13817// 'fabric:' URI scheme.
13818// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13819// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
13820// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
13821// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
13822// state.
13823// The possible values for this parameter include integer value of one of the following health states.
13824// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
13825// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
13826// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided
13827// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
13828//
13829// - Default - Default value. Matches any HealthState. The value is zero.
13830// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
13831// collection of states. The value is 1.
13832// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
13833// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
13834// - Error - Filter that matches input with HealthState value Error. The value is 8.
13835// - All - Filter that matches input with any HealthState value. The value is 65535.
13836// partitionsHealthStateFilter - allows filtering of the partitions health state objects returned in the result
13837// of service health query based on their health state.
13838// The possible values for this parameter include integer value of one of the following health states.
13839// Only partitions that match the filter are returned. All partitions are used to evaluate the aggregated
13840// health state.
13841// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could
13842// be a combination of these value
13843// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of
13844// partitions with HealthState value of OK (2) and Warning (4) will be returned.
13845//
13846// - Default - Default value. Matches any HealthState. The value is zero.
13847// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
13848// collection of states. The value is 1.
13849// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
13850// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
13851// - Error - Filter that matches input with HealthState value Error. The value is 8.
13852// - All - Filter that matches input with any HealthState value. The value is 65535.
13853// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
13854// of its children.
13855// If not present, the health evaluation uses the health policy from application manifest or the default health
13856// policy.
13857// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
13858// result. False by default.
13859// The statistics show the number of children entities in health state Ok, Warning, and Error.
13860// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13861// duration that the client is willing to wait for the requested operation to complete. The default value for
13862// this parameter is 60 seconds.
13863func (client BaseClient) GetServiceHealthUsingPolicy(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result ServiceHealth, err error) {
13864	if tracing.IsEnabled() {
13865		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceHealthUsingPolicy")
13866		defer func() {
13867			sc := -1
13868			if result.Response.Response != nil {
13869				sc = result.Response.Response.StatusCode
13870			}
13871			tracing.EndSpan(ctx, sc, err)
13872		}()
13873	}
13874	if err := validation.Validate([]validation.Validation{
13875		{TargetValue: timeout,
13876			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13877				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13878					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13879				}}}}}); err != nil {
13880		return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealthUsingPolicy", err.Error())
13881	}
13882
13883	req, err := client.GetServiceHealthUsingPolicyPreparer(ctx, serviceID, eventsHealthStateFilter, partitionsHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout)
13884	if err != nil {
13885		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", nil, "Failure preparing request")
13886		return
13887	}
13888
13889	resp, err := client.GetServiceHealthUsingPolicySender(req)
13890	if err != nil {
13891		result.Response = autorest.Response{Response: resp}
13892		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", resp, "Failure sending request")
13893		return
13894	}
13895
13896	result, err = client.GetServiceHealthUsingPolicyResponder(resp)
13897	if err != nil {
13898		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", resp, "Failure responding to request")
13899		return
13900	}
13901
13902	return
13903}
13904
13905// GetServiceHealthUsingPolicyPreparer prepares the GetServiceHealthUsingPolicy request.
13906func (client BaseClient) GetServiceHealthUsingPolicyPreparer(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
13907	pathParameters := map[string]interface{}{
13908		"serviceId": serviceID,
13909	}
13910
13911	const APIVersion = "6.0"
13912	queryParameters := map[string]interface{}{
13913		"api-version": APIVersion,
13914	}
13915	if eventsHealthStateFilter != nil {
13916		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
13917	} else {
13918		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
13919	}
13920	if partitionsHealthStateFilter != nil {
13921		queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", *partitionsHealthStateFilter)
13922	} else {
13923		queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", 0)
13924	}
13925	if excludeHealthStatistics != nil {
13926		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
13927	} else {
13928		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
13929	}
13930	if timeout != nil {
13931		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13932	} else {
13933		queryParameters["timeout"] = autorest.Encode("query", 60)
13934	}
13935
13936	preparer := autorest.CreatePreparer(
13937		autorest.AsContentType("application/json; charset=utf-8"),
13938		autorest.AsPost(),
13939		autorest.WithBaseURL(client.BaseURI),
13940		autorest.WithPathParameters("/Services/{serviceId}/$/GetHealth", pathParameters),
13941		autorest.WithQueryParameters(queryParameters))
13942	if applicationHealthPolicy != nil {
13943		preparer = autorest.DecoratePreparer(preparer,
13944			autorest.WithJSON(applicationHealthPolicy))
13945	}
13946	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13947}
13948
13949// GetServiceHealthUsingPolicySender sends the GetServiceHealthUsingPolicy request. The method will close the
13950// http.Response Body if it receives an error.
13951func (client BaseClient) GetServiceHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
13952	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13953}
13954
13955// GetServiceHealthUsingPolicyResponder handles the response to the GetServiceHealthUsingPolicy request. The method always
13956// closes the http.Response Body.
13957func (client BaseClient) GetServiceHealthUsingPolicyResponder(resp *http.Response) (result ServiceHealth, err error) {
13958	err = autorest.Respond(
13959		resp,
13960		azure.WithErrorUnlessStatusCode(http.StatusOK),
13961		autorest.ByUnmarshallingJSON(&result),
13962		autorest.ByClosing())
13963	result.Response = autorest.Response{Response: resp}
13964	return
13965}
13966
13967// GetServiceInfo returns the information about the specified service belonging to the specified Service Fabric
13968// application.
13969// Parameters:
13970// applicationID - the identity of the application. This is typically the full name of the application without
13971// the 'fabric:' URI scheme.
13972// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13973// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
13974// in 6.0+ and "myapp/app1" in previous versions.
13975// serviceID - the identity of the service. This ID is typically the full name of the service without the
13976// 'fabric:' URI scheme.
13977// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13978// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
13979// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
13980// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13981// duration that the client is willing to wait for the requested operation to complete. The default value for
13982// this parameter is 60 seconds.
13983func (client BaseClient) GetServiceInfo(ctx context.Context, applicationID string, serviceID string, timeout *int64) (result ServiceInfoModel, err error) {
13984	if tracing.IsEnabled() {
13985		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceInfo")
13986		defer func() {
13987			sc := -1
13988			if result.Response.Response != nil {
13989				sc = result.Response.Response.StatusCode
13990			}
13991			tracing.EndSpan(ctx, sc, err)
13992		}()
13993	}
13994	if err := validation.Validate([]validation.Validation{
13995		{TargetValue: timeout,
13996			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13997				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13998					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13999				}}}}}); err != nil {
14000		return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfo", err.Error())
14001	}
14002
14003	req, err := client.GetServiceInfoPreparer(ctx, applicationID, serviceID, timeout)
14004	if err != nil {
14005		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", nil, "Failure preparing request")
14006		return
14007	}
14008
14009	resp, err := client.GetServiceInfoSender(req)
14010	if err != nil {
14011		result.Response = autorest.Response{Response: resp}
14012		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", resp, "Failure sending request")
14013		return
14014	}
14015
14016	result, err = client.GetServiceInfoResponder(resp)
14017	if err != nil {
14018		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", resp, "Failure responding to request")
14019		return
14020	}
14021
14022	return
14023}
14024
14025// GetServiceInfoPreparer prepares the GetServiceInfo request.
14026func (client BaseClient) GetServiceInfoPreparer(ctx context.Context, applicationID string, serviceID string, timeout *int64) (*http.Request, error) {
14027	pathParameters := map[string]interface{}{
14028		"applicationId": applicationID,
14029		"serviceId":     serviceID,
14030	}
14031
14032	const APIVersion = "6.0"
14033	queryParameters := map[string]interface{}{
14034		"api-version": APIVersion,
14035	}
14036	if timeout != nil {
14037		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14038	} else {
14039		queryParameters["timeout"] = autorest.Encode("query", 60)
14040	}
14041
14042	preparer := autorest.CreatePreparer(
14043		autorest.AsGet(),
14044		autorest.WithBaseURL(client.BaseURI),
14045		autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/{serviceId}", pathParameters),
14046		autorest.WithQueryParameters(queryParameters))
14047	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14048}
14049
14050// GetServiceInfoSender sends the GetServiceInfo request. The method will close the
14051// http.Response Body if it receives an error.
14052func (client BaseClient) GetServiceInfoSender(req *http.Request) (*http.Response, error) {
14053	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14054}
14055
14056// GetServiceInfoResponder handles the response to the GetServiceInfo request. The method always
14057// closes the http.Response Body.
14058func (client BaseClient) GetServiceInfoResponder(resp *http.Response) (result ServiceInfoModel, err error) {
14059	err = autorest.Respond(
14060		resp,
14061		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
14062		autorest.ByUnmarshallingJSON(&result),
14063		autorest.ByClosing())
14064	result.Response = autorest.Response{Response: resp}
14065	return
14066}
14067
14068// GetServiceInfoList returns the information about all services belonging to the application specified by the
14069// application ID.
14070// Parameters:
14071// applicationID - the identity of the application. This is typically the full name of the application without
14072// the 'fabric:' URI scheme.
14073// Starting from version 6.0, hierarchical names are delimited with the "~" character.
14074// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
14075// in 6.0+ and "myapp/app1" in previous versions.
14076// serviceTypeName - the service type name used to filter the services to query for.
14077// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
14078// token with a non-empty value is included in the response of the API when the results from the system do not
14079// fit in a single response. When this value is passed to the next API call, the API returns next set of
14080// results. If there are no further results, then the continuation token does not contain a value. The value of
14081// this parameter should not be URL encoded.
14082// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14083// duration that the client is willing to wait for the requested operation to complete. The default value for
14084// this parameter is 60 seconds.
14085func (client BaseClient) GetServiceInfoList(ctx context.Context, applicationID string, serviceTypeName string, continuationToken string, timeout *int64) (result PagedServiceInfoList, err error) {
14086	if tracing.IsEnabled() {
14087		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceInfoList")
14088		defer func() {
14089			sc := -1
14090			if result.Response.Response != nil {
14091				sc = result.Response.Response.StatusCode
14092			}
14093			tracing.EndSpan(ctx, sc, err)
14094		}()
14095	}
14096	if err := validation.Validate([]validation.Validation{
14097		{TargetValue: timeout,
14098			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14099				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14100					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14101				}}}}}); err != nil {
14102		return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfoList", err.Error())
14103	}
14104
14105	req, err := client.GetServiceInfoListPreparer(ctx, applicationID, serviceTypeName, continuationToken, timeout)
14106	if err != nil {
14107		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", nil, "Failure preparing request")
14108		return
14109	}
14110
14111	resp, err := client.GetServiceInfoListSender(req)
14112	if err != nil {
14113		result.Response = autorest.Response{Response: resp}
14114		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", resp, "Failure sending request")
14115		return
14116	}
14117
14118	result, err = client.GetServiceInfoListResponder(resp)
14119	if err != nil {
14120		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", resp, "Failure responding to request")
14121		return
14122	}
14123
14124	return
14125}
14126
14127// GetServiceInfoListPreparer prepares the GetServiceInfoList request.
14128func (client BaseClient) GetServiceInfoListPreparer(ctx context.Context, applicationID string, serviceTypeName string, continuationToken string, timeout *int64) (*http.Request, error) {
14129	pathParameters := map[string]interface{}{
14130		"applicationId": applicationID,
14131	}
14132
14133	const APIVersion = "6.0"
14134	queryParameters := map[string]interface{}{
14135		"api-version": APIVersion,
14136	}
14137	if len(serviceTypeName) > 0 {
14138		queryParameters["ServiceTypeName"] = autorest.Encode("query", serviceTypeName)
14139	}
14140	if len(continuationToken) > 0 {
14141		queryParameters["ContinuationToken"] = continuationToken
14142	}
14143	if timeout != nil {
14144		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14145	} else {
14146		queryParameters["timeout"] = autorest.Encode("query", 60)
14147	}
14148
14149	preparer := autorest.CreatePreparer(
14150		autorest.AsGet(),
14151		autorest.WithBaseURL(client.BaseURI),
14152		autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices", pathParameters),
14153		autorest.WithQueryParameters(queryParameters))
14154	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14155}
14156
14157// GetServiceInfoListSender sends the GetServiceInfoList request. The method will close the
14158// http.Response Body if it receives an error.
14159func (client BaseClient) GetServiceInfoListSender(req *http.Request) (*http.Response, error) {
14160	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14161}
14162
14163// GetServiceInfoListResponder handles the response to the GetServiceInfoList request. The method always
14164// closes the http.Response Body.
14165func (client BaseClient) GetServiceInfoListResponder(resp *http.Response) (result PagedServiceInfoList, err error) {
14166	err = autorest.Respond(
14167		resp,
14168		azure.WithErrorUnlessStatusCode(http.StatusOK),
14169		autorest.ByUnmarshallingJSON(&result),
14170		autorest.ByClosing())
14171	result.Response = autorest.Response{Response: resp}
14172	return
14173}
14174
14175// GetServiceManifest gets the manifest describing a service type. The response contains the service manifest XML as a
14176// string.
14177// Parameters:
14178// applicationTypeName - the name of the application type.
14179// applicationTypeVersion - the version of the application type.
14180// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
14181// Fabric cluster.
14182// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14183// duration that the client is willing to wait for the requested operation to complete. The default value for
14184// this parameter is 60 seconds.
14185func (client BaseClient) GetServiceManifest(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceManifestName string, timeout *int64) (result ServiceTypeManifest, err error) {
14186	if tracing.IsEnabled() {
14187		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceManifest")
14188		defer func() {
14189			sc := -1
14190			if result.Response.Response != nil {
14191				sc = result.Response.Response.StatusCode
14192			}
14193			tracing.EndSpan(ctx, sc, err)
14194		}()
14195	}
14196	if err := validation.Validate([]validation.Validation{
14197		{TargetValue: timeout,
14198			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14199				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14200					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14201				}}}}}); err != nil {
14202		return result, validation.NewError("servicefabric.BaseClient", "GetServiceManifest", err.Error())
14203	}
14204
14205	req, err := client.GetServiceManifestPreparer(ctx, applicationTypeName, applicationTypeVersion, serviceManifestName, timeout)
14206	if err != nil {
14207		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", nil, "Failure preparing request")
14208		return
14209	}
14210
14211	resp, err := client.GetServiceManifestSender(req)
14212	if err != nil {
14213		result.Response = autorest.Response{Response: resp}
14214		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", resp, "Failure sending request")
14215		return
14216	}
14217
14218	result, err = client.GetServiceManifestResponder(resp)
14219	if err != nil {
14220		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", resp, "Failure responding to request")
14221		return
14222	}
14223
14224	return
14225}
14226
14227// GetServiceManifestPreparer prepares the GetServiceManifest request.
14228func (client BaseClient) GetServiceManifestPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceManifestName string, timeout *int64) (*http.Request, error) {
14229	pathParameters := map[string]interface{}{
14230		"applicationTypeName": autorest.Encode("path", applicationTypeName),
14231	}
14232
14233	const APIVersion = "6.0"
14234	queryParameters := map[string]interface{}{
14235		"api-version":            APIVersion,
14236		"ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion),
14237		"ServiceManifestName":    autorest.Encode("query", serviceManifestName),
14238	}
14239	if timeout != nil {
14240		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14241	} else {
14242		queryParameters["timeout"] = autorest.Encode("query", 60)
14243	}
14244
14245	preparer := autorest.CreatePreparer(
14246		autorest.AsGet(),
14247		autorest.WithBaseURL(client.BaseURI),
14248		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceManifest", pathParameters),
14249		autorest.WithQueryParameters(queryParameters))
14250	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14251}
14252
14253// GetServiceManifestSender sends the GetServiceManifest request. The method will close the
14254// http.Response Body if it receives an error.
14255func (client BaseClient) GetServiceManifestSender(req *http.Request) (*http.Response, error) {
14256	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14257}
14258
14259// GetServiceManifestResponder handles the response to the GetServiceManifest request. The method always
14260// closes the http.Response Body.
14261func (client BaseClient) GetServiceManifestResponder(resp *http.Response) (result ServiceTypeManifest, err error) {
14262	err = autorest.Respond(
14263		resp,
14264		azure.WithErrorUnlessStatusCode(http.StatusOK),
14265		autorest.ByUnmarshallingJSON(&result),
14266		autorest.ByClosing())
14267	result.Response = autorest.Response{Response: resp}
14268	return
14269}
14270
14271// GetServiceNameInfo gets name of the service for the specified partition. A 404 error is returned if the partition ID
14272// does not exist in the cluster.
14273// Parameters:
14274// partitionID - the identity of the partition.
14275// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14276// duration that the client is willing to wait for the requested operation to complete. The default value for
14277// this parameter is 60 seconds.
14278func (client BaseClient) GetServiceNameInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result ServiceNameInfo, err error) {
14279	if tracing.IsEnabled() {
14280		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceNameInfo")
14281		defer func() {
14282			sc := -1
14283			if result.Response.Response != nil {
14284				sc = result.Response.Response.StatusCode
14285			}
14286			tracing.EndSpan(ctx, sc, err)
14287		}()
14288	}
14289	if err := validation.Validate([]validation.Validation{
14290		{TargetValue: timeout,
14291			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14292				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14293					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14294				}}}}}); err != nil {
14295		return result, validation.NewError("servicefabric.BaseClient", "GetServiceNameInfo", err.Error())
14296	}
14297
14298	req, err := client.GetServiceNameInfoPreparer(ctx, partitionID, timeout)
14299	if err != nil {
14300		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", nil, "Failure preparing request")
14301		return
14302	}
14303
14304	resp, err := client.GetServiceNameInfoSender(req)
14305	if err != nil {
14306		result.Response = autorest.Response{Response: resp}
14307		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", resp, "Failure sending request")
14308		return
14309	}
14310
14311	result, err = client.GetServiceNameInfoResponder(resp)
14312	if err != nil {
14313		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", resp, "Failure responding to request")
14314		return
14315	}
14316
14317	return
14318}
14319
14320// GetServiceNameInfoPreparer prepares the GetServiceNameInfo request.
14321func (client BaseClient) GetServiceNameInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
14322	pathParameters := map[string]interface{}{
14323		"partitionId": partitionID,
14324	}
14325
14326	const APIVersion = "6.0"
14327	queryParameters := map[string]interface{}{
14328		"api-version": APIVersion,
14329	}
14330	if timeout != nil {
14331		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14332	} else {
14333		queryParameters["timeout"] = autorest.Encode("query", 60)
14334	}
14335
14336	preparer := autorest.CreatePreparer(
14337		autorest.AsGet(),
14338		autorest.WithBaseURL(client.BaseURI),
14339		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetServiceName", pathParameters),
14340		autorest.WithQueryParameters(queryParameters))
14341	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14342}
14343
14344// GetServiceNameInfoSender sends the GetServiceNameInfo request. The method will close the
14345// http.Response Body if it receives an error.
14346func (client BaseClient) GetServiceNameInfoSender(req *http.Request) (*http.Response, error) {
14347	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14348}
14349
14350// GetServiceNameInfoResponder handles the response to the GetServiceNameInfo request. The method always
14351// closes the http.Response Body.
14352func (client BaseClient) GetServiceNameInfoResponder(resp *http.Response) (result ServiceNameInfo, err error) {
14353	err = autorest.Respond(
14354		resp,
14355		azure.WithErrorUnlessStatusCode(http.StatusOK),
14356		autorest.ByUnmarshallingJSON(&result),
14357		autorest.ByClosing())
14358	result.Response = autorest.Response{Response: resp}
14359	return
14360}
14361
14362// GetServices the operation returns the service descriptions of all the services in the application resource.
14363// Parameters:
14364// applicationResourceName - service Fabric application resource name.
14365func (client BaseClient) GetServices(ctx context.Context, applicationResourceName string) (result PagedServiceResourceDescriptionList, err error) {
14366	if tracing.IsEnabled() {
14367		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServices")
14368		defer func() {
14369			sc := -1
14370			if result.Response.Response != nil {
14371				sc = result.Response.Response.StatusCode
14372			}
14373			tracing.EndSpan(ctx, sc, err)
14374		}()
14375	}
14376	req, err := client.GetServicesPreparer(ctx, applicationResourceName)
14377	if err != nil {
14378		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServices", nil, "Failure preparing request")
14379		return
14380	}
14381
14382	resp, err := client.GetServicesSender(req)
14383	if err != nil {
14384		result.Response = autorest.Response{Response: resp}
14385		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServices", resp, "Failure sending request")
14386		return
14387	}
14388
14389	result, err = client.GetServicesResponder(resp)
14390	if err != nil {
14391		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServices", resp, "Failure responding to request")
14392		return
14393	}
14394
14395	return
14396}
14397
14398// GetServicesPreparer prepares the GetServices request.
14399func (client BaseClient) GetServicesPreparer(ctx context.Context, applicationResourceName string) (*http.Request, error) {
14400	pathParameters := map[string]interface{}{
14401		"applicationResourceName": applicationResourceName,
14402	}
14403
14404	const APIVersion = "6.3-preview"
14405	queryParameters := map[string]interface{}{
14406		"api-version": APIVersion,
14407	}
14408
14409	preparer := autorest.CreatePreparer(
14410		autorest.AsGet(),
14411		autorest.WithBaseURL(client.BaseURI),
14412		autorest.WithPathParameters("/Resources/Applications/{applicationResourceName}/Services", pathParameters),
14413		autorest.WithQueryParameters(queryParameters))
14414	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14415}
14416
14417// GetServicesSender sends the GetServices request. The method will close the
14418// http.Response Body if it receives an error.
14419func (client BaseClient) GetServicesSender(req *http.Request) (*http.Response, error) {
14420	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14421}
14422
14423// GetServicesResponder handles the response to the GetServices request. The method always
14424// closes the http.Response Body.
14425func (client BaseClient) GetServicesResponder(resp *http.Response) (result PagedServiceResourceDescriptionList, err error) {
14426	err = autorest.Respond(
14427		resp,
14428		azure.WithErrorUnlessStatusCode(http.StatusOK),
14429		autorest.ByUnmarshallingJSON(&result),
14430		autorest.ByClosing())
14431	result.Response = autorest.Response{Response: resp}
14432	return
14433}
14434
14435// GetServicesEventList the response is list of ServiceEvent objects.
14436// Parameters:
14437// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
14438// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
14439// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14440// duration that the client is willing to wait for the requested operation to complete. The default value for
14441// this parameter is 60 seconds.
14442// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
14443// be included in the response.
14444// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
14445// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
14446// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
14447// populated.
14448func (client BaseClient) GetServicesEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListServiceEvent, err error) {
14449	if tracing.IsEnabled() {
14450		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServicesEventList")
14451		defer func() {
14452			sc := -1
14453			if result.Response.Response != nil {
14454				sc = result.Response.Response.StatusCode
14455			}
14456			tracing.EndSpan(ctx, sc, err)
14457		}()
14458	}
14459	if err := validation.Validate([]validation.Validation{
14460		{TargetValue: timeout,
14461			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14462				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14463					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14464				}}}}}); err != nil {
14465		return result, validation.NewError("servicefabric.BaseClient", "GetServicesEventList", err.Error())
14466	}
14467
14468	req, err := client.GetServicesEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
14469	if err != nil {
14470		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", nil, "Failure preparing request")
14471		return
14472	}
14473
14474	resp, err := client.GetServicesEventListSender(req)
14475	if err != nil {
14476		result.Response = autorest.Response{Response: resp}
14477		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", resp, "Failure sending request")
14478		return
14479	}
14480
14481	result, err = client.GetServicesEventListResponder(resp)
14482	if err != nil {
14483		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", resp, "Failure responding to request")
14484		return
14485	}
14486
14487	return
14488}
14489
14490// GetServicesEventListPreparer prepares the GetServicesEventList request.
14491func (client BaseClient) GetServicesEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
14492	const APIVersion = "6.2-preview"
14493	queryParameters := map[string]interface{}{
14494		"api-version":  APIVersion,
14495		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
14496		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
14497	}
14498	if timeout != nil {
14499		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14500	} else {
14501		queryParameters["timeout"] = autorest.Encode("query", 60)
14502	}
14503	if len(eventsTypesFilter) > 0 {
14504		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
14505	}
14506	if excludeAnalysisEvents != nil {
14507		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
14508	}
14509	if skipCorrelationLookup != nil {
14510		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
14511	}
14512
14513	preparer := autorest.CreatePreparer(
14514		autorest.AsGet(),
14515		autorest.WithBaseURL(client.BaseURI),
14516		autorest.WithPath("/EventsStore/Services/Events"),
14517		autorest.WithQueryParameters(queryParameters))
14518	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14519}
14520
14521// GetServicesEventListSender sends the GetServicesEventList request. The method will close the
14522// http.Response Body if it receives an error.
14523func (client BaseClient) GetServicesEventListSender(req *http.Request) (*http.Response, error) {
14524	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14525}
14526
14527// GetServicesEventListResponder handles the response to the GetServicesEventList request. The method always
14528// closes the http.Response Body.
14529func (client BaseClient) GetServicesEventListResponder(resp *http.Response) (result ListServiceEvent, err error) {
14530	err = autorest.Respond(
14531		resp,
14532		azure.WithErrorUnlessStatusCode(http.StatusOK),
14533		autorest.ByUnmarshallingJSON(&result),
14534		autorest.ByClosing())
14535	result.Response = autorest.Response{Response: resp}
14536	return
14537}
14538
14539// GetServiceTypeInfoByName gets the information about a specific service type that is supported by a provisioned
14540// application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is
14541// returned. A 204 response is returned if the specified service type is not found in the cluster.
14542// Parameters:
14543// applicationTypeName - the name of the application type.
14544// applicationTypeVersion - the version of the application type.
14545// serviceTypeName - specifies the name of a Service Fabric service type.
14546// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14547// duration that the client is willing to wait for the requested operation to complete. The default value for
14548// this parameter is 60 seconds.
14549func (client BaseClient) GetServiceTypeInfoByName(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceTypeName string, timeout *int64) (result ServiceTypeInfo, err error) {
14550	if tracing.IsEnabled() {
14551		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceTypeInfoByName")
14552		defer func() {
14553			sc := -1
14554			if result.Response.Response != nil {
14555				sc = result.Response.Response.StatusCode
14556			}
14557			tracing.EndSpan(ctx, sc, err)
14558		}()
14559	}
14560	if err := validation.Validate([]validation.Validation{
14561		{TargetValue: timeout,
14562			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14563				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14564					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14565				}}}}}); err != nil {
14566		return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoByName", err.Error())
14567	}
14568
14569	req, err := client.GetServiceTypeInfoByNamePreparer(ctx, applicationTypeName, applicationTypeVersion, serviceTypeName, timeout)
14570	if err != nil {
14571		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", nil, "Failure preparing request")
14572		return
14573	}
14574
14575	resp, err := client.GetServiceTypeInfoByNameSender(req)
14576	if err != nil {
14577		result.Response = autorest.Response{Response: resp}
14578		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", resp, "Failure sending request")
14579		return
14580	}
14581
14582	result, err = client.GetServiceTypeInfoByNameResponder(resp)
14583	if err != nil {
14584		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", resp, "Failure responding to request")
14585		return
14586	}
14587
14588	return
14589}
14590
14591// GetServiceTypeInfoByNamePreparer prepares the GetServiceTypeInfoByName request.
14592func (client BaseClient) GetServiceTypeInfoByNamePreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceTypeName string, timeout *int64) (*http.Request, error) {
14593	pathParameters := map[string]interface{}{
14594		"applicationTypeName": autorest.Encode("path", applicationTypeName),
14595		"serviceTypeName":     serviceTypeName,
14596	}
14597
14598	const APIVersion = "6.0"
14599	queryParameters := map[string]interface{}{
14600		"api-version":            APIVersion,
14601		"ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion),
14602	}
14603	if timeout != nil {
14604		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14605	} else {
14606		queryParameters["timeout"] = autorest.Encode("query", 60)
14607	}
14608
14609	preparer := autorest.CreatePreparer(
14610		autorest.AsGet(),
14611		autorest.WithBaseURL(client.BaseURI),
14612		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceTypes/{serviceTypeName}", pathParameters),
14613		autorest.WithQueryParameters(queryParameters))
14614	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14615}
14616
14617// GetServiceTypeInfoByNameSender sends the GetServiceTypeInfoByName request. The method will close the
14618// http.Response Body if it receives an error.
14619func (client BaseClient) GetServiceTypeInfoByNameSender(req *http.Request) (*http.Response, error) {
14620	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14621}
14622
14623// GetServiceTypeInfoByNameResponder handles the response to the GetServiceTypeInfoByName request. The method always
14624// closes the http.Response Body.
14625func (client BaseClient) GetServiceTypeInfoByNameResponder(resp *http.Response) (result ServiceTypeInfo, err error) {
14626	err = autorest.Respond(
14627		resp,
14628		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
14629		autorest.ByUnmarshallingJSON(&result),
14630		autorest.ByClosing())
14631	result.Response = autorest.Response{Response: resp}
14632	return
14633}
14634
14635// GetServiceTypeInfoList gets the list containing the information about service types that are supported by a
14636// provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404
14637// status is returned.
14638// Parameters:
14639// applicationTypeName - the name of the application type.
14640// applicationTypeVersion - the version of the application type.
14641// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14642// duration that the client is willing to wait for the requested operation to complete. The default value for
14643// this parameter is 60 seconds.
14644func (client BaseClient) GetServiceTypeInfoList(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (result ListServiceTypeInfo, err error) {
14645	if tracing.IsEnabled() {
14646		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceTypeInfoList")
14647		defer func() {
14648			sc := -1
14649			if result.Response.Response != nil {
14650				sc = result.Response.Response.StatusCode
14651			}
14652			tracing.EndSpan(ctx, sc, err)
14653		}()
14654	}
14655	if err := validation.Validate([]validation.Validation{
14656		{TargetValue: timeout,
14657			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14658				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14659					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14660				}}}}}); err != nil {
14661		return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoList", err.Error())
14662	}
14663
14664	req, err := client.GetServiceTypeInfoListPreparer(ctx, applicationTypeName, applicationTypeVersion, timeout)
14665	if err != nil {
14666		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", nil, "Failure preparing request")
14667		return
14668	}
14669
14670	resp, err := client.GetServiceTypeInfoListSender(req)
14671	if err != nil {
14672		result.Response = autorest.Response{Response: resp}
14673		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", resp, "Failure sending request")
14674		return
14675	}
14676
14677	result, err = client.GetServiceTypeInfoListResponder(resp)
14678	if err != nil {
14679		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", resp, "Failure responding to request")
14680		return
14681	}
14682
14683	return
14684}
14685
14686// GetServiceTypeInfoListPreparer prepares the GetServiceTypeInfoList request.
14687func (client BaseClient) GetServiceTypeInfoListPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (*http.Request, error) {
14688	pathParameters := map[string]interface{}{
14689		"applicationTypeName": autorest.Encode("path", applicationTypeName),
14690	}
14691
14692	const APIVersion = "6.0"
14693	queryParameters := map[string]interface{}{
14694		"api-version":            APIVersion,
14695		"ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion),
14696	}
14697	if timeout != nil {
14698		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14699	} else {
14700		queryParameters["timeout"] = autorest.Encode("query", 60)
14701	}
14702
14703	preparer := autorest.CreatePreparer(
14704		autorest.AsGet(),
14705		autorest.WithBaseURL(client.BaseURI),
14706		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceTypes", pathParameters),
14707		autorest.WithQueryParameters(queryParameters))
14708	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14709}
14710
14711// GetServiceTypeInfoListSender sends the GetServiceTypeInfoList request. The method will close the
14712// http.Response Body if it receives an error.
14713func (client BaseClient) GetServiceTypeInfoListSender(req *http.Request) (*http.Response, error) {
14714	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14715}
14716
14717// GetServiceTypeInfoListResponder handles the response to the GetServiceTypeInfoList request. The method always
14718// closes the http.Response Body.
14719func (client BaseClient) GetServiceTypeInfoListResponder(resp *http.Response) (result ListServiceTypeInfo, err error) {
14720	err = autorest.Respond(
14721		resp,
14722		azure.WithErrorUnlessStatusCode(http.StatusOK),
14723		autorest.ByUnmarshallingJSON(&result.Value),
14724		autorest.ByClosing())
14725	result.Response = autorest.Response{Response: resp}
14726	return
14727}
14728
14729// GetSubNameInfoList enumerates all the Service Fabric names under a given name. If the subnames do not fit in a page,
14730// one page of results is returned as well as a continuation token, which can be used to get the next page. Querying a
14731// name that doesn't exist will fail.
14732// Parameters:
14733// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
14734// recursive - allows specifying that the search performed should be recursive.
14735// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
14736// token with a non-empty value is included in the response of the API when the results from the system do not
14737// fit in a single response. When this value is passed to the next API call, the API returns next set of
14738// results. If there are no further results, then the continuation token does not contain a value. The value of
14739// this parameter should not be URL encoded.
14740// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14741// duration that the client is willing to wait for the requested operation to complete. The default value for
14742// this parameter is 60 seconds.
14743func (client BaseClient) GetSubNameInfoList(ctx context.Context, nameID string, recursive *bool, continuationToken string, timeout *int64) (result PagedSubNameInfoList, err error) {
14744	if tracing.IsEnabled() {
14745		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSubNameInfoList")
14746		defer func() {
14747			sc := -1
14748			if result.Response.Response != nil {
14749				sc = result.Response.Response.StatusCode
14750			}
14751			tracing.EndSpan(ctx, sc, err)
14752		}()
14753	}
14754	if err := validation.Validate([]validation.Validation{
14755		{TargetValue: timeout,
14756			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14757				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14758					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14759				}}}}}); err != nil {
14760		return result, validation.NewError("servicefabric.BaseClient", "GetSubNameInfoList", err.Error())
14761	}
14762
14763	req, err := client.GetSubNameInfoListPreparer(ctx, nameID, recursive, continuationToken, timeout)
14764	if err != nil {
14765		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", nil, "Failure preparing request")
14766		return
14767	}
14768
14769	resp, err := client.GetSubNameInfoListSender(req)
14770	if err != nil {
14771		result.Response = autorest.Response{Response: resp}
14772		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", resp, "Failure sending request")
14773		return
14774	}
14775
14776	result, err = client.GetSubNameInfoListResponder(resp)
14777	if err != nil {
14778		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", resp, "Failure responding to request")
14779		return
14780	}
14781
14782	return
14783}
14784
14785// GetSubNameInfoListPreparer prepares the GetSubNameInfoList request.
14786func (client BaseClient) GetSubNameInfoListPreparer(ctx context.Context, nameID string, recursive *bool, continuationToken string, timeout *int64) (*http.Request, error) {
14787	pathParameters := map[string]interface{}{
14788		"nameId": nameID,
14789	}
14790
14791	const APIVersion = "6.0"
14792	queryParameters := map[string]interface{}{
14793		"api-version": APIVersion,
14794	}
14795	if recursive != nil {
14796		queryParameters["Recursive"] = autorest.Encode("query", *recursive)
14797	} else {
14798		queryParameters["Recursive"] = autorest.Encode("query", false)
14799	}
14800	if len(continuationToken) > 0 {
14801		queryParameters["ContinuationToken"] = continuationToken
14802	}
14803	if timeout != nil {
14804		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14805	} else {
14806		queryParameters["timeout"] = autorest.Encode("query", 60)
14807	}
14808
14809	preparer := autorest.CreatePreparer(
14810		autorest.AsGet(),
14811		autorest.WithBaseURL(client.BaseURI),
14812		autorest.WithPathParameters("/Names/{nameId}/$/GetSubNames", pathParameters),
14813		autorest.WithQueryParameters(queryParameters))
14814	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14815}
14816
14817// GetSubNameInfoListSender sends the GetSubNameInfoList request. The method will close the
14818// http.Response Body if it receives an error.
14819func (client BaseClient) GetSubNameInfoListSender(req *http.Request) (*http.Response, error) {
14820	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14821}
14822
14823// GetSubNameInfoListResponder handles the response to the GetSubNameInfoList request. The method always
14824// closes the http.Response Body.
14825func (client BaseClient) GetSubNameInfoListResponder(resp *http.Response) (result PagedSubNameInfoList, err error) {
14826	err = autorest.Respond(
14827		resp,
14828		azure.WithErrorUnlessStatusCode(http.StatusOK),
14829		autorest.ByUnmarshallingJSON(&result),
14830		autorest.ByClosing())
14831	result.Response = autorest.Response{Response: resp}
14832	return
14833}
14834
14835// GetUpgradeOrchestrationServiceState get the service state of Service Fabric Upgrade Orchestration Service. This API
14836// is internally used for support purposes.
14837// Parameters:
14838// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14839// duration that the client is willing to wait for the requested operation to complete. The default value for
14840// this parameter is 60 seconds.
14841func (client BaseClient) GetUpgradeOrchestrationServiceState(ctx context.Context, timeout *int64) (result UpgradeOrchestrationServiceState, err error) {
14842	if tracing.IsEnabled() {
14843		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetUpgradeOrchestrationServiceState")
14844		defer func() {
14845			sc := -1
14846			if result.Response.Response != nil {
14847				sc = result.Response.Response.StatusCode
14848			}
14849			tracing.EndSpan(ctx, sc, err)
14850		}()
14851	}
14852	if err := validation.Validate([]validation.Validation{
14853		{TargetValue: timeout,
14854			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14855				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14856					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14857				}}}}}); err != nil {
14858		return result, validation.NewError("servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", err.Error())
14859	}
14860
14861	req, err := client.GetUpgradeOrchestrationServiceStatePreparer(ctx, timeout)
14862	if err != nil {
14863		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", nil, "Failure preparing request")
14864		return
14865	}
14866
14867	resp, err := client.GetUpgradeOrchestrationServiceStateSender(req)
14868	if err != nil {
14869		result.Response = autorest.Response{Response: resp}
14870		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", resp, "Failure sending request")
14871		return
14872	}
14873
14874	result, err = client.GetUpgradeOrchestrationServiceStateResponder(resp)
14875	if err != nil {
14876		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", resp, "Failure responding to request")
14877		return
14878	}
14879
14880	return
14881}
14882
14883// GetUpgradeOrchestrationServiceStatePreparer prepares the GetUpgradeOrchestrationServiceState request.
14884func (client BaseClient) GetUpgradeOrchestrationServiceStatePreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
14885	const APIVersion = "6.0"
14886	queryParameters := map[string]interface{}{
14887		"api-version": APIVersion,
14888	}
14889	if timeout != nil {
14890		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14891	} else {
14892		queryParameters["timeout"] = autorest.Encode("query", 60)
14893	}
14894
14895	preparer := autorest.CreatePreparer(
14896		autorest.AsGet(),
14897		autorest.WithBaseURL(client.BaseURI),
14898		autorest.WithPath("/$/GetUpgradeOrchestrationServiceState"),
14899		autorest.WithQueryParameters(queryParameters))
14900	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14901}
14902
14903// GetUpgradeOrchestrationServiceStateSender sends the GetUpgradeOrchestrationServiceState request. The method will close the
14904// http.Response Body if it receives an error.
14905func (client BaseClient) GetUpgradeOrchestrationServiceStateSender(req *http.Request) (*http.Response, error) {
14906	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14907}
14908
14909// GetUpgradeOrchestrationServiceStateResponder handles the response to the GetUpgradeOrchestrationServiceState request. The method always
14910// closes the http.Response Body.
14911func (client BaseClient) GetUpgradeOrchestrationServiceStateResponder(resp *http.Response) (result UpgradeOrchestrationServiceState, err error) {
14912	err = autorest.Respond(
14913		resp,
14914		azure.WithErrorUnlessStatusCode(http.StatusOK),
14915		autorest.ByUnmarshallingJSON(&result),
14916		autorest.ByClosing())
14917	result.Response = autorest.Response{Response: resp}
14918	return
14919}
14920
14921// GetVolumeResource gets the information about the volume resource with a given name. This information includes the
14922// volume description and other runtime information.
14923// Parameters:
14924// volumeResourceName - service Fabric volume resource name.
14925func (client BaseClient) GetVolumeResource(ctx context.Context, volumeResourceName string) (result VolumeResourceDescription, err error) {
14926	if tracing.IsEnabled() {
14927		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetVolumeResource")
14928		defer func() {
14929			sc := -1
14930			if result.Response.Response != nil {
14931				sc = result.Response.Response.StatusCode
14932			}
14933			tracing.EndSpan(ctx, sc, err)
14934		}()
14935	}
14936	req, err := client.GetVolumeResourcePreparer(ctx, volumeResourceName)
14937	if err != nil {
14938		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetVolumeResource", nil, "Failure preparing request")
14939		return
14940	}
14941
14942	resp, err := client.GetVolumeResourceSender(req)
14943	if err != nil {
14944		result.Response = autorest.Response{Response: resp}
14945		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetVolumeResource", resp, "Failure sending request")
14946		return
14947	}
14948
14949	result, err = client.GetVolumeResourceResponder(resp)
14950	if err != nil {
14951		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetVolumeResource", resp, "Failure responding to request")
14952		return
14953	}
14954
14955	return
14956}
14957
14958// GetVolumeResourcePreparer prepares the GetVolumeResource request.
14959func (client BaseClient) GetVolumeResourcePreparer(ctx context.Context, volumeResourceName string) (*http.Request, error) {
14960	pathParameters := map[string]interface{}{
14961		"volumeResourceName": volumeResourceName,
14962	}
14963
14964	const APIVersion = "6.3-preview"
14965	queryParameters := map[string]interface{}{
14966		"api-version": APIVersion,
14967	}
14968
14969	preparer := autorest.CreatePreparer(
14970		autorest.AsGet(),
14971		autorest.WithBaseURL(client.BaseURI),
14972		autorest.WithPathParameters("/Resources/Volumes/{volumeResourceName}", pathParameters),
14973		autorest.WithQueryParameters(queryParameters))
14974	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14975}
14976
14977// GetVolumeResourceSender sends the GetVolumeResource request. The method will close the
14978// http.Response Body if it receives an error.
14979func (client BaseClient) GetVolumeResourceSender(req *http.Request) (*http.Response, error) {
14980	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14981}
14982
14983// GetVolumeResourceResponder handles the response to the GetVolumeResource request. The method always
14984// closes the http.Response Body.
14985func (client BaseClient) GetVolumeResourceResponder(resp *http.Response) (result VolumeResourceDescription, err error) {
14986	err = autorest.Respond(
14987		resp,
14988		azure.WithErrorUnlessStatusCode(http.StatusOK),
14989		autorest.ByUnmarshallingJSON(&result),
14990		autorest.ByClosing())
14991	result.Response = autorest.Response{Response: resp}
14992	return
14993}
14994
14995// InvokeContainerAPI invoke container API on a container deployed on a Service Fabric node for the given code package.
14996// Parameters:
14997// nodeName - the name of the node.
14998// applicationID - the identity of the application. This is typically the full name of the application without
14999// the 'fabric:' URI scheme.
15000// Starting from version 6.0, hierarchical names are delimited with the "~" character.
15001// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
15002// in 6.0+ and "myapp/app1" in previous versions.
15003// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
15004// Fabric cluster.
15005// codePackageName - the name of code package specified in service manifest registered as part of an
15006// application type in a Service Fabric cluster.
15007// codePackageInstanceID - ID that uniquely identifies a code package instance deployed on a service fabric
15008// node.
15009// containerAPIRequestBody - parameters for making container API call
15010// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15011// duration that the client is willing to wait for the requested operation to complete. The default value for
15012// this parameter is 60 seconds.
15013func (client BaseClient) InvokeContainerAPI(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, codePackageInstanceID string, containerAPIRequestBody ContainerAPIRequestBody, timeout *int64) (result ContainerAPIResponse, err error) {
15014	if tracing.IsEnabled() {
15015		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeContainerAPI")
15016		defer func() {
15017			sc := -1
15018			if result.Response.Response != nil {
15019				sc = result.Response.Response.StatusCode
15020			}
15021			tracing.EndSpan(ctx, sc, err)
15022		}()
15023	}
15024	if err := validation.Validate([]validation.Validation{
15025		{TargetValue: timeout,
15026			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15027				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15028					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15029				}}}},
15030		{TargetValue: containerAPIRequestBody,
15031			Constraints: []validation.Constraint{{Target: "containerAPIRequestBody.URIPath", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
15032		return result, validation.NewError("servicefabric.BaseClient", "InvokeContainerAPI", err.Error())
15033	}
15034
15035	req, err := client.InvokeContainerAPIPreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, codePackageInstanceID, containerAPIRequestBody, timeout)
15036	if err != nil {
15037		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", nil, "Failure preparing request")
15038		return
15039	}
15040
15041	resp, err := client.InvokeContainerAPISender(req)
15042	if err != nil {
15043		result.Response = autorest.Response{Response: resp}
15044		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", resp, "Failure sending request")
15045		return
15046	}
15047
15048	result, err = client.InvokeContainerAPIResponder(resp)
15049	if err != nil {
15050		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", resp, "Failure responding to request")
15051		return
15052	}
15053
15054	return
15055}
15056
15057// InvokeContainerAPIPreparer prepares the InvokeContainerAPI request.
15058func (client BaseClient) InvokeContainerAPIPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, codePackageInstanceID string, containerAPIRequestBody ContainerAPIRequestBody, timeout *int64) (*http.Request, error) {
15059	pathParameters := map[string]interface{}{
15060		"applicationId": applicationID,
15061		"nodeName":      autorest.Encode("path", nodeName),
15062	}
15063
15064	const APIVersion = "6.2"
15065	queryParameters := map[string]interface{}{
15066		"api-version":           APIVersion,
15067		"CodePackageInstanceId": autorest.Encode("query", codePackageInstanceID),
15068		"CodePackageName":       autorest.Encode("query", codePackageName),
15069		"ServiceManifestName":   autorest.Encode("query", serviceManifestName),
15070	}
15071	if timeout != nil {
15072		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15073	} else {
15074		queryParameters["timeout"] = autorest.Encode("query", 60)
15075	}
15076
15077	preparer := autorest.CreatePreparer(
15078		autorest.AsContentType("application/json; charset=utf-8"),
15079		autorest.AsPost(),
15080		autorest.WithBaseURL(client.BaseURI),
15081		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerApi", pathParameters),
15082		autorest.WithJSON(containerAPIRequestBody),
15083		autorest.WithQueryParameters(queryParameters))
15084	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15085}
15086
15087// InvokeContainerAPISender sends the InvokeContainerAPI request. The method will close the
15088// http.Response Body if it receives an error.
15089func (client BaseClient) InvokeContainerAPISender(req *http.Request) (*http.Response, error) {
15090	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15091}
15092
15093// InvokeContainerAPIResponder handles the response to the InvokeContainerAPI request. The method always
15094// closes the http.Response Body.
15095func (client BaseClient) InvokeContainerAPIResponder(resp *http.Response) (result ContainerAPIResponse, err error) {
15096	err = autorest.Respond(
15097		resp,
15098		azure.WithErrorUnlessStatusCode(http.StatusOK),
15099		autorest.ByUnmarshallingJSON(&result),
15100		autorest.ByClosing())
15101	result.Response = autorest.Response{Response: resp}
15102	return
15103}
15104
15105// InvokeInfrastructureCommand for clusters that have one or more instances of the Infrastructure Service configured,
15106// this API provides a way to send infrastructure-specific commands to a particular
15107// instance of the Infrastructure Service.
15108//
15109// Available commands and their corresponding response formats vary depending upon
15110// the infrastructure on which the cluster is running.
15111//
15112// This API supports the Service Fabric platform; it is not meant to be used directly from your code.
15113// Parameters:
15114// command - the text of the command to be invoked. The content of the command is infrastructure-specific.
15115// serviceID - the identity of the infrastructure service. This is the full name of the infrastructure service
15116// without the 'fabric:' URI scheme. This parameter required only for the cluster that has more than one
15117// instance of infrastructure service running.
15118// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15119// duration that the client is willing to wait for the requested operation to complete. The default value for
15120// this parameter is 60 seconds.
15121func (client BaseClient) InvokeInfrastructureCommand(ctx context.Context, command string, serviceID string, timeout *int64) (result String, err error) {
15122	if tracing.IsEnabled() {
15123		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeInfrastructureCommand")
15124		defer func() {
15125			sc := -1
15126			if result.Response.Response != nil {
15127				sc = result.Response.Response.StatusCode
15128			}
15129			tracing.EndSpan(ctx, sc, err)
15130		}()
15131	}
15132	if err := validation.Validate([]validation.Validation{
15133		{TargetValue: timeout,
15134			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15135				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15136					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15137				}}}}}); err != nil {
15138		return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureCommand", err.Error())
15139	}
15140
15141	req, err := client.InvokeInfrastructureCommandPreparer(ctx, command, serviceID, timeout)
15142	if err != nil {
15143		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", nil, "Failure preparing request")
15144		return
15145	}
15146
15147	resp, err := client.InvokeInfrastructureCommandSender(req)
15148	if err != nil {
15149		result.Response = autorest.Response{Response: resp}
15150		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", resp, "Failure sending request")
15151		return
15152	}
15153
15154	result, err = client.InvokeInfrastructureCommandResponder(resp)
15155	if err != nil {
15156		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", resp, "Failure responding to request")
15157		return
15158	}
15159
15160	return
15161}
15162
15163// InvokeInfrastructureCommandPreparer prepares the InvokeInfrastructureCommand request.
15164func (client BaseClient) InvokeInfrastructureCommandPreparer(ctx context.Context, command string, serviceID string, timeout *int64) (*http.Request, error) {
15165	const APIVersion = "6.0"
15166	queryParameters := map[string]interface{}{
15167		"api-version": APIVersion,
15168		"Command":     autorest.Encode("query", command),
15169	}
15170	if len(serviceID) > 0 {
15171		queryParameters["ServiceId"] = autorest.Encode("query", serviceID)
15172	}
15173	if timeout != nil {
15174		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15175	} else {
15176		queryParameters["timeout"] = autorest.Encode("query", 60)
15177	}
15178
15179	preparer := autorest.CreatePreparer(
15180		autorest.AsPost(),
15181		autorest.WithBaseURL(client.BaseURI),
15182		autorest.WithPath("/$/InvokeInfrastructureCommand"),
15183		autorest.WithQueryParameters(queryParameters))
15184	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15185}
15186
15187// InvokeInfrastructureCommandSender sends the InvokeInfrastructureCommand request. The method will close the
15188// http.Response Body if it receives an error.
15189func (client BaseClient) InvokeInfrastructureCommandSender(req *http.Request) (*http.Response, error) {
15190	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15191}
15192
15193// InvokeInfrastructureCommandResponder handles the response to the InvokeInfrastructureCommand request. The method always
15194// closes the http.Response Body.
15195func (client BaseClient) InvokeInfrastructureCommandResponder(resp *http.Response) (result String, err error) {
15196	err = autorest.Respond(
15197		resp,
15198		azure.WithErrorUnlessStatusCode(http.StatusOK),
15199		autorest.ByUnmarshallingJSON(&result.Value),
15200		autorest.ByClosing())
15201	result.Response = autorest.Response{Response: resp}
15202	return
15203}
15204
15205// InvokeInfrastructureQuery for clusters that have one or more instances of the Infrastructure Service configured,
15206// this API provides a way to send infrastructure-specific queries to a particular
15207// instance of the Infrastructure Service.
15208//
15209// Available commands and their corresponding response formats vary depending upon
15210// the infrastructure on which the cluster is running.
15211//
15212// This API supports the Service Fabric platform; it is not meant to be used directly from your code.
15213// Parameters:
15214// command - the text of the command to be invoked. The content of the command is infrastructure-specific.
15215// serviceID - the identity of the infrastructure service. This is the full name of the infrastructure service
15216// without the 'fabric:' URI scheme. This parameter required only for the cluster that has more than one
15217// instance of infrastructure service running.
15218// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15219// duration that the client is willing to wait for the requested operation to complete. The default value for
15220// this parameter is 60 seconds.
15221func (client BaseClient) InvokeInfrastructureQuery(ctx context.Context, command string, serviceID string, timeout *int64) (result String, err error) {
15222	if tracing.IsEnabled() {
15223		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeInfrastructureQuery")
15224		defer func() {
15225			sc := -1
15226			if result.Response.Response != nil {
15227				sc = result.Response.Response.StatusCode
15228			}
15229			tracing.EndSpan(ctx, sc, err)
15230		}()
15231	}
15232	if err := validation.Validate([]validation.Validation{
15233		{TargetValue: timeout,
15234			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15235				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15236					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15237				}}}}}); err != nil {
15238		return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureQuery", err.Error())
15239	}
15240
15241	req, err := client.InvokeInfrastructureQueryPreparer(ctx, command, serviceID, timeout)
15242	if err != nil {
15243		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", nil, "Failure preparing request")
15244		return
15245	}
15246
15247	resp, err := client.InvokeInfrastructureQuerySender(req)
15248	if err != nil {
15249		result.Response = autorest.Response{Response: resp}
15250		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", resp, "Failure sending request")
15251		return
15252	}
15253
15254	result, err = client.InvokeInfrastructureQueryResponder(resp)
15255	if err != nil {
15256		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", resp, "Failure responding to request")
15257		return
15258	}
15259
15260	return
15261}
15262
15263// InvokeInfrastructureQueryPreparer prepares the InvokeInfrastructureQuery request.
15264func (client BaseClient) InvokeInfrastructureQueryPreparer(ctx context.Context, command string, serviceID string, timeout *int64) (*http.Request, error) {
15265	const APIVersion = "6.0"
15266	queryParameters := map[string]interface{}{
15267		"api-version": APIVersion,
15268		"Command":     autorest.Encode("query", command),
15269	}
15270	if len(serviceID) > 0 {
15271		queryParameters["ServiceId"] = autorest.Encode("query", serviceID)
15272	}
15273	if timeout != nil {
15274		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15275	} else {
15276		queryParameters["timeout"] = autorest.Encode("query", 60)
15277	}
15278
15279	preparer := autorest.CreatePreparer(
15280		autorest.AsGet(),
15281		autorest.WithBaseURL(client.BaseURI),
15282		autorest.WithPath("/$/InvokeInfrastructureQuery"),
15283		autorest.WithQueryParameters(queryParameters))
15284	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15285}
15286
15287// InvokeInfrastructureQuerySender sends the InvokeInfrastructureQuery request. The method will close the
15288// http.Response Body if it receives an error.
15289func (client BaseClient) InvokeInfrastructureQuerySender(req *http.Request) (*http.Response, error) {
15290	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15291}
15292
15293// InvokeInfrastructureQueryResponder handles the response to the InvokeInfrastructureQuery request. The method always
15294// closes the http.Response Body.
15295func (client BaseClient) InvokeInfrastructureQueryResponder(resp *http.Response) (result String, err error) {
15296	err = autorest.Respond(
15297		resp,
15298		azure.WithErrorUnlessStatusCode(http.StatusOK),
15299		autorest.ByUnmarshallingJSON(&result.Value),
15300		autorest.ByClosing())
15301	result.Response = autorest.Response{Response: resp}
15302	return
15303}
15304
15305// PostChaosSchedule chaos will automatically schedule runs based on the Chaos Schedule.
15306// The Chaos Schedule will be updated if the provided version matches the version on the server.
15307// When updating the Chaos Schedule, the version on the server is incremented by 1.
15308// The version on the server will wrap back to 0 after reaching a large number.
15309// If Chaos is running when this call is made, the call will fail.
15310// Parameters:
15311// chaosSchedule - describes the schedule used by Chaos.
15312// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15313// duration that the client is willing to wait for the requested operation to complete. The default value for
15314// this parameter is 60 seconds.
15315func (client BaseClient) PostChaosSchedule(ctx context.Context, chaosSchedule ChaosScheduleDescription, timeout *int64) (result autorest.Response, err error) {
15316	if tracing.IsEnabled() {
15317		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PostChaosSchedule")
15318		defer func() {
15319			sc := -1
15320			if result.Response != nil {
15321				sc = result.Response.StatusCode
15322			}
15323			tracing.EndSpan(ctx, sc, err)
15324		}()
15325	}
15326	if err := validation.Validate([]validation.Validation{
15327		{TargetValue: timeout,
15328			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15329				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15330					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15331				}}}},
15332		{TargetValue: chaosSchedule,
15333			Constraints: []validation.Constraint{{Target: "chaosSchedule.Version", Name: validation.Null, Rule: false,
15334				Chain: []validation.Constraint{{Target: "chaosSchedule.Version", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil {
15335		return result, validation.NewError("servicefabric.BaseClient", "PostChaosSchedule", err.Error())
15336	}
15337
15338	req, err := client.PostChaosSchedulePreparer(ctx, chaosSchedule, timeout)
15339	if err != nil {
15340		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", nil, "Failure preparing request")
15341		return
15342	}
15343
15344	resp, err := client.PostChaosScheduleSender(req)
15345	if err != nil {
15346		result.Response = resp
15347		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", resp, "Failure sending request")
15348		return
15349	}
15350
15351	result, err = client.PostChaosScheduleResponder(resp)
15352	if err != nil {
15353		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", resp, "Failure responding to request")
15354		return
15355	}
15356
15357	return
15358}
15359
15360// PostChaosSchedulePreparer prepares the PostChaosSchedule request.
15361func (client BaseClient) PostChaosSchedulePreparer(ctx context.Context, chaosSchedule ChaosScheduleDescription, timeout *int64) (*http.Request, error) {
15362	const APIVersion = "6.2"
15363	queryParameters := map[string]interface{}{
15364		"api-version": APIVersion,
15365	}
15366	if timeout != nil {
15367		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15368	} else {
15369		queryParameters["timeout"] = autorest.Encode("query", 60)
15370	}
15371
15372	preparer := autorest.CreatePreparer(
15373		autorest.AsContentType("application/json; charset=utf-8"),
15374		autorest.AsPost(),
15375		autorest.WithBaseURL(client.BaseURI),
15376		autorest.WithPath("/Tools/Chaos/Schedule"),
15377		autorest.WithJSON(chaosSchedule),
15378		autorest.WithQueryParameters(queryParameters))
15379	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15380}
15381
15382// PostChaosScheduleSender sends the PostChaosSchedule request. The method will close the
15383// http.Response Body if it receives an error.
15384func (client BaseClient) PostChaosScheduleSender(req *http.Request) (*http.Response, error) {
15385	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15386}
15387
15388// PostChaosScheduleResponder handles the response to the PostChaosSchedule request. The method always
15389// closes the http.Response Body.
15390func (client BaseClient) PostChaosScheduleResponder(resp *http.Response) (result autorest.Response, err error) {
15391	err = autorest.Respond(
15392		resp,
15393		azure.WithErrorUnlessStatusCode(http.StatusOK),
15394		autorest.ByClosing())
15395	result.Response = resp
15396	return
15397}
15398
15399// ProvisionApplicationType provisions a Service Fabric application type with the cluster. The provision is required
15400// before any new applications can be instantiated.
15401// The provision operation can be performed either on the application package specified by the
15402// relativePathInImageStore, or by using the URI of the external '.sfpkg'.
15403// Parameters:
15404// provisionApplicationTypeDescriptionBaseRequiredBodyParam - the base type of provision application type
15405// description which supports either image store-based provision or external store-based provision.
15406// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15407// duration that the client is willing to wait for the requested operation to complete. The default value for
15408// this parameter is 60 seconds.
15409func (client BaseClient) ProvisionApplicationType(ctx context.Context, provisionApplicationTypeDescriptionBaseRequiredBodyParam BasicProvisionApplicationTypeDescriptionBase, timeout *int64) (result autorest.Response, err error) {
15410	if tracing.IsEnabled() {
15411		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ProvisionApplicationType")
15412		defer func() {
15413			sc := -1
15414			if result.Response != nil {
15415				sc = result.Response.StatusCode
15416			}
15417			tracing.EndSpan(ctx, sc, err)
15418		}()
15419	}
15420	if err := validation.Validate([]validation.Validation{
15421		{TargetValue: provisionApplicationTypeDescriptionBaseRequiredBodyParam,
15422			Constraints: []validation.Constraint{{Target: "provisionApplicationTypeDescriptionBaseRequiredBodyParam.Async", Name: validation.Null, Rule: true, Chain: nil}}},
15423		{TargetValue: timeout,
15424			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15425				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15426					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15427				}}}}}); err != nil {
15428		return result, validation.NewError("servicefabric.BaseClient", "ProvisionApplicationType", err.Error())
15429	}
15430
15431	req, err := client.ProvisionApplicationTypePreparer(ctx, provisionApplicationTypeDescriptionBaseRequiredBodyParam, timeout)
15432	if err != nil {
15433		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", nil, "Failure preparing request")
15434		return
15435	}
15436
15437	resp, err := client.ProvisionApplicationTypeSender(req)
15438	if err != nil {
15439		result.Response = resp
15440		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", resp, "Failure sending request")
15441		return
15442	}
15443
15444	result, err = client.ProvisionApplicationTypeResponder(resp)
15445	if err != nil {
15446		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", resp, "Failure responding to request")
15447		return
15448	}
15449
15450	return
15451}
15452
15453// ProvisionApplicationTypePreparer prepares the ProvisionApplicationType request.
15454func (client BaseClient) ProvisionApplicationTypePreparer(ctx context.Context, provisionApplicationTypeDescriptionBaseRequiredBodyParam BasicProvisionApplicationTypeDescriptionBase, timeout *int64) (*http.Request, error) {
15455	const APIVersion = "6.2"
15456	queryParameters := map[string]interface{}{
15457		"api-version": APIVersion,
15458	}
15459	if timeout != nil {
15460		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15461	} else {
15462		queryParameters["timeout"] = autorest.Encode("query", 60)
15463	}
15464
15465	preparer := autorest.CreatePreparer(
15466		autorest.AsContentType("application/json; charset=utf-8"),
15467		autorest.AsPost(),
15468		autorest.WithBaseURL(client.BaseURI),
15469		autorest.WithPath("/ApplicationTypes/$/Provision"),
15470		autorest.WithJSON(provisionApplicationTypeDescriptionBaseRequiredBodyParam),
15471		autorest.WithQueryParameters(queryParameters))
15472	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15473}
15474
15475// ProvisionApplicationTypeSender sends the ProvisionApplicationType request. The method will close the
15476// http.Response Body if it receives an error.
15477func (client BaseClient) ProvisionApplicationTypeSender(req *http.Request) (*http.Response, error) {
15478	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15479}
15480
15481// ProvisionApplicationTypeResponder handles the response to the ProvisionApplicationType request. The method always
15482// closes the http.Response Body.
15483func (client BaseClient) ProvisionApplicationTypeResponder(resp *http.Response) (result autorest.Response, err error) {
15484	err = autorest.Respond(
15485		resp,
15486		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
15487		autorest.ByClosing())
15488	result.Response = resp
15489	return
15490}
15491
15492// ProvisionCluster validate and provision the code or configuration packages of a Service Fabric cluster.
15493// Parameters:
15494// provisionFabricDescription - describes the parameters for provisioning a cluster.
15495// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15496// duration that the client is willing to wait for the requested operation to complete. The default value for
15497// this parameter is 60 seconds.
15498func (client BaseClient) ProvisionCluster(ctx context.Context, provisionFabricDescription ProvisionFabricDescription, timeout *int64) (result autorest.Response, err error) {
15499	if tracing.IsEnabled() {
15500		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ProvisionCluster")
15501		defer func() {
15502			sc := -1
15503			if result.Response != nil {
15504				sc = result.Response.StatusCode
15505			}
15506			tracing.EndSpan(ctx, sc, err)
15507		}()
15508	}
15509	if err := validation.Validate([]validation.Validation{
15510		{TargetValue: timeout,
15511			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15512				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15513					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15514				}}}}}); err != nil {
15515		return result, validation.NewError("servicefabric.BaseClient", "ProvisionCluster", err.Error())
15516	}
15517
15518	req, err := client.ProvisionClusterPreparer(ctx, provisionFabricDescription, timeout)
15519	if err != nil {
15520		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", nil, "Failure preparing request")
15521		return
15522	}
15523
15524	resp, err := client.ProvisionClusterSender(req)
15525	if err != nil {
15526		result.Response = resp
15527		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", resp, "Failure sending request")
15528		return
15529	}
15530
15531	result, err = client.ProvisionClusterResponder(resp)
15532	if err != nil {
15533		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", resp, "Failure responding to request")
15534		return
15535	}
15536
15537	return
15538}
15539
15540// ProvisionClusterPreparer prepares the ProvisionCluster request.
15541func (client BaseClient) ProvisionClusterPreparer(ctx context.Context, provisionFabricDescription ProvisionFabricDescription, timeout *int64) (*http.Request, error) {
15542	const APIVersion = "6.0"
15543	queryParameters := map[string]interface{}{
15544		"api-version": APIVersion,
15545	}
15546	if timeout != nil {
15547		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15548	} else {
15549		queryParameters["timeout"] = autorest.Encode("query", 60)
15550	}
15551
15552	preparer := autorest.CreatePreparer(
15553		autorest.AsContentType("application/json; charset=utf-8"),
15554		autorest.AsPost(),
15555		autorest.WithBaseURL(client.BaseURI),
15556		autorest.WithPath("/$/Provision"),
15557		autorest.WithJSON(provisionFabricDescription),
15558		autorest.WithQueryParameters(queryParameters))
15559	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15560}
15561
15562// ProvisionClusterSender sends the ProvisionCluster request. The method will close the
15563// http.Response Body if it receives an error.
15564func (client BaseClient) ProvisionClusterSender(req *http.Request) (*http.Response, error) {
15565	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15566}
15567
15568// ProvisionClusterResponder handles the response to the ProvisionCluster request. The method always
15569// closes the http.Response Body.
15570func (client BaseClient) ProvisionClusterResponder(resp *http.Response) (result autorest.Response, err error) {
15571	err = autorest.Respond(
15572		resp,
15573		azure.WithErrorUnlessStatusCode(http.StatusOK),
15574		autorest.ByClosing())
15575	result.Response = resp
15576	return
15577}
15578
15579// PutProperty creates or updates the specified Service Fabric property under a given name.
15580// Parameters:
15581// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
15582// propertyDescription - describes the Service Fabric property to be created.
15583// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15584// duration that the client is willing to wait for the requested operation to complete. The default value for
15585// this parameter is 60 seconds.
15586func (client BaseClient) PutProperty(ctx context.Context, nameID string, propertyDescription PropertyDescription, timeout *int64) (result autorest.Response, err error) {
15587	if tracing.IsEnabled() {
15588		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PutProperty")
15589		defer func() {
15590			sc := -1
15591			if result.Response != nil {
15592				sc = result.Response.StatusCode
15593			}
15594			tracing.EndSpan(ctx, sc, err)
15595		}()
15596	}
15597	if err := validation.Validate([]validation.Validation{
15598		{TargetValue: propertyDescription,
15599			Constraints: []validation.Constraint{{Target: "propertyDescription.PropertyName", Name: validation.Null, Rule: true, Chain: nil}}},
15600		{TargetValue: timeout,
15601			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15602				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15603					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15604				}}}}}); err != nil {
15605		return result, validation.NewError("servicefabric.BaseClient", "PutProperty", err.Error())
15606	}
15607
15608	req, err := client.PutPropertyPreparer(ctx, nameID, propertyDescription, timeout)
15609	if err != nil {
15610		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", nil, "Failure preparing request")
15611		return
15612	}
15613
15614	resp, err := client.PutPropertySender(req)
15615	if err != nil {
15616		result.Response = resp
15617		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", resp, "Failure sending request")
15618		return
15619	}
15620
15621	result, err = client.PutPropertyResponder(resp)
15622	if err != nil {
15623		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", resp, "Failure responding to request")
15624		return
15625	}
15626
15627	return
15628}
15629
15630// PutPropertyPreparer prepares the PutProperty request.
15631func (client BaseClient) PutPropertyPreparer(ctx context.Context, nameID string, propertyDescription PropertyDescription, timeout *int64) (*http.Request, error) {
15632	pathParameters := map[string]interface{}{
15633		"nameId": nameID,
15634	}
15635
15636	const APIVersion = "6.0"
15637	queryParameters := map[string]interface{}{
15638		"api-version": APIVersion,
15639	}
15640	if timeout != nil {
15641		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15642	} else {
15643		queryParameters["timeout"] = autorest.Encode("query", 60)
15644	}
15645
15646	preparer := autorest.CreatePreparer(
15647		autorest.AsContentType("application/json; charset=utf-8"),
15648		autorest.AsPut(),
15649		autorest.WithBaseURL(client.BaseURI),
15650		autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters),
15651		autorest.WithJSON(propertyDescription),
15652		autorest.WithQueryParameters(queryParameters))
15653	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15654}
15655
15656// PutPropertySender sends the PutProperty request. The method will close the
15657// http.Response Body if it receives an error.
15658func (client BaseClient) PutPropertySender(req *http.Request) (*http.Response, error) {
15659	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15660}
15661
15662// PutPropertyResponder handles the response to the PutProperty request. The method always
15663// closes the http.Response Body.
15664func (client BaseClient) PutPropertyResponder(resp *http.Response) (result autorest.Response, err error) {
15665	err = autorest.Respond(
15666		resp,
15667		azure.WithErrorUnlessStatusCode(http.StatusOK),
15668		autorest.ByClosing())
15669	result.Response = resp
15670	return
15671}
15672
15673// RecoverAllPartitions this operation should only be performed if it is known that the replicas that are down cannot
15674// be recovered. Incorrect use of this API can cause potential data loss.
15675// Parameters:
15676// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15677// duration that the client is willing to wait for the requested operation to complete. The default value for
15678// this parameter is 60 seconds.
15679func (client BaseClient) RecoverAllPartitions(ctx context.Context, timeout *int64) (result autorest.Response, err error) {
15680	if tracing.IsEnabled() {
15681		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverAllPartitions")
15682		defer func() {
15683			sc := -1
15684			if result.Response != nil {
15685				sc = result.Response.StatusCode
15686			}
15687			tracing.EndSpan(ctx, sc, err)
15688		}()
15689	}
15690	if err := validation.Validate([]validation.Validation{
15691		{TargetValue: timeout,
15692			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15693				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15694					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15695				}}}}}); err != nil {
15696		return result, validation.NewError("servicefabric.BaseClient", "RecoverAllPartitions", err.Error())
15697	}
15698
15699	req, err := client.RecoverAllPartitionsPreparer(ctx, timeout)
15700	if err != nil {
15701		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", nil, "Failure preparing request")
15702		return
15703	}
15704
15705	resp, err := client.RecoverAllPartitionsSender(req)
15706	if err != nil {
15707		result.Response = resp
15708		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", resp, "Failure sending request")
15709		return
15710	}
15711
15712	result, err = client.RecoverAllPartitionsResponder(resp)
15713	if err != nil {
15714		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", resp, "Failure responding to request")
15715		return
15716	}
15717
15718	return
15719}
15720
15721// RecoverAllPartitionsPreparer prepares the RecoverAllPartitions request.
15722func (client BaseClient) RecoverAllPartitionsPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
15723	const APIVersion = "6.0"
15724	queryParameters := map[string]interface{}{
15725		"api-version": APIVersion,
15726	}
15727	if timeout != nil {
15728		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15729	} else {
15730		queryParameters["timeout"] = autorest.Encode("query", 60)
15731	}
15732
15733	preparer := autorest.CreatePreparer(
15734		autorest.AsPost(),
15735		autorest.WithBaseURL(client.BaseURI),
15736		autorest.WithPath("/$/RecoverAllPartitions"),
15737		autorest.WithQueryParameters(queryParameters))
15738	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15739}
15740
15741// RecoverAllPartitionsSender sends the RecoverAllPartitions request. The method will close the
15742// http.Response Body if it receives an error.
15743func (client BaseClient) RecoverAllPartitionsSender(req *http.Request) (*http.Response, error) {
15744	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15745}
15746
15747// RecoverAllPartitionsResponder handles the response to the RecoverAllPartitions request. The method always
15748// closes the http.Response Body.
15749func (client BaseClient) RecoverAllPartitionsResponder(resp *http.Response) (result autorest.Response, err error) {
15750	err = autorest.Respond(
15751		resp,
15752		azure.WithErrorUnlessStatusCode(http.StatusOK),
15753		autorest.ByClosing())
15754	result.Response = resp
15755	return
15756}
15757
15758// RecoverPartition this operation should only be performed if it is known that the replicas that are down cannot be
15759// recovered. Incorrect use of this API can cause potential data loss.
15760// Parameters:
15761// partitionID - the identity of the partition.
15762// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15763// duration that the client is willing to wait for the requested operation to complete. The default value for
15764// this parameter is 60 seconds.
15765func (client BaseClient) RecoverPartition(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
15766	if tracing.IsEnabled() {
15767		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverPartition")
15768		defer func() {
15769			sc := -1
15770			if result.Response != nil {
15771				sc = result.Response.StatusCode
15772			}
15773			tracing.EndSpan(ctx, sc, err)
15774		}()
15775	}
15776	if err := validation.Validate([]validation.Validation{
15777		{TargetValue: timeout,
15778			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15779				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15780					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15781				}}}}}); err != nil {
15782		return result, validation.NewError("servicefabric.BaseClient", "RecoverPartition", err.Error())
15783	}
15784
15785	req, err := client.RecoverPartitionPreparer(ctx, partitionID, timeout)
15786	if err != nil {
15787		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", nil, "Failure preparing request")
15788		return
15789	}
15790
15791	resp, err := client.RecoverPartitionSender(req)
15792	if err != nil {
15793		result.Response = resp
15794		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", resp, "Failure sending request")
15795		return
15796	}
15797
15798	result, err = client.RecoverPartitionResponder(resp)
15799	if err != nil {
15800		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", resp, "Failure responding to request")
15801		return
15802	}
15803
15804	return
15805}
15806
15807// RecoverPartitionPreparer prepares the RecoverPartition request.
15808func (client BaseClient) RecoverPartitionPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
15809	pathParameters := map[string]interface{}{
15810		"partitionId": partitionID,
15811	}
15812
15813	const APIVersion = "6.0"
15814	queryParameters := map[string]interface{}{
15815		"api-version": APIVersion,
15816	}
15817	if timeout != nil {
15818		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15819	} else {
15820		queryParameters["timeout"] = autorest.Encode("query", 60)
15821	}
15822
15823	preparer := autorest.CreatePreparer(
15824		autorest.AsPost(),
15825		autorest.WithBaseURL(client.BaseURI),
15826		autorest.WithPathParameters("/Partitions/{partitionId}/$/Recover", pathParameters),
15827		autorest.WithQueryParameters(queryParameters))
15828	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15829}
15830
15831// RecoverPartitionSender sends the RecoverPartition request. The method will close the
15832// http.Response Body if it receives an error.
15833func (client BaseClient) RecoverPartitionSender(req *http.Request) (*http.Response, error) {
15834	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15835}
15836
15837// RecoverPartitionResponder handles the response to the RecoverPartition request. The method always
15838// closes the http.Response Body.
15839func (client BaseClient) RecoverPartitionResponder(resp *http.Response) (result autorest.Response, err error) {
15840	err = autorest.Respond(
15841		resp,
15842		azure.WithErrorUnlessStatusCode(http.StatusOK),
15843		autorest.ByClosing())
15844	result.Response = resp
15845	return
15846}
15847
15848// RecoverServicePartitions indicates to the Service Fabric cluster that it should attempt to recover the specified
15849// service that is currently stuck in quorum loss. This operation should only be performed if it is known that the
15850// replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss.
15851// Parameters:
15852// serviceID - the identity of the service. This ID is typically the full name of the service without the
15853// 'fabric:' URI scheme.
15854// Starting from version 6.0, hierarchical names are delimited with the "~" character.
15855// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
15856// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
15857// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15858// duration that the client is willing to wait for the requested operation to complete. The default value for
15859// this parameter is 60 seconds.
15860func (client BaseClient) RecoverServicePartitions(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) {
15861	if tracing.IsEnabled() {
15862		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverServicePartitions")
15863		defer func() {
15864			sc := -1
15865			if result.Response != nil {
15866				sc = result.Response.StatusCode
15867			}
15868			tracing.EndSpan(ctx, sc, err)
15869		}()
15870	}
15871	if err := validation.Validate([]validation.Validation{
15872		{TargetValue: timeout,
15873			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15874				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15875					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15876				}}}}}); err != nil {
15877		return result, validation.NewError("servicefabric.BaseClient", "RecoverServicePartitions", err.Error())
15878	}
15879
15880	req, err := client.RecoverServicePartitionsPreparer(ctx, serviceID, timeout)
15881	if err != nil {
15882		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", nil, "Failure preparing request")
15883		return
15884	}
15885
15886	resp, err := client.RecoverServicePartitionsSender(req)
15887	if err != nil {
15888		result.Response = resp
15889		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", resp, "Failure sending request")
15890		return
15891	}
15892
15893	result, err = client.RecoverServicePartitionsResponder(resp)
15894	if err != nil {
15895		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", resp, "Failure responding to request")
15896		return
15897	}
15898
15899	return
15900}
15901
15902// RecoverServicePartitionsPreparer prepares the RecoverServicePartitions request.
15903func (client BaseClient) RecoverServicePartitionsPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
15904	pathParameters := map[string]interface{}{
15905		"serviceId": serviceID,
15906	}
15907
15908	const APIVersion = "6.0"
15909	queryParameters := map[string]interface{}{
15910		"api-version": APIVersion,
15911	}
15912	if timeout != nil {
15913		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15914	} else {
15915		queryParameters["timeout"] = autorest.Encode("query", 60)
15916	}
15917
15918	preparer := autorest.CreatePreparer(
15919		autorest.AsPost(),
15920		autorest.WithBaseURL(client.BaseURI),
15921		autorest.WithPathParameters("/Services/$/{serviceId}/$/GetPartitions/$/Recover", pathParameters),
15922		autorest.WithQueryParameters(queryParameters))
15923	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15924}
15925
15926// RecoverServicePartitionsSender sends the RecoverServicePartitions request. The method will close the
15927// http.Response Body if it receives an error.
15928func (client BaseClient) RecoverServicePartitionsSender(req *http.Request) (*http.Response, error) {
15929	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15930}
15931
15932// RecoverServicePartitionsResponder handles the response to the RecoverServicePartitions request. The method always
15933// closes the http.Response Body.
15934func (client BaseClient) RecoverServicePartitionsResponder(resp *http.Response) (result autorest.Response, err error) {
15935	err = autorest.Respond(
15936		resp,
15937		azure.WithErrorUnlessStatusCode(http.StatusOK),
15938		autorest.ByClosing())
15939	result.Response = resp
15940	return
15941}
15942
15943// RecoverSystemPartitions indicates to the Service Fabric cluster that it should attempt to recover the system
15944// services that are currently stuck in quorum loss. This operation should only be performed if it is known that the
15945// replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss.
15946// Parameters:
15947// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15948// duration that the client is willing to wait for the requested operation to complete. The default value for
15949// this parameter is 60 seconds.
15950func (client BaseClient) RecoverSystemPartitions(ctx context.Context, timeout *int64) (result autorest.Response, err error) {
15951	if tracing.IsEnabled() {
15952		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverSystemPartitions")
15953		defer func() {
15954			sc := -1
15955			if result.Response != nil {
15956				sc = result.Response.StatusCode
15957			}
15958			tracing.EndSpan(ctx, sc, err)
15959		}()
15960	}
15961	if err := validation.Validate([]validation.Validation{
15962		{TargetValue: timeout,
15963			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15964				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15965					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15966				}}}}}); err != nil {
15967		return result, validation.NewError("servicefabric.BaseClient", "RecoverSystemPartitions", err.Error())
15968	}
15969
15970	req, err := client.RecoverSystemPartitionsPreparer(ctx, timeout)
15971	if err != nil {
15972		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", nil, "Failure preparing request")
15973		return
15974	}
15975
15976	resp, err := client.RecoverSystemPartitionsSender(req)
15977	if err != nil {
15978		result.Response = resp
15979		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", resp, "Failure sending request")
15980		return
15981	}
15982
15983	result, err = client.RecoverSystemPartitionsResponder(resp)
15984	if err != nil {
15985		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", resp, "Failure responding to request")
15986		return
15987	}
15988
15989	return
15990}
15991
15992// RecoverSystemPartitionsPreparer prepares the RecoverSystemPartitions request.
15993func (client BaseClient) RecoverSystemPartitionsPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
15994	const APIVersion = "6.0"
15995	queryParameters := map[string]interface{}{
15996		"api-version": APIVersion,
15997	}
15998	if timeout != nil {
15999		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16000	} else {
16001		queryParameters["timeout"] = autorest.Encode("query", 60)
16002	}
16003
16004	preparer := autorest.CreatePreparer(
16005		autorest.AsPost(),
16006		autorest.WithBaseURL(client.BaseURI),
16007		autorest.WithPath("/$/RecoverSystemPartitions"),
16008		autorest.WithQueryParameters(queryParameters))
16009	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16010}
16011
16012// RecoverSystemPartitionsSender sends the RecoverSystemPartitions request. The method will close the
16013// http.Response Body if it receives an error.
16014func (client BaseClient) RecoverSystemPartitionsSender(req *http.Request) (*http.Response, error) {
16015	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16016}
16017
16018// RecoverSystemPartitionsResponder handles the response to the RecoverSystemPartitions request. The method always
16019// closes the http.Response Body.
16020func (client BaseClient) RecoverSystemPartitionsResponder(resp *http.Response) (result autorest.Response, err error) {
16021	err = autorest.Respond(
16022		resp,
16023		azure.WithErrorUnlessStatusCode(http.StatusOK),
16024		autorest.ByClosing())
16025	result.Response = resp
16026	return
16027}
16028
16029// RemoveComposeDeployment deletes an existing Service Fabric compose deployment.
16030// Parameters:
16031// deploymentName - the identity of the deployment.
16032// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16033// duration that the client is willing to wait for the requested operation to complete. The default value for
16034// this parameter is 60 seconds.
16035func (client BaseClient) RemoveComposeDeployment(ctx context.Context, deploymentName string, timeout *int64) (result autorest.Response, err error) {
16036	if tracing.IsEnabled() {
16037		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveComposeDeployment")
16038		defer func() {
16039			sc := -1
16040			if result.Response != nil {
16041				sc = result.Response.StatusCode
16042			}
16043			tracing.EndSpan(ctx, sc, err)
16044		}()
16045	}
16046	if err := validation.Validate([]validation.Validation{
16047		{TargetValue: timeout,
16048			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16049				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16050					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16051				}}}}}); err != nil {
16052		return result, validation.NewError("servicefabric.BaseClient", "RemoveComposeDeployment", err.Error())
16053	}
16054
16055	req, err := client.RemoveComposeDeploymentPreparer(ctx, deploymentName, timeout)
16056	if err != nil {
16057		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", nil, "Failure preparing request")
16058		return
16059	}
16060
16061	resp, err := client.RemoveComposeDeploymentSender(req)
16062	if err != nil {
16063		result.Response = resp
16064		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", resp, "Failure sending request")
16065		return
16066	}
16067
16068	result, err = client.RemoveComposeDeploymentResponder(resp)
16069	if err != nil {
16070		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", resp, "Failure responding to request")
16071		return
16072	}
16073
16074	return
16075}
16076
16077// RemoveComposeDeploymentPreparer prepares the RemoveComposeDeployment request.
16078func (client BaseClient) RemoveComposeDeploymentPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) {
16079	pathParameters := map[string]interface{}{
16080		"deploymentName": deploymentName,
16081	}
16082
16083	const APIVersion = "6.0-preview"
16084	queryParameters := map[string]interface{}{
16085		"api-version": APIVersion,
16086	}
16087	if timeout != nil {
16088		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16089	} else {
16090		queryParameters["timeout"] = autorest.Encode("query", 60)
16091	}
16092
16093	preparer := autorest.CreatePreparer(
16094		autorest.AsPost(),
16095		autorest.WithBaseURL(client.BaseURI),
16096		autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/Delete", pathParameters),
16097		autorest.WithQueryParameters(queryParameters))
16098	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16099}
16100
16101// RemoveComposeDeploymentSender sends the RemoveComposeDeployment request. The method will close the
16102// http.Response Body if it receives an error.
16103func (client BaseClient) RemoveComposeDeploymentSender(req *http.Request) (*http.Response, error) {
16104	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16105}
16106
16107// RemoveComposeDeploymentResponder handles the response to the RemoveComposeDeployment request. The method always
16108// closes the http.Response Body.
16109func (client BaseClient) RemoveComposeDeploymentResponder(resp *http.Response) (result autorest.Response, err error) {
16110	err = autorest.Respond(
16111		resp,
16112		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
16113		autorest.ByClosing())
16114	result.Response = resp
16115	return
16116}
16117
16118// RemoveNodeState this implies that it is not possible to recover the persisted state of that node. This generally
16119// happens if a hard disk has been wiped clean, or if a hard disk crashes. The node has to be down for this operation
16120// to be successful. This operation lets Service Fabric know that the replicas on that node no longer exist, and that
16121// Service Fabric should stop waiting for those replicas to come back up. Do not run this cmdlet if the state on the
16122// node has not been removed and the node can come back up with its state intact.
16123// Parameters:
16124// nodeName - the name of the node.
16125// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16126// duration that the client is willing to wait for the requested operation to complete. The default value for
16127// this parameter is 60 seconds.
16128func (client BaseClient) RemoveNodeState(ctx context.Context, nodeName string, timeout *int64) (result autorest.Response, err error) {
16129	if tracing.IsEnabled() {
16130		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveNodeState")
16131		defer func() {
16132			sc := -1
16133			if result.Response != nil {
16134				sc = result.Response.StatusCode
16135			}
16136			tracing.EndSpan(ctx, sc, err)
16137		}()
16138	}
16139	if err := validation.Validate([]validation.Validation{
16140		{TargetValue: timeout,
16141			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16142				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16143					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16144				}}}}}); err != nil {
16145		return result, validation.NewError("servicefabric.BaseClient", "RemoveNodeState", err.Error())
16146	}
16147
16148	req, err := client.RemoveNodeStatePreparer(ctx, nodeName, timeout)
16149	if err != nil {
16150		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", nil, "Failure preparing request")
16151		return
16152	}
16153
16154	resp, err := client.RemoveNodeStateSender(req)
16155	if err != nil {
16156		result.Response = resp
16157		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", resp, "Failure sending request")
16158		return
16159	}
16160
16161	result, err = client.RemoveNodeStateResponder(resp)
16162	if err != nil {
16163		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", resp, "Failure responding to request")
16164		return
16165	}
16166
16167	return
16168}
16169
16170// RemoveNodeStatePreparer prepares the RemoveNodeState request.
16171func (client BaseClient) RemoveNodeStatePreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) {
16172	pathParameters := map[string]interface{}{
16173		"nodeName": autorest.Encode("path", nodeName),
16174	}
16175
16176	const APIVersion = "6.0"
16177	queryParameters := map[string]interface{}{
16178		"api-version": APIVersion,
16179	}
16180	if timeout != nil {
16181		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16182	} else {
16183		queryParameters["timeout"] = autorest.Encode("query", 60)
16184	}
16185
16186	preparer := autorest.CreatePreparer(
16187		autorest.AsPost(),
16188		autorest.WithBaseURL(client.BaseURI),
16189		autorest.WithPathParameters("/Nodes/{nodeName}/$/RemoveNodeState", pathParameters),
16190		autorest.WithQueryParameters(queryParameters))
16191	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16192}
16193
16194// RemoveNodeStateSender sends the RemoveNodeState request. The method will close the
16195// http.Response Body if it receives an error.
16196func (client BaseClient) RemoveNodeStateSender(req *http.Request) (*http.Response, error) {
16197	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16198}
16199
16200// RemoveNodeStateResponder handles the response to the RemoveNodeState request. The method always
16201// closes the http.Response Body.
16202func (client BaseClient) RemoveNodeStateResponder(resp *http.Response) (result autorest.Response, err error) {
16203	err = autorest.Respond(
16204		resp,
16205		azure.WithErrorUnlessStatusCode(http.StatusOK),
16206		autorest.ByClosing())
16207	result.Response = resp
16208	return
16209}
16210
16211// RemoveReplica this API simulates a Service Fabric replica failure by removing a replica from a Service Fabric
16212// cluster. The removal closes the replica, transitions the replica to the role None, and then removes all of the state
16213// information of the replica from the cluster. This API tests the replica state removal path, and simulates the report
16214// fault permanent path through client APIs. Warning - There are no safety checks performed when this API is used.
16215// Incorrect use of this API can lead to data loss for stateful services. In addition, the forceRemove flag impacts all
16216// other replicas hosted in the same process.
16217// Parameters:
16218// nodeName - the name of the node.
16219// partitionID - the identity of the partition.
16220// replicaID - the identifier of the replica.
16221// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful
16222// shutdown sequence. This parameter can be used to forcefully delete an application or service for which
16223// delete is timing out due to issues in the service code that prevents graceful close of replicas.
16224// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16225// duration that the client is willing to wait for the requested operation to complete. The default value for
16226// this parameter is 60 seconds.
16227func (client BaseClient) RemoveReplica(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) {
16228	if tracing.IsEnabled() {
16229		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveReplica")
16230		defer func() {
16231			sc := -1
16232			if result.Response != nil {
16233				sc = result.Response.StatusCode
16234			}
16235			tracing.EndSpan(ctx, sc, err)
16236		}()
16237	}
16238	if err := validation.Validate([]validation.Validation{
16239		{TargetValue: timeout,
16240			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16241				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16242					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16243				}}}}}); err != nil {
16244		return result, validation.NewError("servicefabric.BaseClient", "RemoveReplica", err.Error())
16245	}
16246
16247	req, err := client.RemoveReplicaPreparer(ctx, nodeName, partitionID, replicaID, forceRemove, timeout)
16248	if err != nil {
16249		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", nil, "Failure preparing request")
16250		return
16251	}
16252
16253	resp, err := client.RemoveReplicaSender(req)
16254	if err != nil {
16255		result.Response = resp
16256		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", resp, "Failure sending request")
16257		return
16258	}
16259
16260	result, err = client.RemoveReplicaResponder(resp)
16261	if err != nil {
16262		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", resp, "Failure responding to request")
16263		return
16264	}
16265
16266	return
16267}
16268
16269// RemoveReplicaPreparer prepares the RemoveReplica request.
16270func (client BaseClient) RemoveReplicaPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, forceRemove *bool, timeout *int64) (*http.Request, error) {
16271	pathParameters := map[string]interface{}{
16272		"nodeName":    autorest.Encode("path", nodeName),
16273		"partitionId": partitionID,
16274		"replicaId":   replicaID,
16275	}
16276
16277	const APIVersion = "6.0"
16278	queryParameters := map[string]interface{}{
16279		"api-version": APIVersion,
16280	}
16281	if forceRemove != nil {
16282		queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove)
16283	}
16284	if timeout != nil {
16285		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16286	} else {
16287		queryParameters["timeout"] = autorest.Encode("query", 60)
16288	}
16289
16290	preparer := autorest.CreatePreparer(
16291		autorest.AsPost(),
16292		autorest.WithBaseURL(client.BaseURI),
16293		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Delete", pathParameters),
16294		autorest.WithQueryParameters(queryParameters))
16295	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16296}
16297
16298// RemoveReplicaSender sends the RemoveReplica request. The method will close the
16299// http.Response Body if it receives an error.
16300func (client BaseClient) RemoveReplicaSender(req *http.Request) (*http.Response, error) {
16301	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16302}
16303
16304// RemoveReplicaResponder handles the response to the RemoveReplica request. The method always
16305// closes the http.Response Body.
16306func (client BaseClient) RemoveReplicaResponder(resp *http.Response) (result autorest.Response, err error) {
16307	err = autorest.Respond(
16308		resp,
16309		azure.WithErrorUnlessStatusCode(http.StatusOK),
16310		autorest.ByClosing())
16311	result.Response = resp
16312	return
16313}
16314
16315// ReportApplicationHealth reports health state of the specified Service Fabric application. The report must contain
16316// the information about the source of the health report and property on which it is reported.
16317// The report is sent to a Service Fabric gateway Application, which forwards to the health store.
16318// The report may be accepted by the gateway, but rejected by the health store after extra validation.
16319// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
16320// To see whether the report was applied in the health store, get application health and check that the report appears
16321// in the HealthEvents section.
16322// Parameters:
16323// applicationID - the identity of the application. This is typically the full name of the application without
16324// the 'fabric:' URI scheme.
16325// Starting from version 6.0, hierarchical names are delimited with the "~" character.
16326// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
16327// in 6.0+ and "myapp/app1" in previous versions.
16328// healthInformation - describes the health information for the health report. This information needs to be
16329// present in all of the health reports sent to the health manager.
16330// immediate - a flag that indicates whether the report should be sent immediately.
16331// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
16332// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
16333// regardless of the fabric client settings that the HTTP Gateway Application is using.
16334// This is useful for critical reports that should be sent as soon as possible.
16335// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
16336// is closed or the message doesn't reach the Gateway.
16337// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
16338// Therefore, it will be batched according to the HealthReportSendInterval configuration.
16339// This is the recommended setting because it allows the health client to optimize health reporting messages to
16340// health store as well as health report processing.
16341// By default, reports are not sent immediately.
16342// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16343// duration that the client is willing to wait for the requested operation to complete. The default value for
16344// this parameter is 60 seconds.
16345func (client BaseClient) ReportApplicationHealth(ctx context.Context, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
16346	if tracing.IsEnabled() {
16347		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportApplicationHealth")
16348		defer func() {
16349			sc := -1
16350			if result.Response != nil {
16351				sc = result.Response.StatusCode
16352			}
16353			tracing.EndSpan(ctx, sc, err)
16354		}()
16355	}
16356	if err := validation.Validate([]validation.Validation{
16357		{TargetValue: healthInformation,
16358			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
16359				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
16360		{TargetValue: timeout,
16361			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16362				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16363					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16364				}}}}}); err != nil {
16365		return result, validation.NewError("servicefabric.BaseClient", "ReportApplicationHealth", err.Error())
16366	}
16367
16368	req, err := client.ReportApplicationHealthPreparer(ctx, applicationID, healthInformation, immediate, timeout)
16369	if err != nil {
16370		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", nil, "Failure preparing request")
16371		return
16372	}
16373
16374	resp, err := client.ReportApplicationHealthSender(req)
16375	if err != nil {
16376		result.Response = resp
16377		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", resp, "Failure sending request")
16378		return
16379	}
16380
16381	result, err = client.ReportApplicationHealthResponder(resp)
16382	if err != nil {
16383		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", resp, "Failure responding to request")
16384		return
16385	}
16386
16387	return
16388}
16389
16390// ReportApplicationHealthPreparer prepares the ReportApplicationHealth request.
16391func (client BaseClient) ReportApplicationHealthPreparer(ctx context.Context, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
16392	pathParameters := map[string]interface{}{
16393		"applicationId": applicationID,
16394	}
16395
16396	const APIVersion = "6.0"
16397	queryParameters := map[string]interface{}{
16398		"api-version": APIVersion,
16399	}
16400	if immediate != nil {
16401		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
16402	} else {
16403		queryParameters["Immediate"] = autorest.Encode("query", false)
16404	}
16405	if timeout != nil {
16406		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16407	} else {
16408		queryParameters["timeout"] = autorest.Encode("query", 60)
16409	}
16410
16411	preparer := autorest.CreatePreparer(
16412		autorest.AsContentType("application/json; charset=utf-8"),
16413		autorest.AsPost(),
16414		autorest.WithBaseURL(client.BaseURI),
16415		autorest.WithPathParameters("/Applications/{applicationId}/$/ReportHealth", pathParameters),
16416		autorest.WithJSON(healthInformation),
16417		autorest.WithQueryParameters(queryParameters))
16418	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16419}
16420
16421// ReportApplicationHealthSender sends the ReportApplicationHealth request. The method will close the
16422// http.Response Body if it receives an error.
16423func (client BaseClient) ReportApplicationHealthSender(req *http.Request) (*http.Response, error) {
16424	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16425}
16426
16427// ReportApplicationHealthResponder handles the response to the ReportApplicationHealth request. The method always
16428// closes the http.Response Body.
16429func (client BaseClient) ReportApplicationHealthResponder(resp *http.Response) (result autorest.Response, err error) {
16430	err = autorest.Respond(
16431		resp,
16432		azure.WithErrorUnlessStatusCode(http.StatusOK),
16433		autorest.ByClosing())
16434	result.Response = resp
16435	return
16436}
16437
16438// ReportClusterHealth sends a health report on a Service Fabric cluster. The report must contain the information about
16439// the source of the health report and property on which it is reported.
16440// The report is sent to a Service Fabric gateway node, which forwards to the health store.
16441// The report may be accepted by the gateway, but rejected by the health store after extra validation.
16442// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
16443// To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in
16444// the HealthEvents section.
16445// Parameters:
16446// healthInformation - describes the health information for the health report. This information needs to be
16447// present in all of the health reports sent to the health manager.
16448// immediate - a flag that indicates whether the report should be sent immediately.
16449// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
16450// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
16451// regardless of the fabric client settings that the HTTP Gateway Application is using.
16452// This is useful for critical reports that should be sent as soon as possible.
16453// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
16454// is closed or the message doesn't reach the Gateway.
16455// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
16456// Therefore, it will be batched according to the HealthReportSendInterval configuration.
16457// This is the recommended setting because it allows the health client to optimize health reporting messages to
16458// health store as well as health report processing.
16459// By default, reports are not sent immediately.
16460// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16461// duration that the client is willing to wait for the requested operation to complete. The default value for
16462// this parameter is 60 seconds.
16463func (client BaseClient) ReportClusterHealth(ctx context.Context, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
16464	if tracing.IsEnabled() {
16465		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportClusterHealth")
16466		defer func() {
16467			sc := -1
16468			if result.Response != nil {
16469				sc = result.Response.StatusCode
16470			}
16471			tracing.EndSpan(ctx, sc, err)
16472		}()
16473	}
16474	if err := validation.Validate([]validation.Validation{
16475		{TargetValue: healthInformation,
16476			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
16477				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
16478		{TargetValue: timeout,
16479			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16480				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16481					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16482				}}}}}); err != nil {
16483		return result, validation.NewError("servicefabric.BaseClient", "ReportClusterHealth", err.Error())
16484	}
16485
16486	req, err := client.ReportClusterHealthPreparer(ctx, healthInformation, immediate, timeout)
16487	if err != nil {
16488		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", nil, "Failure preparing request")
16489		return
16490	}
16491
16492	resp, err := client.ReportClusterHealthSender(req)
16493	if err != nil {
16494		result.Response = resp
16495		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", resp, "Failure sending request")
16496		return
16497	}
16498
16499	result, err = client.ReportClusterHealthResponder(resp)
16500	if err != nil {
16501		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", resp, "Failure responding to request")
16502		return
16503	}
16504
16505	return
16506}
16507
16508// ReportClusterHealthPreparer prepares the ReportClusterHealth request.
16509func (client BaseClient) ReportClusterHealthPreparer(ctx context.Context, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
16510	const APIVersion = "6.0"
16511	queryParameters := map[string]interface{}{
16512		"api-version": APIVersion,
16513	}
16514	if immediate != nil {
16515		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
16516	} else {
16517		queryParameters["Immediate"] = autorest.Encode("query", false)
16518	}
16519	if timeout != nil {
16520		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16521	} else {
16522		queryParameters["timeout"] = autorest.Encode("query", 60)
16523	}
16524
16525	preparer := autorest.CreatePreparer(
16526		autorest.AsContentType("application/json; charset=utf-8"),
16527		autorest.AsPost(),
16528		autorest.WithBaseURL(client.BaseURI),
16529		autorest.WithPath("/$/ReportClusterHealth"),
16530		autorest.WithJSON(healthInformation),
16531		autorest.WithQueryParameters(queryParameters))
16532	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16533}
16534
16535// ReportClusterHealthSender sends the ReportClusterHealth request. The method will close the
16536// http.Response Body if it receives an error.
16537func (client BaseClient) ReportClusterHealthSender(req *http.Request) (*http.Response, error) {
16538	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16539}
16540
16541// ReportClusterHealthResponder handles the response to the ReportClusterHealth request. The method always
16542// closes the http.Response Body.
16543func (client BaseClient) ReportClusterHealthResponder(resp *http.Response) (result autorest.Response, err error) {
16544	err = autorest.Respond(
16545		resp,
16546		azure.WithErrorUnlessStatusCode(http.StatusOK),
16547		autorest.ByClosing())
16548	result.Response = resp
16549	return
16550}
16551
16552// ReportDeployedApplicationHealth reports health state of the application deployed on a Service Fabric node. The
16553// report must contain the information about the source of the health report and property on which it is reported.
16554// The report is sent to a Service Fabric gateway Service, which forwards to the health store.
16555// The report may be accepted by the gateway, but rejected by the health store after extra validation.
16556// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
16557// To see whether the report was applied in the health store, get deployed application health and check that the report
16558// appears in the HealthEvents section.
16559// Parameters:
16560// nodeName - the name of the node.
16561// applicationID - the identity of the application. This is typically the full name of the application without
16562// the 'fabric:' URI scheme.
16563// Starting from version 6.0, hierarchical names are delimited with the "~" character.
16564// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
16565// in 6.0+ and "myapp/app1" in previous versions.
16566// healthInformation - describes the health information for the health report. This information needs to be
16567// present in all of the health reports sent to the health manager.
16568// immediate - a flag that indicates whether the report should be sent immediately.
16569// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
16570// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
16571// regardless of the fabric client settings that the HTTP Gateway Application is using.
16572// This is useful for critical reports that should be sent as soon as possible.
16573// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
16574// is closed or the message doesn't reach the Gateway.
16575// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
16576// Therefore, it will be batched according to the HealthReportSendInterval configuration.
16577// This is the recommended setting because it allows the health client to optimize health reporting messages to
16578// health store as well as health report processing.
16579// By default, reports are not sent immediately.
16580// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16581// duration that the client is willing to wait for the requested operation to complete. The default value for
16582// this parameter is 60 seconds.
16583func (client BaseClient) ReportDeployedApplicationHealth(ctx context.Context, nodeName string, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
16584	if tracing.IsEnabled() {
16585		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportDeployedApplicationHealth")
16586		defer func() {
16587			sc := -1
16588			if result.Response != nil {
16589				sc = result.Response.StatusCode
16590			}
16591			tracing.EndSpan(ctx, sc, err)
16592		}()
16593	}
16594	if err := validation.Validate([]validation.Validation{
16595		{TargetValue: healthInformation,
16596			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
16597				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
16598		{TargetValue: timeout,
16599			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16600				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16601					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16602				}}}}}); err != nil {
16603		return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedApplicationHealth", err.Error())
16604	}
16605
16606	req, err := client.ReportDeployedApplicationHealthPreparer(ctx, nodeName, applicationID, healthInformation, immediate, timeout)
16607	if err != nil {
16608		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", nil, "Failure preparing request")
16609		return
16610	}
16611
16612	resp, err := client.ReportDeployedApplicationHealthSender(req)
16613	if err != nil {
16614		result.Response = resp
16615		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", resp, "Failure sending request")
16616		return
16617	}
16618
16619	result, err = client.ReportDeployedApplicationHealthResponder(resp)
16620	if err != nil {
16621		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", resp, "Failure responding to request")
16622		return
16623	}
16624
16625	return
16626}
16627
16628// ReportDeployedApplicationHealthPreparer prepares the ReportDeployedApplicationHealth request.
16629func (client BaseClient) ReportDeployedApplicationHealthPreparer(ctx context.Context, nodeName string, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
16630	pathParameters := map[string]interface{}{
16631		"applicationId": applicationID,
16632		"nodeName":      autorest.Encode("path", nodeName),
16633	}
16634
16635	const APIVersion = "6.0"
16636	queryParameters := map[string]interface{}{
16637		"api-version": APIVersion,
16638	}
16639	if immediate != nil {
16640		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
16641	} else {
16642		queryParameters["Immediate"] = autorest.Encode("query", false)
16643	}
16644	if timeout != nil {
16645		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16646	} else {
16647		queryParameters["timeout"] = autorest.Encode("query", 60)
16648	}
16649
16650	preparer := autorest.CreatePreparer(
16651		autorest.AsContentType("application/json; charset=utf-8"),
16652		autorest.AsPost(),
16653		autorest.WithBaseURL(client.BaseURI),
16654		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/ReportHealth", pathParameters),
16655		autorest.WithJSON(healthInformation),
16656		autorest.WithQueryParameters(queryParameters))
16657	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16658}
16659
16660// ReportDeployedApplicationHealthSender sends the ReportDeployedApplicationHealth request. The method will close the
16661// http.Response Body if it receives an error.
16662func (client BaseClient) ReportDeployedApplicationHealthSender(req *http.Request) (*http.Response, error) {
16663	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16664}
16665
16666// ReportDeployedApplicationHealthResponder handles the response to the ReportDeployedApplicationHealth request. The method always
16667// closes the http.Response Body.
16668func (client BaseClient) ReportDeployedApplicationHealthResponder(resp *http.Response) (result autorest.Response, err error) {
16669	err = autorest.Respond(
16670		resp,
16671		azure.WithErrorUnlessStatusCode(http.StatusOK),
16672		autorest.ByClosing())
16673	result.Response = resp
16674	return
16675}
16676
16677// ReportDeployedServicePackageHealth reports health state of the service package of the application deployed on a
16678// Service Fabric node. The report must contain the information about the source of the health report and property on
16679// which it is reported.
16680// The report is sent to a Service Fabric gateway Service, which forwards to the health store.
16681// The report may be accepted by the gateway, but rejected by the health store after extra validation.
16682// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
16683// To see whether the report was applied in the health store, get deployed service package health and check that the
16684// report appears in the HealthEvents section.
16685// Parameters:
16686// nodeName - the name of the node.
16687// applicationID - the identity of the application. This is typically the full name of the application without
16688// the 'fabric:' URI scheme.
16689// Starting from version 6.0, hierarchical names are delimited with the "~" character.
16690// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
16691// in 6.0+ and "myapp/app1" in previous versions.
16692// servicePackageName - the name of the service package.
16693// healthInformation - describes the health information for the health report. This information needs to be
16694// present in all of the health reports sent to the health manager.
16695// immediate - a flag that indicates whether the report should be sent immediately.
16696// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
16697// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
16698// regardless of the fabric client settings that the HTTP Gateway Application is using.
16699// This is useful for critical reports that should be sent as soon as possible.
16700// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
16701// is closed or the message doesn't reach the Gateway.
16702// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
16703// Therefore, it will be batched according to the HealthReportSendInterval configuration.
16704// This is the recommended setting because it allows the health client to optimize health reporting messages to
16705// health store as well as health report processing.
16706// By default, reports are not sent immediately.
16707// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16708// duration that the client is willing to wait for the requested operation to complete. The default value for
16709// this parameter is 60 seconds.
16710func (client BaseClient) ReportDeployedServicePackageHealth(ctx context.Context, nodeName string, applicationID string, servicePackageName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
16711	if tracing.IsEnabled() {
16712		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportDeployedServicePackageHealth")
16713		defer func() {
16714			sc := -1
16715			if result.Response != nil {
16716				sc = result.Response.StatusCode
16717			}
16718			tracing.EndSpan(ctx, sc, err)
16719		}()
16720	}
16721	if err := validation.Validate([]validation.Validation{
16722		{TargetValue: healthInformation,
16723			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
16724				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
16725		{TargetValue: timeout,
16726			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16727				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16728					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16729				}}}}}); err != nil {
16730		return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedServicePackageHealth", err.Error())
16731	}
16732
16733	req, err := client.ReportDeployedServicePackageHealthPreparer(ctx, nodeName, applicationID, servicePackageName, healthInformation, immediate, timeout)
16734	if err != nil {
16735		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", nil, "Failure preparing request")
16736		return
16737	}
16738
16739	resp, err := client.ReportDeployedServicePackageHealthSender(req)
16740	if err != nil {
16741		result.Response = resp
16742		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", resp, "Failure sending request")
16743		return
16744	}
16745
16746	result, err = client.ReportDeployedServicePackageHealthResponder(resp)
16747	if err != nil {
16748		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", resp, "Failure responding to request")
16749		return
16750	}
16751
16752	return
16753}
16754
16755// ReportDeployedServicePackageHealthPreparer prepares the ReportDeployedServicePackageHealth request.
16756func (client BaseClient) ReportDeployedServicePackageHealthPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
16757	pathParameters := map[string]interface{}{
16758		"applicationId":      applicationID,
16759		"nodeName":           autorest.Encode("path", nodeName),
16760		"servicePackageName": servicePackageName,
16761	}
16762
16763	const APIVersion = "6.0"
16764	queryParameters := map[string]interface{}{
16765		"api-version": APIVersion,
16766	}
16767	if immediate != nil {
16768		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
16769	} else {
16770		queryParameters["Immediate"] = autorest.Encode("query", false)
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}/$/GetServicePackages/{servicePackageName}/$/ReportHealth", pathParameters),
16783		autorest.WithJSON(healthInformation),
16784		autorest.WithQueryParameters(queryParameters))
16785	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16786}
16787
16788// ReportDeployedServicePackageHealthSender sends the ReportDeployedServicePackageHealth request. The method will close the
16789// http.Response Body if it receives an error.
16790func (client BaseClient) ReportDeployedServicePackageHealthSender(req *http.Request) (*http.Response, error) {
16791	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16792}
16793
16794// ReportDeployedServicePackageHealthResponder handles the response to the ReportDeployedServicePackageHealth request. The method always
16795// closes the http.Response Body.
16796func (client BaseClient) ReportDeployedServicePackageHealthResponder(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// ReportNodeHealth reports health state of the specified Service Fabric node. The report must contain the information
16806// about the source of the health report and property on which it is reported.
16807// The report is sent to a Service Fabric gateway node, which forwards to the health store.
16808// The report may be accepted by the gateway, but rejected by the health store after extra validation.
16809// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
16810// To see whether the report was applied in the health store, run GetNodeHealth and check that the report appears in
16811// the HealthEvents section.
16812// Parameters:
16813// nodeName - the name of the node.
16814// healthInformation - describes the health information for the health report. This information needs to be
16815// present in all of the health reports sent to the health manager.
16816// immediate - a flag that indicates whether the report should be sent immediately.
16817// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
16818// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
16819// regardless of the fabric client settings that the HTTP Gateway Application is using.
16820// This is useful for critical reports that should be sent as soon as possible.
16821// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
16822// is closed or the message doesn't reach the Gateway.
16823// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
16824// Therefore, it will be batched according to the HealthReportSendInterval configuration.
16825// This is the recommended setting because it allows the health client to optimize health reporting messages to
16826// health store as well as health report processing.
16827// By default, reports are not sent immediately.
16828// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16829// duration that the client is willing to wait for the requested operation to complete. The default value for
16830// this parameter is 60 seconds.
16831func (client BaseClient) ReportNodeHealth(ctx context.Context, nodeName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
16832	if tracing.IsEnabled() {
16833		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportNodeHealth")
16834		defer func() {
16835			sc := -1
16836			if result.Response != nil {
16837				sc = result.Response.StatusCode
16838			}
16839			tracing.EndSpan(ctx, sc, err)
16840		}()
16841	}
16842	if err := validation.Validate([]validation.Validation{
16843		{TargetValue: healthInformation,
16844			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
16845				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
16846		{TargetValue: timeout,
16847			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16848				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16849					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16850				}}}}}); err != nil {
16851		return result, validation.NewError("servicefabric.BaseClient", "ReportNodeHealth", err.Error())
16852	}
16853
16854	req, err := client.ReportNodeHealthPreparer(ctx, nodeName, healthInformation, immediate, timeout)
16855	if err != nil {
16856		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", nil, "Failure preparing request")
16857		return
16858	}
16859
16860	resp, err := client.ReportNodeHealthSender(req)
16861	if err != nil {
16862		result.Response = resp
16863		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", resp, "Failure sending request")
16864		return
16865	}
16866
16867	result, err = client.ReportNodeHealthResponder(resp)
16868	if err != nil {
16869		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", resp, "Failure responding to request")
16870		return
16871	}
16872
16873	return
16874}
16875
16876// ReportNodeHealthPreparer prepares the ReportNodeHealth request.
16877func (client BaseClient) ReportNodeHealthPreparer(ctx context.Context, nodeName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
16878	pathParameters := map[string]interface{}{
16879		"nodeName": autorest.Encode("path", nodeName),
16880	}
16881
16882	const APIVersion = "6.0"
16883	queryParameters := map[string]interface{}{
16884		"api-version": APIVersion,
16885	}
16886	if immediate != nil {
16887		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
16888	} else {
16889		queryParameters["Immediate"] = autorest.Encode("query", false)
16890	}
16891	if timeout != nil {
16892		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16893	} else {
16894		queryParameters["timeout"] = autorest.Encode("query", 60)
16895	}
16896
16897	preparer := autorest.CreatePreparer(
16898		autorest.AsContentType("application/json; charset=utf-8"),
16899		autorest.AsPost(),
16900		autorest.WithBaseURL(client.BaseURI),
16901		autorest.WithPathParameters("/Nodes/{nodeName}/$/ReportHealth", pathParameters),
16902		autorest.WithJSON(healthInformation),
16903		autorest.WithQueryParameters(queryParameters))
16904	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16905}
16906
16907// ReportNodeHealthSender sends the ReportNodeHealth request. The method will close the
16908// http.Response Body if it receives an error.
16909func (client BaseClient) ReportNodeHealthSender(req *http.Request) (*http.Response, error) {
16910	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16911}
16912
16913// ReportNodeHealthResponder handles the response to the ReportNodeHealth request. The method always
16914// closes the http.Response Body.
16915func (client BaseClient) ReportNodeHealthResponder(resp *http.Response) (result autorest.Response, err error) {
16916	err = autorest.Respond(
16917		resp,
16918		azure.WithErrorUnlessStatusCode(http.StatusOK),
16919		autorest.ByClosing())
16920	result.Response = resp
16921	return
16922}
16923
16924// ReportPartitionHealth reports health state of the specified Service Fabric partition. The report must contain the
16925// information about the source of the health report and property on which it is reported.
16926// The report is sent to a Service Fabric gateway Partition, which forwards to the health store.
16927// The report may be accepted by the gateway, but rejected by the health store after extra validation.
16928// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
16929// To see whether the report was applied in the health store, run GetPartitionHealth and check that the report appears
16930// in the HealthEvents section.
16931// Parameters:
16932// partitionID - the identity of the partition.
16933// healthInformation - describes the health information for the health report. This information needs to be
16934// present in all of the health reports sent to the health manager.
16935// immediate - a flag that indicates whether the report should be sent immediately.
16936// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
16937// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
16938// regardless of the fabric client settings that the HTTP Gateway Application is using.
16939// This is useful for critical reports that should be sent as soon as possible.
16940// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
16941// is closed or the message doesn't reach the Gateway.
16942// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
16943// Therefore, it will be batched according to the HealthReportSendInterval configuration.
16944// This is the recommended setting because it allows the health client to optimize health reporting messages to
16945// health store as well as health report processing.
16946// By default, reports are not sent immediately.
16947// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16948// duration that the client is willing to wait for the requested operation to complete. The default value for
16949// this parameter is 60 seconds.
16950func (client BaseClient) ReportPartitionHealth(ctx context.Context, partitionID uuid.UUID, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
16951	if tracing.IsEnabled() {
16952		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportPartitionHealth")
16953		defer func() {
16954			sc := -1
16955			if result.Response != nil {
16956				sc = result.Response.StatusCode
16957			}
16958			tracing.EndSpan(ctx, sc, err)
16959		}()
16960	}
16961	if err := validation.Validate([]validation.Validation{
16962		{TargetValue: healthInformation,
16963			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
16964				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
16965		{TargetValue: timeout,
16966			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16967				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16968					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16969				}}}}}); err != nil {
16970		return result, validation.NewError("servicefabric.BaseClient", "ReportPartitionHealth", err.Error())
16971	}
16972
16973	req, err := client.ReportPartitionHealthPreparer(ctx, partitionID, healthInformation, immediate, timeout)
16974	if err != nil {
16975		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", nil, "Failure preparing request")
16976		return
16977	}
16978
16979	resp, err := client.ReportPartitionHealthSender(req)
16980	if err != nil {
16981		result.Response = resp
16982		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", resp, "Failure sending request")
16983		return
16984	}
16985
16986	result, err = client.ReportPartitionHealthResponder(resp)
16987	if err != nil {
16988		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", resp, "Failure responding to request")
16989		return
16990	}
16991
16992	return
16993}
16994
16995// ReportPartitionHealthPreparer prepares the ReportPartitionHealth request.
16996func (client BaseClient) ReportPartitionHealthPreparer(ctx context.Context, partitionID uuid.UUID, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
16997	pathParameters := map[string]interface{}{
16998		"partitionId": partitionID,
16999	}
17000
17001	const APIVersion = "6.0"
17002	queryParameters := map[string]interface{}{
17003		"api-version": APIVersion,
17004	}
17005	if immediate != nil {
17006		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
17007	} else {
17008		queryParameters["Immediate"] = autorest.Encode("query", false)
17009	}
17010	if timeout != nil {
17011		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17012	} else {
17013		queryParameters["timeout"] = autorest.Encode("query", 60)
17014	}
17015
17016	preparer := autorest.CreatePreparer(
17017		autorest.AsContentType("application/json; charset=utf-8"),
17018		autorest.AsPost(),
17019		autorest.WithBaseURL(client.BaseURI),
17020		autorest.WithPathParameters("/Partitions/{partitionId}/$/ReportHealth", pathParameters),
17021		autorest.WithJSON(healthInformation),
17022		autorest.WithQueryParameters(queryParameters))
17023	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17024}
17025
17026// ReportPartitionHealthSender sends the ReportPartitionHealth request. The method will close the
17027// http.Response Body if it receives an error.
17028func (client BaseClient) ReportPartitionHealthSender(req *http.Request) (*http.Response, error) {
17029	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17030}
17031
17032// ReportPartitionHealthResponder handles the response to the ReportPartitionHealth request. The method always
17033// closes the http.Response Body.
17034func (client BaseClient) ReportPartitionHealthResponder(resp *http.Response) (result autorest.Response, err error) {
17035	err = autorest.Respond(
17036		resp,
17037		azure.WithErrorUnlessStatusCode(http.StatusOK),
17038		autorest.ByClosing())
17039	result.Response = resp
17040	return
17041}
17042
17043// ReportReplicaHealth reports health state of the specified Service Fabric replica. The report must contain the
17044// information about the source of the health report and property on which it is reported.
17045// The report is sent to a Service Fabric gateway Replica, which forwards to the health store.
17046// The report may be accepted by the gateway, but rejected by the health store after extra validation.
17047// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
17048// To see whether the report was applied in the health store, run GetReplicaHealth and check that the report appears in
17049// the HealthEvents section.
17050// Parameters:
17051// partitionID - the identity of the partition.
17052// replicaID - the identifier of the replica.
17053// replicaHealthReportServiceKind - the kind of service replica (Stateless or Stateful) for which the health is
17054// being reported. Following are the possible values.
17055// healthInformation - describes the health information for the health report. This information needs to be
17056// present in all of the health reports sent to the health manager.
17057// immediate - a flag that indicates whether the report should be sent immediately.
17058// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
17059// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
17060// regardless of the fabric client settings that the HTTP Gateway Application is using.
17061// This is useful for critical reports that should be sent as soon as possible.
17062// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
17063// is closed or the message doesn't reach the Gateway.
17064// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
17065// Therefore, it will be batched according to the HealthReportSendInterval configuration.
17066// This is the recommended setting because it allows the health client to optimize health reporting messages to
17067// health store as well as health report processing.
17068// By default, reports are not sent immediately.
17069// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17070// duration that the client is willing to wait for the requested operation to complete. The default value for
17071// this parameter is 60 seconds.
17072func (client BaseClient) ReportReplicaHealth(ctx context.Context, partitionID uuid.UUID, replicaID string, replicaHealthReportServiceKind ReplicaHealthReportServiceKind, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
17073	if tracing.IsEnabled() {
17074		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportReplicaHealth")
17075		defer func() {
17076			sc := -1
17077			if result.Response != nil {
17078				sc = result.Response.StatusCode
17079			}
17080			tracing.EndSpan(ctx, sc, err)
17081		}()
17082	}
17083	if err := validation.Validate([]validation.Validation{
17084		{TargetValue: healthInformation,
17085			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
17086				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
17087		{TargetValue: timeout,
17088			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17089				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17090					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17091				}}}}}); err != nil {
17092		return result, validation.NewError("servicefabric.BaseClient", "ReportReplicaHealth", err.Error())
17093	}
17094
17095	req, err := client.ReportReplicaHealthPreparer(ctx, partitionID, replicaID, replicaHealthReportServiceKind, healthInformation, immediate, timeout)
17096	if err != nil {
17097		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", nil, "Failure preparing request")
17098		return
17099	}
17100
17101	resp, err := client.ReportReplicaHealthSender(req)
17102	if err != nil {
17103		result.Response = resp
17104		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", resp, "Failure sending request")
17105		return
17106	}
17107
17108	result, err = client.ReportReplicaHealthResponder(resp)
17109	if err != nil {
17110		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", resp, "Failure responding to request")
17111		return
17112	}
17113
17114	return
17115}
17116
17117// ReportReplicaHealthPreparer prepares the ReportReplicaHealth request.
17118func (client BaseClient) ReportReplicaHealthPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, replicaHealthReportServiceKind ReplicaHealthReportServiceKind, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
17119	pathParameters := map[string]interface{}{
17120		"partitionId": partitionID,
17121		"replicaId":   replicaID,
17122	}
17123
17124	const APIVersion = "6.0"
17125	queryParameters := map[string]interface{}{
17126		"api-version":                    APIVersion,
17127		"ReplicaHealthReportServiceKind": autorest.Encode("query", replicaHealthReportServiceKind),
17128	}
17129	if immediate != nil {
17130		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
17131	} else {
17132		queryParameters["Immediate"] = autorest.Encode("query", false)
17133	}
17134	if timeout != nil {
17135		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17136	} else {
17137		queryParameters["timeout"] = autorest.Encode("query", 60)
17138	}
17139
17140	preparer := autorest.CreatePreparer(
17141		autorest.AsContentType("application/json; charset=utf-8"),
17142		autorest.AsPost(),
17143		autorest.WithBaseURL(client.BaseURI),
17144		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/ReportHealth", pathParameters),
17145		autorest.WithJSON(healthInformation),
17146		autorest.WithQueryParameters(queryParameters))
17147	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17148}
17149
17150// ReportReplicaHealthSender sends the ReportReplicaHealth request. The method will close the
17151// http.Response Body if it receives an error.
17152func (client BaseClient) ReportReplicaHealthSender(req *http.Request) (*http.Response, error) {
17153	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17154}
17155
17156// ReportReplicaHealthResponder handles the response to the ReportReplicaHealth request. The method always
17157// closes the http.Response Body.
17158func (client BaseClient) ReportReplicaHealthResponder(resp *http.Response) (result autorest.Response, err error) {
17159	err = autorest.Respond(
17160		resp,
17161		azure.WithErrorUnlessStatusCode(http.StatusOK),
17162		autorest.ByClosing())
17163	result.Response = resp
17164	return
17165}
17166
17167// ReportServiceHealth reports health state of the specified Service Fabric service. The report must contain the
17168// information about the source of the health report and property on which it is reported.
17169// The report is sent to a Service Fabric gateway Service, which forwards to the health store.
17170// The report may be accepted by the gateway, but rejected by the health store after extra validation.
17171// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
17172// To see whether the report was applied in the health store, run GetServiceHealth and check that the report appears in
17173// the HealthEvents section.
17174// Parameters:
17175// serviceID - the identity of the service. This ID is typically the full name of the service without the
17176// 'fabric:' URI scheme.
17177// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17178// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
17179// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
17180// healthInformation - describes the health information for the health report. This information needs to be
17181// present in all of the health reports sent to the health manager.
17182// immediate - a flag that indicates whether the report should be sent immediately.
17183// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
17184// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
17185// regardless of the fabric client settings that the HTTP Gateway Application is using.
17186// This is useful for critical reports that should be sent as soon as possible.
17187// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
17188// is closed or the message doesn't reach the Gateway.
17189// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
17190// Therefore, it will be batched according to the HealthReportSendInterval configuration.
17191// This is the recommended setting because it allows the health client to optimize health reporting messages to
17192// health store as well as health report processing.
17193// By default, reports are not sent immediately.
17194// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17195// duration that the client is willing to wait for the requested operation to complete. The default value for
17196// this parameter is 60 seconds.
17197func (client BaseClient) ReportServiceHealth(ctx context.Context, serviceID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
17198	if tracing.IsEnabled() {
17199		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportServiceHealth")
17200		defer func() {
17201			sc := -1
17202			if result.Response != nil {
17203				sc = result.Response.StatusCode
17204			}
17205			tracing.EndSpan(ctx, sc, err)
17206		}()
17207	}
17208	if err := validation.Validate([]validation.Validation{
17209		{TargetValue: healthInformation,
17210			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
17211				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
17212		{TargetValue: timeout,
17213			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17214				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17215					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17216				}}}}}); err != nil {
17217		return result, validation.NewError("servicefabric.BaseClient", "ReportServiceHealth", err.Error())
17218	}
17219
17220	req, err := client.ReportServiceHealthPreparer(ctx, serviceID, healthInformation, immediate, timeout)
17221	if err != nil {
17222		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", nil, "Failure preparing request")
17223		return
17224	}
17225
17226	resp, err := client.ReportServiceHealthSender(req)
17227	if err != nil {
17228		result.Response = resp
17229		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", resp, "Failure sending request")
17230		return
17231	}
17232
17233	result, err = client.ReportServiceHealthResponder(resp)
17234	if err != nil {
17235		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", resp, "Failure responding to request")
17236		return
17237	}
17238
17239	return
17240}
17241
17242// ReportServiceHealthPreparer prepares the ReportServiceHealth request.
17243func (client BaseClient) ReportServiceHealthPreparer(ctx context.Context, serviceID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
17244	pathParameters := map[string]interface{}{
17245		"serviceId": serviceID,
17246	}
17247
17248	const APIVersion = "6.0"
17249	queryParameters := map[string]interface{}{
17250		"api-version": APIVersion,
17251	}
17252	if immediate != nil {
17253		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
17254	} else {
17255		queryParameters["Immediate"] = autorest.Encode("query", false)
17256	}
17257	if timeout != nil {
17258		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17259	} else {
17260		queryParameters["timeout"] = autorest.Encode("query", 60)
17261	}
17262
17263	preparer := autorest.CreatePreparer(
17264		autorest.AsContentType("application/json; charset=utf-8"),
17265		autorest.AsPost(),
17266		autorest.WithBaseURL(client.BaseURI),
17267		autorest.WithPathParameters("/Services/{serviceId}/$/ReportHealth", pathParameters),
17268		autorest.WithJSON(healthInformation),
17269		autorest.WithQueryParameters(queryParameters))
17270	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17271}
17272
17273// ReportServiceHealthSender sends the ReportServiceHealth request. The method will close the
17274// http.Response Body if it receives an error.
17275func (client BaseClient) ReportServiceHealthSender(req *http.Request) (*http.Response, error) {
17276	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17277}
17278
17279// ReportServiceHealthResponder handles the response to the ReportServiceHealth request. The method always
17280// closes the http.Response Body.
17281func (client BaseClient) ReportServiceHealthResponder(resp *http.Response) (result autorest.Response, err error) {
17282	err = autorest.Respond(
17283		resp,
17284		azure.WithErrorUnlessStatusCode(http.StatusOK),
17285		autorest.ByClosing())
17286	result.Response = resp
17287	return
17288}
17289
17290// ResetPartitionLoad resets the current load of a Service Fabric partition to the default load for the service.
17291// Parameters:
17292// partitionID - the identity of the partition.
17293// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17294// duration that the client is willing to wait for the requested operation to complete. The default value for
17295// this parameter is 60 seconds.
17296func (client BaseClient) ResetPartitionLoad(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
17297	if tracing.IsEnabled() {
17298		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResetPartitionLoad")
17299		defer func() {
17300			sc := -1
17301			if result.Response != nil {
17302				sc = result.Response.StatusCode
17303			}
17304			tracing.EndSpan(ctx, sc, err)
17305		}()
17306	}
17307	if err := validation.Validate([]validation.Validation{
17308		{TargetValue: timeout,
17309			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17310				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17311					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17312				}}}}}); err != nil {
17313		return result, validation.NewError("servicefabric.BaseClient", "ResetPartitionLoad", err.Error())
17314	}
17315
17316	req, err := client.ResetPartitionLoadPreparer(ctx, partitionID, timeout)
17317	if err != nil {
17318		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", nil, "Failure preparing request")
17319		return
17320	}
17321
17322	resp, err := client.ResetPartitionLoadSender(req)
17323	if err != nil {
17324		result.Response = resp
17325		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", resp, "Failure sending request")
17326		return
17327	}
17328
17329	result, err = client.ResetPartitionLoadResponder(resp)
17330	if err != nil {
17331		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", resp, "Failure responding to request")
17332		return
17333	}
17334
17335	return
17336}
17337
17338// ResetPartitionLoadPreparer prepares the ResetPartitionLoad request.
17339func (client BaseClient) ResetPartitionLoadPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
17340	pathParameters := map[string]interface{}{
17341		"partitionId": partitionID,
17342	}
17343
17344	const APIVersion = "6.0"
17345	queryParameters := map[string]interface{}{
17346		"api-version": APIVersion,
17347	}
17348	if timeout != nil {
17349		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17350	} else {
17351		queryParameters["timeout"] = autorest.Encode("query", 60)
17352	}
17353
17354	preparer := autorest.CreatePreparer(
17355		autorest.AsPost(),
17356		autorest.WithBaseURL(client.BaseURI),
17357		autorest.WithPathParameters("/Partitions/{partitionId}/$/ResetLoad", pathParameters),
17358		autorest.WithQueryParameters(queryParameters))
17359	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17360}
17361
17362// ResetPartitionLoadSender sends the ResetPartitionLoad request. The method will close the
17363// http.Response Body if it receives an error.
17364func (client BaseClient) ResetPartitionLoadSender(req *http.Request) (*http.Response, error) {
17365	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17366}
17367
17368// ResetPartitionLoadResponder handles the response to the ResetPartitionLoad request. The method always
17369// closes the http.Response Body.
17370func (client BaseClient) ResetPartitionLoadResponder(resp *http.Response) (result autorest.Response, err error) {
17371	err = autorest.Respond(
17372		resp,
17373		azure.WithErrorUnlessStatusCode(http.StatusOK),
17374		autorest.ByClosing())
17375	result.Response = resp
17376	return
17377}
17378
17379// ResolveService resolve a Service Fabric service partition to get the endpoints of the service replicas.
17380// Parameters:
17381// serviceID - the identity of the service. This ID is typically the full name of the service without the
17382// 'fabric:' URI scheme.
17383// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17384// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
17385// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
17386// partitionKeyType - key type for the partition. This parameter is required if the partition scheme for the
17387// service is Int64Range or Named. The possible values are following.
17388// - None (1) - Indicates that the PartitionKeyValue parameter is not specified. This is valid for the
17389// partitions with partitioning scheme as Singleton. This is the default value. The value is 1.
17390// - Int64Range (2) - Indicates that the PartitionKeyValue parameter is an int64 partition key. This is valid
17391// for the partitions with partitioning scheme as Int64Range. The value is 2.
17392// - Named (3) - Indicates that the PartitionKeyValue parameter is a name of the partition. This is valid for
17393// the partitions with partitioning scheme as Named. The value is 3.
17394// partitionKeyValue - partition key. This is required if the partition scheme for the service is Int64Range or
17395// Named.
17396// previousRspVersion - the value in the Version field of the response that was received previously. This is
17397// required if the user knows that the result that was gotten previously is stale.
17398// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17399// duration that the client is willing to wait for the requested operation to complete. The default value for
17400// this parameter is 60 seconds.
17401func (client BaseClient) ResolveService(ctx context.Context, serviceID string, partitionKeyType *int32, partitionKeyValue string, previousRspVersion string, timeout *int64) (result ResolvedServicePartition, err error) {
17402	if tracing.IsEnabled() {
17403		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResolveService")
17404		defer func() {
17405			sc := -1
17406			if result.Response.Response != nil {
17407				sc = result.Response.Response.StatusCode
17408			}
17409			tracing.EndSpan(ctx, sc, err)
17410		}()
17411	}
17412	if err := validation.Validate([]validation.Validation{
17413		{TargetValue: timeout,
17414			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17415				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17416					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17417				}}}}}); err != nil {
17418		return result, validation.NewError("servicefabric.BaseClient", "ResolveService", err.Error())
17419	}
17420
17421	req, err := client.ResolveServicePreparer(ctx, serviceID, partitionKeyType, partitionKeyValue, previousRspVersion, timeout)
17422	if err != nil {
17423		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", nil, "Failure preparing request")
17424		return
17425	}
17426
17427	resp, err := client.ResolveServiceSender(req)
17428	if err != nil {
17429		result.Response = autorest.Response{Response: resp}
17430		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", resp, "Failure sending request")
17431		return
17432	}
17433
17434	result, err = client.ResolveServiceResponder(resp)
17435	if err != nil {
17436		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", resp, "Failure responding to request")
17437		return
17438	}
17439
17440	return
17441}
17442
17443// ResolveServicePreparer prepares the ResolveService request.
17444func (client BaseClient) ResolveServicePreparer(ctx context.Context, serviceID string, partitionKeyType *int32, partitionKeyValue string, previousRspVersion string, timeout *int64) (*http.Request, error) {
17445	pathParameters := map[string]interface{}{
17446		"serviceId": serviceID,
17447	}
17448
17449	const APIVersion = "6.0"
17450	queryParameters := map[string]interface{}{
17451		"api-version": APIVersion,
17452	}
17453	if partitionKeyType != nil {
17454		queryParameters["PartitionKeyType"] = autorest.Encode("query", *partitionKeyType)
17455	}
17456	if len(partitionKeyValue) > 0 {
17457		queryParameters["PartitionKeyValue"] = partitionKeyValue
17458	}
17459	if len(previousRspVersion) > 0 {
17460		queryParameters["PreviousRspVersion"] = previousRspVersion
17461	}
17462	if timeout != nil {
17463		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17464	} else {
17465		queryParameters["timeout"] = autorest.Encode("query", 60)
17466	}
17467
17468	preparer := autorest.CreatePreparer(
17469		autorest.AsGet(),
17470		autorest.WithBaseURL(client.BaseURI),
17471		autorest.WithPathParameters("/Services/{serviceId}/$/ResolvePartition", pathParameters),
17472		autorest.WithQueryParameters(queryParameters))
17473	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17474}
17475
17476// ResolveServiceSender sends the ResolveService request. The method will close the
17477// http.Response Body if it receives an error.
17478func (client BaseClient) ResolveServiceSender(req *http.Request) (*http.Response, error) {
17479	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17480}
17481
17482// ResolveServiceResponder handles the response to the ResolveService request. The method always
17483// closes the http.Response Body.
17484func (client BaseClient) ResolveServiceResponder(resp *http.Response) (result ResolvedServicePartition, err error) {
17485	err = autorest.Respond(
17486		resp,
17487		azure.WithErrorUnlessStatusCode(http.StatusOK),
17488		autorest.ByUnmarshallingJSON(&result),
17489		autorest.ByClosing())
17490	result.Response = autorest.Response{Response: resp}
17491	return
17492}
17493
17494// RestartDeployedCodePackage restarts a code package deployed on a Service Fabric node in a cluster. This aborts the
17495// code package process, which will restart all the user service replicas hosted in that process.
17496// Parameters:
17497// nodeName - the name of the node.
17498// applicationID - the identity of the application. This is typically the full name of the application without
17499// the 'fabric:' URI scheme.
17500// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17501// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
17502// in 6.0+ and "myapp/app1" in previous versions.
17503// restartDeployedCodePackageDescription - describes the deployed code package on Service Fabric node to
17504// restart.
17505// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17506// duration that the client is willing to wait for the requested operation to complete. The default value for
17507// this parameter is 60 seconds.
17508func (client BaseClient) RestartDeployedCodePackage(ctx context.Context, nodeName string, applicationID string, restartDeployedCodePackageDescription RestartDeployedCodePackageDescription, timeout *int64) (result autorest.Response, err error) {
17509	if tracing.IsEnabled() {
17510		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartDeployedCodePackage")
17511		defer func() {
17512			sc := -1
17513			if result.Response != nil {
17514				sc = result.Response.StatusCode
17515			}
17516			tracing.EndSpan(ctx, sc, err)
17517		}()
17518	}
17519	if err := validation.Validate([]validation.Validation{
17520		{TargetValue: restartDeployedCodePackageDescription,
17521			Constraints: []validation.Constraint{{Target: "restartDeployedCodePackageDescription.ServiceManifestName", Name: validation.Null, Rule: true, Chain: nil},
17522				{Target: "restartDeployedCodePackageDescription.CodePackageName", Name: validation.Null, Rule: true, Chain: nil},
17523				{Target: "restartDeployedCodePackageDescription.CodePackageInstanceID", Name: validation.Null, Rule: true, Chain: nil}}},
17524		{TargetValue: timeout,
17525			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17526				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17527					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17528				}}}}}); err != nil {
17529		return result, validation.NewError("servicefabric.BaseClient", "RestartDeployedCodePackage", err.Error())
17530	}
17531
17532	req, err := client.RestartDeployedCodePackagePreparer(ctx, nodeName, applicationID, restartDeployedCodePackageDescription, timeout)
17533	if err != nil {
17534		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", nil, "Failure preparing request")
17535		return
17536	}
17537
17538	resp, err := client.RestartDeployedCodePackageSender(req)
17539	if err != nil {
17540		result.Response = resp
17541		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", resp, "Failure sending request")
17542		return
17543	}
17544
17545	result, err = client.RestartDeployedCodePackageResponder(resp)
17546	if err != nil {
17547		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", resp, "Failure responding to request")
17548		return
17549	}
17550
17551	return
17552}
17553
17554// RestartDeployedCodePackagePreparer prepares the RestartDeployedCodePackage request.
17555func (client BaseClient) RestartDeployedCodePackagePreparer(ctx context.Context, nodeName string, applicationID string, restartDeployedCodePackageDescription RestartDeployedCodePackageDescription, timeout *int64) (*http.Request, error) {
17556	pathParameters := map[string]interface{}{
17557		"applicationId": applicationID,
17558		"nodeName":      autorest.Encode("path", nodeName),
17559	}
17560
17561	const APIVersion = "6.0"
17562	queryParameters := map[string]interface{}{
17563		"api-version": APIVersion,
17564	}
17565	if timeout != nil {
17566		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17567	} else {
17568		queryParameters["timeout"] = autorest.Encode("query", 60)
17569	}
17570
17571	preparer := autorest.CreatePreparer(
17572		autorest.AsContentType("application/json; charset=utf-8"),
17573		autorest.AsPost(),
17574		autorest.WithBaseURL(client.BaseURI),
17575		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/Restart", pathParameters),
17576		autorest.WithJSON(restartDeployedCodePackageDescription),
17577		autorest.WithQueryParameters(queryParameters))
17578	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17579}
17580
17581// RestartDeployedCodePackageSender sends the RestartDeployedCodePackage request. The method will close the
17582// http.Response Body if it receives an error.
17583func (client BaseClient) RestartDeployedCodePackageSender(req *http.Request) (*http.Response, error) {
17584	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17585}
17586
17587// RestartDeployedCodePackageResponder handles the response to the RestartDeployedCodePackage request. The method always
17588// closes the http.Response Body.
17589func (client BaseClient) RestartDeployedCodePackageResponder(resp *http.Response) (result autorest.Response, err error) {
17590	err = autorest.Respond(
17591		resp,
17592		azure.WithErrorUnlessStatusCode(http.StatusOK),
17593		autorest.ByClosing())
17594	result.Response = resp
17595	return
17596}
17597
17598// RestartNode restarts a Service Fabric cluster node that is already started.
17599// Parameters:
17600// nodeName - the name of the node.
17601// restartNodeDescription - the instance of the node to be restarted and a flag indicating the need to take
17602// dump of the fabric process.
17603// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17604// duration that the client is willing to wait for the requested operation to complete. The default value for
17605// this parameter is 60 seconds.
17606func (client BaseClient) RestartNode(ctx context.Context, nodeName string, restartNodeDescription RestartNodeDescription, timeout *int64) (result autorest.Response, err error) {
17607	if tracing.IsEnabled() {
17608		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartNode")
17609		defer func() {
17610			sc := -1
17611			if result.Response != nil {
17612				sc = result.Response.StatusCode
17613			}
17614			tracing.EndSpan(ctx, sc, err)
17615		}()
17616	}
17617	if err := validation.Validate([]validation.Validation{
17618		{TargetValue: restartNodeDescription,
17619			Constraints: []validation.Constraint{{Target: "restartNodeDescription.NodeInstanceID", Name: validation.Null, Rule: true, Chain: nil}}},
17620		{TargetValue: timeout,
17621			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17622				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17623					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17624				}}}}}); err != nil {
17625		return result, validation.NewError("servicefabric.BaseClient", "RestartNode", err.Error())
17626	}
17627
17628	req, err := client.RestartNodePreparer(ctx, nodeName, restartNodeDescription, timeout)
17629	if err != nil {
17630		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", nil, "Failure preparing request")
17631		return
17632	}
17633
17634	resp, err := client.RestartNodeSender(req)
17635	if err != nil {
17636		result.Response = resp
17637		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", resp, "Failure sending request")
17638		return
17639	}
17640
17641	result, err = client.RestartNodeResponder(resp)
17642	if err != nil {
17643		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", resp, "Failure responding to request")
17644		return
17645	}
17646
17647	return
17648}
17649
17650// RestartNodePreparer prepares the RestartNode request.
17651func (client BaseClient) RestartNodePreparer(ctx context.Context, nodeName string, restartNodeDescription RestartNodeDescription, timeout *int64) (*http.Request, error) {
17652	pathParameters := map[string]interface{}{
17653		"nodeName": autorest.Encode("path", nodeName),
17654	}
17655
17656	const APIVersion = "6.0"
17657	queryParameters := map[string]interface{}{
17658		"api-version": APIVersion,
17659	}
17660	if timeout != nil {
17661		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17662	} else {
17663		queryParameters["timeout"] = autorest.Encode("query", 60)
17664	}
17665
17666	preparer := autorest.CreatePreparer(
17667		autorest.AsContentType("application/json; charset=utf-8"),
17668		autorest.AsPost(),
17669		autorest.WithBaseURL(client.BaseURI),
17670		autorest.WithPathParameters("/Nodes/{nodeName}/$/Restart", pathParameters),
17671		autorest.WithJSON(restartNodeDescription),
17672		autorest.WithQueryParameters(queryParameters))
17673	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17674}
17675
17676// RestartNodeSender sends the RestartNode request. The method will close the
17677// http.Response Body if it receives an error.
17678func (client BaseClient) RestartNodeSender(req *http.Request) (*http.Response, error) {
17679	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17680}
17681
17682// RestartNodeResponder handles the response to the RestartNode request. The method always
17683// closes the http.Response Body.
17684func (client BaseClient) RestartNodeResponder(resp *http.Response) (result autorest.Response, err error) {
17685	err = autorest.Respond(
17686		resp,
17687		azure.WithErrorUnlessStatusCode(http.StatusOK),
17688		autorest.ByClosing())
17689	result.Response = resp
17690	return
17691}
17692
17693// RestartReplica restarts a service replica of a persisted service running on a node. Warning - There are no safety
17694// checks performed when this API is used. Incorrect use of this API can lead to availability loss for stateful
17695// services.
17696// Parameters:
17697// nodeName - the name of the node.
17698// partitionID - the identity of the partition.
17699// replicaID - the identifier of the replica.
17700// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17701// duration that the client is willing to wait for the requested operation to complete. The default value for
17702// this parameter is 60 seconds.
17703func (client BaseClient) RestartReplica(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (result autorest.Response, err error) {
17704	if tracing.IsEnabled() {
17705		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartReplica")
17706		defer func() {
17707			sc := -1
17708			if result.Response != nil {
17709				sc = result.Response.StatusCode
17710			}
17711			tracing.EndSpan(ctx, sc, err)
17712		}()
17713	}
17714	if err := validation.Validate([]validation.Validation{
17715		{TargetValue: timeout,
17716			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17717				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17718					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17719				}}}}}); err != nil {
17720		return result, validation.NewError("servicefabric.BaseClient", "RestartReplica", err.Error())
17721	}
17722
17723	req, err := client.RestartReplicaPreparer(ctx, nodeName, partitionID, replicaID, timeout)
17724	if err != nil {
17725		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", nil, "Failure preparing request")
17726		return
17727	}
17728
17729	resp, err := client.RestartReplicaSender(req)
17730	if err != nil {
17731		result.Response = resp
17732		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", resp, "Failure sending request")
17733		return
17734	}
17735
17736	result, err = client.RestartReplicaResponder(resp)
17737	if err != nil {
17738		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", resp, "Failure responding to request")
17739		return
17740	}
17741
17742	return
17743}
17744
17745// RestartReplicaPreparer prepares the RestartReplica request.
17746func (client BaseClient) RestartReplicaPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) {
17747	pathParameters := map[string]interface{}{
17748		"nodeName":    autorest.Encode("path", nodeName),
17749		"partitionId": partitionID,
17750		"replicaId":   replicaID,
17751	}
17752
17753	const APIVersion = "6.0"
17754	queryParameters := map[string]interface{}{
17755		"api-version": APIVersion,
17756	}
17757	if timeout != nil {
17758		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17759	} else {
17760		queryParameters["timeout"] = autorest.Encode("query", 60)
17761	}
17762
17763	preparer := autorest.CreatePreparer(
17764		autorest.AsPost(),
17765		autorest.WithBaseURL(client.BaseURI),
17766		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Restart", pathParameters),
17767		autorest.WithQueryParameters(queryParameters))
17768	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17769}
17770
17771// RestartReplicaSender sends the RestartReplica request. The method will close the
17772// http.Response Body if it receives an error.
17773func (client BaseClient) RestartReplicaSender(req *http.Request) (*http.Response, error) {
17774	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17775}
17776
17777// RestartReplicaResponder handles the response to the RestartReplica request. The method always
17778// closes the http.Response Body.
17779func (client BaseClient) RestartReplicaResponder(resp *http.Response) (result autorest.Response, err error) {
17780	err = autorest.Respond(
17781		resp,
17782		azure.WithErrorUnlessStatusCode(http.StatusOK),
17783		autorest.ByClosing())
17784	result.Response = resp
17785	return
17786}
17787
17788// RestorePartition restores the state of a of the stateful persisted partition using the specified backup point. In
17789// case the partition is already being periodically backed up, then by default the backup point is looked for in the
17790// storage specified in backup policy. One can also override the same by specifying the backup storage details as part
17791// of the restore partition description in body. Once the restore is initiated, its progress can be tracked using the
17792// GetRestoreProgress operation.
17793// In case, the operation times out, specify a greater restore timeout value in the query parameter.
17794// Parameters:
17795// partitionID - the identity of the partition.
17796// restorePartitionDescription - describes the parameters to restore the partition.
17797// restoreTimeout - specifies the maximum amount of time to wait, in minutes, for the restore operation to
17798// complete. Post that, the operation returns back with timeout error. However, in certain corner cases it
17799// could be that the restore operation goes through even though it completes with timeout. In case of timeout
17800// error, its recommended to invoke this operation again with a greater timeout value. the default value for
17801// the same is 10 minutes.
17802// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17803// duration that the client is willing to wait for the requested operation to complete. The default value for
17804// this parameter is 60 seconds.
17805func (client BaseClient) RestorePartition(ctx context.Context, partitionID uuid.UUID, restorePartitionDescription RestorePartitionDescription, restoreTimeout *int32, timeout *int64) (result autorest.Response, err error) {
17806	if tracing.IsEnabled() {
17807		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestorePartition")
17808		defer func() {
17809			sc := -1
17810			if result.Response != nil {
17811				sc = result.Response.StatusCode
17812			}
17813			tracing.EndSpan(ctx, sc, err)
17814		}()
17815	}
17816	if err := validation.Validate([]validation.Validation{
17817		{TargetValue: restorePartitionDescription,
17818			Constraints: []validation.Constraint{{Target: "restorePartitionDescription.BackupID", Name: validation.Null, Rule: true, Chain: nil},
17819				{Target: "restorePartitionDescription.BackupLocation", Name: validation.Null, Rule: true, Chain: nil}}},
17820		{TargetValue: timeout,
17821			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17822				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17823					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17824				}}}}}); err != nil {
17825		return result, validation.NewError("servicefabric.BaseClient", "RestorePartition", err.Error())
17826	}
17827
17828	req, err := client.RestorePartitionPreparer(ctx, partitionID, restorePartitionDescription, restoreTimeout, timeout)
17829	if err != nil {
17830		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", nil, "Failure preparing request")
17831		return
17832	}
17833
17834	resp, err := client.RestorePartitionSender(req)
17835	if err != nil {
17836		result.Response = resp
17837		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", resp, "Failure sending request")
17838		return
17839	}
17840
17841	result, err = client.RestorePartitionResponder(resp)
17842	if err != nil {
17843		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", resp, "Failure responding to request")
17844		return
17845	}
17846
17847	return
17848}
17849
17850// RestorePartitionPreparer prepares the RestorePartition request.
17851func (client BaseClient) RestorePartitionPreparer(ctx context.Context, partitionID uuid.UUID, restorePartitionDescription RestorePartitionDescription, restoreTimeout *int32, timeout *int64) (*http.Request, error) {
17852	pathParameters := map[string]interface{}{
17853		"partitionId": partitionID,
17854	}
17855
17856	const APIVersion = "6.2-preview"
17857	queryParameters := map[string]interface{}{
17858		"api-version": APIVersion,
17859	}
17860	if restoreTimeout != nil {
17861		queryParameters["RestoreTimeout"] = autorest.Encode("query", *restoreTimeout)
17862	} else {
17863		queryParameters["RestoreTimeout"] = autorest.Encode("query", 10)
17864	}
17865	if timeout != nil {
17866		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17867	} else {
17868		queryParameters["timeout"] = autorest.Encode("query", 60)
17869	}
17870
17871	preparer := autorest.CreatePreparer(
17872		autorest.AsContentType("application/json; charset=utf-8"),
17873		autorest.AsPost(),
17874		autorest.WithBaseURL(client.BaseURI),
17875		autorest.WithPathParameters("/Partitions/{partitionId}/$/Restore", pathParameters),
17876		autorest.WithJSON(restorePartitionDescription),
17877		autorest.WithQueryParameters(queryParameters))
17878	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17879}
17880
17881// RestorePartitionSender sends the RestorePartition request. The method will close the
17882// http.Response Body if it receives an error.
17883func (client BaseClient) RestorePartitionSender(req *http.Request) (*http.Response, error) {
17884	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17885}
17886
17887// RestorePartitionResponder handles the response to the RestorePartition request. The method always
17888// closes the http.Response Body.
17889func (client BaseClient) RestorePartitionResponder(resp *http.Response) (result autorest.Response, err error) {
17890	err = autorest.Respond(
17891		resp,
17892		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
17893		autorest.ByClosing())
17894	result.Response = resp
17895	return
17896}
17897
17898// ResumeApplicationBackup the previously suspended Service Fabric application resumes taking periodic backup as per
17899// the backup policy currently configured for the same.
17900// Parameters:
17901// applicationID - the identity of the application. This is typically the full name of the application without
17902// the 'fabric:' URI scheme.
17903// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17904// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
17905// in 6.0+ and "myapp/app1" in previous versions.
17906// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17907// duration that the client is willing to wait for the requested operation to complete. The default value for
17908// this parameter is 60 seconds.
17909func (client BaseClient) ResumeApplicationBackup(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) {
17910	if tracing.IsEnabled() {
17911		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeApplicationBackup")
17912		defer func() {
17913			sc := -1
17914			if result.Response != nil {
17915				sc = result.Response.StatusCode
17916			}
17917			tracing.EndSpan(ctx, sc, err)
17918		}()
17919	}
17920	if err := validation.Validate([]validation.Validation{
17921		{TargetValue: timeout,
17922			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17923				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17924					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17925				}}}}}); err != nil {
17926		return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationBackup", err.Error())
17927	}
17928
17929	req, err := client.ResumeApplicationBackupPreparer(ctx, applicationID, timeout)
17930	if err != nil {
17931		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", nil, "Failure preparing request")
17932		return
17933	}
17934
17935	resp, err := client.ResumeApplicationBackupSender(req)
17936	if err != nil {
17937		result.Response = resp
17938		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", resp, "Failure sending request")
17939		return
17940	}
17941
17942	result, err = client.ResumeApplicationBackupResponder(resp)
17943	if err != nil {
17944		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", resp, "Failure responding to request")
17945		return
17946	}
17947
17948	return
17949}
17950
17951// ResumeApplicationBackupPreparer prepares the ResumeApplicationBackup request.
17952func (client BaseClient) ResumeApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
17953	pathParameters := map[string]interface{}{
17954		"applicationId": applicationID,
17955	}
17956
17957	const APIVersion = "6.2-preview"
17958	queryParameters := map[string]interface{}{
17959		"api-version": APIVersion,
17960	}
17961	if timeout != nil {
17962		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17963	} else {
17964		queryParameters["timeout"] = autorest.Encode("query", 60)
17965	}
17966
17967	preparer := autorest.CreatePreparer(
17968		autorest.AsPost(),
17969		autorest.WithBaseURL(client.BaseURI),
17970		autorest.WithPathParameters("/Applications/{applicationId}/$/ResumeBackup", pathParameters),
17971		autorest.WithQueryParameters(queryParameters))
17972	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17973}
17974
17975// ResumeApplicationBackupSender sends the ResumeApplicationBackup request. The method will close the
17976// http.Response Body if it receives an error.
17977func (client BaseClient) ResumeApplicationBackupSender(req *http.Request) (*http.Response, error) {
17978	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17979}
17980
17981// ResumeApplicationBackupResponder handles the response to the ResumeApplicationBackup request. The method always
17982// closes the http.Response Body.
17983func (client BaseClient) ResumeApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) {
17984	err = autorest.Respond(
17985		resp,
17986		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
17987		autorest.ByClosing())
17988	result.Response = resp
17989	return
17990}
17991
17992// ResumeApplicationUpgrade resumes an unmonitored manual Service Fabric application upgrade. Service Fabric upgrades
17993// one upgrade domain at a time. For unmonitored manual upgrades, after Service Fabric finishes an upgrade domain, it
17994// waits for you to call this API before proceeding to the next upgrade domain.
17995// Parameters:
17996// applicationID - the identity of the application. This is typically the full name of the application without
17997// the 'fabric:' URI scheme.
17998// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17999// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
18000// in 6.0+ and "myapp/app1" in previous versions.
18001// resumeApplicationUpgradeDescription - describes the parameters for resuming an application upgrade.
18002// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18003// duration that the client is willing to wait for the requested operation to complete. The default value for
18004// this parameter is 60 seconds.
18005func (client BaseClient) ResumeApplicationUpgrade(ctx context.Context, applicationID string, resumeApplicationUpgradeDescription ResumeApplicationUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
18006	if tracing.IsEnabled() {
18007		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeApplicationUpgrade")
18008		defer func() {
18009			sc := -1
18010			if result.Response != nil {
18011				sc = result.Response.StatusCode
18012			}
18013			tracing.EndSpan(ctx, sc, err)
18014		}()
18015	}
18016	if err := validation.Validate([]validation.Validation{
18017		{TargetValue: resumeApplicationUpgradeDescription,
18018			Constraints: []validation.Constraint{{Target: "resumeApplicationUpgradeDescription.UpgradeDomainName", Name: validation.Null, Rule: true, Chain: nil}}},
18019		{TargetValue: timeout,
18020			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18021				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18022					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18023				}}}}}); err != nil {
18024		return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationUpgrade", err.Error())
18025	}
18026
18027	req, err := client.ResumeApplicationUpgradePreparer(ctx, applicationID, resumeApplicationUpgradeDescription, timeout)
18028	if err != nil {
18029		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", nil, "Failure preparing request")
18030		return
18031	}
18032
18033	resp, err := client.ResumeApplicationUpgradeSender(req)
18034	if err != nil {
18035		result.Response = resp
18036		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", resp, "Failure sending request")
18037		return
18038	}
18039
18040	result, err = client.ResumeApplicationUpgradeResponder(resp)
18041	if err != nil {
18042		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", resp, "Failure responding to request")
18043		return
18044	}
18045
18046	return
18047}
18048
18049// ResumeApplicationUpgradePreparer prepares the ResumeApplicationUpgrade request.
18050func (client BaseClient) ResumeApplicationUpgradePreparer(ctx context.Context, applicationID string, resumeApplicationUpgradeDescription ResumeApplicationUpgradeDescription, timeout *int64) (*http.Request, error) {
18051	pathParameters := map[string]interface{}{
18052		"applicationId": applicationID,
18053	}
18054
18055	const APIVersion = "6.0"
18056	queryParameters := map[string]interface{}{
18057		"api-version": APIVersion,
18058	}
18059	if timeout != nil {
18060		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18061	} else {
18062		queryParameters["timeout"] = autorest.Encode("query", 60)
18063	}
18064
18065	preparer := autorest.CreatePreparer(
18066		autorest.AsContentType("application/json; charset=utf-8"),
18067		autorest.AsPost(),
18068		autorest.WithBaseURL(client.BaseURI),
18069		autorest.WithPathParameters("/Applications/{applicationId}/$/MoveToNextUpgradeDomain", pathParameters),
18070		autorest.WithJSON(resumeApplicationUpgradeDescription),
18071		autorest.WithQueryParameters(queryParameters))
18072	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18073}
18074
18075// ResumeApplicationUpgradeSender sends the ResumeApplicationUpgrade request. The method will close the
18076// http.Response Body if it receives an error.
18077func (client BaseClient) ResumeApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
18078	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18079}
18080
18081// ResumeApplicationUpgradeResponder handles the response to the ResumeApplicationUpgrade request. The method always
18082// closes the http.Response Body.
18083func (client BaseClient) ResumeApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
18084	err = autorest.Respond(
18085		resp,
18086		azure.WithErrorUnlessStatusCode(http.StatusOK),
18087		autorest.ByClosing())
18088	result.Response = resp
18089	return
18090}
18091
18092// ResumeClusterUpgrade make the cluster code or configuration upgrade move on to the next upgrade domain if
18093// appropriate.
18094// Parameters:
18095// resumeClusterUpgradeDescription - describes the parameters for resuming a cluster upgrade.
18096// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18097// duration that the client is willing to wait for the requested operation to complete. The default value for
18098// this parameter is 60 seconds.
18099func (client BaseClient) ResumeClusterUpgrade(ctx context.Context, resumeClusterUpgradeDescription ResumeClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
18100	if tracing.IsEnabled() {
18101		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeClusterUpgrade")
18102		defer func() {
18103			sc := -1
18104			if result.Response != nil {
18105				sc = result.Response.StatusCode
18106			}
18107			tracing.EndSpan(ctx, sc, err)
18108		}()
18109	}
18110	if err := validation.Validate([]validation.Validation{
18111		{TargetValue: resumeClusterUpgradeDescription,
18112			Constraints: []validation.Constraint{{Target: "resumeClusterUpgradeDescription.UpgradeDomain", Name: validation.Null, Rule: true, Chain: nil}}},
18113		{TargetValue: timeout,
18114			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18115				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18116					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18117				}}}}}); err != nil {
18118		return result, validation.NewError("servicefabric.BaseClient", "ResumeClusterUpgrade", err.Error())
18119	}
18120
18121	req, err := client.ResumeClusterUpgradePreparer(ctx, resumeClusterUpgradeDescription, timeout)
18122	if err != nil {
18123		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", nil, "Failure preparing request")
18124		return
18125	}
18126
18127	resp, err := client.ResumeClusterUpgradeSender(req)
18128	if err != nil {
18129		result.Response = resp
18130		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", resp, "Failure sending request")
18131		return
18132	}
18133
18134	result, err = client.ResumeClusterUpgradeResponder(resp)
18135	if err != nil {
18136		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", resp, "Failure responding to request")
18137		return
18138	}
18139
18140	return
18141}
18142
18143// ResumeClusterUpgradePreparer prepares the ResumeClusterUpgrade request.
18144func (client BaseClient) ResumeClusterUpgradePreparer(ctx context.Context, resumeClusterUpgradeDescription ResumeClusterUpgradeDescription, timeout *int64) (*http.Request, error) {
18145	const APIVersion = "6.0"
18146	queryParameters := map[string]interface{}{
18147		"api-version": APIVersion,
18148	}
18149	if timeout != nil {
18150		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18151	} else {
18152		queryParameters["timeout"] = autorest.Encode("query", 60)
18153	}
18154
18155	preparer := autorest.CreatePreparer(
18156		autorest.AsContentType("application/json; charset=utf-8"),
18157		autorest.AsPost(),
18158		autorest.WithBaseURL(client.BaseURI),
18159		autorest.WithPath("/$/MoveToNextUpgradeDomain"),
18160		autorest.WithJSON(resumeClusterUpgradeDescription),
18161		autorest.WithQueryParameters(queryParameters))
18162	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18163}
18164
18165// ResumeClusterUpgradeSender sends the ResumeClusterUpgrade request. The method will close the
18166// http.Response Body if it receives an error.
18167func (client BaseClient) ResumeClusterUpgradeSender(req *http.Request) (*http.Response, error) {
18168	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18169}
18170
18171// ResumeClusterUpgradeResponder handles the response to the ResumeClusterUpgrade request. The method always
18172// closes the http.Response Body.
18173func (client BaseClient) ResumeClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
18174	err = autorest.Respond(
18175		resp,
18176		azure.WithErrorUnlessStatusCode(http.StatusOK),
18177		autorest.ByClosing())
18178	result.Response = resp
18179	return
18180}
18181
18182// ResumePartitionBackup the previously suspended partition resumes taking periodic backup as per the backup policy
18183// currently configured for the same.
18184// Parameters:
18185// partitionID - the identity of the partition.
18186// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18187// duration that the client is willing to wait for the requested operation to complete. The default value for
18188// this parameter is 60 seconds.
18189func (client BaseClient) ResumePartitionBackup(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
18190	if tracing.IsEnabled() {
18191		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumePartitionBackup")
18192		defer func() {
18193			sc := -1
18194			if result.Response != nil {
18195				sc = result.Response.StatusCode
18196			}
18197			tracing.EndSpan(ctx, sc, err)
18198		}()
18199	}
18200	if err := validation.Validate([]validation.Validation{
18201		{TargetValue: timeout,
18202			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18203				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18204					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18205				}}}}}); err != nil {
18206		return result, validation.NewError("servicefabric.BaseClient", "ResumePartitionBackup", err.Error())
18207	}
18208
18209	req, err := client.ResumePartitionBackupPreparer(ctx, partitionID, timeout)
18210	if err != nil {
18211		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", nil, "Failure preparing request")
18212		return
18213	}
18214
18215	resp, err := client.ResumePartitionBackupSender(req)
18216	if err != nil {
18217		result.Response = resp
18218		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", resp, "Failure sending request")
18219		return
18220	}
18221
18222	result, err = client.ResumePartitionBackupResponder(resp)
18223	if err != nil {
18224		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", resp, "Failure responding to request")
18225		return
18226	}
18227
18228	return
18229}
18230
18231// ResumePartitionBackupPreparer prepares the ResumePartitionBackup request.
18232func (client BaseClient) ResumePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
18233	pathParameters := map[string]interface{}{
18234		"partitionId": partitionID,
18235	}
18236
18237	const APIVersion = "6.2-preview"
18238	queryParameters := map[string]interface{}{
18239		"api-version": APIVersion,
18240	}
18241	if timeout != nil {
18242		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18243	} else {
18244		queryParameters["timeout"] = autorest.Encode("query", 60)
18245	}
18246
18247	preparer := autorest.CreatePreparer(
18248		autorest.AsPost(),
18249		autorest.WithBaseURL(client.BaseURI),
18250		autorest.WithPathParameters("/Partitions/{partitionId}/$/ResumeBackup", pathParameters),
18251		autorest.WithQueryParameters(queryParameters))
18252	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18253}
18254
18255// ResumePartitionBackupSender sends the ResumePartitionBackup request. The method will close the
18256// http.Response Body if it receives an error.
18257func (client BaseClient) ResumePartitionBackupSender(req *http.Request) (*http.Response, error) {
18258	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18259}
18260
18261// ResumePartitionBackupResponder handles the response to the ResumePartitionBackup request. The method always
18262// closes the http.Response Body.
18263func (client BaseClient) ResumePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) {
18264	err = autorest.Respond(
18265		resp,
18266		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18267		autorest.ByClosing())
18268	result.Response = resp
18269	return
18270}
18271
18272// ResumeServiceBackup the previously suspended Service Fabric service resumes taking periodic backup as per the backup
18273// policy currently configured for the same.
18274// Parameters:
18275// serviceID - the identity of the service. This ID is typically the full name of the service without the
18276// 'fabric:' URI scheme.
18277// Starting from version 6.0, hierarchical names are delimited with the "~" character.
18278// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
18279// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
18280// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18281// duration that the client is willing to wait for the requested operation to complete. The default value for
18282// this parameter is 60 seconds.
18283func (client BaseClient) ResumeServiceBackup(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) {
18284	if tracing.IsEnabled() {
18285		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeServiceBackup")
18286		defer func() {
18287			sc := -1
18288			if result.Response != nil {
18289				sc = result.Response.StatusCode
18290			}
18291			tracing.EndSpan(ctx, sc, err)
18292		}()
18293	}
18294	if err := validation.Validate([]validation.Validation{
18295		{TargetValue: timeout,
18296			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18297				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18298					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18299				}}}}}); err != nil {
18300		return result, validation.NewError("servicefabric.BaseClient", "ResumeServiceBackup", err.Error())
18301	}
18302
18303	req, err := client.ResumeServiceBackupPreparer(ctx, serviceID, timeout)
18304	if err != nil {
18305		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", nil, "Failure preparing request")
18306		return
18307	}
18308
18309	resp, err := client.ResumeServiceBackupSender(req)
18310	if err != nil {
18311		result.Response = resp
18312		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", resp, "Failure sending request")
18313		return
18314	}
18315
18316	result, err = client.ResumeServiceBackupResponder(resp)
18317	if err != nil {
18318		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", resp, "Failure responding to request")
18319		return
18320	}
18321
18322	return
18323}
18324
18325// ResumeServiceBackupPreparer prepares the ResumeServiceBackup request.
18326func (client BaseClient) ResumeServiceBackupPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
18327	pathParameters := map[string]interface{}{
18328		"serviceId": serviceID,
18329	}
18330
18331	const APIVersion = "6.2-preview"
18332	queryParameters := map[string]interface{}{
18333		"api-version": APIVersion,
18334	}
18335	if timeout != nil {
18336		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18337	} else {
18338		queryParameters["timeout"] = autorest.Encode("query", 60)
18339	}
18340
18341	preparer := autorest.CreatePreparer(
18342		autorest.AsPost(),
18343		autorest.WithBaseURL(client.BaseURI),
18344		autorest.WithPathParameters("/Services/{serviceId}/$/ResumeBackup", pathParameters),
18345		autorest.WithQueryParameters(queryParameters))
18346	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18347}
18348
18349// ResumeServiceBackupSender sends the ResumeServiceBackup request. The method will close the
18350// http.Response Body if it receives an error.
18351func (client BaseClient) ResumeServiceBackupSender(req *http.Request) (*http.Response, error) {
18352	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18353}
18354
18355// ResumeServiceBackupResponder handles the response to the ResumeServiceBackup request. The method always
18356// closes the http.Response Body.
18357func (client BaseClient) ResumeServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) {
18358	err = autorest.Respond(
18359		resp,
18360		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18361		autorest.ByClosing())
18362	result.Response = resp
18363	return
18364}
18365
18366// RollbackApplicationUpgrade starts rolling back the current application upgrade to the previous version. This API can
18367// only be used to roll back the current in-progress upgrade that is rolling forward to new version. If the application
18368// is not currently being upgraded use StartApplicationUpgrade API to upgrade it to desired version, including rolling
18369// back to a previous version.
18370// Parameters:
18371// applicationID - the identity of the application. This is typically the full name of the application without
18372// the 'fabric:' URI scheme.
18373// Starting from version 6.0, hierarchical names are delimited with the "~" character.
18374// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
18375// in 6.0+ and "myapp/app1" in previous versions.
18376// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18377// duration that the client is willing to wait for the requested operation to complete. The default value for
18378// this parameter is 60 seconds.
18379func (client BaseClient) RollbackApplicationUpgrade(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) {
18380	if tracing.IsEnabled() {
18381		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RollbackApplicationUpgrade")
18382		defer func() {
18383			sc := -1
18384			if result.Response != nil {
18385				sc = result.Response.StatusCode
18386			}
18387			tracing.EndSpan(ctx, sc, err)
18388		}()
18389	}
18390	if err := validation.Validate([]validation.Validation{
18391		{TargetValue: timeout,
18392			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18393				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18394					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18395				}}}}}); err != nil {
18396		return result, validation.NewError("servicefabric.BaseClient", "RollbackApplicationUpgrade", err.Error())
18397	}
18398
18399	req, err := client.RollbackApplicationUpgradePreparer(ctx, applicationID, timeout)
18400	if err != nil {
18401		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", nil, "Failure preparing request")
18402		return
18403	}
18404
18405	resp, err := client.RollbackApplicationUpgradeSender(req)
18406	if err != nil {
18407		result.Response = resp
18408		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", resp, "Failure sending request")
18409		return
18410	}
18411
18412	result, err = client.RollbackApplicationUpgradeResponder(resp)
18413	if err != nil {
18414		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", resp, "Failure responding to request")
18415		return
18416	}
18417
18418	return
18419}
18420
18421// RollbackApplicationUpgradePreparer prepares the RollbackApplicationUpgrade request.
18422func (client BaseClient) RollbackApplicationUpgradePreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
18423	pathParameters := map[string]interface{}{
18424		"applicationId": applicationID,
18425	}
18426
18427	const APIVersion = "6.0"
18428	queryParameters := map[string]interface{}{
18429		"api-version": APIVersion,
18430	}
18431	if timeout != nil {
18432		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18433	} else {
18434		queryParameters["timeout"] = autorest.Encode("query", 60)
18435	}
18436
18437	preparer := autorest.CreatePreparer(
18438		autorest.AsPost(),
18439		autorest.WithBaseURL(client.BaseURI),
18440		autorest.WithPathParameters("/Applications/{applicationId}/$/RollbackUpgrade", pathParameters),
18441		autorest.WithQueryParameters(queryParameters))
18442	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18443}
18444
18445// RollbackApplicationUpgradeSender sends the RollbackApplicationUpgrade request. The method will close the
18446// http.Response Body if it receives an error.
18447func (client BaseClient) RollbackApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
18448	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18449}
18450
18451// RollbackApplicationUpgradeResponder handles the response to the RollbackApplicationUpgrade request. The method always
18452// closes the http.Response Body.
18453func (client BaseClient) RollbackApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
18454	err = autorest.Respond(
18455		resp,
18456		azure.WithErrorUnlessStatusCode(http.StatusOK),
18457		autorest.ByClosing())
18458	result.Response = resp
18459	return
18460}
18461
18462// RollbackClusterUpgrade rollback the code or configuration upgrade of a Service Fabric cluster.
18463// Parameters:
18464// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18465// duration that the client is willing to wait for the requested operation to complete. The default value for
18466// this parameter is 60 seconds.
18467func (client BaseClient) RollbackClusterUpgrade(ctx context.Context, timeout *int64) (result autorest.Response, err error) {
18468	if tracing.IsEnabled() {
18469		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RollbackClusterUpgrade")
18470		defer func() {
18471			sc := -1
18472			if result.Response != nil {
18473				sc = result.Response.StatusCode
18474			}
18475			tracing.EndSpan(ctx, sc, err)
18476		}()
18477	}
18478	if err := validation.Validate([]validation.Validation{
18479		{TargetValue: timeout,
18480			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18481				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18482					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18483				}}}}}); err != nil {
18484		return result, validation.NewError("servicefabric.BaseClient", "RollbackClusterUpgrade", err.Error())
18485	}
18486
18487	req, err := client.RollbackClusterUpgradePreparer(ctx, timeout)
18488	if err != nil {
18489		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", nil, "Failure preparing request")
18490		return
18491	}
18492
18493	resp, err := client.RollbackClusterUpgradeSender(req)
18494	if err != nil {
18495		result.Response = resp
18496		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", resp, "Failure sending request")
18497		return
18498	}
18499
18500	result, err = client.RollbackClusterUpgradeResponder(resp)
18501	if err != nil {
18502		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", resp, "Failure responding to request")
18503		return
18504	}
18505
18506	return
18507}
18508
18509// RollbackClusterUpgradePreparer prepares the RollbackClusterUpgrade request.
18510func (client BaseClient) RollbackClusterUpgradePreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
18511	const APIVersion = "6.0"
18512	queryParameters := map[string]interface{}{
18513		"api-version": APIVersion,
18514	}
18515	if timeout != nil {
18516		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18517	} else {
18518		queryParameters["timeout"] = autorest.Encode("query", 60)
18519	}
18520
18521	preparer := autorest.CreatePreparer(
18522		autorest.AsPost(),
18523		autorest.WithBaseURL(client.BaseURI),
18524		autorest.WithPath("/$/RollbackUpgrade"),
18525		autorest.WithQueryParameters(queryParameters))
18526	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18527}
18528
18529// RollbackClusterUpgradeSender sends the RollbackClusterUpgrade request. The method will close the
18530// http.Response Body if it receives an error.
18531func (client BaseClient) RollbackClusterUpgradeSender(req *http.Request) (*http.Response, error) {
18532	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18533}
18534
18535// RollbackClusterUpgradeResponder handles the response to the RollbackClusterUpgrade request. The method always
18536// closes the http.Response Body.
18537func (client BaseClient) RollbackClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
18538	err = autorest.Respond(
18539		resp,
18540		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18541		autorest.ByClosing())
18542	result.Response = resp
18543	return
18544}
18545
18546// SetUpgradeOrchestrationServiceState update the service state of Service Fabric Upgrade Orchestration Service. This
18547// API is internally used for support purposes.
18548// Parameters:
18549// upgradeOrchestrationServiceState - service state of Service Fabric Upgrade Orchestration Service.
18550// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18551// duration that the client is willing to wait for the requested operation to complete. The default value for
18552// this parameter is 60 seconds.
18553func (client BaseClient) SetUpgradeOrchestrationServiceState(ctx context.Context, upgradeOrchestrationServiceState UpgradeOrchestrationServiceState, timeout *int64) (result UpgradeOrchestrationServiceStateSummary, err error) {
18554	if tracing.IsEnabled() {
18555		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SetUpgradeOrchestrationServiceState")
18556		defer func() {
18557			sc := -1
18558			if result.Response.Response != nil {
18559				sc = result.Response.Response.StatusCode
18560			}
18561			tracing.EndSpan(ctx, sc, err)
18562		}()
18563	}
18564	if err := validation.Validate([]validation.Validation{
18565		{TargetValue: timeout,
18566			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18567				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18568					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18569				}}}}}); err != nil {
18570		return result, validation.NewError("servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", err.Error())
18571	}
18572
18573	req, err := client.SetUpgradeOrchestrationServiceStatePreparer(ctx, upgradeOrchestrationServiceState, timeout)
18574	if err != nil {
18575		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", nil, "Failure preparing request")
18576		return
18577	}
18578
18579	resp, err := client.SetUpgradeOrchestrationServiceStateSender(req)
18580	if err != nil {
18581		result.Response = autorest.Response{Response: resp}
18582		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", resp, "Failure sending request")
18583		return
18584	}
18585
18586	result, err = client.SetUpgradeOrchestrationServiceStateResponder(resp)
18587	if err != nil {
18588		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", resp, "Failure responding to request")
18589		return
18590	}
18591
18592	return
18593}
18594
18595// SetUpgradeOrchestrationServiceStatePreparer prepares the SetUpgradeOrchestrationServiceState request.
18596func (client BaseClient) SetUpgradeOrchestrationServiceStatePreparer(ctx context.Context, upgradeOrchestrationServiceState UpgradeOrchestrationServiceState, timeout *int64) (*http.Request, error) {
18597	const APIVersion = "6.0"
18598	queryParameters := map[string]interface{}{
18599		"api-version": APIVersion,
18600	}
18601	if timeout != nil {
18602		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18603	} else {
18604		queryParameters["timeout"] = autorest.Encode("query", 60)
18605	}
18606
18607	preparer := autorest.CreatePreparer(
18608		autorest.AsContentType("application/json; charset=utf-8"),
18609		autorest.AsPost(),
18610		autorest.WithBaseURL(client.BaseURI),
18611		autorest.WithPath("/$/SetUpgradeOrchestrationServiceState"),
18612		autorest.WithJSON(upgradeOrchestrationServiceState),
18613		autorest.WithQueryParameters(queryParameters))
18614	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18615}
18616
18617// SetUpgradeOrchestrationServiceStateSender sends the SetUpgradeOrchestrationServiceState request. The method will close the
18618// http.Response Body if it receives an error.
18619func (client BaseClient) SetUpgradeOrchestrationServiceStateSender(req *http.Request) (*http.Response, error) {
18620	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18621}
18622
18623// SetUpgradeOrchestrationServiceStateResponder handles the response to the SetUpgradeOrchestrationServiceState request. The method always
18624// closes the http.Response Body.
18625func (client BaseClient) SetUpgradeOrchestrationServiceStateResponder(resp *http.Response) (result UpgradeOrchestrationServiceStateSummary, err error) {
18626	err = autorest.Respond(
18627		resp,
18628		azure.WithErrorUnlessStatusCode(http.StatusOK),
18629		autorest.ByUnmarshallingJSON(&result),
18630		autorest.ByClosing())
18631	result.Response = autorest.Response{Response: resp}
18632	return
18633}
18634
18635// StartApplicationUpgrade validates the supplied application upgrade parameters and starts upgrading the application
18636// if the parameters are valid.
18637// Parameters:
18638// applicationID - the identity of the application. This is typically the full name of the application without
18639// the 'fabric:' URI scheme.
18640// Starting from version 6.0, hierarchical names are delimited with the "~" character.
18641// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
18642// in 6.0+ and "myapp/app1" in previous versions.
18643// applicationUpgradeDescription - parameters for an application upgrade.
18644// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18645// duration that the client is willing to wait for the requested operation to complete. The default value for
18646// this parameter is 60 seconds.
18647func (client BaseClient) StartApplicationUpgrade(ctx context.Context, applicationID string, applicationUpgradeDescription ApplicationUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
18648	if tracing.IsEnabled() {
18649		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartApplicationUpgrade")
18650		defer func() {
18651			sc := -1
18652			if result.Response != nil {
18653				sc = result.Response.StatusCode
18654			}
18655			tracing.EndSpan(ctx, sc, err)
18656		}()
18657	}
18658	if err := validation.Validate([]validation.Validation{
18659		{TargetValue: applicationUpgradeDescription,
18660			Constraints: []validation.Constraint{{Target: "applicationUpgradeDescription.Name", Name: validation.Null, Rule: true, Chain: nil},
18661				{Target: "applicationUpgradeDescription.TargetApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil},
18662				{Target: "applicationUpgradeDescription.Parameters", Name: validation.Null, Rule: true, Chain: nil}}},
18663		{TargetValue: timeout,
18664			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18665				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18666					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18667				}}}}}); err != nil {
18668		return result, validation.NewError("servicefabric.BaseClient", "StartApplicationUpgrade", err.Error())
18669	}
18670
18671	req, err := client.StartApplicationUpgradePreparer(ctx, applicationID, applicationUpgradeDescription, timeout)
18672	if err != nil {
18673		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", nil, "Failure preparing request")
18674		return
18675	}
18676
18677	resp, err := client.StartApplicationUpgradeSender(req)
18678	if err != nil {
18679		result.Response = resp
18680		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", resp, "Failure sending request")
18681		return
18682	}
18683
18684	result, err = client.StartApplicationUpgradeResponder(resp)
18685	if err != nil {
18686		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", resp, "Failure responding to request")
18687		return
18688	}
18689
18690	return
18691}
18692
18693// StartApplicationUpgradePreparer prepares the StartApplicationUpgrade request.
18694func (client BaseClient) StartApplicationUpgradePreparer(ctx context.Context, applicationID string, applicationUpgradeDescription ApplicationUpgradeDescription, timeout *int64) (*http.Request, error) {
18695	pathParameters := map[string]interface{}{
18696		"applicationId": applicationID,
18697	}
18698
18699	const APIVersion = "6.0"
18700	queryParameters := map[string]interface{}{
18701		"api-version": APIVersion,
18702	}
18703	if timeout != nil {
18704		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18705	} else {
18706		queryParameters["timeout"] = autorest.Encode("query", 60)
18707	}
18708
18709	preparer := autorest.CreatePreparer(
18710		autorest.AsContentType("application/json; charset=utf-8"),
18711		autorest.AsPost(),
18712		autorest.WithBaseURL(client.BaseURI),
18713		autorest.WithPathParameters("/Applications/{applicationId}/$/Upgrade", pathParameters),
18714		autorest.WithJSON(applicationUpgradeDescription),
18715		autorest.WithQueryParameters(queryParameters))
18716	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18717}
18718
18719// StartApplicationUpgradeSender sends the StartApplicationUpgrade request. The method will close the
18720// http.Response Body if it receives an error.
18721func (client BaseClient) StartApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
18722	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18723}
18724
18725// StartApplicationUpgradeResponder handles the response to the StartApplicationUpgrade request. The method always
18726// closes the http.Response Body.
18727func (client BaseClient) StartApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
18728	err = autorest.Respond(
18729		resp,
18730		azure.WithErrorUnlessStatusCode(http.StatusOK),
18731		autorest.ByClosing())
18732	result.Response = resp
18733	return
18734}
18735
18736// StartChaos if Chaos is not already running in the cluster, it starts Chaos with the passed in Chaos parameters.
18737// If Chaos is already running when this call is made, the call fails with the error code
18738// FABRIC_E_CHAOS_ALREADY_RUNNING.
18739// Refer to the article [Induce controlled Chaos in Service Fabric
18740// clusters](https://docs.microsoft.com/azure/service-fabric/service-fabric-controlled-chaos) for more details.
18741// Parameters:
18742// chaosParameters - describes all the parameters to configure a Chaos run.
18743// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18744// duration that the client is willing to wait for the requested operation to complete. The default value for
18745// this parameter is 60 seconds.
18746func (client BaseClient) StartChaos(ctx context.Context, chaosParameters ChaosParameters, timeout *int64) (result autorest.Response, err error) {
18747	if tracing.IsEnabled() {
18748		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartChaos")
18749		defer func() {
18750			sc := -1
18751			if result.Response != nil {
18752				sc = result.Response.StatusCode
18753			}
18754			tracing.EndSpan(ctx, sc, err)
18755		}()
18756	}
18757	if err := validation.Validate([]validation.Validation{
18758		{TargetValue: chaosParameters,
18759			Constraints: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.Null, Rule: false,
18760				Chain: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18761					{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
18762				}},
18763				{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.Null, Rule: false,
18764					Chain: []validation.Constraint{{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18765						{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
18766					}},
18767				{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.Null, Rule: false,
18768					Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18769						{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
18770					}},
18771				{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.Null, Rule: false,
18772					Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18773						{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
18774					}}}},
18775		{TargetValue: timeout,
18776			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18777				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18778					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18779				}}}}}); err != nil {
18780		return result, validation.NewError("servicefabric.BaseClient", "StartChaos", err.Error())
18781	}
18782
18783	req, err := client.StartChaosPreparer(ctx, chaosParameters, timeout)
18784	if err != nil {
18785		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", nil, "Failure preparing request")
18786		return
18787	}
18788
18789	resp, err := client.StartChaosSender(req)
18790	if err != nil {
18791		result.Response = resp
18792		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", resp, "Failure sending request")
18793		return
18794	}
18795
18796	result, err = client.StartChaosResponder(resp)
18797	if err != nil {
18798		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", resp, "Failure responding to request")
18799		return
18800	}
18801
18802	return
18803}
18804
18805// StartChaosPreparer prepares the StartChaos request.
18806func (client BaseClient) StartChaosPreparer(ctx context.Context, chaosParameters ChaosParameters, timeout *int64) (*http.Request, error) {
18807	const APIVersion = "6.0"
18808	queryParameters := map[string]interface{}{
18809		"api-version": APIVersion,
18810	}
18811	if timeout != nil {
18812		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18813	} else {
18814		queryParameters["timeout"] = autorest.Encode("query", 60)
18815	}
18816
18817	preparer := autorest.CreatePreparer(
18818		autorest.AsContentType("application/json; charset=utf-8"),
18819		autorest.AsPost(),
18820		autorest.WithBaseURL(client.BaseURI),
18821		autorest.WithPath("/Tools/Chaos/$/Start"),
18822		autorest.WithJSON(chaosParameters),
18823		autorest.WithQueryParameters(queryParameters))
18824	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18825}
18826
18827// StartChaosSender sends the StartChaos request. The method will close the
18828// http.Response Body if it receives an error.
18829func (client BaseClient) StartChaosSender(req *http.Request) (*http.Response, error) {
18830	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18831}
18832
18833// StartChaosResponder handles the response to the StartChaos request. The method always
18834// closes the http.Response Body.
18835func (client BaseClient) StartChaosResponder(resp *http.Response) (result autorest.Response, err error) {
18836	err = autorest.Respond(
18837		resp,
18838		azure.WithErrorUnlessStatusCode(http.StatusOK),
18839		autorest.ByClosing())
18840	result.Response = resp
18841	return
18842}
18843
18844// StartClusterConfigurationUpgrade validate the supplied configuration upgrade parameters and start upgrading the
18845// cluster configuration if the parameters are valid.
18846// Parameters:
18847// clusterConfigurationUpgradeDescription - parameters for a standalone cluster configuration upgrade.
18848// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18849// duration that the client is willing to wait for the requested operation to complete. The default value for
18850// this parameter is 60 seconds.
18851func (client BaseClient) StartClusterConfigurationUpgrade(ctx context.Context, clusterConfigurationUpgradeDescription ClusterConfigurationUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
18852	if tracing.IsEnabled() {
18853		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartClusterConfigurationUpgrade")
18854		defer func() {
18855			sc := -1
18856			if result.Response != nil {
18857				sc = result.Response.StatusCode
18858			}
18859			tracing.EndSpan(ctx, sc, err)
18860		}()
18861	}
18862	if err := validation.Validate([]validation.Validation{
18863		{TargetValue: clusterConfigurationUpgradeDescription,
18864			Constraints: []validation.Constraint{{Target: "clusterConfigurationUpgradeDescription.ClusterConfig", Name: validation.Null, Rule: true, Chain: nil}}},
18865		{TargetValue: timeout,
18866			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18867				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18868					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18869				}}}}}); err != nil {
18870		return result, validation.NewError("servicefabric.BaseClient", "StartClusterConfigurationUpgrade", err.Error())
18871	}
18872
18873	req, err := client.StartClusterConfigurationUpgradePreparer(ctx, clusterConfigurationUpgradeDescription, timeout)
18874	if err != nil {
18875		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", nil, "Failure preparing request")
18876		return
18877	}
18878
18879	resp, err := client.StartClusterConfigurationUpgradeSender(req)
18880	if err != nil {
18881		result.Response = resp
18882		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", resp, "Failure sending request")
18883		return
18884	}
18885
18886	result, err = client.StartClusterConfigurationUpgradeResponder(resp)
18887	if err != nil {
18888		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", resp, "Failure responding to request")
18889		return
18890	}
18891
18892	return
18893}
18894
18895// StartClusterConfigurationUpgradePreparer prepares the StartClusterConfigurationUpgrade request.
18896func (client BaseClient) StartClusterConfigurationUpgradePreparer(ctx context.Context, clusterConfigurationUpgradeDescription ClusterConfigurationUpgradeDescription, timeout *int64) (*http.Request, error) {
18897	const APIVersion = "6.0"
18898	queryParameters := map[string]interface{}{
18899		"api-version": APIVersion,
18900	}
18901	if timeout != nil {
18902		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18903	} else {
18904		queryParameters["timeout"] = autorest.Encode("query", 60)
18905	}
18906
18907	preparer := autorest.CreatePreparer(
18908		autorest.AsContentType("application/json; charset=utf-8"),
18909		autorest.AsPost(),
18910		autorest.WithBaseURL(client.BaseURI),
18911		autorest.WithPath("/$/StartClusterConfigurationUpgrade"),
18912		autorest.WithJSON(clusterConfigurationUpgradeDescription),
18913		autorest.WithQueryParameters(queryParameters))
18914	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18915}
18916
18917// StartClusterConfigurationUpgradeSender sends the StartClusterConfigurationUpgrade request. The method will close the
18918// http.Response Body if it receives an error.
18919func (client BaseClient) StartClusterConfigurationUpgradeSender(req *http.Request) (*http.Response, error) {
18920	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18921}
18922
18923// StartClusterConfigurationUpgradeResponder handles the response to the StartClusterConfigurationUpgrade request. The method always
18924// closes the http.Response Body.
18925func (client BaseClient) StartClusterConfigurationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
18926	err = autorest.Respond(
18927		resp,
18928		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18929		autorest.ByClosing())
18930	result.Response = resp
18931	return
18932}
18933
18934// StartClusterUpgrade validate the supplied upgrade parameters and start upgrading the code or configuration version
18935// of a Service Fabric cluster if the parameters are valid.
18936// Parameters:
18937// startClusterUpgradeDescription - describes the parameters for starting a cluster upgrade.
18938// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18939// duration that the client is willing to wait for the requested operation to complete. The default value for
18940// this parameter is 60 seconds.
18941func (client BaseClient) StartClusterUpgrade(ctx context.Context, startClusterUpgradeDescription StartClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
18942	if tracing.IsEnabled() {
18943		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartClusterUpgrade")
18944		defer func() {
18945			sc := -1
18946			if result.Response != nil {
18947				sc = result.Response.StatusCode
18948			}
18949			tracing.EndSpan(ctx, sc, err)
18950		}()
18951	}
18952	if err := validation.Validate([]validation.Validation{
18953		{TargetValue: startClusterUpgradeDescription,
18954			Constraints: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false,
18955				Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false,
18956					Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
18957						{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
18958					}},
18959					{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false,
18960						Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
18961							{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
18962						}},
18963				}}}},
18964		{TargetValue: timeout,
18965			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18966				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18967					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18968				}}}}}); err != nil {
18969		return result, validation.NewError("servicefabric.BaseClient", "StartClusterUpgrade", err.Error())
18970	}
18971
18972	req, err := client.StartClusterUpgradePreparer(ctx, startClusterUpgradeDescription, timeout)
18973	if err != nil {
18974		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", nil, "Failure preparing request")
18975		return
18976	}
18977
18978	resp, err := client.StartClusterUpgradeSender(req)
18979	if err != nil {
18980		result.Response = resp
18981		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", resp, "Failure sending request")
18982		return
18983	}
18984
18985	result, err = client.StartClusterUpgradeResponder(resp)
18986	if err != nil {
18987		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", resp, "Failure responding to request")
18988		return
18989	}
18990
18991	return
18992}
18993
18994// StartClusterUpgradePreparer prepares the StartClusterUpgrade request.
18995func (client BaseClient) StartClusterUpgradePreparer(ctx context.Context, startClusterUpgradeDescription StartClusterUpgradeDescription, timeout *int64) (*http.Request, error) {
18996	const APIVersion = "6.0"
18997	queryParameters := map[string]interface{}{
18998		"api-version": APIVersion,
18999	}
19000	if timeout != nil {
19001		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19002	} else {
19003		queryParameters["timeout"] = autorest.Encode("query", 60)
19004	}
19005
19006	preparer := autorest.CreatePreparer(
19007		autorest.AsContentType("application/json; charset=utf-8"),
19008		autorest.AsPost(),
19009		autorest.WithBaseURL(client.BaseURI),
19010		autorest.WithPath("/$/Upgrade"),
19011		autorest.WithJSON(startClusterUpgradeDescription),
19012		autorest.WithQueryParameters(queryParameters))
19013	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19014}
19015
19016// StartClusterUpgradeSender sends the StartClusterUpgrade request. The method will close the
19017// http.Response Body if it receives an error.
19018func (client BaseClient) StartClusterUpgradeSender(req *http.Request) (*http.Response, error) {
19019	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19020}
19021
19022// StartClusterUpgradeResponder handles the response to the StartClusterUpgrade request. The method always
19023// closes the http.Response Body.
19024func (client BaseClient) StartClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
19025	err = autorest.Respond(
19026		resp,
19027		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19028		autorest.ByClosing())
19029	result.Response = resp
19030	return
19031}
19032
19033// StartComposeDeploymentUpgrade validates the supplied upgrade parameters and starts upgrading the deployment if the
19034// parameters are valid.
19035// Parameters:
19036// deploymentName - the identity of the deployment.
19037// composeDeploymentUpgradeDescription - parameters for upgrading compose deployment.
19038// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19039// duration that the client is willing to wait for the requested operation to complete. The default value for
19040// this parameter is 60 seconds.
19041func (client BaseClient) StartComposeDeploymentUpgrade(ctx context.Context, deploymentName string, composeDeploymentUpgradeDescription ComposeDeploymentUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
19042	if tracing.IsEnabled() {
19043		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartComposeDeploymentUpgrade")
19044		defer func() {
19045			sc := -1
19046			if result.Response != nil {
19047				sc = result.Response.StatusCode
19048			}
19049			tracing.EndSpan(ctx, sc, err)
19050		}()
19051	}
19052	if err := validation.Validate([]validation.Validation{
19053		{TargetValue: composeDeploymentUpgradeDescription,
19054			Constraints: []validation.Constraint{{Target: "composeDeploymentUpgradeDescription.DeploymentName", Name: validation.Null, Rule: true, Chain: nil},
19055				{Target: "composeDeploymentUpgradeDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}},
19056		{TargetValue: timeout,
19057			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19058				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19059					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19060				}}}}}); err != nil {
19061		return result, validation.NewError("servicefabric.BaseClient", "StartComposeDeploymentUpgrade", err.Error())
19062	}
19063
19064	req, err := client.StartComposeDeploymentUpgradePreparer(ctx, deploymentName, composeDeploymentUpgradeDescription, timeout)
19065	if err != nil {
19066		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", nil, "Failure preparing request")
19067		return
19068	}
19069
19070	resp, err := client.StartComposeDeploymentUpgradeSender(req)
19071	if err != nil {
19072		result.Response = resp
19073		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", resp, "Failure sending request")
19074		return
19075	}
19076
19077	result, err = client.StartComposeDeploymentUpgradeResponder(resp)
19078	if err != nil {
19079		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", resp, "Failure responding to request")
19080		return
19081	}
19082
19083	return
19084}
19085
19086// StartComposeDeploymentUpgradePreparer prepares the StartComposeDeploymentUpgrade request.
19087func (client BaseClient) StartComposeDeploymentUpgradePreparer(ctx context.Context, deploymentName string, composeDeploymentUpgradeDescription ComposeDeploymentUpgradeDescription, timeout *int64) (*http.Request, error) {
19088	pathParameters := map[string]interface{}{
19089		"deploymentName": deploymentName,
19090	}
19091
19092	const APIVersion = "6.0-preview"
19093	queryParameters := map[string]interface{}{
19094		"api-version": APIVersion,
19095	}
19096	if timeout != nil {
19097		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19098	} else {
19099		queryParameters["timeout"] = autorest.Encode("query", 60)
19100	}
19101
19102	preparer := autorest.CreatePreparer(
19103		autorest.AsContentType("application/json; charset=utf-8"),
19104		autorest.AsPost(),
19105		autorest.WithBaseURL(client.BaseURI),
19106		autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/Upgrade", pathParameters),
19107		autorest.WithJSON(composeDeploymentUpgradeDescription),
19108		autorest.WithQueryParameters(queryParameters))
19109	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19110}
19111
19112// StartComposeDeploymentUpgradeSender sends the StartComposeDeploymentUpgrade request. The method will close the
19113// http.Response Body if it receives an error.
19114func (client BaseClient) StartComposeDeploymentUpgradeSender(req *http.Request) (*http.Response, error) {
19115	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19116}
19117
19118// StartComposeDeploymentUpgradeResponder handles the response to the StartComposeDeploymentUpgrade request. The method always
19119// closes the http.Response Body.
19120func (client BaseClient) StartComposeDeploymentUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
19121	err = autorest.Respond(
19122		resp,
19123		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19124		autorest.ByClosing())
19125	result.Response = resp
19126	return
19127}
19128
19129// StartDataLoss this API will induce data loss for the specified partition. It will trigger a call to the OnDataLoss
19130// API of the partition.
19131// Actual data loss will depend on the specified DataLossMode.
19132//
19133// - PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is triggered for the partition but actual
19134// data loss depends on the presence of in-flight replication.
19135// - FullDataLoss - All replicas are removed hence all data is lost and OnDataLoss is triggered.
19136//
19137// This API should only be called with a stateful service as the target.
19138//
19139// Calling this API with a system service as the target is not advised.
19140//
19141// Note:  Once this API has been called, it cannot be reversed. Calling CancelOperation will only stop execution and
19142// clean up internal system state.
19143// It will not restore data if the command has progressed far enough to cause data loss.
19144//
19145// Call the GetDataLossProgress API with the same OperationId to return information on the operation started with this
19146// API.
19147// Parameters:
19148// serviceID - the identity of the service. This ID is typically the full name of the service without the
19149// 'fabric:' URI scheme.
19150// Starting from version 6.0, hierarchical names are delimited with the "~" character.
19151// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
19152// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
19153// partitionID - the identity of the partition.
19154// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
19155// API
19156// dataLossMode - this enum is passed to the StartDataLoss API to indicate what type of data loss to induce.
19157// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19158// duration that the client is willing to wait for the requested operation to complete. The default value for
19159// this parameter is 60 seconds.
19160func (client BaseClient) StartDataLoss(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, dataLossMode DataLossMode, timeout *int64) (result autorest.Response, err error) {
19161	if tracing.IsEnabled() {
19162		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartDataLoss")
19163		defer func() {
19164			sc := -1
19165			if result.Response != nil {
19166				sc = result.Response.StatusCode
19167			}
19168			tracing.EndSpan(ctx, sc, err)
19169		}()
19170	}
19171	if err := validation.Validate([]validation.Validation{
19172		{TargetValue: timeout,
19173			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19174				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19175					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19176				}}}}}); err != nil {
19177		return result, validation.NewError("servicefabric.BaseClient", "StartDataLoss", err.Error())
19178	}
19179
19180	req, err := client.StartDataLossPreparer(ctx, serviceID, partitionID, operationID, dataLossMode, timeout)
19181	if err != nil {
19182		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", nil, "Failure preparing request")
19183		return
19184	}
19185
19186	resp, err := client.StartDataLossSender(req)
19187	if err != nil {
19188		result.Response = resp
19189		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", resp, "Failure sending request")
19190		return
19191	}
19192
19193	result, err = client.StartDataLossResponder(resp)
19194	if err != nil {
19195		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", resp, "Failure responding to request")
19196		return
19197	}
19198
19199	return
19200}
19201
19202// StartDataLossPreparer prepares the StartDataLoss request.
19203func (client BaseClient) StartDataLossPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, dataLossMode DataLossMode, timeout *int64) (*http.Request, error) {
19204	pathParameters := map[string]interface{}{
19205		"partitionId": partitionID,
19206		"serviceId":   serviceID,
19207	}
19208
19209	const APIVersion = "6.0"
19210	queryParameters := map[string]interface{}{
19211		"api-version":  APIVersion,
19212		"DataLossMode": autorest.Encode("query", dataLossMode),
19213		"OperationId":  autorest.Encode("query", operationID),
19214	}
19215	if timeout != nil {
19216		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19217	} else {
19218		queryParameters["timeout"] = autorest.Encode("query", 60)
19219	}
19220
19221	preparer := autorest.CreatePreparer(
19222		autorest.AsPost(),
19223		autorest.WithBaseURL(client.BaseURI),
19224		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartDataLoss", pathParameters),
19225		autorest.WithQueryParameters(queryParameters))
19226	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19227}
19228
19229// StartDataLossSender sends the StartDataLoss request. The method will close the
19230// http.Response Body if it receives an error.
19231func (client BaseClient) StartDataLossSender(req *http.Request) (*http.Response, error) {
19232	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19233}
19234
19235// StartDataLossResponder handles the response to the StartDataLoss request. The method always
19236// closes the http.Response Body.
19237func (client BaseClient) StartDataLossResponder(resp *http.Response) (result autorest.Response, err error) {
19238	err = autorest.Respond(
19239		resp,
19240		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19241		autorest.ByClosing())
19242	result.Response = resp
19243	return
19244}
19245
19246// StartNodeTransition starts or stops a cluster node.  A cluster node is a process, not the OS instance itself.  To
19247// start a node, pass in "Start" for the NodeTransitionType parameter.
19248// To stop a node, pass in "Stop" for the NodeTransitionType parameter.  This API starts the operation - when the API
19249// returns the node may not have finished transitioning yet.
19250// Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation.
19251// Parameters:
19252// nodeName - the name of the node.
19253// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
19254// API
19255// nodeTransitionType - indicates the type of transition to perform.  NodeTransitionType.Start will start a
19256// stopped node.  NodeTransitionType.Stop will stop a node that is up.
19257// nodeInstanceID - the node instance ID of the target node.  This can be determined through GetNodeInfo API.
19258// stopDurationInSeconds - the duration, in seconds, to keep the node stopped.  The minimum value is 600, the
19259// maximum is 14400.  After this time expires, the node will automatically come back up.
19260// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19261// duration that the client is willing to wait for the requested operation to complete. The default value for
19262// this parameter is 60 seconds.
19263func (client BaseClient) StartNodeTransition(ctx context.Context, nodeName string, operationID uuid.UUID, nodeTransitionType NodeTransitionType, nodeInstanceID string, stopDurationInSeconds int32, timeout *int64) (result autorest.Response, err error) {
19264	if tracing.IsEnabled() {
19265		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartNodeTransition")
19266		defer func() {
19267			sc := -1
19268			if result.Response != nil {
19269				sc = result.Response.StatusCode
19270			}
19271			tracing.EndSpan(ctx, sc, err)
19272		}()
19273	}
19274	if err := validation.Validate([]validation.Validation{
19275		{TargetValue: stopDurationInSeconds,
19276			Constraints: []validation.Constraint{{Target: "stopDurationInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}},
19277		{TargetValue: timeout,
19278			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19279				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19280					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19281				}}}}}); err != nil {
19282		return result, validation.NewError("servicefabric.BaseClient", "StartNodeTransition", err.Error())
19283	}
19284
19285	req, err := client.StartNodeTransitionPreparer(ctx, nodeName, operationID, nodeTransitionType, nodeInstanceID, stopDurationInSeconds, timeout)
19286	if err != nil {
19287		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", nil, "Failure preparing request")
19288		return
19289	}
19290
19291	resp, err := client.StartNodeTransitionSender(req)
19292	if err != nil {
19293		result.Response = resp
19294		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", resp, "Failure sending request")
19295		return
19296	}
19297
19298	result, err = client.StartNodeTransitionResponder(resp)
19299	if err != nil {
19300		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", resp, "Failure responding to request")
19301		return
19302	}
19303
19304	return
19305}
19306
19307// StartNodeTransitionPreparer prepares the StartNodeTransition request.
19308func (client BaseClient) StartNodeTransitionPreparer(ctx context.Context, nodeName string, operationID uuid.UUID, nodeTransitionType NodeTransitionType, nodeInstanceID string, stopDurationInSeconds int32, timeout *int64) (*http.Request, error) {
19309	pathParameters := map[string]interface{}{
19310		"nodeName": autorest.Encode("path", nodeName),
19311	}
19312
19313	const APIVersion = "6.0"
19314	queryParameters := map[string]interface{}{
19315		"api-version":           APIVersion,
19316		"NodeInstanceId":        autorest.Encode("query", nodeInstanceID),
19317		"NodeTransitionType":    autorest.Encode("query", nodeTransitionType),
19318		"OperationId":           autorest.Encode("query", operationID),
19319		"StopDurationInSeconds": autorest.Encode("query", stopDurationInSeconds),
19320	}
19321	if timeout != nil {
19322		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19323	} else {
19324		queryParameters["timeout"] = autorest.Encode("query", 60)
19325	}
19326
19327	preparer := autorest.CreatePreparer(
19328		autorest.AsPost(),
19329		autorest.WithBaseURL(client.BaseURI),
19330		autorest.WithPathParameters("/Faults/Nodes/{nodeName}/$/StartTransition/", pathParameters),
19331		autorest.WithQueryParameters(queryParameters))
19332	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19333}
19334
19335// StartNodeTransitionSender sends the StartNodeTransition request. The method will close the
19336// http.Response Body if it receives an error.
19337func (client BaseClient) StartNodeTransitionSender(req *http.Request) (*http.Response, error) {
19338	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19339}
19340
19341// StartNodeTransitionResponder handles the response to the StartNodeTransition request. The method always
19342// closes the http.Response Body.
19343func (client BaseClient) StartNodeTransitionResponder(resp *http.Response) (result autorest.Response, err error) {
19344	err = autorest.Respond(
19345		resp,
19346		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19347		autorest.ByClosing())
19348	result.Response = resp
19349	return
19350}
19351
19352// StartPartitionRestart this API is useful for testing failover.
19353//
19354// If used to target a stateless service partition, RestartPartitionMode must be AllReplicasOrInstances.
19355//
19356// Call the GetPartitionRestartProgress API using the same OperationId to get the progress.
19357// Parameters:
19358// serviceID - the identity of the service. This ID is typically the full name of the service without the
19359// 'fabric:' URI scheme.
19360// Starting from version 6.0, hierarchical names are delimited with the "~" character.
19361// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
19362// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
19363// partitionID - the identity of the partition.
19364// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
19365// API
19366// restartPartitionMode - describe which partitions to restart.
19367// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19368// duration that the client is willing to wait for the requested operation to complete. The default value for
19369// this parameter is 60 seconds.
19370func (client BaseClient) StartPartitionRestart(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, restartPartitionMode RestartPartitionMode, timeout *int64) (result autorest.Response, err error) {
19371	if tracing.IsEnabled() {
19372		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartPartitionRestart")
19373		defer func() {
19374			sc := -1
19375			if result.Response != nil {
19376				sc = result.Response.StatusCode
19377			}
19378			tracing.EndSpan(ctx, sc, err)
19379		}()
19380	}
19381	if err := validation.Validate([]validation.Validation{
19382		{TargetValue: timeout,
19383			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19384				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19385					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19386				}}}}}); err != nil {
19387		return result, validation.NewError("servicefabric.BaseClient", "StartPartitionRestart", err.Error())
19388	}
19389
19390	req, err := client.StartPartitionRestartPreparer(ctx, serviceID, partitionID, operationID, restartPartitionMode, timeout)
19391	if err != nil {
19392		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", nil, "Failure preparing request")
19393		return
19394	}
19395
19396	resp, err := client.StartPartitionRestartSender(req)
19397	if err != nil {
19398		result.Response = resp
19399		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", resp, "Failure sending request")
19400		return
19401	}
19402
19403	result, err = client.StartPartitionRestartResponder(resp)
19404	if err != nil {
19405		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", resp, "Failure responding to request")
19406		return
19407	}
19408
19409	return
19410}
19411
19412// StartPartitionRestartPreparer prepares the StartPartitionRestart request.
19413func (client BaseClient) StartPartitionRestartPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, restartPartitionMode RestartPartitionMode, timeout *int64) (*http.Request, error) {
19414	pathParameters := map[string]interface{}{
19415		"partitionId": partitionID,
19416		"serviceId":   serviceID,
19417	}
19418
19419	const APIVersion = "6.0"
19420	queryParameters := map[string]interface{}{
19421		"api-version":          APIVersion,
19422		"OperationId":          autorest.Encode("query", operationID),
19423		"RestartPartitionMode": autorest.Encode("query", restartPartitionMode),
19424	}
19425	if timeout != nil {
19426		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19427	} else {
19428		queryParameters["timeout"] = autorest.Encode("query", 60)
19429	}
19430
19431	preparer := autorest.CreatePreparer(
19432		autorest.AsPost(),
19433		autorest.WithBaseURL(client.BaseURI),
19434		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartRestart", pathParameters),
19435		autorest.WithQueryParameters(queryParameters))
19436	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19437}
19438
19439// StartPartitionRestartSender sends the StartPartitionRestart request. The method will close the
19440// http.Response Body if it receives an error.
19441func (client BaseClient) StartPartitionRestartSender(req *http.Request) (*http.Response, error) {
19442	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19443}
19444
19445// StartPartitionRestartResponder handles the response to the StartPartitionRestart request. The method always
19446// closes the http.Response Body.
19447func (client BaseClient) StartPartitionRestartResponder(resp *http.Response) (result autorest.Response, err error) {
19448	err = autorest.Respond(
19449		resp,
19450		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19451		autorest.ByClosing())
19452	result.Response = resp
19453	return
19454}
19455
19456// StartQuorumLoss this API is useful for a temporary quorum loss situation on your service.
19457//
19458// Call the GetQuorumLossProgress API with the same OperationId to return information on the operation started with
19459// this API.
19460//
19461// This can only be called on stateful persisted (HasPersistedState==true) services.  Do not use this API on stateless
19462// services or stateful in-memory only services.
19463// Parameters:
19464// serviceID - the identity of the service. This ID is typically the full name of the service without the
19465// 'fabric:' URI scheme.
19466// Starting from version 6.0, hierarchical names are delimited with the "~" character.
19467// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
19468// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
19469// partitionID - the identity of the partition.
19470// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
19471// API
19472// quorumLossMode - this enum is passed to the StartQuorumLoss API to indicate what type of quorum loss to
19473// induce.
19474// quorumLossDuration - the amount of time for which the partition will be kept in quorum loss.  This must be
19475// specified in seconds.
19476// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19477// duration that the client is willing to wait for the requested operation to complete. The default value for
19478// this parameter is 60 seconds.
19479func (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) {
19480	if tracing.IsEnabled() {
19481		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartQuorumLoss")
19482		defer func() {
19483			sc := -1
19484			if result.Response != nil {
19485				sc = result.Response.StatusCode
19486			}
19487			tracing.EndSpan(ctx, sc, err)
19488		}()
19489	}
19490	if err := validation.Validate([]validation.Validation{
19491		{TargetValue: timeout,
19492			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19493				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19494					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19495				}}}}}); err != nil {
19496		return result, validation.NewError("servicefabric.BaseClient", "StartQuorumLoss", err.Error())
19497	}
19498
19499	req, err := client.StartQuorumLossPreparer(ctx, serviceID, partitionID, operationID, quorumLossMode, quorumLossDuration, timeout)
19500	if err != nil {
19501		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", nil, "Failure preparing request")
19502		return
19503	}
19504
19505	resp, err := client.StartQuorumLossSender(req)
19506	if err != nil {
19507		result.Response = resp
19508		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", resp, "Failure sending request")
19509		return
19510	}
19511
19512	result, err = client.StartQuorumLossResponder(resp)
19513	if err != nil {
19514		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", resp, "Failure responding to request")
19515		return
19516	}
19517
19518	return
19519}
19520
19521// StartQuorumLossPreparer prepares the StartQuorumLoss request.
19522func (client BaseClient) StartQuorumLossPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, quorumLossMode QuorumLossMode, quorumLossDuration int32, timeout *int64) (*http.Request, error) {
19523	pathParameters := map[string]interface{}{
19524		"partitionId": partitionID,
19525		"serviceId":   serviceID,
19526	}
19527
19528	const APIVersion = "6.0"
19529	queryParameters := map[string]interface{}{
19530		"api-version":        APIVersion,
19531		"OperationId":        autorest.Encode("query", operationID),
19532		"QuorumLossDuration": autorest.Encode("query", quorumLossDuration),
19533		"QuorumLossMode":     autorest.Encode("query", quorumLossMode),
19534	}
19535	if timeout != nil {
19536		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19537	} else {
19538		queryParameters["timeout"] = autorest.Encode("query", 60)
19539	}
19540
19541	preparer := autorest.CreatePreparer(
19542		autorest.AsPost(),
19543		autorest.WithBaseURL(client.BaseURI),
19544		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartQuorumLoss", pathParameters),
19545		autorest.WithQueryParameters(queryParameters))
19546	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19547}
19548
19549// StartQuorumLossSender sends the StartQuorumLoss request. The method will close the
19550// http.Response Body if it receives an error.
19551func (client BaseClient) StartQuorumLossSender(req *http.Request) (*http.Response, error) {
19552	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19553}
19554
19555// StartQuorumLossResponder handles the response to the StartQuorumLoss request. The method always
19556// closes the http.Response Body.
19557func (client BaseClient) StartQuorumLossResponder(resp *http.Response) (result autorest.Response, err error) {
19558	err = autorest.Respond(
19559		resp,
19560		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19561		autorest.ByClosing())
19562	result.Response = resp
19563	return
19564}
19565
19566// StopChaos stops Chaos from executing new faults. In-flight faults will continue to execute until they are complete.
19567// The current Chaos Schedule is put into a stopped state.
19568// Once a schedule is stopped, it will stay in the stopped state and not be used to Chaos Schedule new runs of Chaos. A
19569// new Chaos Schedule must be set in order to resume scheduling.
19570// Parameters:
19571// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19572// duration that the client is willing to wait for the requested operation to complete. The default value for
19573// this parameter is 60 seconds.
19574func (client BaseClient) StopChaos(ctx context.Context, timeout *int64) (result autorest.Response, err error) {
19575	if tracing.IsEnabled() {
19576		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StopChaos")
19577		defer func() {
19578			sc := -1
19579			if result.Response != nil {
19580				sc = result.Response.StatusCode
19581			}
19582			tracing.EndSpan(ctx, sc, err)
19583		}()
19584	}
19585	if err := validation.Validate([]validation.Validation{
19586		{TargetValue: timeout,
19587			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19588				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19589					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19590				}}}}}); err != nil {
19591		return result, validation.NewError("servicefabric.BaseClient", "StopChaos", err.Error())
19592	}
19593
19594	req, err := client.StopChaosPreparer(ctx, timeout)
19595	if err != nil {
19596		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", nil, "Failure preparing request")
19597		return
19598	}
19599
19600	resp, err := client.StopChaosSender(req)
19601	if err != nil {
19602		result.Response = resp
19603		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", resp, "Failure sending request")
19604		return
19605	}
19606
19607	result, err = client.StopChaosResponder(resp)
19608	if err != nil {
19609		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", resp, "Failure responding to request")
19610		return
19611	}
19612
19613	return
19614}
19615
19616// StopChaosPreparer prepares the StopChaos request.
19617func (client BaseClient) StopChaosPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
19618	const APIVersion = "6.0"
19619	queryParameters := map[string]interface{}{
19620		"api-version": APIVersion,
19621	}
19622	if timeout != nil {
19623		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19624	} else {
19625		queryParameters["timeout"] = autorest.Encode("query", 60)
19626	}
19627
19628	preparer := autorest.CreatePreparer(
19629		autorest.AsPost(),
19630		autorest.WithBaseURL(client.BaseURI),
19631		autorest.WithPath("/Tools/Chaos/$/Stop"),
19632		autorest.WithQueryParameters(queryParameters))
19633	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19634}
19635
19636// StopChaosSender sends the StopChaos request. The method will close the
19637// http.Response Body if it receives an error.
19638func (client BaseClient) StopChaosSender(req *http.Request) (*http.Response, error) {
19639	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19640}
19641
19642// StopChaosResponder handles the response to the StopChaos request. The method always
19643// closes the http.Response Body.
19644func (client BaseClient) StopChaosResponder(resp *http.Response) (result autorest.Response, err error) {
19645	err = autorest.Respond(
19646		resp,
19647		azure.WithErrorUnlessStatusCode(http.StatusOK),
19648		autorest.ByClosing())
19649	result.Response = resp
19650	return
19651}
19652
19653// SubmitPropertyBatch submits a batch of property operations. Either all or none of the operations will be committed.
19654// Parameters:
19655// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
19656// propertyBatchDescriptionList - describes the property batch operations to be submitted.
19657// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19658// duration that the client is willing to wait for the requested operation to complete. The default value for
19659// this parameter is 60 seconds.
19660func (client BaseClient) SubmitPropertyBatch(ctx context.Context, nameID string, propertyBatchDescriptionList PropertyBatchDescriptionList, timeout *int64) (result PropertyBatchInfoModel, err error) {
19661	if tracing.IsEnabled() {
19662		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SubmitPropertyBatch")
19663		defer func() {
19664			sc := -1
19665			if result.Response.Response != nil {
19666				sc = result.Response.Response.StatusCode
19667			}
19668			tracing.EndSpan(ctx, sc, err)
19669		}()
19670	}
19671	if err := validation.Validate([]validation.Validation{
19672		{TargetValue: timeout,
19673			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19674				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19675					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19676				}}}}}); err != nil {
19677		return result, validation.NewError("servicefabric.BaseClient", "SubmitPropertyBatch", err.Error())
19678	}
19679
19680	req, err := client.SubmitPropertyBatchPreparer(ctx, nameID, propertyBatchDescriptionList, timeout)
19681	if err != nil {
19682		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", nil, "Failure preparing request")
19683		return
19684	}
19685
19686	resp, err := client.SubmitPropertyBatchSender(req)
19687	if err != nil {
19688		result.Response = autorest.Response{Response: resp}
19689		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", resp, "Failure sending request")
19690		return
19691	}
19692
19693	result, err = client.SubmitPropertyBatchResponder(resp)
19694	if err != nil {
19695		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", resp, "Failure responding to request")
19696		return
19697	}
19698
19699	return
19700}
19701
19702// SubmitPropertyBatchPreparer prepares the SubmitPropertyBatch request.
19703func (client BaseClient) SubmitPropertyBatchPreparer(ctx context.Context, nameID string, propertyBatchDescriptionList PropertyBatchDescriptionList, timeout *int64) (*http.Request, error) {
19704	pathParameters := map[string]interface{}{
19705		"nameId": nameID,
19706	}
19707
19708	const APIVersion = "6.0"
19709	queryParameters := map[string]interface{}{
19710		"api-version": APIVersion,
19711	}
19712	if timeout != nil {
19713		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19714	} else {
19715		queryParameters["timeout"] = autorest.Encode("query", 60)
19716	}
19717
19718	preparer := autorest.CreatePreparer(
19719		autorest.AsContentType("application/json; charset=utf-8"),
19720		autorest.AsPost(),
19721		autorest.WithBaseURL(client.BaseURI),
19722		autorest.WithPathParameters("/Names/{nameId}/$/GetProperties/$/SubmitBatch", pathParameters),
19723		autorest.WithJSON(propertyBatchDescriptionList),
19724		autorest.WithQueryParameters(queryParameters))
19725	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19726}
19727
19728// SubmitPropertyBatchSender sends the SubmitPropertyBatch request. The method will close the
19729// http.Response Body if it receives an error.
19730func (client BaseClient) SubmitPropertyBatchSender(req *http.Request) (*http.Response, error) {
19731	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19732}
19733
19734// SubmitPropertyBatchResponder handles the response to the SubmitPropertyBatch request. The method always
19735// closes the http.Response Body.
19736func (client BaseClient) SubmitPropertyBatchResponder(resp *http.Response) (result PropertyBatchInfoModel, err error) {
19737	err = autorest.Respond(
19738		resp,
19739		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusConflict),
19740		autorest.ByUnmarshallingJSON(&result),
19741		autorest.ByClosing())
19742	result.Response = autorest.Response{Response: resp}
19743	return
19744}
19745
19746// SuspendApplicationBackup the application which is configured to take periodic backups, is suspended for taking
19747// further backups till it is resumed again. This operation applies to the entire application's hierarchy. It means all
19748// the services and partitions under this application are now suspended for backup.
19749// Parameters:
19750// applicationID - the identity of the application. This is typically the full name of the application without
19751// the 'fabric:' URI scheme.
19752// Starting from version 6.0, hierarchical names are delimited with the "~" character.
19753// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
19754// in 6.0+ and "myapp/app1" in previous versions.
19755// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19756// duration that the client is willing to wait for the requested operation to complete. The default value for
19757// this parameter is 60 seconds.
19758func (client BaseClient) SuspendApplicationBackup(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) {
19759	if tracing.IsEnabled() {
19760		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendApplicationBackup")
19761		defer func() {
19762			sc := -1
19763			if result.Response != nil {
19764				sc = result.Response.StatusCode
19765			}
19766			tracing.EndSpan(ctx, sc, err)
19767		}()
19768	}
19769	if err := validation.Validate([]validation.Validation{
19770		{TargetValue: timeout,
19771			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19772				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19773					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19774				}}}}}); err != nil {
19775		return result, validation.NewError("servicefabric.BaseClient", "SuspendApplicationBackup", err.Error())
19776	}
19777
19778	req, err := client.SuspendApplicationBackupPreparer(ctx, applicationID, timeout)
19779	if err != nil {
19780		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", nil, "Failure preparing request")
19781		return
19782	}
19783
19784	resp, err := client.SuspendApplicationBackupSender(req)
19785	if err != nil {
19786		result.Response = resp
19787		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", resp, "Failure sending request")
19788		return
19789	}
19790
19791	result, err = client.SuspendApplicationBackupResponder(resp)
19792	if err != nil {
19793		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", resp, "Failure responding to request")
19794		return
19795	}
19796
19797	return
19798}
19799
19800// SuspendApplicationBackupPreparer prepares the SuspendApplicationBackup request.
19801func (client BaseClient) SuspendApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
19802	pathParameters := map[string]interface{}{
19803		"applicationId": applicationID,
19804	}
19805
19806	const APIVersion = "6.2-preview"
19807	queryParameters := map[string]interface{}{
19808		"api-version": APIVersion,
19809	}
19810	if timeout != nil {
19811		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19812	} else {
19813		queryParameters["timeout"] = autorest.Encode("query", 60)
19814	}
19815
19816	preparer := autorest.CreatePreparer(
19817		autorest.AsPost(),
19818		autorest.WithBaseURL(client.BaseURI),
19819		autorest.WithPathParameters("/Applications/{applicationId}/$/SuspendBackup", pathParameters),
19820		autorest.WithQueryParameters(queryParameters))
19821	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19822}
19823
19824// SuspendApplicationBackupSender sends the SuspendApplicationBackup request. The method will close the
19825// http.Response Body if it receives an error.
19826func (client BaseClient) SuspendApplicationBackupSender(req *http.Request) (*http.Response, error) {
19827	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19828}
19829
19830// SuspendApplicationBackupResponder handles the response to the SuspendApplicationBackup request. The method always
19831// closes the http.Response Body.
19832func (client BaseClient) SuspendApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) {
19833	err = autorest.Respond(
19834		resp,
19835		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19836		autorest.ByClosing())
19837	result.Response = resp
19838	return
19839}
19840
19841// SuspendPartitionBackup the partition which is configured to take periodic backups, is suspended for taking further
19842// backups till it is resumed again.
19843// Parameters:
19844// partitionID - the identity of the partition.
19845// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19846// duration that the client is willing to wait for the requested operation to complete. The default value for
19847// this parameter is 60 seconds.
19848func (client BaseClient) SuspendPartitionBackup(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
19849	if tracing.IsEnabled() {
19850		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendPartitionBackup")
19851		defer func() {
19852			sc := -1
19853			if result.Response != nil {
19854				sc = result.Response.StatusCode
19855			}
19856			tracing.EndSpan(ctx, sc, err)
19857		}()
19858	}
19859	if err := validation.Validate([]validation.Validation{
19860		{TargetValue: timeout,
19861			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19862				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19863					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19864				}}}}}); err != nil {
19865		return result, validation.NewError("servicefabric.BaseClient", "SuspendPartitionBackup", err.Error())
19866	}
19867
19868	req, err := client.SuspendPartitionBackupPreparer(ctx, partitionID, timeout)
19869	if err != nil {
19870		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", nil, "Failure preparing request")
19871		return
19872	}
19873
19874	resp, err := client.SuspendPartitionBackupSender(req)
19875	if err != nil {
19876		result.Response = resp
19877		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", resp, "Failure sending request")
19878		return
19879	}
19880
19881	result, err = client.SuspendPartitionBackupResponder(resp)
19882	if err != nil {
19883		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", resp, "Failure responding to request")
19884		return
19885	}
19886
19887	return
19888}
19889
19890// SuspendPartitionBackupPreparer prepares the SuspendPartitionBackup request.
19891func (client BaseClient) SuspendPartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
19892	pathParameters := map[string]interface{}{
19893		"partitionId": partitionID,
19894	}
19895
19896	const APIVersion = "6.2-preview"
19897	queryParameters := map[string]interface{}{
19898		"api-version": APIVersion,
19899	}
19900	if timeout != nil {
19901		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19902	} else {
19903		queryParameters["timeout"] = autorest.Encode("query", 60)
19904	}
19905
19906	preparer := autorest.CreatePreparer(
19907		autorest.AsPost(),
19908		autorest.WithBaseURL(client.BaseURI),
19909		autorest.WithPathParameters("/Partitions/{partitionId}/$/SuspendBackup", pathParameters),
19910		autorest.WithQueryParameters(queryParameters))
19911	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19912}
19913
19914// SuspendPartitionBackupSender sends the SuspendPartitionBackup request. The method will close the
19915// http.Response Body if it receives an error.
19916func (client BaseClient) SuspendPartitionBackupSender(req *http.Request) (*http.Response, error) {
19917	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19918}
19919
19920// SuspendPartitionBackupResponder handles the response to the SuspendPartitionBackup request. The method always
19921// closes the http.Response Body.
19922func (client BaseClient) SuspendPartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) {
19923	err = autorest.Respond(
19924		resp,
19925		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19926		autorest.ByClosing())
19927	result.Response = resp
19928	return
19929}
19930
19931// SuspendServiceBackup the service which is configured to take periodic backups, is suspended for taking further
19932// backups till it is resumed again. This operation applies to the entire service's hierarchy. It means all the
19933// partitions under this service are now suspended for backup.
19934// Parameters:
19935// serviceID - the identity of the service. This ID is typically the full name of the service without the
19936// 'fabric:' URI scheme.
19937// Starting from version 6.0, hierarchical names are delimited with the "~" character.
19938// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
19939// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
19940// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19941// duration that the client is willing to wait for the requested operation to complete. The default value for
19942// this parameter is 60 seconds.
19943func (client BaseClient) SuspendServiceBackup(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) {
19944	if tracing.IsEnabled() {
19945		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendServiceBackup")
19946		defer func() {
19947			sc := -1
19948			if result.Response != nil {
19949				sc = result.Response.StatusCode
19950			}
19951			tracing.EndSpan(ctx, sc, err)
19952		}()
19953	}
19954	if err := validation.Validate([]validation.Validation{
19955		{TargetValue: timeout,
19956			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19957				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19958					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19959				}}}}}); err != nil {
19960		return result, validation.NewError("servicefabric.BaseClient", "SuspendServiceBackup", err.Error())
19961	}
19962
19963	req, err := client.SuspendServiceBackupPreparer(ctx, serviceID, timeout)
19964	if err != nil {
19965		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", nil, "Failure preparing request")
19966		return
19967	}
19968
19969	resp, err := client.SuspendServiceBackupSender(req)
19970	if err != nil {
19971		result.Response = resp
19972		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", resp, "Failure sending request")
19973		return
19974	}
19975
19976	result, err = client.SuspendServiceBackupResponder(resp)
19977	if err != nil {
19978		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", resp, "Failure responding to request")
19979		return
19980	}
19981
19982	return
19983}
19984
19985// SuspendServiceBackupPreparer prepares the SuspendServiceBackup request.
19986func (client BaseClient) SuspendServiceBackupPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
19987	pathParameters := map[string]interface{}{
19988		"serviceId": serviceID,
19989	}
19990
19991	const APIVersion = "6.2-preview"
19992	queryParameters := map[string]interface{}{
19993		"api-version": APIVersion,
19994	}
19995	if timeout != nil {
19996		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19997	} else {
19998		queryParameters["timeout"] = autorest.Encode("query", 60)
19999	}
20000
20001	preparer := autorest.CreatePreparer(
20002		autorest.AsPost(),
20003		autorest.WithBaseURL(client.BaseURI),
20004		autorest.WithPathParameters("/Services/{serviceId}/$/SuspendBackup", pathParameters),
20005		autorest.WithQueryParameters(queryParameters))
20006	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20007}
20008
20009// SuspendServiceBackupSender sends the SuspendServiceBackup request. The method will close the
20010// http.Response Body if it receives an error.
20011func (client BaseClient) SuspendServiceBackupSender(req *http.Request) (*http.Response, error) {
20012	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20013}
20014
20015// SuspendServiceBackupResponder handles the response to the SuspendServiceBackup request. The method always
20016// closes the http.Response Body.
20017func (client BaseClient) SuspendServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) {
20018	err = autorest.Respond(
20019		resp,
20020		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
20021		autorest.ByClosing())
20022	result.Response = resp
20023	return
20024}
20025
20026// UnprovisionApplicationType this operation can only be performed if all application instances of the application type
20027// have been deleted. Once the application type is unregistered, no new application instances can be created for this
20028// particular application type.
20029// Parameters:
20030// applicationTypeName - the name of the application type.
20031// unprovisionApplicationTypeDescriptionInfo - the relative path for the application package in the image store
20032// specified during the prior copy operation.
20033// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
20034// duration that the client is willing to wait for the requested operation to complete. The default value for
20035// this parameter is 60 seconds.
20036func (client BaseClient) UnprovisionApplicationType(ctx context.Context, applicationTypeName string, unprovisionApplicationTypeDescriptionInfo UnprovisionApplicationTypeDescriptionInfo, timeout *int64) (result autorest.Response, err error) {
20037	if tracing.IsEnabled() {
20038		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UnprovisionApplicationType")
20039		defer func() {
20040			sc := -1
20041			if result.Response != nil {
20042				sc = result.Response.StatusCode
20043			}
20044			tracing.EndSpan(ctx, sc, err)
20045		}()
20046	}
20047	if err := validation.Validate([]validation.Validation{
20048		{TargetValue: unprovisionApplicationTypeDescriptionInfo,
20049			Constraints: []validation.Constraint{{Target: "unprovisionApplicationTypeDescriptionInfo.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}}},
20050		{TargetValue: timeout,
20051			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
20052				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
20053					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
20054				}}}}}); err != nil {
20055		return result, validation.NewError("servicefabric.BaseClient", "UnprovisionApplicationType", err.Error())
20056	}
20057
20058	req, err := client.UnprovisionApplicationTypePreparer(ctx, applicationTypeName, unprovisionApplicationTypeDescriptionInfo, timeout)
20059	if err != nil {
20060		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", nil, "Failure preparing request")
20061		return
20062	}
20063
20064	resp, err := client.UnprovisionApplicationTypeSender(req)
20065	if err != nil {
20066		result.Response = resp
20067		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", resp, "Failure sending request")
20068		return
20069	}
20070
20071	result, err = client.UnprovisionApplicationTypeResponder(resp)
20072	if err != nil {
20073		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", resp, "Failure responding to request")
20074		return
20075	}
20076
20077	return
20078}
20079
20080// UnprovisionApplicationTypePreparer prepares the UnprovisionApplicationType request.
20081func (client BaseClient) UnprovisionApplicationTypePreparer(ctx context.Context, applicationTypeName string, unprovisionApplicationTypeDescriptionInfo UnprovisionApplicationTypeDescriptionInfo, timeout *int64) (*http.Request, error) {
20082	pathParameters := map[string]interface{}{
20083		"applicationTypeName": autorest.Encode("path", applicationTypeName),
20084	}
20085
20086	const APIVersion = "6.0"
20087	queryParameters := map[string]interface{}{
20088		"api-version": APIVersion,
20089	}
20090	if timeout != nil {
20091		queryParameters["timeout"] = autorest.Encode("query", *timeout)
20092	} else {
20093		queryParameters["timeout"] = autorest.Encode("query", 60)
20094	}
20095
20096	preparer := autorest.CreatePreparer(
20097		autorest.AsContentType("application/json; charset=utf-8"),
20098		autorest.AsPost(),
20099		autorest.WithBaseURL(client.BaseURI),
20100		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/Unprovision", pathParameters),
20101		autorest.WithJSON(unprovisionApplicationTypeDescriptionInfo),
20102		autorest.WithQueryParameters(queryParameters))
20103	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20104}
20105
20106// UnprovisionApplicationTypeSender sends the UnprovisionApplicationType request. The method will close the
20107// http.Response Body if it receives an error.
20108func (client BaseClient) UnprovisionApplicationTypeSender(req *http.Request) (*http.Response, error) {
20109	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20110}
20111
20112// UnprovisionApplicationTypeResponder handles the response to the UnprovisionApplicationType request. The method always
20113// closes the http.Response Body.
20114func (client BaseClient) UnprovisionApplicationTypeResponder(resp *http.Response) (result autorest.Response, err error) {
20115	err = autorest.Respond(
20116		resp,
20117		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
20118		autorest.ByClosing())
20119	result.Response = resp
20120	return
20121}
20122
20123// UnprovisionCluster it is supported to unprovision code and configuration separately.
20124// Parameters:
20125// unprovisionFabricDescription - describes the parameters for unprovisioning a cluster.
20126// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
20127// duration that the client is willing to wait for the requested operation to complete. The default value for
20128// this parameter is 60 seconds.
20129func (client BaseClient) UnprovisionCluster(ctx context.Context, unprovisionFabricDescription UnprovisionFabricDescription, timeout *int64) (result autorest.Response, err error) {
20130	if tracing.IsEnabled() {
20131		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UnprovisionCluster")
20132		defer func() {
20133			sc := -1
20134			if result.Response != nil {
20135				sc = result.Response.StatusCode
20136			}
20137			tracing.EndSpan(ctx, sc, err)
20138		}()
20139	}
20140	if err := validation.Validate([]validation.Validation{
20141		{TargetValue: timeout,
20142			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
20143				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
20144					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
20145				}}}}}); err != nil {
20146		return result, validation.NewError("servicefabric.BaseClient", "UnprovisionCluster", err.Error())
20147	}
20148
20149	req, err := client.UnprovisionClusterPreparer(ctx, unprovisionFabricDescription, timeout)
20150	if err != nil {
20151		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", nil, "Failure preparing request")
20152		return
20153	}
20154
20155	resp, err := client.UnprovisionClusterSender(req)
20156	if err != nil {
20157		result.Response = resp
20158		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", resp, "Failure sending request")
20159		return
20160	}
20161
20162	result, err = client.UnprovisionClusterResponder(resp)
20163	if err != nil {
20164		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", resp, "Failure responding to request")
20165		return
20166	}
20167
20168	return
20169}
20170
20171// UnprovisionClusterPreparer prepares the UnprovisionCluster request.
20172func (client BaseClient) UnprovisionClusterPreparer(ctx context.Context, unprovisionFabricDescription UnprovisionFabricDescription, timeout *int64) (*http.Request, error) {
20173	const APIVersion = "6.0"
20174	queryParameters := map[string]interface{}{
20175		"api-version": APIVersion,
20176	}
20177	if timeout != nil {
20178		queryParameters["timeout"] = autorest.Encode("query", *timeout)
20179	} else {
20180		queryParameters["timeout"] = autorest.Encode("query", 60)
20181	}
20182
20183	preparer := autorest.CreatePreparer(
20184		autorest.AsContentType("application/json; charset=utf-8"),
20185		autorest.AsPost(),
20186		autorest.WithBaseURL(client.BaseURI),
20187		autorest.WithPath("/$/Unprovision"),
20188		autorest.WithJSON(unprovisionFabricDescription),
20189		autorest.WithQueryParameters(queryParameters))
20190	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20191}
20192
20193// UnprovisionClusterSender sends the UnprovisionCluster request. The method will close the
20194// http.Response Body if it receives an error.
20195func (client BaseClient) UnprovisionClusterSender(req *http.Request) (*http.Response, error) {
20196	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20197}
20198
20199// UnprovisionClusterResponder handles the response to the UnprovisionCluster request. The method always
20200// closes the http.Response Body.
20201func (client BaseClient) UnprovisionClusterResponder(resp *http.Response) (result autorest.Response, err error) {
20202	err = autorest.Respond(
20203		resp,
20204		azure.WithErrorUnlessStatusCode(http.StatusOK),
20205		autorest.ByClosing())
20206	result.Response = resp
20207	return
20208}
20209
20210// UpdateApplicationUpgrade updates the parameters of an ongoing application upgrade from the ones specified at the
20211// time of starting the application upgrade. This may be required to mitigate stuck application upgrades due to
20212// incorrect parameters or issues in the application to make progress.
20213// Parameters:
20214// applicationID - the identity of the application. This is typically the full name of the application without
20215// the 'fabric:' URI scheme.
20216// Starting from version 6.0, hierarchical names are delimited with the "~" character.
20217// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
20218// in 6.0+ and "myapp/app1" in previous versions.
20219// applicationUpgradeUpdateDescription - parameters for updating an existing application upgrade.
20220// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
20221// duration that the client is willing to wait for the requested operation to complete. The default value for
20222// this parameter is 60 seconds.
20223func (client BaseClient) UpdateApplicationUpgrade(ctx context.Context, applicationID string, applicationUpgradeUpdateDescription ApplicationUpgradeUpdateDescription, timeout *int64) (result autorest.Response, err error) {
20224	if tracing.IsEnabled() {
20225		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateApplicationUpgrade")
20226		defer func() {
20227			sc := -1
20228			if result.Response != nil {
20229				sc = result.Response.StatusCode
20230			}
20231			tracing.EndSpan(ctx, sc, err)
20232		}()
20233	}
20234	if err := validation.Validate([]validation.Validation{
20235		{TargetValue: applicationUpgradeUpdateDescription,
20236			Constraints: []validation.Constraint{{Target: "applicationUpgradeUpdateDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}},
20237		{TargetValue: timeout,
20238			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
20239				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
20240					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
20241				}}}}}); err != nil {
20242		return result, validation.NewError("servicefabric.BaseClient", "UpdateApplicationUpgrade", err.Error())
20243	}
20244
20245	req, err := client.UpdateApplicationUpgradePreparer(ctx, applicationID, applicationUpgradeUpdateDescription, timeout)
20246	if err != nil {
20247		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", nil, "Failure preparing request")
20248		return
20249	}
20250
20251	resp, err := client.UpdateApplicationUpgradeSender(req)
20252	if err != nil {
20253		result.Response = resp
20254		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", resp, "Failure sending request")
20255		return
20256	}
20257
20258	result, err = client.UpdateApplicationUpgradeResponder(resp)
20259	if err != nil {
20260		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", resp, "Failure responding to request")
20261		return
20262	}
20263
20264	return
20265}
20266
20267// UpdateApplicationUpgradePreparer prepares the UpdateApplicationUpgrade request.
20268func (client BaseClient) UpdateApplicationUpgradePreparer(ctx context.Context, applicationID string, applicationUpgradeUpdateDescription ApplicationUpgradeUpdateDescription, timeout *int64) (*http.Request, error) {
20269	pathParameters := map[string]interface{}{
20270		"applicationId": applicationID,
20271	}
20272
20273	const APIVersion = "6.0"
20274	queryParameters := map[string]interface{}{
20275		"api-version": APIVersion,
20276	}
20277	if timeout != nil {
20278		queryParameters["timeout"] = autorest.Encode("query", *timeout)
20279	} else {
20280		queryParameters["timeout"] = autorest.Encode("query", 60)
20281	}
20282
20283	preparer := autorest.CreatePreparer(
20284		autorest.AsContentType("application/json; charset=utf-8"),
20285		autorest.AsPost(),
20286		autorest.WithBaseURL(client.BaseURI),
20287		autorest.WithPathParameters("/Applications/{applicationId}/$/UpdateUpgrade", pathParameters),
20288		autorest.WithJSON(applicationUpgradeUpdateDescription),
20289		autorest.WithQueryParameters(queryParameters))
20290	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20291}
20292
20293// UpdateApplicationUpgradeSender sends the UpdateApplicationUpgrade request. The method will close the
20294// http.Response Body if it receives an error.
20295func (client BaseClient) UpdateApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
20296	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20297}
20298
20299// UpdateApplicationUpgradeResponder handles the response to the UpdateApplicationUpgrade request. The method always
20300// closes the http.Response Body.
20301func (client BaseClient) UpdateApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
20302	err = autorest.Respond(
20303		resp,
20304		azure.WithErrorUnlessStatusCode(http.StatusOK),
20305		autorest.ByClosing())
20306	result.Response = resp
20307	return
20308}
20309
20310// UpdateBackupPolicy updates the backup policy identified by {backupPolicyName}
20311// Parameters:
20312// backupPolicyDescription - describes the backup policy.
20313// backupPolicyName - the name of the backup policy.
20314// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
20315// duration that the client is willing to wait for the requested operation to complete. The default value for
20316// this parameter is 60 seconds.
20317func (client BaseClient) UpdateBackupPolicy(ctx context.Context, backupPolicyDescription BackupPolicyDescription, backupPolicyName string, timeout *int64) (result autorest.Response, err error) {
20318	if tracing.IsEnabled() {
20319		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateBackupPolicy")
20320		defer func() {
20321			sc := -1
20322			if result.Response != nil {
20323				sc = result.Response.StatusCode
20324			}
20325			tracing.EndSpan(ctx, sc, err)
20326		}()
20327	}
20328	if err := validation.Validate([]validation.Validation{
20329		{TargetValue: backupPolicyDescription,
20330			Constraints: []validation.Constraint{{Target: "backupPolicyDescription.Name", Name: validation.Null, Rule: true, Chain: nil},
20331				{Target: "backupPolicyDescription.AutoRestoreOnDataLoss", Name: validation.Null, Rule: true, Chain: nil},
20332				{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.Null, Rule: true,
20333					Chain: []validation.Constraint{{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMaximum, Rule: int64(255), Chain: nil},
20334						{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
20335					}}}},
20336		{TargetValue: timeout,
20337			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
20338				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
20339					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
20340				}}}}}); err != nil {
20341		return result, validation.NewError("servicefabric.BaseClient", "UpdateBackupPolicy", err.Error())
20342	}
20343
20344	req, err := client.UpdateBackupPolicyPreparer(ctx, backupPolicyDescription, backupPolicyName, timeout)
20345	if err != nil {
20346		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", nil, "Failure preparing request")
20347		return
20348	}
20349
20350	resp, err := client.UpdateBackupPolicySender(req)
20351	if err != nil {
20352		result.Response = resp
20353		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", resp, "Failure sending request")
20354		return
20355	}
20356
20357	result, err = client.UpdateBackupPolicyResponder(resp)
20358	if err != nil {
20359		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", resp, "Failure responding to request")
20360		return
20361	}
20362
20363	return
20364}
20365
20366// UpdateBackupPolicyPreparer prepares the UpdateBackupPolicy request.
20367func (client BaseClient) UpdateBackupPolicyPreparer(ctx context.Context, backupPolicyDescription BackupPolicyDescription, backupPolicyName string, timeout *int64) (*http.Request, error) {
20368	pathParameters := map[string]interface{}{
20369		"backupPolicyName": autorest.Encode("path", backupPolicyName),
20370	}
20371
20372	const APIVersion = "6.2-preview"
20373	queryParameters := map[string]interface{}{
20374		"api-version": APIVersion,
20375	}
20376	if timeout != nil {
20377		queryParameters["timeout"] = autorest.Encode("query", *timeout)
20378	} else {
20379		queryParameters["timeout"] = autorest.Encode("query", 60)
20380	}
20381
20382	preparer := autorest.CreatePreparer(
20383		autorest.AsContentType("application/json; charset=utf-8"),
20384		autorest.AsPost(),
20385		autorest.WithBaseURL(client.BaseURI),
20386		autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/Update", pathParameters),
20387		autorest.WithJSON(backupPolicyDescription),
20388		autorest.WithQueryParameters(queryParameters))
20389	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20390}
20391
20392// UpdateBackupPolicySender sends the UpdateBackupPolicy request. The method will close the
20393// http.Response Body if it receives an error.
20394func (client BaseClient) UpdateBackupPolicySender(req *http.Request) (*http.Response, error) {
20395	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20396}
20397
20398// UpdateBackupPolicyResponder handles the response to the UpdateBackupPolicy request. The method always
20399// closes the http.Response Body.
20400func (client BaseClient) UpdateBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
20401	err = autorest.Respond(
20402		resp,
20403		azure.WithErrorUnlessStatusCode(http.StatusOK),
20404		autorest.ByClosing())
20405	result.Response = resp
20406	return
20407}
20408
20409// UpdateClusterUpgrade update the upgrade parameters used during a Service Fabric cluster upgrade.
20410// Parameters:
20411// updateClusterUpgradeDescription - parameters for updating a cluster upgrade.
20412// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
20413// duration that the client is willing to wait for the requested operation to complete. The default value for
20414// this parameter is 60 seconds.
20415func (client BaseClient) UpdateClusterUpgrade(ctx context.Context, updateClusterUpgradeDescription UpdateClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
20416	if tracing.IsEnabled() {
20417		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateClusterUpgrade")
20418		defer func() {
20419			sc := -1
20420			if result.Response != nil {
20421				sc = result.Response.StatusCode
20422			}
20423			tracing.EndSpan(ctx, sc, err)
20424		}()
20425	}
20426	if err := validation.Validate([]validation.Validation{
20427		{TargetValue: updateClusterUpgradeDescription,
20428			Constraints: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false,
20429				Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false,
20430					Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
20431						{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
20432					}},
20433					{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false,
20434						Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
20435							{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
20436						}},
20437				}}}},
20438		{TargetValue: timeout,
20439			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
20440				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
20441					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
20442				}}}}}); err != nil {
20443		return result, validation.NewError("servicefabric.BaseClient", "UpdateClusterUpgrade", err.Error())
20444	}
20445
20446	req, err := client.UpdateClusterUpgradePreparer(ctx, updateClusterUpgradeDescription, timeout)
20447	if err != nil {
20448		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", nil, "Failure preparing request")
20449		return
20450	}
20451
20452	resp, err := client.UpdateClusterUpgradeSender(req)
20453	if err != nil {
20454		result.Response = resp
20455		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", resp, "Failure sending request")
20456		return
20457	}
20458
20459	result, err = client.UpdateClusterUpgradeResponder(resp)
20460	if err != nil {
20461		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", resp, "Failure responding to request")
20462		return
20463	}
20464
20465	return
20466}
20467
20468// UpdateClusterUpgradePreparer prepares the UpdateClusterUpgrade request.
20469func (client BaseClient) UpdateClusterUpgradePreparer(ctx context.Context, updateClusterUpgradeDescription UpdateClusterUpgradeDescription, timeout *int64) (*http.Request, error) {
20470	const APIVersion = "6.0"
20471	queryParameters := map[string]interface{}{
20472		"api-version": APIVersion,
20473	}
20474	if timeout != nil {
20475		queryParameters["timeout"] = autorest.Encode("query", *timeout)
20476	} else {
20477		queryParameters["timeout"] = autorest.Encode("query", 60)
20478	}
20479
20480	preparer := autorest.CreatePreparer(
20481		autorest.AsContentType("application/json; charset=utf-8"),
20482		autorest.AsPost(),
20483		autorest.WithBaseURL(client.BaseURI),
20484		autorest.WithPath("/$/UpdateUpgrade"),
20485		autorest.WithJSON(updateClusterUpgradeDescription),
20486		autorest.WithQueryParameters(queryParameters))
20487	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20488}
20489
20490// UpdateClusterUpgradeSender sends the UpdateClusterUpgrade request. The method will close the
20491// http.Response Body if it receives an error.
20492func (client BaseClient) UpdateClusterUpgradeSender(req *http.Request) (*http.Response, error) {
20493	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20494}
20495
20496// UpdateClusterUpgradeResponder handles the response to the UpdateClusterUpgrade request. The method always
20497// closes the http.Response Body.
20498func (client BaseClient) UpdateClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
20499	err = autorest.Respond(
20500		resp,
20501		azure.WithErrorUnlessStatusCode(http.StatusOK),
20502		autorest.ByClosing())
20503	result.Response = resp
20504	return
20505}
20506
20507// UpdateRepairExecutionState this API supports the Service Fabric platform; it is not meant to be used directly from
20508// your code.
20509// Parameters:
20510// repairTask - describes the repair task to be created or updated.
20511func (client BaseClient) UpdateRepairExecutionState(ctx context.Context, repairTask RepairTask) (result RepairTaskUpdateInfo, err error) {
20512	if tracing.IsEnabled() {
20513		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateRepairExecutionState")
20514		defer func() {
20515			sc := -1
20516			if result.Response.Response != nil {
20517				sc = result.Response.Response.StatusCode
20518			}
20519			tracing.EndSpan(ctx, sc, err)
20520		}()
20521	}
20522	if err := validation.Validate([]validation.Validation{
20523		{TargetValue: repairTask,
20524			Constraints: []validation.Constraint{{Target: "repairTask.TaskID", Name: validation.Null, Rule: true, Chain: nil},
20525				{Target: "repairTask.Action", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
20526		return result, validation.NewError("servicefabric.BaseClient", "UpdateRepairExecutionState", err.Error())
20527	}
20528
20529	req, err := client.UpdateRepairExecutionStatePreparer(ctx, repairTask)
20530	if err != nil {
20531		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", nil, "Failure preparing request")
20532		return
20533	}
20534
20535	resp, err := client.UpdateRepairExecutionStateSender(req)
20536	if err != nil {
20537		result.Response = autorest.Response{Response: resp}
20538		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", resp, "Failure sending request")
20539		return
20540	}
20541
20542	result, err = client.UpdateRepairExecutionStateResponder(resp)
20543	if err != nil {
20544		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", resp, "Failure responding to request")
20545		return
20546	}
20547
20548	return
20549}
20550
20551// UpdateRepairExecutionStatePreparer prepares the UpdateRepairExecutionState request.
20552func (client BaseClient) UpdateRepairExecutionStatePreparer(ctx context.Context, repairTask RepairTask) (*http.Request, error) {
20553	const APIVersion = "6.0"
20554	queryParameters := map[string]interface{}{
20555		"api-version": APIVersion,
20556	}
20557
20558	preparer := autorest.CreatePreparer(
20559		autorest.AsContentType("application/json; charset=utf-8"),
20560		autorest.AsPost(),
20561		autorest.WithBaseURL(client.BaseURI),
20562		autorest.WithPath("/$/UpdateRepairExecutionState"),
20563		autorest.WithJSON(repairTask),
20564		autorest.WithQueryParameters(queryParameters))
20565	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20566}
20567
20568// UpdateRepairExecutionStateSender sends the UpdateRepairExecutionState request. The method will close the
20569// http.Response Body if it receives an error.
20570func (client BaseClient) UpdateRepairExecutionStateSender(req *http.Request) (*http.Response, error) {
20571	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20572}
20573
20574// UpdateRepairExecutionStateResponder handles the response to the UpdateRepairExecutionState request. The method always
20575// closes the http.Response Body.
20576func (client BaseClient) UpdateRepairExecutionStateResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
20577	err = autorest.Respond(
20578		resp,
20579		azure.WithErrorUnlessStatusCode(http.StatusOK),
20580		autorest.ByUnmarshallingJSON(&result),
20581		autorest.ByClosing())
20582	result.Response = autorest.Response{Response: resp}
20583	return
20584}
20585
20586// UpdateRepairTaskHealthPolicy this API supports the Service Fabric platform; it is not meant to be used directly from
20587// your code.
20588// Parameters:
20589// repairTaskUpdateHealthPolicyDescription - describes the repair task healthy policy to be updated.
20590func (client BaseClient) UpdateRepairTaskHealthPolicy(ctx context.Context, repairTaskUpdateHealthPolicyDescription RepairTaskUpdateHealthPolicyDescription) (result RepairTaskUpdateInfo, err error) {
20591	if tracing.IsEnabled() {
20592		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateRepairTaskHealthPolicy")
20593		defer func() {
20594			sc := -1
20595			if result.Response.Response != nil {
20596				sc = result.Response.Response.StatusCode
20597			}
20598			tracing.EndSpan(ctx, sc, err)
20599		}()
20600	}
20601	if err := validation.Validate([]validation.Validation{
20602		{TargetValue: repairTaskUpdateHealthPolicyDescription,
20603			Constraints: []validation.Constraint{{Target: "repairTaskUpdateHealthPolicyDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
20604		return result, validation.NewError("servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", err.Error())
20605	}
20606
20607	req, err := client.UpdateRepairTaskHealthPolicyPreparer(ctx, repairTaskUpdateHealthPolicyDescription)
20608	if err != nil {
20609		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", nil, "Failure preparing request")
20610		return
20611	}
20612
20613	resp, err := client.UpdateRepairTaskHealthPolicySender(req)
20614	if err != nil {
20615		result.Response = autorest.Response{Response: resp}
20616		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", resp, "Failure sending request")
20617		return
20618	}
20619
20620	result, err = client.UpdateRepairTaskHealthPolicyResponder(resp)
20621	if err != nil {
20622		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", resp, "Failure responding to request")
20623		return
20624	}
20625
20626	return
20627}
20628
20629// UpdateRepairTaskHealthPolicyPreparer prepares the UpdateRepairTaskHealthPolicy request.
20630func (client BaseClient) UpdateRepairTaskHealthPolicyPreparer(ctx context.Context, repairTaskUpdateHealthPolicyDescription RepairTaskUpdateHealthPolicyDescription) (*http.Request, error) {
20631	const APIVersion = "6.0"
20632	queryParameters := map[string]interface{}{
20633		"api-version": APIVersion,
20634	}
20635
20636	preparer := autorest.CreatePreparer(
20637		autorest.AsContentType("application/json; charset=utf-8"),
20638		autorest.AsPost(),
20639		autorest.WithBaseURL(client.BaseURI),
20640		autorest.WithPath("/$/UpdateRepairTaskHealthPolicy"),
20641		autorest.WithJSON(repairTaskUpdateHealthPolicyDescription),
20642		autorest.WithQueryParameters(queryParameters))
20643	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20644}
20645
20646// UpdateRepairTaskHealthPolicySender sends the UpdateRepairTaskHealthPolicy request. The method will close the
20647// http.Response Body if it receives an error.
20648func (client BaseClient) UpdateRepairTaskHealthPolicySender(req *http.Request) (*http.Response, error) {
20649	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20650}
20651
20652// UpdateRepairTaskHealthPolicyResponder handles the response to the UpdateRepairTaskHealthPolicy request. The method always
20653// closes the http.Response Body.
20654func (client BaseClient) UpdateRepairTaskHealthPolicyResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
20655	err = autorest.Respond(
20656		resp,
20657		azure.WithErrorUnlessStatusCode(http.StatusOK),
20658		autorest.ByUnmarshallingJSON(&result),
20659		autorest.ByClosing())
20660	result.Response = autorest.Response{Response: resp}
20661	return
20662}
20663
20664// UpdateService this API allows updating properties of a running Service Fabric service. The set of properties that
20665// can be updated are a subset of the properties that were specified at the time of creating the service. The current
20666// set of properties can be obtained using `GetServiceDescription` API. Note that updating the properties of a running
20667// service is different than upgrading your application using `StartApplicationUpgrade` API. The upgrade is a long
20668// running background operation that involves moving the application from one version to another, one upgrade domain at
20669// a time, whereas update applies the new properties immediately to the service.
20670// Parameters:
20671// serviceID - the identity of the service. This ID is typically the full name of the service without the
20672// 'fabric:' URI scheme.
20673// Starting from version 6.0, hierarchical names are delimited with the "~" character.
20674// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
20675// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
20676// serviceUpdateDescription - the information necessary to update a service.
20677// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
20678// duration that the client is willing to wait for the requested operation to complete. The default value for
20679// this parameter is 60 seconds.
20680func (client BaseClient) UpdateService(ctx context.Context, serviceID string, serviceUpdateDescription BasicServiceUpdateDescription, timeout *int64) (result autorest.Response, err error) {
20681	if tracing.IsEnabled() {
20682		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateService")
20683		defer func() {
20684			sc := -1
20685			if result.Response != nil {
20686				sc = result.Response.StatusCode
20687			}
20688			tracing.EndSpan(ctx, sc, err)
20689		}()
20690	}
20691	if err := validation.Validate([]validation.Validation{
20692		{TargetValue: timeout,
20693			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
20694				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
20695					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
20696				}}}}}); err != nil {
20697		return result, validation.NewError("servicefabric.BaseClient", "UpdateService", err.Error())
20698	}
20699
20700	req, err := client.UpdateServicePreparer(ctx, serviceID, serviceUpdateDescription, timeout)
20701	if err != nil {
20702		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", nil, "Failure preparing request")
20703		return
20704	}
20705
20706	resp, err := client.UpdateServiceSender(req)
20707	if err != nil {
20708		result.Response = resp
20709		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", resp, "Failure sending request")
20710		return
20711	}
20712
20713	result, err = client.UpdateServiceResponder(resp)
20714	if err != nil {
20715		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", resp, "Failure responding to request")
20716		return
20717	}
20718
20719	return
20720}
20721
20722// UpdateServicePreparer prepares the UpdateService request.
20723func (client BaseClient) UpdateServicePreparer(ctx context.Context, serviceID string, serviceUpdateDescription BasicServiceUpdateDescription, timeout *int64) (*http.Request, error) {
20724	pathParameters := map[string]interface{}{
20725		"serviceId": serviceID,
20726	}
20727
20728	const APIVersion = "6.0"
20729	queryParameters := map[string]interface{}{
20730		"api-version": APIVersion,
20731	}
20732	if timeout != nil {
20733		queryParameters["timeout"] = autorest.Encode("query", *timeout)
20734	} else {
20735		queryParameters["timeout"] = autorest.Encode("query", 60)
20736	}
20737
20738	preparer := autorest.CreatePreparer(
20739		autorest.AsContentType("application/json; charset=utf-8"),
20740		autorest.AsPost(),
20741		autorest.WithBaseURL(client.BaseURI),
20742		autorest.WithPathParameters("/Services/{serviceId}/$/Update", pathParameters),
20743		autorest.WithJSON(serviceUpdateDescription),
20744		autorest.WithQueryParameters(queryParameters))
20745	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20746}
20747
20748// UpdateServiceSender sends the UpdateService request. The method will close the
20749// http.Response Body if it receives an error.
20750func (client BaseClient) UpdateServiceSender(req *http.Request) (*http.Response, error) {
20751	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20752}
20753
20754// UpdateServiceResponder handles the response to the UpdateService request. The method always
20755// closes the http.Response Body.
20756func (client BaseClient) UpdateServiceResponder(resp *http.Response) (result autorest.Response, err error) {
20757	err = autorest.Respond(
20758		resp,
20759		azure.WithErrorUnlessStatusCode(http.StatusOK),
20760		autorest.ByClosing())
20761	result.Response = resp
20762	return
20763}
20764
20765// UploadFile uploads contents of the file to the image store. Use this API if the file is small enough to upload again
20766// if the connection fails. The file's data needs to be added to the request body. The contents will be uploaded to the
20767// specified path. Image store service uses a mark file to indicate the availability of the folder. The mark file is an
20768// empty file named "_.dir". The mark file is generated by the image store service when all files in a folder are
20769// uploaded. When using File-by-File approach to upload application package in REST, the image store service isn't
20770// aware of the file hierarchy of the application package; you need to create a mark file per folder and upload it
20771// last, to let the image store service know that the folder is complete.
20772// Parameters:
20773// contentPath - relative path to file or folder in the image store from its root.
20774// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
20775// duration that the client is willing to wait for the requested operation to complete. The default value for
20776// this parameter is 60 seconds.
20777func (client BaseClient) UploadFile(ctx context.Context, contentPath string, timeout *int64) (result autorest.Response, err error) {
20778	if tracing.IsEnabled() {
20779		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UploadFile")
20780		defer func() {
20781			sc := -1
20782			if result.Response != nil {
20783				sc = result.Response.StatusCode
20784			}
20785			tracing.EndSpan(ctx, sc, err)
20786		}()
20787	}
20788	if err := validation.Validate([]validation.Validation{
20789		{TargetValue: timeout,
20790			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
20791				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
20792					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
20793				}}}}}); err != nil {
20794		return result, validation.NewError("servicefabric.BaseClient", "UploadFile", err.Error())
20795	}
20796
20797	req, err := client.UploadFilePreparer(ctx, contentPath, timeout)
20798	if err != nil {
20799		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", nil, "Failure preparing request")
20800		return
20801	}
20802
20803	resp, err := client.UploadFileSender(req)
20804	if err != nil {
20805		result.Response = resp
20806		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", resp, "Failure sending request")
20807		return
20808	}
20809
20810	result, err = client.UploadFileResponder(resp)
20811	if err != nil {
20812		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", resp, "Failure responding to request")
20813		return
20814	}
20815
20816	return
20817}
20818
20819// UploadFilePreparer prepares the UploadFile request.
20820func (client BaseClient) UploadFilePreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) {
20821	pathParameters := map[string]interface{}{
20822		"contentPath": autorest.Encode("path", contentPath),
20823	}
20824
20825	const APIVersion = "6.0"
20826	queryParameters := map[string]interface{}{
20827		"api-version": APIVersion,
20828	}
20829	if timeout != nil {
20830		queryParameters["timeout"] = autorest.Encode("query", *timeout)
20831	} else {
20832		queryParameters["timeout"] = autorest.Encode("query", 60)
20833	}
20834
20835	preparer := autorest.CreatePreparer(
20836		autorest.AsPut(),
20837		autorest.WithBaseURL(client.BaseURI),
20838		autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters),
20839		autorest.WithQueryParameters(queryParameters))
20840	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20841}
20842
20843// UploadFileSender sends the UploadFile request. The method will close the
20844// http.Response Body if it receives an error.
20845func (client BaseClient) UploadFileSender(req *http.Request) (*http.Response, error) {
20846	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20847}
20848
20849// UploadFileResponder handles the response to the UploadFile request. The method always
20850// closes the http.Response Body.
20851func (client BaseClient) UploadFileResponder(resp *http.Response) (result autorest.Response, err error) {
20852	err = autorest.Respond(
20853		resp,
20854		azure.WithErrorUnlessStatusCode(http.StatusOK),
20855		autorest.ByClosing())
20856	result.Response = resp
20857	return
20858}
20859
20860// UploadFileChunk uploads a file chunk to the image store with the specified upload session ID and image store
20861// relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file
20862// upload from scratch whenever there is a network interruption. Use this option if the file size is large.
20863//
20864// To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the
20865// image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store
20866// relative path already exists, it will be overwritten when the upload session commits.
20867// Parameters:
20868// contentPath - relative path to file or folder in the image store from its root.
20869// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session
20870// which keeps track of all file chunks until it is committed.
20871// contentRange - when uploading file chunks to the image store, the Content-Range header field need to be
20872// configured and sent with a request. The format should looks like "bytes
20873// {First-Byte-Position}-{Last-Byte-Position}/{File-Length}". For example, Content-Range:bytes 300-5000/20000
20874// indicates that user is sending bytes 300 through 5,000 and the total file length is 20,000 bytes.
20875// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
20876// duration that the client is willing to wait for the requested operation to complete. The default value for
20877// this parameter is 60 seconds.
20878func (client BaseClient) UploadFileChunk(ctx context.Context, contentPath string, sessionID uuid.UUID, contentRange string, timeout *int64) (result autorest.Response, err error) {
20879	if tracing.IsEnabled() {
20880		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UploadFileChunk")
20881		defer func() {
20882			sc := -1
20883			if result.Response != nil {
20884				sc = result.Response.StatusCode
20885			}
20886			tracing.EndSpan(ctx, sc, err)
20887		}()
20888	}
20889	if err := validation.Validate([]validation.Validation{
20890		{TargetValue: timeout,
20891			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
20892				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
20893					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
20894				}}}}}); err != nil {
20895		return result, validation.NewError("servicefabric.BaseClient", "UploadFileChunk", err.Error())
20896	}
20897
20898	req, err := client.UploadFileChunkPreparer(ctx, contentPath, sessionID, contentRange, timeout)
20899	if err != nil {
20900		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", nil, "Failure preparing request")
20901		return
20902	}
20903
20904	resp, err := client.UploadFileChunkSender(req)
20905	if err != nil {
20906		result.Response = resp
20907		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", resp, "Failure sending request")
20908		return
20909	}
20910
20911	result, err = client.UploadFileChunkResponder(resp)
20912	if err != nil {
20913		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", resp, "Failure responding to request")
20914		return
20915	}
20916
20917	return
20918}
20919
20920// UploadFileChunkPreparer prepares the UploadFileChunk request.
20921func (client BaseClient) UploadFileChunkPreparer(ctx context.Context, contentPath string, sessionID uuid.UUID, contentRange string, timeout *int64) (*http.Request, error) {
20922	pathParameters := map[string]interface{}{
20923		"contentPath": autorest.Encode("path", contentPath),
20924	}
20925
20926	const APIVersion = "6.0"
20927	queryParameters := map[string]interface{}{
20928		"api-version": APIVersion,
20929		"session-id":  autorest.Encode("query", sessionID),
20930	}
20931	if timeout != nil {
20932		queryParameters["timeout"] = autorest.Encode("query", *timeout)
20933	} else {
20934		queryParameters["timeout"] = autorest.Encode("query", 60)
20935	}
20936
20937	preparer := autorest.CreatePreparer(
20938		autorest.AsPut(),
20939		autorest.WithBaseURL(client.BaseURI),
20940		autorest.WithPathParameters("/ImageStore/{contentPath}/$/UploadChunk", pathParameters),
20941		autorest.WithQueryParameters(queryParameters),
20942		autorest.WithHeader("Content-Range", autorest.String(contentRange)))
20943	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20944}
20945
20946// UploadFileChunkSender sends the UploadFileChunk request. The method will close the
20947// http.Response Body if it receives an error.
20948func (client BaseClient) UploadFileChunkSender(req *http.Request) (*http.Response, error) {
20949	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20950}
20951
20952// UploadFileChunkResponder handles the response to the UploadFileChunk request. The method always
20953// closes the http.Response Body.
20954func (client BaseClient) UploadFileChunkResponder(resp *http.Response) (result autorest.Response, err error) {
20955	err = autorest.Respond(
20956		resp,
20957		azure.WithErrorUnlessStatusCode(http.StatusOK),
20958		autorest.ByClosing())
20959	result.Response = resp
20960	return
20961}
20962