1// Package servicefabric implements the Azure ARM Servicefabric service API version 6.2.0.9.
2//
3// Service Fabric REST Client APIs allows management of Service Fabric clusters, applications and services.
4package servicefabric
5
6// Copyright (c) Microsoft and contributors.  All rights reserved.
7//
8// Licensed under the Apache License, Version 2.0 (the "License");
9// you may not use this file except in compliance with the License.
10// You may obtain a copy of the License at
11// http://www.apache.org/licenses/LICENSE-2.0
12//
13// Unless required by applicable law or agreed to in writing, software
14// distributed under the License is distributed on an "AS IS" BASIS,
15// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16//
17// See the License for the specific language governing permissions and
18// limitations under the License.
19//
20// Code generated by Microsoft (R) AutoRest Code Generator.
21// Changes may cause incorrect behavior and will be lost if the code is regenerated.
22
23import (
24	"context"
25	"github.com/Azure/go-autorest/autorest"
26	"github.com/Azure/go-autorest/autorest/azure"
27	"github.com/Azure/go-autorest/autorest/date"
28	"github.com/Azure/go-autorest/autorest/validation"
29	"github.com/Azure/go-autorest/tracing"
30	"github.com/satori/go.uuid"
31	"net/http"
32)
33
34const (
35	// DefaultBaseURI is the default URI used for the service Servicefabric
36	DefaultBaseURI = "http://localhost:19080"
37)
38
39// BaseClient is the base client for Servicefabric.
40type BaseClient struct {
41	autorest.Client
42	BaseURI string
43}
44
45// New creates an instance of the BaseClient client.
46func New() BaseClient {
47	return NewWithBaseURI(DefaultBaseURI)
48}
49
50// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint.  Use this when interacting with
51// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
52func NewWithBaseURI(baseURI string) BaseClient {
53	return BaseClient{
54		Client:  autorest.NewClientWithUserAgent(UserAgent()),
55		BaseURI: baseURI,
56	}
57}
58
59// BackupPartition creates a backup of the stateful persisted partition's state. In case the partition is already being
60// periodically backed up, then by default the new backup is created at the same backup storage. One can also override
61// the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its
62// progress can be tracked using the GetBackupProgress operation.
63// In case, the operation times out, specify a greater backup timeout value in the query parameter.
64// Parameters:
65// partitionID - the identity of the partition.
66// backupPartitionDescription - describes the parameters to backup the partition now. If not present, backup
67// operation uses default parameters from the backup policy current associated with this partition.
68// backupTimeout - specifies the maximum amount of time, in minutes, to wait for the backup operation to
69// complete. Post that, the operation completes with timeout error. However, in certain corner cases it could
70// be that though the operation returns back timeout, the backup actually goes through. In case of timeout
71// error, its recommended to invoke this operation again with a greater timeout value. The default value for
72// the same is 10 minutes.
73// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
74// duration that the client is willing to wait for the requested operation to complete. The default value for
75// this parameter is 60 seconds.
76func (client BaseClient) BackupPartition(ctx context.Context, partitionID uuid.UUID, backupPartitionDescription *BackupPartitionDescription, backupTimeout *int32, timeout *int64) (result autorest.Response, err error) {
77	if tracing.IsEnabled() {
78		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.BackupPartition")
79		defer func() {
80			sc := -1
81			if result.Response != nil {
82				sc = result.Response.StatusCode
83			}
84			tracing.EndSpan(ctx, sc, err)
85		}()
86	}
87	if err := validation.Validate([]validation.Validation{
88		{TargetValue: timeout,
89			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
90				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
91					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
92				}}}}}); err != nil {
93		return result, validation.NewError("servicefabric.BaseClient", "BackupPartition", err.Error())
94	}
95
96	req, err := client.BackupPartitionPreparer(ctx, partitionID, backupPartitionDescription, backupTimeout, timeout)
97	if err != nil {
98		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "BackupPartition", nil, "Failure preparing request")
99		return
100	}
101
102	resp, err := client.BackupPartitionSender(req)
103	if err != nil {
104		result.Response = resp
105		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "BackupPartition", resp, "Failure sending request")
106		return
107	}
108
109	result, err = client.BackupPartitionResponder(resp)
110	if err != nil {
111		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "BackupPartition", resp, "Failure responding to request")
112	}
113
114	return
115}
116
117// BackupPartitionPreparer prepares the BackupPartition request.
118func (client BaseClient) BackupPartitionPreparer(ctx context.Context, partitionID uuid.UUID, backupPartitionDescription *BackupPartitionDescription, backupTimeout *int32, timeout *int64) (*http.Request, error) {
119	pathParameters := map[string]interface{}{
120		"partitionId": partitionID,
121	}
122
123	const APIVersion = "6.2-preview"
124	queryParameters := map[string]interface{}{
125		"api-version": APIVersion,
126	}
127	if backupTimeout != nil {
128		queryParameters["BackupTimeout"] = autorest.Encode("query", *backupTimeout)
129	} else {
130		queryParameters["BackupTimeout"] = autorest.Encode("query", 10)
131	}
132	if timeout != nil {
133		queryParameters["timeout"] = autorest.Encode("query", *timeout)
134	} else {
135		queryParameters["timeout"] = autorest.Encode("query", 60)
136	}
137
138	preparer := autorest.CreatePreparer(
139		autorest.AsContentType("application/json; charset=utf-8"),
140		autorest.AsPost(),
141		autorest.WithBaseURL(client.BaseURI),
142		autorest.WithPathParameters("/Partitions/{partitionId}/$/Backup", pathParameters),
143		autorest.WithQueryParameters(queryParameters))
144	if backupPartitionDescription != nil {
145		preparer = autorest.DecoratePreparer(preparer,
146			autorest.WithJSON(backupPartitionDescription))
147	}
148	return preparer.Prepare((&http.Request{}).WithContext(ctx))
149}
150
151// BackupPartitionSender sends the BackupPartition request. The method will close the
152// http.Response Body if it receives an error.
153func (client BaseClient) BackupPartitionSender(req *http.Request) (*http.Response, error) {
154	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
155}
156
157// BackupPartitionResponder handles the response to the BackupPartition request. The method always
158// closes the http.Response Body.
159func (client BaseClient) BackupPartitionResponder(resp *http.Response) (result autorest.Response, err error) {
160	err = autorest.Respond(
161		resp,
162		client.ByInspecting(),
163		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
164		autorest.ByClosing())
165	result.Response = resp
166	return
167}
168
169// CancelOperation the following is a list of APIs that start fault operations that may be cancelled using
170// CancelOperation -
171// - StartDataLoss
172// - StartQuorumLoss
173// - StartPartitionRestart
174// - StartNodeTransition
175//
176// If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up.  If force is
177// true, the command will be aborted, and some internal state
178// may be left behind.  Specifying force as true should be used with care.  Calling this API with force set to true is
179// not allowed until this API has already
180// been called on the same test command with force set to false first, or unless the test command already has an
181// OperationState of OperationState.RollingBack.
182// Clarification: OperationState.RollingBack means that the system will/is be cleaning up internal system state caused
183// by executing the command.  It will not restore data if the
184// test command was to cause data loss.  For example, if you call StartDataLoss then call this API, the system will
185// only clean up internal state from running the command.
186// It will not restore the target partition's data, if the command progressed far enough to cause data loss.
187//
188// Important note:  if this API is invoked with force==true, internal state may be left behind.
189// Parameters:
190// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
191// API
192// force - indicates whether to gracefully rollback and clean up internal system state modified by executing
193// the user-induced operation.
194// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
195// duration that the client is willing to wait for the requested operation to complete. The default value for
196// this parameter is 60 seconds.
197func (client BaseClient) CancelOperation(ctx context.Context, operationID uuid.UUID, force bool, timeout *int64) (result autorest.Response, err error) {
198	if tracing.IsEnabled() {
199		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CancelOperation")
200		defer func() {
201			sc := -1
202			if result.Response != nil {
203				sc = result.Response.StatusCode
204			}
205			tracing.EndSpan(ctx, sc, err)
206		}()
207	}
208	if err := validation.Validate([]validation.Validation{
209		{TargetValue: timeout,
210			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
211				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
212					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
213				}}}}}); err != nil {
214		return result, validation.NewError("servicefabric.BaseClient", "CancelOperation", err.Error())
215	}
216
217	req, err := client.CancelOperationPreparer(ctx, operationID, force, timeout)
218	if err != nil {
219		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", nil, "Failure preparing request")
220		return
221	}
222
223	resp, err := client.CancelOperationSender(req)
224	if err != nil {
225		result.Response = resp
226		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", resp, "Failure sending request")
227		return
228	}
229
230	result, err = client.CancelOperationResponder(resp)
231	if err != nil {
232		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", resp, "Failure responding to request")
233	}
234
235	return
236}
237
238// CancelOperationPreparer prepares the CancelOperation request.
239func (client BaseClient) CancelOperationPreparer(ctx context.Context, operationID uuid.UUID, force bool, timeout *int64) (*http.Request, error) {
240	const APIVersion = "6.0"
241	queryParameters := map[string]interface{}{
242		"api-version": APIVersion,
243		"Force":       autorest.Encode("query", force),
244		"OperationId": autorest.Encode("query", operationID),
245	}
246	if timeout != nil {
247		queryParameters["timeout"] = autorest.Encode("query", *timeout)
248	} else {
249		queryParameters["timeout"] = autorest.Encode("query", 60)
250	}
251
252	preparer := autorest.CreatePreparer(
253		autorest.AsPost(),
254		autorest.WithBaseURL(client.BaseURI),
255		autorest.WithPath("/Faults/$/Cancel"),
256		autorest.WithQueryParameters(queryParameters))
257	return preparer.Prepare((&http.Request{}).WithContext(ctx))
258}
259
260// CancelOperationSender sends the CancelOperation request. The method will close the
261// http.Response Body if it receives an error.
262func (client BaseClient) CancelOperationSender(req *http.Request) (*http.Response, error) {
263	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
264}
265
266// CancelOperationResponder handles the response to the CancelOperation request. The method always
267// closes the http.Response Body.
268func (client BaseClient) CancelOperationResponder(resp *http.Response) (result autorest.Response, err error) {
269	err = autorest.Respond(
270		resp,
271		client.ByInspecting(),
272		azure.WithErrorUnlessStatusCode(http.StatusOK),
273		autorest.ByClosing())
274	result.Response = resp
275	return
276}
277
278// CancelRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your code.
279// Parameters:
280// repairTaskCancelDescription - describes the repair task to be cancelled.
281func (client BaseClient) CancelRepairTask(ctx context.Context, repairTaskCancelDescription RepairTaskCancelDescription) (result RepairTaskUpdateInfo, err error) {
282	if tracing.IsEnabled() {
283		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CancelRepairTask")
284		defer func() {
285			sc := -1
286			if result.Response.Response != nil {
287				sc = result.Response.Response.StatusCode
288			}
289			tracing.EndSpan(ctx, sc, err)
290		}()
291	}
292	if err := validation.Validate([]validation.Validation{
293		{TargetValue: repairTaskCancelDescription,
294			Constraints: []validation.Constraint{{Target: "repairTaskCancelDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
295		return result, validation.NewError("servicefabric.BaseClient", "CancelRepairTask", err.Error())
296	}
297
298	req, err := client.CancelRepairTaskPreparer(ctx, repairTaskCancelDescription)
299	if err != nil {
300		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", nil, "Failure preparing request")
301		return
302	}
303
304	resp, err := client.CancelRepairTaskSender(req)
305	if err != nil {
306		result.Response = autorest.Response{Response: resp}
307		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", resp, "Failure sending request")
308		return
309	}
310
311	result, err = client.CancelRepairTaskResponder(resp)
312	if err != nil {
313		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", resp, "Failure responding to request")
314	}
315
316	return
317}
318
319// CancelRepairTaskPreparer prepares the CancelRepairTask request.
320func (client BaseClient) CancelRepairTaskPreparer(ctx context.Context, repairTaskCancelDescription RepairTaskCancelDescription) (*http.Request, error) {
321	const APIVersion = "6.0"
322	queryParameters := map[string]interface{}{
323		"api-version": APIVersion,
324	}
325
326	preparer := autorest.CreatePreparer(
327		autorest.AsContentType("application/json; charset=utf-8"),
328		autorest.AsPost(),
329		autorest.WithBaseURL(client.BaseURI),
330		autorest.WithPath("/$/CancelRepairTask"),
331		autorest.WithJSON(repairTaskCancelDescription),
332		autorest.WithQueryParameters(queryParameters))
333	return preparer.Prepare((&http.Request{}).WithContext(ctx))
334}
335
336// CancelRepairTaskSender sends the CancelRepairTask request. The method will close the
337// http.Response Body if it receives an error.
338func (client BaseClient) CancelRepairTaskSender(req *http.Request) (*http.Response, error) {
339	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
340}
341
342// CancelRepairTaskResponder handles the response to the CancelRepairTask request. The method always
343// closes the http.Response Body.
344func (client BaseClient) CancelRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
345	err = autorest.Respond(
346		resp,
347		client.ByInspecting(),
348		azure.WithErrorUnlessStatusCode(http.StatusOK),
349		autorest.ByUnmarshallingJSON(&result),
350		autorest.ByClosing())
351	result.Response = autorest.Response{Response: resp}
352	return
353}
354
355// CommitImageStoreUploadSession when all file chunks have been uploaded, the upload session needs to be committed
356// explicitly to complete the upload. Image store preserves the upload session until the expiration time, which is 30
357// minutes after the last chunk received.
358// Parameters:
359// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session
360// which keeps track of all file chunks until it is committed.
361// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
362// duration that the client is willing to wait for the requested operation to complete. The default value for
363// this parameter is 60 seconds.
364func (client BaseClient) CommitImageStoreUploadSession(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
365	if tracing.IsEnabled() {
366		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CommitImageStoreUploadSession")
367		defer func() {
368			sc := -1
369			if result.Response != nil {
370				sc = result.Response.StatusCode
371			}
372			tracing.EndSpan(ctx, sc, err)
373		}()
374	}
375	if err := validation.Validate([]validation.Validation{
376		{TargetValue: timeout,
377			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
378				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
379					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
380				}}}}}); err != nil {
381		return result, validation.NewError("servicefabric.BaseClient", "CommitImageStoreUploadSession", err.Error())
382	}
383
384	req, err := client.CommitImageStoreUploadSessionPreparer(ctx, sessionID, timeout)
385	if err != nil {
386		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", nil, "Failure preparing request")
387		return
388	}
389
390	resp, err := client.CommitImageStoreUploadSessionSender(req)
391	if err != nil {
392		result.Response = resp
393		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", resp, "Failure sending request")
394		return
395	}
396
397	result, err = client.CommitImageStoreUploadSessionResponder(resp)
398	if err != nil {
399		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", resp, "Failure responding to request")
400	}
401
402	return
403}
404
405// CommitImageStoreUploadSessionPreparer prepares the CommitImageStoreUploadSession request.
406func (client BaseClient) CommitImageStoreUploadSessionPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) {
407	const APIVersion = "6.0"
408	queryParameters := map[string]interface{}{
409		"api-version": APIVersion,
410		"session-id":  autorest.Encode("query", sessionID),
411	}
412	if timeout != nil {
413		queryParameters["timeout"] = autorest.Encode("query", *timeout)
414	} else {
415		queryParameters["timeout"] = autorest.Encode("query", 60)
416	}
417
418	preparer := autorest.CreatePreparer(
419		autorest.AsPost(),
420		autorest.WithBaseURL(client.BaseURI),
421		autorest.WithPath("/ImageStore/$/CommitUploadSession"),
422		autorest.WithQueryParameters(queryParameters))
423	return preparer.Prepare((&http.Request{}).WithContext(ctx))
424}
425
426// CommitImageStoreUploadSessionSender sends the CommitImageStoreUploadSession request. The method will close the
427// http.Response Body if it receives an error.
428func (client BaseClient) CommitImageStoreUploadSessionSender(req *http.Request) (*http.Response, error) {
429	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
430}
431
432// CommitImageStoreUploadSessionResponder handles the response to the CommitImageStoreUploadSession request. The method always
433// closes the http.Response Body.
434func (client BaseClient) CommitImageStoreUploadSessionResponder(resp *http.Response) (result autorest.Response, err error) {
435	err = autorest.Respond(
436		resp,
437		client.ByInspecting(),
438		azure.WithErrorUnlessStatusCode(http.StatusOK),
439		autorest.ByClosing())
440	result.Response = resp
441	return
442}
443
444// CopyImageStoreContent copies the image store content from the source image store relative path to the destination
445// image store relative path.
446// Parameters:
447// imageStoreCopyDescription - describes the copy description for the image store.
448// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
449// duration that the client is willing to wait for the requested operation to complete. The default value for
450// this parameter is 60 seconds.
451func (client BaseClient) CopyImageStoreContent(ctx context.Context, imageStoreCopyDescription ImageStoreCopyDescription, timeout *int64) (result autorest.Response, err error) {
452	if tracing.IsEnabled() {
453		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CopyImageStoreContent")
454		defer func() {
455			sc := -1
456			if result.Response != nil {
457				sc = result.Response.StatusCode
458			}
459			tracing.EndSpan(ctx, sc, err)
460		}()
461	}
462	if err := validation.Validate([]validation.Validation{
463		{TargetValue: imageStoreCopyDescription,
464			Constraints: []validation.Constraint{{Target: "imageStoreCopyDescription.RemoteSource", Name: validation.Null, Rule: true, Chain: nil},
465				{Target: "imageStoreCopyDescription.RemoteDestination", Name: validation.Null, Rule: true, Chain: nil}}},
466		{TargetValue: timeout,
467			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
468				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
469					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
470				}}}}}); err != nil {
471		return result, validation.NewError("servicefabric.BaseClient", "CopyImageStoreContent", err.Error())
472	}
473
474	req, err := client.CopyImageStoreContentPreparer(ctx, imageStoreCopyDescription, timeout)
475	if err != nil {
476		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", nil, "Failure preparing request")
477		return
478	}
479
480	resp, err := client.CopyImageStoreContentSender(req)
481	if err != nil {
482		result.Response = resp
483		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", resp, "Failure sending request")
484		return
485	}
486
487	result, err = client.CopyImageStoreContentResponder(resp)
488	if err != nil {
489		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", resp, "Failure responding to request")
490	}
491
492	return
493}
494
495// CopyImageStoreContentPreparer prepares the CopyImageStoreContent request.
496func (client BaseClient) CopyImageStoreContentPreparer(ctx context.Context, imageStoreCopyDescription ImageStoreCopyDescription, timeout *int64) (*http.Request, error) {
497	const APIVersion = "6.0"
498	queryParameters := map[string]interface{}{
499		"api-version": APIVersion,
500	}
501	if timeout != nil {
502		queryParameters["timeout"] = autorest.Encode("query", *timeout)
503	} else {
504		queryParameters["timeout"] = autorest.Encode("query", 60)
505	}
506
507	preparer := autorest.CreatePreparer(
508		autorest.AsContentType("application/json; charset=utf-8"),
509		autorest.AsPost(),
510		autorest.WithBaseURL(client.BaseURI),
511		autorest.WithPath("/ImageStore/$/Copy"),
512		autorest.WithJSON(imageStoreCopyDescription),
513		autorest.WithQueryParameters(queryParameters))
514	return preparer.Prepare((&http.Request{}).WithContext(ctx))
515}
516
517// CopyImageStoreContentSender sends the CopyImageStoreContent request. The method will close the
518// http.Response Body if it receives an error.
519func (client BaseClient) CopyImageStoreContentSender(req *http.Request) (*http.Response, error) {
520	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
521}
522
523// CopyImageStoreContentResponder handles the response to the CopyImageStoreContent request. The method always
524// closes the http.Response Body.
525func (client BaseClient) CopyImageStoreContentResponder(resp *http.Response) (result autorest.Response, err error) {
526	err = autorest.Respond(
527		resp,
528		client.ByInspecting(),
529		azure.WithErrorUnlessStatusCode(http.StatusOK),
530		autorest.ByClosing())
531	result.Response = resp
532	return
533}
534
535// CreateApplication creates a Service Fabric application using the specified description.
536// Parameters:
537// applicationDescription - description for creating an application.
538// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
539// duration that the client is willing to wait for the requested operation to complete. The default value for
540// this parameter is 60 seconds.
541func (client BaseClient) CreateApplication(ctx context.Context, applicationDescription ApplicationDescription, timeout *int64) (result autorest.Response, err error) {
542	if tracing.IsEnabled() {
543		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateApplication")
544		defer func() {
545			sc := -1
546			if result.Response != nil {
547				sc = result.Response.StatusCode
548			}
549			tracing.EndSpan(ctx, sc, err)
550		}()
551	}
552	if err := validation.Validate([]validation.Validation{
553		{TargetValue: applicationDescription,
554			Constraints: []validation.Constraint{{Target: "applicationDescription.Name", Name: validation.Null, Rule: true, Chain: nil},
555				{Target: "applicationDescription.TypeName", Name: validation.Null, Rule: true, Chain: nil},
556				{Target: "applicationDescription.TypeVersion", Name: validation.Null, Rule: true, Chain: nil},
557				{Target: "applicationDescription.ApplicationCapacity", Name: validation.Null, Rule: false,
558					Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MinimumNodes", Name: validation.Null, Rule: false,
559						Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MinimumNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}},
560						{Target: "applicationDescription.ApplicationCapacity.MaximumNodes", Name: validation.Null, Rule: false,
561							Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MaximumNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}},
562					}}}},
563		{TargetValue: timeout,
564			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
565				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
566					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
567				}}}}}); err != nil {
568		return result, validation.NewError("servicefabric.BaseClient", "CreateApplication", err.Error())
569	}
570
571	req, err := client.CreateApplicationPreparer(ctx, applicationDescription, timeout)
572	if err != nil {
573		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", nil, "Failure preparing request")
574		return
575	}
576
577	resp, err := client.CreateApplicationSender(req)
578	if err != nil {
579		result.Response = resp
580		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", resp, "Failure sending request")
581		return
582	}
583
584	result, err = client.CreateApplicationResponder(resp)
585	if err != nil {
586		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", resp, "Failure responding to request")
587	}
588
589	return
590}
591
592// CreateApplicationPreparer prepares the CreateApplication request.
593func (client BaseClient) CreateApplicationPreparer(ctx context.Context, applicationDescription ApplicationDescription, timeout *int64) (*http.Request, error) {
594	const APIVersion = "6.0"
595	queryParameters := map[string]interface{}{
596		"api-version": APIVersion,
597	}
598	if timeout != nil {
599		queryParameters["timeout"] = autorest.Encode("query", *timeout)
600	} else {
601		queryParameters["timeout"] = autorest.Encode("query", 60)
602	}
603
604	preparer := autorest.CreatePreparer(
605		autorest.AsContentType("application/json; charset=utf-8"),
606		autorest.AsPost(),
607		autorest.WithBaseURL(client.BaseURI),
608		autorest.WithPath("/Applications/$/Create"),
609		autorest.WithJSON(applicationDescription),
610		autorest.WithQueryParameters(queryParameters))
611	return preparer.Prepare((&http.Request{}).WithContext(ctx))
612}
613
614// CreateApplicationSender sends the CreateApplication request. The method will close the
615// http.Response Body if it receives an error.
616func (client BaseClient) CreateApplicationSender(req *http.Request) (*http.Response, error) {
617	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
618}
619
620// CreateApplicationResponder handles the response to the CreateApplication request. The method always
621// closes the http.Response Body.
622func (client BaseClient) CreateApplicationResponder(resp *http.Response) (result autorest.Response, err error) {
623	err = autorest.Respond(
624		resp,
625		client.ByInspecting(),
626		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
627		autorest.ByClosing())
628	result.Response = resp
629	return
630}
631
632// CreateBackupPolicy creates a backup policy which can be associated later with a Service Fabric application, service
633// or a partition for periodic backup.
634// Parameters:
635// backupPolicyDescription - describes the backup policy.
636// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
637// duration that the client is willing to wait for the requested operation to complete. The default value for
638// this parameter is 60 seconds.
639func (client BaseClient) CreateBackupPolicy(ctx context.Context, backupPolicyDescription BackupPolicyDescription, timeout *int64) (result autorest.Response, err error) {
640	if tracing.IsEnabled() {
641		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateBackupPolicy")
642		defer func() {
643			sc := -1
644			if result.Response != nil {
645				sc = result.Response.StatusCode
646			}
647			tracing.EndSpan(ctx, sc, err)
648		}()
649	}
650	if err := validation.Validate([]validation.Validation{
651		{TargetValue: backupPolicyDescription,
652			Constraints: []validation.Constraint{{Target: "backupPolicyDescription.Name", Name: validation.Null, Rule: true, Chain: nil},
653				{Target: "backupPolicyDescription.AutoRestoreOnDataLoss", Name: validation.Null, Rule: true, Chain: nil},
654				{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.Null, Rule: true,
655					Chain: []validation.Constraint{{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMaximum, Rule: int64(255), Chain: nil},
656						{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
657					}},
658				{Target: "backupPolicyDescription.Schedule", Name: validation.Null, Rule: true, Chain: nil},
659				{Target: "backupPolicyDescription.Storage", Name: validation.Null, Rule: true, Chain: nil}}},
660		{TargetValue: timeout,
661			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
662				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
663					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
664				}}}}}); err != nil {
665		return result, validation.NewError("servicefabric.BaseClient", "CreateBackupPolicy", err.Error())
666	}
667
668	req, err := client.CreateBackupPolicyPreparer(ctx, backupPolicyDescription, timeout)
669	if err != nil {
670		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", nil, "Failure preparing request")
671		return
672	}
673
674	resp, err := client.CreateBackupPolicySender(req)
675	if err != nil {
676		result.Response = resp
677		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", resp, "Failure sending request")
678		return
679	}
680
681	result, err = client.CreateBackupPolicyResponder(resp)
682	if err != nil {
683		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", resp, "Failure responding to request")
684	}
685
686	return
687}
688
689// CreateBackupPolicyPreparer prepares the CreateBackupPolicy request.
690func (client BaseClient) CreateBackupPolicyPreparer(ctx context.Context, backupPolicyDescription BackupPolicyDescription, timeout *int64) (*http.Request, error) {
691	const APIVersion = "6.2-preview"
692	queryParameters := map[string]interface{}{
693		"api-version": APIVersion,
694	}
695	if timeout != nil {
696		queryParameters["timeout"] = autorest.Encode("query", *timeout)
697	} else {
698		queryParameters["timeout"] = autorest.Encode("query", 60)
699	}
700
701	preparer := autorest.CreatePreparer(
702		autorest.AsContentType("application/json; charset=utf-8"),
703		autorest.AsPost(),
704		autorest.WithBaseURL(client.BaseURI),
705		autorest.WithPath("/BackupRestore/BackupPolicies/$/Create"),
706		autorest.WithJSON(backupPolicyDescription),
707		autorest.WithQueryParameters(queryParameters))
708	return preparer.Prepare((&http.Request{}).WithContext(ctx))
709}
710
711// CreateBackupPolicySender sends the CreateBackupPolicy request. The method will close the
712// http.Response Body if it receives an error.
713func (client BaseClient) CreateBackupPolicySender(req *http.Request) (*http.Response, error) {
714	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
715}
716
717// CreateBackupPolicyResponder handles the response to the CreateBackupPolicy request. The method always
718// closes the http.Response Body.
719func (client BaseClient) CreateBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
720	err = autorest.Respond(
721		resp,
722		client.ByInspecting(),
723		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
724		autorest.ByClosing())
725	result.Response = resp
726	return
727}
728
729// CreateComposeDeployment compose is a file format that describes multi-container applications. This API allows
730// deploying container based applications defined in compose format in a Service Fabric cluster. Once the deployment is
731// created it's status can be tracked via `GetComposeDeploymentStatus` API.
732// Parameters:
733// createComposeDeploymentDescription - describes the compose deployment that needs to be created.
734// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
735// duration that the client is willing to wait for the requested operation to complete. The default value for
736// this parameter is 60 seconds.
737func (client BaseClient) CreateComposeDeployment(ctx context.Context, createComposeDeploymentDescription CreateComposeDeploymentDescription, timeout *int64) (result autorest.Response, err error) {
738	if tracing.IsEnabled() {
739		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateComposeDeployment")
740		defer func() {
741			sc := -1
742			if result.Response != nil {
743				sc = result.Response.StatusCode
744			}
745			tracing.EndSpan(ctx, sc, err)
746		}()
747	}
748	if err := validation.Validate([]validation.Validation{
749		{TargetValue: createComposeDeploymentDescription,
750			Constraints: []validation.Constraint{{Target: "createComposeDeploymentDescription.DeploymentName", Name: validation.Null, Rule: true, Chain: nil},
751				{Target: "createComposeDeploymentDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}},
752		{TargetValue: timeout,
753			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
754				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
755					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
756				}}}}}); err != nil {
757		return result, validation.NewError("servicefabric.BaseClient", "CreateComposeDeployment", err.Error())
758	}
759
760	req, err := client.CreateComposeDeploymentPreparer(ctx, createComposeDeploymentDescription, timeout)
761	if err != nil {
762		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", nil, "Failure preparing request")
763		return
764	}
765
766	resp, err := client.CreateComposeDeploymentSender(req)
767	if err != nil {
768		result.Response = resp
769		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", resp, "Failure sending request")
770		return
771	}
772
773	result, err = client.CreateComposeDeploymentResponder(resp)
774	if err != nil {
775		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", resp, "Failure responding to request")
776	}
777
778	return
779}
780
781// CreateComposeDeploymentPreparer prepares the CreateComposeDeployment request.
782func (client BaseClient) CreateComposeDeploymentPreparer(ctx context.Context, createComposeDeploymentDescription CreateComposeDeploymentDescription, timeout *int64) (*http.Request, error) {
783	const APIVersion = "6.0-preview"
784	queryParameters := map[string]interface{}{
785		"api-version": APIVersion,
786	}
787	if timeout != nil {
788		queryParameters["timeout"] = autorest.Encode("query", *timeout)
789	} else {
790		queryParameters["timeout"] = autorest.Encode("query", 60)
791	}
792
793	preparer := autorest.CreatePreparer(
794		autorest.AsContentType("application/json; charset=utf-8"),
795		autorest.AsPut(),
796		autorest.WithBaseURL(client.BaseURI),
797		autorest.WithPath("/ComposeDeployments/$/Create"),
798		autorest.WithJSON(createComposeDeploymentDescription),
799		autorest.WithQueryParameters(queryParameters))
800	return preparer.Prepare((&http.Request{}).WithContext(ctx))
801}
802
803// CreateComposeDeploymentSender sends the CreateComposeDeployment request. The method will close the
804// http.Response Body if it receives an error.
805func (client BaseClient) CreateComposeDeploymentSender(req *http.Request) (*http.Response, error) {
806	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
807}
808
809// CreateComposeDeploymentResponder handles the response to the CreateComposeDeployment request. The method always
810// closes the http.Response Body.
811func (client BaseClient) CreateComposeDeploymentResponder(resp *http.Response) (result autorest.Response, err error) {
812	err = autorest.Respond(
813		resp,
814		client.ByInspecting(),
815		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
816		autorest.ByClosing())
817	result.Response = resp
818	return
819}
820
821// CreateName creates the specified Service Fabric name.
822// Parameters:
823// nameDescription - describes the Service Fabric name to be created.
824// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
825// duration that the client is willing to wait for the requested operation to complete. The default value for
826// this parameter is 60 seconds.
827func (client BaseClient) CreateName(ctx context.Context, nameDescription NameDescription, timeout *int64) (result autorest.Response, err error) {
828	if tracing.IsEnabled() {
829		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateName")
830		defer func() {
831			sc := -1
832			if result.Response != nil {
833				sc = result.Response.StatusCode
834			}
835			tracing.EndSpan(ctx, sc, err)
836		}()
837	}
838	if err := validation.Validate([]validation.Validation{
839		{TargetValue: nameDescription,
840			Constraints: []validation.Constraint{{Target: "nameDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}},
841		{TargetValue: timeout,
842			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
843				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
844					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
845				}}}}}); err != nil {
846		return result, validation.NewError("servicefabric.BaseClient", "CreateName", err.Error())
847	}
848
849	req, err := client.CreateNamePreparer(ctx, nameDescription, timeout)
850	if err != nil {
851		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", nil, "Failure preparing request")
852		return
853	}
854
855	resp, err := client.CreateNameSender(req)
856	if err != nil {
857		result.Response = resp
858		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", resp, "Failure sending request")
859		return
860	}
861
862	result, err = client.CreateNameResponder(resp)
863	if err != nil {
864		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", resp, "Failure responding to request")
865	}
866
867	return
868}
869
870// CreateNamePreparer prepares the CreateName request.
871func (client BaseClient) CreateNamePreparer(ctx context.Context, nameDescription NameDescription, timeout *int64) (*http.Request, error) {
872	const APIVersion = "6.0"
873	queryParameters := map[string]interface{}{
874		"api-version": APIVersion,
875	}
876	if timeout != nil {
877		queryParameters["timeout"] = autorest.Encode("query", *timeout)
878	} else {
879		queryParameters["timeout"] = autorest.Encode("query", 60)
880	}
881
882	preparer := autorest.CreatePreparer(
883		autorest.AsContentType("application/json; charset=utf-8"),
884		autorest.AsPost(),
885		autorest.WithBaseURL(client.BaseURI),
886		autorest.WithPath("/Names/$/Create"),
887		autorest.WithJSON(nameDescription),
888		autorest.WithQueryParameters(queryParameters))
889	return preparer.Prepare((&http.Request{}).WithContext(ctx))
890}
891
892// CreateNameSender sends the CreateName request. The method will close the
893// http.Response Body if it receives an error.
894func (client BaseClient) CreateNameSender(req *http.Request) (*http.Response, error) {
895	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
896}
897
898// CreateNameResponder handles the response to the CreateName request. The method always
899// closes the http.Response Body.
900func (client BaseClient) CreateNameResponder(resp *http.Response) (result autorest.Response, err error) {
901	err = autorest.Respond(
902		resp,
903		client.ByInspecting(),
904		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
905		autorest.ByClosing())
906	result.Response = resp
907	return
908}
909
910// CreateRepairTask for clusters that have the Repair Manager Service configured,
911// this API provides a way to create repair tasks that run automatically or manually.
912// For repair tasks that run automatically, an appropriate repair executor
913// must be running for each repair action to run automatically.
914// These are currently only available in specially-configured Azure Cloud Services.
915//
916// To create a manual repair task, provide the set of impacted node names and the
917// expected impact. When the state of the created repair task changes to approved,
918// you can safely perform repair actions on those nodes.
919//
920// This API supports the Service Fabric platform; it is not meant to be used directly from your code.
921// Parameters:
922// repairTask - describes the repair task to be created or updated.
923func (client BaseClient) CreateRepairTask(ctx context.Context, repairTask RepairTask) (result RepairTaskUpdateInfo, err error) {
924	if tracing.IsEnabled() {
925		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateRepairTask")
926		defer func() {
927			sc := -1
928			if result.Response.Response != nil {
929				sc = result.Response.Response.StatusCode
930			}
931			tracing.EndSpan(ctx, sc, err)
932		}()
933	}
934	if err := validation.Validate([]validation.Validation{
935		{TargetValue: repairTask,
936			Constraints: []validation.Constraint{{Target: "repairTask.TaskID", Name: validation.Null, Rule: true, Chain: nil},
937				{Target: "repairTask.Action", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
938		return result, validation.NewError("servicefabric.BaseClient", "CreateRepairTask", err.Error())
939	}
940
941	req, err := client.CreateRepairTaskPreparer(ctx, repairTask)
942	if err != nil {
943		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", nil, "Failure preparing request")
944		return
945	}
946
947	resp, err := client.CreateRepairTaskSender(req)
948	if err != nil {
949		result.Response = autorest.Response{Response: resp}
950		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", resp, "Failure sending request")
951		return
952	}
953
954	result, err = client.CreateRepairTaskResponder(resp)
955	if err != nil {
956		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", resp, "Failure responding to request")
957	}
958
959	return
960}
961
962// CreateRepairTaskPreparer prepares the CreateRepairTask request.
963func (client BaseClient) CreateRepairTaskPreparer(ctx context.Context, repairTask RepairTask) (*http.Request, error) {
964	const APIVersion = "6.0"
965	queryParameters := map[string]interface{}{
966		"api-version": APIVersion,
967	}
968
969	preparer := autorest.CreatePreparer(
970		autorest.AsContentType("application/json; charset=utf-8"),
971		autorest.AsPost(),
972		autorest.WithBaseURL(client.BaseURI),
973		autorest.WithPath("/$/CreateRepairTask"),
974		autorest.WithJSON(repairTask),
975		autorest.WithQueryParameters(queryParameters))
976	return preparer.Prepare((&http.Request{}).WithContext(ctx))
977}
978
979// CreateRepairTaskSender sends the CreateRepairTask request. The method will close the
980// http.Response Body if it receives an error.
981func (client BaseClient) CreateRepairTaskSender(req *http.Request) (*http.Response, error) {
982	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
983}
984
985// CreateRepairTaskResponder handles the response to the CreateRepairTask request. The method always
986// closes the http.Response Body.
987func (client BaseClient) CreateRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
988	err = autorest.Respond(
989		resp,
990		client.ByInspecting(),
991		azure.WithErrorUnlessStatusCode(http.StatusOK),
992		autorest.ByUnmarshallingJSON(&result),
993		autorest.ByClosing())
994	result.Response = autorest.Response{Response: resp}
995	return
996}
997
998// CreateService this api allows creating a new Service Fabric stateless or stateful service under a specified Service
999// Fabric application. The description for creating the service includes partitioning information and optional
1000// properties for placement and load balancing. Some of the properties can later be modified using `UpdateService` API.
1001// Parameters:
1002// applicationID - the identity of the application. This is typically the full name of the application without
1003// the 'fabric:' URI scheme.
1004// Starting from version 6.0, hierarchical names are delimited with the "~" character.
1005// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
1006// in 6.0+ and "myapp/app1" in previous versions.
1007// serviceDescription - the information necessary to create a service.
1008// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1009// duration that the client is willing to wait for the requested operation to complete. The default value for
1010// this parameter is 60 seconds.
1011func (client BaseClient) CreateService(ctx context.Context, applicationID string, serviceDescription BasicServiceDescription, timeout *int64) (result autorest.Response, err error) {
1012	if tracing.IsEnabled() {
1013		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateService")
1014		defer func() {
1015			sc := -1
1016			if result.Response != nil {
1017				sc = result.Response.StatusCode
1018			}
1019			tracing.EndSpan(ctx, sc, err)
1020		}()
1021	}
1022	if err := validation.Validate([]validation.Validation{
1023		{TargetValue: serviceDescription,
1024			Constraints: []validation.Constraint{{Target: "serviceDescription.ServiceName", Name: validation.Null, Rule: true, Chain: nil},
1025				{Target: "serviceDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil},
1026				{Target: "serviceDescription.PartitionDescription", Name: validation.Null, Rule: true, Chain: nil}}},
1027		{TargetValue: timeout,
1028			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1029				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1030					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1031				}}}}}); err != nil {
1032		return result, validation.NewError("servicefabric.BaseClient", "CreateService", err.Error())
1033	}
1034
1035	req, err := client.CreateServicePreparer(ctx, applicationID, serviceDescription, timeout)
1036	if err != nil {
1037		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", nil, "Failure preparing request")
1038		return
1039	}
1040
1041	resp, err := client.CreateServiceSender(req)
1042	if err != nil {
1043		result.Response = resp
1044		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", resp, "Failure sending request")
1045		return
1046	}
1047
1048	result, err = client.CreateServiceResponder(resp)
1049	if err != nil {
1050		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", resp, "Failure responding to request")
1051	}
1052
1053	return
1054}
1055
1056// CreateServicePreparer prepares the CreateService request.
1057func (client BaseClient) CreateServicePreparer(ctx context.Context, applicationID string, serviceDescription BasicServiceDescription, timeout *int64) (*http.Request, error) {
1058	pathParameters := map[string]interface{}{
1059		"applicationId": applicationID,
1060	}
1061
1062	const APIVersion = "6.0"
1063	queryParameters := map[string]interface{}{
1064		"api-version": APIVersion,
1065	}
1066	if timeout != nil {
1067		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1068	} else {
1069		queryParameters["timeout"] = autorest.Encode("query", 60)
1070	}
1071
1072	preparer := autorest.CreatePreparer(
1073		autorest.AsContentType("application/json; charset=utf-8"),
1074		autorest.AsPost(),
1075		autorest.WithBaseURL(client.BaseURI),
1076		autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/$/Create", pathParameters),
1077		autorest.WithJSON(serviceDescription),
1078		autorest.WithQueryParameters(queryParameters))
1079	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1080}
1081
1082// CreateServiceSender sends the CreateService request. The method will close the
1083// http.Response Body if it receives an error.
1084func (client BaseClient) CreateServiceSender(req *http.Request) (*http.Response, error) {
1085	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1086}
1087
1088// CreateServiceResponder handles the response to the CreateService request. The method always
1089// closes the http.Response Body.
1090func (client BaseClient) CreateServiceResponder(resp *http.Response) (result autorest.Response, err error) {
1091	err = autorest.Respond(
1092		resp,
1093		client.ByInspecting(),
1094		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
1095		autorest.ByClosing())
1096	result.Response = resp
1097	return
1098}
1099
1100// CreateServiceFromTemplate creates a Service Fabric service from the service template defined in the application
1101// manifest. A service template contains the properties that will be same for the service instance of the same type.
1102// The API allows overriding the properties that are usually different for different services of the same service type.
1103// Parameters:
1104// applicationID - the identity of the application. This is typically the full name of the application without
1105// the 'fabric:' URI scheme.
1106// Starting from version 6.0, hierarchical names are delimited with the "~" character.
1107// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
1108// in 6.0+ and "myapp/app1" in previous versions.
1109// serviceFromTemplateDescription - describes the service that needs to be created from the template defined in
1110// the application manifest.
1111// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1112// duration that the client is willing to wait for the requested operation to complete. The default value for
1113// this parameter is 60 seconds.
1114func (client BaseClient) CreateServiceFromTemplate(ctx context.Context, applicationID string, serviceFromTemplateDescription ServiceFromTemplateDescription, timeout *int64) (result autorest.Response, err error) {
1115	if tracing.IsEnabled() {
1116		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateServiceFromTemplate")
1117		defer func() {
1118			sc := -1
1119			if result.Response != nil {
1120				sc = result.Response.StatusCode
1121			}
1122			tracing.EndSpan(ctx, sc, err)
1123		}()
1124	}
1125	if err := validation.Validate([]validation.Validation{
1126		{TargetValue: serviceFromTemplateDescription,
1127			Constraints: []validation.Constraint{{Target: "serviceFromTemplateDescription.ApplicationName", Name: validation.Null, Rule: true, Chain: nil},
1128				{Target: "serviceFromTemplateDescription.ServiceName", Name: validation.Null, Rule: true, Chain: nil},
1129				{Target: "serviceFromTemplateDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}}},
1130		{TargetValue: timeout,
1131			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1132				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1133					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1134				}}}}}); err != nil {
1135		return result, validation.NewError("servicefabric.BaseClient", "CreateServiceFromTemplate", err.Error())
1136	}
1137
1138	req, err := client.CreateServiceFromTemplatePreparer(ctx, applicationID, serviceFromTemplateDescription, timeout)
1139	if err != nil {
1140		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", nil, "Failure preparing request")
1141		return
1142	}
1143
1144	resp, err := client.CreateServiceFromTemplateSender(req)
1145	if err != nil {
1146		result.Response = resp
1147		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", resp, "Failure sending request")
1148		return
1149	}
1150
1151	result, err = client.CreateServiceFromTemplateResponder(resp)
1152	if err != nil {
1153		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", resp, "Failure responding to request")
1154	}
1155
1156	return
1157}
1158
1159// CreateServiceFromTemplatePreparer prepares the CreateServiceFromTemplate request.
1160func (client BaseClient) CreateServiceFromTemplatePreparer(ctx context.Context, applicationID string, serviceFromTemplateDescription ServiceFromTemplateDescription, timeout *int64) (*http.Request, error) {
1161	pathParameters := map[string]interface{}{
1162		"applicationId": applicationID,
1163	}
1164
1165	const APIVersion = "6.0"
1166	queryParameters := map[string]interface{}{
1167		"api-version": APIVersion,
1168	}
1169	if timeout != nil {
1170		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1171	} else {
1172		queryParameters["timeout"] = autorest.Encode("query", 60)
1173	}
1174
1175	preparer := autorest.CreatePreparer(
1176		autorest.AsContentType("application/json; charset=utf-8"),
1177		autorest.AsPost(),
1178		autorest.WithBaseURL(client.BaseURI),
1179		autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/$/CreateFromTemplate", pathParameters),
1180		autorest.WithJSON(serviceFromTemplateDescription),
1181		autorest.WithQueryParameters(queryParameters))
1182	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1183}
1184
1185// CreateServiceFromTemplateSender sends the CreateServiceFromTemplate request. The method will close the
1186// http.Response Body if it receives an error.
1187func (client BaseClient) CreateServiceFromTemplateSender(req *http.Request) (*http.Response, error) {
1188	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1189}
1190
1191// CreateServiceFromTemplateResponder handles the response to the CreateServiceFromTemplate request. The method always
1192// closes the http.Response Body.
1193func (client BaseClient) CreateServiceFromTemplateResponder(resp *http.Response) (result autorest.Response, err error) {
1194	err = autorest.Respond(
1195		resp,
1196		client.ByInspecting(),
1197		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
1198		autorest.ByClosing())
1199	result.Response = resp
1200	return
1201}
1202
1203// DeleteApplication deletes an existing Service Fabric application. An application must be created before it can be
1204// deleted. Deleting an application will delete all services that are part of that application. By default, Service
1205// Fabric will try to close service replicas in a graceful manner and then delete the service. However, if a service is
1206// having issues closing the replica gracefully, the delete operation may take a long time or get stuck. Use the
1207// optional ForceRemove flag to skip the graceful close sequence and forcefully delete the application and all of the
1208// its services.
1209// Parameters:
1210// applicationID - the identity of the application. This is typically the full name of the application without
1211// the 'fabric:' URI scheme.
1212// Starting from version 6.0, hierarchical names are delimited with the "~" character.
1213// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
1214// in 6.0+ and "myapp/app1" in previous versions.
1215// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful
1216// shutdown sequence. This parameter can be used to forcefully delete an application or service for which
1217// delete is timing out due to issues in the service code that prevents graceful close of replicas.
1218// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1219// duration that the client is willing to wait for the requested operation to complete. The default value for
1220// this parameter is 60 seconds.
1221func (client BaseClient) DeleteApplication(ctx context.Context, applicationID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) {
1222	if tracing.IsEnabled() {
1223		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteApplication")
1224		defer func() {
1225			sc := -1
1226			if result.Response != nil {
1227				sc = result.Response.StatusCode
1228			}
1229			tracing.EndSpan(ctx, sc, err)
1230		}()
1231	}
1232	if err := validation.Validate([]validation.Validation{
1233		{TargetValue: timeout,
1234			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1235				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1236					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1237				}}}}}); err != nil {
1238		return result, validation.NewError("servicefabric.BaseClient", "DeleteApplication", err.Error())
1239	}
1240
1241	req, err := client.DeleteApplicationPreparer(ctx, applicationID, forceRemove, timeout)
1242	if err != nil {
1243		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", nil, "Failure preparing request")
1244		return
1245	}
1246
1247	resp, err := client.DeleteApplicationSender(req)
1248	if err != nil {
1249		result.Response = resp
1250		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", resp, "Failure sending request")
1251		return
1252	}
1253
1254	result, err = client.DeleteApplicationResponder(resp)
1255	if err != nil {
1256		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", resp, "Failure responding to request")
1257	}
1258
1259	return
1260}
1261
1262// DeleteApplicationPreparer prepares the DeleteApplication request.
1263func (client BaseClient) DeleteApplicationPreparer(ctx context.Context, applicationID string, forceRemove *bool, timeout *int64) (*http.Request, error) {
1264	pathParameters := map[string]interface{}{
1265		"applicationId": applicationID,
1266	}
1267
1268	const APIVersion = "6.0"
1269	queryParameters := map[string]interface{}{
1270		"api-version": APIVersion,
1271	}
1272	if forceRemove != nil {
1273		queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove)
1274	}
1275	if timeout != nil {
1276		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1277	} else {
1278		queryParameters["timeout"] = autorest.Encode("query", 60)
1279	}
1280
1281	preparer := autorest.CreatePreparer(
1282		autorest.AsPost(),
1283		autorest.WithBaseURL(client.BaseURI),
1284		autorest.WithPathParameters("/Applications/{applicationId}/$/Delete", pathParameters),
1285		autorest.WithQueryParameters(queryParameters))
1286	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1287}
1288
1289// DeleteApplicationSender sends the DeleteApplication request. The method will close the
1290// http.Response Body if it receives an error.
1291func (client BaseClient) DeleteApplicationSender(req *http.Request) (*http.Response, error) {
1292	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1293}
1294
1295// DeleteApplicationResponder handles the response to the DeleteApplication request. The method always
1296// closes the http.Response Body.
1297func (client BaseClient) DeleteApplicationResponder(resp *http.Response) (result autorest.Response, err error) {
1298	err = autorest.Respond(
1299		resp,
1300		client.ByInspecting(),
1301		azure.WithErrorUnlessStatusCode(http.StatusOK),
1302		autorest.ByClosing())
1303	result.Response = resp
1304	return
1305}
1306
1307// DeleteBackupPolicy deletes an existing backup policy. A backup policy must be created before it can be deleted. A
1308// currently active backup policy, associated with any Service Fabric application, service or partition, cannot be
1309// deleted without first deleting the mapping.
1310// Parameters:
1311// backupPolicyName - the name of the backup policy.
1312// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1313// duration that the client is willing to wait for the requested operation to complete. The default value for
1314// this parameter is 60 seconds.
1315func (client BaseClient) DeleteBackupPolicy(ctx context.Context, backupPolicyName string, timeout *int64) (result autorest.Response, err error) {
1316	if tracing.IsEnabled() {
1317		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteBackupPolicy")
1318		defer func() {
1319			sc := -1
1320			if result.Response != nil {
1321				sc = result.Response.StatusCode
1322			}
1323			tracing.EndSpan(ctx, sc, err)
1324		}()
1325	}
1326	if err := validation.Validate([]validation.Validation{
1327		{TargetValue: timeout,
1328			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1329				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1330					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1331				}}}}}); err != nil {
1332		return result, validation.NewError("servicefabric.BaseClient", "DeleteBackupPolicy", err.Error())
1333	}
1334
1335	req, err := client.DeleteBackupPolicyPreparer(ctx, backupPolicyName, timeout)
1336	if err != nil {
1337		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", nil, "Failure preparing request")
1338		return
1339	}
1340
1341	resp, err := client.DeleteBackupPolicySender(req)
1342	if err != nil {
1343		result.Response = resp
1344		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", resp, "Failure sending request")
1345		return
1346	}
1347
1348	result, err = client.DeleteBackupPolicyResponder(resp)
1349	if err != nil {
1350		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", resp, "Failure responding to request")
1351	}
1352
1353	return
1354}
1355
1356// DeleteBackupPolicyPreparer prepares the DeleteBackupPolicy request.
1357func (client BaseClient) DeleteBackupPolicyPreparer(ctx context.Context, backupPolicyName string, timeout *int64) (*http.Request, error) {
1358	pathParameters := map[string]interface{}{
1359		"backupPolicyName": autorest.Encode("path", backupPolicyName),
1360	}
1361
1362	const APIVersion = "6.2-preview"
1363	queryParameters := map[string]interface{}{
1364		"api-version": APIVersion,
1365	}
1366	if timeout != nil {
1367		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1368	} else {
1369		queryParameters["timeout"] = autorest.Encode("query", 60)
1370	}
1371
1372	preparer := autorest.CreatePreparer(
1373		autorest.AsPost(),
1374		autorest.WithBaseURL(client.BaseURI),
1375		autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/Delete", pathParameters),
1376		autorest.WithQueryParameters(queryParameters))
1377	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1378}
1379
1380// DeleteBackupPolicySender sends the DeleteBackupPolicy request. The method will close the
1381// http.Response Body if it receives an error.
1382func (client BaseClient) DeleteBackupPolicySender(req *http.Request) (*http.Response, error) {
1383	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1384}
1385
1386// DeleteBackupPolicyResponder handles the response to the DeleteBackupPolicy request. The method always
1387// closes the http.Response Body.
1388func (client BaseClient) DeleteBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
1389	err = autorest.Respond(
1390		resp,
1391		client.ByInspecting(),
1392		azure.WithErrorUnlessStatusCode(http.StatusOK),
1393		autorest.ByClosing())
1394	result.Response = resp
1395	return
1396}
1397
1398// DeleteImageStoreContent deletes existing image store content being found within the given image store relative path.
1399// This can be used to delete uploaded application packages once they are provisioned.
1400// Parameters:
1401// contentPath - relative path to file or folder in the image store from its root.
1402// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1403// duration that the client is willing to wait for the requested operation to complete. The default value for
1404// this parameter is 60 seconds.
1405func (client BaseClient) DeleteImageStoreContent(ctx context.Context, contentPath string, timeout *int64) (result autorest.Response, err error) {
1406	if tracing.IsEnabled() {
1407		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImageStoreContent")
1408		defer func() {
1409			sc := -1
1410			if result.Response != nil {
1411				sc = result.Response.StatusCode
1412			}
1413			tracing.EndSpan(ctx, sc, err)
1414		}()
1415	}
1416	if err := validation.Validate([]validation.Validation{
1417		{TargetValue: timeout,
1418			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1419				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1420					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1421				}}}}}); err != nil {
1422		return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreContent", err.Error())
1423	}
1424
1425	req, err := client.DeleteImageStoreContentPreparer(ctx, contentPath, timeout)
1426	if err != nil {
1427		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", nil, "Failure preparing request")
1428		return
1429	}
1430
1431	resp, err := client.DeleteImageStoreContentSender(req)
1432	if err != nil {
1433		result.Response = resp
1434		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", resp, "Failure sending request")
1435		return
1436	}
1437
1438	result, err = client.DeleteImageStoreContentResponder(resp)
1439	if err != nil {
1440		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", resp, "Failure responding to request")
1441	}
1442
1443	return
1444}
1445
1446// DeleteImageStoreContentPreparer prepares the DeleteImageStoreContent request.
1447func (client BaseClient) DeleteImageStoreContentPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) {
1448	pathParameters := map[string]interface{}{
1449		"contentPath": autorest.Encode("path", contentPath),
1450	}
1451
1452	const APIVersion = "6.0"
1453	queryParameters := map[string]interface{}{
1454		"api-version": APIVersion,
1455	}
1456	if timeout != nil {
1457		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1458	} else {
1459		queryParameters["timeout"] = autorest.Encode("query", 60)
1460	}
1461
1462	preparer := autorest.CreatePreparer(
1463		autorest.AsDelete(),
1464		autorest.WithBaseURL(client.BaseURI),
1465		autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters),
1466		autorest.WithQueryParameters(queryParameters))
1467	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1468}
1469
1470// DeleteImageStoreContentSender sends the DeleteImageStoreContent request. The method will close the
1471// http.Response Body if it receives an error.
1472func (client BaseClient) DeleteImageStoreContentSender(req *http.Request) (*http.Response, error) {
1473	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1474}
1475
1476// DeleteImageStoreContentResponder handles the response to the DeleteImageStoreContent request. The method always
1477// closes the http.Response Body.
1478func (client BaseClient) DeleteImageStoreContentResponder(resp *http.Response) (result autorest.Response, err error) {
1479	err = autorest.Respond(
1480		resp,
1481		client.ByInspecting(),
1482		azure.WithErrorUnlessStatusCode(http.StatusOK),
1483		autorest.ByClosing())
1484	result.Response = resp
1485	return
1486}
1487
1488// DeleteImageStoreUploadSession the DELETE request will cause the existing upload session to expire and remove any
1489// previously uploaded file chunks.
1490// Parameters:
1491// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session
1492// which keeps track of all file chunks until it is committed.
1493// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1494// duration that the client is willing to wait for the requested operation to complete. The default value for
1495// this parameter is 60 seconds.
1496func (client BaseClient) DeleteImageStoreUploadSession(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
1497	if tracing.IsEnabled() {
1498		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImageStoreUploadSession")
1499		defer func() {
1500			sc := -1
1501			if result.Response != nil {
1502				sc = result.Response.StatusCode
1503			}
1504			tracing.EndSpan(ctx, sc, err)
1505		}()
1506	}
1507	if err := validation.Validate([]validation.Validation{
1508		{TargetValue: timeout,
1509			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1510				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1511					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1512				}}}}}); err != nil {
1513		return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreUploadSession", err.Error())
1514	}
1515
1516	req, err := client.DeleteImageStoreUploadSessionPreparer(ctx, sessionID, timeout)
1517	if err != nil {
1518		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", nil, "Failure preparing request")
1519		return
1520	}
1521
1522	resp, err := client.DeleteImageStoreUploadSessionSender(req)
1523	if err != nil {
1524		result.Response = resp
1525		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", resp, "Failure sending request")
1526		return
1527	}
1528
1529	result, err = client.DeleteImageStoreUploadSessionResponder(resp)
1530	if err != nil {
1531		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", resp, "Failure responding to request")
1532	}
1533
1534	return
1535}
1536
1537// DeleteImageStoreUploadSessionPreparer prepares the DeleteImageStoreUploadSession request.
1538func (client BaseClient) DeleteImageStoreUploadSessionPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) {
1539	const APIVersion = "6.0"
1540	queryParameters := map[string]interface{}{
1541		"api-version": APIVersion,
1542		"session-id":  autorest.Encode("query", sessionID),
1543	}
1544	if timeout != nil {
1545		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1546	} else {
1547		queryParameters["timeout"] = autorest.Encode("query", 60)
1548	}
1549
1550	preparer := autorest.CreatePreparer(
1551		autorest.AsDelete(),
1552		autorest.WithBaseURL(client.BaseURI),
1553		autorest.WithPath("/ImageStore/$/DeleteUploadSession"),
1554		autorest.WithQueryParameters(queryParameters))
1555	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1556}
1557
1558// DeleteImageStoreUploadSessionSender sends the DeleteImageStoreUploadSession request. The method will close the
1559// http.Response Body if it receives an error.
1560func (client BaseClient) DeleteImageStoreUploadSessionSender(req *http.Request) (*http.Response, error) {
1561	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1562}
1563
1564// DeleteImageStoreUploadSessionResponder handles the response to the DeleteImageStoreUploadSession request. The method always
1565// closes the http.Response Body.
1566func (client BaseClient) DeleteImageStoreUploadSessionResponder(resp *http.Response) (result autorest.Response, err error) {
1567	err = autorest.Respond(
1568		resp,
1569		client.ByInspecting(),
1570		azure.WithErrorUnlessStatusCode(http.StatusOK),
1571		autorest.ByClosing())
1572	result.Response = resp
1573	return
1574}
1575
1576// DeleteName deletes the specified Service Fabric name. A name must be created before it can be deleted. Deleting a
1577// name with child properties will fail.
1578// Parameters:
1579// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
1580// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1581// duration that the client is willing to wait for the requested operation to complete. The default value for
1582// this parameter is 60 seconds.
1583func (client BaseClient) DeleteName(ctx context.Context, nameID string, timeout *int64) (result autorest.Response, err error) {
1584	if tracing.IsEnabled() {
1585		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteName")
1586		defer func() {
1587			sc := -1
1588			if result.Response != nil {
1589				sc = result.Response.StatusCode
1590			}
1591			tracing.EndSpan(ctx, sc, err)
1592		}()
1593	}
1594	if err := validation.Validate([]validation.Validation{
1595		{TargetValue: timeout,
1596			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1597				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1598					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1599				}}}}}); err != nil {
1600		return result, validation.NewError("servicefabric.BaseClient", "DeleteName", err.Error())
1601	}
1602
1603	req, err := client.DeleteNamePreparer(ctx, nameID, timeout)
1604	if err != nil {
1605		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", nil, "Failure preparing request")
1606		return
1607	}
1608
1609	resp, err := client.DeleteNameSender(req)
1610	if err != nil {
1611		result.Response = resp
1612		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", resp, "Failure sending request")
1613		return
1614	}
1615
1616	result, err = client.DeleteNameResponder(resp)
1617	if err != nil {
1618		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", resp, "Failure responding to request")
1619	}
1620
1621	return
1622}
1623
1624// DeleteNamePreparer prepares the DeleteName request.
1625func (client BaseClient) DeleteNamePreparer(ctx context.Context, nameID string, timeout *int64) (*http.Request, error) {
1626	pathParameters := map[string]interface{}{
1627		"nameId": nameID,
1628	}
1629
1630	const APIVersion = "6.0"
1631	queryParameters := map[string]interface{}{
1632		"api-version": APIVersion,
1633	}
1634	if timeout != nil {
1635		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1636	} else {
1637		queryParameters["timeout"] = autorest.Encode("query", 60)
1638	}
1639
1640	preparer := autorest.CreatePreparer(
1641		autorest.AsDelete(),
1642		autorest.WithBaseURL(client.BaseURI),
1643		autorest.WithPathParameters("/Names/{nameId}", pathParameters),
1644		autorest.WithQueryParameters(queryParameters))
1645	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1646}
1647
1648// DeleteNameSender sends the DeleteName request. The method will close the
1649// http.Response Body if it receives an error.
1650func (client BaseClient) DeleteNameSender(req *http.Request) (*http.Response, error) {
1651	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1652}
1653
1654// DeleteNameResponder handles the response to the DeleteName request. The method always
1655// closes the http.Response Body.
1656func (client BaseClient) DeleteNameResponder(resp *http.Response) (result autorest.Response, err error) {
1657	err = autorest.Respond(
1658		resp,
1659		client.ByInspecting(),
1660		azure.WithErrorUnlessStatusCode(http.StatusOK),
1661		autorest.ByClosing())
1662	result.Response = resp
1663	return
1664}
1665
1666// DeleteProperty deletes the specified Service Fabric property under a given name. A property must be created before
1667// it can be deleted.
1668// Parameters:
1669// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
1670// propertyName - specifies the name of the property to get.
1671// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1672// duration that the client is willing to wait for the requested operation to complete. The default value for
1673// this parameter is 60 seconds.
1674func (client BaseClient) DeleteProperty(ctx context.Context, nameID string, propertyName string, timeout *int64) (result autorest.Response, err error) {
1675	if tracing.IsEnabled() {
1676		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteProperty")
1677		defer func() {
1678			sc := -1
1679			if result.Response != nil {
1680				sc = result.Response.StatusCode
1681			}
1682			tracing.EndSpan(ctx, sc, err)
1683		}()
1684	}
1685	if err := validation.Validate([]validation.Validation{
1686		{TargetValue: timeout,
1687			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1688				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1689					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1690				}}}}}); err != nil {
1691		return result, validation.NewError("servicefabric.BaseClient", "DeleteProperty", err.Error())
1692	}
1693
1694	req, err := client.DeletePropertyPreparer(ctx, nameID, propertyName, timeout)
1695	if err != nil {
1696		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", nil, "Failure preparing request")
1697		return
1698	}
1699
1700	resp, err := client.DeletePropertySender(req)
1701	if err != nil {
1702		result.Response = resp
1703		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", resp, "Failure sending request")
1704		return
1705	}
1706
1707	result, err = client.DeletePropertyResponder(resp)
1708	if err != nil {
1709		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", resp, "Failure responding to request")
1710	}
1711
1712	return
1713}
1714
1715// DeletePropertyPreparer prepares the DeleteProperty request.
1716func (client BaseClient) DeletePropertyPreparer(ctx context.Context, nameID string, propertyName string, timeout *int64) (*http.Request, error) {
1717	pathParameters := map[string]interface{}{
1718		"nameId": nameID,
1719	}
1720
1721	const APIVersion = "6.0"
1722	queryParameters := map[string]interface{}{
1723		"api-version":  APIVersion,
1724		"PropertyName": autorest.Encode("query", propertyName),
1725	}
1726	if timeout != nil {
1727		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1728	} else {
1729		queryParameters["timeout"] = autorest.Encode("query", 60)
1730	}
1731
1732	preparer := autorest.CreatePreparer(
1733		autorest.AsDelete(),
1734		autorest.WithBaseURL(client.BaseURI),
1735		autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters),
1736		autorest.WithQueryParameters(queryParameters))
1737	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1738}
1739
1740// DeletePropertySender sends the DeleteProperty request. The method will close the
1741// http.Response Body if it receives an error.
1742func (client BaseClient) DeletePropertySender(req *http.Request) (*http.Response, error) {
1743	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1744}
1745
1746// DeletePropertyResponder handles the response to the DeleteProperty request. The method always
1747// closes the http.Response Body.
1748func (client BaseClient) DeletePropertyResponder(resp *http.Response) (result autorest.Response, err error) {
1749	err = autorest.Respond(
1750		resp,
1751		client.ByInspecting(),
1752		azure.WithErrorUnlessStatusCode(http.StatusOK),
1753		autorest.ByClosing())
1754	result.Response = resp
1755	return
1756}
1757
1758// DeleteRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your code.
1759// Parameters:
1760// repairTaskDeleteDescription - describes the repair task to be deleted.
1761func (client BaseClient) DeleteRepairTask(ctx context.Context, repairTaskDeleteDescription RepairTaskDeleteDescription) (result autorest.Response, err error) {
1762	if tracing.IsEnabled() {
1763		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteRepairTask")
1764		defer func() {
1765			sc := -1
1766			if result.Response != nil {
1767				sc = result.Response.StatusCode
1768			}
1769			tracing.EndSpan(ctx, sc, err)
1770		}()
1771	}
1772	if err := validation.Validate([]validation.Validation{
1773		{TargetValue: repairTaskDeleteDescription,
1774			Constraints: []validation.Constraint{{Target: "repairTaskDeleteDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
1775		return result, validation.NewError("servicefabric.BaseClient", "DeleteRepairTask", err.Error())
1776	}
1777
1778	req, err := client.DeleteRepairTaskPreparer(ctx, repairTaskDeleteDescription)
1779	if err != nil {
1780		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", nil, "Failure preparing request")
1781		return
1782	}
1783
1784	resp, err := client.DeleteRepairTaskSender(req)
1785	if err != nil {
1786		result.Response = resp
1787		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", resp, "Failure sending request")
1788		return
1789	}
1790
1791	result, err = client.DeleteRepairTaskResponder(resp)
1792	if err != nil {
1793		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", resp, "Failure responding to request")
1794	}
1795
1796	return
1797}
1798
1799// DeleteRepairTaskPreparer prepares the DeleteRepairTask request.
1800func (client BaseClient) DeleteRepairTaskPreparer(ctx context.Context, repairTaskDeleteDescription RepairTaskDeleteDescription) (*http.Request, error) {
1801	const APIVersion = "6.0"
1802	queryParameters := map[string]interface{}{
1803		"api-version": APIVersion,
1804	}
1805
1806	preparer := autorest.CreatePreparer(
1807		autorest.AsContentType("application/json; charset=utf-8"),
1808		autorest.AsPost(),
1809		autorest.WithBaseURL(client.BaseURI),
1810		autorest.WithPath("/$/DeleteRepairTask"),
1811		autorest.WithJSON(repairTaskDeleteDescription),
1812		autorest.WithQueryParameters(queryParameters))
1813	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1814}
1815
1816// DeleteRepairTaskSender sends the DeleteRepairTask request. The method will close the
1817// http.Response Body if it receives an error.
1818func (client BaseClient) DeleteRepairTaskSender(req *http.Request) (*http.Response, error) {
1819	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1820}
1821
1822// DeleteRepairTaskResponder handles the response to the DeleteRepairTask request. The method always
1823// closes the http.Response Body.
1824func (client BaseClient) DeleteRepairTaskResponder(resp *http.Response) (result autorest.Response, err error) {
1825	err = autorest.Respond(
1826		resp,
1827		client.ByInspecting(),
1828		azure.WithErrorUnlessStatusCode(http.StatusOK),
1829		autorest.ByClosing())
1830	result.Response = resp
1831	return
1832}
1833
1834// DeleteService deletes an existing Service Fabric service. A service must be created before it can be deleted. By
1835// default, Service Fabric will try to close service replicas in a graceful manner and then delete the service.
1836// However, if the service is having issues closing the replica gracefully, the delete operation may take a long time
1837// or get stuck. Use the optional ForceRemove flag to skip the graceful close sequence and forcefully delete the
1838// service.
1839// Parameters:
1840// serviceID - the identity of the service. This is typically the full name of the service without the
1841// 'fabric:' URI scheme.
1842// Starting from version 6.0, hierarchical names are delimited with the "~" character.
1843// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
1844// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
1845// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful
1846// shutdown sequence. This parameter can be used to forcefully delete an application or service for which
1847// delete is timing out due to issues in the service code that prevents graceful close of replicas.
1848// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1849// duration that the client is willing to wait for the requested operation to complete. The default value for
1850// this parameter is 60 seconds.
1851func (client BaseClient) DeleteService(ctx context.Context, serviceID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) {
1852	if tracing.IsEnabled() {
1853		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteService")
1854		defer func() {
1855			sc := -1
1856			if result.Response != nil {
1857				sc = result.Response.StatusCode
1858			}
1859			tracing.EndSpan(ctx, sc, err)
1860		}()
1861	}
1862	if err := validation.Validate([]validation.Validation{
1863		{TargetValue: timeout,
1864			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1865				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1866					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1867				}}}}}); err != nil {
1868		return result, validation.NewError("servicefabric.BaseClient", "DeleteService", err.Error())
1869	}
1870
1871	req, err := client.DeleteServicePreparer(ctx, serviceID, forceRemove, timeout)
1872	if err != nil {
1873		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", nil, "Failure preparing request")
1874		return
1875	}
1876
1877	resp, err := client.DeleteServiceSender(req)
1878	if err != nil {
1879		result.Response = resp
1880		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", resp, "Failure sending request")
1881		return
1882	}
1883
1884	result, err = client.DeleteServiceResponder(resp)
1885	if err != nil {
1886		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", resp, "Failure responding to request")
1887	}
1888
1889	return
1890}
1891
1892// DeleteServicePreparer prepares the DeleteService request.
1893func (client BaseClient) DeleteServicePreparer(ctx context.Context, serviceID string, forceRemove *bool, timeout *int64) (*http.Request, error) {
1894	pathParameters := map[string]interface{}{
1895		"serviceId": serviceID,
1896	}
1897
1898	const APIVersion = "6.0"
1899	queryParameters := map[string]interface{}{
1900		"api-version": APIVersion,
1901	}
1902	if forceRemove != nil {
1903		queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove)
1904	}
1905	if timeout != nil {
1906		queryParameters["timeout"] = autorest.Encode("query", *timeout)
1907	} else {
1908		queryParameters["timeout"] = autorest.Encode("query", 60)
1909	}
1910
1911	preparer := autorest.CreatePreparer(
1912		autorest.AsPost(),
1913		autorest.WithBaseURL(client.BaseURI),
1914		autorest.WithPathParameters("/Services/{serviceId}/$/Delete", pathParameters),
1915		autorest.WithQueryParameters(queryParameters))
1916	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1917}
1918
1919// DeleteServiceSender sends the DeleteService request. The method will close the
1920// http.Response Body if it receives an error.
1921func (client BaseClient) DeleteServiceSender(req *http.Request) (*http.Response, error) {
1922	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1923}
1924
1925// DeleteServiceResponder handles the response to the DeleteService request. The method always
1926// closes the http.Response Body.
1927func (client BaseClient) DeleteServiceResponder(resp *http.Response) (result autorest.Response, err error) {
1928	err = autorest.Respond(
1929		resp,
1930		client.ByInspecting(),
1931		azure.WithErrorUnlessStatusCode(http.StatusOK),
1932		autorest.ByClosing())
1933	result.Response = resp
1934	return
1935}
1936
1937// DeployServicePackageToNode this API provides a way to download code packages including the container images on a
1938// specific node outside of the normal application deployment and upgrade path. This is useful for the large code
1939// packages and container images to be present on the node before the actual application deployment and upgrade, thus
1940// significantly reducing the total time required for the deployment or upgrade.
1941// Parameters:
1942// nodeName - the name of the node.
1943// deployServicePackageToNodeDescription - describes information for deploying a service package to a Service
1944// Fabric node.
1945// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
1946// duration that the client is willing to wait for the requested operation to complete. The default value for
1947// this parameter is 60 seconds.
1948func (client BaseClient) DeployServicePackageToNode(ctx context.Context, nodeName string, deployServicePackageToNodeDescription DeployServicePackageToNodeDescription, timeout *int64) (result autorest.Response, err error) {
1949	if tracing.IsEnabled() {
1950		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeployServicePackageToNode")
1951		defer func() {
1952			sc := -1
1953			if result.Response != nil {
1954				sc = result.Response.StatusCode
1955			}
1956			tracing.EndSpan(ctx, sc, err)
1957		}()
1958	}
1959	if err := validation.Validate([]validation.Validation{
1960		{TargetValue: deployServicePackageToNodeDescription,
1961			Constraints: []validation.Constraint{{Target: "deployServicePackageToNodeDescription.ServiceManifestName", Name: validation.Null, Rule: true, Chain: nil},
1962				{Target: "deployServicePackageToNodeDescription.ApplicationTypeName", Name: validation.Null, Rule: true, Chain: nil},
1963				{Target: "deployServicePackageToNodeDescription.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil},
1964				{Target: "deployServicePackageToNodeDescription.NodeName", Name: validation.Null, Rule: true, Chain: nil}}},
1965		{TargetValue: timeout,
1966			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
1967				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
1968					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
1969				}}}}}); err != nil {
1970		return result, validation.NewError("servicefabric.BaseClient", "DeployServicePackageToNode", err.Error())
1971	}
1972
1973	req, err := client.DeployServicePackageToNodePreparer(ctx, nodeName, deployServicePackageToNodeDescription, timeout)
1974	if err != nil {
1975		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", nil, "Failure preparing request")
1976		return
1977	}
1978
1979	resp, err := client.DeployServicePackageToNodeSender(req)
1980	if err != nil {
1981		result.Response = resp
1982		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", resp, "Failure sending request")
1983		return
1984	}
1985
1986	result, err = client.DeployServicePackageToNodeResponder(resp)
1987	if err != nil {
1988		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", resp, "Failure responding to request")
1989	}
1990
1991	return
1992}
1993
1994// DeployServicePackageToNodePreparer prepares the DeployServicePackageToNode request.
1995func (client BaseClient) DeployServicePackageToNodePreparer(ctx context.Context, nodeName string, deployServicePackageToNodeDescription DeployServicePackageToNodeDescription, timeout *int64) (*http.Request, error) {
1996	pathParameters := map[string]interface{}{
1997		"nodeName": autorest.Encode("path", nodeName),
1998	}
1999
2000	const APIVersion = "6.0"
2001	queryParameters := map[string]interface{}{
2002		"api-version": APIVersion,
2003	}
2004	if timeout != nil {
2005		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2006	} else {
2007		queryParameters["timeout"] = autorest.Encode("query", 60)
2008	}
2009
2010	preparer := autorest.CreatePreparer(
2011		autorest.AsContentType("application/json; charset=utf-8"),
2012		autorest.AsPost(),
2013		autorest.WithBaseURL(client.BaseURI),
2014		autorest.WithPathParameters("/Nodes/{nodeName}/$/DeployServicePackage", pathParameters),
2015		autorest.WithJSON(deployServicePackageToNodeDescription),
2016		autorest.WithQueryParameters(queryParameters))
2017	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2018}
2019
2020// DeployServicePackageToNodeSender sends the DeployServicePackageToNode request. The method will close the
2021// http.Response Body if it receives an error.
2022func (client BaseClient) DeployServicePackageToNodeSender(req *http.Request) (*http.Response, error) {
2023	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2024}
2025
2026// DeployServicePackageToNodeResponder handles the response to the DeployServicePackageToNode request. The method always
2027// closes the http.Response Body.
2028func (client BaseClient) DeployServicePackageToNodeResponder(resp *http.Response) (result autorest.Response, err error) {
2029	err = autorest.Respond(
2030		resp,
2031		client.ByInspecting(),
2032		azure.WithErrorUnlessStatusCode(http.StatusOK),
2033		autorest.ByClosing())
2034	result.Response = resp
2035	return
2036}
2037
2038// DisableApplicationBackup disables periodic backup of Service Fabric application which was previously enabled.
2039// Parameters:
2040// applicationID - the identity of the application. This is typically the full name of the application without
2041// the 'fabric:' URI scheme.
2042// Starting from version 6.0, hierarchical names are delimited with the "~" character.
2043// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
2044// in 6.0+ and "myapp/app1" in previous versions.
2045// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2046// duration that the client is willing to wait for the requested operation to complete. The default value for
2047// this parameter is 60 seconds.
2048func (client BaseClient) DisableApplicationBackup(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) {
2049	if tracing.IsEnabled() {
2050		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableApplicationBackup")
2051		defer func() {
2052			sc := -1
2053			if result.Response != nil {
2054				sc = result.Response.StatusCode
2055			}
2056			tracing.EndSpan(ctx, sc, err)
2057		}()
2058	}
2059	if err := validation.Validate([]validation.Validation{
2060		{TargetValue: timeout,
2061			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2062				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2063					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2064				}}}}}); err != nil {
2065		return result, validation.NewError("servicefabric.BaseClient", "DisableApplicationBackup", err.Error())
2066	}
2067
2068	req, err := client.DisableApplicationBackupPreparer(ctx, applicationID, timeout)
2069	if err != nil {
2070		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", nil, "Failure preparing request")
2071		return
2072	}
2073
2074	resp, err := client.DisableApplicationBackupSender(req)
2075	if err != nil {
2076		result.Response = resp
2077		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", resp, "Failure sending request")
2078		return
2079	}
2080
2081	result, err = client.DisableApplicationBackupResponder(resp)
2082	if err != nil {
2083		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", resp, "Failure responding to request")
2084	}
2085
2086	return
2087}
2088
2089// DisableApplicationBackupPreparer prepares the DisableApplicationBackup request.
2090func (client BaseClient) DisableApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
2091	pathParameters := map[string]interface{}{
2092		"applicationId": applicationID,
2093	}
2094
2095	const APIVersion = "6.2-preview"
2096	queryParameters := map[string]interface{}{
2097		"api-version": APIVersion,
2098	}
2099	if timeout != nil {
2100		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2101	} else {
2102		queryParameters["timeout"] = autorest.Encode("query", 60)
2103	}
2104
2105	preparer := autorest.CreatePreparer(
2106		autorest.AsPost(),
2107		autorest.WithBaseURL(client.BaseURI),
2108		autorest.WithPathParameters("/Applications/{applicationId}/$/DisableBackup", pathParameters),
2109		autorest.WithQueryParameters(queryParameters))
2110	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2111}
2112
2113// DisableApplicationBackupSender sends the DisableApplicationBackup request. The method will close the
2114// http.Response Body if it receives an error.
2115func (client BaseClient) DisableApplicationBackupSender(req *http.Request) (*http.Response, error) {
2116	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2117}
2118
2119// DisableApplicationBackupResponder handles the response to the DisableApplicationBackup request. The method always
2120// closes the http.Response Body.
2121func (client BaseClient) DisableApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2122	err = autorest.Respond(
2123		resp,
2124		client.ByInspecting(),
2125		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2126		autorest.ByClosing())
2127	result.Response = resp
2128	return
2129}
2130
2131// DisableNode deactivate a Service Fabric cluster node with the specified deactivation intent. Once the deactivation
2132// is in progress, the deactivation intent can be increased, but not decreased (for example, a node which is was
2133// deactivated with the Pause intent can be deactivated further with Restart, but not the other way around. Nodes may
2134// be reactivated using the Activate a node operation any time after they are deactivated. If the deactivation is not
2135// complete this will cancel the deactivation. A node which goes down and comes back up while deactivated will still
2136// need to be reactivated before services will be placed on that node.
2137// Parameters:
2138// nodeName - the name of the node.
2139// deactivationIntentDescription - describes the intent or reason for deactivating the node.
2140// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2141// duration that the client is willing to wait for the requested operation to complete. The default value for
2142// this parameter is 60 seconds.
2143func (client BaseClient) DisableNode(ctx context.Context, nodeName string, deactivationIntentDescription DeactivationIntentDescription, timeout *int64) (result autorest.Response, err error) {
2144	if tracing.IsEnabled() {
2145		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableNode")
2146		defer func() {
2147			sc := -1
2148			if result.Response != nil {
2149				sc = result.Response.StatusCode
2150			}
2151			tracing.EndSpan(ctx, sc, err)
2152		}()
2153	}
2154	if err := validation.Validate([]validation.Validation{
2155		{TargetValue: timeout,
2156			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2157				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2158					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2159				}}}}}); err != nil {
2160		return result, validation.NewError("servicefabric.BaseClient", "DisableNode", err.Error())
2161	}
2162
2163	req, err := client.DisableNodePreparer(ctx, nodeName, deactivationIntentDescription, timeout)
2164	if err != nil {
2165		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", nil, "Failure preparing request")
2166		return
2167	}
2168
2169	resp, err := client.DisableNodeSender(req)
2170	if err != nil {
2171		result.Response = resp
2172		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", resp, "Failure sending request")
2173		return
2174	}
2175
2176	result, err = client.DisableNodeResponder(resp)
2177	if err != nil {
2178		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", resp, "Failure responding to request")
2179	}
2180
2181	return
2182}
2183
2184// DisableNodePreparer prepares the DisableNode request.
2185func (client BaseClient) DisableNodePreparer(ctx context.Context, nodeName string, deactivationIntentDescription DeactivationIntentDescription, timeout *int64) (*http.Request, error) {
2186	pathParameters := map[string]interface{}{
2187		"nodeName": autorest.Encode("path", nodeName),
2188	}
2189
2190	const APIVersion = "6.0"
2191	queryParameters := map[string]interface{}{
2192		"api-version": APIVersion,
2193	}
2194	if timeout != nil {
2195		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2196	} else {
2197		queryParameters["timeout"] = autorest.Encode("query", 60)
2198	}
2199
2200	preparer := autorest.CreatePreparer(
2201		autorest.AsContentType("application/json; charset=utf-8"),
2202		autorest.AsPost(),
2203		autorest.WithBaseURL(client.BaseURI),
2204		autorest.WithPathParameters("/Nodes/{nodeName}/$/Deactivate", pathParameters),
2205		autorest.WithJSON(deactivationIntentDescription),
2206		autorest.WithQueryParameters(queryParameters))
2207	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2208}
2209
2210// DisableNodeSender sends the DisableNode request. The method will close the
2211// http.Response Body if it receives an error.
2212func (client BaseClient) DisableNodeSender(req *http.Request) (*http.Response, error) {
2213	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2214}
2215
2216// DisableNodeResponder handles the response to the DisableNode request. The method always
2217// closes the http.Response Body.
2218func (client BaseClient) DisableNodeResponder(resp *http.Response) (result autorest.Response, err error) {
2219	err = autorest.Respond(
2220		resp,
2221		client.ByInspecting(),
2222		azure.WithErrorUnlessStatusCode(http.StatusOK),
2223		autorest.ByClosing())
2224	result.Response = resp
2225	return
2226}
2227
2228// DisablePartitionBackup disables periodic backup of partition which was previously enabled. Backup must be explicitly
2229// enabled before it can be disabled.
2230// In case the backup is enabled for the Service Fabric application or service, which this partition is part of, this
2231// partition would continue to be periodically backed up as per the policy mapped at the higher level entity.
2232// Parameters:
2233// partitionID - the identity of the partition.
2234// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2235// duration that the client is willing to wait for the requested operation to complete. The default value for
2236// this parameter is 60 seconds.
2237func (client BaseClient) DisablePartitionBackup(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
2238	if tracing.IsEnabled() {
2239		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisablePartitionBackup")
2240		defer func() {
2241			sc := -1
2242			if result.Response != nil {
2243				sc = result.Response.StatusCode
2244			}
2245			tracing.EndSpan(ctx, sc, err)
2246		}()
2247	}
2248	if err := validation.Validate([]validation.Validation{
2249		{TargetValue: timeout,
2250			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2251				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2252					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2253				}}}}}); err != nil {
2254		return result, validation.NewError("servicefabric.BaseClient", "DisablePartitionBackup", err.Error())
2255	}
2256
2257	req, err := client.DisablePartitionBackupPreparer(ctx, partitionID, timeout)
2258	if err != nil {
2259		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", nil, "Failure preparing request")
2260		return
2261	}
2262
2263	resp, err := client.DisablePartitionBackupSender(req)
2264	if err != nil {
2265		result.Response = resp
2266		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", resp, "Failure sending request")
2267		return
2268	}
2269
2270	result, err = client.DisablePartitionBackupResponder(resp)
2271	if err != nil {
2272		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", resp, "Failure responding to request")
2273	}
2274
2275	return
2276}
2277
2278// DisablePartitionBackupPreparer prepares the DisablePartitionBackup request.
2279func (client BaseClient) DisablePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
2280	pathParameters := map[string]interface{}{
2281		"partitionId": partitionID,
2282	}
2283
2284	const APIVersion = "6.2-preview"
2285	queryParameters := map[string]interface{}{
2286		"api-version": APIVersion,
2287	}
2288	if timeout != nil {
2289		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2290	} else {
2291		queryParameters["timeout"] = autorest.Encode("query", 60)
2292	}
2293
2294	preparer := autorest.CreatePreparer(
2295		autorest.AsPost(),
2296		autorest.WithBaseURL(client.BaseURI),
2297		autorest.WithPathParameters("/Partitions/{partitionId}/$/DisableBackup", pathParameters),
2298		autorest.WithQueryParameters(queryParameters))
2299	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2300}
2301
2302// DisablePartitionBackupSender sends the DisablePartitionBackup request. The method will close the
2303// http.Response Body if it receives an error.
2304func (client BaseClient) DisablePartitionBackupSender(req *http.Request) (*http.Response, error) {
2305	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2306}
2307
2308// DisablePartitionBackupResponder handles the response to the DisablePartitionBackup request. The method always
2309// closes the http.Response Body.
2310func (client BaseClient) DisablePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2311	err = autorest.Respond(
2312		resp,
2313		client.ByInspecting(),
2314		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2315		autorest.ByClosing())
2316	result.Response = resp
2317	return
2318}
2319
2320// DisableServiceBackup disables periodic backup of Service Fabric service which was previously enabled. Backup must be
2321// explicitly enabled before it can be disabled.
2322// In case the backup is enabled for the Service Fabric application, which this service is part of, this service would
2323// continue to be periodically backed up as per the policy mapped at the application level.
2324// Parameters:
2325// serviceID - the identity of the service. This is typically the full name of the service without the
2326// 'fabric:' URI scheme.
2327// Starting from version 6.0, hierarchical names are delimited with the "~" character.
2328// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
2329// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
2330// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2331// duration that the client is willing to wait for the requested operation to complete. The default value for
2332// this parameter is 60 seconds.
2333func (client BaseClient) DisableServiceBackup(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) {
2334	if tracing.IsEnabled() {
2335		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableServiceBackup")
2336		defer func() {
2337			sc := -1
2338			if result.Response != nil {
2339				sc = result.Response.StatusCode
2340			}
2341			tracing.EndSpan(ctx, sc, err)
2342		}()
2343	}
2344	if err := validation.Validate([]validation.Validation{
2345		{TargetValue: timeout,
2346			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2347				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2348					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2349				}}}}}); err != nil {
2350		return result, validation.NewError("servicefabric.BaseClient", "DisableServiceBackup", err.Error())
2351	}
2352
2353	req, err := client.DisableServiceBackupPreparer(ctx, serviceID, timeout)
2354	if err != nil {
2355		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", nil, "Failure preparing request")
2356		return
2357	}
2358
2359	resp, err := client.DisableServiceBackupSender(req)
2360	if err != nil {
2361		result.Response = resp
2362		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", resp, "Failure sending request")
2363		return
2364	}
2365
2366	result, err = client.DisableServiceBackupResponder(resp)
2367	if err != nil {
2368		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", resp, "Failure responding to request")
2369	}
2370
2371	return
2372}
2373
2374// DisableServiceBackupPreparer prepares the DisableServiceBackup request.
2375func (client BaseClient) DisableServiceBackupPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
2376	pathParameters := map[string]interface{}{
2377		"serviceId": serviceID,
2378	}
2379
2380	const APIVersion = "6.2-preview"
2381	queryParameters := map[string]interface{}{
2382		"api-version": APIVersion,
2383	}
2384	if timeout != nil {
2385		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2386	} else {
2387		queryParameters["timeout"] = autorest.Encode("query", 60)
2388	}
2389
2390	preparer := autorest.CreatePreparer(
2391		autorest.AsPost(),
2392		autorest.WithBaseURL(client.BaseURI),
2393		autorest.WithPathParameters("/Services/{serviceId}/$/DisableBackup", pathParameters),
2394		autorest.WithQueryParameters(queryParameters))
2395	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2396}
2397
2398// DisableServiceBackupSender sends the DisableServiceBackup request. The method will close the
2399// http.Response Body if it receives an error.
2400func (client BaseClient) DisableServiceBackupSender(req *http.Request) (*http.Response, error) {
2401	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2402}
2403
2404// DisableServiceBackupResponder handles the response to the DisableServiceBackup request. The method always
2405// closes the http.Response Body.
2406func (client BaseClient) DisableServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2407	err = autorest.Respond(
2408		resp,
2409		client.ByInspecting(),
2410		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2411		autorest.ByClosing())
2412	result.Response = resp
2413	return
2414}
2415
2416// EnableApplicationBackup enables periodic backup of stateful partitions which are part of this Service Fabric
2417// application. Each partition is backed up individually as per the specified backup policy description.
2418// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup.
2419// Parameters:
2420// applicationID - the identity of the application. This is typically the full name of the application without
2421// the 'fabric:' URI scheme.
2422// Starting from version 6.0, hierarchical names are delimited with the "~" character.
2423// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
2424// in 6.0+ and "myapp/app1" in previous versions.
2425// enableBackupDescription - specifies the parameters for enabling backup.
2426// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2427// duration that the client is willing to wait for the requested operation to complete. The default value for
2428// this parameter is 60 seconds.
2429func (client BaseClient) EnableApplicationBackup(ctx context.Context, applicationID string, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) {
2430	if tracing.IsEnabled() {
2431		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableApplicationBackup")
2432		defer func() {
2433			sc := -1
2434			if result.Response != nil {
2435				sc = result.Response.StatusCode
2436			}
2437			tracing.EndSpan(ctx, sc, err)
2438		}()
2439	}
2440	if err := validation.Validate([]validation.Validation{
2441		{TargetValue: enableBackupDescription,
2442			Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}},
2443		{TargetValue: timeout,
2444			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2445				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2446					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2447				}}}}}); err != nil {
2448		return result, validation.NewError("servicefabric.BaseClient", "EnableApplicationBackup", err.Error())
2449	}
2450
2451	req, err := client.EnableApplicationBackupPreparer(ctx, applicationID, enableBackupDescription, timeout)
2452	if err != nil {
2453		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", nil, "Failure preparing request")
2454		return
2455	}
2456
2457	resp, err := client.EnableApplicationBackupSender(req)
2458	if err != nil {
2459		result.Response = resp
2460		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", resp, "Failure sending request")
2461		return
2462	}
2463
2464	result, err = client.EnableApplicationBackupResponder(resp)
2465	if err != nil {
2466		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", resp, "Failure responding to request")
2467	}
2468
2469	return
2470}
2471
2472// EnableApplicationBackupPreparer prepares the EnableApplicationBackup request.
2473func (client BaseClient) EnableApplicationBackupPreparer(ctx context.Context, applicationID string, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) {
2474	pathParameters := map[string]interface{}{
2475		"applicationId": applicationID,
2476	}
2477
2478	const APIVersion = "6.2-preview"
2479	queryParameters := map[string]interface{}{
2480		"api-version": APIVersion,
2481	}
2482	if timeout != nil {
2483		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2484	} else {
2485		queryParameters["timeout"] = autorest.Encode("query", 60)
2486	}
2487
2488	preparer := autorest.CreatePreparer(
2489		autorest.AsContentType("application/json; charset=utf-8"),
2490		autorest.AsPost(),
2491		autorest.WithBaseURL(client.BaseURI),
2492		autorest.WithPathParameters("/Applications/{applicationId}/$/EnableBackup", pathParameters),
2493		autorest.WithJSON(enableBackupDescription),
2494		autorest.WithQueryParameters(queryParameters))
2495	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2496}
2497
2498// EnableApplicationBackupSender sends the EnableApplicationBackup request. The method will close the
2499// http.Response Body if it receives an error.
2500func (client BaseClient) EnableApplicationBackupSender(req *http.Request) (*http.Response, error) {
2501	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2502}
2503
2504// EnableApplicationBackupResponder handles the response to the EnableApplicationBackup request. The method always
2505// closes the http.Response Body.
2506func (client BaseClient) EnableApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2507	err = autorest.Respond(
2508		resp,
2509		client.ByInspecting(),
2510		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2511		autorest.ByClosing())
2512	result.Response = resp
2513	return
2514}
2515
2516// EnableNode activates a Service Fabric cluster node which is currently deactivated. Once activated, the node will
2517// again become a viable target for placing new replicas, and any deactivated replicas remaining on the node will be
2518// reactivated.
2519// Parameters:
2520// nodeName - the name of the node.
2521// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2522// duration that the client is willing to wait for the requested operation to complete. The default value for
2523// this parameter is 60 seconds.
2524func (client BaseClient) EnableNode(ctx context.Context, nodeName string, timeout *int64) (result autorest.Response, err error) {
2525	if tracing.IsEnabled() {
2526		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableNode")
2527		defer func() {
2528			sc := -1
2529			if result.Response != nil {
2530				sc = result.Response.StatusCode
2531			}
2532			tracing.EndSpan(ctx, sc, err)
2533		}()
2534	}
2535	if err := validation.Validate([]validation.Validation{
2536		{TargetValue: timeout,
2537			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2538				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2539					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2540				}}}}}); err != nil {
2541		return result, validation.NewError("servicefabric.BaseClient", "EnableNode", err.Error())
2542	}
2543
2544	req, err := client.EnableNodePreparer(ctx, nodeName, timeout)
2545	if err != nil {
2546		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", nil, "Failure preparing request")
2547		return
2548	}
2549
2550	resp, err := client.EnableNodeSender(req)
2551	if err != nil {
2552		result.Response = resp
2553		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", resp, "Failure sending request")
2554		return
2555	}
2556
2557	result, err = client.EnableNodeResponder(resp)
2558	if err != nil {
2559		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", resp, "Failure responding to request")
2560	}
2561
2562	return
2563}
2564
2565// EnableNodePreparer prepares the EnableNode request.
2566func (client BaseClient) EnableNodePreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) {
2567	pathParameters := map[string]interface{}{
2568		"nodeName": autorest.Encode("path", nodeName),
2569	}
2570
2571	const APIVersion = "6.0"
2572	queryParameters := map[string]interface{}{
2573		"api-version": APIVersion,
2574	}
2575	if timeout != nil {
2576		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2577	} else {
2578		queryParameters["timeout"] = autorest.Encode("query", 60)
2579	}
2580
2581	preparer := autorest.CreatePreparer(
2582		autorest.AsPost(),
2583		autorest.WithBaseURL(client.BaseURI),
2584		autorest.WithPathParameters("/Nodes/{nodeName}/$/Activate", pathParameters),
2585		autorest.WithQueryParameters(queryParameters))
2586	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2587}
2588
2589// EnableNodeSender sends the EnableNode request. The method will close the
2590// http.Response Body if it receives an error.
2591func (client BaseClient) EnableNodeSender(req *http.Request) (*http.Response, error) {
2592	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2593}
2594
2595// EnableNodeResponder handles the response to the EnableNode request. The method always
2596// closes the http.Response Body.
2597func (client BaseClient) EnableNodeResponder(resp *http.Response) (result autorest.Response, err error) {
2598	err = autorest.Respond(
2599		resp,
2600		client.ByInspecting(),
2601		azure.WithErrorUnlessStatusCode(http.StatusOK),
2602		autorest.ByClosing())
2603	result.Response = resp
2604	return
2605}
2606
2607// EnablePartitionBackup enables periodic backup of stateful persisted partition. Each partition is backed up as per
2608// the specified backup policy description. In case the application or service, which is partition is part of, is
2609// already enabled for backup then this operation would override the policy being used to take the periodic backup of
2610// this partition.
2611// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup.
2612// Parameters:
2613// partitionID - the identity of the partition.
2614// enableBackupDescription - specifies the parameters for enabling backup.
2615// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2616// duration that the client is willing to wait for the requested operation to complete. The default value for
2617// this parameter is 60 seconds.
2618func (client BaseClient) EnablePartitionBackup(ctx context.Context, partitionID uuid.UUID, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) {
2619	if tracing.IsEnabled() {
2620		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnablePartitionBackup")
2621		defer func() {
2622			sc := -1
2623			if result.Response != nil {
2624				sc = result.Response.StatusCode
2625			}
2626			tracing.EndSpan(ctx, sc, err)
2627		}()
2628	}
2629	if err := validation.Validate([]validation.Validation{
2630		{TargetValue: enableBackupDescription,
2631			Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}},
2632		{TargetValue: timeout,
2633			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2634				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2635					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2636				}}}}}); err != nil {
2637		return result, validation.NewError("servicefabric.BaseClient", "EnablePartitionBackup", err.Error())
2638	}
2639
2640	req, err := client.EnablePartitionBackupPreparer(ctx, partitionID, enableBackupDescription, timeout)
2641	if err != nil {
2642		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", nil, "Failure preparing request")
2643		return
2644	}
2645
2646	resp, err := client.EnablePartitionBackupSender(req)
2647	if err != nil {
2648		result.Response = resp
2649		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", resp, "Failure sending request")
2650		return
2651	}
2652
2653	result, err = client.EnablePartitionBackupResponder(resp)
2654	if err != nil {
2655		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", resp, "Failure responding to request")
2656	}
2657
2658	return
2659}
2660
2661// EnablePartitionBackupPreparer prepares the EnablePartitionBackup request.
2662func (client BaseClient) EnablePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) {
2663	pathParameters := map[string]interface{}{
2664		"partitionId": partitionID,
2665	}
2666
2667	const APIVersion = "6.2-preview"
2668	queryParameters := map[string]interface{}{
2669		"api-version": APIVersion,
2670	}
2671	if timeout != nil {
2672		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2673	} else {
2674		queryParameters["timeout"] = autorest.Encode("query", 60)
2675	}
2676
2677	preparer := autorest.CreatePreparer(
2678		autorest.AsContentType("application/json; charset=utf-8"),
2679		autorest.AsPost(),
2680		autorest.WithBaseURL(client.BaseURI),
2681		autorest.WithPathParameters("/Partitions/{partitionId}/$/EnableBackup", pathParameters),
2682		autorest.WithJSON(enableBackupDescription),
2683		autorest.WithQueryParameters(queryParameters))
2684	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2685}
2686
2687// EnablePartitionBackupSender sends the EnablePartitionBackup request. The method will close the
2688// http.Response Body if it receives an error.
2689func (client BaseClient) EnablePartitionBackupSender(req *http.Request) (*http.Response, error) {
2690	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2691}
2692
2693// EnablePartitionBackupResponder handles the response to the EnablePartitionBackup request. The method always
2694// closes the http.Response Body.
2695func (client BaseClient) EnablePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2696	err = autorest.Respond(
2697		resp,
2698		client.ByInspecting(),
2699		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2700		autorest.ByClosing())
2701	result.Response = resp
2702	return
2703}
2704
2705// EnableServiceBackup enables periodic backup of stateful partitions which are part of this Service Fabric service.
2706// Each partition is backed up individually as per the specified backup policy description. In case the application,
2707// which the service is part of, is already enabled for backup then this operation would override the policy being used
2708// to take the periodic backup for this service and its partitions (unless explicitly overridden at the partition
2709// level).
2710// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup.
2711// Parameters:
2712// serviceID - the identity of the service. This is typically the full name of the service without the
2713// 'fabric:' URI scheme.
2714// Starting from version 6.0, hierarchical names are delimited with the "~" character.
2715// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
2716// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
2717// enableBackupDescription - specifies the parameters for enabling backup.
2718// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2719// duration that the client is willing to wait for the requested operation to complete. The default value for
2720// this parameter is 60 seconds.
2721func (client BaseClient) EnableServiceBackup(ctx context.Context, serviceID string, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) {
2722	if tracing.IsEnabled() {
2723		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableServiceBackup")
2724		defer func() {
2725			sc := -1
2726			if result.Response != nil {
2727				sc = result.Response.StatusCode
2728			}
2729			tracing.EndSpan(ctx, sc, err)
2730		}()
2731	}
2732	if err := validation.Validate([]validation.Validation{
2733		{TargetValue: enableBackupDescription,
2734			Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}},
2735		{TargetValue: timeout,
2736			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2737				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2738					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2739				}}}}}); err != nil {
2740		return result, validation.NewError("servicefabric.BaseClient", "EnableServiceBackup", err.Error())
2741	}
2742
2743	req, err := client.EnableServiceBackupPreparer(ctx, serviceID, enableBackupDescription, timeout)
2744	if err != nil {
2745		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", nil, "Failure preparing request")
2746		return
2747	}
2748
2749	resp, err := client.EnableServiceBackupSender(req)
2750	if err != nil {
2751		result.Response = resp
2752		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", resp, "Failure sending request")
2753		return
2754	}
2755
2756	result, err = client.EnableServiceBackupResponder(resp)
2757	if err != nil {
2758		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", resp, "Failure responding to request")
2759	}
2760
2761	return
2762}
2763
2764// EnableServiceBackupPreparer prepares the EnableServiceBackup request.
2765func (client BaseClient) EnableServiceBackupPreparer(ctx context.Context, serviceID string, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) {
2766	pathParameters := map[string]interface{}{
2767		"serviceId": serviceID,
2768	}
2769
2770	const APIVersion = "6.2-preview"
2771	queryParameters := map[string]interface{}{
2772		"api-version": APIVersion,
2773	}
2774	if timeout != nil {
2775		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2776	} else {
2777		queryParameters["timeout"] = autorest.Encode("query", 60)
2778	}
2779
2780	preparer := autorest.CreatePreparer(
2781		autorest.AsContentType("application/json; charset=utf-8"),
2782		autorest.AsPost(),
2783		autorest.WithBaseURL(client.BaseURI),
2784		autorest.WithPathParameters("/Services/{serviceId}/$/EnableBackup", pathParameters),
2785		autorest.WithJSON(enableBackupDescription),
2786		autorest.WithQueryParameters(queryParameters))
2787	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2788}
2789
2790// EnableServiceBackupSender sends the EnableServiceBackup request. The method will close the
2791// http.Response Body if it receives an error.
2792func (client BaseClient) EnableServiceBackupSender(req *http.Request) (*http.Response, error) {
2793	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2794}
2795
2796// EnableServiceBackupResponder handles the response to the EnableServiceBackup request. The method always
2797// closes the http.Response Body.
2798func (client BaseClient) EnableServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) {
2799	err = autorest.Respond(
2800		resp,
2801		client.ByInspecting(),
2802		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
2803		autorest.ByClosing())
2804	result.Response = resp
2805	return
2806}
2807
2808// ForceApproveRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your
2809// code.
2810// Parameters:
2811// repairTaskApproveDescription - describes the repair task to be approved.
2812func (client BaseClient) ForceApproveRepairTask(ctx context.Context, repairTaskApproveDescription RepairTaskApproveDescription) (result RepairTaskUpdateInfo, err error) {
2813	if tracing.IsEnabled() {
2814		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ForceApproveRepairTask")
2815		defer func() {
2816			sc := -1
2817			if result.Response.Response != nil {
2818				sc = result.Response.Response.StatusCode
2819			}
2820			tracing.EndSpan(ctx, sc, err)
2821		}()
2822	}
2823	if err := validation.Validate([]validation.Validation{
2824		{TargetValue: repairTaskApproveDescription,
2825			Constraints: []validation.Constraint{{Target: "repairTaskApproveDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
2826		return result, validation.NewError("servicefabric.BaseClient", "ForceApproveRepairTask", err.Error())
2827	}
2828
2829	req, err := client.ForceApproveRepairTaskPreparer(ctx, repairTaskApproveDescription)
2830	if err != nil {
2831		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", nil, "Failure preparing request")
2832		return
2833	}
2834
2835	resp, err := client.ForceApproveRepairTaskSender(req)
2836	if err != nil {
2837		result.Response = autorest.Response{Response: resp}
2838		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", resp, "Failure sending request")
2839		return
2840	}
2841
2842	result, err = client.ForceApproveRepairTaskResponder(resp)
2843	if err != nil {
2844		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", resp, "Failure responding to request")
2845	}
2846
2847	return
2848}
2849
2850// ForceApproveRepairTaskPreparer prepares the ForceApproveRepairTask request.
2851func (client BaseClient) ForceApproveRepairTaskPreparer(ctx context.Context, repairTaskApproveDescription RepairTaskApproveDescription) (*http.Request, error) {
2852	const APIVersion = "6.0"
2853	queryParameters := map[string]interface{}{
2854		"api-version": APIVersion,
2855	}
2856
2857	preparer := autorest.CreatePreparer(
2858		autorest.AsContentType("application/json; charset=utf-8"),
2859		autorest.AsPost(),
2860		autorest.WithBaseURL(client.BaseURI),
2861		autorest.WithPath("/$/ForceApproveRepairTask"),
2862		autorest.WithJSON(repairTaskApproveDescription),
2863		autorest.WithQueryParameters(queryParameters))
2864	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2865}
2866
2867// ForceApproveRepairTaskSender sends the ForceApproveRepairTask request. The method will close the
2868// http.Response Body if it receives an error.
2869func (client BaseClient) ForceApproveRepairTaskSender(req *http.Request) (*http.Response, error) {
2870	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2871}
2872
2873// ForceApproveRepairTaskResponder handles the response to the ForceApproveRepairTask request. The method always
2874// closes the http.Response Body.
2875func (client BaseClient) ForceApproveRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
2876	err = autorest.Respond(
2877		resp,
2878		client.ByInspecting(),
2879		azure.WithErrorUnlessStatusCode(http.StatusOK),
2880		autorest.ByUnmarshallingJSON(&result),
2881		autorest.ByClosing())
2882	result.Response = autorest.Response{Response: resp}
2883	return
2884}
2885
2886// GetAadMetadata gets the Azure Active Directory metadata used for secured connection to cluster.
2887// This API is not supposed to be called separately. It provides information needed to set up an Azure Active Directory
2888// secured connection with a Service Fabric cluster.
2889// Parameters:
2890// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2891// duration that the client is willing to wait for the requested operation to complete. The default value for
2892// this parameter is 60 seconds.
2893func (client BaseClient) GetAadMetadata(ctx context.Context, timeout *int64) (result AadMetadataObject, err error) {
2894	if tracing.IsEnabled() {
2895		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetAadMetadata")
2896		defer func() {
2897			sc := -1
2898			if result.Response.Response != nil {
2899				sc = result.Response.Response.StatusCode
2900			}
2901			tracing.EndSpan(ctx, sc, err)
2902		}()
2903	}
2904	if err := validation.Validate([]validation.Validation{
2905		{TargetValue: timeout,
2906			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
2907				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
2908					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
2909				}}}}}); err != nil {
2910		return result, validation.NewError("servicefabric.BaseClient", "GetAadMetadata", err.Error())
2911	}
2912
2913	req, err := client.GetAadMetadataPreparer(ctx, timeout)
2914	if err != nil {
2915		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", nil, "Failure preparing request")
2916		return
2917	}
2918
2919	resp, err := client.GetAadMetadataSender(req)
2920	if err != nil {
2921		result.Response = autorest.Response{Response: resp}
2922		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", resp, "Failure sending request")
2923		return
2924	}
2925
2926	result, err = client.GetAadMetadataResponder(resp)
2927	if err != nil {
2928		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", resp, "Failure responding to request")
2929	}
2930
2931	return
2932}
2933
2934// GetAadMetadataPreparer prepares the GetAadMetadata request.
2935func (client BaseClient) GetAadMetadataPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
2936	const APIVersion = "6.0"
2937	queryParameters := map[string]interface{}{
2938		"api-version": APIVersion,
2939	}
2940	if timeout != nil {
2941		queryParameters["timeout"] = autorest.Encode("query", *timeout)
2942	} else {
2943		queryParameters["timeout"] = autorest.Encode("query", 60)
2944	}
2945
2946	preparer := autorest.CreatePreparer(
2947		autorest.AsGet(),
2948		autorest.WithBaseURL(client.BaseURI),
2949		autorest.WithPath("/$/GetAadMetadata"),
2950		autorest.WithQueryParameters(queryParameters))
2951	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2952}
2953
2954// GetAadMetadataSender sends the GetAadMetadata request. The method will close the
2955// http.Response Body if it receives an error.
2956func (client BaseClient) GetAadMetadataSender(req *http.Request) (*http.Response, error) {
2957	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2958}
2959
2960// GetAadMetadataResponder handles the response to the GetAadMetadata request. The method always
2961// closes the http.Response Body.
2962func (client BaseClient) GetAadMetadataResponder(resp *http.Response) (result AadMetadataObject, err error) {
2963	err = autorest.Respond(
2964		resp,
2965		client.ByInspecting(),
2966		azure.WithErrorUnlessStatusCode(http.StatusOK),
2967		autorest.ByUnmarshallingJSON(&result),
2968		autorest.ByClosing())
2969	result.Response = autorest.Response{Response: resp}
2970	return
2971}
2972
2973// GetAllEntitiesBackedUpByPolicy returns a list of Service Fabric application, service or partition which are
2974// associated with this backup policy.
2975// Parameters:
2976// backupPolicyName - the name of the backup policy.
2977// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
2978// token with a non empty value is included in the response of the API when the results from the system do not
2979// fit in a single response. When this value is passed to the next API call, the API returns next set of
2980// results. If there are no further results then the continuation token does not contain a value. The value of
2981// this parameter should not be URL encoded.
2982// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
2983// defines the upper bound on the number of results returned. The results returned can be less than the
2984// specified maximum results if they do not fit in the message as per the max message size restrictions defined
2985// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
2986// as possible that fit in the return message.
2987// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
2988// duration that the client is willing to wait for the requested operation to complete. The default value for
2989// this parameter is 60 seconds.
2990func (client BaseClient) GetAllEntitiesBackedUpByPolicy(ctx context.Context, backupPolicyName string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupEntityList, err error) {
2991	if tracing.IsEnabled() {
2992		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetAllEntitiesBackedUpByPolicy")
2993		defer func() {
2994			sc := -1
2995			if result.Response.Response != nil {
2996				sc = result.Response.Response.StatusCode
2997			}
2998			tracing.EndSpan(ctx, sc, err)
2999		}()
3000	}
3001	if err := validation.Validate([]validation.Validation{
3002		{TargetValue: maxResults,
3003			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
3004				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
3005		{TargetValue: timeout,
3006			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3007				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3008					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3009				}}}}}); err != nil {
3010		return result, validation.NewError("servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", err.Error())
3011	}
3012
3013	req, err := client.GetAllEntitiesBackedUpByPolicyPreparer(ctx, backupPolicyName, continuationToken, maxResults, timeout)
3014	if err != nil {
3015		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", nil, "Failure preparing request")
3016		return
3017	}
3018
3019	resp, err := client.GetAllEntitiesBackedUpByPolicySender(req)
3020	if err != nil {
3021		result.Response = autorest.Response{Response: resp}
3022		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", resp, "Failure sending request")
3023		return
3024	}
3025
3026	result, err = client.GetAllEntitiesBackedUpByPolicyResponder(resp)
3027	if err != nil {
3028		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", resp, "Failure responding to request")
3029	}
3030
3031	return
3032}
3033
3034// GetAllEntitiesBackedUpByPolicyPreparer prepares the GetAllEntitiesBackedUpByPolicy request.
3035func (client BaseClient) GetAllEntitiesBackedUpByPolicyPreparer(ctx context.Context, backupPolicyName string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
3036	pathParameters := map[string]interface{}{
3037		"backupPolicyName": autorest.Encode("path", backupPolicyName),
3038	}
3039
3040	const APIVersion = "6.2-preview"
3041	queryParameters := map[string]interface{}{
3042		"api-version": APIVersion,
3043	}
3044	if len(continuationToken) > 0 {
3045		queryParameters["ContinuationToken"] = continuationToken
3046	}
3047	if maxResults != nil {
3048		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
3049	} else {
3050		queryParameters["MaxResults"] = autorest.Encode("query", 0)
3051	}
3052	if timeout != nil {
3053		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3054	} else {
3055		queryParameters["timeout"] = autorest.Encode("query", 60)
3056	}
3057
3058	preparer := autorest.CreatePreparer(
3059		autorest.AsGet(),
3060		autorest.WithBaseURL(client.BaseURI),
3061		autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/GetBackupEnabledEntities", pathParameters),
3062		autorest.WithQueryParameters(queryParameters))
3063	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3064}
3065
3066// GetAllEntitiesBackedUpByPolicySender sends the GetAllEntitiesBackedUpByPolicy request. The method will close the
3067// http.Response Body if it receives an error.
3068func (client BaseClient) GetAllEntitiesBackedUpByPolicySender(req *http.Request) (*http.Response, error) {
3069	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3070}
3071
3072// GetAllEntitiesBackedUpByPolicyResponder handles the response to the GetAllEntitiesBackedUpByPolicy request. The method always
3073// closes the http.Response Body.
3074func (client BaseClient) GetAllEntitiesBackedUpByPolicyResponder(resp *http.Response) (result PagedBackupEntityList, err error) {
3075	err = autorest.Respond(
3076		resp,
3077		client.ByInspecting(),
3078		azure.WithErrorUnlessStatusCode(http.StatusOK),
3079		autorest.ByUnmarshallingJSON(&result),
3080		autorest.ByClosing())
3081	result.Response = autorest.Response{Response: resp}
3082	return
3083}
3084
3085// GetApplicationBackupConfigurationInfo gets the Service Fabric backup configuration information for the application
3086// and the services and partitions under this application.
3087// Parameters:
3088// applicationID - the identity of the application. This is typically the full name of the application without
3089// the 'fabric:' URI scheme.
3090// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3091// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3092// in 6.0+ and "myapp/app1" in previous versions.
3093// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
3094// token with a non empty value is included in the response of the API when the results from the system do not
3095// fit in a single response. When this value is passed to the next API call, the API returns next set of
3096// results. If there are no further results then the continuation token does not contain a value. The value of
3097// this parameter should not be URL encoded.
3098// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
3099// defines the upper bound on the number of results returned. The results returned can be less than the
3100// specified maximum results if they do not fit in the message as per the max message size restrictions defined
3101// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
3102// as possible that fit in the return message.
3103// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3104// duration that the client is willing to wait for the requested operation to complete. The default value for
3105// this parameter is 60 seconds.
3106func (client BaseClient) GetApplicationBackupConfigurationInfo(ctx context.Context, applicationID string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupConfigurationInfoList, err error) {
3107	if tracing.IsEnabled() {
3108		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationBackupConfigurationInfo")
3109		defer func() {
3110			sc := -1
3111			if result.Response.Response != nil {
3112				sc = result.Response.Response.StatusCode
3113			}
3114			tracing.EndSpan(ctx, sc, err)
3115		}()
3116	}
3117	if err := validation.Validate([]validation.Validation{
3118		{TargetValue: maxResults,
3119			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
3120				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
3121		{TargetValue: timeout,
3122			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3123				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3124					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3125				}}}}}); err != nil {
3126		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", err.Error())
3127	}
3128
3129	req, err := client.GetApplicationBackupConfigurationInfoPreparer(ctx, applicationID, continuationToken, maxResults, timeout)
3130	if err != nil {
3131		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", nil, "Failure preparing request")
3132		return
3133	}
3134
3135	resp, err := client.GetApplicationBackupConfigurationInfoSender(req)
3136	if err != nil {
3137		result.Response = autorest.Response{Response: resp}
3138		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", resp, "Failure sending request")
3139		return
3140	}
3141
3142	result, err = client.GetApplicationBackupConfigurationInfoResponder(resp)
3143	if err != nil {
3144		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", resp, "Failure responding to request")
3145	}
3146
3147	return
3148}
3149
3150// GetApplicationBackupConfigurationInfoPreparer prepares the GetApplicationBackupConfigurationInfo request.
3151func (client BaseClient) GetApplicationBackupConfigurationInfoPreparer(ctx context.Context, applicationID string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
3152	pathParameters := map[string]interface{}{
3153		"applicationId": applicationID,
3154	}
3155
3156	const APIVersion = "6.2-preview"
3157	queryParameters := map[string]interface{}{
3158		"api-version": APIVersion,
3159	}
3160	if len(continuationToken) > 0 {
3161		queryParameters["ContinuationToken"] = continuationToken
3162	}
3163	if maxResults != nil {
3164		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
3165	} else {
3166		queryParameters["MaxResults"] = autorest.Encode("query", 0)
3167	}
3168	if timeout != nil {
3169		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3170	} else {
3171		queryParameters["timeout"] = autorest.Encode("query", 60)
3172	}
3173
3174	preparer := autorest.CreatePreparer(
3175		autorest.AsGet(),
3176		autorest.WithBaseURL(client.BaseURI),
3177		autorest.WithPathParameters("/Applications/{applicationId}/$/GetBackupConfigurationInfo", pathParameters),
3178		autorest.WithQueryParameters(queryParameters))
3179	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3180}
3181
3182// GetApplicationBackupConfigurationInfoSender sends the GetApplicationBackupConfigurationInfo request. The method will close the
3183// http.Response Body if it receives an error.
3184func (client BaseClient) GetApplicationBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) {
3185	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3186}
3187
3188// GetApplicationBackupConfigurationInfoResponder handles the response to the GetApplicationBackupConfigurationInfo request. The method always
3189// closes the http.Response Body.
3190func (client BaseClient) GetApplicationBackupConfigurationInfoResponder(resp *http.Response) (result PagedBackupConfigurationInfoList, err error) {
3191	err = autorest.Respond(
3192		resp,
3193		client.ByInspecting(),
3194		azure.WithErrorUnlessStatusCode(http.StatusOK),
3195		autorest.ByUnmarshallingJSON(&result),
3196		autorest.ByClosing())
3197	result.Response = autorest.Response{Response: resp}
3198	return
3199}
3200
3201// GetApplicationBackupList returns a list of backups available for every partition in this Service Fabric application.
3202// The server enumerates all the backups available at the backup location configured in the backup policy. It also
3203// allows filtering of the result based on start and end datetime or just fetching the latest available backup for
3204// every partition.
3205// Parameters:
3206// applicationID - the identity of the application. This is typically the full name of the application without
3207// the 'fabric:' URI scheme.
3208// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3209// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3210// in 6.0+ and "myapp/app1" in previous versions.
3211// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3212// duration that the client is willing to wait for the requested operation to complete. The default value for
3213// this parameter is 60 seconds.
3214// latest - specifies whether to get only the most recent backup available for a partition for the specified
3215// time range.
3216// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The
3217// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups
3218// from the beginning are enumerated.
3219// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date
3220// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is
3221// done till the most recent backup.
3222// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
3223// token with a non empty value is included in the response of the API when the results from the system do not
3224// fit in a single response. When this value is passed to the next API call, the API returns next set of
3225// results. If there are no further results then the continuation token does not contain a value. The value of
3226// this parameter should not be URL encoded.
3227// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
3228// defines the upper bound on the number of results returned. The results returned can be less than the
3229// specified maximum results if they do not fit in the message as per the max message size restrictions defined
3230// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
3231// as possible that fit in the return message.
3232func (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) {
3233	if tracing.IsEnabled() {
3234		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationBackupList")
3235		defer func() {
3236			sc := -1
3237			if result.Response.Response != nil {
3238				sc = result.Response.Response.StatusCode
3239			}
3240			tracing.EndSpan(ctx, sc, err)
3241		}()
3242	}
3243	if err := validation.Validate([]validation.Validation{
3244		{TargetValue: timeout,
3245			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3246				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3247					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3248				}}}},
3249		{TargetValue: maxResults,
3250			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
3251				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil {
3252		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationBackupList", err.Error())
3253	}
3254
3255	req, err := client.GetApplicationBackupListPreparer(ctx, applicationID, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults)
3256	if err != nil {
3257		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", nil, "Failure preparing request")
3258		return
3259	}
3260
3261	resp, err := client.GetApplicationBackupListSender(req)
3262	if err != nil {
3263		result.Response = autorest.Response{Response: resp}
3264		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", resp, "Failure sending request")
3265		return
3266	}
3267
3268	result, err = client.GetApplicationBackupListResponder(resp)
3269	if err != nil {
3270		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", resp, "Failure responding to request")
3271	}
3272
3273	return
3274}
3275
3276// GetApplicationBackupListPreparer prepares the GetApplicationBackupList request.
3277func (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) {
3278	pathParameters := map[string]interface{}{
3279		"applicationId": applicationID,
3280	}
3281
3282	const APIVersion = "6.2-preview"
3283	queryParameters := map[string]interface{}{
3284		"api-version": APIVersion,
3285	}
3286	if timeout != nil {
3287		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3288	} else {
3289		queryParameters["timeout"] = autorest.Encode("query", 60)
3290	}
3291	if latest != nil {
3292		queryParameters["Latest"] = autorest.Encode("query", *latest)
3293	} else {
3294		queryParameters["Latest"] = autorest.Encode("query", false)
3295	}
3296	if startDateTimeFilter != nil {
3297		queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter)
3298	}
3299	if endDateTimeFilter != nil {
3300		queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter)
3301	}
3302	if len(continuationToken) > 0 {
3303		queryParameters["ContinuationToken"] = continuationToken
3304	}
3305	if maxResults != nil {
3306		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
3307	} else {
3308		queryParameters["MaxResults"] = autorest.Encode("query", 0)
3309	}
3310
3311	preparer := autorest.CreatePreparer(
3312		autorest.AsGet(),
3313		autorest.WithBaseURL(client.BaseURI),
3314		autorest.WithPathParameters("/Applications/{applicationId}/$/GetBackups", pathParameters),
3315		autorest.WithQueryParameters(queryParameters))
3316	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3317}
3318
3319// GetApplicationBackupListSender sends the GetApplicationBackupList request. The method will close the
3320// http.Response Body if it receives an error.
3321func (client BaseClient) GetApplicationBackupListSender(req *http.Request) (*http.Response, error) {
3322	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3323}
3324
3325// GetApplicationBackupListResponder handles the response to the GetApplicationBackupList request. The method always
3326// closes the http.Response Body.
3327func (client BaseClient) GetApplicationBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) {
3328	err = autorest.Respond(
3329		resp,
3330		client.ByInspecting(),
3331		azure.WithErrorUnlessStatusCode(http.StatusOK),
3332		autorest.ByUnmarshallingJSON(&result),
3333		autorest.ByClosing())
3334	result.Response = autorest.Response{Response: resp}
3335	return
3336}
3337
3338// GetApplicationEventList the response is list of ApplicationEvent objects.
3339// Parameters:
3340// applicationID - the identity of the application. This is typically the full name of the application without
3341// the 'fabric:' URI scheme.
3342// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3343// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3344// in 6.0+ and "myapp/app1" in previous versions.
3345// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
3346// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
3347// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3348// duration that the client is willing to wait for the requested operation to complete. The default value for
3349// this parameter is 60 seconds.
3350// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
3351// be included in the response.
3352// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
3353// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
3354// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
3355// populated.
3356func (client BaseClient) GetApplicationEventList(ctx context.Context, applicationID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListApplicationEvent, err error) {
3357	if tracing.IsEnabled() {
3358		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationEventList")
3359		defer func() {
3360			sc := -1
3361			if result.Response.Response != nil {
3362				sc = result.Response.Response.StatusCode
3363			}
3364			tracing.EndSpan(ctx, sc, err)
3365		}()
3366	}
3367	if err := validation.Validate([]validation.Validation{
3368		{TargetValue: timeout,
3369			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3370				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3371					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3372				}}}}}); err != nil {
3373		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationEventList", err.Error())
3374	}
3375
3376	req, err := client.GetApplicationEventListPreparer(ctx, applicationID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
3377	if err != nil {
3378		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", nil, "Failure preparing request")
3379		return
3380	}
3381
3382	resp, err := client.GetApplicationEventListSender(req)
3383	if err != nil {
3384		result.Response = autorest.Response{Response: resp}
3385		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", resp, "Failure sending request")
3386		return
3387	}
3388
3389	result, err = client.GetApplicationEventListResponder(resp)
3390	if err != nil {
3391		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", resp, "Failure responding to request")
3392	}
3393
3394	return
3395}
3396
3397// GetApplicationEventListPreparer prepares the GetApplicationEventList request.
3398func (client BaseClient) GetApplicationEventListPreparer(ctx context.Context, applicationID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
3399	pathParameters := map[string]interface{}{
3400		"applicationId": applicationID,
3401	}
3402
3403	const APIVersion = "6.2-preview"
3404	queryParameters := map[string]interface{}{
3405		"api-version":  APIVersion,
3406		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
3407		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
3408	}
3409	if timeout != nil {
3410		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3411	} else {
3412		queryParameters["timeout"] = autorest.Encode("query", 60)
3413	}
3414	if len(eventsTypesFilter) > 0 {
3415		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
3416	}
3417	if excludeAnalysisEvents != nil {
3418		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
3419	}
3420	if skipCorrelationLookup != nil {
3421		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
3422	}
3423
3424	preparer := autorest.CreatePreparer(
3425		autorest.AsGet(),
3426		autorest.WithBaseURL(client.BaseURI),
3427		autorest.WithPathParameters("/EventsStore/Applications/{applicationId}/$/Events", pathParameters),
3428		autorest.WithQueryParameters(queryParameters))
3429	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3430}
3431
3432// GetApplicationEventListSender sends the GetApplicationEventList request. The method will close the
3433// http.Response Body if it receives an error.
3434func (client BaseClient) GetApplicationEventListSender(req *http.Request) (*http.Response, error) {
3435	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3436}
3437
3438// GetApplicationEventListResponder handles the response to the GetApplicationEventList request. The method always
3439// closes the http.Response Body.
3440func (client BaseClient) GetApplicationEventListResponder(resp *http.Response) (result ListApplicationEvent, err error) {
3441	err = autorest.Respond(
3442		resp,
3443		client.ByInspecting(),
3444		azure.WithErrorUnlessStatusCode(http.StatusOK),
3445		autorest.ByUnmarshallingJSON(&result),
3446		autorest.ByClosing())
3447	result.Response = autorest.Response{Response: resp}
3448	return
3449}
3450
3451// GetApplicationHealth returns the heath state of the service fabric application. The response reports either Ok,
3452// Error or Warning health state. If the entity is not found in the health store, it will return Error.
3453// Parameters:
3454// applicationID - the identity of the application. This is typically the full name of the application without
3455// the 'fabric:' URI scheme.
3456// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3457// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3458// in 6.0+ and "myapp/app1" in previous versions.
3459// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
3460// state.
3461// The possible values for this parameter include integer value of one of the following health states.
3462// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
3463// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
3464// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
3465// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
3466//
3467// - Default - Default value. Matches any HealthState. The value is zero.
3468// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3469// collection of states. The value is 1.
3470// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3471// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3472// - Error - Filter that matches input with HealthState value Error. The value is 8.
3473// - All - Filter that matches input with any HealthState value. The value is 65535.
3474// deployedApplicationsHealthStateFilter - allows filtering of the deployed applications health state objects
3475// returned in the result of application health query based on their health state.
3476// The possible values for this parameter include integer value of one of the following health states. Only
3477// deployed applications that match the filter will be returned.
3478// All deployed applications are used to evaluate the aggregated health state. If not specified, all entries
3479// are returned.
3480// The state values are flag based enumeration, so the value could be a combination of these value obtained
3481// using bitwise 'OR' operator.
3482// For example, if the provided value is 6 then health state of deployed applications with HealthState value of
3483// OK (2) and Warning (4) are returned.
3484//
3485// - Default - Default value. Matches any HealthState. The value is zero.
3486// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3487// collection of states. The value is 1.
3488// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3489// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3490// - Error - Filter that matches input with HealthState value Error. The value is 8.
3491// - All - Filter that matches input with any HealthState value. The value is 65535.
3492// servicesHealthStateFilter - allows filtering of the services health state objects returned in the result of
3493// services health query based on their health state.
3494// The possible values for this parameter include integer value of one of the following health states.
3495// Only services that match the filter are returned. All services are used to evaluate the aggregated health
3496// state.
3497// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
3498// be a combination of these value
3499// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of services
3500// with HealthState value of OK (2) and Warning (4) will be returned.
3501//
3502// - Default - Default value. Matches any HealthState. The value is zero.
3503// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3504// collection of states. The value is 1.
3505// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3506// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3507// - Error - Filter that matches input with HealthState value Error. The value is 8.
3508// - All - Filter that matches input with any HealthState value. The value is 65535.
3509// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
3510// result. False by default.
3511// The statistics show the number of children entities in health state Ok, Warning, and Error.
3512// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3513// duration that the client is willing to wait for the requested operation to complete. The default value for
3514// this parameter is 60 seconds.
3515func (client BaseClient) GetApplicationHealth(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result ApplicationHealth, err error) {
3516	if tracing.IsEnabled() {
3517		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationHealth")
3518		defer func() {
3519			sc := -1
3520			if result.Response.Response != nil {
3521				sc = result.Response.Response.StatusCode
3522			}
3523			tracing.EndSpan(ctx, sc, err)
3524		}()
3525	}
3526	if err := validation.Validate([]validation.Validation{
3527		{TargetValue: timeout,
3528			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3529				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3530					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3531				}}}}}); err != nil {
3532		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealth", err.Error())
3533	}
3534
3535	req, err := client.GetApplicationHealthPreparer(ctx, applicationID, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, timeout)
3536	if err != nil {
3537		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", nil, "Failure preparing request")
3538		return
3539	}
3540
3541	resp, err := client.GetApplicationHealthSender(req)
3542	if err != nil {
3543		result.Response = autorest.Response{Response: resp}
3544		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", resp, "Failure sending request")
3545		return
3546	}
3547
3548	result, err = client.GetApplicationHealthResponder(resp)
3549	if err != nil {
3550		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", resp, "Failure responding to request")
3551	}
3552
3553	return
3554}
3555
3556// GetApplicationHealthPreparer prepares the GetApplicationHealth request.
3557func (client BaseClient) GetApplicationHealthPreparer(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
3558	pathParameters := map[string]interface{}{
3559		"applicationId": applicationID,
3560	}
3561
3562	const APIVersion = "6.0"
3563	queryParameters := map[string]interface{}{
3564		"api-version": APIVersion,
3565	}
3566	if eventsHealthStateFilter != nil {
3567		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
3568	} else {
3569		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
3570	}
3571	if deployedApplicationsHealthStateFilter != nil {
3572		queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", *deployedApplicationsHealthStateFilter)
3573	} else {
3574		queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", 0)
3575	}
3576	if servicesHealthStateFilter != nil {
3577		queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", *servicesHealthStateFilter)
3578	} else {
3579		queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", 0)
3580	}
3581	if excludeHealthStatistics != nil {
3582		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
3583	} else {
3584		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
3585	}
3586	if timeout != nil {
3587		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3588	} else {
3589		queryParameters["timeout"] = autorest.Encode("query", 60)
3590	}
3591
3592	preparer := autorest.CreatePreparer(
3593		autorest.AsGet(),
3594		autorest.WithBaseURL(client.BaseURI),
3595		autorest.WithPathParameters("/Applications/{applicationId}/$/GetHealth", pathParameters),
3596		autorest.WithQueryParameters(queryParameters))
3597	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3598}
3599
3600// GetApplicationHealthSender sends the GetApplicationHealth request. The method will close the
3601// http.Response Body if it receives an error.
3602func (client BaseClient) GetApplicationHealthSender(req *http.Request) (*http.Response, error) {
3603	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3604}
3605
3606// GetApplicationHealthResponder handles the response to the GetApplicationHealth request. The method always
3607// closes the http.Response Body.
3608func (client BaseClient) GetApplicationHealthResponder(resp *http.Response) (result ApplicationHealth, err error) {
3609	err = autorest.Respond(
3610		resp,
3611		client.ByInspecting(),
3612		azure.WithErrorUnlessStatusCode(http.StatusOK),
3613		autorest.ByUnmarshallingJSON(&result),
3614		autorest.ByClosing())
3615	result.Response = autorest.Response{Response: resp}
3616	return
3617}
3618
3619// GetApplicationHealthUsingPolicy gets the health of a Service Fabric application. Use EventsHealthStateFilter to
3620// filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicies to
3621// override the health policies used to evaluate the health.
3622// Parameters:
3623// applicationID - the identity of the application. This is typically the full name of the application without
3624// the 'fabric:' URI scheme.
3625// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3626// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3627// in 6.0+ and "myapp/app1" in previous versions.
3628// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
3629// state.
3630// The possible values for this parameter include integer value of one of the following health states.
3631// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
3632// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
3633// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
3634// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
3635//
3636// - Default - Default value. Matches any HealthState. The value is zero.
3637// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3638// collection of states. The value is 1.
3639// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3640// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3641// - Error - Filter that matches input with HealthState value Error. The value is 8.
3642// - All - Filter that matches input with any HealthState value. The value is 65535.
3643// deployedApplicationsHealthStateFilter - allows filtering of the deployed applications health state objects
3644// returned in the result of application health query based on their health state.
3645// The possible values for this parameter include integer value of one of the following health states. Only
3646// deployed applications that match the filter will be returned.
3647// All deployed applications are used to evaluate the aggregated health state. If not specified, all entries
3648// are returned.
3649// The state values are flag based enumeration, so the value could be a combination of these value obtained
3650// using bitwise 'OR' operator.
3651// For example, if the provided value is 6 then health state of deployed applications with HealthState value of
3652// OK (2) and Warning (4) are returned.
3653//
3654// - Default - Default value. Matches any HealthState. The value is zero.
3655// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3656// collection of states. The value is 1.
3657// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3658// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3659// - Error - Filter that matches input with HealthState value Error. The value is 8.
3660// - All - Filter that matches input with any HealthState value. The value is 65535.
3661// servicesHealthStateFilter - allows filtering of the services health state objects returned in the result of
3662// services health query based on their health state.
3663// The possible values for this parameter include integer value of one of the following health states.
3664// Only services that match the filter are returned. All services are used to evaluate the aggregated health
3665// state.
3666// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
3667// be a combination of these value
3668// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of services
3669// with HealthState value of OK (2) and Warning (4) will be returned.
3670//
3671// - Default - Default value. Matches any HealthState. The value is zero.
3672// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
3673// collection of states. The value is 1.
3674// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
3675// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
3676// - Error - Filter that matches input with HealthState value Error. The value is 8.
3677// - All - Filter that matches input with any HealthState value. The value is 65535.
3678// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
3679// result. False by default.
3680// The statistics show the number of children entities in health state Ok, Warning, and Error.
3681// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
3682// of its children.
3683// If not present, the health evaluation uses the health policy from application manifest or the default health
3684// policy.
3685// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3686// duration that the client is willing to wait for the requested operation to complete. The default value for
3687// this parameter is 60 seconds.
3688func (client BaseClient) GetApplicationHealthUsingPolicy(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result ApplicationHealth, err error) {
3689	if tracing.IsEnabled() {
3690		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationHealthUsingPolicy")
3691		defer func() {
3692			sc := -1
3693			if result.Response.Response != nil {
3694				sc = result.Response.Response.StatusCode
3695			}
3696			tracing.EndSpan(ctx, sc, err)
3697		}()
3698	}
3699	if err := validation.Validate([]validation.Validation{
3700		{TargetValue: timeout,
3701			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3702				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3703					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3704				}}}}}); err != nil {
3705		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", err.Error())
3706	}
3707
3708	req, err := client.GetApplicationHealthUsingPolicyPreparer(ctx, applicationID, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, applicationHealthPolicy, timeout)
3709	if err != nil {
3710		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", nil, "Failure preparing request")
3711		return
3712	}
3713
3714	resp, err := client.GetApplicationHealthUsingPolicySender(req)
3715	if err != nil {
3716		result.Response = autorest.Response{Response: resp}
3717		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", resp, "Failure sending request")
3718		return
3719	}
3720
3721	result, err = client.GetApplicationHealthUsingPolicyResponder(resp)
3722	if err != nil {
3723		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", resp, "Failure responding to request")
3724	}
3725
3726	return
3727}
3728
3729// GetApplicationHealthUsingPolicyPreparer prepares the GetApplicationHealthUsingPolicy request.
3730func (client BaseClient) GetApplicationHealthUsingPolicyPreparer(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) {
3731	pathParameters := map[string]interface{}{
3732		"applicationId": applicationID,
3733	}
3734
3735	const APIVersion = "6.0"
3736	queryParameters := map[string]interface{}{
3737		"api-version": APIVersion,
3738	}
3739	if eventsHealthStateFilter != nil {
3740		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
3741	} else {
3742		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
3743	}
3744	if deployedApplicationsHealthStateFilter != nil {
3745		queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", *deployedApplicationsHealthStateFilter)
3746	} else {
3747		queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", 0)
3748	}
3749	if servicesHealthStateFilter != nil {
3750		queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", *servicesHealthStateFilter)
3751	} else {
3752		queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", 0)
3753	}
3754	if excludeHealthStatistics != nil {
3755		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
3756	} else {
3757		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
3758	}
3759	if timeout != nil {
3760		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3761	} else {
3762		queryParameters["timeout"] = autorest.Encode("query", 60)
3763	}
3764
3765	preparer := autorest.CreatePreparer(
3766		autorest.AsContentType("application/json; charset=utf-8"),
3767		autorest.AsPost(),
3768		autorest.WithBaseURL(client.BaseURI),
3769		autorest.WithPathParameters("/Applications/{applicationId}/$/GetHealth", pathParameters),
3770		autorest.WithQueryParameters(queryParameters))
3771	if applicationHealthPolicy != nil {
3772		preparer = autorest.DecoratePreparer(preparer,
3773			autorest.WithJSON(applicationHealthPolicy))
3774	}
3775	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3776}
3777
3778// GetApplicationHealthUsingPolicySender sends the GetApplicationHealthUsingPolicy request. The method will close the
3779// http.Response Body if it receives an error.
3780func (client BaseClient) GetApplicationHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
3781	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3782}
3783
3784// GetApplicationHealthUsingPolicyResponder handles the response to the GetApplicationHealthUsingPolicy request. The method always
3785// closes the http.Response Body.
3786func (client BaseClient) GetApplicationHealthUsingPolicyResponder(resp *http.Response) (result ApplicationHealth, err error) {
3787	err = autorest.Respond(
3788		resp,
3789		client.ByInspecting(),
3790		azure.WithErrorUnlessStatusCode(http.StatusOK),
3791		autorest.ByUnmarshallingJSON(&result),
3792		autorest.ByClosing())
3793	result.Response = autorest.Response{Response: resp}
3794	return
3795}
3796
3797// GetApplicationInfo returns the information about the application that was created or in the process of being created
3798// in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the
3799// name, type, status, parameters and other details about the application.
3800// Parameters:
3801// applicationID - the identity of the application. This is typically the full name of the application without
3802// the 'fabric:' URI scheme.
3803// Starting from version 6.0, hierarchical names are delimited with the "~" character.
3804// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
3805// in 6.0+ and "myapp/app1" in previous versions.
3806// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from
3807// the result.
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) GetApplicationInfo(ctx context.Context, applicationID string, excludeApplicationParameters *bool, timeout *int64) (result ApplicationInfo, err error) {
3812	if tracing.IsEnabled() {
3813		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationInfo")
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", "GetApplicationInfo", err.Error())
3829	}
3830
3831	req, err := client.GetApplicationInfoPreparer(ctx, applicationID, excludeApplicationParameters, timeout)
3832	if err != nil {
3833		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", nil, "Failure preparing request")
3834		return
3835	}
3836
3837	resp, err := client.GetApplicationInfoSender(req)
3838	if err != nil {
3839		result.Response = autorest.Response{Response: resp}
3840		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", resp, "Failure sending request")
3841		return
3842	}
3843
3844	result, err = client.GetApplicationInfoResponder(resp)
3845	if err != nil {
3846		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", resp, "Failure responding to request")
3847	}
3848
3849	return
3850}
3851
3852// GetApplicationInfoPreparer prepares the GetApplicationInfo request.
3853func (client BaseClient) GetApplicationInfoPreparer(ctx context.Context, applicationID string, excludeApplicationParameters *bool, timeout *int64) (*http.Request, error) {
3854	pathParameters := map[string]interface{}{
3855		"applicationId": applicationID,
3856	}
3857
3858	const APIVersion = "6.0"
3859	queryParameters := map[string]interface{}{
3860		"api-version": APIVersion,
3861	}
3862	if excludeApplicationParameters != nil {
3863		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters)
3864	} else {
3865		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false)
3866	}
3867	if timeout != nil {
3868		queryParameters["timeout"] = autorest.Encode("query", *timeout)
3869	} else {
3870		queryParameters["timeout"] = autorest.Encode("query", 60)
3871	}
3872
3873	preparer := autorest.CreatePreparer(
3874		autorest.AsGet(),
3875		autorest.WithBaseURL(client.BaseURI),
3876		autorest.WithPathParameters("/Applications/{applicationId}", pathParameters),
3877		autorest.WithQueryParameters(queryParameters))
3878	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3879}
3880
3881// GetApplicationInfoSender sends the GetApplicationInfo request. The method will close the
3882// http.Response Body if it receives an error.
3883func (client BaseClient) GetApplicationInfoSender(req *http.Request) (*http.Response, error) {
3884	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3885}
3886
3887// GetApplicationInfoResponder handles the response to the GetApplicationInfo request. The method always
3888// closes the http.Response Body.
3889func (client BaseClient) GetApplicationInfoResponder(resp *http.Response) (result ApplicationInfo, err error) {
3890	err = autorest.Respond(
3891		resp,
3892		client.ByInspecting(),
3893		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
3894		autorest.ByUnmarshallingJSON(&result),
3895		autorest.ByClosing())
3896	result.Response = autorest.Response{Response: resp}
3897	return
3898}
3899
3900// GetApplicationInfoList gets the information about the applications that were created or in the process of being
3901// created in the Service Fabric cluster and match the specified filters. The response includes the name, type, status,
3902// parameters, and other details about the application. If the applications do not fit in a page, one page of results
3903// is returned as well as a continuation token which can be used to get the next page. Filters ApplicationTypeName and
3904// ApplicationDefinitionKindFilter cannot be specified at the same time.
3905// Parameters:
3906// applicationDefinitionKindFilter - used to filter on ApplicationDefinitionKind which is the mechanism used to
3907// define a Service Fabric application.
3908// - Default - Default value, which performs the same function as selecting "All". The value is 0.
3909// - All - Filter that matches input with any ApplicationDefinitionKind value. The value is 65535.
3910// - ServiceFabricApplicationDescription - Filter that matches input with ApplicationDefinitionKind value
3911// ServiceFabricApplicationDescription. The value is 1.
3912// - Compose - Filter that matches input with ApplicationDefinitionKind value Compose. The value is 2.
3913// applicationTypeName - the application type name used to filter the applications to query for. This value
3914// should not contain the application type version.
3915// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from
3916// the result.
3917// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
3918// token with a non empty value is included in the response of the API when the results from the system do not
3919// fit in a single response. When this value is passed to the next API call, the API returns next set of
3920// results. If there are no further results then the continuation token does not contain a value. The value of
3921// this parameter should not be URL encoded.
3922// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
3923// defines the upper bound on the number of results returned. The results returned can be less than the
3924// specified maximum results if they do not fit in the message as per the max message size restrictions defined
3925// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
3926// as possible that fit in the return message.
3927// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
3928// duration that the client is willing to wait for the requested operation to complete. The default value for
3929// this parameter is 60 seconds.
3930func (client BaseClient) GetApplicationInfoList(ctx context.Context, applicationDefinitionKindFilter *int32, applicationTypeName string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationInfoList, err error) {
3931	if tracing.IsEnabled() {
3932		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationInfoList")
3933		defer func() {
3934			sc := -1
3935			if result.Response.Response != nil {
3936				sc = result.Response.Response.StatusCode
3937			}
3938			tracing.EndSpan(ctx, sc, err)
3939		}()
3940	}
3941	if err := validation.Validate([]validation.Validation{
3942		{TargetValue: maxResults,
3943			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
3944				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
3945		{TargetValue: timeout,
3946			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
3947				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
3948					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
3949				}}}}}); err != nil {
3950		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfoList", err.Error())
3951	}
3952
3953	req, err := client.GetApplicationInfoListPreparer(ctx, applicationDefinitionKindFilter, applicationTypeName, excludeApplicationParameters, continuationToken, maxResults, timeout)
3954	if err != nil {
3955		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", nil, "Failure preparing request")
3956		return
3957	}
3958
3959	resp, err := client.GetApplicationInfoListSender(req)
3960	if err != nil {
3961		result.Response = autorest.Response{Response: resp}
3962		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", resp, "Failure sending request")
3963		return
3964	}
3965
3966	result, err = client.GetApplicationInfoListResponder(resp)
3967	if err != nil {
3968		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", resp, "Failure responding to request")
3969	}
3970
3971	return
3972}
3973
3974// GetApplicationInfoListPreparer prepares the GetApplicationInfoList request.
3975func (client BaseClient) GetApplicationInfoListPreparer(ctx context.Context, applicationDefinitionKindFilter *int32, applicationTypeName string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
3976	const APIVersion = "6.1"
3977	queryParameters := map[string]interface{}{
3978		"api-version": APIVersion,
3979	}
3980	if applicationDefinitionKindFilter != nil {
3981		queryParameters["ApplicationDefinitionKindFilter"] = autorest.Encode("query", *applicationDefinitionKindFilter)
3982	} else {
3983		queryParameters["ApplicationDefinitionKindFilter"] = autorest.Encode("query", 0)
3984	}
3985	if len(applicationTypeName) > 0 {
3986		queryParameters["ApplicationTypeName"] = autorest.Encode("query", applicationTypeName)
3987	}
3988	if excludeApplicationParameters != nil {
3989		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters)
3990	} else {
3991		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false)
3992	}
3993	if len(continuationToken) > 0 {
3994		queryParameters["ContinuationToken"] = continuationToken
3995	}
3996	if maxResults != nil {
3997		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
3998	} else {
3999		queryParameters["MaxResults"] = autorest.Encode("query", 0)
4000	}
4001	if timeout != nil {
4002		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4003	} else {
4004		queryParameters["timeout"] = autorest.Encode("query", 60)
4005	}
4006
4007	preparer := autorest.CreatePreparer(
4008		autorest.AsGet(),
4009		autorest.WithBaseURL(client.BaseURI),
4010		autorest.WithPath("/Applications"),
4011		autorest.WithQueryParameters(queryParameters))
4012	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4013}
4014
4015// GetApplicationInfoListSender sends the GetApplicationInfoList request. The method will close the
4016// http.Response Body if it receives an error.
4017func (client BaseClient) GetApplicationInfoListSender(req *http.Request) (*http.Response, error) {
4018	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4019}
4020
4021// GetApplicationInfoListResponder handles the response to the GetApplicationInfoList request. The method always
4022// closes the http.Response Body.
4023func (client BaseClient) GetApplicationInfoListResponder(resp *http.Response) (result PagedApplicationInfoList, err error) {
4024	err = autorest.Respond(
4025		resp,
4026		client.ByInspecting(),
4027		azure.WithErrorUnlessStatusCode(http.StatusOK),
4028		autorest.ByUnmarshallingJSON(&result),
4029		autorest.ByClosing())
4030	result.Response = autorest.Response{Response: resp}
4031	return
4032}
4033
4034// GetApplicationLoadInfo returns the load information about the application that was created or in the process of
4035// being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response
4036// includes the name, minimum nodes, maximum nodes, the number of nodes the application is occupying currently, and
4037// application load metric information about the application.
4038// Parameters:
4039// applicationID - the identity of the application. This is typically the full name of the application without
4040// the 'fabric:' URI scheme.
4041// Starting from version 6.0, hierarchical names are delimited with the "~" character.
4042// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
4043// in 6.0+ and "myapp/app1" in previous versions.
4044// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4045// duration that the client is willing to wait for the requested operation to complete. The default value for
4046// this parameter is 60 seconds.
4047func (client BaseClient) GetApplicationLoadInfo(ctx context.Context, applicationID string, timeout *int64) (result ApplicationLoadInfo, err error) {
4048	if tracing.IsEnabled() {
4049		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationLoadInfo")
4050		defer func() {
4051			sc := -1
4052			if result.Response.Response != nil {
4053				sc = result.Response.Response.StatusCode
4054			}
4055			tracing.EndSpan(ctx, sc, err)
4056		}()
4057	}
4058	if err := validation.Validate([]validation.Validation{
4059		{TargetValue: timeout,
4060			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4061				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4062					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4063				}}}}}); err != nil {
4064		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationLoadInfo", err.Error())
4065	}
4066
4067	req, err := client.GetApplicationLoadInfoPreparer(ctx, applicationID, timeout)
4068	if err != nil {
4069		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", nil, "Failure preparing request")
4070		return
4071	}
4072
4073	resp, err := client.GetApplicationLoadInfoSender(req)
4074	if err != nil {
4075		result.Response = autorest.Response{Response: resp}
4076		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", resp, "Failure sending request")
4077		return
4078	}
4079
4080	result, err = client.GetApplicationLoadInfoResponder(resp)
4081	if err != nil {
4082		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", resp, "Failure responding to request")
4083	}
4084
4085	return
4086}
4087
4088// GetApplicationLoadInfoPreparer prepares the GetApplicationLoadInfo request.
4089func (client BaseClient) GetApplicationLoadInfoPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
4090	pathParameters := map[string]interface{}{
4091		"applicationId": applicationID,
4092	}
4093
4094	const APIVersion = "6.0"
4095	queryParameters := map[string]interface{}{
4096		"api-version": APIVersion,
4097	}
4098	if timeout != nil {
4099		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4100	} else {
4101		queryParameters["timeout"] = autorest.Encode("query", 60)
4102	}
4103
4104	preparer := autorest.CreatePreparer(
4105		autorest.AsGet(),
4106		autorest.WithBaseURL(client.BaseURI),
4107		autorest.WithPathParameters("/Applications/{applicationId}/$/GetLoadInformation", pathParameters),
4108		autorest.WithQueryParameters(queryParameters))
4109	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4110}
4111
4112// GetApplicationLoadInfoSender sends the GetApplicationLoadInfo request. The method will close the
4113// http.Response Body if it receives an error.
4114func (client BaseClient) GetApplicationLoadInfoSender(req *http.Request) (*http.Response, error) {
4115	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4116}
4117
4118// GetApplicationLoadInfoResponder handles the response to the GetApplicationLoadInfo request. The method always
4119// closes the http.Response Body.
4120func (client BaseClient) GetApplicationLoadInfoResponder(resp *http.Response) (result ApplicationLoadInfo, err error) {
4121	err = autorest.Respond(
4122		resp,
4123		client.ByInspecting(),
4124		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
4125		autorest.ByUnmarshallingJSON(&result),
4126		autorest.ByClosing())
4127	result.Response = autorest.Response{Response: resp}
4128	return
4129}
4130
4131// GetApplicationManifest gets the manifest describing an application type. The response contains the application
4132// manifest XML as a string.
4133// Parameters:
4134// applicationTypeName - the name of the application type.
4135// applicationTypeVersion - the version of the application type.
4136// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4137// duration that the client is willing to wait for the requested operation to complete. The default value for
4138// this parameter is 60 seconds.
4139func (client BaseClient) GetApplicationManifest(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (result ApplicationTypeManifest, err error) {
4140	if tracing.IsEnabled() {
4141		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationManifest")
4142		defer func() {
4143			sc := -1
4144			if result.Response.Response != nil {
4145				sc = result.Response.Response.StatusCode
4146			}
4147			tracing.EndSpan(ctx, sc, err)
4148		}()
4149	}
4150	if err := validation.Validate([]validation.Validation{
4151		{TargetValue: timeout,
4152			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4153				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4154					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4155				}}}}}); err != nil {
4156		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationManifest", err.Error())
4157	}
4158
4159	req, err := client.GetApplicationManifestPreparer(ctx, applicationTypeName, applicationTypeVersion, timeout)
4160	if err != nil {
4161		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", nil, "Failure preparing request")
4162		return
4163	}
4164
4165	resp, err := client.GetApplicationManifestSender(req)
4166	if err != nil {
4167		result.Response = autorest.Response{Response: resp}
4168		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", resp, "Failure sending request")
4169		return
4170	}
4171
4172	result, err = client.GetApplicationManifestResponder(resp)
4173	if err != nil {
4174		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", resp, "Failure responding to request")
4175	}
4176
4177	return
4178}
4179
4180// GetApplicationManifestPreparer prepares the GetApplicationManifest request.
4181func (client BaseClient) GetApplicationManifestPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (*http.Request, error) {
4182	pathParameters := map[string]interface{}{
4183		"applicationTypeName": autorest.Encode("path", applicationTypeName),
4184	}
4185
4186	const APIVersion = "6.0"
4187	queryParameters := map[string]interface{}{
4188		"api-version":            APIVersion,
4189		"ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion),
4190	}
4191	if timeout != nil {
4192		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4193	} else {
4194		queryParameters["timeout"] = autorest.Encode("query", 60)
4195	}
4196
4197	preparer := autorest.CreatePreparer(
4198		autorest.AsGet(),
4199		autorest.WithBaseURL(client.BaseURI),
4200		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetApplicationManifest", pathParameters),
4201		autorest.WithQueryParameters(queryParameters))
4202	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4203}
4204
4205// GetApplicationManifestSender sends the GetApplicationManifest request. The method will close the
4206// http.Response Body if it receives an error.
4207func (client BaseClient) GetApplicationManifestSender(req *http.Request) (*http.Response, error) {
4208	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4209}
4210
4211// GetApplicationManifestResponder handles the response to the GetApplicationManifest request. The method always
4212// closes the http.Response Body.
4213func (client BaseClient) GetApplicationManifestResponder(resp *http.Response) (result ApplicationTypeManifest, err error) {
4214	err = autorest.Respond(
4215		resp,
4216		client.ByInspecting(),
4217		azure.WithErrorUnlessStatusCode(http.StatusOK),
4218		autorest.ByUnmarshallingJSON(&result),
4219		autorest.ByClosing())
4220	result.Response = autorest.Response{Response: resp}
4221	return
4222}
4223
4224// GetApplicationNameInfo gets the name of the application for the specified service. A 404
4225// FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the provided service ID does not exist.
4226// Parameters:
4227// serviceID - the identity of the service. This is typically the full name of the service without the
4228// 'fabric:' URI scheme.
4229// Starting from version 6.0, hierarchical names are delimited with the "~" character.
4230// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
4231// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
4232// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4233// duration that the client is willing to wait for the requested operation to complete. The default value for
4234// this parameter is 60 seconds.
4235func (client BaseClient) GetApplicationNameInfo(ctx context.Context, serviceID string, timeout *int64) (result ApplicationNameInfo, err error) {
4236	if tracing.IsEnabled() {
4237		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationNameInfo")
4238		defer func() {
4239			sc := -1
4240			if result.Response.Response != nil {
4241				sc = result.Response.Response.StatusCode
4242			}
4243			tracing.EndSpan(ctx, sc, err)
4244		}()
4245	}
4246	if err := validation.Validate([]validation.Validation{
4247		{TargetValue: timeout,
4248			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4249				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4250					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4251				}}}}}); err != nil {
4252		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationNameInfo", err.Error())
4253	}
4254
4255	req, err := client.GetApplicationNameInfoPreparer(ctx, serviceID, timeout)
4256	if err != nil {
4257		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", nil, "Failure preparing request")
4258		return
4259	}
4260
4261	resp, err := client.GetApplicationNameInfoSender(req)
4262	if err != nil {
4263		result.Response = autorest.Response{Response: resp}
4264		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", resp, "Failure sending request")
4265		return
4266	}
4267
4268	result, err = client.GetApplicationNameInfoResponder(resp)
4269	if err != nil {
4270		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", resp, "Failure responding to request")
4271	}
4272
4273	return
4274}
4275
4276// GetApplicationNameInfoPreparer prepares the GetApplicationNameInfo request.
4277func (client BaseClient) GetApplicationNameInfoPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
4278	pathParameters := map[string]interface{}{
4279		"serviceId": serviceID,
4280	}
4281
4282	const APIVersion = "6.0"
4283	queryParameters := map[string]interface{}{
4284		"api-version": APIVersion,
4285	}
4286	if timeout != nil {
4287		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4288	} else {
4289		queryParameters["timeout"] = autorest.Encode("query", 60)
4290	}
4291
4292	preparer := autorest.CreatePreparer(
4293		autorest.AsGet(),
4294		autorest.WithBaseURL(client.BaseURI),
4295		autorest.WithPathParameters("/Services/{serviceId}/$/GetApplicationName", pathParameters),
4296		autorest.WithQueryParameters(queryParameters))
4297	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4298}
4299
4300// GetApplicationNameInfoSender sends the GetApplicationNameInfo request. The method will close the
4301// http.Response Body if it receives an error.
4302func (client BaseClient) GetApplicationNameInfoSender(req *http.Request) (*http.Response, error) {
4303	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4304}
4305
4306// GetApplicationNameInfoResponder handles the response to the GetApplicationNameInfo request. The method always
4307// closes the http.Response Body.
4308func (client BaseClient) GetApplicationNameInfoResponder(resp *http.Response) (result ApplicationNameInfo, err error) {
4309	err = autorest.Respond(
4310		resp,
4311		client.ByInspecting(),
4312		azure.WithErrorUnlessStatusCode(http.StatusOK),
4313		autorest.ByUnmarshallingJSON(&result),
4314		autorest.ByClosing())
4315	result.Response = autorest.Response{Response: resp}
4316	return
4317}
4318
4319// GetApplicationsEventList the response is list of ApplicationEvent objects.
4320// Parameters:
4321// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
4322// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
4323// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4324// duration that the client is willing to wait for the requested operation to complete. The default value for
4325// this parameter is 60 seconds.
4326// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
4327// be included in the response.
4328// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
4329// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
4330// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
4331// populated.
4332func (client BaseClient) GetApplicationsEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListApplicationEvent, err error) {
4333	if tracing.IsEnabled() {
4334		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationsEventList")
4335		defer func() {
4336			sc := -1
4337			if result.Response.Response != nil {
4338				sc = result.Response.Response.StatusCode
4339			}
4340			tracing.EndSpan(ctx, sc, err)
4341		}()
4342	}
4343	if err := validation.Validate([]validation.Validation{
4344		{TargetValue: timeout,
4345			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4346				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4347					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4348				}}}}}); err != nil {
4349		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationsEventList", err.Error())
4350	}
4351
4352	req, err := client.GetApplicationsEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
4353	if err != nil {
4354		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", nil, "Failure preparing request")
4355		return
4356	}
4357
4358	resp, err := client.GetApplicationsEventListSender(req)
4359	if err != nil {
4360		result.Response = autorest.Response{Response: resp}
4361		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", resp, "Failure sending request")
4362		return
4363	}
4364
4365	result, err = client.GetApplicationsEventListResponder(resp)
4366	if err != nil {
4367		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", resp, "Failure responding to request")
4368	}
4369
4370	return
4371}
4372
4373// GetApplicationsEventListPreparer prepares the GetApplicationsEventList request.
4374func (client BaseClient) GetApplicationsEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
4375	const APIVersion = "6.2-preview"
4376	queryParameters := map[string]interface{}{
4377		"api-version":  APIVersion,
4378		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
4379		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
4380	}
4381	if timeout != nil {
4382		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4383	} else {
4384		queryParameters["timeout"] = autorest.Encode("query", 60)
4385	}
4386	if len(eventsTypesFilter) > 0 {
4387		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
4388	}
4389	if excludeAnalysisEvents != nil {
4390		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
4391	}
4392	if skipCorrelationLookup != nil {
4393		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
4394	}
4395
4396	preparer := autorest.CreatePreparer(
4397		autorest.AsGet(),
4398		autorest.WithBaseURL(client.BaseURI),
4399		autorest.WithPath("/EventsStore/Applications/Events"),
4400		autorest.WithQueryParameters(queryParameters))
4401	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4402}
4403
4404// GetApplicationsEventListSender sends the GetApplicationsEventList request. The method will close the
4405// http.Response Body if it receives an error.
4406func (client BaseClient) GetApplicationsEventListSender(req *http.Request) (*http.Response, error) {
4407	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4408}
4409
4410// GetApplicationsEventListResponder handles the response to the GetApplicationsEventList request. The method always
4411// closes the http.Response Body.
4412func (client BaseClient) GetApplicationsEventListResponder(resp *http.Response) (result ListApplicationEvent, err error) {
4413	err = autorest.Respond(
4414		resp,
4415		client.ByInspecting(),
4416		azure.WithErrorUnlessStatusCode(http.StatusOK),
4417		autorest.ByUnmarshallingJSON(&result),
4418		autorest.ByClosing())
4419	result.Response = autorest.Response{Response: resp}
4420	return
4421}
4422
4423// GetApplicationTypeInfoList returns the information about the application types that are provisioned or in the
4424// process of being provisioned in the Service Fabric cluster. Each version of an application type is returned as one
4425// application type. The response includes the name, version, status and other details about the application type. This
4426// is a paged query, meaning that if not all of the application types fit in a page, one page of results is returned as
4427// well as a continuation token which can be used to get the next page. For example, if there are 10 application types
4428// but a page only fits the first 3 application types, or if max results is set to 3, then 3 is returned. To access the
4429// rest of the results, retrieve subsequent pages by using the returned continuation token in the next query. An empty
4430// continuation token is returned if there are no subsequent pages.
4431// Parameters:
4432// applicationTypeDefinitionKindFilter - used to filter on ApplicationTypeDefinitionKind which is the mechanism
4433// used to define a Service Fabric application type.
4434// - Default - Default value, which performs the same function as selecting "All". The value is 0.
4435// - All - Filter that matches input with any ApplicationTypeDefinitionKind value. The value is 65535.
4436// - ServiceFabricApplicationPackage - Filter that matches input with ApplicationTypeDefinitionKind value
4437// ServiceFabricApplicationPackage. The value is 1.
4438// - Compose - Filter that matches input with ApplicationTypeDefinitionKind value Compose. The value is 2.
4439// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from
4440// the result.
4441// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
4442// token with a non empty value is included in the response of the API when the results from the system do not
4443// fit in a single response. When this value is passed to the next API call, the API returns next set of
4444// results. If there are no further results then the continuation token does not contain a value. The value of
4445// this parameter should not be URL encoded.
4446// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
4447// defines the upper bound on the number of results returned. The results returned can be less than the
4448// specified maximum results if they do not fit in the message as per the max message size restrictions defined
4449// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
4450// as possible that fit in the return message.
4451// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4452// duration that the client is willing to wait for the requested operation to complete. The default value for
4453// this parameter is 60 seconds.
4454func (client BaseClient) GetApplicationTypeInfoList(ctx context.Context, applicationTypeDefinitionKindFilter *int32, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationTypeInfoList, err error) {
4455	if tracing.IsEnabled() {
4456		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationTypeInfoList")
4457		defer func() {
4458			sc := -1
4459			if result.Response.Response != nil {
4460				sc = result.Response.Response.StatusCode
4461			}
4462			tracing.EndSpan(ctx, sc, err)
4463		}()
4464	}
4465	if err := validation.Validate([]validation.Validation{
4466		{TargetValue: maxResults,
4467			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
4468				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
4469		{TargetValue: timeout,
4470			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4471				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4472					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4473				}}}}}); err != nil {
4474		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoList", err.Error())
4475	}
4476
4477	req, err := client.GetApplicationTypeInfoListPreparer(ctx, applicationTypeDefinitionKindFilter, excludeApplicationParameters, continuationToken, maxResults, timeout)
4478	if err != nil {
4479		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", nil, "Failure preparing request")
4480		return
4481	}
4482
4483	resp, err := client.GetApplicationTypeInfoListSender(req)
4484	if err != nil {
4485		result.Response = autorest.Response{Response: resp}
4486		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", resp, "Failure sending request")
4487		return
4488	}
4489
4490	result, err = client.GetApplicationTypeInfoListResponder(resp)
4491	if err != nil {
4492		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", resp, "Failure responding to request")
4493	}
4494
4495	return
4496}
4497
4498// GetApplicationTypeInfoListPreparer prepares the GetApplicationTypeInfoList request.
4499func (client BaseClient) GetApplicationTypeInfoListPreparer(ctx context.Context, applicationTypeDefinitionKindFilter *int32, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
4500	const APIVersion = "6.0"
4501	queryParameters := map[string]interface{}{
4502		"api-version": APIVersion,
4503	}
4504	if applicationTypeDefinitionKindFilter != nil {
4505		queryParameters["ApplicationTypeDefinitionKindFilter"] = autorest.Encode("query", *applicationTypeDefinitionKindFilter)
4506	} else {
4507		queryParameters["ApplicationTypeDefinitionKindFilter"] = autorest.Encode("query", 0)
4508	}
4509	if excludeApplicationParameters != nil {
4510		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters)
4511	} else {
4512		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false)
4513	}
4514	if len(continuationToken) > 0 {
4515		queryParameters["ContinuationToken"] = continuationToken
4516	}
4517	if maxResults != nil {
4518		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
4519	} else {
4520		queryParameters["MaxResults"] = autorest.Encode("query", 0)
4521	}
4522	if timeout != nil {
4523		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4524	} else {
4525		queryParameters["timeout"] = autorest.Encode("query", 60)
4526	}
4527
4528	preparer := autorest.CreatePreparer(
4529		autorest.AsGet(),
4530		autorest.WithBaseURL(client.BaseURI),
4531		autorest.WithPath("/ApplicationTypes"),
4532		autorest.WithQueryParameters(queryParameters))
4533	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4534}
4535
4536// GetApplicationTypeInfoListSender sends the GetApplicationTypeInfoList request. The method will close the
4537// http.Response Body if it receives an error.
4538func (client BaseClient) GetApplicationTypeInfoListSender(req *http.Request) (*http.Response, error) {
4539	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4540}
4541
4542// GetApplicationTypeInfoListResponder handles the response to the GetApplicationTypeInfoList request. The method always
4543// closes the http.Response Body.
4544func (client BaseClient) GetApplicationTypeInfoListResponder(resp *http.Response) (result PagedApplicationTypeInfoList, err error) {
4545	err = autorest.Respond(
4546		resp,
4547		client.ByInspecting(),
4548		azure.WithErrorUnlessStatusCode(http.StatusOK),
4549		autorest.ByUnmarshallingJSON(&result),
4550		autorest.ByClosing())
4551	result.Response = autorest.Response{Response: resp}
4552	return
4553}
4554
4555// GetApplicationTypeInfoListByName returns the information about the application types that are provisioned or in the
4556// process of being provisioned in the Service Fabric cluster. These results are of application types whose name match
4557// exactly the one specified as the parameter, and which comply with the given query parameters. All versions of the
4558// application type matching the application type name are returned, with each version returned as one application
4559// type. The response includes the name, version, status and other details about the application type. This is a paged
4560// query, meaning that if not all of the application types fit in a page, one page of results is returned as well as a
4561// continuation token which can be used to get the next page. For example, if there are 10 application types but a page
4562// only fits the first 3 application types, or if max results is set to 3, then 3 is returned. To access the rest of
4563// the results, retrieve subsequent pages by using the returned continuation token in the next query. An empty
4564// continuation token is returned if there are no subsequent pages.
4565// Parameters:
4566// applicationTypeName - the name of the application type.
4567// applicationTypeVersion - the version of the application type.
4568// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from
4569// the result.
4570// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
4571// token with a non empty value is included in the response of the API when the results from the system do not
4572// fit in a single response. When this value is passed to the next API call, the API returns next set of
4573// results. If there are no further results then the continuation token does not contain a value. The value of
4574// this parameter should not be URL encoded.
4575// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
4576// defines the upper bound on the number of results returned. The results returned can be less than the
4577// specified maximum results if they do not fit in the message as per the max message size restrictions defined
4578// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
4579// as possible that fit in the return message.
4580// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4581// duration that the client is willing to wait for the requested operation to complete. The default value for
4582// this parameter is 60 seconds.
4583func (client BaseClient) GetApplicationTypeInfoListByName(ctx context.Context, applicationTypeName string, applicationTypeVersion string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationTypeInfoList, err error) {
4584	if tracing.IsEnabled() {
4585		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationTypeInfoListByName")
4586		defer func() {
4587			sc := -1
4588			if result.Response.Response != nil {
4589				sc = result.Response.Response.StatusCode
4590			}
4591			tracing.EndSpan(ctx, sc, err)
4592		}()
4593	}
4594	if err := validation.Validate([]validation.Validation{
4595		{TargetValue: maxResults,
4596			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
4597				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
4598		{TargetValue: timeout,
4599			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4600				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4601					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4602				}}}}}); err != nil {
4603		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoListByName", err.Error())
4604	}
4605
4606	req, err := client.GetApplicationTypeInfoListByNamePreparer(ctx, applicationTypeName, applicationTypeVersion, excludeApplicationParameters, continuationToken, maxResults, timeout)
4607	if err != nil {
4608		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", nil, "Failure preparing request")
4609		return
4610	}
4611
4612	resp, err := client.GetApplicationTypeInfoListByNameSender(req)
4613	if err != nil {
4614		result.Response = autorest.Response{Response: resp}
4615		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", resp, "Failure sending request")
4616		return
4617	}
4618
4619	result, err = client.GetApplicationTypeInfoListByNameResponder(resp)
4620	if err != nil {
4621		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", resp, "Failure responding to request")
4622	}
4623
4624	return
4625}
4626
4627// GetApplicationTypeInfoListByNamePreparer prepares the GetApplicationTypeInfoListByName request.
4628func (client BaseClient) GetApplicationTypeInfoListByNamePreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
4629	pathParameters := map[string]interface{}{
4630		"applicationTypeName": autorest.Encode("path", applicationTypeName),
4631	}
4632
4633	const APIVersion = "6.0"
4634	queryParameters := map[string]interface{}{
4635		"api-version": APIVersion,
4636	}
4637	if len(applicationTypeVersion) > 0 {
4638		queryParameters["ApplicationTypeVersion"] = autorest.Encode("query", applicationTypeVersion)
4639	}
4640	if excludeApplicationParameters != nil {
4641		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters)
4642	} else {
4643		queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false)
4644	}
4645	if len(continuationToken) > 0 {
4646		queryParameters["ContinuationToken"] = continuationToken
4647	}
4648	if maxResults != nil {
4649		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
4650	} else {
4651		queryParameters["MaxResults"] = autorest.Encode("query", 0)
4652	}
4653	if timeout != nil {
4654		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4655	} else {
4656		queryParameters["timeout"] = autorest.Encode("query", 60)
4657	}
4658
4659	preparer := autorest.CreatePreparer(
4660		autorest.AsGet(),
4661		autorest.WithBaseURL(client.BaseURI),
4662		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}", pathParameters),
4663		autorest.WithQueryParameters(queryParameters))
4664	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4665}
4666
4667// GetApplicationTypeInfoListByNameSender sends the GetApplicationTypeInfoListByName request. The method will close the
4668// http.Response Body if it receives an error.
4669func (client BaseClient) GetApplicationTypeInfoListByNameSender(req *http.Request) (*http.Response, error) {
4670	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4671}
4672
4673// GetApplicationTypeInfoListByNameResponder handles the response to the GetApplicationTypeInfoListByName request. The method always
4674// closes the http.Response Body.
4675func (client BaseClient) GetApplicationTypeInfoListByNameResponder(resp *http.Response) (result PagedApplicationTypeInfoList, err error) {
4676	err = autorest.Respond(
4677		resp,
4678		client.ByInspecting(),
4679		azure.WithErrorUnlessStatusCode(http.StatusOK),
4680		autorest.ByUnmarshallingJSON(&result),
4681		autorest.ByClosing())
4682	result.Response = autorest.Response{Response: resp}
4683	return
4684}
4685
4686// GetApplicationUpgrade returns information about the state of the latest application upgrade along with details to
4687// aid debugging application health issues.
4688// Parameters:
4689// applicationID - the identity of the application. This is typically the full name of the application without
4690// the 'fabric:' URI scheme.
4691// Starting from version 6.0, hierarchical names are delimited with the "~" character.
4692// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
4693// in 6.0+ and "myapp/app1" in previous versions.
4694// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4695// duration that the client is willing to wait for the requested operation to complete. The default value for
4696// this parameter is 60 seconds.
4697func (client BaseClient) GetApplicationUpgrade(ctx context.Context, applicationID string, timeout *int64) (result ApplicationUpgradeProgressInfo, err error) {
4698	if tracing.IsEnabled() {
4699		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationUpgrade")
4700		defer func() {
4701			sc := -1
4702			if result.Response.Response != nil {
4703				sc = result.Response.Response.StatusCode
4704			}
4705			tracing.EndSpan(ctx, sc, err)
4706		}()
4707	}
4708	if err := validation.Validate([]validation.Validation{
4709		{TargetValue: timeout,
4710			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4711				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4712					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4713				}}}}}); err != nil {
4714		return result, validation.NewError("servicefabric.BaseClient", "GetApplicationUpgrade", err.Error())
4715	}
4716
4717	req, err := client.GetApplicationUpgradePreparer(ctx, applicationID, timeout)
4718	if err != nil {
4719		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", nil, "Failure preparing request")
4720		return
4721	}
4722
4723	resp, err := client.GetApplicationUpgradeSender(req)
4724	if err != nil {
4725		result.Response = autorest.Response{Response: resp}
4726		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", resp, "Failure sending request")
4727		return
4728	}
4729
4730	result, err = client.GetApplicationUpgradeResponder(resp)
4731	if err != nil {
4732		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", resp, "Failure responding to request")
4733	}
4734
4735	return
4736}
4737
4738// GetApplicationUpgradePreparer prepares the GetApplicationUpgrade request.
4739func (client BaseClient) GetApplicationUpgradePreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
4740	pathParameters := map[string]interface{}{
4741		"applicationId": applicationID,
4742	}
4743
4744	const APIVersion = "6.0"
4745	queryParameters := map[string]interface{}{
4746		"api-version": APIVersion,
4747	}
4748	if timeout != nil {
4749		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4750	} else {
4751		queryParameters["timeout"] = autorest.Encode("query", 60)
4752	}
4753
4754	preparer := autorest.CreatePreparer(
4755		autorest.AsGet(),
4756		autorest.WithBaseURL(client.BaseURI),
4757		autorest.WithPathParameters("/Applications/{applicationId}/$/GetUpgradeProgress", pathParameters),
4758		autorest.WithQueryParameters(queryParameters))
4759	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4760}
4761
4762// GetApplicationUpgradeSender sends the GetApplicationUpgrade request. The method will close the
4763// http.Response Body if it receives an error.
4764func (client BaseClient) GetApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
4765	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4766}
4767
4768// GetApplicationUpgradeResponder handles the response to the GetApplicationUpgrade request. The method always
4769// closes the http.Response Body.
4770func (client BaseClient) GetApplicationUpgradeResponder(resp *http.Response) (result ApplicationUpgradeProgressInfo, err error) {
4771	err = autorest.Respond(
4772		resp,
4773		client.ByInspecting(),
4774		azure.WithErrorUnlessStatusCode(http.StatusOK),
4775		autorest.ByUnmarshallingJSON(&result),
4776		autorest.ByClosing())
4777	result.Response = autorest.Response{Response: resp}
4778	return
4779}
4780
4781// GetBackupPolicyByName gets a particular backup policy identified by {backupPolicyName}
4782// Parameters:
4783// backupPolicyName - the name of the backup policy.
4784// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4785// duration that the client is willing to wait for the requested operation to complete. The default value for
4786// this parameter is 60 seconds.
4787func (client BaseClient) GetBackupPolicyByName(ctx context.Context, backupPolicyName string, timeout *int64) (result BackupPolicyDescription, err error) {
4788	if tracing.IsEnabled() {
4789		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupPolicyByName")
4790		defer func() {
4791			sc := -1
4792			if result.Response.Response != nil {
4793				sc = result.Response.Response.StatusCode
4794			}
4795			tracing.EndSpan(ctx, sc, err)
4796		}()
4797	}
4798	if err := validation.Validate([]validation.Validation{
4799		{TargetValue: timeout,
4800			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4801				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4802					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4803				}}}}}); err != nil {
4804		return result, validation.NewError("servicefabric.BaseClient", "GetBackupPolicyByName", err.Error())
4805	}
4806
4807	req, err := client.GetBackupPolicyByNamePreparer(ctx, backupPolicyName, timeout)
4808	if err != nil {
4809		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", nil, "Failure preparing request")
4810		return
4811	}
4812
4813	resp, err := client.GetBackupPolicyByNameSender(req)
4814	if err != nil {
4815		result.Response = autorest.Response{Response: resp}
4816		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", resp, "Failure sending request")
4817		return
4818	}
4819
4820	result, err = client.GetBackupPolicyByNameResponder(resp)
4821	if err != nil {
4822		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", resp, "Failure responding to request")
4823	}
4824
4825	return
4826}
4827
4828// GetBackupPolicyByNamePreparer prepares the GetBackupPolicyByName request.
4829func (client BaseClient) GetBackupPolicyByNamePreparer(ctx context.Context, backupPolicyName string, timeout *int64) (*http.Request, error) {
4830	pathParameters := map[string]interface{}{
4831		"backupPolicyName": autorest.Encode("path", backupPolicyName),
4832	}
4833
4834	const APIVersion = "6.2-preview"
4835	queryParameters := map[string]interface{}{
4836		"api-version": APIVersion,
4837	}
4838	if timeout != nil {
4839		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4840	} else {
4841		queryParameters["timeout"] = autorest.Encode("query", 60)
4842	}
4843
4844	preparer := autorest.CreatePreparer(
4845		autorest.AsGet(),
4846		autorest.WithBaseURL(client.BaseURI),
4847		autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}", pathParameters),
4848		autorest.WithQueryParameters(queryParameters))
4849	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4850}
4851
4852// GetBackupPolicyByNameSender sends the GetBackupPolicyByName request. The method will close the
4853// http.Response Body if it receives an error.
4854func (client BaseClient) GetBackupPolicyByNameSender(req *http.Request) (*http.Response, error) {
4855	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4856}
4857
4858// GetBackupPolicyByNameResponder handles the response to the GetBackupPolicyByName request. The method always
4859// closes the http.Response Body.
4860func (client BaseClient) GetBackupPolicyByNameResponder(resp *http.Response) (result BackupPolicyDescription, err error) {
4861	err = autorest.Respond(
4862		resp,
4863		client.ByInspecting(),
4864		azure.WithErrorUnlessStatusCode(http.StatusOK),
4865		autorest.ByUnmarshallingJSON(&result),
4866		autorest.ByClosing())
4867	result.Response = autorest.Response{Response: resp}
4868	return
4869}
4870
4871// GetBackupPolicyList get a list of all the backup policies configured.
4872// Parameters:
4873// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
4874// token with a non empty value is included in the response of the API when the results from the system do not
4875// fit in a single response. When this value is passed to the next API call, the API returns next set of
4876// results. If there are no further results then the continuation token does not contain a value. The value of
4877// this parameter should not be URL encoded.
4878// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
4879// defines the upper bound on the number of results returned. The results returned can be less than the
4880// specified maximum results if they do not fit in the message as per the max message size restrictions defined
4881// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
4882// as possible that fit in the return message.
4883// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4884// duration that the client is willing to wait for the requested operation to complete. The default value for
4885// this parameter is 60 seconds.
4886func (client BaseClient) GetBackupPolicyList(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupPolicyDescriptionList, err error) {
4887	if tracing.IsEnabled() {
4888		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupPolicyList")
4889		defer func() {
4890			sc := -1
4891			if result.Response.Response != nil {
4892				sc = result.Response.Response.StatusCode
4893			}
4894			tracing.EndSpan(ctx, sc, err)
4895		}()
4896	}
4897	if err := validation.Validate([]validation.Validation{
4898		{TargetValue: maxResults,
4899			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
4900				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
4901		{TargetValue: timeout,
4902			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
4903				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
4904					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
4905				}}}}}); err != nil {
4906		return result, validation.NewError("servicefabric.BaseClient", "GetBackupPolicyList", err.Error())
4907	}
4908
4909	req, err := client.GetBackupPolicyListPreparer(ctx, continuationToken, maxResults, timeout)
4910	if err != nil {
4911		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", nil, "Failure preparing request")
4912		return
4913	}
4914
4915	resp, err := client.GetBackupPolicyListSender(req)
4916	if err != nil {
4917		result.Response = autorest.Response{Response: resp}
4918		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", resp, "Failure sending request")
4919		return
4920	}
4921
4922	result, err = client.GetBackupPolicyListResponder(resp)
4923	if err != nil {
4924		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", resp, "Failure responding to request")
4925	}
4926
4927	return
4928}
4929
4930// GetBackupPolicyListPreparer prepares the GetBackupPolicyList request.
4931func (client BaseClient) GetBackupPolicyListPreparer(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
4932	const APIVersion = "6.2-preview"
4933	queryParameters := map[string]interface{}{
4934		"api-version": APIVersion,
4935	}
4936	if len(continuationToken) > 0 {
4937		queryParameters["ContinuationToken"] = continuationToken
4938	}
4939	if maxResults != nil {
4940		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
4941	} else {
4942		queryParameters["MaxResults"] = autorest.Encode("query", 0)
4943	}
4944	if timeout != nil {
4945		queryParameters["timeout"] = autorest.Encode("query", *timeout)
4946	} else {
4947		queryParameters["timeout"] = autorest.Encode("query", 60)
4948	}
4949
4950	preparer := autorest.CreatePreparer(
4951		autorest.AsGet(),
4952		autorest.WithBaseURL(client.BaseURI),
4953		autorest.WithPath("/BackupRestore/BackupPolicies"),
4954		autorest.WithQueryParameters(queryParameters))
4955	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4956}
4957
4958// GetBackupPolicyListSender sends the GetBackupPolicyList request. The method will close the
4959// http.Response Body if it receives an error.
4960func (client BaseClient) GetBackupPolicyListSender(req *http.Request) (*http.Response, error) {
4961	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4962}
4963
4964// GetBackupPolicyListResponder handles the response to the GetBackupPolicyList request. The method always
4965// closes the http.Response Body.
4966func (client BaseClient) GetBackupPolicyListResponder(resp *http.Response) (result PagedBackupPolicyDescriptionList, err error) {
4967	err = autorest.Respond(
4968		resp,
4969		client.ByInspecting(),
4970		azure.WithErrorUnlessStatusCode(http.StatusOK),
4971		autorest.ByUnmarshallingJSON(&result),
4972		autorest.ByClosing())
4973	result.Response = autorest.Response{Response: resp}
4974	return
4975}
4976
4977// GetBackupsFromBackupLocation gets the list of backups available for the specified backed up entity (Application,
4978// Service or Partition) at the specified backup location (FileShare or Azure Blob Storage).
4979// Parameters:
4980// getBackupByStorageQueryDescription - describes the filters and backup storage details to be used for
4981// enumerating backups.
4982// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
4983// duration that the client is willing to wait for the requested operation to complete. The default value for
4984// this parameter is 60 seconds.
4985// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
4986// token with a non empty value is included in the response of the API when the results from the system do not
4987// fit in a single response. When this value is passed to the next API call, the API returns next set of
4988// results. If there are no further results then the continuation token does not contain a value. The value of
4989// this parameter should not be URL encoded.
4990// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
4991// defines the upper bound on the number of results returned. The results returned can be less than the
4992// specified maximum results if they do not fit in the message as per the max message size restrictions defined
4993// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
4994// as possible that fit in the return message.
4995func (client BaseClient) GetBackupsFromBackupLocation(ctx context.Context, getBackupByStorageQueryDescription GetBackupByStorageQueryDescription, timeout *int64, continuationToken string, maxResults *int64) (result PagedBackupInfoList, err error) {
4996	if tracing.IsEnabled() {
4997		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupsFromBackupLocation")
4998		defer func() {
4999			sc := -1
5000			if result.Response.Response != nil {
5001				sc = result.Response.Response.StatusCode
5002			}
5003			tracing.EndSpan(ctx, sc, err)
5004		}()
5005	}
5006	if err := validation.Validate([]validation.Validation{
5007		{TargetValue: timeout,
5008			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5009				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5010					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5011				}}}},
5012		{TargetValue: maxResults,
5013			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
5014				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
5015		{TargetValue: getBackupByStorageQueryDescription,
5016			Constraints: []validation.Constraint{{Target: "getBackupByStorageQueryDescription.Storage", Name: validation.Null, Rule: true, Chain: nil},
5017				{Target: "getBackupByStorageQueryDescription.BackupEntity", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
5018		return result, validation.NewError("servicefabric.BaseClient", "GetBackupsFromBackupLocation", err.Error())
5019	}
5020
5021	req, err := client.GetBackupsFromBackupLocationPreparer(ctx, getBackupByStorageQueryDescription, timeout, continuationToken, maxResults)
5022	if err != nil {
5023		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", nil, "Failure preparing request")
5024		return
5025	}
5026
5027	resp, err := client.GetBackupsFromBackupLocationSender(req)
5028	if err != nil {
5029		result.Response = autorest.Response{Response: resp}
5030		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", resp, "Failure sending request")
5031		return
5032	}
5033
5034	result, err = client.GetBackupsFromBackupLocationResponder(resp)
5035	if err != nil {
5036		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", resp, "Failure responding to request")
5037	}
5038
5039	return
5040}
5041
5042// GetBackupsFromBackupLocationPreparer prepares the GetBackupsFromBackupLocation request.
5043func (client BaseClient) GetBackupsFromBackupLocationPreparer(ctx context.Context, getBackupByStorageQueryDescription GetBackupByStorageQueryDescription, timeout *int64, continuationToken string, maxResults *int64) (*http.Request, error) {
5044	const APIVersion = "6.2-preview"
5045	queryParameters := map[string]interface{}{
5046		"api-version": APIVersion,
5047	}
5048	if timeout != nil {
5049		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5050	} else {
5051		queryParameters["timeout"] = autorest.Encode("query", 60)
5052	}
5053	if len(continuationToken) > 0 {
5054		queryParameters["ContinuationToken"] = continuationToken
5055	}
5056	if maxResults != nil {
5057		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
5058	} else {
5059		queryParameters["MaxResults"] = autorest.Encode("query", 0)
5060	}
5061
5062	preparer := autorest.CreatePreparer(
5063		autorest.AsContentType("application/json; charset=utf-8"),
5064		autorest.AsPost(),
5065		autorest.WithBaseURL(client.BaseURI),
5066		autorest.WithPath("/BackupRestore/$/GetBackups"),
5067		autorest.WithJSON(getBackupByStorageQueryDescription),
5068		autorest.WithQueryParameters(queryParameters))
5069	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5070}
5071
5072// GetBackupsFromBackupLocationSender sends the GetBackupsFromBackupLocation request. The method will close the
5073// http.Response Body if it receives an error.
5074func (client BaseClient) GetBackupsFromBackupLocationSender(req *http.Request) (*http.Response, error) {
5075	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5076}
5077
5078// GetBackupsFromBackupLocationResponder handles the response to the GetBackupsFromBackupLocation request. The method always
5079// closes the http.Response Body.
5080func (client BaseClient) GetBackupsFromBackupLocationResponder(resp *http.Response) (result PagedBackupInfoList, err error) {
5081	err = autorest.Respond(
5082		resp,
5083		client.ByInspecting(),
5084		azure.WithErrorUnlessStatusCode(http.StatusOK),
5085		autorest.ByUnmarshallingJSON(&result),
5086		autorest.ByClosing())
5087	result.Response = autorest.Response{Response: resp}
5088	return
5089}
5090
5091// GetChaos get the status of Chaos indicating whether or not Chaos is running, the Chaos parameters used for running
5092// Chaos and the status of the Chaos Schedule.
5093// Parameters:
5094// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5095// duration that the client is willing to wait for the requested operation to complete. The default value for
5096// this parameter is 60 seconds.
5097func (client BaseClient) GetChaos(ctx context.Context, timeout *int64) (result Chaos, err error) {
5098	if tracing.IsEnabled() {
5099		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaos")
5100		defer func() {
5101			sc := -1
5102			if result.Response.Response != nil {
5103				sc = result.Response.Response.StatusCode
5104			}
5105			tracing.EndSpan(ctx, sc, err)
5106		}()
5107	}
5108	if err := validation.Validate([]validation.Validation{
5109		{TargetValue: timeout,
5110			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5111				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5112					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5113				}}}}}); err != nil {
5114		return result, validation.NewError("servicefabric.BaseClient", "GetChaos", err.Error())
5115	}
5116
5117	req, err := client.GetChaosPreparer(ctx, timeout)
5118	if err != nil {
5119		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", nil, "Failure preparing request")
5120		return
5121	}
5122
5123	resp, err := client.GetChaosSender(req)
5124	if err != nil {
5125		result.Response = autorest.Response{Response: resp}
5126		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", resp, "Failure sending request")
5127		return
5128	}
5129
5130	result, err = client.GetChaosResponder(resp)
5131	if err != nil {
5132		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", resp, "Failure responding to request")
5133	}
5134
5135	return
5136}
5137
5138// GetChaosPreparer prepares the GetChaos request.
5139func (client BaseClient) GetChaosPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
5140	const APIVersion = "6.2"
5141	queryParameters := map[string]interface{}{
5142		"api-version": APIVersion,
5143	}
5144	if timeout != nil {
5145		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5146	} else {
5147		queryParameters["timeout"] = autorest.Encode("query", 60)
5148	}
5149
5150	preparer := autorest.CreatePreparer(
5151		autorest.AsGet(),
5152		autorest.WithBaseURL(client.BaseURI),
5153		autorest.WithPath("/Tools/Chaos"),
5154		autorest.WithQueryParameters(queryParameters))
5155	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5156}
5157
5158// GetChaosSender sends the GetChaos request. The method will close the
5159// http.Response Body if it receives an error.
5160func (client BaseClient) GetChaosSender(req *http.Request) (*http.Response, error) {
5161	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5162}
5163
5164// GetChaosResponder handles the response to the GetChaos request. The method always
5165// closes the http.Response Body.
5166func (client BaseClient) GetChaosResponder(resp *http.Response) (result Chaos, err error) {
5167	err = autorest.Respond(
5168		resp,
5169		client.ByInspecting(),
5170		azure.WithErrorUnlessStatusCode(http.StatusOK),
5171		autorest.ByUnmarshallingJSON(&result),
5172		autorest.ByClosing())
5173	result.Response = autorest.Response{Response: resp}
5174	return
5175}
5176
5177// GetChaosEvents to get the next segment of the Chaos events, you can specify the ContinuationToken. To get the start
5178// of a new segment of Chaos events, you can specify the time range
5179// through StartTimeUtc and EndTimeUtc. You cannot specify both the ContinuationToken and the time range in the same
5180// call.
5181// When there are more than 100 Chaos events, the Chaos events are returned in multiple segments where a segment
5182// contains no more than 100 Chaos events and to get the next segment you make a call to this API with the continuation
5183// token.
5184// Parameters:
5185// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
5186// token with a non empty value is included in the response of the API when the results from the system do not
5187// fit in a single response. When this value is passed to the next API call, the API returns next set of
5188// results. If there are no further results then the continuation token does not contain a value. The value of
5189// this parameter should not be URL encoded.
5190// startTimeUtc - the Windows file time representing the start time of the time range for which a Chaos report
5191// is to be generated. Please consult [DateTime.ToFileTimeUtc
5192// Method](https://msdn.microsoft.com/en-us/library/system.datetime.tofiletimeutc(v=vs.110).aspx) for details.
5193// endTimeUtc - the Windows file time representing the end time of the time range for which a Chaos report is
5194// to be generated. Please consult [DateTime.ToFileTimeUtc
5195// Method](https://msdn.microsoft.com/en-us/library/system.datetime.tofiletimeutc(v=vs.110).aspx) for details.
5196// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
5197// defines the upper bound on the number of results returned. The results returned can be less than the
5198// specified maximum results if they do not fit in the message as per the max message size restrictions defined
5199// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
5200// as possible that fit in the return message.
5201// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5202// duration that the client is willing to wait for the requested operation to complete. The default value for
5203// this parameter is 60 seconds.
5204func (client BaseClient) GetChaosEvents(ctx context.Context, continuationToken string, startTimeUtc string, endTimeUtc string, maxResults *int64, timeout *int64) (result ChaosEventsSegment, err error) {
5205	if tracing.IsEnabled() {
5206		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaosEvents")
5207		defer func() {
5208			sc := -1
5209			if result.Response.Response != nil {
5210				sc = result.Response.Response.StatusCode
5211			}
5212			tracing.EndSpan(ctx, sc, err)
5213		}()
5214	}
5215	if err := validation.Validate([]validation.Validation{
5216		{TargetValue: maxResults,
5217			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
5218				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
5219		{TargetValue: timeout,
5220			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5221				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5222					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5223				}}}}}); err != nil {
5224		return result, validation.NewError("servicefabric.BaseClient", "GetChaosEvents", err.Error())
5225	}
5226
5227	req, err := client.GetChaosEventsPreparer(ctx, continuationToken, startTimeUtc, endTimeUtc, maxResults, timeout)
5228	if err != nil {
5229		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", nil, "Failure preparing request")
5230		return
5231	}
5232
5233	resp, err := client.GetChaosEventsSender(req)
5234	if err != nil {
5235		result.Response = autorest.Response{Response: resp}
5236		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", resp, "Failure sending request")
5237		return
5238	}
5239
5240	result, err = client.GetChaosEventsResponder(resp)
5241	if err != nil {
5242		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", resp, "Failure responding to request")
5243	}
5244
5245	return
5246}
5247
5248// GetChaosEventsPreparer prepares the GetChaosEvents request.
5249func (client BaseClient) GetChaosEventsPreparer(ctx context.Context, continuationToken string, startTimeUtc string, endTimeUtc string, maxResults *int64, timeout *int64) (*http.Request, error) {
5250	const APIVersion = "6.2"
5251	queryParameters := map[string]interface{}{
5252		"api-version": APIVersion,
5253	}
5254	if len(continuationToken) > 0 {
5255		queryParameters["ContinuationToken"] = continuationToken
5256	}
5257	if len(startTimeUtc) > 0 {
5258		queryParameters["StartTimeUtc"] = autorest.Encode("query", startTimeUtc)
5259	}
5260	if len(endTimeUtc) > 0 {
5261		queryParameters["EndTimeUtc"] = autorest.Encode("query", endTimeUtc)
5262	}
5263	if maxResults != nil {
5264		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
5265	} else {
5266		queryParameters["MaxResults"] = autorest.Encode("query", 0)
5267	}
5268	if timeout != nil {
5269		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5270	} else {
5271		queryParameters["timeout"] = autorest.Encode("query", 60)
5272	}
5273
5274	preparer := autorest.CreatePreparer(
5275		autorest.AsGet(),
5276		autorest.WithBaseURL(client.BaseURI),
5277		autorest.WithPath("/Tools/Chaos/Events"),
5278		autorest.WithQueryParameters(queryParameters))
5279	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5280}
5281
5282// GetChaosEventsSender sends the GetChaosEvents request. The method will close the
5283// http.Response Body if it receives an error.
5284func (client BaseClient) GetChaosEventsSender(req *http.Request) (*http.Response, error) {
5285	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5286}
5287
5288// GetChaosEventsResponder handles the response to the GetChaosEvents request. The method always
5289// closes the http.Response Body.
5290func (client BaseClient) GetChaosEventsResponder(resp *http.Response) (result ChaosEventsSegment, err error) {
5291	err = autorest.Respond(
5292		resp,
5293		client.ByInspecting(),
5294		azure.WithErrorUnlessStatusCode(http.StatusOK),
5295		autorest.ByUnmarshallingJSON(&result),
5296		autorest.ByClosing())
5297	result.Response = autorest.Response{Response: resp}
5298	return
5299}
5300
5301// GetChaosSchedule gets the version of the Chaos Schedule in use and the Chaos Schedule that defines when and how to
5302// run Chaos.
5303func (client BaseClient) GetChaosSchedule(ctx context.Context) (result ChaosScheduleDescription, err error) {
5304	if tracing.IsEnabled() {
5305		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaosSchedule")
5306		defer func() {
5307			sc := -1
5308			if result.Response.Response != nil {
5309				sc = result.Response.Response.StatusCode
5310			}
5311			tracing.EndSpan(ctx, sc, err)
5312		}()
5313	}
5314	req, err := client.GetChaosSchedulePreparer(ctx)
5315	if err != nil {
5316		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", nil, "Failure preparing request")
5317		return
5318	}
5319
5320	resp, err := client.GetChaosScheduleSender(req)
5321	if err != nil {
5322		result.Response = autorest.Response{Response: resp}
5323		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", resp, "Failure sending request")
5324		return
5325	}
5326
5327	result, err = client.GetChaosScheduleResponder(resp)
5328	if err != nil {
5329		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", resp, "Failure responding to request")
5330	}
5331
5332	return
5333}
5334
5335// GetChaosSchedulePreparer prepares the GetChaosSchedule request.
5336func (client BaseClient) GetChaosSchedulePreparer(ctx context.Context) (*http.Request, error) {
5337	const APIVersion = "6.2"
5338	queryParameters := map[string]interface{}{
5339		"api-version": APIVersion,
5340	}
5341
5342	preparer := autorest.CreatePreparer(
5343		autorest.AsGet(),
5344		autorest.WithBaseURL(client.BaseURI),
5345		autorest.WithPath("/Tools/Chaos/Schedule"),
5346		autorest.WithQueryParameters(queryParameters))
5347	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5348}
5349
5350// GetChaosScheduleSender sends the GetChaosSchedule request. The method will close the
5351// http.Response Body if it receives an error.
5352func (client BaseClient) GetChaosScheduleSender(req *http.Request) (*http.Response, error) {
5353	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5354}
5355
5356// GetChaosScheduleResponder handles the response to the GetChaosSchedule request. The method always
5357// closes the http.Response Body.
5358func (client BaseClient) GetChaosScheduleResponder(resp *http.Response) (result ChaosScheduleDescription, err error) {
5359	err = autorest.Respond(
5360		resp,
5361		client.ByInspecting(),
5362		azure.WithErrorUnlessStatusCode(http.StatusOK),
5363		autorest.ByUnmarshallingJSON(&result),
5364		autorest.ByClosing())
5365	result.Response = autorest.Response{Response: resp}
5366	return
5367}
5368
5369// GetClusterConfiguration get the Service Fabric standalone cluster configuration. The cluster configuration contains
5370// properties of the cluster that include different node types on the cluster,
5371// security configurations, fault and upgrade domain topologies, etc.
5372// Parameters:
5373// configurationAPIVersion - the API version of the Standalone cluster json configuration.
5374// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5375// duration that the client is willing to wait for the requested operation to complete. The default value for
5376// this parameter is 60 seconds.
5377func (client BaseClient) GetClusterConfiguration(ctx context.Context, configurationAPIVersion string, timeout *int64) (result ClusterConfiguration, err error) {
5378	if tracing.IsEnabled() {
5379		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterConfiguration")
5380		defer func() {
5381			sc := -1
5382			if result.Response.Response != nil {
5383				sc = result.Response.Response.StatusCode
5384			}
5385			tracing.EndSpan(ctx, sc, err)
5386		}()
5387	}
5388	if err := validation.Validate([]validation.Validation{
5389		{TargetValue: timeout,
5390			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5391				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5392					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5393				}}}}}); err != nil {
5394		return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfiguration", err.Error())
5395	}
5396
5397	req, err := client.GetClusterConfigurationPreparer(ctx, configurationAPIVersion, timeout)
5398	if err != nil {
5399		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", nil, "Failure preparing request")
5400		return
5401	}
5402
5403	resp, err := client.GetClusterConfigurationSender(req)
5404	if err != nil {
5405		result.Response = autorest.Response{Response: resp}
5406		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", resp, "Failure sending request")
5407		return
5408	}
5409
5410	result, err = client.GetClusterConfigurationResponder(resp)
5411	if err != nil {
5412		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", resp, "Failure responding to request")
5413	}
5414
5415	return
5416}
5417
5418// GetClusterConfigurationPreparer prepares the GetClusterConfiguration request.
5419func (client BaseClient) GetClusterConfigurationPreparer(ctx context.Context, configurationAPIVersion string, timeout *int64) (*http.Request, error) {
5420	const APIVersion = "6.0"
5421	queryParameters := map[string]interface{}{
5422		"api-version":             APIVersion,
5423		"ConfigurationApiVersion": autorest.Encode("query", configurationAPIVersion),
5424	}
5425	if timeout != nil {
5426		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5427	} else {
5428		queryParameters["timeout"] = autorest.Encode("query", 60)
5429	}
5430
5431	preparer := autorest.CreatePreparer(
5432		autorest.AsGet(),
5433		autorest.WithBaseURL(client.BaseURI),
5434		autorest.WithPath("/$/GetClusterConfiguration"),
5435		autorest.WithQueryParameters(queryParameters))
5436	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5437}
5438
5439// GetClusterConfigurationSender sends the GetClusterConfiguration request. The method will close the
5440// http.Response Body if it receives an error.
5441func (client BaseClient) GetClusterConfigurationSender(req *http.Request) (*http.Response, error) {
5442	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5443}
5444
5445// GetClusterConfigurationResponder handles the response to the GetClusterConfiguration request. The method always
5446// closes the http.Response Body.
5447func (client BaseClient) GetClusterConfigurationResponder(resp *http.Response) (result ClusterConfiguration, err error) {
5448	err = autorest.Respond(
5449		resp,
5450		client.ByInspecting(),
5451		azure.WithErrorUnlessStatusCode(http.StatusOK),
5452		autorest.ByUnmarshallingJSON(&result),
5453		autorest.ByClosing())
5454	result.Response = autorest.Response{Response: resp}
5455	return
5456}
5457
5458// GetClusterConfigurationUpgradeStatus get the cluster configuration upgrade status details of a Service Fabric
5459// standalone cluster.
5460// Parameters:
5461// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5462// duration that the client is willing to wait for the requested operation to complete. The default value for
5463// this parameter is 60 seconds.
5464func (client BaseClient) GetClusterConfigurationUpgradeStatus(ctx context.Context, timeout *int64) (result ClusterConfigurationUpgradeStatusInfo, err error) {
5465	if tracing.IsEnabled() {
5466		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterConfigurationUpgradeStatus")
5467		defer func() {
5468			sc := -1
5469			if result.Response.Response != nil {
5470				sc = result.Response.Response.StatusCode
5471			}
5472			tracing.EndSpan(ctx, sc, err)
5473		}()
5474	}
5475	if err := validation.Validate([]validation.Validation{
5476		{TargetValue: timeout,
5477			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5478				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5479					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5480				}}}}}); err != nil {
5481		return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", err.Error())
5482	}
5483
5484	req, err := client.GetClusterConfigurationUpgradeStatusPreparer(ctx, timeout)
5485	if err != nil {
5486		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", nil, "Failure preparing request")
5487		return
5488	}
5489
5490	resp, err := client.GetClusterConfigurationUpgradeStatusSender(req)
5491	if err != nil {
5492		result.Response = autorest.Response{Response: resp}
5493		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", resp, "Failure sending request")
5494		return
5495	}
5496
5497	result, err = client.GetClusterConfigurationUpgradeStatusResponder(resp)
5498	if err != nil {
5499		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", resp, "Failure responding to request")
5500	}
5501
5502	return
5503}
5504
5505// GetClusterConfigurationUpgradeStatusPreparer prepares the GetClusterConfigurationUpgradeStatus request.
5506func (client BaseClient) GetClusterConfigurationUpgradeStatusPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
5507	const APIVersion = "6.0"
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("/$/GetClusterConfigurationUpgradeStatus"),
5521		autorest.WithQueryParameters(queryParameters))
5522	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5523}
5524
5525// GetClusterConfigurationUpgradeStatusSender sends the GetClusterConfigurationUpgradeStatus request. The method will close the
5526// http.Response Body if it receives an error.
5527func (client BaseClient) GetClusterConfigurationUpgradeStatusSender(req *http.Request) (*http.Response, error) {
5528	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5529}
5530
5531// GetClusterConfigurationUpgradeStatusResponder handles the response to the GetClusterConfigurationUpgradeStatus request. The method always
5532// closes the http.Response Body.
5533func (client BaseClient) GetClusterConfigurationUpgradeStatusResponder(resp *http.Response) (result ClusterConfigurationUpgradeStatusInfo, err error) {
5534	err = autorest.Respond(
5535		resp,
5536		client.ByInspecting(),
5537		azure.WithErrorUnlessStatusCode(http.StatusOK),
5538		autorest.ByUnmarshallingJSON(&result),
5539		autorest.ByClosing())
5540	result.Response = autorest.Response{Response: resp}
5541	return
5542}
5543
5544// GetClusterEventList the response is list of ClusterEvent objects.
5545// Parameters:
5546// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
5547// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
5548// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5549// duration that the client is willing to wait for the requested operation to complete. The default value for
5550// this parameter is 60 seconds.
5551// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
5552// be included in the response.
5553// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
5554// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
5555// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
5556// populated.
5557func (client BaseClient) GetClusterEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListClusterEvent, err error) {
5558	if tracing.IsEnabled() {
5559		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterEventList")
5560		defer func() {
5561			sc := -1
5562			if result.Response.Response != nil {
5563				sc = result.Response.Response.StatusCode
5564			}
5565			tracing.EndSpan(ctx, sc, err)
5566		}()
5567	}
5568	if err := validation.Validate([]validation.Validation{
5569		{TargetValue: timeout,
5570			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5571				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5572					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5573				}}}}}); err != nil {
5574		return result, validation.NewError("servicefabric.BaseClient", "GetClusterEventList", err.Error())
5575	}
5576
5577	req, err := client.GetClusterEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
5578	if err != nil {
5579		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", nil, "Failure preparing request")
5580		return
5581	}
5582
5583	resp, err := client.GetClusterEventListSender(req)
5584	if err != nil {
5585		result.Response = autorest.Response{Response: resp}
5586		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", resp, "Failure sending request")
5587		return
5588	}
5589
5590	result, err = client.GetClusterEventListResponder(resp)
5591	if err != nil {
5592		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", resp, "Failure responding to request")
5593	}
5594
5595	return
5596}
5597
5598// GetClusterEventListPreparer prepares the GetClusterEventList request.
5599func (client BaseClient) GetClusterEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
5600	const APIVersion = "6.2-preview"
5601	queryParameters := map[string]interface{}{
5602		"api-version":  APIVersion,
5603		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
5604		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
5605	}
5606	if timeout != nil {
5607		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5608	} else {
5609		queryParameters["timeout"] = autorest.Encode("query", 60)
5610	}
5611	if len(eventsTypesFilter) > 0 {
5612		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
5613	}
5614	if excludeAnalysisEvents != nil {
5615		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
5616	}
5617	if skipCorrelationLookup != nil {
5618		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
5619	}
5620
5621	preparer := autorest.CreatePreparer(
5622		autorest.AsGet(),
5623		autorest.WithBaseURL(client.BaseURI),
5624		autorest.WithPath("/EventsStore/Cluster/Events"),
5625		autorest.WithQueryParameters(queryParameters))
5626	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5627}
5628
5629// GetClusterEventListSender sends the GetClusterEventList request. The method will close the
5630// http.Response Body if it receives an error.
5631func (client BaseClient) GetClusterEventListSender(req *http.Request) (*http.Response, error) {
5632	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5633}
5634
5635// GetClusterEventListResponder handles the response to the GetClusterEventList request. The method always
5636// closes the http.Response Body.
5637func (client BaseClient) GetClusterEventListResponder(resp *http.Response) (result ListClusterEvent, err error) {
5638	err = autorest.Respond(
5639		resp,
5640		client.ByInspecting(),
5641		azure.WithErrorUnlessStatusCode(http.StatusOK),
5642		autorest.ByUnmarshallingJSON(&result),
5643		autorest.ByClosing())
5644	result.Response = autorest.Response{Response: resp}
5645	return
5646}
5647
5648// GetClusterHealth gets the health of a Service Fabric cluster.
5649// Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health
5650// state.
5651// Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and
5652// applications returned based on their aggregated health state.
5653// Parameters:
5654// nodesHealthStateFilter - allows filtering of the node health state objects returned in the result of cluster
5655// health query
5656// based on their health state. The possible values for this parameter include integer value of one of the
5657// following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the
5658// aggregated health state.
5659// If not specified, all entries are returned.
5660// The state values are flag based enumeration, so the value could be a combination of these values obtained
5661// using bitwise 'OR' operator.
5662// For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and
5663// Warning (4) are returned.
5664//
5665// - Default - Default value. Matches any HealthState. The value is zero.
5666// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
5667// collection of states. The value is 1.
5668// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
5669// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
5670// - Error - Filter that matches input with HealthState value Error. The value is 8.
5671// - All - Filter that matches input with any HealthState value. The value is 65535.
5672// applicationsHealthStateFilter - allows filtering of the application health state objects returned in the
5673// result of cluster health
5674// query based on their health state.
5675// The possible values for this parameter include integer value obtained from members or bitwise operations
5676// on members of HealthStateFilter enumeration. Only applications that match the filter are returned.
5677// All applications are used to evaluate the aggregated health state. If not specified, all entries are
5678// returned.
5679// The state values are flag based enumeration, so the value could be a combination of these values obtained
5680// using bitwise 'OR' operator.
5681// For example, if the provided value is 6 then health state of applications with HealthState value of OK (2)
5682// and Warning (4) are returned.
5683//
5684// - Default - Default value. Matches any HealthState. The value is zero.
5685// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
5686// collection of states. The value is 1.
5687// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
5688// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
5689// - Error - Filter that matches input with HealthState value Error. The value is 8.
5690// - All - Filter that matches input with any HealthState value. The value is 65535.
5691// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
5692// state.
5693// The possible values for this parameter include integer value of one of the following health states.
5694// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
5695// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
5696// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
5697// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
5698//
5699// - Default - Default value. Matches any HealthState. The value is zero.
5700// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
5701// collection of states. The value is 1.
5702// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
5703// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
5704// - Error - Filter that matches input with HealthState value Error. The value is 8.
5705// - All - Filter that matches input with any HealthState value. The value is 65535.
5706// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
5707// result. False by default.
5708// The statistics show the number of children entities in health state Ok, Warning, and Error.
5709// includeSystemApplicationHealthStatistics - indicates whether the health statistics should include the
5710// fabric:/System application health statistics. False by default.
5711// If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that
5712// belong to the fabric:/System application.
5713// Otherwise, the query result includes health statistics only for user applications.
5714// The health statistics must be included in the query result for this parameter to be applied.
5715// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5716// duration that the client is willing to wait for the requested operation to complete. The default value for
5717// this parameter is 60 seconds.
5718func (client BaseClient) GetClusterHealth(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, timeout *int64) (result ClusterHealth, err error) {
5719	if tracing.IsEnabled() {
5720		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealth")
5721		defer func() {
5722			sc := -1
5723			if result.Response.Response != nil {
5724				sc = result.Response.Response.StatusCode
5725			}
5726			tracing.EndSpan(ctx, sc, err)
5727		}()
5728	}
5729	if err := validation.Validate([]validation.Validation{
5730		{TargetValue: timeout,
5731			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5732				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5733					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5734				}}}}}); err != nil {
5735		return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealth", err.Error())
5736	}
5737
5738	req, err := client.GetClusterHealthPreparer(ctx, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, timeout)
5739	if err != nil {
5740		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", nil, "Failure preparing request")
5741		return
5742	}
5743
5744	resp, err := client.GetClusterHealthSender(req)
5745	if err != nil {
5746		result.Response = autorest.Response{Response: resp}
5747		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", resp, "Failure sending request")
5748		return
5749	}
5750
5751	result, err = client.GetClusterHealthResponder(resp)
5752	if err != nil {
5753		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", resp, "Failure responding to request")
5754	}
5755
5756	return
5757}
5758
5759// GetClusterHealthPreparer prepares the GetClusterHealth request.
5760func (client BaseClient) GetClusterHealthPreparer(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, timeout *int64) (*http.Request, error) {
5761	const APIVersion = "6.0"
5762	queryParameters := map[string]interface{}{
5763		"api-version": APIVersion,
5764	}
5765	if nodesHealthStateFilter != nil {
5766		queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", *nodesHealthStateFilter)
5767	} else {
5768		queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", 0)
5769	}
5770	if applicationsHealthStateFilter != nil {
5771		queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", *applicationsHealthStateFilter)
5772	} else {
5773		queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", 0)
5774	}
5775	if eventsHealthStateFilter != nil {
5776		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
5777	} else {
5778		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
5779	}
5780	if excludeHealthStatistics != nil {
5781		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
5782	} else {
5783		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
5784	}
5785	if includeSystemApplicationHealthStatistics != nil {
5786		queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", *includeSystemApplicationHealthStatistics)
5787	} else {
5788		queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", false)
5789	}
5790	if timeout != nil {
5791		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5792	} else {
5793		queryParameters["timeout"] = autorest.Encode("query", 60)
5794	}
5795
5796	preparer := autorest.CreatePreparer(
5797		autorest.AsGet(),
5798		autorest.WithBaseURL(client.BaseURI),
5799		autorest.WithPath("/$/GetClusterHealth"),
5800		autorest.WithQueryParameters(queryParameters))
5801	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5802}
5803
5804// GetClusterHealthSender sends the GetClusterHealth request. The method will close the
5805// http.Response Body if it receives an error.
5806func (client BaseClient) GetClusterHealthSender(req *http.Request) (*http.Response, error) {
5807	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5808}
5809
5810// GetClusterHealthResponder handles the response to the GetClusterHealth request. The method always
5811// closes the http.Response Body.
5812func (client BaseClient) GetClusterHealthResponder(resp *http.Response) (result ClusterHealth, err error) {
5813	err = autorest.Respond(
5814		resp,
5815		client.ByInspecting(),
5816		azure.WithErrorUnlessStatusCode(http.StatusOK),
5817		autorest.ByUnmarshallingJSON(&result),
5818		autorest.ByClosing())
5819	result.Response = autorest.Response{Response: resp}
5820	return
5821}
5822
5823// GetClusterHealthChunk gets the health of a Service Fabric cluster using health chunks. Includes the aggregated
5824// health state of the cluster, but none of the cluster entities.
5825// To expand the cluster health and get the health state of all or some of the entities, use the POST URI and specify
5826// the cluster health chunk query description.
5827// Parameters:
5828// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5829// duration that the client is willing to wait for the requested operation to complete. The default value for
5830// this parameter is 60 seconds.
5831func (client BaseClient) GetClusterHealthChunk(ctx context.Context, timeout *int64) (result ClusterHealthChunk, err error) {
5832	if tracing.IsEnabled() {
5833		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthChunk")
5834		defer func() {
5835			sc := -1
5836			if result.Response.Response != nil {
5837				sc = result.Response.Response.StatusCode
5838			}
5839			tracing.EndSpan(ctx, sc, err)
5840		}()
5841	}
5842	if err := validation.Validate([]validation.Validation{
5843		{TargetValue: timeout,
5844			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5845				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5846					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5847				}}}}}); err != nil {
5848		return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunk", err.Error())
5849	}
5850
5851	req, err := client.GetClusterHealthChunkPreparer(ctx, timeout)
5852	if err != nil {
5853		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", nil, "Failure preparing request")
5854		return
5855	}
5856
5857	resp, err := client.GetClusterHealthChunkSender(req)
5858	if err != nil {
5859		result.Response = autorest.Response{Response: resp}
5860		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", resp, "Failure sending request")
5861		return
5862	}
5863
5864	result, err = client.GetClusterHealthChunkResponder(resp)
5865	if err != nil {
5866		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", resp, "Failure responding to request")
5867	}
5868
5869	return
5870}
5871
5872// GetClusterHealthChunkPreparer prepares the GetClusterHealthChunk request.
5873func (client BaseClient) GetClusterHealthChunkPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
5874	const APIVersion = "6.0"
5875	queryParameters := map[string]interface{}{
5876		"api-version": APIVersion,
5877	}
5878	if timeout != nil {
5879		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5880	} else {
5881		queryParameters["timeout"] = autorest.Encode("query", 60)
5882	}
5883
5884	preparer := autorest.CreatePreparer(
5885		autorest.AsGet(),
5886		autorest.WithBaseURL(client.BaseURI),
5887		autorest.WithPath("/$/GetClusterHealthChunk"),
5888		autorest.WithQueryParameters(queryParameters))
5889	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5890}
5891
5892// GetClusterHealthChunkSender sends the GetClusterHealthChunk request. The method will close the
5893// http.Response Body if it receives an error.
5894func (client BaseClient) GetClusterHealthChunkSender(req *http.Request) (*http.Response, error) {
5895	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5896}
5897
5898// GetClusterHealthChunkResponder handles the response to the GetClusterHealthChunk request. The method always
5899// closes the http.Response Body.
5900func (client BaseClient) GetClusterHealthChunkResponder(resp *http.Response) (result ClusterHealthChunk, err error) {
5901	err = autorest.Respond(
5902		resp,
5903		client.ByInspecting(),
5904		azure.WithErrorUnlessStatusCode(http.StatusOK),
5905		autorest.ByUnmarshallingJSON(&result),
5906		autorest.ByClosing())
5907	result.Response = autorest.Response{Response: resp}
5908	return
5909}
5910
5911// GetClusterHealthChunkUsingPolicyAndAdvancedFilters gets the health of a Service Fabric cluster using health chunks.
5912// The health evaluation is done based on the input cluster health chunk query description.
5913// The query description allows users to specify health policies for evaluating the cluster and its children.
5914// Users can specify very flexible filters to select which cluster entities to return. The selection can be done based
5915// on the entities health state and based on the hierarchy.
5916// The query can return multi-level children of the entities based on the specified filters. For example, it can return
5917// one application with a specified name, and for this application, return
5918// only services that are in Error or Warning, and all partitions and replicas for one of these services.
5919// Parameters:
5920// clusterHealthChunkQueryDescription - describes the cluster and application health policies used to evaluate
5921// the cluster health and the filters to select which cluster entities to be returned.
5922// If the cluster health policy is present, it is used to evaluate the cluster events and the cluster nodes. If
5923// not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the
5924// default cluster health policy.
5925// By default, each application is evaluated using its specific application health policy, defined in the
5926// application manifest, or the default health policy, if no policy is defined in manifest.
5927// If the application health policy map is specified, and it has an entry for an application, the specified
5928// application health policy
5929// is used to evaluate the application health.
5930// Users can specify very flexible filters to select which cluster entities to include in response. The
5931// selection can be done based on the entities health state and based on the hierarchy.
5932// The query can return multi-level children of the entities based on the specified filters. For example, it
5933// can return one application with a specified name, and for this application, return
5934// only services that are in Error or Warning, and all partitions and replicas for one of these services.
5935// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
5936// duration that the client is willing to wait for the requested operation to complete. The default value for
5937// this parameter is 60 seconds.
5938func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFilters(ctx context.Context, clusterHealthChunkQueryDescription *ClusterHealthChunkQueryDescription, timeout *int64) (result ClusterHealthChunk, err error) {
5939	if tracing.IsEnabled() {
5940		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthChunkUsingPolicyAndAdvancedFilters")
5941		defer func() {
5942			sc := -1
5943			if result.Response.Response != nil {
5944				sc = result.Response.Response.StatusCode
5945			}
5946			tracing.EndSpan(ctx, sc, err)
5947		}()
5948	}
5949	if err := validation.Validate([]validation.Validation{
5950		{TargetValue: timeout,
5951			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
5952				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
5953					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
5954				}}}}}); err != nil {
5955		return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", err.Error())
5956	}
5957
5958	req, err := client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer(ctx, clusterHealthChunkQueryDescription, timeout)
5959	if err != nil {
5960		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", nil, "Failure preparing request")
5961		return
5962	}
5963
5964	resp, err := client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender(req)
5965	if err != nil {
5966		result.Response = autorest.Response{Response: resp}
5967		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", resp, "Failure sending request")
5968		return
5969	}
5970
5971	result, err = client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder(resp)
5972	if err != nil {
5973		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", resp, "Failure responding to request")
5974	}
5975
5976	return
5977}
5978
5979// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer prepares the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request.
5980func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer(ctx context.Context, clusterHealthChunkQueryDescription *ClusterHealthChunkQueryDescription, timeout *int64) (*http.Request, error) {
5981	const APIVersion = "6.0"
5982	queryParameters := map[string]interface{}{
5983		"api-version": APIVersion,
5984	}
5985	if timeout != nil {
5986		queryParameters["timeout"] = autorest.Encode("query", *timeout)
5987	} else {
5988		queryParameters["timeout"] = autorest.Encode("query", 60)
5989	}
5990
5991	preparer := autorest.CreatePreparer(
5992		autorest.AsContentType("application/json; charset=utf-8"),
5993		autorest.AsPost(),
5994		autorest.WithBaseURL(client.BaseURI),
5995		autorest.WithPath("/$/GetClusterHealthChunk"),
5996		autorest.WithQueryParameters(queryParameters))
5997	if clusterHealthChunkQueryDescription != nil {
5998		preparer = autorest.DecoratePreparer(preparer,
5999			autorest.WithJSON(clusterHealthChunkQueryDescription))
6000	}
6001	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6002}
6003
6004// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender sends the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. The method will close the
6005// http.Response Body if it receives an error.
6006func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender(req *http.Request) (*http.Response, error) {
6007	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6008}
6009
6010// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder handles the response to the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. The method always
6011// closes the http.Response Body.
6012func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder(resp *http.Response) (result ClusterHealthChunk, err error) {
6013	err = autorest.Respond(
6014		resp,
6015		client.ByInspecting(),
6016		azure.WithErrorUnlessStatusCode(http.StatusOK),
6017		autorest.ByUnmarshallingJSON(&result),
6018		autorest.ByClosing())
6019	result.Response = autorest.Response{Response: resp}
6020	return
6021}
6022
6023// GetClusterHealthUsingPolicy gets the health of a Service Fabric cluster.
6024// Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health
6025// state.
6026// Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and
6027// applications returned based on their aggregated health state.
6028// Use ClusterHealthPolicies to override the health policies used to evaluate the health.
6029// Parameters:
6030// nodesHealthStateFilter - allows filtering of the node health state objects returned in the result of cluster
6031// health query
6032// based on their health state. The possible values for this parameter include integer value of one of the
6033// following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the
6034// aggregated health state.
6035// If not specified, all entries are returned.
6036// The state values are flag based enumeration, so the value could be a combination of these values obtained
6037// using bitwise 'OR' operator.
6038// For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and
6039// Warning (4) are returned.
6040//
6041// - Default - Default value. Matches any HealthState. The value is zero.
6042// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
6043// collection of states. The value is 1.
6044// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
6045// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
6046// - Error - Filter that matches input with HealthState value Error. The value is 8.
6047// - All - Filter that matches input with any HealthState value. The value is 65535.
6048// applicationsHealthStateFilter - allows filtering of the application health state objects returned in the
6049// result of cluster health
6050// query based on their health state.
6051// The possible values for this parameter include integer value obtained from members or bitwise operations
6052// on members of HealthStateFilter enumeration. Only applications that match the filter are returned.
6053// All applications are used to evaluate the aggregated health state. If not specified, all entries are
6054// returned.
6055// The state values are flag based enumeration, so the value could be a combination of these values obtained
6056// using bitwise 'OR' operator.
6057// For example, if the provided value is 6 then health state of applications with HealthState value of OK (2)
6058// and Warning (4) are returned.
6059//
6060// - Default - Default value. Matches any HealthState. The value is zero.
6061// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
6062// collection of states. The value is 1.
6063// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
6064// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
6065// - Error - Filter that matches input with HealthState value Error. The value is 8.
6066// - All - Filter that matches input with any HealthState value. The value is 65535.
6067// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
6068// state.
6069// The possible values for this parameter include integer value of one of the following health states.
6070// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
6071// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
6072// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
6073// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
6074//
6075// - Default - Default value. Matches any HealthState. The value is zero.
6076// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
6077// collection of states. The value is 1.
6078// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
6079// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
6080// - Error - Filter that matches input with HealthState value Error. The value is 8.
6081// - All - Filter that matches input with any HealthState value. The value is 65535.
6082// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
6083// result. False by default.
6084// The statistics show the number of children entities in health state Ok, Warning, and Error.
6085// includeSystemApplicationHealthStatistics - indicates whether the health statistics should include the
6086// fabric:/System application health statistics. False by default.
6087// If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that
6088// belong to the fabric:/System application.
6089// Otherwise, the query result includes health statistics only for user applications.
6090// The health statistics must be included in the query result for this parameter to be applied.
6091// clusterHealthPolicies - describes the health policies used to evaluate the cluster health.
6092// If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the
6093// default cluster health policy.
6094// By default, each application is evaluated using its specific application health policy, defined in the
6095// application manifest, or the default health policy, if no policy is defined in manifest.
6096// If the application health policy map is specified, and it has an entry for an application, the specified
6097// application health policy
6098// is used to evaluate the application health.
6099// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6100// duration that the client is willing to wait for the requested operation to complete. The default value for
6101// this parameter is 60 seconds.
6102func (client BaseClient) GetClusterHealthUsingPolicy(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, clusterHealthPolicies *ClusterHealthPolicies, timeout *int64) (result ClusterHealth, err error) {
6103	if tracing.IsEnabled() {
6104		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthUsingPolicy")
6105		defer func() {
6106			sc := -1
6107			if result.Response.Response != nil {
6108				sc = result.Response.Response.StatusCode
6109			}
6110			tracing.EndSpan(ctx, sc, err)
6111		}()
6112	}
6113	if err := validation.Validate([]validation.Validation{
6114		{TargetValue: timeout,
6115			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6116				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6117					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6118				}}}}}); err != nil {
6119		return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthUsingPolicy", err.Error())
6120	}
6121
6122	req, err := client.GetClusterHealthUsingPolicyPreparer(ctx, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, clusterHealthPolicies, timeout)
6123	if err != nil {
6124		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", nil, "Failure preparing request")
6125		return
6126	}
6127
6128	resp, err := client.GetClusterHealthUsingPolicySender(req)
6129	if err != nil {
6130		result.Response = autorest.Response{Response: resp}
6131		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", resp, "Failure sending request")
6132		return
6133	}
6134
6135	result, err = client.GetClusterHealthUsingPolicyResponder(resp)
6136	if err != nil {
6137		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", resp, "Failure responding to request")
6138	}
6139
6140	return
6141}
6142
6143// GetClusterHealthUsingPolicyPreparer prepares the GetClusterHealthUsingPolicy request.
6144func (client BaseClient) GetClusterHealthUsingPolicyPreparer(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, clusterHealthPolicies *ClusterHealthPolicies, 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.AsContentType("application/json; charset=utf-8"),
6182		autorest.AsPost(),
6183		autorest.WithBaseURL(client.BaseURI),
6184		autorest.WithPath("/$/GetClusterHealth"),
6185		autorest.WithQueryParameters(queryParameters))
6186	if clusterHealthPolicies != nil {
6187		preparer = autorest.DecoratePreparer(preparer,
6188			autorest.WithJSON(clusterHealthPolicies))
6189	}
6190	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6191}
6192
6193// GetClusterHealthUsingPolicySender sends the GetClusterHealthUsingPolicy request. The method will close the
6194// http.Response Body if it receives an error.
6195func (client BaseClient) GetClusterHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
6196	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6197}
6198
6199// GetClusterHealthUsingPolicyResponder handles the response to the GetClusterHealthUsingPolicy request. The method always
6200// closes the http.Response Body.
6201func (client BaseClient) GetClusterHealthUsingPolicyResponder(resp *http.Response) (result ClusterHealth, err error) {
6202	err = autorest.Respond(
6203		resp,
6204		client.ByInspecting(),
6205		azure.WithErrorUnlessStatusCode(http.StatusOK),
6206		autorest.ByUnmarshallingJSON(&result),
6207		autorest.ByClosing())
6208	result.Response = autorest.Response{Response: resp}
6209	return
6210}
6211
6212// GetClusterManifest get the Service Fabric cluster manifest. The cluster manifest contains properties of the cluster
6213// that include different node types on the cluster,
6214// security configurations, fault and upgrade domain topologies, etc.
6215//
6216// These properties are specified as part of the ClusterConfig.JSON file while deploying a stand alone cluster.
6217// However, most of the information in the cluster manifest
6218// is generated internally by service fabric during cluster deployment in other deployment scenarios (e.g. when using
6219// azure portal).
6220//
6221// The contents of the cluster manifest are for informational purposes only and users are not expected to take a
6222// dependency on the format of the file contents or its interpretation.
6223// Parameters:
6224// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6225// duration that the client is willing to wait for the requested operation to complete. The default value for
6226// this parameter is 60 seconds.
6227func (client BaseClient) GetClusterManifest(ctx context.Context, timeout *int64) (result ClusterManifest, err error) {
6228	if tracing.IsEnabled() {
6229		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterManifest")
6230		defer func() {
6231			sc := -1
6232			if result.Response.Response != nil {
6233				sc = result.Response.Response.StatusCode
6234			}
6235			tracing.EndSpan(ctx, sc, err)
6236		}()
6237	}
6238	if err := validation.Validate([]validation.Validation{
6239		{TargetValue: timeout,
6240			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6241				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6242					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6243				}}}}}); err != nil {
6244		return result, validation.NewError("servicefabric.BaseClient", "GetClusterManifest", err.Error())
6245	}
6246
6247	req, err := client.GetClusterManifestPreparer(ctx, timeout)
6248	if err != nil {
6249		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", nil, "Failure preparing request")
6250		return
6251	}
6252
6253	resp, err := client.GetClusterManifestSender(req)
6254	if err != nil {
6255		result.Response = autorest.Response{Response: resp}
6256		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", resp, "Failure sending request")
6257		return
6258	}
6259
6260	result, err = client.GetClusterManifestResponder(resp)
6261	if err != nil {
6262		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", resp, "Failure responding to request")
6263	}
6264
6265	return
6266}
6267
6268// GetClusterManifestPreparer prepares the GetClusterManifest request.
6269func (client BaseClient) GetClusterManifestPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
6270	const APIVersion = "6.0"
6271	queryParameters := map[string]interface{}{
6272		"api-version": APIVersion,
6273	}
6274	if timeout != nil {
6275		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6276	} else {
6277		queryParameters["timeout"] = autorest.Encode("query", 60)
6278	}
6279
6280	preparer := autorest.CreatePreparer(
6281		autorest.AsGet(),
6282		autorest.WithBaseURL(client.BaseURI),
6283		autorest.WithPath("/$/GetClusterManifest"),
6284		autorest.WithQueryParameters(queryParameters))
6285	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6286}
6287
6288// GetClusterManifestSender sends the GetClusterManifest request. The method will close the
6289// http.Response Body if it receives an error.
6290func (client BaseClient) GetClusterManifestSender(req *http.Request) (*http.Response, error) {
6291	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6292}
6293
6294// GetClusterManifestResponder handles the response to the GetClusterManifest request. The method always
6295// closes the http.Response Body.
6296func (client BaseClient) GetClusterManifestResponder(resp *http.Response) (result ClusterManifest, err error) {
6297	err = autorest.Respond(
6298		resp,
6299		client.ByInspecting(),
6300		azure.WithErrorUnlessStatusCode(http.StatusOK),
6301		autorest.ByUnmarshallingJSON(&result),
6302		autorest.ByClosing())
6303	result.Response = autorest.Response{Response: resp}
6304	return
6305}
6306
6307// GetClusterUpgradeProgress gets the current progress of the ongoing cluster upgrade. If no upgrade is currently in
6308// progress, gets the last state of the previous cluster upgrade.
6309// Parameters:
6310// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6311// duration that the client is willing to wait for the requested operation to complete. The default value for
6312// this parameter is 60 seconds.
6313func (client BaseClient) GetClusterUpgradeProgress(ctx context.Context, timeout *int64) (result ClusterUpgradeProgressObject, err error) {
6314	if tracing.IsEnabled() {
6315		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterUpgradeProgress")
6316		defer func() {
6317			sc := -1
6318			if result.Response.Response != nil {
6319				sc = result.Response.Response.StatusCode
6320			}
6321			tracing.EndSpan(ctx, sc, err)
6322		}()
6323	}
6324	if err := validation.Validate([]validation.Validation{
6325		{TargetValue: timeout,
6326			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6327				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6328					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6329				}}}}}); err != nil {
6330		return result, validation.NewError("servicefabric.BaseClient", "GetClusterUpgradeProgress", err.Error())
6331	}
6332
6333	req, err := client.GetClusterUpgradeProgressPreparer(ctx, timeout)
6334	if err != nil {
6335		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", nil, "Failure preparing request")
6336		return
6337	}
6338
6339	resp, err := client.GetClusterUpgradeProgressSender(req)
6340	if err != nil {
6341		result.Response = autorest.Response{Response: resp}
6342		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", resp, "Failure sending request")
6343		return
6344	}
6345
6346	result, err = client.GetClusterUpgradeProgressResponder(resp)
6347	if err != nil {
6348		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", resp, "Failure responding to request")
6349	}
6350
6351	return
6352}
6353
6354// GetClusterUpgradeProgressPreparer prepares the GetClusterUpgradeProgress request.
6355func (client BaseClient) GetClusterUpgradeProgressPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
6356	const APIVersion = "6.0"
6357	queryParameters := map[string]interface{}{
6358		"api-version": APIVersion,
6359	}
6360	if timeout != nil {
6361		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6362	} else {
6363		queryParameters["timeout"] = autorest.Encode("query", 60)
6364	}
6365
6366	preparer := autorest.CreatePreparer(
6367		autorest.AsGet(),
6368		autorest.WithBaseURL(client.BaseURI),
6369		autorest.WithPath("/$/GetUpgradeProgress"),
6370		autorest.WithQueryParameters(queryParameters))
6371	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6372}
6373
6374// GetClusterUpgradeProgressSender sends the GetClusterUpgradeProgress request. The method will close the
6375// http.Response Body if it receives an error.
6376func (client BaseClient) GetClusterUpgradeProgressSender(req *http.Request) (*http.Response, error) {
6377	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6378}
6379
6380// GetClusterUpgradeProgressResponder handles the response to the GetClusterUpgradeProgress request. The method always
6381// closes the http.Response Body.
6382func (client BaseClient) GetClusterUpgradeProgressResponder(resp *http.Response) (result ClusterUpgradeProgressObject, err error) {
6383	err = autorest.Respond(
6384		resp,
6385		client.ByInspecting(),
6386		azure.WithErrorUnlessStatusCode(http.StatusOK),
6387		autorest.ByUnmarshallingJSON(&result),
6388		autorest.ByClosing())
6389	result.Response = autorest.Response{Response: resp}
6390	return
6391}
6392
6393// GetComposeDeploymentStatus returns the status of the compose deployment that was created or in the process of being
6394// created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response
6395// includes the name, status and other details about the deployment.
6396// Parameters:
6397// deploymentName - the identity of the deployment.
6398// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6399// duration that the client is willing to wait for the requested operation to complete. The default value for
6400// this parameter is 60 seconds.
6401func (client BaseClient) GetComposeDeploymentStatus(ctx context.Context, deploymentName string, timeout *int64) (result ComposeDeploymentStatusInfo, err error) {
6402	if tracing.IsEnabled() {
6403		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentStatus")
6404		defer func() {
6405			sc := -1
6406			if result.Response.Response != nil {
6407				sc = result.Response.Response.StatusCode
6408			}
6409			tracing.EndSpan(ctx, sc, err)
6410		}()
6411	}
6412	if err := validation.Validate([]validation.Validation{
6413		{TargetValue: timeout,
6414			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6415				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6416					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6417				}}}}}); err != nil {
6418		return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatus", err.Error())
6419	}
6420
6421	req, err := client.GetComposeDeploymentStatusPreparer(ctx, deploymentName, timeout)
6422	if err != nil {
6423		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", nil, "Failure preparing request")
6424		return
6425	}
6426
6427	resp, err := client.GetComposeDeploymentStatusSender(req)
6428	if err != nil {
6429		result.Response = autorest.Response{Response: resp}
6430		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", resp, "Failure sending request")
6431		return
6432	}
6433
6434	result, err = client.GetComposeDeploymentStatusResponder(resp)
6435	if err != nil {
6436		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", resp, "Failure responding to request")
6437	}
6438
6439	return
6440}
6441
6442// GetComposeDeploymentStatusPreparer prepares the GetComposeDeploymentStatus request.
6443func (client BaseClient) GetComposeDeploymentStatusPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) {
6444	pathParameters := map[string]interface{}{
6445		"deploymentName": deploymentName,
6446	}
6447
6448	const APIVersion = "6.0-preview"
6449	queryParameters := map[string]interface{}{
6450		"api-version": APIVersion,
6451	}
6452	if timeout != nil {
6453		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6454	} else {
6455		queryParameters["timeout"] = autorest.Encode("query", 60)
6456	}
6457
6458	preparer := autorest.CreatePreparer(
6459		autorest.AsGet(),
6460		autorest.WithBaseURL(client.BaseURI),
6461		autorest.WithPathParameters("/ComposeDeployments/{deploymentName}", pathParameters),
6462		autorest.WithQueryParameters(queryParameters))
6463	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6464}
6465
6466// GetComposeDeploymentStatusSender sends the GetComposeDeploymentStatus request. The method will close the
6467// http.Response Body if it receives an error.
6468func (client BaseClient) GetComposeDeploymentStatusSender(req *http.Request) (*http.Response, error) {
6469	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6470}
6471
6472// GetComposeDeploymentStatusResponder handles the response to the GetComposeDeploymentStatus request. The method always
6473// closes the http.Response Body.
6474func (client BaseClient) GetComposeDeploymentStatusResponder(resp *http.Response) (result ComposeDeploymentStatusInfo, err error) {
6475	err = autorest.Respond(
6476		resp,
6477		client.ByInspecting(),
6478		azure.WithErrorUnlessStatusCode(http.StatusOK),
6479		autorest.ByUnmarshallingJSON(&result),
6480		autorest.ByClosing())
6481	result.Response = autorest.Response{Response: resp}
6482	return
6483}
6484
6485// GetComposeDeploymentStatusList gets the status about the compose deployments that were created or in the process of
6486// being created in the Service Fabric cluster. The response includes the name, status and other details about the
6487// compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a
6488// continuation token which can be used to get the next page.
6489// Parameters:
6490// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
6491// token with a non empty value is included in the response of the API when the results from the system do not
6492// fit in a single response. When this value is passed to the next API call, the API returns next set of
6493// results. If there are no further results then the continuation token does not contain a value. The value of
6494// this parameter should not be URL encoded.
6495// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
6496// defines the upper bound on the number of results returned. The results returned can be less than the
6497// specified maximum results if they do not fit in the message as per the max message size restrictions defined
6498// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
6499// as possible that fit in the return message.
6500// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6501// duration that the client is willing to wait for the requested operation to complete. The default value for
6502// this parameter is 60 seconds.
6503func (client BaseClient) GetComposeDeploymentStatusList(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (result PagedComposeDeploymentStatusInfoList, err error) {
6504	if tracing.IsEnabled() {
6505		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentStatusList")
6506		defer func() {
6507			sc := -1
6508			if result.Response.Response != nil {
6509				sc = result.Response.Response.StatusCode
6510			}
6511			tracing.EndSpan(ctx, sc, err)
6512		}()
6513	}
6514	if err := validation.Validate([]validation.Validation{
6515		{TargetValue: maxResults,
6516			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
6517				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
6518		{TargetValue: timeout,
6519			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6520				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6521					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6522				}}}}}); err != nil {
6523		return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatusList", err.Error())
6524	}
6525
6526	req, err := client.GetComposeDeploymentStatusListPreparer(ctx, continuationToken, maxResults, timeout)
6527	if err != nil {
6528		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", nil, "Failure preparing request")
6529		return
6530	}
6531
6532	resp, err := client.GetComposeDeploymentStatusListSender(req)
6533	if err != nil {
6534		result.Response = autorest.Response{Response: resp}
6535		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", resp, "Failure sending request")
6536		return
6537	}
6538
6539	result, err = client.GetComposeDeploymentStatusListResponder(resp)
6540	if err != nil {
6541		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", resp, "Failure responding to request")
6542	}
6543
6544	return
6545}
6546
6547// GetComposeDeploymentStatusListPreparer prepares the GetComposeDeploymentStatusList request.
6548func (client BaseClient) GetComposeDeploymentStatusListPreparer(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
6549	const APIVersion = "6.0-preview"
6550	queryParameters := map[string]interface{}{
6551		"api-version": APIVersion,
6552	}
6553	if len(continuationToken) > 0 {
6554		queryParameters["ContinuationToken"] = continuationToken
6555	}
6556	if maxResults != nil {
6557		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
6558	} else {
6559		queryParameters["MaxResults"] = autorest.Encode("query", 0)
6560	}
6561	if timeout != nil {
6562		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6563	} else {
6564		queryParameters["timeout"] = autorest.Encode("query", 60)
6565	}
6566
6567	preparer := autorest.CreatePreparer(
6568		autorest.AsGet(),
6569		autorest.WithBaseURL(client.BaseURI),
6570		autorest.WithPath("/ComposeDeployments"),
6571		autorest.WithQueryParameters(queryParameters))
6572	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6573}
6574
6575// GetComposeDeploymentStatusListSender sends the GetComposeDeploymentStatusList request. The method will close the
6576// http.Response Body if it receives an error.
6577func (client BaseClient) GetComposeDeploymentStatusListSender(req *http.Request) (*http.Response, error) {
6578	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6579}
6580
6581// GetComposeDeploymentStatusListResponder handles the response to the GetComposeDeploymentStatusList request. The method always
6582// closes the http.Response Body.
6583func (client BaseClient) GetComposeDeploymentStatusListResponder(resp *http.Response) (result PagedComposeDeploymentStatusInfoList, err error) {
6584	err = autorest.Respond(
6585		resp,
6586		client.ByInspecting(),
6587		azure.WithErrorUnlessStatusCode(http.StatusOK),
6588		autorest.ByUnmarshallingJSON(&result),
6589		autorest.ByClosing())
6590	result.Response = autorest.Response{Response: resp}
6591	return
6592}
6593
6594// GetComposeDeploymentUpgradeProgress returns the information about the state of the compose deployment upgrade along
6595// with details to aid debugging application health issues.
6596// Parameters:
6597// deploymentName - the identity of the deployment.
6598// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6599// duration that the client is willing to wait for the requested operation to complete. The default value for
6600// this parameter is 60 seconds.
6601func (client BaseClient) GetComposeDeploymentUpgradeProgress(ctx context.Context, deploymentName string, timeout *int64) (result ComposeDeploymentUpgradeProgressInfo, err error) {
6602	if tracing.IsEnabled() {
6603		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentUpgradeProgress")
6604		defer func() {
6605			sc := -1
6606			if result.Response.Response != nil {
6607				sc = result.Response.Response.StatusCode
6608			}
6609			tracing.EndSpan(ctx, sc, err)
6610		}()
6611	}
6612	if err := validation.Validate([]validation.Validation{
6613		{TargetValue: timeout,
6614			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6615				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6616					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6617				}}}}}); err != nil {
6618		return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", err.Error())
6619	}
6620
6621	req, err := client.GetComposeDeploymentUpgradeProgressPreparer(ctx, deploymentName, timeout)
6622	if err != nil {
6623		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", nil, "Failure preparing request")
6624		return
6625	}
6626
6627	resp, err := client.GetComposeDeploymentUpgradeProgressSender(req)
6628	if err != nil {
6629		result.Response = autorest.Response{Response: resp}
6630		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", resp, "Failure sending request")
6631		return
6632	}
6633
6634	result, err = client.GetComposeDeploymentUpgradeProgressResponder(resp)
6635	if err != nil {
6636		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", resp, "Failure responding to request")
6637	}
6638
6639	return
6640}
6641
6642// GetComposeDeploymentUpgradeProgressPreparer prepares the GetComposeDeploymentUpgradeProgress request.
6643func (client BaseClient) GetComposeDeploymentUpgradeProgressPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) {
6644	pathParameters := map[string]interface{}{
6645		"deploymentName": deploymentName,
6646	}
6647
6648	const APIVersion = "6.0-preview"
6649	queryParameters := map[string]interface{}{
6650		"api-version": APIVersion,
6651	}
6652	if timeout != nil {
6653		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6654	} else {
6655		queryParameters["timeout"] = autorest.Encode("query", 60)
6656	}
6657
6658	preparer := autorest.CreatePreparer(
6659		autorest.AsGet(),
6660		autorest.WithBaseURL(client.BaseURI),
6661		autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/GetUpgradeProgress", pathParameters),
6662		autorest.WithQueryParameters(queryParameters))
6663	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6664}
6665
6666// GetComposeDeploymentUpgradeProgressSender sends the GetComposeDeploymentUpgradeProgress request. The method will close the
6667// http.Response Body if it receives an error.
6668func (client BaseClient) GetComposeDeploymentUpgradeProgressSender(req *http.Request) (*http.Response, error) {
6669	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6670}
6671
6672// GetComposeDeploymentUpgradeProgressResponder handles the response to the GetComposeDeploymentUpgradeProgress request. The method always
6673// closes the http.Response Body.
6674func (client BaseClient) GetComposeDeploymentUpgradeProgressResponder(resp *http.Response) (result ComposeDeploymentUpgradeProgressInfo, err error) {
6675	err = autorest.Respond(
6676		resp,
6677		client.ByInspecting(),
6678		azure.WithErrorUnlessStatusCode(http.StatusOK),
6679		autorest.ByUnmarshallingJSON(&result),
6680		autorest.ByClosing())
6681	result.Response = autorest.Response{Response: resp}
6682	return
6683}
6684
6685// GetContainerLogsDeployedOnNode gets the container logs for container deployed on a Service Fabric node for the given
6686// code package.
6687// Parameters:
6688// nodeName - the name of the node.
6689// applicationID - the identity of the application. This is typically the full name of the application without
6690// the 'fabric:' URI scheme.
6691// Starting from version 6.0, hierarchical names are delimited with the "~" character.
6692// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
6693// in 6.0+ and "myapp/app1" in previous versions.
6694// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
6695// Fabric cluster.
6696// codePackageName - the name of code package specified in service manifest registered as part of an
6697// application type in a Service Fabric cluster.
6698// tail - number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs.
6699// previous - specifies whether to get container logs from exited/dead containers of the code package instance.
6700// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6701// duration that the client is willing to wait for the requested operation to complete. The default value for
6702// this parameter is 60 seconds.
6703func (client BaseClient) GetContainerLogsDeployedOnNode(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, tail string, previous *bool, timeout *int64) (result ContainerLogs, err error) {
6704	if tracing.IsEnabled() {
6705		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetContainerLogsDeployedOnNode")
6706		defer func() {
6707			sc := -1
6708			if result.Response.Response != nil {
6709				sc = result.Response.Response.StatusCode
6710			}
6711			tracing.EndSpan(ctx, sc, err)
6712		}()
6713	}
6714	if err := validation.Validate([]validation.Validation{
6715		{TargetValue: timeout,
6716			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6717				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6718					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6719				}}}}}); err != nil {
6720		return result, validation.NewError("servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", err.Error())
6721	}
6722
6723	req, err := client.GetContainerLogsDeployedOnNodePreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, tail, previous, timeout)
6724	if err != nil {
6725		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", nil, "Failure preparing request")
6726		return
6727	}
6728
6729	resp, err := client.GetContainerLogsDeployedOnNodeSender(req)
6730	if err != nil {
6731		result.Response = autorest.Response{Response: resp}
6732		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", resp, "Failure sending request")
6733		return
6734	}
6735
6736	result, err = client.GetContainerLogsDeployedOnNodeResponder(resp)
6737	if err != nil {
6738		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", resp, "Failure responding to request")
6739	}
6740
6741	return
6742}
6743
6744// GetContainerLogsDeployedOnNodePreparer prepares the GetContainerLogsDeployedOnNode request.
6745func (client BaseClient) GetContainerLogsDeployedOnNodePreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, tail string, previous *bool, timeout *int64) (*http.Request, error) {
6746	pathParameters := map[string]interface{}{
6747		"applicationId": applicationID,
6748		"nodeName":      autorest.Encode("path", nodeName),
6749	}
6750
6751	const APIVersion = "6.2"
6752	queryParameters := map[string]interface{}{
6753		"api-version":         APIVersion,
6754		"CodePackageName":     autorest.Encode("query", codePackageName),
6755		"ServiceManifestName": autorest.Encode("query", serviceManifestName),
6756	}
6757	if len(tail) > 0 {
6758		queryParameters["Tail"] = autorest.Encode("query", tail)
6759	}
6760	if previous != nil {
6761		queryParameters["Previous"] = autorest.Encode("query", *previous)
6762	} else {
6763		queryParameters["Previous"] = autorest.Encode("query", false)
6764	}
6765	if timeout != nil {
6766		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6767	} else {
6768		queryParameters["timeout"] = autorest.Encode("query", 60)
6769	}
6770
6771	preparer := autorest.CreatePreparer(
6772		autorest.AsGet(),
6773		autorest.WithBaseURL(client.BaseURI),
6774		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerLogs", pathParameters),
6775		autorest.WithQueryParameters(queryParameters))
6776	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6777}
6778
6779// GetContainerLogsDeployedOnNodeSender sends the GetContainerLogsDeployedOnNode request. The method will close the
6780// http.Response Body if it receives an error.
6781func (client BaseClient) GetContainerLogsDeployedOnNodeSender(req *http.Request) (*http.Response, error) {
6782	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6783}
6784
6785// GetContainerLogsDeployedOnNodeResponder handles the response to the GetContainerLogsDeployedOnNode request. The method always
6786// closes the http.Response Body.
6787func (client BaseClient) GetContainerLogsDeployedOnNodeResponder(resp *http.Response) (result ContainerLogs, err error) {
6788	err = autorest.Respond(
6789		resp,
6790		client.ByInspecting(),
6791		azure.WithErrorUnlessStatusCode(http.StatusOK),
6792		autorest.ByUnmarshallingJSON(&result),
6793		autorest.ByClosing())
6794	result.Response = autorest.Response{Response: resp}
6795	return
6796}
6797
6798// GetContainersEventList the response is list of ContainerInstanceEvent objects.
6799// Parameters:
6800// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
6801// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
6802// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6803// duration that the client is willing to wait for the requested operation to complete. The default value for
6804// this parameter is 60 seconds.
6805// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
6806// be included in the response.
6807// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
6808// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
6809// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
6810// populated.
6811func (client BaseClient) GetContainersEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListContainerInstanceEvent, err error) {
6812	if tracing.IsEnabled() {
6813		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetContainersEventList")
6814		defer func() {
6815			sc := -1
6816			if result.Response.Response != nil {
6817				sc = result.Response.Response.StatusCode
6818			}
6819			tracing.EndSpan(ctx, sc, err)
6820		}()
6821	}
6822	if err := validation.Validate([]validation.Validation{
6823		{TargetValue: timeout,
6824			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6825				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6826					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6827				}}}}}); err != nil {
6828		return result, validation.NewError("servicefabric.BaseClient", "GetContainersEventList", err.Error())
6829	}
6830
6831	req, err := client.GetContainersEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
6832	if err != nil {
6833		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", nil, "Failure preparing request")
6834		return
6835	}
6836
6837	resp, err := client.GetContainersEventListSender(req)
6838	if err != nil {
6839		result.Response = autorest.Response{Response: resp}
6840		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", resp, "Failure sending request")
6841		return
6842	}
6843
6844	result, err = client.GetContainersEventListResponder(resp)
6845	if err != nil {
6846		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", resp, "Failure responding to request")
6847	}
6848
6849	return
6850}
6851
6852// GetContainersEventListPreparer prepares the GetContainersEventList request.
6853func (client BaseClient) GetContainersEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
6854	const APIVersion = "6.2-preview"
6855	queryParameters := map[string]interface{}{
6856		"api-version":  APIVersion,
6857		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
6858		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
6859	}
6860	if timeout != nil {
6861		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6862	} else {
6863		queryParameters["timeout"] = autorest.Encode("query", 60)
6864	}
6865	if len(eventsTypesFilter) > 0 {
6866		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
6867	}
6868	if excludeAnalysisEvents != nil {
6869		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
6870	}
6871	if skipCorrelationLookup != nil {
6872		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
6873	}
6874
6875	preparer := autorest.CreatePreparer(
6876		autorest.AsGet(),
6877		autorest.WithBaseURL(client.BaseURI),
6878		autorest.WithPath("/EventsStore/Containers/Events"),
6879		autorest.WithQueryParameters(queryParameters))
6880	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6881}
6882
6883// GetContainersEventListSender sends the GetContainersEventList request. The method will close the
6884// http.Response Body if it receives an error.
6885func (client BaseClient) GetContainersEventListSender(req *http.Request) (*http.Response, error) {
6886	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6887}
6888
6889// GetContainersEventListResponder handles the response to the GetContainersEventList request. The method always
6890// closes the http.Response Body.
6891func (client BaseClient) GetContainersEventListResponder(resp *http.Response) (result ListContainerInstanceEvent, err error) {
6892	err = autorest.Respond(
6893		resp,
6894		client.ByInspecting(),
6895		azure.WithErrorUnlessStatusCode(http.StatusOK),
6896		autorest.ByUnmarshallingJSON(&result.Value),
6897		autorest.ByClosing())
6898	result.Response = autorest.Response{Response: resp}
6899	return
6900}
6901
6902// GetCorrelatedEventList the response is list of FabricEvents.
6903// Parameters:
6904// eventInstanceID - the EventInstanceId.
6905// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
6906// duration that the client is willing to wait for the requested operation to complete. The default value for
6907// this parameter is 60 seconds.
6908func (client BaseClient) GetCorrelatedEventList(ctx context.Context, eventInstanceID string, timeout *int64) (result ListFabricEvent, err error) {
6909	if tracing.IsEnabled() {
6910		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCorrelatedEventList")
6911		defer func() {
6912			sc := -1
6913			if result.Response.Response != nil {
6914				sc = result.Response.Response.StatusCode
6915			}
6916			tracing.EndSpan(ctx, sc, err)
6917		}()
6918	}
6919	if err := validation.Validate([]validation.Validation{
6920		{TargetValue: timeout,
6921			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
6922				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
6923					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
6924				}}}}}); err != nil {
6925		return result, validation.NewError("servicefabric.BaseClient", "GetCorrelatedEventList", err.Error())
6926	}
6927
6928	req, err := client.GetCorrelatedEventListPreparer(ctx, eventInstanceID, timeout)
6929	if err != nil {
6930		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", nil, "Failure preparing request")
6931		return
6932	}
6933
6934	resp, err := client.GetCorrelatedEventListSender(req)
6935	if err != nil {
6936		result.Response = autorest.Response{Response: resp}
6937		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", resp, "Failure sending request")
6938		return
6939	}
6940
6941	result, err = client.GetCorrelatedEventListResponder(resp)
6942	if err != nil {
6943		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", resp, "Failure responding to request")
6944	}
6945
6946	return
6947}
6948
6949// GetCorrelatedEventListPreparer prepares the GetCorrelatedEventList request.
6950func (client BaseClient) GetCorrelatedEventListPreparer(ctx context.Context, eventInstanceID string, timeout *int64) (*http.Request, error) {
6951	pathParameters := map[string]interface{}{
6952		"eventInstanceId": autorest.Encode("path", eventInstanceID),
6953	}
6954
6955	const APIVersion = "6.2-preview"
6956	queryParameters := map[string]interface{}{
6957		"api-version": APIVersion,
6958	}
6959	if timeout != nil {
6960		queryParameters["timeout"] = autorest.Encode("query", *timeout)
6961	} else {
6962		queryParameters["timeout"] = autorest.Encode("query", 60)
6963	}
6964
6965	preparer := autorest.CreatePreparer(
6966		autorest.AsGet(),
6967		autorest.WithBaseURL(client.BaseURI),
6968		autorest.WithPathParameters("/EventsStore/CorrelatedEvents/{eventInstanceId}/$/Events", pathParameters),
6969		autorest.WithQueryParameters(queryParameters))
6970	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6971}
6972
6973// GetCorrelatedEventListSender sends the GetCorrelatedEventList request. The method will close the
6974// http.Response Body if it receives an error.
6975func (client BaseClient) GetCorrelatedEventListSender(req *http.Request) (*http.Response, error) {
6976	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6977}
6978
6979// GetCorrelatedEventListResponder handles the response to the GetCorrelatedEventList request. The method always
6980// closes the http.Response Body.
6981func (client BaseClient) GetCorrelatedEventListResponder(resp *http.Response) (result ListFabricEvent, err error) {
6982	err = autorest.Respond(
6983		resp,
6984		client.ByInspecting(),
6985		azure.WithErrorUnlessStatusCode(http.StatusOK),
6986		autorest.ByUnmarshallingJSON(&result),
6987		autorest.ByClosing())
6988	result.Response = autorest.Response{Response: resp}
6989	return
6990}
6991
6992// GetDataLossProgress gets the progress of a data loss operation started with StartDataLoss, using the OperationId.
6993// Parameters:
6994// serviceID - the identity of the service. This is typically the full name of the service without the
6995// 'fabric:' URI scheme.
6996// Starting from version 6.0, hierarchical names are delimited with the "~" character.
6997// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
6998// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
6999// partitionID - the identity of the partition.
7000// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
7001// API
7002// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7003// duration that the client is willing to wait for the requested operation to complete. The default value for
7004// this parameter is 60 seconds.
7005func (client BaseClient) GetDataLossProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionDataLossProgress, err error) {
7006	if tracing.IsEnabled() {
7007		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDataLossProgress")
7008		defer func() {
7009			sc := -1
7010			if result.Response.Response != nil {
7011				sc = result.Response.Response.StatusCode
7012			}
7013			tracing.EndSpan(ctx, sc, err)
7014		}()
7015	}
7016	if err := validation.Validate([]validation.Validation{
7017		{TargetValue: timeout,
7018			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7019				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7020					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7021				}}}}}); err != nil {
7022		return result, validation.NewError("servicefabric.BaseClient", "GetDataLossProgress", err.Error())
7023	}
7024
7025	req, err := client.GetDataLossProgressPreparer(ctx, serviceID, partitionID, operationID, timeout)
7026	if err != nil {
7027		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", nil, "Failure preparing request")
7028		return
7029	}
7030
7031	resp, err := client.GetDataLossProgressSender(req)
7032	if err != nil {
7033		result.Response = autorest.Response{Response: resp}
7034		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", resp, "Failure sending request")
7035		return
7036	}
7037
7038	result, err = client.GetDataLossProgressResponder(resp)
7039	if err != nil {
7040		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", resp, "Failure responding to request")
7041	}
7042
7043	return
7044}
7045
7046// GetDataLossProgressPreparer prepares the GetDataLossProgress request.
7047func (client BaseClient) GetDataLossProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) {
7048	pathParameters := map[string]interface{}{
7049		"partitionId": partitionID,
7050		"serviceId":   serviceID,
7051	}
7052
7053	const APIVersion = "6.0"
7054	queryParameters := map[string]interface{}{
7055		"api-version": APIVersion,
7056		"OperationId": autorest.Encode("query", operationID),
7057	}
7058	if timeout != nil {
7059		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7060	} else {
7061		queryParameters["timeout"] = autorest.Encode("query", 60)
7062	}
7063
7064	preparer := autorest.CreatePreparer(
7065		autorest.AsGet(),
7066		autorest.WithBaseURL(client.BaseURI),
7067		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetDataLossProgress", pathParameters),
7068		autorest.WithQueryParameters(queryParameters))
7069	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7070}
7071
7072// GetDataLossProgressSender sends the GetDataLossProgress request. The method will close the
7073// http.Response Body if it receives an error.
7074func (client BaseClient) GetDataLossProgressSender(req *http.Request) (*http.Response, error) {
7075	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7076}
7077
7078// GetDataLossProgressResponder handles the response to the GetDataLossProgress request. The method always
7079// closes the http.Response Body.
7080func (client BaseClient) GetDataLossProgressResponder(resp *http.Response) (result PartitionDataLossProgress, err error) {
7081	err = autorest.Respond(
7082		resp,
7083		client.ByInspecting(),
7084		azure.WithErrorUnlessStatusCode(http.StatusOK),
7085		autorest.ByUnmarshallingJSON(&result),
7086		autorest.ByClosing())
7087	result.Response = autorest.Response{Response: resp}
7088	return
7089}
7090
7091// GetDeployedApplicationHealth gets the information about health of an application deployed on a Service Fabric node.
7092// Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed
7093// application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for
7094// DeployedServicePackageHealth children based on health state.
7095// Parameters:
7096// nodeName - the name of the node.
7097// applicationID - the identity of the application. This is typically the full name of the application without
7098// the 'fabric:' URI scheme.
7099// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7100// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7101// in 6.0+ and "myapp/app1" in previous versions.
7102// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
7103// state.
7104// The possible values for this parameter include integer value of one of the following health states.
7105// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
7106// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
7107// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
7108// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
7109//
7110// - Default - Default value. Matches any HealthState. The value is zero.
7111// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7112// collection of states. The value is 1.
7113// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7114// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7115// - Error - Filter that matches input with HealthState value Error. The value is 8.
7116// - All - Filter that matches input with any HealthState value. The value is 65535.
7117// deployedServicePackagesHealthStateFilter - allows filtering of the deployed service package health state
7118// objects returned in the result of deployed application health query based on their health state.
7119// The possible values for this parameter include integer value of one of the following health states.
7120// Only deployed service packages that match the filter are returned. All deployed service packages are used to
7121// evaluate the aggregated health state of the deployed application.
7122// If not specified, all entries are returned.
7123// The state values are flag based enumeration, so the value can be a combination of these value obtained using
7124// bitwise 'OR' operator.
7125// For example, if the provided value is 6 then health state of service packages with HealthState value of OK
7126// (2) and Warning (4) are returned.
7127//
7128// - Default - Default value. Matches any HealthState. The value is zero.
7129// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7130// collection of states. The value is 1.
7131// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7132// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7133// - Error - Filter that matches input with HealthState value Error. The value is 8.
7134// - All - Filter that matches input with any HealthState value. The value is 65535.
7135// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
7136// result. False by default.
7137// The statistics show the number of children entities in health state Ok, Warning, and Error.
7138// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7139// duration that the client is willing to wait for the requested operation to complete. The default value for
7140// this parameter is 60 seconds.
7141func (client BaseClient) GetDeployedApplicationHealth(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result DeployedApplicationHealth, err error) {
7142	if tracing.IsEnabled() {
7143		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationHealth")
7144		defer func() {
7145			sc := -1
7146			if result.Response.Response != nil {
7147				sc = result.Response.Response.StatusCode
7148			}
7149			tracing.EndSpan(ctx, sc, err)
7150		}()
7151	}
7152	if err := validation.Validate([]validation.Validation{
7153		{TargetValue: timeout,
7154			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7155				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7156					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7157				}}}}}); err != nil {
7158		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealth", err.Error())
7159	}
7160
7161	req, err := client.GetDeployedApplicationHealthPreparer(ctx, nodeName, applicationID, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, excludeHealthStatistics, timeout)
7162	if err != nil {
7163		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", nil, "Failure preparing request")
7164		return
7165	}
7166
7167	resp, err := client.GetDeployedApplicationHealthSender(req)
7168	if err != nil {
7169		result.Response = autorest.Response{Response: resp}
7170		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", resp, "Failure sending request")
7171		return
7172	}
7173
7174	result, err = client.GetDeployedApplicationHealthResponder(resp)
7175	if err != nil {
7176		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", resp, "Failure responding to request")
7177	}
7178
7179	return
7180}
7181
7182// GetDeployedApplicationHealthPreparer prepares the GetDeployedApplicationHealth request.
7183func (client BaseClient) GetDeployedApplicationHealthPreparer(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
7184	pathParameters := map[string]interface{}{
7185		"applicationId": applicationID,
7186		"nodeName":      autorest.Encode("path", nodeName),
7187	}
7188
7189	const APIVersion = "6.0"
7190	queryParameters := map[string]interface{}{
7191		"api-version": APIVersion,
7192	}
7193	if eventsHealthStateFilter != nil {
7194		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
7195	} else {
7196		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
7197	}
7198	if deployedServicePackagesHealthStateFilter != nil {
7199		queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", *deployedServicePackagesHealthStateFilter)
7200	} else {
7201		queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", 0)
7202	}
7203	if excludeHealthStatistics != nil {
7204		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
7205	} else {
7206		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
7207	}
7208	if timeout != nil {
7209		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7210	} else {
7211		queryParameters["timeout"] = autorest.Encode("query", 60)
7212	}
7213
7214	preparer := autorest.CreatePreparer(
7215		autorest.AsGet(),
7216		autorest.WithBaseURL(client.BaseURI),
7217		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetHealth", pathParameters),
7218		autorest.WithQueryParameters(queryParameters))
7219	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7220}
7221
7222// GetDeployedApplicationHealthSender sends the GetDeployedApplicationHealth request. The method will close the
7223// http.Response Body if it receives an error.
7224func (client BaseClient) GetDeployedApplicationHealthSender(req *http.Request) (*http.Response, error) {
7225	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7226}
7227
7228// GetDeployedApplicationHealthResponder handles the response to the GetDeployedApplicationHealth request. The method always
7229// closes the http.Response Body.
7230func (client BaseClient) GetDeployedApplicationHealthResponder(resp *http.Response) (result DeployedApplicationHealth, err error) {
7231	err = autorest.Respond(
7232		resp,
7233		client.ByInspecting(),
7234		azure.WithErrorUnlessStatusCode(http.StatusOK),
7235		autorest.ByUnmarshallingJSON(&result),
7236		autorest.ByClosing())
7237	result.Response = autorest.Response{Response: resp}
7238	return
7239}
7240
7241// GetDeployedApplicationHealthUsingPolicy gets the information about health of an application deployed on a Service
7242// Fabric node using the specified policy. Use EventsHealthStateFilter to optionally filter for the collection of
7243// HealthEvent objects reported on the deployed application based on health state. Use
7244// DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on
7245// health state. Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health.
7246// This API only uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored
7247// while evaluating the health of the deployed application.
7248// Parameters:
7249// nodeName - the name of the node.
7250// applicationID - the identity of the application. This is typically the full name of the application without
7251// the 'fabric:' URI scheme.
7252// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7253// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7254// in 6.0+ and "myapp/app1" in previous versions.
7255// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
7256// state.
7257// The possible values for this parameter include integer value of one of the following health states.
7258// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
7259// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
7260// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
7261// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
7262//
7263// - Default - Default value. Matches any HealthState. The value is zero.
7264// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7265// collection of states. The value is 1.
7266// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7267// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7268// - Error - Filter that matches input with HealthState value Error. The value is 8.
7269// - All - Filter that matches input with any HealthState value. The value is 65535.
7270// deployedServicePackagesHealthStateFilter - allows filtering of the deployed service package health state
7271// objects returned in the result of deployed application health query based on their health state.
7272// The possible values for this parameter include integer value of one of the following health states.
7273// Only deployed service packages that match the filter are returned. All deployed service packages are used to
7274// evaluate the aggregated health state of the deployed application.
7275// If not specified, all entries are returned.
7276// The state values are flag based enumeration, so the value can be a combination of these value obtained using
7277// bitwise 'OR' operator.
7278// For example, if the provided value is 6 then health state of service packages with HealthState value of OK
7279// (2) and Warning (4) are returned.
7280//
7281// - Default - Default value. Matches any HealthState. The value is zero.
7282// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7283// collection of states. The value is 1.
7284// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7285// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7286// - Error - Filter that matches input with HealthState value Error. The value is 8.
7287// - All - Filter that matches input with any HealthState value. The value is 65535.
7288// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
7289// of its children.
7290// If not present, the health evaluation uses the health policy from application manifest or the default health
7291// policy.
7292// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
7293// result. False by default.
7294// The statistics show the number of children entities in health state Ok, Warning, and Error.
7295// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7296// duration that the client is willing to wait for the requested operation to complete. The default value for
7297// this parameter is 60 seconds.
7298func (client BaseClient) GetDeployedApplicationHealthUsingPolicy(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result DeployedApplicationHealth, err error) {
7299	if tracing.IsEnabled() {
7300		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationHealthUsingPolicy")
7301		defer func() {
7302			sc := -1
7303			if result.Response.Response != nil {
7304				sc = result.Response.Response.StatusCode
7305			}
7306			tracing.EndSpan(ctx, sc, err)
7307		}()
7308	}
7309	if err := validation.Validate([]validation.Validation{
7310		{TargetValue: timeout,
7311			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7312				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7313					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7314				}}}}}); err != nil {
7315		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", err.Error())
7316	}
7317
7318	req, err := client.GetDeployedApplicationHealthUsingPolicyPreparer(ctx, nodeName, applicationID, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout)
7319	if err != nil {
7320		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", nil, "Failure preparing request")
7321		return
7322	}
7323
7324	resp, err := client.GetDeployedApplicationHealthUsingPolicySender(req)
7325	if err != nil {
7326		result.Response = autorest.Response{Response: resp}
7327		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", resp, "Failure sending request")
7328		return
7329	}
7330
7331	result, err = client.GetDeployedApplicationHealthUsingPolicyResponder(resp)
7332	if err != nil {
7333		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", resp, "Failure responding to request")
7334	}
7335
7336	return
7337}
7338
7339// GetDeployedApplicationHealthUsingPolicyPreparer prepares the GetDeployedApplicationHealthUsingPolicy request.
7340func (client BaseClient) GetDeployedApplicationHealthUsingPolicyPreparer(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
7341	pathParameters := map[string]interface{}{
7342		"applicationId": applicationID,
7343		"nodeName":      autorest.Encode("path", nodeName),
7344	}
7345
7346	const APIVersion = "6.0"
7347	queryParameters := map[string]interface{}{
7348		"api-version": APIVersion,
7349	}
7350	if eventsHealthStateFilter != nil {
7351		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
7352	} else {
7353		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
7354	}
7355	if deployedServicePackagesHealthStateFilter != nil {
7356		queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", *deployedServicePackagesHealthStateFilter)
7357	} else {
7358		queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", 0)
7359	}
7360	if excludeHealthStatistics != nil {
7361		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
7362	} else {
7363		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
7364	}
7365	if timeout != nil {
7366		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7367	} else {
7368		queryParameters["timeout"] = autorest.Encode("query", 60)
7369	}
7370
7371	preparer := autorest.CreatePreparer(
7372		autorest.AsContentType("application/json; charset=utf-8"),
7373		autorest.AsPost(),
7374		autorest.WithBaseURL(client.BaseURI),
7375		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetHealth", pathParameters),
7376		autorest.WithQueryParameters(queryParameters))
7377	if applicationHealthPolicy != nil {
7378		preparer = autorest.DecoratePreparer(preparer,
7379			autorest.WithJSON(applicationHealthPolicy))
7380	}
7381	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7382}
7383
7384// GetDeployedApplicationHealthUsingPolicySender sends the GetDeployedApplicationHealthUsingPolicy request. The method will close the
7385// http.Response Body if it receives an error.
7386func (client BaseClient) GetDeployedApplicationHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
7387	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7388}
7389
7390// GetDeployedApplicationHealthUsingPolicyResponder handles the response to the GetDeployedApplicationHealthUsingPolicy request. The method always
7391// closes the http.Response Body.
7392func (client BaseClient) GetDeployedApplicationHealthUsingPolicyResponder(resp *http.Response) (result DeployedApplicationHealth, err error) {
7393	err = autorest.Respond(
7394		resp,
7395		client.ByInspecting(),
7396		azure.WithErrorUnlessStatusCode(http.StatusOK),
7397		autorest.ByUnmarshallingJSON(&result),
7398		autorest.ByClosing())
7399	result.Response = autorest.Response{Response: resp}
7400	return
7401}
7402
7403// GetDeployedApplicationInfo gets the information about an application deployed on a Service Fabric node.  This query
7404// returns system application information if the application ID provided is for system application. Results encompass
7405// deployed applications in active, activating, and downloading states. This query requires that the node name
7406// corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service
7407// Fabric nodes on the cluster.
7408// Parameters:
7409// nodeName - the name of the node.
7410// applicationID - the identity of the application. This is typically the full name of the application without
7411// the 'fabric:' URI scheme.
7412// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7413// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7414// in 6.0+ and "myapp/app1" in previous versions.
7415// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7416// duration that the client is willing to wait for the requested operation to complete. The default value for
7417// this parameter is 60 seconds.
7418// includeHealthState - include the health state of an entity.
7419// If this parameter is false or not specified, then the health state returned is "Unknown".
7420// When set to true, the query goes in parallel to the node and the health system service before the results
7421// are merged.
7422// As a result, the query is more expensive and may take a longer time.
7423func (client BaseClient) GetDeployedApplicationInfo(ctx context.Context, nodeName string, applicationID string, timeout *int64, includeHealthState *bool) (result DeployedApplicationInfo, err error) {
7424	if tracing.IsEnabled() {
7425		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationInfo")
7426		defer func() {
7427			sc := -1
7428			if result.Response.Response != nil {
7429				sc = result.Response.Response.StatusCode
7430			}
7431			tracing.EndSpan(ctx, sc, err)
7432		}()
7433	}
7434	if err := validation.Validate([]validation.Validation{
7435		{TargetValue: timeout,
7436			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7437				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7438					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7439				}}}}}); err != nil {
7440		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfo", err.Error())
7441	}
7442
7443	req, err := client.GetDeployedApplicationInfoPreparer(ctx, nodeName, applicationID, timeout, includeHealthState)
7444	if err != nil {
7445		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", nil, "Failure preparing request")
7446		return
7447	}
7448
7449	resp, err := client.GetDeployedApplicationInfoSender(req)
7450	if err != nil {
7451		result.Response = autorest.Response{Response: resp}
7452		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", resp, "Failure sending request")
7453		return
7454	}
7455
7456	result, err = client.GetDeployedApplicationInfoResponder(resp)
7457	if err != nil {
7458		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", resp, "Failure responding to request")
7459	}
7460
7461	return
7462}
7463
7464// GetDeployedApplicationInfoPreparer prepares the GetDeployedApplicationInfo request.
7465func (client BaseClient) GetDeployedApplicationInfoPreparer(ctx context.Context, nodeName string, applicationID string, timeout *int64, includeHealthState *bool) (*http.Request, error) {
7466	pathParameters := map[string]interface{}{
7467		"applicationId": applicationID,
7468		"nodeName":      autorest.Encode("path", nodeName),
7469	}
7470
7471	const APIVersion = "6.1"
7472	queryParameters := map[string]interface{}{
7473		"api-version": APIVersion,
7474	}
7475	if timeout != nil {
7476		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7477	} else {
7478		queryParameters["timeout"] = autorest.Encode("query", 60)
7479	}
7480	if includeHealthState != nil {
7481		queryParameters["IncludeHealthState"] = autorest.Encode("query", *includeHealthState)
7482	} else {
7483		queryParameters["IncludeHealthState"] = autorest.Encode("query", false)
7484	}
7485
7486	preparer := autorest.CreatePreparer(
7487		autorest.AsGet(),
7488		autorest.WithBaseURL(client.BaseURI),
7489		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}", pathParameters),
7490		autorest.WithQueryParameters(queryParameters))
7491	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7492}
7493
7494// GetDeployedApplicationInfoSender sends the GetDeployedApplicationInfo request. The method will close the
7495// http.Response Body if it receives an error.
7496func (client BaseClient) GetDeployedApplicationInfoSender(req *http.Request) (*http.Response, error) {
7497	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7498}
7499
7500// GetDeployedApplicationInfoResponder handles the response to the GetDeployedApplicationInfo request. The method always
7501// closes the http.Response Body.
7502func (client BaseClient) GetDeployedApplicationInfoResponder(resp *http.Response) (result DeployedApplicationInfo, err error) {
7503	err = autorest.Respond(
7504		resp,
7505		client.ByInspecting(),
7506		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
7507		autorest.ByUnmarshallingJSON(&result),
7508		autorest.ByClosing())
7509	result.Response = autorest.Response{Response: resp}
7510	return
7511}
7512
7513// GetDeployedApplicationInfoList gets the list of applications deployed on a Service Fabric node. The results do not
7514// include information about deployed system applications unless explicitly queried for by ID. Results encompass
7515// deployed applications in active, activating, and downloading states. This query requires that the node name
7516// corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service
7517// Fabric nodes on the cluster.
7518// Parameters:
7519// nodeName - the name of the node.
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.
7523// includeHealthState - include the health state of an entity.
7524// If this parameter is false or not specified, then the health state returned is "Unknown".
7525// When set to true, the query goes in parallel to the node and the health system service before the results
7526// are merged.
7527// As a result, the query is more expensive and may take a longer time.
7528// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
7529// token with a non empty value is included in the response of the API when the results from the system do not
7530// fit in a single response. When this value is passed to the next API call, the API returns next set of
7531// results. If there are no further results then the continuation token does not contain a value. The value of
7532// this parameter should not be URL encoded.
7533// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
7534// defines the upper bound on the number of results returned. The results returned can be less than the
7535// specified maximum results if they do not fit in the message as per the max message size restrictions defined
7536// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
7537// as possible that fit in the return message.
7538func (client BaseClient) GetDeployedApplicationInfoList(ctx context.Context, nodeName string, timeout *int64, includeHealthState *bool, continuationToken string, maxResults *int64) (result PagedDeployedApplicationInfoList, err error) {
7539	if tracing.IsEnabled() {
7540		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationInfoList")
7541		defer func() {
7542			sc := -1
7543			if result.Response.Response != nil {
7544				sc = result.Response.Response.StatusCode
7545			}
7546			tracing.EndSpan(ctx, sc, err)
7547		}()
7548	}
7549	if err := validation.Validate([]validation.Validation{
7550		{TargetValue: timeout,
7551			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7552				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7553					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7554				}}}},
7555		{TargetValue: maxResults,
7556			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
7557				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil {
7558		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfoList", err.Error())
7559	}
7560
7561	req, err := client.GetDeployedApplicationInfoListPreparer(ctx, nodeName, timeout, includeHealthState, continuationToken, maxResults)
7562	if err != nil {
7563		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", nil, "Failure preparing request")
7564		return
7565	}
7566
7567	resp, err := client.GetDeployedApplicationInfoListSender(req)
7568	if err != nil {
7569		result.Response = autorest.Response{Response: resp}
7570		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", resp, "Failure sending request")
7571		return
7572	}
7573
7574	result, err = client.GetDeployedApplicationInfoListResponder(resp)
7575	if err != nil {
7576		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", resp, "Failure responding to request")
7577	}
7578
7579	return
7580}
7581
7582// GetDeployedApplicationInfoListPreparer prepares the GetDeployedApplicationInfoList request.
7583func (client BaseClient) GetDeployedApplicationInfoListPreparer(ctx context.Context, nodeName string, timeout *int64, includeHealthState *bool, continuationToken string, maxResults *int64) (*http.Request, error) {
7584	pathParameters := map[string]interface{}{
7585		"nodeName": autorest.Encode("path", nodeName),
7586	}
7587
7588	const APIVersion = "6.1"
7589	queryParameters := map[string]interface{}{
7590		"api-version": APIVersion,
7591	}
7592	if timeout != nil {
7593		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7594	} else {
7595		queryParameters["timeout"] = autorest.Encode("query", 60)
7596	}
7597	if includeHealthState != nil {
7598		queryParameters["IncludeHealthState"] = autorest.Encode("query", *includeHealthState)
7599	} else {
7600		queryParameters["IncludeHealthState"] = autorest.Encode("query", false)
7601	}
7602	if len(continuationToken) > 0 {
7603		queryParameters["ContinuationToken"] = continuationToken
7604	}
7605	if maxResults != nil {
7606		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
7607	} else {
7608		queryParameters["MaxResults"] = autorest.Encode("query", 0)
7609	}
7610
7611	preparer := autorest.CreatePreparer(
7612		autorest.AsGet(),
7613		autorest.WithBaseURL(client.BaseURI),
7614		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications", pathParameters),
7615		autorest.WithQueryParameters(queryParameters))
7616	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7617}
7618
7619// GetDeployedApplicationInfoListSender sends the GetDeployedApplicationInfoList request. The method will close the
7620// http.Response Body if it receives an error.
7621func (client BaseClient) GetDeployedApplicationInfoListSender(req *http.Request) (*http.Response, error) {
7622	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7623}
7624
7625// GetDeployedApplicationInfoListResponder handles the response to the GetDeployedApplicationInfoList request. The method always
7626// closes the http.Response Body.
7627func (client BaseClient) GetDeployedApplicationInfoListResponder(resp *http.Response) (result PagedDeployedApplicationInfoList, err error) {
7628	err = autorest.Respond(
7629		resp,
7630		client.ByInspecting(),
7631		azure.WithErrorUnlessStatusCode(http.StatusOK),
7632		autorest.ByUnmarshallingJSON(&result),
7633		autorest.ByClosing())
7634	result.Response = autorest.Response{Response: resp}
7635	return
7636}
7637
7638// GetDeployedCodePackageInfoList gets the list of code packages deployed on a Service Fabric node for the given
7639// application.
7640// Parameters:
7641// nodeName - the name of the node.
7642// applicationID - the identity of the application. This is typically the full name of the application without
7643// the 'fabric:' URI scheme.
7644// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7645// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7646// in 6.0+ and "myapp/app1" in previous versions.
7647// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
7648// Fabric cluster.
7649// codePackageName - the name of code package specified in service manifest registered as part of an
7650// application type in a Service Fabric cluster.
7651// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7652// duration that the client is willing to wait for the requested operation to complete. The default value for
7653// this parameter is 60 seconds.
7654func (client BaseClient) GetDeployedCodePackageInfoList(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, timeout *int64) (result ListDeployedCodePackageInfo, err error) {
7655	if tracing.IsEnabled() {
7656		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedCodePackageInfoList")
7657		defer func() {
7658			sc := -1
7659			if result.Response.Response != nil {
7660				sc = result.Response.Response.StatusCode
7661			}
7662			tracing.EndSpan(ctx, sc, err)
7663		}()
7664	}
7665	if err := validation.Validate([]validation.Validation{
7666		{TargetValue: timeout,
7667			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7668				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7669					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7670				}}}}}); err != nil {
7671		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedCodePackageInfoList", err.Error())
7672	}
7673
7674	req, err := client.GetDeployedCodePackageInfoListPreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, timeout)
7675	if err != nil {
7676		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", nil, "Failure preparing request")
7677		return
7678	}
7679
7680	resp, err := client.GetDeployedCodePackageInfoListSender(req)
7681	if err != nil {
7682		result.Response = autorest.Response{Response: resp}
7683		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", resp, "Failure sending request")
7684		return
7685	}
7686
7687	result, err = client.GetDeployedCodePackageInfoListResponder(resp)
7688	if err != nil {
7689		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", resp, "Failure responding to request")
7690	}
7691
7692	return
7693}
7694
7695// GetDeployedCodePackageInfoListPreparer prepares the GetDeployedCodePackageInfoList request.
7696func (client BaseClient) GetDeployedCodePackageInfoListPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, timeout *int64) (*http.Request, error) {
7697	pathParameters := map[string]interface{}{
7698		"applicationId": applicationID,
7699		"nodeName":      autorest.Encode("path", nodeName),
7700	}
7701
7702	const APIVersion = "6.0"
7703	queryParameters := map[string]interface{}{
7704		"api-version": APIVersion,
7705	}
7706	if len(serviceManifestName) > 0 {
7707		queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName)
7708	}
7709	if len(codePackageName) > 0 {
7710		queryParameters["CodePackageName"] = autorest.Encode("query", codePackageName)
7711	}
7712	if timeout != nil {
7713		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7714	} else {
7715		queryParameters["timeout"] = autorest.Encode("query", 60)
7716	}
7717
7718	preparer := autorest.CreatePreparer(
7719		autorest.AsGet(),
7720		autorest.WithBaseURL(client.BaseURI),
7721		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages", pathParameters),
7722		autorest.WithQueryParameters(queryParameters))
7723	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7724}
7725
7726// GetDeployedCodePackageInfoListSender sends the GetDeployedCodePackageInfoList request. The method will close the
7727// http.Response Body if it receives an error.
7728func (client BaseClient) GetDeployedCodePackageInfoListSender(req *http.Request) (*http.Response, error) {
7729	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7730}
7731
7732// GetDeployedCodePackageInfoListResponder handles the response to the GetDeployedCodePackageInfoList request. The method always
7733// closes the http.Response Body.
7734func (client BaseClient) GetDeployedCodePackageInfoListResponder(resp *http.Response) (result ListDeployedCodePackageInfo, err error) {
7735	err = autorest.Respond(
7736		resp,
7737		client.ByInspecting(),
7738		azure.WithErrorUnlessStatusCode(http.StatusOK),
7739		autorest.ByUnmarshallingJSON(&result.Value),
7740		autorest.ByClosing())
7741	result.Response = autorest.Response{Response: resp}
7742	return
7743}
7744
7745// GetDeployedServicePackageHealth gets the information about health of service package for a specific application
7746// deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of
7747// HealthEvent objects reported on the deployed service package based on health state.
7748// Parameters:
7749// nodeName - the name of the node.
7750// applicationID - the identity of the application. This is typically the full name of the application without
7751// the 'fabric:' URI scheme.
7752// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7753// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7754// in 6.0+ and "myapp/app1" in previous versions.
7755// servicePackageName - the name of the service package.
7756// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
7757// state.
7758// The possible values for this parameter include integer value of one of the following health states.
7759// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
7760// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
7761// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
7762// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
7763//
7764// - Default - Default value. Matches any HealthState. The value is zero.
7765// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7766// collection of states. The value is 1.
7767// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7768// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7769// - Error - Filter that matches input with HealthState value Error. The value is 8.
7770// - All - Filter that matches input with any HealthState value. The value is 65535.
7771// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7772// duration that the client is willing to wait for the requested operation to complete. The default value for
7773// this parameter is 60 seconds.
7774func (client BaseClient) GetDeployedServicePackageHealth(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, timeout *int64) (result DeployedServicePackageHealth, err error) {
7775	if tracing.IsEnabled() {
7776		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageHealth")
7777		defer func() {
7778			sc := -1
7779			if result.Response.Response != nil {
7780				sc = result.Response.Response.StatusCode
7781			}
7782			tracing.EndSpan(ctx, sc, err)
7783		}()
7784	}
7785	if err := validation.Validate([]validation.Validation{
7786		{TargetValue: timeout,
7787			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7788				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7789					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7790				}}}}}); err != nil {
7791		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealth", err.Error())
7792	}
7793
7794	req, err := client.GetDeployedServicePackageHealthPreparer(ctx, nodeName, applicationID, servicePackageName, eventsHealthStateFilter, timeout)
7795	if err != nil {
7796		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", nil, "Failure preparing request")
7797		return
7798	}
7799
7800	resp, err := client.GetDeployedServicePackageHealthSender(req)
7801	if err != nil {
7802		result.Response = autorest.Response{Response: resp}
7803		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", resp, "Failure sending request")
7804		return
7805	}
7806
7807	result, err = client.GetDeployedServicePackageHealthResponder(resp)
7808	if err != nil {
7809		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", resp, "Failure responding to request")
7810	}
7811
7812	return
7813}
7814
7815// GetDeployedServicePackageHealthPreparer prepares the GetDeployedServicePackageHealth request.
7816func (client BaseClient) GetDeployedServicePackageHealthPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) {
7817	pathParameters := map[string]interface{}{
7818		"applicationId":      applicationID,
7819		"nodeName":           autorest.Encode("path", nodeName),
7820		"servicePackageName": servicePackageName,
7821	}
7822
7823	const APIVersion = "6.0"
7824	queryParameters := map[string]interface{}{
7825		"api-version": APIVersion,
7826	}
7827	if eventsHealthStateFilter != nil {
7828		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
7829	} else {
7830		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
7831	}
7832	if timeout != nil {
7833		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7834	} else {
7835		queryParameters["timeout"] = autorest.Encode("query", 60)
7836	}
7837
7838	preparer := autorest.CreatePreparer(
7839		autorest.AsGet(),
7840		autorest.WithBaseURL(client.BaseURI),
7841		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/GetHealth", pathParameters),
7842		autorest.WithQueryParameters(queryParameters))
7843	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7844}
7845
7846// GetDeployedServicePackageHealthSender sends the GetDeployedServicePackageHealth request. The method will close the
7847// http.Response Body if it receives an error.
7848func (client BaseClient) GetDeployedServicePackageHealthSender(req *http.Request) (*http.Response, error) {
7849	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7850}
7851
7852// GetDeployedServicePackageHealthResponder handles the response to the GetDeployedServicePackageHealth request. The method always
7853// closes the http.Response Body.
7854func (client BaseClient) GetDeployedServicePackageHealthResponder(resp *http.Response) (result DeployedServicePackageHealth, err error) {
7855	err = autorest.Respond(
7856		resp,
7857		client.ByInspecting(),
7858		azure.WithErrorUnlessStatusCode(http.StatusOK),
7859		autorest.ByUnmarshallingJSON(&result),
7860		autorest.ByClosing())
7861	result.Response = autorest.Response{Response: resp}
7862	return
7863}
7864
7865// GetDeployedServicePackageHealthUsingPolicy gets the information about health of an service package for a specific
7866// application deployed on a Service Fabric node. using the specified policy. Use EventsHealthStateFilter to optionally
7867// filter for the collection of HealthEvent objects reported on the deployed service package based on health state. Use
7868// ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only uses
7869// 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while evaluating
7870// the health of the deployed service package.
7871// Parameters:
7872// nodeName - the name of the node.
7873// applicationID - the identity of the application. This is typically the full name of the application without
7874// the 'fabric:' URI scheme.
7875// Starting from version 6.0, hierarchical names are delimited with the "~" character.
7876// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
7877// in 6.0+ and "myapp/app1" in previous versions.
7878// servicePackageName - the name of the service package.
7879// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
7880// state.
7881// The possible values for this parameter include integer value of one of the following health states.
7882// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
7883// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
7884// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
7885// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
7886//
7887// - Default - Default value. Matches any HealthState. The value is zero.
7888// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
7889// collection of states. The value is 1.
7890// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
7891// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
7892// - Error - Filter that matches input with HealthState value Error. The value is 8.
7893// - All - Filter that matches input with any HealthState value. The value is 65535.
7894// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
7895// of its children.
7896// If not present, the health evaluation uses the health policy from application manifest or the default health
7897// policy.
7898// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
7899// duration that the client is willing to wait for the requested operation to complete. The default value for
7900// this parameter is 60 seconds.
7901func (client BaseClient) GetDeployedServicePackageHealthUsingPolicy(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result DeployedServicePackageHealth, err error) {
7902	if tracing.IsEnabled() {
7903		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageHealthUsingPolicy")
7904		defer func() {
7905			sc := -1
7906			if result.Response.Response != nil {
7907				sc = result.Response.Response.StatusCode
7908			}
7909			tracing.EndSpan(ctx, sc, err)
7910		}()
7911	}
7912	if err := validation.Validate([]validation.Validation{
7913		{TargetValue: timeout,
7914			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
7915				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
7916					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
7917				}}}}}); err != nil {
7918		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", err.Error())
7919	}
7920
7921	req, err := client.GetDeployedServicePackageHealthUsingPolicyPreparer(ctx, nodeName, applicationID, servicePackageName, eventsHealthStateFilter, applicationHealthPolicy, timeout)
7922	if err != nil {
7923		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", nil, "Failure preparing request")
7924		return
7925	}
7926
7927	resp, err := client.GetDeployedServicePackageHealthUsingPolicySender(req)
7928	if err != nil {
7929		result.Response = autorest.Response{Response: resp}
7930		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", resp, "Failure sending request")
7931		return
7932	}
7933
7934	result, err = client.GetDeployedServicePackageHealthUsingPolicyResponder(resp)
7935	if err != nil {
7936		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", resp, "Failure responding to request")
7937	}
7938
7939	return
7940}
7941
7942// GetDeployedServicePackageHealthUsingPolicyPreparer prepares the GetDeployedServicePackageHealthUsingPolicy request.
7943func (client BaseClient) GetDeployedServicePackageHealthUsingPolicyPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) {
7944	pathParameters := map[string]interface{}{
7945		"applicationId":      applicationID,
7946		"nodeName":           autorest.Encode("path", nodeName),
7947		"servicePackageName": servicePackageName,
7948	}
7949
7950	const APIVersion = "6.0"
7951	queryParameters := map[string]interface{}{
7952		"api-version": APIVersion,
7953	}
7954	if eventsHealthStateFilter != nil {
7955		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
7956	} else {
7957		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
7958	}
7959	if timeout != nil {
7960		queryParameters["timeout"] = autorest.Encode("query", *timeout)
7961	} else {
7962		queryParameters["timeout"] = autorest.Encode("query", 60)
7963	}
7964
7965	preparer := autorest.CreatePreparer(
7966		autorest.AsContentType("application/json; charset=utf-8"),
7967		autorest.AsPost(),
7968		autorest.WithBaseURL(client.BaseURI),
7969		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/GetHealth", pathParameters),
7970		autorest.WithQueryParameters(queryParameters))
7971	if applicationHealthPolicy != nil {
7972		preparer = autorest.DecoratePreparer(preparer,
7973			autorest.WithJSON(applicationHealthPolicy))
7974	}
7975	return preparer.Prepare((&http.Request{}).WithContext(ctx))
7976}
7977
7978// GetDeployedServicePackageHealthUsingPolicySender sends the GetDeployedServicePackageHealthUsingPolicy request. The method will close the
7979// http.Response Body if it receives an error.
7980func (client BaseClient) GetDeployedServicePackageHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
7981	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7982}
7983
7984// GetDeployedServicePackageHealthUsingPolicyResponder handles the response to the GetDeployedServicePackageHealthUsingPolicy request. The method always
7985// closes the http.Response Body.
7986func (client BaseClient) GetDeployedServicePackageHealthUsingPolicyResponder(resp *http.Response) (result DeployedServicePackageHealth, err error) {
7987	err = autorest.Respond(
7988		resp,
7989		client.ByInspecting(),
7990		azure.WithErrorUnlessStatusCode(http.StatusOK),
7991		autorest.ByUnmarshallingJSON(&result),
7992		autorest.ByClosing())
7993	result.Response = autorest.Response{Response: resp}
7994	return
7995}
7996
7997// GetDeployedServicePackageInfoList returns the information about the service packages deployed on a Service Fabric
7998// node for the given application.
7999// Parameters:
8000// nodeName - the name of the node.
8001// applicationID - the identity of the application. This is typically the full name of the application without
8002// the 'fabric:' URI scheme.
8003// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8004// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8005// in 6.0+ and "myapp/app1" in previous versions.
8006// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8007// duration that the client is willing to wait for the requested operation to complete. The default value for
8008// this parameter is 60 seconds.
8009func (client BaseClient) GetDeployedServicePackageInfoList(ctx context.Context, nodeName string, applicationID string, timeout *int64) (result ListDeployedServicePackageInfo, err error) {
8010	if tracing.IsEnabled() {
8011		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageInfoList")
8012		defer func() {
8013			sc := -1
8014			if result.Response.Response != nil {
8015				sc = result.Response.Response.StatusCode
8016			}
8017			tracing.EndSpan(ctx, sc, err)
8018		}()
8019	}
8020	if err := validation.Validate([]validation.Validation{
8021		{TargetValue: timeout,
8022			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8023				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8024					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8025				}}}}}); err != nil {
8026		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoList", err.Error())
8027	}
8028
8029	req, err := client.GetDeployedServicePackageInfoListPreparer(ctx, nodeName, applicationID, timeout)
8030	if err != nil {
8031		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", nil, "Failure preparing request")
8032		return
8033	}
8034
8035	resp, err := client.GetDeployedServicePackageInfoListSender(req)
8036	if err != nil {
8037		result.Response = autorest.Response{Response: resp}
8038		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", resp, "Failure sending request")
8039		return
8040	}
8041
8042	result, err = client.GetDeployedServicePackageInfoListResponder(resp)
8043	if err != nil {
8044		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", resp, "Failure responding to request")
8045	}
8046
8047	return
8048}
8049
8050// GetDeployedServicePackageInfoListPreparer prepares the GetDeployedServicePackageInfoList request.
8051func (client BaseClient) GetDeployedServicePackageInfoListPreparer(ctx context.Context, nodeName string, applicationID string, timeout *int64) (*http.Request, error) {
8052	pathParameters := map[string]interface{}{
8053		"applicationId": applicationID,
8054		"nodeName":      autorest.Encode("path", nodeName),
8055	}
8056
8057	const APIVersion = "6.0"
8058	queryParameters := map[string]interface{}{
8059		"api-version": APIVersion,
8060	}
8061	if timeout != nil {
8062		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8063	} else {
8064		queryParameters["timeout"] = autorest.Encode("query", 60)
8065	}
8066
8067	preparer := autorest.CreatePreparer(
8068		autorest.AsGet(),
8069		autorest.WithBaseURL(client.BaseURI),
8070		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages", pathParameters),
8071		autorest.WithQueryParameters(queryParameters))
8072	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8073}
8074
8075// GetDeployedServicePackageInfoListSender sends the GetDeployedServicePackageInfoList request. The method will close the
8076// http.Response Body if it receives an error.
8077func (client BaseClient) GetDeployedServicePackageInfoListSender(req *http.Request) (*http.Response, error) {
8078	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8079}
8080
8081// GetDeployedServicePackageInfoListResponder handles the response to the GetDeployedServicePackageInfoList request. The method always
8082// closes the http.Response Body.
8083func (client BaseClient) GetDeployedServicePackageInfoListResponder(resp *http.Response) (result ListDeployedServicePackageInfo, err error) {
8084	err = autorest.Respond(
8085		resp,
8086		client.ByInspecting(),
8087		azure.WithErrorUnlessStatusCode(http.StatusOK),
8088		autorest.ByUnmarshallingJSON(&result.Value),
8089		autorest.ByClosing())
8090	result.Response = autorest.Response{Response: resp}
8091	return
8092}
8093
8094// GetDeployedServicePackageInfoListByName returns the information about the service packages deployed on a Service
8095// Fabric node for the given application. These results are of service packages whose name match exactly the service
8096// package name specified as the parameter.
8097// Parameters:
8098// nodeName - the name of the node.
8099// applicationID - the identity of the application. This is typically the full name of the application without
8100// the 'fabric:' URI scheme.
8101// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8102// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8103// in 6.0+ and "myapp/app1" in previous versions.
8104// servicePackageName - the name of the service package.
8105// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8106// duration that the client is willing to wait for the requested operation to complete. The default value for
8107// this parameter is 60 seconds.
8108func (client BaseClient) GetDeployedServicePackageInfoListByName(ctx context.Context, nodeName string, applicationID string, servicePackageName string, timeout *int64) (result ListDeployedServicePackageInfo, err error) {
8109	if tracing.IsEnabled() {
8110		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageInfoListByName")
8111		defer func() {
8112			sc := -1
8113			if result.Response.Response != nil {
8114				sc = result.Response.Response.StatusCode
8115			}
8116			tracing.EndSpan(ctx, sc, err)
8117		}()
8118	}
8119	if err := validation.Validate([]validation.Validation{
8120		{TargetValue: timeout,
8121			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8122				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8123					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8124				}}}}}); err != nil {
8125		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", err.Error())
8126	}
8127
8128	req, err := client.GetDeployedServicePackageInfoListByNamePreparer(ctx, nodeName, applicationID, servicePackageName, timeout)
8129	if err != nil {
8130		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", nil, "Failure preparing request")
8131		return
8132	}
8133
8134	resp, err := client.GetDeployedServicePackageInfoListByNameSender(req)
8135	if err != nil {
8136		result.Response = autorest.Response{Response: resp}
8137		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", resp, "Failure sending request")
8138		return
8139	}
8140
8141	result, err = client.GetDeployedServicePackageInfoListByNameResponder(resp)
8142	if err != nil {
8143		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", resp, "Failure responding to request")
8144	}
8145
8146	return
8147}
8148
8149// GetDeployedServicePackageInfoListByNamePreparer prepares the GetDeployedServicePackageInfoListByName request.
8150func (client BaseClient) GetDeployedServicePackageInfoListByNamePreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, timeout *int64) (*http.Request, error) {
8151	pathParameters := map[string]interface{}{
8152		"applicationId":      applicationID,
8153		"nodeName":           autorest.Encode("path", nodeName),
8154		"servicePackageName": servicePackageName,
8155	}
8156
8157	const APIVersion = "6.0"
8158	queryParameters := map[string]interface{}{
8159		"api-version": APIVersion,
8160	}
8161	if timeout != nil {
8162		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8163	} else {
8164		queryParameters["timeout"] = autorest.Encode("query", 60)
8165	}
8166
8167	preparer := autorest.CreatePreparer(
8168		autorest.AsGet(),
8169		autorest.WithBaseURL(client.BaseURI),
8170		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}", pathParameters),
8171		autorest.WithQueryParameters(queryParameters))
8172	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8173}
8174
8175// GetDeployedServicePackageInfoListByNameSender sends the GetDeployedServicePackageInfoListByName request. The method will close the
8176// http.Response Body if it receives an error.
8177func (client BaseClient) GetDeployedServicePackageInfoListByNameSender(req *http.Request) (*http.Response, error) {
8178	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8179}
8180
8181// GetDeployedServicePackageInfoListByNameResponder handles the response to the GetDeployedServicePackageInfoListByName request. The method always
8182// closes the http.Response Body.
8183func (client BaseClient) GetDeployedServicePackageInfoListByNameResponder(resp *http.Response) (result ListDeployedServicePackageInfo, err error) {
8184	err = autorest.Respond(
8185		resp,
8186		client.ByInspecting(),
8187		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
8188		autorest.ByUnmarshallingJSON(&result.Value),
8189		autorest.ByClosing())
8190	result.Response = autorest.Response{Response: resp}
8191	return
8192}
8193
8194// GetDeployedServiceReplicaDetailInfo gets the details of the replica deployed on a Service Fabric node. The
8195// information include service kind, service name, current service operation, current service operation start date
8196// time, partition ID, replica/instance ID, reported load, and other information.
8197// Parameters:
8198// nodeName - the name of the node.
8199// partitionID - the identity of the partition.
8200// replicaID - the identifier of the replica.
8201// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8202// duration that the client is willing to wait for the requested operation to complete. The default value for
8203// this parameter is 60 seconds.
8204func (client BaseClient) GetDeployedServiceReplicaDetailInfo(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (result DeployedServiceReplicaDetailInfoModel, err error) {
8205	if tracing.IsEnabled() {
8206		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaDetailInfo")
8207		defer func() {
8208			sc := -1
8209			if result.Response.Response != nil {
8210				sc = result.Response.Response.StatusCode
8211			}
8212			tracing.EndSpan(ctx, sc, err)
8213		}()
8214	}
8215	if err := validation.Validate([]validation.Validation{
8216		{TargetValue: timeout,
8217			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8218				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8219					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8220				}}}}}); err != nil {
8221		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", err.Error())
8222	}
8223
8224	req, err := client.GetDeployedServiceReplicaDetailInfoPreparer(ctx, nodeName, partitionID, replicaID, timeout)
8225	if err != nil {
8226		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", nil, "Failure preparing request")
8227		return
8228	}
8229
8230	resp, err := client.GetDeployedServiceReplicaDetailInfoSender(req)
8231	if err != nil {
8232		result.Response = autorest.Response{Response: resp}
8233		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", resp, "Failure sending request")
8234		return
8235	}
8236
8237	result, err = client.GetDeployedServiceReplicaDetailInfoResponder(resp)
8238	if err != nil {
8239		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", resp, "Failure responding to request")
8240	}
8241
8242	return
8243}
8244
8245// GetDeployedServiceReplicaDetailInfoPreparer prepares the GetDeployedServiceReplicaDetailInfo request.
8246func (client BaseClient) GetDeployedServiceReplicaDetailInfoPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) {
8247	pathParameters := map[string]interface{}{
8248		"nodeName":    autorest.Encode("path", nodeName),
8249		"partitionId": partitionID,
8250		"replicaId":   replicaID,
8251	}
8252
8253	const APIVersion = "6.0"
8254	queryParameters := map[string]interface{}{
8255		"api-version": APIVersion,
8256	}
8257	if timeout != nil {
8258		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8259	} else {
8260		queryParameters["timeout"] = autorest.Encode("query", 60)
8261	}
8262
8263	preparer := autorest.CreatePreparer(
8264		autorest.AsGet(),
8265		autorest.WithBaseURL(client.BaseURI),
8266		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetDetail", pathParameters),
8267		autorest.WithQueryParameters(queryParameters))
8268	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8269}
8270
8271// GetDeployedServiceReplicaDetailInfoSender sends the GetDeployedServiceReplicaDetailInfo request. The method will close the
8272// http.Response Body if it receives an error.
8273func (client BaseClient) GetDeployedServiceReplicaDetailInfoSender(req *http.Request) (*http.Response, error) {
8274	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8275}
8276
8277// GetDeployedServiceReplicaDetailInfoResponder handles the response to the GetDeployedServiceReplicaDetailInfo request. The method always
8278// closes the http.Response Body.
8279func (client BaseClient) GetDeployedServiceReplicaDetailInfoResponder(resp *http.Response) (result DeployedServiceReplicaDetailInfoModel, err error) {
8280	err = autorest.Respond(
8281		resp,
8282		client.ByInspecting(),
8283		azure.WithErrorUnlessStatusCode(http.StatusOK),
8284		autorest.ByUnmarshallingJSON(&result),
8285		autorest.ByClosing())
8286	result.Response = autorest.Response{Response: resp}
8287	return
8288}
8289
8290// GetDeployedServiceReplicaDetailInfoByPartitionID gets the details of the replica deployed on a Service Fabric node.
8291// The information include service kind, service name, current service operation, current service operation start date
8292// time, partition ID, replica/instance ID, reported load, and other information.
8293// Parameters:
8294// nodeName - the name of the node.
8295// partitionID - the identity of the partition.
8296// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8297// duration that the client is willing to wait for the requested operation to complete. The default value for
8298// this parameter is 60 seconds.
8299func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionID(ctx context.Context, nodeName string, partitionID uuid.UUID, timeout *int64) (result DeployedServiceReplicaDetailInfoModel, err error) {
8300	if tracing.IsEnabled() {
8301		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaDetailInfoByPartitionID")
8302		defer func() {
8303			sc := -1
8304			if result.Response.Response != nil {
8305				sc = result.Response.Response.StatusCode
8306			}
8307			tracing.EndSpan(ctx, sc, err)
8308		}()
8309	}
8310	if err := validation.Validate([]validation.Validation{
8311		{TargetValue: timeout,
8312			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8313				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8314					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8315				}}}}}); err != nil {
8316		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", err.Error())
8317	}
8318
8319	req, err := client.GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer(ctx, nodeName, partitionID, timeout)
8320	if err != nil {
8321		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", nil, "Failure preparing request")
8322		return
8323	}
8324
8325	resp, err := client.GetDeployedServiceReplicaDetailInfoByPartitionIDSender(req)
8326	if err != nil {
8327		result.Response = autorest.Response{Response: resp}
8328		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", resp, "Failure sending request")
8329		return
8330	}
8331
8332	result, err = client.GetDeployedServiceReplicaDetailInfoByPartitionIDResponder(resp)
8333	if err != nil {
8334		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", resp, "Failure responding to request")
8335	}
8336
8337	return
8338}
8339
8340// GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer prepares the GetDeployedServiceReplicaDetailInfoByPartitionID request.
8341func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
8342	pathParameters := map[string]interface{}{
8343		"nodeName":    autorest.Encode("path", nodeName),
8344		"partitionId": partitionID,
8345	}
8346
8347	const APIVersion = "6.0"
8348	queryParameters := map[string]interface{}{
8349		"api-version": APIVersion,
8350	}
8351	if timeout != nil {
8352		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8353	} else {
8354		queryParameters["timeout"] = autorest.Encode("query", 60)
8355	}
8356
8357	preparer := autorest.CreatePreparer(
8358		autorest.AsGet(),
8359		autorest.WithBaseURL(client.BaseURI),
8360		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas", pathParameters),
8361		autorest.WithQueryParameters(queryParameters))
8362	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8363}
8364
8365// GetDeployedServiceReplicaDetailInfoByPartitionIDSender sends the GetDeployedServiceReplicaDetailInfoByPartitionID request. The method will close the
8366// http.Response Body if it receives an error.
8367func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDSender(req *http.Request) (*http.Response, error) {
8368	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8369}
8370
8371// GetDeployedServiceReplicaDetailInfoByPartitionIDResponder handles the response to the GetDeployedServiceReplicaDetailInfoByPartitionID request. The method always
8372// closes the http.Response Body.
8373func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDResponder(resp *http.Response) (result DeployedServiceReplicaDetailInfoModel, err error) {
8374	err = autorest.Respond(
8375		resp,
8376		client.ByInspecting(),
8377		azure.WithErrorUnlessStatusCode(http.StatusOK),
8378		autorest.ByUnmarshallingJSON(&result),
8379		autorest.ByClosing())
8380	result.Response = autorest.Response{Response: resp}
8381	return
8382}
8383
8384// GetDeployedServiceReplicaInfoList gets the list containing the information about replicas deployed on a Service
8385// Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of
8386// the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return
8387// information about the deployed replicas matching the specified values for those parameters.
8388// Parameters:
8389// nodeName - the name of the node.
8390// applicationID - the identity of the application. This is typically the full name of the application without
8391// the 'fabric:' URI scheme.
8392// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8393// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8394// in 6.0+ and "myapp/app1" in previous versions.
8395// partitionID - the identity of the partition.
8396// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
8397// Fabric cluster.
8398// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8399// duration that the client is willing to wait for the requested operation to complete. The default value for
8400// this parameter is 60 seconds.
8401func (client BaseClient) GetDeployedServiceReplicaInfoList(ctx context.Context, nodeName string, applicationID string, partitionID *uuid.UUID, serviceManifestName string, timeout *int64) (result ListDeployedServiceReplicaInfo, err error) {
8402	if tracing.IsEnabled() {
8403		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaInfoList")
8404		defer func() {
8405			sc := -1
8406			if result.Response.Response != nil {
8407				sc = result.Response.Response.StatusCode
8408			}
8409			tracing.EndSpan(ctx, sc, err)
8410		}()
8411	}
8412	if err := validation.Validate([]validation.Validation{
8413		{TargetValue: timeout,
8414			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8415				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8416					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8417				}}}}}); err != nil {
8418		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", err.Error())
8419	}
8420
8421	req, err := client.GetDeployedServiceReplicaInfoListPreparer(ctx, nodeName, applicationID, partitionID, serviceManifestName, timeout)
8422	if err != nil {
8423		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", nil, "Failure preparing request")
8424		return
8425	}
8426
8427	resp, err := client.GetDeployedServiceReplicaInfoListSender(req)
8428	if err != nil {
8429		result.Response = autorest.Response{Response: resp}
8430		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", resp, "Failure sending request")
8431		return
8432	}
8433
8434	result, err = client.GetDeployedServiceReplicaInfoListResponder(resp)
8435	if err != nil {
8436		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", resp, "Failure responding to request")
8437	}
8438
8439	return
8440}
8441
8442// GetDeployedServiceReplicaInfoListPreparer prepares the GetDeployedServiceReplicaInfoList request.
8443func (client BaseClient) GetDeployedServiceReplicaInfoListPreparer(ctx context.Context, nodeName string, applicationID string, partitionID *uuid.UUID, serviceManifestName string, timeout *int64) (*http.Request, error) {
8444	pathParameters := map[string]interface{}{
8445		"applicationId": applicationID,
8446		"nodeName":      autorest.Encode("path", nodeName),
8447	}
8448
8449	const APIVersion = "6.0"
8450	queryParameters := map[string]interface{}{
8451		"api-version": APIVersion,
8452	}
8453	if partitionID != nil {
8454		queryParameters["PartitionId"] = autorest.Encode("query", *partitionID)
8455	}
8456	if len(serviceManifestName) > 0 {
8457		queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName)
8458	}
8459	if timeout != nil {
8460		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8461	} else {
8462		queryParameters["timeout"] = autorest.Encode("query", 60)
8463	}
8464
8465	preparer := autorest.CreatePreparer(
8466		autorest.AsGet(),
8467		autorest.WithBaseURL(client.BaseURI),
8468		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetReplicas", pathParameters),
8469		autorest.WithQueryParameters(queryParameters))
8470	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8471}
8472
8473// GetDeployedServiceReplicaInfoListSender sends the GetDeployedServiceReplicaInfoList request. The method will close the
8474// http.Response Body if it receives an error.
8475func (client BaseClient) GetDeployedServiceReplicaInfoListSender(req *http.Request) (*http.Response, error) {
8476	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8477}
8478
8479// GetDeployedServiceReplicaInfoListResponder handles the response to the GetDeployedServiceReplicaInfoList request. The method always
8480// closes the http.Response Body.
8481func (client BaseClient) GetDeployedServiceReplicaInfoListResponder(resp *http.Response) (result ListDeployedServiceReplicaInfo, err error) {
8482	err = autorest.Respond(
8483		resp,
8484		client.ByInspecting(),
8485		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
8486		autorest.ByUnmarshallingJSON(&result),
8487		autorest.ByClosing())
8488	result.Response = autorest.Response{Response: resp}
8489	return
8490}
8491
8492// GetDeployedServiceTypeInfoByName gets the list containing the information about a specific service type from the
8493// applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its
8494// registration status, the code package that registered it and activation ID of the service package. Each entry
8495// represents one activation of a service type, differentiated by the activation ID.
8496// Parameters:
8497// nodeName - the name of the node.
8498// applicationID - the identity of the application. This is typically the full name of the application without
8499// the 'fabric:' URI scheme.
8500// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8501// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8502// in 6.0+ and "myapp/app1" in previous versions.
8503// serviceTypeName - specifies the name of a Service Fabric service type.
8504// serviceManifestName - the name of the service manifest to filter the list of deployed service type
8505// information. If specified, the response will only contain the information about service types that are
8506// defined in this service manifest.
8507// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8508// duration that the client is willing to wait for the requested operation to complete. The default value for
8509// this parameter is 60 seconds.
8510func (client BaseClient) GetDeployedServiceTypeInfoByName(ctx context.Context, nodeName string, applicationID string, serviceTypeName string, serviceManifestName string, timeout *int64) (result ListDeployedServiceTypeInfo, err error) {
8511	if tracing.IsEnabled() {
8512		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceTypeInfoByName")
8513		defer func() {
8514			sc := -1
8515			if result.Response.Response != nil {
8516				sc = result.Response.Response.StatusCode
8517			}
8518			tracing.EndSpan(ctx, sc, err)
8519		}()
8520	}
8521	if err := validation.Validate([]validation.Validation{
8522		{TargetValue: timeout,
8523			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8524				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8525					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8526				}}}}}); err != nil {
8527		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", err.Error())
8528	}
8529
8530	req, err := client.GetDeployedServiceTypeInfoByNamePreparer(ctx, nodeName, applicationID, serviceTypeName, serviceManifestName, timeout)
8531	if err != nil {
8532		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", nil, "Failure preparing request")
8533		return
8534	}
8535
8536	resp, err := client.GetDeployedServiceTypeInfoByNameSender(req)
8537	if err != nil {
8538		result.Response = autorest.Response{Response: resp}
8539		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", resp, "Failure sending request")
8540		return
8541	}
8542
8543	result, err = client.GetDeployedServiceTypeInfoByNameResponder(resp)
8544	if err != nil {
8545		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", resp, "Failure responding to request")
8546	}
8547
8548	return
8549}
8550
8551// GetDeployedServiceTypeInfoByNamePreparer prepares the GetDeployedServiceTypeInfoByName request.
8552func (client BaseClient) GetDeployedServiceTypeInfoByNamePreparer(ctx context.Context, nodeName string, applicationID string, serviceTypeName string, serviceManifestName string, timeout *int64) (*http.Request, error) {
8553	pathParameters := map[string]interface{}{
8554		"applicationId":   applicationID,
8555		"nodeName":        autorest.Encode("path", nodeName),
8556		"serviceTypeName": serviceTypeName,
8557	}
8558
8559	const APIVersion = "6.0"
8560	queryParameters := map[string]interface{}{
8561		"api-version": APIVersion,
8562	}
8563	if len(serviceManifestName) > 0 {
8564		queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName)
8565	}
8566	if timeout != nil {
8567		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8568	} else {
8569		queryParameters["timeout"] = autorest.Encode("query", 60)
8570	}
8571
8572	preparer := autorest.CreatePreparer(
8573		autorest.AsGet(),
8574		autorest.WithBaseURL(client.BaseURI),
8575		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes/{serviceTypeName}", pathParameters),
8576		autorest.WithQueryParameters(queryParameters))
8577	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8578}
8579
8580// GetDeployedServiceTypeInfoByNameSender sends the GetDeployedServiceTypeInfoByName request. The method will close the
8581// http.Response Body if it receives an error.
8582func (client BaseClient) GetDeployedServiceTypeInfoByNameSender(req *http.Request) (*http.Response, error) {
8583	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8584}
8585
8586// GetDeployedServiceTypeInfoByNameResponder handles the response to the GetDeployedServiceTypeInfoByName request. The method always
8587// closes the http.Response Body.
8588func (client BaseClient) GetDeployedServiceTypeInfoByNameResponder(resp *http.Response) (result ListDeployedServiceTypeInfo, err error) {
8589	err = autorest.Respond(
8590		resp,
8591		client.ByInspecting(),
8592		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
8593		autorest.ByUnmarshallingJSON(&result.Value),
8594		autorest.ByClosing())
8595	result.Response = autorest.Response{Response: resp}
8596	return
8597}
8598
8599// GetDeployedServiceTypeInfoList gets the list containing the information about service types from the applications
8600// deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration
8601// status, the code package that registered it and activation ID of the service package.
8602// Parameters:
8603// nodeName - the name of the node.
8604// applicationID - the identity of the application. This is typically the full name of the application without
8605// the 'fabric:' URI scheme.
8606// Starting from version 6.0, hierarchical names are delimited with the "~" character.
8607// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
8608// in 6.0+ and "myapp/app1" in previous versions.
8609// serviceManifestName - the name of the service manifest to filter the list of deployed service type
8610// information. If specified, the response will only contain the information about service types that are
8611// defined in this service manifest.
8612// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8613// duration that the client is willing to wait for the requested operation to complete. The default value for
8614// this parameter is 60 seconds.
8615func (client BaseClient) GetDeployedServiceTypeInfoList(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, timeout *int64) (result ListDeployedServiceTypeInfo, err error) {
8616	if tracing.IsEnabled() {
8617		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceTypeInfoList")
8618		defer func() {
8619			sc := -1
8620			if result.Response.Response != nil {
8621				sc = result.Response.Response.StatusCode
8622			}
8623			tracing.EndSpan(ctx, sc, err)
8624		}()
8625	}
8626	if err := validation.Validate([]validation.Validation{
8627		{TargetValue: timeout,
8628			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8629				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8630					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8631				}}}}}); err != nil {
8632		return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", err.Error())
8633	}
8634
8635	req, err := client.GetDeployedServiceTypeInfoListPreparer(ctx, nodeName, applicationID, serviceManifestName, timeout)
8636	if err != nil {
8637		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", nil, "Failure preparing request")
8638		return
8639	}
8640
8641	resp, err := client.GetDeployedServiceTypeInfoListSender(req)
8642	if err != nil {
8643		result.Response = autorest.Response{Response: resp}
8644		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", resp, "Failure sending request")
8645		return
8646	}
8647
8648	result, err = client.GetDeployedServiceTypeInfoListResponder(resp)
8649	if err != nil {
8650		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", resp, "Failure responding to request")
8651	}
8652
8653	return
8654}
8655
8656// GetDeployedServiceTypeInfoListPreparer prepares the GetDeployedServiceTypeInfoList request.
8657func (client BaseClient) GetDeployedServiceTypeInfoListPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, timeout *int64) (*http.Request, error) {
8658	pathParameters := map[string]interface{}{
8659		"applicationId": applicationID,
8660		"nodeName":      autorest.Encode("path", nodeName),
8661	}
8662
8663	const APIVersion = "6.0"
8664	queryParameters := map[string]interface{}{
8665		"api-version": APIVersion,
8666	}
8667	if len(serviceManifestName) > 0 {
8668		queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName)
8669	}
8670	if timeout != nil {
8671		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8672	} else {
8673		queryParameters["timeout"] = autorest.Encode("query", 60)
8674	}
8675
8676	preparer := autorest.CreatePreparer(
8677		autorest.AsGet(),
8678		autorest.WithBaseURL(client.BaseURI),
8679		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes", pathParameters),
8680		autorest.WithQueryParameters(queryParameters))
8681	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8682}
8683
8684// GetDeployedServiceTypeInfoListSender sends the GetDeployedServiceTypeInfoList request. The method will close the
8685// http.Response Body if it receives an error.
8686func (client BaseClient) GetDeployedServiceTypeInfoListSender(req *http.Request) (*http.Response, error) {
8687	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8688}
8689
8690// GetDeployedServiceTypeInfoListResponder handles the response to the GetDeployedServiceTypeInfoList request. The method always
8691// closes the http.Response Body.
8692func (client BaseClient) GetDeployedServiceTypeInfoListResponder(resp *http.Response) (result ListDeployedServiceTypeInfo, err error) {
8693	err = autorest.Respond(
8694		resp,
8695		client.ByInspecting(),
8696		azure.WithErrorUnlessStatusCode(http.StatusOK),
8697		autorest.ByUnmarshallingJSON(&result.Value),
8698		autorest.ByClosing())
8699	result.Response = autorest.Response{Response: resp}
8700	return
8701}
8702
8703// GetFaultOperationList gets the a list of user-induced fault operations filtered by provided input.
8704// Parameters:
8705// typeFilter - used to filter on OperationType for user-induced operations.
8706// 65535 - select all
8707// 1     - select PartitionDataLoss.
8708// 2     - select PartitionQuorumLoss.
8709// 4     - select PartitionRestart.
8710// 8     - select NodeTransition.
8711// stateFilter - used to filter on OperationState's for user-induced operations.
8712// 65535 - select All
8713// 1     - select Running
8714// 2     - select RollingBack
8715// 8     - select Completed
8716// 16    - select Faulted
8717// 32    - select Cancelled
8718// 64    - select ForceCancelled
8719// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8720// duration that the client is willing to wait for the requested operation to complete. The default value for
8721// this parameter is 60 seconds.
8722func (client BaseClient) GetFaultOperationList(ctx context.Context, typeFilter int32, stateFilter int32, timeout *int64) (result ListOperationStatus, err error) {
8723	if tracing.IsEnabled() {
8724		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetFaultOperationList")
8725		defer func() {
8726			sc := -1
8727			if result.Response.Response != nil {
8728				sc = result.Response.Response.StatusCode
8729			}
8730			tracing.EndSpan(ctx, sc, err)
8731		}()
8732	}
8733	if err := validation.Validate([]validation.Validation{
8734		{TargetValue: timeout,
8735			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8736				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8737					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8738				}}}}}); err != nil {
8739		return result, validation.NewError("servicefabric.BaseClient", "GetFaultOperationList", err.Error())
8740	}
8741
8742	req, err := client.GetFaultOperationListPreparer(ctx, typeFilter, stateFilter, timeout)
8743	if err != nil {
8744		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", nil, "Failure preparing request")
8745		return
8746	}
8747
8748	resp, err := client.GetFaultOperationListSender(req)
8749	if err != nil {
8750		result.Response = autorest.Response{Response: resp}
8751		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", resp, "Failure sending request")
8752		return
8753	}
8754
8755	result, err = client.GetFaultOperationListResponder(resp)
8756	if err != nil {
8757		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", resp, "Failure responding to request")
8758	}
8759
8760	return
8761}
8762
8763// GetFaultOperationListPreparer prepares the GetFaultOperationList request.
8764func (client BaseClient) GetFaultOperationListPreparer(ctx context.Context, typeFilter int32, stateFilter int32, timeout *int64) (*http.Request, error) {
8765	const APIVersion = "6.0"
8766	queryParameters := map[string]interface{}{
8767		"api-version": APIVersion,
8768		"StateFilter": autorest.Encode("query", stateFilter),
8769		"TypeFilter":  autorest.Encode("query", typeFilter),
8770	}
8771	if timeout != nil {
8772		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8773	} else {
8774		queryParameters["timeout"] = autorest.Encode("query", 60)
8775	}
8776
8777	preparer := autorest.CreatePreparer(
8778		autorest.AsGet(),
8779		autorest.WithBaseURL(client.BaseURI),
8780		autorest.WithPath("/Faults/"),
8781		autorest.WithQueryParameters(queryParameters))
8782	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8783}
8784
8785// GetFaultOperationListSender sends the GetFaultOperationList request. The method will close the
8786// http.Response Body if it receives an error.
8787func (client BaseClient) GetFaultOperationListSender(req *http.Request) (*http.Response, error) {
8788	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8789}
8790
8791// GetFaultOperationListResponder handles the response to the GetFaultOperationList request. The method always
8792// closes the http.Response Body.
8793func (client BaseClient) GetFaultOperationListResponder(resp *http.Response) (result ListOperationStatus, err error) {
8794	err = autorest.Respond(
8795		resp,
8796		client.ByInspecting(),
8797		azure.WithErrorUnlessStatusCode(http.StatusOK),
8798		autorest.ByUnmarshallingJSON(&result.Value),
8799		autorest.ByClosing())
8800	result.Response = autorest.Response{Response: resp}
8801	return
8802}
8803
8804// GetImageStoreContent returns the information about the image store content at the specified contentPath relative to
8805// the root of the image store.
8806// Parameters:
8807// contentPath - relative path to file or folder in the image store from its root.
8808// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8809// duration that the client is willing to wait for the requested operation to complete. The default value for
8810// this parameter is 60 seconds.
8811func (client BaseClient) GetImageStoreContent(ctx context.Context, contentPath string, timeout *int64) (result ImageStoreContent, err error) {
8812	if tracing.IsEnabled() {
8813		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreContent")
8814		defer func() {
8815			sc := -1
8816			if result.Response.Response != nil {
8817				sc = result.Response.Response.StatusCode
8818			}
8819			tracing.EndSpan(ctx, sc, err)
8820		}()
8821	}
8822	if err := validation.Validate([]validation.Validation{
8823		{TargetValue: timeout,
8824			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8825				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8826					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8827				}}}}}); err != nil {
8828		return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreContent", err.Error())
8829	}
8830
8831	req, err := client.GetImageStoreContentPreparer(ctx, contentPath, timeout)
8832	if err != nil {
8833		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", nil, "Failure preparing request")
8834		return
8835	}
8836
8837	resp, err := client.GetImageStoreContentSender(req)
8838	if err != nil {
8839		result.Response = autorest.Response{Response: resp}
8840		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", resp, "Failure sending request")
8841		return
8842	}
8843
8844	result, err = client.GetImageStoreContentResponder(resp)
8845	if err != nil {
8846		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", resp, "Failure responding to request")
8847	}
8848
8849	return
8850}
8851
8852// GetImageStoreContentPreparer prepares the GetImageStoreContent request.
8853func (client BaseClient) GetImageStoreContentPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) {
8854	pathParameters := map[string]interface{}{
8855		"contentPath": autorest.Encode("path", contentPath),
8856	}
8857
8858	const APIVersion = "6.2"
8859	queryParameters := map[string]interface{}{
8860		"api-version": APIVersion,
8861	}
8862	if timeout != nil {
8863		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8864	} else {
8865		queryParameters["timeout"] = autorest.Encode("query", 60)
8866	}
8867
8868	preparer := autorest.CreatePreparer(
8869		autorest.AsGet(),
8870		autorest.WithBaseURL(client.BaseURI),
8871		autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters),
8872		autorest.WithQueryParameters(queryParameters))
8873	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8874}
8875
8876// GetImageStoreContentSender sends the GetImageStoreContent request. The method will close the
8877// http.Response Body if it receives an error.
8878func (client BaseClient) GetImageStoreContentSender(req *http.Request) (*http.Response, error) {
8879	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8880}
8881
8882// GetImageStoreContentResponder handles the response to the GetImageStoreContent request. The method always
8883// closes the http.Response Body.
8884func (client BaseClient) GetImageStoreContentResponder(resp *http.Response) (result ImageStoreContent, err error) {
8885	err = autorest.Respond(
8886		resp,
8887		client.ByInspecting(),
8888		azure.WithErrorUnlessStatusCode(http.StatusOK),
8889		autorest.ByUnmarshallingJSON(&result),
8890		autorest.ByClosing())
8891	result.Response = autorest.Response{Response: resp}
8892	return
8893}
8894
8895// GetImageStoreRootContent returns the information about the image store content at the root of the image store.
8896// Parameters:
8897// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8898// duration that the client is willing to wait for the requested operation to complete. The default value for
8899// this parameter is 60 seconds.
8900func (client BaseClient) GetImageStoreRootContent(ctx context.Context, timeout *int64) (result ImageStoreContent, err error) {
8901	if tracing.IsEnabled() {
8902		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreRootContent")
8903		defer func() {
8904			sc := -1
8905			if result.Response.Response != nil {
8906				sc = result.Response.Response.StatusCode
8907			}
8908			tracing.EndSpan(ctx, sc, err)
8909		}()
8910	}
8911	if err := validation.Validate([]validation.Validation{
8912		{TargetValue: timeout,
8913			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
8914				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
8915					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
8916				}}}}}); err != nil {
8917		return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreRootContent", err.Error())
8918	}
8919
8920	req, err := client.GetImageStoreRootContentPreparer(ctx, timeout)
8921	if err != nil {
8922		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", nil, "Failure preparing request")
8923		return
8924	}
8925
8926	resp, err := client.GetImageStoreRootContentSender(req)
8927	if err != nil {
8928		result.Response = autorest.Response{Response: resp}
8929		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", resp, "Failure sending request")
8930		return
8931	}
8932
8933	result, err = client.GetImageStoreRootContentResponder(resp)
8934	if err != nil {
8935		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", resp, "Failure responding to request")
8936	}
8937
8938	return
8939}
8940
8941// GetImageStoreRootContentPreparer prepares the GetImageStoreRootContent request.
8942func (client BaseClient) GetImageStoreRootContentPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
8943	const APIVersion = "6.0"
8944	queryParameters := map[string]interface{}{
8945		"api-version": APIVersion,
8946	}
8947	if timeout != nil {
8948		queryParameters["timeout"] = autorest.Encode("query", *timeout)
8949	} else {
8950		queryParameters["timeout"] = autorest.Encode("query", 60)
8951	}
8952
8953	preparer := autorest.CreatePreparer(
8954		autorest.AsGet(),
8955		autorest.WithBaseURL(client.BaseURI),
8956		autorest.WithPath("/ImageStore"),
8957		autorest.WithQueryParameters(queryParameters))
8958	return preparer.Prepare((&http.Request{}).WithContext(ctx))
8959}
8960
8961// GetImageStoreRootContentSender sends the GetImageStoreRootContent request. The method will close the
8962// http.Response Body if it receives an error.
8963func (client BaseClient) GetImageStoreRootContentSender(req *http.Request) (*http.Response, error) {
8964	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8965}
8966
8967// GetImageStoreRootContentResponder handles the response to the GetImageStoreRootContent request. The method always
8968// closes the http.Response Body.
8969func (client BaseClient) GetImageStoreRootContentResponder(resp *http.Response) (result ImageStoreContent, err error) {
8970	err = autorest.Respond(
8971		resp,
8972		client.ByInspecting(),
8973		azure.WithErrorUnlessStatusCode(http.StatusOK),
8974		autorest.ByUnmarshallingJSON(&result),
8975		autorest.ByClosing())
8976	result.Response = autorest.Response{Response: resp}
8977	return
8978}
8979
8980// GetImageStoreUploadSessionByID gets the image store upload session identified by the given ID. User can query the
8981// upload session at any time during uploading.
8982// Parameters:
8983// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session
8984// which keeps track of all file chunks until it is committed.
8985// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
8986// duration that the client is willing to wait for the requested operation to complete. The default value for
8987// this parameter is 60 seconds.
8988func (client BaseClient) GetImageStoreUploadSessionByID(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result UploadSession, err error) {
8989	if tracing.IsEnabled() {
8990		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreUploadSessionByID")
8991		defer func() {
8992			sc := -1
8993			if result.Response.Response != nil {
8994				sc = result.Response.Response.StatusCode
8995			}
8996			tracing.EndSpan(ctx, sc, err)
8997		}()
8998	}
8999	if err := validation.Validate([]validation.Validation{
9000		{TargetValue: timeout,
9001			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9002				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9003					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9004				}}}}}); err != nil {
9005		return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreUploadSessionByID", err.Error())
9006	}
9007
9008	req, err := client.GetImageStoreUploadSessionByIDPreparer(ctx, sessionID, timeout)
9009	if err != nil {
9010		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", nil, "Failure preparing request")
9011		return
9012	}
9013
9014	resp, err := client.GetImageStoreUploadSessionByIDSender(req)
9015	if err != nil {
9016		result.Response = autorest.Response{Response: resp}
9017		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", resp, "Failure sending request")
9018		return
9019	}
9020
9021	result, err = client.GetImageStoreUploadSessionByIDResponder(resp)
9022	if err != nil {
9023		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", resp, "Failure responding to request")
9024	}
9025
9026	return
9027}
9028
9029// GetImageStoreUploadSessionByIDPreparer prepares the GetImageStoreUploadSessionByID request.
9030func (client BaseClient) GetImageStoreUploadSessionByIDPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) {
9031	const APIVersion = "6.0"
9032	queryParameters := map[string]interface{}{
9033		"api-version": APIVersion,
9034		"session-id":  autorest.Encode("query", sessionID),
9035	}
9036	if timeout != nil {
9037		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9038	} else {
9039		queryParameters["timeout"] = autorest.Encode("query", 60)
9040	}
9041
9042	preparer := autorest.CreatePreparer(
9043		autorest.AsGet(),
9044		autorest.WithBaseURL(client.BaseURI),
9045		autorest.WithPath("/ImageStore/$/GetUploadSession"),
9046		autorest.WithQueryParameters(queryParameters))
9047	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9048}
9049
9050// GetImageStoreUploadSessionByIDSender sends the GetImageStoreUploadSessionByID request. The method will close the
9051// http.Response Body if it receives an error.
9052func (client BaseClient) GetImageStoreUploadSessionByIDSender(req *http.Request) (*http.Response, error) {
9053	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9054}
9055
9056// GetImageStoreUploadSessionByIDResponder handles the response to the GetImageStoreUploadSessionByID request. The method always
9057// closes the http.Response Body.
9058func (client BaseClient) GetImageStoreUploadSessionByIDResponder(resp *http.Response) (result UploadSession, err error) {
9059	err = autorest.Respond(
9060		resp,
9061		client.ByInspecting(),
9062		azure.WithErrorUnlessStatusCode(http.StatusOK),
9063		autorest.ByUnmarshallingJSON(&result),
9064		autorest.ByClosing())
9065	result.Response = autorest.Response{Response: resp}
9066	return
9067}
9068
9069// GetImageStoreUploadSessionByPath gets the image store upload session associated with the given image store relative
9070// path. User can query the upload session at any time during uploading.
9071// Parameters:
9072// contentPath - relative path to file or folder in the image store from its root.
9073// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9074// duration that the client is willing to wait for the requested operation to complete. The default value for
9075// this parameter is 60 seconds.
9076func (client BaseClient) GetImageStoreUploadSessionByPath(ctx context.Context, contentPath string, timeout *int64) (result UploadSession, err error) {
9077	if tracing.IsEnabled() {
9078		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreUploadSessionByPath")
9079		defer func() {
9080			sc := -1
9081			if result.Response.Response != nil {
9082				sc = result.Response.Response.StatusCode
9083			}
9084			tracing.EndSpan(ctx, sc, err)
9085		}()
9086	}
9087	if err := validation.Validate([]validation.Validation{
9088		{TargetValue: timeout,
9089			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9090				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9091					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9092				}}}}}); err != nil {
9093		return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", err.Error())
9094	}
9095
9096	req, err := client.GetImageStoreUploadSessionByPathPreparer(ctx, contentPath, timeout)
9097	if err != nil {
9098		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", nil, "Failure preparing request")
9099		return
9100	}
9101
9102	resp, err := client.GetImageStoreUploadSessionByPathSender(req)
9103	if err != nil {
9104		result.Response = autorest.Response{Response: resp}
9105		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", resp, "Failure sending request")
9106		return
9107	}
9108
9109	result, err = client.GetImageStoreUploadSessionByPathResponder(resp)
9110	if err != nil {
9111		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", resp, "Failure responding to request")
9112	}
9113
9114	return
9115}
9116
9117// GetImageStoreUploadSessionByPathPreparer prepares the GetImageStoreUploadSessionByPath request.
9118func (client BaseClient) GetImageStoreUploadSessionByPathPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) {
9119	pathParameters := map[string]interface{}{
9120		"contentPath": autorest.Encode("path", contentPath),
9121	}
9122
9123	const APIVersion = "6.0"
9124	queryParameters := map[string]interface{}{
9125		"api-version": APIVersion,
9126	}
9127	if timeout != nil {
9128		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9129	} else {
9130		queryParameters["timeout"] = autorest.Encode("query", 60)
9131	}
9132
9133	preparer := autorest.CreatePreparer(
9134		autorest.AsGet(),
9135		autorest.WithBaseURL(client.BaseURI),
9136		autorest.WithPathParameters("/ImageStore/{contentPath}/$/GetUploadSession", pathParameters),
9137		autorest.WithQueryParameters(queryParameters))
9138	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9139}
9140
9141// GetImageStoreUploadSessionByPathSender sends the GetImageStoreUploadSessionByPath request. The method will close the
9142// http.Response Body if it receives an error.
9143func (client BaseClient) GetImageStoreUploadSessionByPathSender(req *http.Request) (*http.Response, error) {
9144	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9145}
9146
9147// GetImageStoreUploadSessionByPathResponder handles the response to the GetImageStoreUploadSessionByPath request. The method always
9148// closes the http.Response Body.
9149func (client BaseClient) GetImageStoreUploadSessionByPathResponder(resp *http.Response) (result UploadSession, err error) {
9150	err = autorest.Respond(
9151		resp,
9152		client.ByInspecting(),
9153		azure.WithErrorUnlessStatusCode(http.StatusOK),
9154		autorest.ByUnmarshallingJSON(&result),
9155		autorest.ByClosing())
9156	result.Response = autorest.Response{Response: resp}
9157	return
9158}
9159
9160// GetNameExistsInfo returns whether the specified Service Fabric name exists.
9161// Parameters:
9162// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
9163// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9164// duration that the client is willing to wait for the requested operation to complete. The default value for
9165// this parameter is 60 seconds.
9166func (client BaseClient) GetNameExistsInfo(ctx context.Context, nameID string, timeout *int64) (result autorest.Response, err error) {
9167	if tracing.IsEnabled() {
9168		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNameExistsInfo")
9169		defer func() {
9170			sc := -1
9171			if result.Response != nil {
9172				sc = result.Response.StatusCode
9173			}
9174			tracing.EndSpan(ctx, sc, err)
9175		}()
9176	}
9177	if err := validation.Validate([]validation.Validation{
9178		{TargetValue: timeout,
9179			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9180				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9181					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9182				}}}}}); err != nil {
9183		return result, validation.NewError("servicefabric.BaseClient", "GetNameExistsInfo", err.Error())
9184	}
9185
9186	req, err := client.GetNameExistsInfoPreparer(ctx, nameID, timeout)
9187	if err != nil {
9188		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", nil, "Failure preparing request")
9189		return
9190	}
9191
9192	resp, err := client.GetNameExistsInfoSender(req)
9193	if err != nil {
9194		result.Response = resp
9195		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", resp, "Failure sending request")
9196		return
9197	}
9198
9199	result, err = client.GetNameExistsInfoResponder(resp)
9200	if err != nil {
9201		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", resp, "Failure responding to request")
9202	}
9203
9204	return
9205}
9206
9207// GetNameExistsInfoPreparer prepares the GetNameExistsInfo request.
9208func (client BaseClient) GetNameExistsInfoPreparer(ctx context.Context, nameID string, timeout *int64) (*http.Request, error) {
9209	pathParameters := map[string]interface{}{
9210		"nameId": nameID,
9211	}
9212
9213	const APIVersion = "6.0"
9214	queryParameters := map[string]interface{}{
9215		"api-version": APIVersion,
9216	}
9217	if timeout != nil {
9218		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9219	} else {
9220		queryParameters["timeout"] = autorest.Encode("query", 60)
9221	}
9222
9223	preparer := autorest.CreatePreparer(
9224		autorest.AsGet(),
9225		autorest.WithBaseURL(client.BaseURI),
9226		autorest.WithPathParameters("/Names/{nameId}", pathParameters),
9227		autorest.WithQueryParameters(queryParameters))
9228	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9229}
9230
9231// GetNameExistsInfoSender sends the GetNameExistsInfo request. The method will close the
9232// http.Response Body if it receives an error.
9233func (client BaseClient) GetNameExistsInfoSender(req *http.Request) (*http.Response, error) {
9234	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9235}
9236
9237// GetNameExistsInfoResponder handles the response to the GetNameExistsInfo request. The method always
9238// closes the http.Response Body.
9239func (client BaseClient) GetNameExistsInfoResponder(resp *http.Response) (result autorest.Response, err error) {
9240	err = autorest.Respond(
9241		resp,
9242		client.ByInspecting(),
9243		azure.WithErrorUnlessStatusCode(http.StatusOK),
9244		autorest.ByClosing())
9245	result.Response = resp
9246	return
9247}
9248
9249// GetNodeEventList the response is list of NodeEvent objects.
9250// Parameters:
9251// nodeName - the name of the node.
9252// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
9253// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
9254// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9255// duration that the client is willing to wait for the requested operation to complete. The default value for
9256// this parameter is 60 seconds.
9257// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
9258// be included in the response.
9259// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
9260// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
9261// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
9262// populated.
9263func (client BaseClient) GetNodeEventList(ctx context.Context, nodeName string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListNodeEvent, err error) {
9264	if tracing.IsEnabled() {
9265		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeEventList")
9266		defer func() {
9267			sc := -1
9268			if result.Response.Response != nil {
9269				sc = result.Response.Response.StatusCode
9270			}
9271			tracing.EndSpan(ctx, sc, err)
9272		}()
9273	}
9274	if err := validation.Validate([]validation.Validation{
9275		{TargetValue: timeout,
9276			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9277				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9278					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9279				}}}}}); err != nil {
9280		return result, validation.NewError("servicefabric.BaseClient", "GetNodeEventList", err.Error())
9281	}
9282
9283	req, err := client.GetNodeEventListPreparer(ctx, nodeName, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
9284	if err != nil {
9285		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", nil, "Failure preparing request")
9286		return
9287	}
9288
9289	resp, err := client.GetNodeEventListSender(req)
9290	if err != nil {
9291		result.Response = autorest.Response{Response: resp}
9292		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", resp, "Failure sending request")
9293		return
9294	}
9295
9296	result, err = client.GetNodeEventListResponder(resp)
9297	if err != nil {
9298		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", resp, "Failure responding to request")
9299	}
9300
9301	return
9302}
9303
9304// GetNodeEventListPreparer prepares the GetNodeEventList request.
9305func (client BaseClient) GetNodeEventListPreparer(ctx context.Context, nodeName string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
9306	pathParameters := map[string]interface{}{
9307		"nodeName": autorest.Encode("path", nodeName),
9308	}
9309
9310	const APIVersion = "6.2-preview"
9311	queryParameters := map[string]interface{}{
9312		"api-version":  APIVersion,
9313		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
9314		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
9315	}
9316	if timeout != nil {
9317		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9318	} else {
9319		queryParameters["timeout"] = autorest.Encode("query", 60)
9320	}
9321	if len(eventsTypesFilter) > 0 {
9322		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
9323	}
9324	if excludeAnalysisEvents != nil {
9325		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
9326	}
9327	if skipCorrelationLookup != nil {
9328		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
9329	}
9330
9331	preparer := autorest.CreatePreparer(
9332		autorest.AsGet(),
9333		autorest.WithBaseURL(client.BaseURI),
9334		autorest.WithPathParameters("/EventsStore/Nodes/{nodeName}/$/Events", pathParameters),
9335		autorest.WithQueryParameters(queryParameters))
9336	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9337}
9338
9339// GetNodeEventListSender sends the GetNodeEventList request. The method will close the
9340// http.Response Body if it receives an error.
9341func (client BaseClient) GetNodeEventListSender(req *http.Request) (*http.Response, error) {
9342	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9343}
9344
9345// GetNodeEventListResponder handles the response to the GetNodeEventList request. The method always
9346// closes the http.Response Body.
9347func (client BaseClient) GetNodeEventListResponder(resp *http.Response) (result ListNodeEvent, err error) {
9348	err = autorest.Respond(
9349		resp,
9350		client.ByInspecting(),
9351		azure.WithErrorUnlessStatusCode(http.StatusOK),
9352		autorest.ByUnmarshallingJSON(&result),
9353		autorest.ByClosing())
9354	result.Response = autorest.Response{Response: resp}
9355	return
9356}
9357
9358// GetNodeHealth gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of
9359// health events reported on the node based on the health state. If the node that you specify by name does not exist in
9360// the health store, this returns an error.
9361// Parameters:
9362// nodeName - the name of the node.
9363// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
9364// state.
9365// The possible values for this parameter include integer value of one of the following health states.
9366// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
9367// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
9368// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
9369// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
9370//
9371// - Default - Default value. Matches any HealthState. The value is zero.
9372// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
9373// collection of states. The value is 1.
9374// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
9375// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
9376// - Error - Filter that matches input with HealthState value Error. The value is 8.
9377// - All - Filter that matches input with any HealthState value. The value is 65535.
9378// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9379// duration that the client is willing to wait for the requested operation to complete. The default value for
9380// this parameter is 60 seconds.
9381func (client BaseClient) GetNodeHealth(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, timeout *int64) (result NodeHealth, err error) {
9382	if tracing.IsEnabled() {
9383		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeHealth")
9384		defer func() {
9385			sc := -1
9386			if result.Response.Response != nil {
9387				sc = result.Response.Response.StatusCode
9388			}
9389			tracing.EndSpan(ctx, sc, err)
9390		}()
9391	}
9392	if err := validation.Validate([]validation.Validation{
9393		{TargetValue: timeout,
9394			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9395				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9396					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9397				}}}}}); err != nil {
9398		return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealth", err.Error())
9399	}
9400
9401	req, err := client.GetNodeHealthPreparer(ctx, nodeName, eventsHealthStateFilter, timeout)
9402	if err != nil {
9403		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", nil, "Failure preparing request")
9404		return
9405	}
9406
9407	resp, err := client.GetNodeHealthSender(req)
9408	if err != nil {
9409		result.Response = autorest.Response{Response: resp}
9410		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", resp, "Failure sending request")
9411		return
9412	}
9413
9414	result, err = client.GetNodeHealthResponder(resp)
9415	if err != nil {
9416		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", resp, "Failure responding to request")
9417	}
9418
9419	return
9420}
9421
9422// GetNodeHealthPreparer prepares the GetNodeHealth request.
9423func (client BaseClient) GetNodeHealthPreparer(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) {
9424	pathParameters := map[string]interface{}{
9425		"nodeName": autorest.Encode("path", nodeName),
9426	}
9427
9428	const APIVersion = "6.0"
9429	queryParameters := map[string]interface{}{
9430		"api-version": APIVersion,
9431	}
9432	if eventsHealthStateFilter != nil {
9433		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
9434	} else {
9435		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
9436	}
9437	if timeout != nil {
9438		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9439	} else {
9440		queryParameters["timeout"] = autorest.Encode("query", 60)
9441	}
9442
9443	preparer := autorest.CreatePreparer(
9444		autorest.AsGet(),
9445		autorest.WithBaseURL(client.BaseURI),
9446		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetHealth", pathParameters),
9447		autorest.WithQueryParameters(queryParameters))
9448	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9449}
9450
9451// GetNodeHealthSender sends the GetNodeHealth request. The method will close the
9452// http.Response Body if it receives an error.
9453func (client BaseClient) GetNodeHealthSender(req *http.Request) (*http.Response, error) {
9454	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9455}
9456
9457// GetNodeHealthResponder handles the response to the GetNodeHealth request. The method always
9458// closes the http.Response Body.
9459func (client BaseClient) GetNodeHealthResponder(resp *http.Response) (result NodeHealth, err error) {
9460	err = autorest.Respond(
9461		resp,
9462		client.ByInspecting(),
9463		azure.WithErrorUnlessStatusCode(http.StatusOK),
9464		autorest.ByUnmarshallingJSON(&result),
9465		autorest.ByClosing())
9466	result.Response = autorest.Response{Response: resp}
9467	return
9468}
9469
9470// GetNodeHealthUsingPolicy gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the
9471// collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body
9472// to override the health policies used to evaluate the health. If the node that you specify by name does not exist in
9473// the health store, this returns an error.
9474// Parameters:
9475// nodeName - the name of the node.
9476// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
9477// state.
9478// The possible values for this parameter include integer value of one of the following health states.
9479// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
9480// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
9481// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
9482// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
9483//
9484// - Default - Default value. Matches any HealthState. The value is zero.
9485// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
9486// collection of states. The value is 1.
9487// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
9488// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
9489// - Error - Filter that matches input with HealthState value Error. The value is 8.
9490// - All - Filter that matches input with any HealthState value. The value is 65535.
9491// clusterHealthPolicy - describes the health policies used to evaluate the health of a cluster or node. If not
9492// present, the health evaluation uses the health policy from cluster manifest or the default health policy.
9493// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9494// duration that the client is willing to wait for the requested operation to complete. The default value for
9495// this parameter is 60 seconds.
9496func (client BaseClient) GetNodeHealthUsingPolicy(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, clusterHealthPolicy *ClusterHealthPolicy, timeout *int64) (result NodeHealth, err error) {
9497	if tracing.IsEnabled() {
9498		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeHealthUsingPolicy")
9499		defer func() {
9500			sc := -1
9501			if result.Response.Response != nil {
9502				sc = result.Response.Response.StatusCode
9503			}
9504			tracing.EndSpan(ctx, sc, err)
9505		}()
9506	}
9507	if err := validation.Validate([]validation.Validation{
9508		{TargetValue: timeout,
9509			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9510				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9511					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9512				}}}}}); err != nil {
9513		return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealthUsingPolicy", err.Error())
9514	}
9515
9516	req, err := client.GetNodeHealthUsingPolicyPreparer(ctx, nodeName, eventsHealthStateFilter, clusterHealthPolicy, timeout)
9517	if err != nil {
9518		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", nil, "Failure preparing request")
9519		return
9520	}
9521
9522	resp, err := client.GetNodeHealthUsingPolicySender(req)
9523	if err != nil {
9524		result.Response = autorest.Response{Response: resp}
9525		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", resp, "Failure sending request")
9526		return
9527	}
9528
9529	result, err = client.GetNodeHealthUsingPolicyResponder(resp)
9530	if err != nil {
9531		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", resp, "Failure responding to request")
9532	}
9533
9534	return
9535}
9536
9537// GetNodeHealthUsingPolicyPreparer prepares the GetNodeHealthUsingPolicy request.
9538func (client BaseClient) GetNodeHealthUsingPolicyPreparer(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, clusterHealthPolicy *ClusterHealthPolicy, timeout *int64) (*http.Request, error) {
9539	pathParameters := map[string]interface{}{
9540		"nodeName": autorest.Encode("path", nodeName),
9541	}
9542
9543	const APIVersion = "6.0"
9544	queryParameters := map[string]interface{}{
9545		"api-version": APIVersion,
9546	}
9547	if eventsHealthStateFilter != nil {
9548		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
9549	} else {
9550		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
9551	}
9552	if timeout != nil {
9553		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9554	} else {
9555		queryParameters["timeout"] = autorest.Encode("query", 60)
9556	}
9557
9558	preparer := autorest.CreatePreparer(
9559		autorest.AsContentType("application/json; charset=utf-8"),
9560		autorest.AsPost(),
9561		autorest.WithBaseURL(client.BaseURI),
9562		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetHealth", pathParameters),
9563		autorest.WithQueryParameters(queryParameters))
9564	if clusterHealthPolicy != nil {
9565		preparer = autorest.DecoratePreparer(preparer,
9566			autorest.WithJSON(clusterHealthPolicy))
9567	}
9568	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9569}
9570
9571// GetNodeHealthUsingPolicySender sends the GetNodeHealthUsingPolicy request. The method will close the
9572// http.Response Body if it receives an error.
9573func (client BaseClient) GetNodeHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
9574	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9575}
9576
9577// GetNodeHealthUsingPolicyResponder handles the response to the GetNodeHealthUsingPolicy request. The method always
9578// closes the http.Response Body.
9579func (client BaseClient) GetNodeHealthUsingPolicyResponder(resp *http.Response) (result NodeHealth, err error) {
9580	err = autorest.Respond(
9581		resp,
9582		client.ByInspecting(),
9583		azure.WithErrorUnlessStatusCode(http.StatusOK),
9584		autorest.ByUnmarshallingJSON(&result),
9585		autorest.ByClosing())
9586	result.Response = autorest.Response{Response: resp}
9587	return
9588}
9589
9590// GetNodeInfo gets the information about a specific node in the Service Fabric Cluster. The response includes the
9591// name, status, id, health, uptime, and other details about the node.
9592// Parameters:
9593// nodeName - the name of the node.
9594// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9595// duration that the client is willing to wait for the requested operation to complete. The default value for
9596// this parameter is 60 seconds.
9597func (client BaseClient) GetNodeInfo(ctx context.Context, nodeName string, timeout *int64) (result NodeInfo, err error) {
9598	if tracing.IsEnabled() {
9599		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeInfo")
9600		defer func() {
9601			sc := -1
9602			if result.Response.Response != nil {
9603				sc = result.Response.Response.StatusCode
9604			}
9605			tracing.EndSpan(ctx, sc, err)
9606		}()
9607	}
9608	if err := validation.Validate([]validation.Validation{
9609		{TargetValue: timeout,
9610			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9611				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9612					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9613				}}}}}); err != nil {
9614		return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfo", err.Error())
9615	}
9616
9617	req, err := client.GetNodeInfoPreparer(ctx, nodeName, timeout)
9618	if err != nil {
9619		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", nil, "Failure preparing request")
9620		return
9621	}
9622
9623	resp, err := client.GetNodeInfoSender(req)
9624	if err != nil {
9625		result.Response = autorest.Response{Response: resp}
9626		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", resp, "Failure sending request")
9627		return
9628	}
9629
9630	result, err = client.GetNodeInfoResponder(resp)
9631	if err != nil {
9632		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", resp, "Failure responding to request")
9633	}
9634
9635	return
9636}
9637
9638// GetNodeInfoPreparer prepares the GetNodeInfo request.
9639func (client BaseClient) GetNodeInfoPreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) {
9640	pathParameters := map[string]interface{}{
9641		"nodeName": autorest.Encode("path", nodeName),
9642	}
9643
9644	const APIVersion = "6.0"
9645	queryParameters := map[string]interface{}{
9646		"api-version": APIVersion,
9647	}
9648	if timeout != nil {
9649		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9650	} else {
9651		queryParameters["timeout"] = autorest.Encode("query", 60)
9652	}
9653
9654	preparer := autorest.CreatePreparer(
9655		autorest.AsGet(),
9656		autorest.WithBaseURL(client.BaseURI),
9657		autorest.WithPathParameters("/Nodes/{nodeName}", pathParameters),
9658		autorest.WithQueryParameters(queryParameters))
9659	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9660}
9661
9662// GetNodeInfoSender sends the GetNodeInfo request. The method will close the
9663// http.Response Body if it receives an error.
9664func (client BaseClient) GetNodeInfoSender(req *http.Request) (*http.Response, error) {
9665	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9666}
9667
9668// GetNodeInfoResponder handles the response to the GetNodeInfo request. The method always
9669// closes the http.Response Body.
9670func (client BaseClient) GetNodeInfoResponder(resp *http.Response) (result NodeInfo, err error) {
9671	err = autorest.Respond(
9672		resp,
9673		client.ByInspecting(),
9674		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
9675		autorest.ByUnmarshallingJSON(&result),
9676		autorest.ByClosing())
9677	result.Response = autorest.Response{Response: resp}
9678	return
9679}
9680
9681// GetNodeInfoList gets the list of nodes in the Service Fabric cluster. The response includes the name, status, id,
9682// health, uptime, and other details about the node.
9683// Parameters:
9684// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
9685// token with a non empty value is included in the response of the API when the results from the system do not
9686// fit in a single response. When this value is passed to the next API call, the API returns next set of
9687// results. If there are no further results then the continuation token does not contain a value. The value of
9688// this parameter should not be URL encoded.
9689// nodeStatusFilter - allows filtering the nodes based on the NodeStatus. Only the nodes that are matching the
9690// specified filter value will be returned. The filter value can be one of the following.
9691// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9692// duration that the client is willing to wait for the requested operation to complete. The default value for
9693// this parameter is 60 seconds.
9694func (client BaseClient) GetNodeInfoList(ctx context.Context, continuationToken string, nodeStatusFilter NodeStatusFilter, timeout *int64) (result PagedNodeInfoList, err error) {
9695	if tracing.IsEnabled() {
9696		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeInfoList")
9697		defer func() {
9698			sc := -1
9699			if result.Response.Response != nil {
9700				sc = result.Response.Response.StatusCode
9701			}
9702			tracing.EndSpan(ctx, sc, err)
9703		}()
9704	}
9705	if err := validation.Validate([]validation.Validation{
9706		{TargetValue: timeout,
9707			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9708				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9709					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9710				}}}}}); err != nil {
9711		return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfoList", err.Error())
9712	}
9713
9714	req, err := client.GetNodeInfoListPreparer(ctx, continuationToken, nodeStatusFilter, timeout)
9715	if err != nil {
9716		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", nil, "Failure preparing request")
9717		return
9718	}
9719
9720	resp, err := client.GetNodeInfoListSender(req)
9721	if err != nil {
9722		result.Response = autorest.Response{Response: resp}
9723		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", resp, "Failure sending request")
9724		return
9725	}
9726
9727	result, err = client.GetNodeInfoListResponder(resp)
9728	if err != nil {
9729		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", resp, "Failure responding to request")
9730	}
9731
9732	return
9733}
9734
9735// GetNodeInfoListPreparer prepares the GetNodeInfoList request.
9736func (client BaseClient) GetNodeInfoListPreparer(ctx context.Context, continuationToken string, nodeStatusFilter NodeStatusFilter, timeout *int64) (*http.Request, error) {
9737	const APIVersion = "6.0"
9738	queryParameters := map[string]interface{}{
9739		"api-version": APIVersion,
9740	}
9741	if len(continuationToken) > 0 {
9742		queryParameters["ContinuationToken"] = continuationToken
9743	}
9744	if len(string(nodeStatusFilter)) > 0 {
9745		queryParameters["NodeStatusFilter"] = autorest.Encode("query", nodeStatusFilter)
9746	} else {
9747		queryParameters["NodeStatusFilter"] = autorest.Encode("query", "default")
9748	}
9749	if timeout != nil {
9750		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9751	} else {
9752		queryParameters["timeout"] = autorest.Encode("query", 60)
9753	}
9754
9755	preparer := autorest.CreatePreparer(
9756		autorest.AsGet(),
9757		autorest.WithBaseURL(client.BaseURI),
9758		autorest.WithPath("/Nodes"),
9759		autorest.WithQueryParameters(queryParameters))
9760	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9761}
9762
9763// GetNodeInfoListSender sends the GetNodeInfoList request. The method will close the
9764// http.Response Body if it receives an error.
9765func (client BaseClient) GetNodeInfoListSender(req *http.Request) (*http.Response, error) {
9766	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9767}
9768
9769// GetNodeInfoListResponder handles the response to the GetNodeInfoList request. The method always
9770// closes the http.Response Body.
9771func (client BaseClient) GetNodeInfoListResponder(resp *http.Response) (result PagedNodeInfoList, err error) {
9772	err = autorest.Respond(
9773		resp,
9774		client.ByInspecting(),
9775		azure.WithErrorUnlessStatusCode(http.StatusOK),
9776		autorest.ByUnmarshallingJSON(&result),
9777		autorest.ByClosing())
9778	result.Response = autorest.Response{Response: resp}
9779	return
9780}
9781
9782// GetNodeLoadInfo retrieves the load information of a Service Fabric node for all the metrics that have load or
9783// capacity defined.
9784// Parameters:
9785// nodeName - the name of the node.
9786// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9787// duration that the client is willing to wait for the requested operation to complete. The default value for
9788// this parameter is 60 seconds.
9789func (client BaseClient) GetNodeLoadInfo(ctx context.Context, nodeName string, timeout *int64) (result NodeLoadInfo, err error) {
9790	if tracing.IsEnabled() {
9791		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeLoadInfo")
9792		defer func() {
9793			sc := -1
9794			if result.Response.Response != nil {
9795				sc = result.Response.Response.StatusCode
9796			}
9797			tracing.EndSpan(ctx, sc, err)
9798		}()
9799	}
9800	if err := validation.Validate([]validation.Validation{
9801		{TargetValue: timeout,
9802			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9803				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9804					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9805				}}}}}); err != nil {
9806		return result, validation.NewError("servicefabric.BaseClient", "GetNodeLoadInfo", err.Error())
9807	}
9808
9809	req, err := client.GetNodeLoadInfoPreparer(ctx, nodeName, timeout)
9810	if err != nil {
9811		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", nil, "Failure preparing request")
9812		return
9813	}
9814
9815	resp, err := client.GetNodeLoadInfoSender(req)
9816	if err != nil {
9817		result.Response = autorest.Response{Response: resp}
9818		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", resp, "Failure sending request")
9819		return
9820	}
9821
9822	result, err = client.GetNodeLoadInfoResponder(resp)
9823	if err != nil {
9824		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", resp, "Failure responding to request")
9825	}
9826
9827	return
9828}
9829
9830// GetNodeLoadInfoPreparer prepares the GetNodeLoadInfo request.
9831func (client BaseClient) GetNodeLoadInfoPreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) {
9832	pathParameters := map[string]interface{}{
9833		"nodeName": autorest.Encode("path", nodeName),
9834	}
9835
9836	const APIVersion = "6.0"
9837	queryParameters := map[string]interface{}{
9838		"api-version": APIVersion,
9839	}
9840	if timeout != nil {
9841		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9842	} else {
9843		queryParameters["timeout"] = autorest.Encode("query", 60)
9844	}
9845
9846	preparer := autorest.CreatePreparer(
9847		autorest.AsGet(),
9848		autorest.WithBaseURL(client.BaseURI),
9849		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetLoadInformation", pathParameters),
9850		autorest.WithQueryParameters(queryParameters))
9851	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9852}
9853
9854// GetNodeLoadInfoSender sends the GetNodeLoadInfo request. The method will close the
9855// http.Response Body if it receives an error.
9856func (client BaseClient) GetNodeLoadInfoSender(req *http.Request) (*http.Response, error) {
9857	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9858}
9859
9860// GetNodeLoadInfoResponder handles the response to the GetNodeLoadInfo request. The method always
9861// closes the http.Response Body.
9862func (client BaseClient) GetNodeLoadInfoResponder(resp *http.Response) (result NodeLoadInfo, err error) {
9863	err = autorest.Respond(
9864		resp,
9865		client.ByInspecting(),
9866		azure.WithErrorUnlessStatusCode(http.StatusOK),
9867		autorest.ByUnmarshallingJSON(&result),
9868		autorest.ByClosing())
9869	result.Response = autorest.Response{Response: resp}
9870	return
9871}
9872
9873// GetNodesEventList the response is list of NodeEvent objects.
9874// Parameters:
9875// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
9876// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
9877// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9878// duration that the client is willing to wait for the requested operation to complete. The default value for
9879// this parameter is 60 seconds.
9880// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
9881// be included in the response.
9882// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
9883// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
9884// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
9885// populated.
9886func (client BaseClient) GetNodesEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListNodeEvent, err error) {
9887	if tracing.IsEnabled() {
9888		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodesEventList")
9889		defer func() {
9890			sc := -1
9891			if result.Response.Response != nil {
9892				sc = result.Response.Response.StatusCode
9893			}
9894			tracing.EndSpan(ctx, sc, err)
9895		}()
9896	}
9897	if err := validation.Validate([]validation.Validation{
9898		{TargetValue: timeout,
9899			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
9900				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
9901					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
9902				}}}}}); err != nil {
9903		return result, validation.NewError("servicefabric.BaseClient", "GetNodesEventList", err.Error())
9904	}
9905
9906	req, err := client.GetNodesEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
9907	if err != nil {
9908		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", nil, "Failure preparing request")
9909		return
9910	}
9911
9912	resp, err := client.GetNodesEventListSender(req)
9913	if err != nil {
9914		result.Response = autorest.Response{Response: resp}
9915		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", resp, "Failure sending request")
9916		return
9917	}
9918
9919	result, err = client.GetNodesEventListResponder(resp)
9920	if err != nil {
9921		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", resp, "Failure responding to request")
9922	}
9923
9924	return
9925}
9926
9927// GetNodesEventListPreparer prepares the GetNodesEventList request.
9928func (client BaseClient) GetNodesEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
9929	const APIVersion = "6.2-preview"
9930	queryParameters := map[string]interface{}{
9931		"api-version":  APIVersion,
9932		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
9933		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
9934	}
9935	if timeout != nil {
9936		queryParameters["timeout"] = autorest.Encode("query", *timeout)
9937	} else {
9938		queryParameters["timeout"] = autorest.Encode("query", 60)
9939	}
9940	if len(eventsTypesFilter) > 0 {
9941		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
9942	}
9943	if excludeAnalysisEvents != nil {
9944		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
9945	}
9946	if skipCorrelationLookup != nil {
9947		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
9948	}
9949
9950	preparer := autorest.CreatePreparer(
9951		autorest.AsGet(),
9952		autorest.WithBaseURL(client.BaseURI),
9953		autorest.WithPath("/EventsStore/Nodes/Events"),
9954		autorest.WithQueryParameters(queryParameters))
9955	return preparer.Prepare((&http.Request{}).WithContext(ctx))
9956}
9957
9958// GetNodesEventListSender sends the GetNodesEventList request. The method will close the
9959// http.Response Body if it receives an error.
9960func (client BaseClient) GetNodesEventListSender(req *http.Request) (*http.Response, error) {
9961	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9962}
9963
9964// GetNodesEventListResponder handles the response to the GetNodesEventList request. The method always
9965// closes the http.Response Body.
9966func (client BaseClient) GetNodesEventListResponder(resp *http.Response) (result ListNodeEvent, err error) {
9967	err = autorest.Respond(
9968		resp,
9969		client.ByInspecting(),
9970		azure.WithErrorUnlessStatusCode(http.StatusOK),
9971		autorest.ByUnmarshallingJSON(&result),
9972		autorest.ByClosing())
9973	result.Response = autorest.Response{Response: resp}
9974	return
9975}
9976
9977// GetNodeTransitionProgress gets the progress of an operation started with StartNodeTransition using the provided
9978// OperationId.
9979// Parameters:
9980// nodeName - the name of the node.
9981// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
9982// API
9983// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
9984// duration that the client is willing to wait for the requested operation to complete. The default value for
9985// this parameter is 60 seconds.
9986func (client BaseClient) GetNodeTransitionProgress(ctx context.Context, nodeName string, operationID uuid.UUID, timeout *int64) (result NodeTransitionProgress, err error) {
9987	if tracing.IsEnabled() {
9988		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeTransitionProgress")
9989		defer func() {
9990			sc := -1
9991			if result.Response.Response != nil {
9992				sc = result.Response.Response.StatusCode
9993			}
9994			tracing.EndSpan(ctx, sc, err)
9995		}()
9996	}
9997	if err := validation.Validate([]validation.Validation{
9998		{TargetValue: timeout,
9999			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10000				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10001					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10002				}}}}}); err != nil {
10003		return result, validation.NewError("servicefabric.BaseClient", "GetNodeTransitionProgress", err.Error())
10004	}
10005
10006	req, err := client.GetNodeTransitionProgressPreparer(ctx, nodeName, operationID, timeout)
10007	if err != nil {
10008		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", nil, "Failure preparing request")
10009		return
10010	}
10011
10012	resp, err := client.GetNodeTransitionProgressSender(req)
10013	if err != nil {
10014		result.Response = autorest.Response{Response: resp}
10015		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", resp, "Failure sending request")
10016		return
10017	}
10018
10019	result, err = client.GetNodeTransitionProgressResponder(resp)
10020	if err != nil {
10021		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", resp, "Failure responding to request")
10022	}
10023
10024	return
10025}
10026
10027// GetNodeTransitionProgressPreparer prepares the GetNodeTransitionProgress request.
10028func (client BaseClient) GetNodeTransitionProgressPreparer(ctx context.Context, nodeName string, operationID uuid.UUID, timeout *int64) (*http.Request, error) {
10029	pathParameters := map[string]interface{}{
10030		"nodeName": autorest.Encode("path", nodeName),
10031	}
10032
10033	const APIVersion = "6.0"
10034	queryParameters := map[string]interface{}{
10035		"api-version": APIVersion,
10036		"OperationId": autorest.Encode("query", operationID),
10037	}
10038	if timeout != nil {
10039		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10040	} else {
10041		queryParameters["timeout"] = autorest.Encode("query", 60)
10042	}
10043
10044	preparer := autorest.CreatePreparer(
10045		autorest.AsGet(),
10046		autorest.WithBaseURL(client.BaseURI),
10047		autorest.WithPathParameters("/Faults/Nodes/{nodeName}/$/GetTransitionProgress", pathParameters),
10048		autorest.WithQueryParameters(queryParameters))
10049	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10050}
10051
10052// GetNodeTransitionProgressSender sends the GetNodeTransitionProgress request. The method will close the
10053// http.Response Body if it receives an error.
10054func (client BaseClient) GetNodeTransitionProgressSender(req *http.Request) (*http.Response, error) {
10055	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10056}
10057
10058// GetNodeTransitionProgressResponder handles the response to the GetNodeTransitionProgress request. The method always
10059// closes the http.Response Body.
10060func (client BaseClient) GetNodeTransitionProgressResponder(resp *http.Response) (result NodeTransitionProgress, err error) {
10061	err = autorest.Respond(
10062		resp,
10063		client.ByInspecting(),
10064		azure.WithErrorUnlessStatusCode(http.StatusOK),
10065		autorest.ByUnmarshallingJSON(&result),
10066		autorest.ByClosing())
10067	result.Response = autorest.Response{Response: resp}
10068	return
10069}
10070
10071// GetPartitionBackupConfigurationInfo gets the Service Fabric Backup configuration information for the specified
10072// partition.
10073// Parameters:
10074// partitionID - the identity of the partition.
10075// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10076// duration that the client is willing to wait for the requested operation to complete. The default value for
10077// this parameter is 60 seconds.
10078func (client BaseClient) GetPartitionBackupConfigurationInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result PartitionBackupConfigurationInfo, err error) {
10079	if tracing.IsEnabled() {
10080		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupConfigurationInfo")
10081		defer func() {
10082			sc := -1
10083			if result.Response.Response != nil {
10084				sc = result.Response.Response.StatusCode
10085			}
10086			tracing.EndSpan(ctx, sc, err)
10087		}()
10088	}
10089	if err := validation.Validate([]validation.Validation{
10090		{TargetValue: timeout,
10091			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10092				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10093					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10094				}}}}}); err != nil {
10095		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", err.Error())
10096	}
10097
10098	req, err := client.GetPartitionBackupConfigurationInfoPreparer(ctx, partitionID, timeout)
10099	if err != nil {
10100		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", nil, "Failure preparing request")
10101		return
10102	}
10103
10104	resp, err := client.GetPartitionBackupConfigurationInfoSender(req)
10105	if err != nil {
10106		result.Response = autorest.Response{Response: resp}
10107		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", resp, "Failure sending request")
10108		return
10109	}
10110
10111	result, err = client.GetPartitionBackupConfigurationInfoResponder(resp)
10112	if err != nil {
10113		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", resp, "Failure responding to request")
10114	}
10115
10116	return
10117}
10118
10119// GetPartitionBackupConfigurationInfoPreparer prepares the GetPartitionBackupConfigurationInfo request.
10120func (client BaseClient) GetPartitionBackupConfigurationInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
10121	pathParameters := map[string]interface{}{
10122		"partitionId": partitionID,
10123	}
10124
10125	const APIVersion = "6.2-preview"
10126	queryParameters := map[string]interface{}{
10127		"api-version": APIVersion,
10128	}
10129	if timeout != nil {
10130		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10131	} else {
10132		queryParameters["timeout"] = autorest.Encode("query", 60)
10133	}
10134
10135	preparer := autorest.CreatePreparer(
10136		autorest.AsGet(),
10137		autorest.WithBaseURL(client.BaseURI),
10138		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackupConfigurationInfo", pathParameters),
10139		autorest.WithQueryParameters(queryParameters))
10140	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10141}
10142
10143// GetPartitionBackupConfigurationInfoSender sends the GetPartitionBackupConfigurationInfo request. The method will close the
10144// http.Response Body if it receives an error.
10145func (client BaseClient) GetPartitionBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) {
10146	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10147}
10148
10149// GetPartitionBackupConfigurationInfoResponder handles the response to the GetPartitionBackupConfigurationInfo request. The method always
10150// closes the http.Response Body.
10151func (client BaseClient) GetPartitionBackupConfigurationInfoResponder(resp *http.Response) (result PartitionBackupConfigurationInfo, err error) {
10152	err = autorest.Respond(
10153		resp,
10154		client.ByInspecting(),
10155		azure.WithErrorUnlessStatusCode(http.StatusOK),
10156		autorest.ByUnmarshallingJSON(&result),
10157		autorest.ByClosing())
10158	result.Response = autorest.Response{Response: resp}
10159	return
10160}
10161
10162// GetPartitionBackupList returns a list of backups available for the specified partition. The server enumerates all
10163// the backups available in the backup store configured in the backup policy. It also allows filtering of the result
10164// based on start and end datetime or just fetching the latest available backup for the partition.
10165// Parameters:
10166// partitionID - the identity of the partition.
10167// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10168// duration that the client is willing to wait for the requested operation to complete. The default value for
10169// this parameter is 60 seconds.
10170// latest - specifies whether to get only the most recent backup available for a partition for the specified
10171// time range.
10172// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The
10173// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups
10174// from the beginning are enumerated.
10175// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date
10176// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is
10177// done till the most recent backup.
10178func (client BaseClient) GetPartitionBackupList(ctx context.Context, partitionID uuid.UUID, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time) (result PagedBackupInfoList, err error) {
10179	if tracing.IsEnabled() {
10180		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupList")
10181		defer func() {
10182			sc := -1
10183			if result.Response.Response != nil {
10184				sc = result.Response.Response.StatusCode
10185			}
10186			tracing.EndSpan(ctx, sc, err)
10187		}()
10188	}
10189	if err := validation.Validate([]validation.Validation{
10190		{TargetValue: timeout,
10191			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10192				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10193					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10194				}}}}}); err != nil {
10195		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupList", err.Error())
10196	}
10197
10198	req, err := client.GetPartitionBackupListPreparer(ctx, partitionID, timeout, latest, startDateTimeFilter, endDateTimeFilter)
10199	if err != nil {
10200		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", nil, "Failure preparing request")
10201		return
10202	}
10203
10204	resp, err := client.GetPartitionBackupListSender(req)
10205	if err != nil {
10206		result.Response = autorest.Response{Response: resp}
10207		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", resp, "Failure sending request")
10208		return
10209	}
10210
10211	result, err = client.GetPartitionBackupListResponder(resp)
10212	if err != nil {
10213		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", resp, "Failure responding to request")
10214	}
10215
10216	return
10217}
10218
10219// GetPartitionBackupListPreparer prepares the GetPartitionBackupList request.
10220func (client BaseClient) GetPartitionBackupListPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time) (*http.Request, error) {
10221	pathParameters := map[string]interface{}{
10222		"partitionId": partitionID,
10223	}
10224
10225	const APIVersion = "6.2-preview"
10226	queryParameters := map[string]interface{}{
10227		"api-version": APIVersion,
10228	}
10229	if timeout != nil {
10230		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10231	} else {
10232		queryParameters["timeout"] = autorest.Encode("query", 60)
10233	}
10234	if latest != nil {
10235		queryParameters["Latest"] = autorest.Encode("query", *latest)
10236	} else {
10237		queryParameters["Latest"] = autorest.Encode("query", false)
10238	}
10239	if startDateTimeFilter != nil {
10240		queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter)
10241	}
10242	if endDateTimeFilter != nil {
10243		queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter)
10244	}
10245
10246	preparer := autorest.CreatePreparer(
10247		autorest.AsGet(),
10248		autorest.WithBaseURL(client.BaseURI),
10249		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackups", pathParameters),
10250		autorest.WithQueryParameters(queryParameters))
10251	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10252}
10253
10254// GetPartitionBackupListSender sends the GetPartitionBackupList request. The method will close the
10255// http.Response Body if it receives an error.
10256func (client BaseClient) GetPartitionBackupListSender(req *http.Request) (*http.Response, error) {
10257	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10258}
10259
10260// GetPartitionBackupListResponder handles the response to the GetPartitionBackupList request. The method always
10261// closes the http.Response Body.
10262func (client BaseClient) GetPartitionBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) {
10263	err = autorest.Respond(
10264		resp,
10265		client.ByInspecting(),
10266		azure.WithErrorUnlessStatusCode(http.StatusOK),
10267		autorest.ByUnmarshallingJSON(&result),
10268		autorest.ByClosing())
10269	result.Response = autorest.Response{Response: resp}
10270	return
10271}
10272
10273// GetPartitionBackupProgress returns information about the state of the latest backup along with details or failure
10274// reason in case of completion.
10275// Parameters:
10276// partitionID - the identity of the partition.
10277// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10278// duration that the client is willing to wait for the requested operation to complete. The default value for
10279// this parameter is 60 seconds.
10280func (client BaseClient) GetPartitionBackupProgress(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result BackupProgressInfo, err error) {
10281	if tracing.IsEnabled() {
10282		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupProgress")
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", "GetPartitionBackupProgress", err.Error())
10298	}
10299
10300	req, err := client.GetPartitionBackupProgressPreparer(ctx, partitionID, timeout)
10301	if err != nil {
10302		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", nil, "Failure preparing request")
10303		return
10304	}
10305
10306	resp, err := client.GetPartitionBackupProgressSender(req)
10307	if err != nil {
10308		result.Response = autorest.Response{Response: resp}
10309		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", resp, "Failure sending request")
10310		return
10311	}
10312
10313	result, err = client.GetPartitionBackupProgressResponder(resp)
10314	if err != nil {
10315		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", resp, "Failure responding to request")
10316	}
10317
10318	return
10319}
10320
10321// GetPartitionBackupProgressPreparer prepares the GetPartitionBackupProgress request.
10322func (client BaseClient) GetPartitionBackupProgressPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
10323	pathParameters := map[string]interface{}{
10324		"partitionId": partitionID,
10325	}
10326
10327	const APIVersion = "6.2-preview"
10328	queryParameters := map[string]interface{}{
10329		"api-version": APIVersion,
10330	}
10331	if timeout != nil {
10332		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10333	} else {
10334		queryParameters["timeout"] = autorest.Encode("query", 60)
10335	}
10336
10337	preparer := autorest.CreatePreparer(
10338		autorest.AsGet(),
10339		autorest.WithBaseURL(client.BaseURI),
10340		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackupProgress", pathParameters),
10341		autorest.WithQueryParameters(queryParameters))
10342	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10343}
10344
10345// GetPartitionBackupProgressSender sends the GetPartitionBackupProgress request. The method will close the
10346// http.Response Body if it receives an error.
10347func (client BaseClient) GetPartitionBackupProgressSender(req *http.Request) (*http.Response, error) {
10348	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10349}
10350
10351// GetPartitionBackupProgressResponder handles the response to the GetPartitionBackupProgress request. The method always
10352// closes the http.Response Body.
10353func (client BaseClient) GetPartitionBackupProgressResponder(resp *http.Response) (result BackupProgressInfo, err error) {
10354	err = autorest.Respond(
10355		resp,
10356		client.ByInspecting(),
10357		azure.WithErrorUnlessStatusCode(http.StatusOK),
10358		autorest.ByUnmarshallingJSON(&result),
10359		autorest.ByClosing())
10360	result.Response = autorest.Response{Response: resp}
10361	return
10362}
10363
10364// GetPartitionEventList the response is list of PartitionEvent objects.
10365// Parameters:
10366// partitionID - the identity of the partition.
10367// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
10368// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
10369// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10370// duration that the client is willing to wait for the requested operation to complete. The default value for
10371// this parameter is 60 seconds.
10372// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
10373// be included in the response.
10374// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
10375// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
10376// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
10377// populated.
10378func (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) {
10379	if tracing.IsEnabled() {
10380		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionEventList")
10381		defer func() {
10382			sc := -1
10383			if result.Response.Response != nil {
10384				sc = result.Response.Response.StatusCode
10385			}
10386			tracing.EndSpan(ctx, sc, err)
10387		}()
10388	}
10389	if err := validation.Validate([]validation.Validation{
10390		{TargetValue: timeout,
10391			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10392				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10393					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10394				}}}}}); err != nil {
10395		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionEventList", err.Error())
10396	}
10397
10398	req, err := client.GetPartitionEventListPreparer(ctx, partitionID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
10399	if err != nil {
10400		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", nil, "Failure preparing request")
10401		return
10402	}
10403
10404	resp, err := client.GetPartitionEventListSender(req)
10405	if err != nil {
10406		result.Response = autorest.Response{Response: resp}
10407		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", resp, "Failure sending request")
10408		return
10409	}
10410
10411	result, err = client.GetPartitionEventListResponder(resp)
10412	if err != nil {
10413		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", resp, "Failure responding to request")
10414	}
10415
10416	return
10417}
10418
10419// GetPartitionEventListPreparer prepares the GetPartitionEventList request.
10420func (client BaseClient) GetPartitionEventListPreparer(ctx context.Context, partitionID uuid.UUID, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
10421	pathParameters := map[string]interface{}{
10422		"partitionId": partitionID,
10423	}
10424
10425	const APIVersion = "6.2-preview"
10426	queryParameters := map[string]interface{}{
10427		"api-version":  APIVersion,
10428		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
10429		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
10430	}
10431	if timeout != nil {
10432		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10433	} else {
10434		queryParameters["timeout"] = autorest.Encode("query", 60)
10435	}
10436	if len(eventsTypesFilter) > 0 {
10437		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
10438	}
10439	if excludeAnalysisEvents != nil {
10440		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
10441	}
10442	if skipCorrelationLookup != nil {
10443		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
10444	}
10445
10446	preparer := autorest.CreatePreparer(
10447		autorest.AsGet(),
10448		autorest.WithBaseURL(client.BaseURI),
10449		autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Events", pathParameters),
10450		autorest.WithQueryParameters(queryParameters))
10451	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10452}
10453
10454// GetPartitionEventListSender sends the GetPartitionEventList request. The method will close the
10455// http.Response Body if it receives an error.
10456func (client BaseClient) GetPartitionEventListSender(req *http.Request) (*http.Response, error) {
10457	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10458}
10459
10460// GetPartitionEventListResponder handles the response to the GetPartitionEventList request. The method always
10461// closes the http.Response Body.
10462func (client BaseClient) GetPartitionEventListResponder(resp *http.Response) (result ListPartitionEvent, err error) {
10463	err = autorest.Respond(
10464		resp,
10465		client.ByInspecting(),
10466		azure.WithErrorUnlessStatusCode(http.StatusOK),
10467		autorest.ByUnmarshallingJSON(&result),
10468		autorest.ByClosing())
10469	result.Response = autorest.Response{Response: resp}
10470	return
10471}
10472
10473// GetPartitionHealth gets the health information of the specified partition.
10474// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health
10475// state.
10476// Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition.
10477// If you specify a partition that does not exist in the health store, this request returns an error.
10478// Parameters:
10479// partitionID - the identity of the partition.
10480// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
10481// state.
10482// The possible values for this parameter include integer value of one of the following health states.
10483// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
10484// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
10485// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
10486// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
10487//
10488// - Default - Default value. Matches any HealthState. The value is zero.
10489// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
10490// collection of states. The value is 1.
10491// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
10492// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
10493// - Error - Filter that matches input with HealthState value Error. The value is 8.
10494// - All - Filter that matches input with any HealthState value. The value is 65535.
10495// replicasHealthStateFilter - allows filtering the collection of ReplicaHealthState objects on the partition.
10496// The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only replicas
10497// that match the filter will be returned. All replicas will be used to evaluate the aggregated health state.
10498// If not specified, all entries will be returned.The state values are flag based enumeration, so the value
10499// could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided
10500// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) will be returned. The
10501// possible values for this parameter include integer value of one of the following health states.
10502//
10503// - Default - Default value. Matches any HealthState. The value is zero.
10504// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
10505// collection of states. The value is 1.
10506// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
10507// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
10508// - Error - Filter that matches input with HealthState value Error. The value is 8.
10509// - All - Filter that matches input with any HealthState value. The value is 65535.
10510// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
10511// result. False by default.
10512// The statistics show the number of children entities in health state Ok, Warning, and Error.
10513// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10514// duration that the client is willing to wait for the requested operation to complete. The default value for
10515// this parameter is 60 seconds.
10516func (client BaseClient) GetPartitionHealth(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result PartitionHealth, err error) {
10517	if tracing.IsEnabled() {
10518		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionHealth")
10519		defer func() {
10520			sc := -1
10521			if result.Response.Response != nil {
10522				sc = result.Response.Response.StatusCode
10523			}
10524			tracing.EndSpan(ctx, sc, err)
10525		}()
10526	}
10527	if err := validation.Validate([]validation.Validation{
10528		{TargetValue: timeout,
10529			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10530				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10531					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10532				}}}}}); err != nil {
10533		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealth", err.Error())
10534	}
10535
10536	req, err := client.GetPartitionHealthPreparer(ctx, partitionID, eventsHealthStateFilter, replicasHealthStateFilter, excludeHealthStatistics, timeout)
10537	if err != nil {
10538		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", nil, "Failure preparing request")
10539		return
10540	}
10541
10542	resp, err := client.GetPartitionHealthSender(req)
10543	if err != nil {
10544		result.Response = autorest.Response{Response: resp}
10545		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", resp, "Failure sending request")
10546		return
10547	}
10548
10549	result, err = client.GetPartitionHealthResponder(resp)
10550	if err != nil {
10551		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", resp, "Failure responding to request")
10552	}
10553
10554	return
10555}
10556
10557// GetPartitionHealthPreparer prepares the GetPartitionHealth request.
10558func (client BaseClient) GetPartitionHealthPreparer(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
10559	pathParameters := map[string]interface{}{
10560		"partitionId": partitionID,
10561	}
10562
10563	const APIVersion = "6.0"
10564	queryParameters := map[string]interface{}{
10565		"api-version": APIVersion,
10566	}
10567	if eventsHealthStateFilter != nil {
10568		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
10569	} else {
10570		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
10571	}
10572	if replicasHealthStateFilter != nil {
10573		queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", *replicasHealthStateFilter)
10574	} else {
10575		queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", 0)
10576	}
10577	if excludeHealthStatistics != nil {
10578		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
10579	} else {
10580		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
10581	}
10582	if timeout != nil {
10583		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10584	} else {
10585		queryParameters["timeout"] = autorest.Encode("query", 60)
10586	}
10587
10588	preparer := autorest.CreatePreparer(
10589		autorest.AsGet(),
10590		autorest.WithBaseURL(client.BaseURI),
10591		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetHealth", pathParameters),
10592		autorest.WithQueryParameters(queryParameters))
10593	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10594}
10595
10596// GetPartitionHealthSender sends the GetPartitionHealth request. The method will close the
10597// http.Response Body if it receives an error.
10598func (client BaseClient) GetPartitionHealthSender(req *http.Request) (*http.Response, error) {
10599	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10600}
10601
10602// GetPartitionHealthResponder handles the response to the GetPartitionHealth request. The method always
10603// closes the http.Response Body.
10604func (client BaseClient) GetPartitionHealthResponder(resp *http.Response) (result PartitionHealth, err error) {
10605	err = autorest.Respond(
10606		resp,
10607		client.ByInspecting(),
10608		azure.WithErrorUnlessStatusCode(http.StatusOK),
10609		autorest.ByUnmarshallingJSON(&result),
10610		autorest.ByClosing())
10611	result.Response = autorest.Response{Response: resp}
10612	return
10613}
10614
10615// GetPartitionHealthUsingPolicy gets the health information of the specified partition.
10616// If the application health policy is specified, the health evaluation uses it to get the aggregated health state.
10617// If the policy is not specified, the health evaluation uses the application health policy defined in the application
10618// manifest, or the default health policy, if no policy is defined in the manifest.
10619// Use EventsHealthStateFilter to filter the collection of health events reported on the partition based on the health
10620// state.
10621// Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. Use
10622// ApplicationHealthPolicy in the POST body to override the health policies used to evaluate the health.
10623// If you specify a partition that does not exist in the health store, this request returns an error.
10624// Parameters:
10625// partitionID - the identity of the partition.
10626// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
10627// state.
10628// The possible values for this parameter include integer value of one of the following health states.
10629// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
10630// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
10631// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
10632// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
10633//
10634// - Default - Default value. Matches any HealthState. The value is zero.
10635// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
10636// collection of states. The value is 1.
10637// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
10638// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
10639// - Error - Filter that matches input with HealthState value Error. The value is 8.
10640// - All - Filter that matches input with any HealthState value. The value is 65535.
10641// replicasHealthStateFilter - allows filtering the collection of ReplicaHealthState objects on the partition.
10642// The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only replicas
10643// that match the filter will be returned. All replicas will be used to evaluate the aggregated health state.
10644// If not specified, all entries will be returned.The state values are flag based enumeration, so the value
10645// could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided
10646// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) will be returned. The
10647// possible values for this parameter include integer value of one of the following health states.
10648//
10649// - Default - Default value. Matches any HealthState. The value is zero.
10650// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
10651// collection of states. The value is 1.
10652// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
10653// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
10654// - Error - Filter that matches input with HealthState value Error. The value is 8.
10655// - All - Filter that matches input with any HealthState value. The value is 65535.
10656// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
10657// of its children.
10658// If not present, the health evaluation uses the health policy from application manifest or the default health
10659// policy.
10660// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
10661// result. False by default.
10662// The statistics show the number of children entities in health state Ok, Warning, and Error.
10663// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10664// duration that the client is willing to wait for the requested operation to complete. The default value for
10665// this parameter is 60 seconds.
10666func (client BaseClient) GetPartitionHealthUsingPolicy(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result PartitionHealth, err error) {
10667	if tracing.IsEnabled() {
10668		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionHealthUsingPolicy")
10669		defer func() {
10670			sc := -1
10671			if result.Response.Response != nil {
10672				sc = result.Response.Response.StatusCode
10673			}
10674			tracing.EndSpan(ctx, sc, err)
10675		}()
10676	}
10677	if err := validation.Validate([]validation.Validation{
10678		{TargetValue: timeout,
10679			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10680				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10681					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10682				}}}}}); err != nil {
10683		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", err.Error())
10684	}
10685
10686	req, err := client.GetPartitionHealthUsingPolicyPreparer(ctx, partitionID, eventsHealthStateFilter, replicasHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout)
10687	if err != nil {
10688		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", nil, "Failure preparing request")
10689		return
10690	}
10691
10692	resp, err := client.GetPartitionHealthUsingPolicySender(req)
10693	if err != nil {
10694		result.Response = autorest.Response{Response: resp}
10695		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", resp, "Failure sending request")
10696		return
10697	}
10698
10699	result, err = client.GetPartitionHealthUsingPolicyResponder(resp)
10700	if err != nil {
10701		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", resp, "Failure responding to request")
10702	}
10703
10704	return
10705}
10706
10707// GetPartitionHealthUsingPolicyPreparer prepares the GetPartitionHealthUsingPolicy request.
10708func (client BaseClient) GetPartitionHealthUsingPolicyPreparer(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
10709	pathParameters := map[string]interface{}{
10710		"partitionId": partitionID,
10711	}
10712
10713	const APIVersion = "6.0"
10714	queryParameters := map[string]interface{}{
10715		"api-version": APIVersion,
10716	}
10717	if eventsHealthStateFilter != nil {
10718		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
10719	} else {
10720		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
10721	}
10722	if replicasHealthStateFilter != nil {
10723		queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", *replicasHealthStateFilter)
10724	} else {
10725		queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", 0)
10726	}
10727	if excludeHealthStatistics != nil {
10728		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
10729	} else {
10730		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
10731	}
10732	if timeout != nil {
10733		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10734	} else {
10735		queryParameters["timeout"] = autorest.Encode("query", 60)
10736	}
10737
10738	preparer := autorest.CreatePreparer(
10739		autorest.AsContentType("application/json; charset=utf-8"),
10740		autorest.AsPost(),
10741		autorest.WithBaseURL(client.BaseURI),
10742		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetHealth", pathParameters),
10743		autorest.WithQueryParameters(queryParameters))
10744	if applicationHealthPolicy != nil {
10745		preparer = autorest.DecoratePreparer(preparer,
10746			autorest.WithJSON(applicationHealthPolicy))
10747	}
10748	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10749}
10750
10751// GetPartitionHealthUsingPolicySender sends the GetPartitionHealthUsingPolicy request. The method will close the
10752// http.Response Body if it receives an error.
10753func (client BaseClient) GetPartitionHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
10754	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10755}
10756
10757// GetPartitionHealthUsingPolicyResponder handles the response to the GetPartitionHealthUsingPolicy request. The method always
10758// closes the http.Response Body.
10759func (client BaseClient) GetPartitionHealthUsingPolicyResponder(resp *http.Response) (result PartitionHealth, err error) {
10760	err = autorest.Respond(
10761		resp,
10762		client.ByInspecting(),
10763		azure.WithErrorUnlessStatusCode(http.StatusOK),
10764		autorest.ByUnmarshallingJSON(&result),
10765		autorest.ByClosing())
10766	result.Response = autorest.Response{Response: resp}
10767	return
10768}
10769
10770// GetPartitionInfo gets the information about the specified partition. The response includes the partition ID,
10771// partitioning scheme information, keys supported by the partition, status, health, and other details about the
10772// partition.
10773// Parameters:
10774// partitionID - the identity of the partition.
10775// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10776// duration that the client is willing to wait for the requested operation to complete. The default value for
10777// this parameter is 60 seconds.
10778func (client BaseClient) GetPartitionInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result ServicePartitionInfoModel, err error) {
10779	if tracing.IsEnabled() {
10780		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionInfo")
10781		defer func() {
10782			sc := -1
10783			if result.Response.Response != nil {
10784				sc = result.Response.Response.StatusCode
10785			}
10786			tracing.EndSpan(ctx, sc, err)
10787		}()
10788	}
10789	if err := validation.Validate([]validation.Validation{
10790		{TargetValue: timeout,
10791			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10792				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10793					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10794				}}}}}); err != nil {
10795		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfo", err.Error())
10796	}
10797
10798	req, err := client.GetPartitionInfoPreparer(ctx, partitionID, timeout)
10799	if err != nil {
10800		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", nil, "Failure preparing request")
10801		return
10802	}
10803
10804	resp, err := client.GetPartitionInfoSender(req)
10805	if err != nil {
10806		result.Response = autorest.Response{Response: resp}
10807		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", resp, "Failure sending request")
10808		return
10809	}
10810
10811	result, err = client.GetPartitionInfoResponder(resp)
10812	if err != nil {
10813		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", resp, "Failure responding to request")
10814	}
10815
10816	return
10817}
10818
10819// GetPartitionInfoPreparer prepares the GetPartitionInfo request.
10820func (client BaseClient) GetPartitionInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
10821	pathParameters := map[string]interface{}{
10822		"partitionId": partitionID,
10823	}
10824
10825	const APIVersion = "6.0"
10826	queryParameters := map[string]interface{}{
10827		"api-version": APIVersion,
10828	}
10829	if timeout != nil {
10830		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10831	} else {
10832		queryParameters["timeout"] = autorest.Encode("query", 60)
10833	}
10834
10835	preparer := autorest.CreatePreparer(
10836		autorest.AsGet(),
10837		autorest.WithBaseURL(client.BaseURI),
10838		autorest.WithPathParameters("/Partitions/{partitionId}", pathParameters),
10839		autorest.WithQueryParameters(queryParameters))
10840	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10841}
10842
10843// GetPartitionInfoSender sends the GetPartitionInfo request. The method will close the
10844// http.Response Body if it receives an error.
10845func (client BaseClient) GetPartitionInfoSender(req *http.Request) (*http.Response, error) {
10846	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10847}
10848
10849// GetPartitionInfoResponder handles the response to the GetPartitionInfo request. The method always
10850// closes the http.Response Body.
10851func (client BaseClient) GetPartitionInfoResponder(resp *http.Response) (result ServicePartitionInfoModel, err error) {
10852	err = autorest.Respond(
10853		resp,
10854		client.ByInspecting(),
10855		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
10856		autorest.ByUnmarshallingJSON(&result),
10857		autorest.ByClosing())
10858	result.Response = autorest.Response{Response: resp}
10859	return
10860}
10861
10862// GetPartitionInfoList gets the list of partitions of a Service Fabric service. The response includes the partition
10863// ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the
10864// partition.
10865// Parameters:
10866// serviceID - the identity of the service. This is typically the full name of the service without the
10867// 'fabric:' URI scheme.
10868// Starting from version 6.0, hierarchical names are delimited with the "~" character.
10869// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
10870// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
10871// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
10872// token with a non empty value is included in the response of the API when the results from the system do not
10873// fit in a single response. When this value is passed to the next API call, the API returns next set of
10874// results. If there are no further results then the continuation token does not contain a value. The value of
10875// this parameter should not be URL encoded.
10876// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10877// duration that the client is willing to wait for the requested operation to complete. The default value for
10878// this parameter is 60 seconds.
10879func (client BaseClient) GetPartitionInfoList(ctx context.Context, serviceID string, continuationToken string, timeout *int64) (result PagedServicePartitionInfoList, err error) {
10880	if tracing.IsEnabled() {
10881		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionInfoList")
10882		defer func() {
10883			sc := -1
10884			if result.Response.Response != nil {
10885				sc = result.Response.Response.StatusCode
10886			}
10887			tracing.EndSpan(ctx, sc, err)
10888		}()
10889	}
10890	if err := validation.Validate([]validation.Validation{
10891		{TargetValue: timeout,
10892			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10893				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10894					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10895				}}}}}); err != nil {
10896		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfoList", err.Error())
10897	}
10898
10899	req, err := client.GetPartitionInfoListPreparer(ctx, serviceID, continuationToken, timeout)
10900	if err != nil {
10901		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", nil, "Failure preparing request")
10902		return
10903	}
10904
10905	resp, err := client.GetPartitionInfoListSender(req)
10906	if err != nil {
10907		result.Response = autorest.Response{Response: resp}
10908		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", resp, "Failure sending request")
10909		return
10910	}
10911
10912	result, err = client.GetPartitionInfoListResponder(resp)
10913	if err != nil {
10914		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", resp, "Failure responding to request")
10915	}
10916
10917	return
10918}
10919
10920// GetPartitionInfoListPreparer prepares the GetPartitionInfoList request.
10921func (client BaseClient) GetPartitionInfoListPreparer(ctx context.Context, serviceID string, continuationToken string, timeout *int64) (*http.Request, error) {
10922	pathParameters := map[string]interface{}{
10923		"serviceId": serviceID,
10924	}
10925
10926	const APIVersion = "6.0"
10927	queryParameters := map[string]interface{}{
10928		"api-version": APIVersion,
10929	}
10930	if len(continuationToken) > 0 {
10931		queryParameters["ContinuationToken"] = continuationToken
10932	}
10933	if timeout != nil {
10934		queryParameters["timeout"] = autorest.Encode("query", *timeout)
10935	} else {
10936		queryParameters["timeout"] = autorest.Encode("query", 60)
10937	}
10938
10939	preparer := autorest.CreatePreparer(
10940		autorest.AsGet(),
10941		autorest.WithBaseURL(client.BaseURI),
10942		autorest.WithPathParameters("/Services/{serviceId}/$/GetPartitions", pathParameters),
10943		autorest.WithQueryParameters(queryParameters))
10944	return preparer.Prepare((&http.Request{}).WithContext(ctx))
10945}
10946
10947// GetPartitionInfoListSender sends the GetPartitionInfoList request. The method will close the
10948// http.Response Body if it receives an error.
10949func (client BaseClient) GetPartitionInfoListSender(req *http.Request) (*http.Response, error) {
10950	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10951}
10952
10953// GetPartitionInfoListResponder handles the response to the GetPartitionInfoList request. The method always
10954// closes the http.Response Body.
10955func (client BaseClient) GetPartitionInfoListResponder(resp *http.Response) (result PagedServicePartitionInfoList, err error) {
10956	err = autorest.Respond(
10957		resp,
10958		client.ByInspecting(),
10959		azure.WithErrorUnlessStatusCode(http.StatusOK),
10960		autorest.ByUnmarshallingJSON(&result),
10961		autorest.ByClosing())
10962	result.Response = autorest.Response{Response: resp}
10963	return
10964}
10965
10966// GetPartitionLoadInformation returns information about the load of a specified partition.
10967// The response includes a list of load reports for a Service Fabric partition.
10968// Each report includes the load metric name, value, and last reported time in UTC.
10969// Parameters:
10970// partitionID - the identity of the partition.
10971// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
10972// duration that the client is willing to wait for the requested operation to complete. The default value for
10973// this parameter is 60 seconds.
10974func (client BaseClient) GetPartitionLoadInformation(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result PartitionLoadInformation, err error) {
10975	if tracing.IsEnabled() {
10976		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionLoadInformation")
10977		defer func() {
10978			sc := -1
10979			if result.Response.Response != nil {
10980				sc = result.Response.Response.StatusCode
10981			}
10982			tracing.EndSpan(ctx, sc, err)
10983		}()
10984	}
10985	if err := validation.Validate([]validation.Validation{
10986		{TargetValue: timeout,
10987			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
10988				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
10989					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
10990				}}}}}); err != nil {
10991		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionLoadInformation", err.Error())
10992	}
10993
10994	req, err := client.GetPartitionLoadInformationPreparer(ctx, partitionID, timeout)
10995	if err != nil {
10996		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", nil, "Failure preparing request")
10997		return
10998	}
10999
11000	resp, err := client.GetPartitionLoadInformationSender(req)
11001	if err != nil {
11002		result.Response = autorest.Response{Response: resp}
11003		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", resp, "Failure sending request")
11004		return
11005	}
11006
11007	result, err = client.GetPartitionLoadInformationResponder(resp)
11008	if err != nil {
11009		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", resp, "Failure responding to request")
11010	}
11011
11012	return
11013}
11014
11015// GetPartitionLoadInformationPreparer prepares the GetPartitionLoadInformation request.
11016func (client BaseClient) GetPartitionLoadInformationPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
11017	pathParameters := map[string]interface{}{
11018		"partitionId": partitionID,
11019	}
11020
11021	const APIVersion = "6.0"
11022	queryParameters := map[string]interface{}{
11023		"api-version": APIVersion,
11024	}
11025	if timeout != nil {
11026		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11027	} else {
11028		queryParameters["timeout"] = autorest.Encode("query", 60)
11029	}
11030
11031	preparer := autorest.CreatePreparer(
11032		autorest.AsGet(),
11033		autorest.WithBaseURL(client.BaseURI),
11034		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetLoadInformation", pathParameters),
11035		autorest.WithQueryParameters(queryParameters))
11036	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11037}
11038
11039// GetPartitionLoadInformationSender sends the GetPartitionLoadInformation request. The method will close the
11040// http.Response Body if it receives an error.
11041func (client BaseClient) GetPartitionLoadInformationSender(req *http.Request) (*http.Response, error) {
11042	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11043}
11044
11045// GetPartitionLoadInformationResponder handles the response to the GetPartitionLoadInformation request. The method always
11046// closes the http.Response Body.
11047func (client BaseClient) GetPartitionLoadInformationResponder(resp *http.Response) (result PartitionLoadInformation, err error) {
11048	err = autorest.Respond(
11049		resp,
11050		client.ByInspecting(),
11051		azure.WithErrorUnlessStatusCode(http.StatusOK),
11052		autorest.ByUnmarshallingJSON(&result),
11053		autorest.ByClosing())
11054	result.Response = autorest.Response{Response: resp}
11055	return
11056}
11057
11058// GetPartitionReplicaEventList the response is list of ReplicaEvent objects.
11059// Parameters:
11060// partitionID - the identity of the partition.
11061// replicaID - the identifier of the replica.
11062// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11063// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11064// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11065// duration that the client is willing to wait for the requested operation to complete. The default value for
11066// this parameter is 60 seconds.
11067// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
11068// be included in the response.
11069// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
11070// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
11071// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
11072// populated.
11073func (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) {
11074	if tracing.IsEnabled() {
11075		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionReplicaEventList")
11076		defer func() {
11077			sc := -1
11078			if result.Response.Response != nil {
11079				sc = result.Response.Response.StatusCode
11080			}
11081			tracing.EndSpan(ctx, sc, err)
11082		}()
11083	}
11084	if err := validation.Validate([]validation.Validation{
11085		{TargetValue: timeout,
11086			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11087				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11088					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11089				}}}}}); err != nil {
11090		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionReplicaEventList", err.Error())
11091	}
11092
11093	req, err := client.GetPartitionReplicaEventListPreparer(ctx, partitionID, replicaID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
11094	if err != nil {
11095		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", nil, "Failure preparing request")
11096		return
11097	}
11098
11099	resp, err := client.GetPartitionReplicaEventListSender(req)
11100	if err != nil {
11101		result.Response = autorest.Response{Response: resp}
11102		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", resp, "Failure sending request")
11103		return
11104	}
11105
11106	result, err = client.GetPartitionReplicaEventListResponder(resp)
11107	if err != nil {
11108		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", resp, "Failure responding to request")
11109	}
11110
11111	return
11112}
11113
11114// GetPartitionReplicaEventListPreparer prepares the GetPartitionReplicaEventList request.
11115func (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) {
11116	pathParameters := map[string]interface{}{
11117		"partitionId": partitionID,
11118		"replicaId":   replicaID,
11119	}
11120
11121	const APIVersion = "6.2-preview"
11122	queryParameters := map[string]interface{}{
11123		"api-version":  APIVersion,
11124		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
11125		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
11126	}
11127	if timeout != nil {
11128		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11129	} else {
11130		queryParameters["timeout"] = autorest.Encode("query", 60)
11131	}
11132	if len(eventsTypesFilter) > 0 {
11133		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
11134	}
11135	if excludeAnalysisEvents != nil {
11136		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
11137	}
11138	if skipCorrelationLookup != nil {
11139		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
11140	}
11141
11142	preparer := autorest.CreatePreparer(
11143		autorest.AsGet(),
11144		autorest.WithBaseURL(client.BaseURI),
11145		autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Replicas/{replicaId}/$/Events", pathParameters),
11146		autorest.WithQueryParameters(queryParameters))
11147	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11148}
11149
11150// GetPartitionReplicaEventListSender sends the GetPartitionReplicaEventList request. The method will close the
11151// http.Response Body if it receives an error.
11152func (client BaseClient) GetPartitionReplicaEventListSender(req *http.Request) (*http.Response, error) {
11153	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11154}
11155
11156// GetPartitionReplicaEventListResponder handles the response to the GetPartitionReplicaEventList request. The method always
11157// closes the http.Response Body.
11158func (client BaseClient) GetPartitionReplicaEventListResponder(resp *http.Response) (result ListReplicaEvent, err error) {
11159	err = autorest.Respond(
11160		resp,
11161		client.ByInspecting(),
11162		azure.WithErrorUnlessStatusCode(http.StatusOK),
11163		autorest.ByUnmarshallingJSON(&result),
11164		autorest.ByClosing())
11165	result.Response = autorest.Response{Response: resp}
11166	return
11167}
11168
11169// GetPartitionReplicasEventList the response is list of ReplicaEvent objects.
11170// Parameters:
11171// partitionID - the identity of the partition.
11172// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11173// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11174// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11175// duration that the client is willing to wait for the requested operation to complete. The default value for
11176// this parameter is 60 seconds.
11177// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
11178// be included in the response.
11179// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
11180// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
11181// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
11182// populated.
11183func (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) {
11184	if tracing.IsEnabled() {
11185		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionReplicasEventList")
11186		defer func() {
11187			sc := -1
11188			if result.Response.Response != nil {
11189				sc = result.Response.Response.StatusCode
11190			}
11191			tracing.EndSpan(ctx, sc, err)
11192		}()
11193	}
11194	if err := validation.Validate([]validation.Validation{
11195		{TargetValue: timeout,
11196			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11197				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11198					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11199				}}}}}); err != nil {
11200		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionReplicasEventList", err.Error())
11201	}
11202
11203	req, err := client.GetPartitionReplicasEventListPreparer(ctx, partitionID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
11204	if err != nil {
11205		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", nil, "Failure preparing request")
11206		return
11207	}
11208
11209	resp, err := client.GetPartitionReplicasEventListSender(req)
11210	if err != nil {
11211		result.Response = autorest.Response{Response: resp}
11212		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", resp, "Failure sending request")
11213		return
11214	}
11215
11216	result, err = client.GetPartitionReplicasEventListResponder(resp)
11217	if err != nil {
11218		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", resp, "Failure responding to request")
11219	}
11220
11221	return
11222}
11223
11224// GetPartitionReplicasEventListPreparer prepares the GetPartitionReplicasEventList request.
11225func (client BaseClient) GetPartitionReplicasEventListPreparer(ctx context.Context, partitionID uuid.UUID, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
11226	pathParameters := map[string]interface{}{
11227		"partitionId": partitionID,
11228	}
11229
11230	const APIVersion = "6.2-preview"
11231	queryParameters := map[string]interface{}{
11232		"api-version":  APIVersion,
11233		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
11234		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
11235	}
11236	if timeout != nil {
11237		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11238	} else {
11239		queryParameters["timeout"] = autorest.Encode("query", 60)
11240	}
11241	if len(eventsTypesFilter) > 0 {
11242		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
11243	}
11244	if excludeAnalysisEvents != nil {
11245		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
11246	}
11247	if skipCorrelationLookup != nil {
11248		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
11249	}
11250
11251	preparer := autorest.CreatePreparer(
11252		autorest.AsGet(),
11253		autorest.WithBaseURL(client.BaseURI),
11254		autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Replicas/Events", pathParameters),
11255		autorest.WithQueryParameters(queryParameters))
11256	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11257}
11258
11259// GetPartitionReplicasEventListSender sends the GetPartitionReplicasEventList request. The method will close the
11260// http.Response Body if it receives an error.
11261func (client BaseClient) GetPartitionReplicasEventListSender(req *http.Request) (*http.Response, error) {
11262	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11263}
11264
11265// GetPartitionReplicasEventListResponder handles the response to the GetPartitionReplicasEventList request. The method always
11266// closes the http.Response Body.
11267func (client BaseClient) GetPartitionReplicasEventListResponder(resp *http.Response) (result ListReplicaEvent, err error) {
11268	err = autorest.Respond(
11269		resp,
11270		client.ByInspecting(),
11271		azure.WithErrorUnlessStatusCode(http.StatusOK),
11272		autorest.ByUnmarshallingJSON(&result),
11273		autorest.ByClosing())
11274	result.Response = autorest.Response{Response: resp}
11275	return
11276}
11277
11278// GetPartitionRestartProgress gets the progress of a PartitionRestart started with StartPartitionRestart using the
11279// provided OperationId.
11280// Parameters:
11281// serviceID - the identity of the service. This is typically the full name of the service without the
11282// 'fabric:' URI scheme.
11283// Starting from version 6.0, hierarchical names are delimited with the "~" character.
11284// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
11285// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
11286// partitionID - the identity of the partition.
11287// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
11288// API
11289// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11290// duration that the client is willing to wait for the requested operation to complete. The default value for
11291// this parameter is 60 seconds.
11292func (client BaseClient) GetPartitionRestartProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionRestartProgress, err error) {
11293	if tracing.IsEnabled() {
11294		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionRestartProgress")
11295		defer func() {
11296			sc := -1
11297			if result.Response.Response != nil {
11298				sc = result.Response.Response.StatusCode
11299			}
11300			tracing.EndSpan(ctx, sc, err)
11301		}()
11302	}
11303	if err := validation.Validate([]validation.Validation{
11304		{TargetValue: timeout,
11305			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11306				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11307					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11308				}}}}}); err != nil {
11309		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestartProgress", err.Error())
11310	}
11311
11312	req, err := client.GetPartitionRestartProgressPreparer(ctx, serviceID, partitionID, operationID, timeout)
11313	if err != nil {
11314		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", nil, "Failure preparing request")
11315		return
11316	}
11317
11318	resp, err := client.GetPartitionRestartProgressSender(req)
11319	if err != nil {
11320		result.Response = autorest.Response{Response: resp}
11321		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", resp, "Failure sending request")
11322		return
11323	}
11324
11325	result, err = client.GetPartitionRestartProgressResponder(resp)
11326	if err != nil {
11327		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", resp, "Failure responding to request")
11328	}
11329
11330	return
11331}
11332
11333// GetPartitionRestartProgressPreparer prepares the GetPartitionRestartProgress request.
11334func (client BaseClient) GetPartitionRestartProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) {
11335	pathParameters := map[string]interface{}{
11336		"partitionId": partitionID,
11337		"serviceId":   serviceID,
11338	}
11339
11340	const APIVersion = "6.0"
11341	queryParameters := map[string]interface{}{
11342		"api-version": APIVersion,
11343		"OperationId": autorest.Encode("query", operationID),
11344	}
11345	if timeout != nil {
11346		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11347	} else {
11348		queryParameters["timeout"] = autorest.Encode("query", 60)
11349	}
11350
11351	preparer := autorest.CreatePreparer(
11352		autorest.AsGet(),
11353		autorest.WithBaseURL(client.BaseURI),
11354		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetRestartProgress", pathParameters),
11355		autorest.WithQueryParameters(queryParameters))
11356	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11357}
11358
11359// GetPartitionRestartProgressSender sends the GetPartitionRestartProgress request. The method will close the
11360// http.Response Body if it receives an error.
11361func (client BaseClient) GetPartitionRestartProgressSender(req *http.Request) (*http.Response, error) {
11362	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11363}
11364
11365// GetPartitionRestartProgressResponder handles the response to the GetPartitionRestartProgress request. The method always
11366// closes the http.Response Body.
11367func (client BaseClient) GetPartitionRestartProgressResponder(resp *http.Response) (result PartitionRestartProgress, err error) {
11368	err = autorest.Respond(
11369		resp,
11370		client.ByInspecting(),
11371		azure.WithErrorUnlessStatusCode(http.StatusOK),
11372		autorest.ByUnmarshallingJSON(&result),
11373		autorest.ByClosing())
11374	result.Response = autorest.Response{Response: resp}
11375	return
11376}
11377
11378// GetPartitionRestoreProgress returns information about the state of the latest restore operation along with details
11379// or failure reason in case of completion.
11380// Parameters:
11381// partitionID - the identity of the partition.
11382// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11383// duration that the client is willing to wait for the requested operation to complete. The default value for
11384// this parameter is 60 seconds.
11385func (client BaseClient) GetPartitionRestoreProgress(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result RestoreProgressInfo, err error) {
11386	if tracing.IsEnabled() {
11387		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionRestoreProgress")
11388		defer func() {
11389			sc := -1
11390			if result.Response.Response != nil {
11391				sc = result.Response.Response.StatusCode
11392			}
11393			tracing.EndSpan(ctx, sc, err)
11394		}()
11395	}
11396	if err := validation.Validate([]validation.Validation{
11397		{TargetValue: timeout,
11398			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11399				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11400					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11401				}}}}}); err != nil {
11402		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestoreProgress", err.Error())
11403	}
11404
11405	req, err := client.GetPartitionRestoreProgressPreparer(ctx, partitionID, timeout)
11406	if err != nil {
11407		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", nil, "Failure preparing request")
11408		return
11409	}
11410
11411	resp, err := client.GetPartitionRestoreProgressSender(req)
11412	if err != nil {
11413		result.Response = autorest.Response{Response: resp}
11414		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", resp, "Failure sending request")
11415		return
11416	}
11417
11418	result, err = client.GetPartitionRestoreProgressResponder(resp)
11419	if err != nil {
11420		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", resp, "Failure responding to request")
11421	}
11422
11423	return
11424}
11425
11426// GetPartitionRestoreProgressPreparer prepares the GetPartitionRestoreProgress request.
11427func (client BaseClient) GetPartitionRestoreProgressPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
11428	pathParameters := map[string]interface{}{
11429		"partitionId": partitionID,
11430	}
11431
11432	const APIVersion = "6.2-preview"
11433	queryParameters := map[string]interface{}{
11434		"api-version": APIVersion,
11435	}
11436	if timeout != nil {
11437		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11438	} else {
11439		queryParameters["timeout"] = autorest.Encode("query", 60)
11440	}
11441
11442	preparer := autorest.CreatePreparer(
11443		autorest.AsGet(),
11444		autorest.WithBaseURL(client.BaseURI),
11445		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetRestoreProgress", pathParameters),
11446		autorest.WithQueryParameters(queryParameters))
11447	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11448}
11449
11450// GetPartitionRestoreProgressSender sends the GetPartitionRestoreProgress request. The method will close the
11451// http.Response Body if it receives an error.
11452func (client BaseClient) GetPartitionRestoreProgressSender(req *http.Request) (*http.Response, error) {
11453	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11454}
11455
11456// GetPartitionRestoreProgressResponder handles the response to the GetPartitionRestoreProgress request. The method always
11457// closes the http.Response Body.
11458func (client BaseClient) GetPartitionRestoreProgressResponder(resp *http.Response) (result RestoreProgressInfo, err error) {
11459	err = autorest.Respond(
11460		resp,
11461		client.ByInspecting(),
11462		azure.WithErrorUnlessStatusCode(http.StatusOK),
11463		autorest.ByUnmarshallingJSON(&result),
11464		autorest.ByClosing())
11465	result.Response = autorest.Response{Response: resp}
11466	return
11467}
11468
11469// GetPartitionsEventList the response is list of PartitionEvent objects.
11470// Parameters:
11471// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11472// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
11473// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11474// duration that the client is willing to wait for the requested operation to complete. The default value for
11475// this parameter is 60 seconds.
11476// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
11477// be included in the response.
11478// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
11479// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
11480// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
11481// populated.
11482func (client BaseClient) GetPartitionsEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListPartitionEvent, err error) {
11483	if tracing.IsEnabled() {
11484		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionsEventList")
11485		defer func() {
11486			sc := -1
11487			if result.Response.Response != nil {
11488				sc = result.Response.Response.StatusCode
11489			}
11490			tracing.EndSpan(ctx, sc, err)
11491		}()
11492	}
11493	if err := validation.Validate([]validation.Validation{
11494		{TargetValue: timeout,
11495			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11496				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11497					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11498				}}}}}); err != nil {
11499		return result, validation.NewError("servicefabric.BaseClient", "GetPartitionsEventList", err.Error())
11500	}
11501
11502	req, err := client.GetPartitionsEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
11503	if err != nil {
11504		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", nil, "Failure preparing request")
11505		return
11506	}
11507
11508	resp, err := client.GetPartitionsEventListSender(req)
11509	if err != nil {
11510		result.Response = autorest.Response{Response: resp}
11511		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", resp, "Failure sending request")
11512		return
11513	}
11514
11515	result, err = client.GetPartitionsEventListResponder(resp)
11516	if err != nil {
11517		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", resp, "Failure responding to request")
11518	}
11519
11520	return
11521}
11522
11523// GetPartitionsEventListPreparer prepares the GetPartitionsEventList request.
11524func (client BaseClient) GetPartitionsEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
11525	const APIVersion = "6.2-preview"
11526	queryParameters := map[string]interface{}{
11527		"api-version":  APIVersion,
11528		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
11529		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
11530	}
11531	if timeout != nil {
11532		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11533	} else {
11534		queryParameters["timeout"] = autorest.Encode("query", 60)
11535	}
11536	if len(eventsTypesFilter) > 0 {
11537		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
11538	}
11539	if excludeAnalysisEvents != nil {
11540		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
11541	}
11542	if skipCorrelationLookup != nil {
11543		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
11544	}
11545
11546	preparer := autorest.CreatePreparer(
11547		autorest.AsGet(),
11548		autorest.WithBaseURL(client.BaseURI),
11549		autorest.WithPath("/EventsStore/Partitions/Events"),
11550		autorest.WithQueryParameters(queryParameters))
11551	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11552}
11553
11554// GetPartitionsEventListSender sends the GetPartitionsEventList request. The method will close the
11555// http.Response Body if it receives an error.
11556func (client BaseClient) GetPartitionsEventListSender(req *http.Request) (*http.Response, error) {
11557	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11558}
11559
11560// GetPartitionsEventListResponder handles the response to the GetPartitionsEventList request. The method always
11561// closes the http.Response Body.
11562func (client BaseClient) GetPartitionsEventListResponder(resp *http.Response) (result ListPartitionEvent, err error) {
11563	err = autorest.Respond(
11564		resp,
11565		client.ByInspecting(),
11566		azure.WithErrorUnlessStatusCode(http.StatusOK),
11567		autorest.ByUnmarshallingJSON(&result),
11568		autorest.ByClosing())
11569	result.Response = autorest.Response{Response: resp}
11570	return
11571}
11572
11573// GetPropertyInfo gets the specified Service Fabric property under a given name. This will always return both value
11574// and metadata.
11575// Parameters:
11576// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
11577// propertyName - specifies the name of the property to get.
11578// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11579// duration that the client is willing to wait for the requested operation to complete. The default value for
11580// this parameter is 60 seconds.
11581func (client BaseClient) GetPropertyInfo(ctx context.Context, nameID string, propertyName string, timeout *int64) (result PropertyInfo, err error) {
11582	if tracing.IsEnabled() {
11583		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPropertyInfo")
11584		defer func() {
11585			sc := -1
11586			if result.Response.Response != nil {
11587				sc = result.Response.Response.StatusCode
11588			}
11589			tracing.EndSpan(ctx, sc, err)
11590		}()
11591	}
11592	if err := validation.Validate([]validation.Validation{
11593		{TargetValue: timeout,
11594			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11595				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11596					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11597				}}}}}); err != nil {
11598		return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfo", err.Error())
11599	}
11600
11601	req, err := client.GetPropertyInfoPreparer(ctx, nameID, propertyName, timeout)
11602	if err != nil {
11603		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", nil, "Failure preparing request")
11604		return
11605	}
11606
11607	resp, err := client.GetPropertyInfoSender(req)
11608	if err != nil {
11609		result.Response = autorest.Response{Response: resp}
11610		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", resp, "Failure sending request")
11611		return
11612	}
11613
11614	result, err = client.GetPropertyInfoResponder(resp)
11615	if err != nil {
11616		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", resp, "Failure responding to request")
11617	}
11618
11619	return
11620}
11621
11622// GetPropertyInfoPreparer prepares the GetPropertyInfo request.
11623func (client BaseClient) GetPropertyInfoPreparer(ctx context.Context, nameID string, propertyName string, timeout *int64) (*http.Request, error) {
11624	pathParameters := map[string]interface{}{
11625		"nameId": nameID,
11626	}
11627
11628	const APIVersion = "6.0"
11629	queryParameters := map[string]interface{}{
11630		"api-version":  APIVersion,
11631		"PropertyName": autorest.Encode("query", propertyName),
11632	}
11633	if timeout != nil {
11634		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11635	} else {
11636		queryParameters["timeout"] = autorest.Encode("query", 60)
11637	}
11638
11639	preparer := autorest.CreatePreparer(
11640		autorest.AsGet(),
11641		autorest.WithBaseURL(client.BaseURI),
11642		autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters),
11643		autorest.WithQueryParameters(queryParameters))
11644	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11645}
11646
11647// GetPropertyInfoSender sends the GetPropertyInfo request. The method will close the
11648// http.Response Body if it receives an error.
11649func (client BaseClient) GetPropertyInfoSender(req *http.Request) (*http.Response, error) {
11650	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11651}
11652
11653// GetPropertyInfoResponder handles the response to the GetPropertyInfo request. The method always
11654// closes the http.Response Body.
11655func (client BaseClient) GetPropertyInfoResponder(resp *http.Response) (result PropertyInfo, err error) {
11656	err = autorest.Respond(
11657		resp,
11658		client.ByInspecting(),
11659		azure.WithErrorUnlessStatusCode(http.StatusOK),
11660		autorest.ByUnmarshallingJSON(&result),
11661		autorest.ByClosing())
11662	result.Response = autorest.Response{Response: resp}
11663	return
11664}
11665
11666// GetPropertyInfoList a Service Fabric name can have one or more named properties that stores custom information. This
11667// operation gets the information about these properties in a paged list. The information include name, value and
11668// metadata about each of the properties.
11669// Parameters:
11670// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
11671// includeValues - allows specifying whether to include the values of the properties returned. True if values
11672// should be returned with the metadata; False to return only property metadata.
11673// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
11674// token with a non empty value is included in the response of the API when the results from the system do not
11675// fit in a single response. When this value is passed to the next API call, the API returns next set of
11676// results. If there are no further results then the continuation token does not contain a value. The value of
11677// this parameter should not be URL encoded.
11678// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11679// duration that the client is willing to wait for the requested operation to complete. The default value for
11680// this parameter is 60 seconds.
11681func (client BaseClient) GetPropertyInfoList(ctx context.Context, nameID string, includeValues *bool, continuationToken string, timeout *int64) (result PagedPropertyInfoList, err error) {
11682	if tracing.IsEnabled() {
11683		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPropertyInfoList")
11684		defer func() {
11685			sc := -1
11686			if result.Response.Response != nil {
11687				sc = result.Response.Response.StatusCode
11688			}
11689			tracing.EndSpan(ctx, sc, err)
11690		}()
11691	}
11692	if err := validation.Validate([]validation.Validation{
11693		{TargetValue: timeout,
11694			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11695				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11696					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11697				}}}}}); err != nil {
11698		return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfoList", err.Error())
11699	}
11700
11701	req, err := client.GetPropertyInfoListPreparer(ctx, nameID, includeValues, continuationToken, timeout)
11702	if err != nil {
11703		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", nil, "Failure preparing request")
11704		return
11705	}
11706
11707	resp, err := client.GetPropertyInfoListSender(req)
11708	if err != nil {
11709		result.Response = autorest.Response{Response: resp}
11710		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", resp, "Failure sending request")
11711		return
11712	}
11713
11714	result, err = client.GetPropertyInfoListResponder(resp)
11715	if err != nil {
11716		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", resp, "Failure responding to request")
11717	}
11718
11719	return
11720}
11721
11722// GetPropertyInfoListPreparer prepares the GetPropertyInfoList request.
11723func (client BaseClient) GetPropertyInfoListPreparer(ctx context.Context, nameID string, includeValues *bool, continuationToken string, timeout *int64) (*http.Request, error) {
11724	pathParameters := map[string]interface{}{
11725		"nameId": nameID,
11726	}
11727
11728	const APIVersion = "6.0"
11729	queryParameters := map[string]interface{}{
11730		"api-version": APIVersion,
11731	}
11732	if includeValues != nil {
11733		queryParameters["IncludeValues"] = autorest.Encode("query", *includeValues)
11734	} else {
11735		queryParameters["IncludeValues"] = autorest.Encode("query", false)
11736	}
11737	if len(continuationToken) > 0 {
11738		queryParameters["ContinuationToken"] = continuationToken
11739	}
11740	if timeout != nil {
11741		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11742	} else {
11743		queryParameters["timeout"] = autorest.Encode("query", 60)
11744	}
11745
11746	preparer := autorest.CreatePreparer(
11747		autorest.AsGet(),
11748		autorest.WithBaseURL(client.BaseURI),
11749		autorest.WithPathParameters("/Names/{nameId}/$/GetProperties", pathParameters),
11750		autorest.WithQueryParameters(queryParameters))
11751	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11752}
11753
11754// GetPropertyInfoListSender sends the GetPropertyInfoList request. The method will close the
11755// http.Response Body if it receives an error.
11756func (client BaseClient) GetPropertyInfoListSender(req *http.Request) (*http.Response, error) {
11757	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11758}
11759
11760// GetPropertyInfoListResponder handles the response to the GetPropertyInfoList request. The method always
11761// closes the http.Response Body.
11762func (client BaseClient) GetPropertyInfoListResponder(resp *http.Response) (result PagedPropertyInfoList, err error) {
11763	err = autorest.Respond(
11764		resp,
11765		client.ByInspecting(),
11766		azure.WithErrorUnlessStatusCode(http.StatusOK),
11767		autorest.ByUnmarshallingJSON(&result),
11768		autorest.ByClosing())
11769	result.Response = autorest.Response{Response: resp}
11770	return
11771}
11772
11773// GetProvisionedFabricCodeVersionInfoList gets a list of information about fabric code versions that are provisioned
11774// in the cluster. The parameter CodeVersion can be used to optionally filter the output to only that particular
11775// version.
11776// Parameters:
11777// codeVersion - the product version of Service Fabric.
11778// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11779// duration that the client is willing to wait for the requested operation to complete. The default value for
11780// this parameter is 60 seconds.
11781func (client BaseClient) GetProvisionedFabricCodeVersionInfoList(ctx context.Context, codeVersion string, timeout *int64) (result ListFabricCodeVersionInfo, err error) {
11782	if tracing.IsEnabled() {
11783		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetProvisionedFabricCodeVersionInfoList")
11784		defer func() {
11785			sc := -1
11786			if result.Response.Response != nil {
11787				sc = result.Response.Response.StatusCode
11788			}
11789			tracing.EndSpan(ctx, sc, err)
11790		}()
11791	}
11792	if err := validation.Validate([]validation.Validation{
11793		{TargetValue: timeout,
11794			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11795				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11796					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11797				}}}}}); err != nil {
11798		return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", err.Error())
11799	}
11800
11801	req, err := client.GetProvisionedFabricCodeVersionInfoListPreparer(ctx, codeVersion, timeout)
11802	if err != nil {
11803		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", nil, "Failure preparing request")
11804		return
11805	}
11806
11807	resp, err := client.GetProvisionedFabricCodeVersionInfoListSender(req)
11808	if err != nil {
11809		result.Response = autorest.Response{Response: resp}
11810		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", resp, "Failure sending request")
11811		return
11812	}
11813
11814	result, err = client.GetProvisionedFabricCodeVersionInfoListResponder(resp)
11815	if err != nil {
11816		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", resp, "Failure responding to request")
11817	}
11818
11819	return
11820}
11821
11822// GetProvisionedFabricCodeVersionInfoListPreparer prepares the GetProvisionedFabricCodeVersionInfoList request.
11823func (client BaseClient) GetProvisionedFabricCodeVersionInfoListPreparer(ctx context.Context, codeVersion string, timeout *int64) (*http.Request, error) {
11824	const APIVersion = "6.0"
11825	queryParameters := map[string]interface{}{
11826		"api-version": APIVersion,
11827	}
11828	if len(codeVersion) > 0 {
11829		queryParameters["CodeVersion"] = autorest.Encode("query", codeVersion)
11830	}
11831	if timeout != nil {
11832		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11833	} else {
11834		queryParameters["timeout"] = autorest.Encode("query", 60)
11835	}
11836
11837	preparer := autorest.CreatePreparer(
11838		autorest.AsGet(),
11839		autorest.WithBaseURL(client.BaseURI),
11840		autorest.WithPath("/$/GetProvisionedCodeVersions"),
11841		autorest.WithQueryParameters(queryParameters))
11842	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11843}
11844
11845// GetProvisionedFabricCodeVersionInfoListSender sends the GetProvisionedFabricCodeVersionInfoList request. The method will close the
11846// http.Response Body if it receives an error.
11847func (client BaseClient) GetProvisionedFabricCodeVersionInfoListSender(req *http.Request) (*http.Response, error) {
11848	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11849}
11850
11851// GetProvisionedFabricCodeVersionInfoListResponder handles the response to the GetProvisionedFabricCodeVersionInfoList request. The method always
11852// closes the http.Response Body.
11853func (client BaseClient) GetProvisionedFabricCodeVersionInfoListResponder(resp *http.Response) (result ListFabricCodeVersionInfo, err error) {
11854	err = autorest.Respond(
11855		resp,
11856		client.ByInspecting(),
11857		azure.WithErrorUnlessStatusCode(http.StatusOK),
11858		autorest.ByUnmarshallingJSON(&result.Value),
11859		autorest.ByClosing())
11860	result.Response = autorest.Response{Response: resp}
11861	return
11862}
11863
11864// GetProvisionedFabricConfigVersionInfoList gets a list of information about fabric config versions that are
11865// provisioned in the cluster. The parameter ConfigVersion can be used to optionally filter the output to only that
11866// particular version.
11867// Parameters:
11868// configVersion - the config version of Service Fabric.
11869// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11870// duration that the client is willing to wait for the requested operation to complete. The default value for
11871// this parameter is 60 seconds.
11872func (client BaseClient) GetProvisionedFabricConfigVersionInfoList(ctx context.Context, configVersion string, timeout *int64) (result ListFabricConfigVersionInfo, err error) {
11873	if tracing.IsEnabled() {
11874		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetProvisionedFabricConfigVersionInfoList")
11875		defer func() {
11876			sc := -1
11877			if result.Response.Response != nil {
11878				sc = result.Response.Response.StatusCode
11879			}
11880			tracing.EndSpan(ctx, sc, err)
11881		}()
11882	}
11883	if err := validation.Validate([]validation.Validation{
11884		{TargetValue: timeout,
11885			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11886				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11887					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11888				}}}}}); err != nil {
11889		return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", err.Error())
11890	}
11891
11892	req, err := client.GetProvisionedFabricConfigVersionInfoListPreparer(ctx, configVersion, timeout)
11893	if err != nil {
11894		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", nil, "Failure preparing request")
11895		return
11896	}
11897
11898	resp, err := client.GetProvisionedFabricConfigVersionInfoListSender(req)
11899	if err != nil {
11900		result.Response = autorest.Response{Response: resp}
11901		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", resp, "Failure sending request")
11902		return
11903	}
11904
11905	result, err = client.GetProvisionedFabricConfigVersionInfoListResponder(resp)
11906	if err != nil {
11907		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", resp, "Failure responding to request")
11908	}
11909
11910	return
11911}
11912
11913// GetProvisionedFabricConfigVersionInfoListPreparer prepares the GetProvisionedFabricConfigVersionInfoList request.
11914func (client BaseClient) GetProvisionedFabricConfigVersionInfoListPreparer(ctx context.Context, configVersion string, timeout *int64) (*http.Request, error) {
11915	const APIVersion = "6.0"
11916	queryParameters := map[string]interface{}{
11917		"api-version": APIVersion,
11918	}
11919	if len(configVersion) > 0 {
11920		queryParameters["ConfigVersion"] = autorest.Encode("query", configVersion)
11921	}
11922	if timeout != nil {
11923		queryParameters["timeout"] = autorest.Encode("query", *timeout)
11924	} else {
11925		queryParameters["timeout"] = autorest.Encode("query", 60)
11926	}
11927
11928	preparer := autorest.CreatePreparer(
11929		autorest.AsGet(),
11930		autorest.WithBaseURL(client.BaseURI),
11931		autorest.WithPath("/$/GetProvisionedConfigVersions"),
11932		autorest.WithQueryParameters(queryParameters))
11933	return preparer.Prepare((&http.Request{}).WithContext(ctx))
11934}
11935
11936// GetProvisionedFabricConfigVersionInfoListSender sends the GetProvisionedFabricConfigVersionInfoList request. The method will close the
11937// http.Response Body if it receives an error.
11938func (client BaseClient) GetProvisionedFabricConfigVersionInfoListSender(req *http.Request) (*http.Response, error) {
11939	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11940}
11941
11942// GetProvisionedFabricConfigVersionInfoListResponder handles the response to the GetProvisionedFabricConfigVersionInfoList request. The method always
11943// closes the http.Response Body.
11944func (client BaseClient) GetProvisionedFabricConfigVersionInfoListResponder(resp *http.Response) (result ListFabricConfigVersionInfo, err error) {
11945	err = autorest.Respond(
11946		resp,
11947		client.ByInspecting(),
11948		azure.WithErrorUnlessStatusCode(http.StatusOK),
11949		autorest.ByUnmarshallingJSON(&result.Value),
11950		autorest.ByClosing())
11951	result.Response = autorest.Response{Response: resp}
11952	return
11953}
11954
11955// GetQuorumLossProgress gets the progress of a quorum loss operation started with StartQuorumLoss, using the provided
11956// OperationId.
11957// Parameters:
11958// serviceID - the identity of the service. This is typically the full name of the service without the
11959// 'fabric:' URI scheme.
11960// Starting from version 6.0, hierarchical names are delimited with the "~" character.
11961// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
11962// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
11963// partitionID - the identity of the partition.
11964// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
11965// API
11966// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
11967// duration that the client is willing to wait for the requested operation to complete. The default value for
11968// this parameter is 60 seconds.
11969func (client BaseClient) GetQuorumLossProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionQuorumLossProgress, err error) {
11970	if tracing.IsEnabled() {
11971		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetQuorumLossProgress")
11972		defer func() {
11973			sc := -1
11974			if result.Response.Response != nil {
11975				sc = result.Response.Response.StatusCode
11976			}
11977			tracing.EndSpan(ctx, sc, err)
11978		}()
11979	}
11980	if err := validation.Validate([]validation.Validation{
11981		{TargetValue: timeout,
11982			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
11983				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
11984					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
11985				}}}}}); err != nil {
11986		return result, validation.NewError("servicefabric.BaseClient", "GetQuorumLossProgress", err.Error())
11987	}
11988
11989	req, err := client.GetQuorumLossProgressPreparer(ctx, serviceID, partitionID, operationID, timeout)
11990	if err != nil {
11991		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", nil, "Failure preparing request")
11992		return
11993	}
11994
11995	resp, err := client.GetQuorumLossProgressSender(req)
11996	if err != nil {
11997		result.Response = autorest.Response{Response: resp}
11998		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", resp, "Failure sending request")
11999		return
12000	}
12001
12002	result, err = client.GetQuorumLossProgressResponder(resp)
12003	if err != nil {
12004		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", resp, "Failure responding to request")
12005	}
12006
12007	return
12008}
12009
12010// GetQuorumLossProgressPreparer prepares the GetQuorumLossProgress request.
12011func (client BaseClient) GetQuorumLossProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) {
12012	pathParameters := map[string]interface{}{
12013		"partitionId": partitionID,
12014		"serviceId":   serviceID,
12015	}
12016
12017	const APIVersion = "6.0"
12018	queryParameters := map[string]interface{}{
12019		"api-version": APIVersion,
12020		"OperationId": autorest.Encode("query", operationID),
12021	}
12022	if timeout != nil {
12023		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12024	} else {
12025		queryParameters["timeout"] = autorest.Encode("query", 60)
12026	}
12027
12028	preparer := autorest.CreatePreparer(
12029		autorest.AsGet(),
12030		autorest.WithBaseURL(client.BaseURI),
12031		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetQuorumLossProgress", pathParameters),
12032		autorest.WithQueryParameters(queryParameters))
12033	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12034}
12035
12036// GetQuorumLossProgressSender sends the GetQuorumLossProgress request. The method will close the
12037// http.Response Body if it receives an error.
12038func (client BaseClient) GetQuorumLossProgressSender(req *http.Request) (*http.Response, error) {
12039	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12040}
12041
12042// GetQuorumLossProgressResponder handles the response to the GetQuorumLossProgress request. The method always
12043// closes the http.Response Body.
12044func (client BaseClient) GetQuorumLossProgressResponder(resp *http.Response) (result PartitionQuorumLossProgress, err error) {
12045	err = autorest.Respond(
12046		resp,
12047		client.ByInspecting(),
12048		azure.WithErrorUnlessStatusCode(http.StatusOK),
12049		autorest.ByUnmarshallingJSON(&result),
12050		autorest.ByClosing())
12051	result.Response = autorest.Response{Response: resp}
12052	return
12053}
12054
12055// GetRepairTaskList this API supports the Service Fabric platform; it is not meant to be used directly from your code.
12056// Parameters:
12057// taskIDFilter - the repair task ID prefix to be matched.
12058// stateFilter - a bitwise-OR of the following values, specifying which task states should be included in the
12059// result list.
12060// - 1 - Created
12061// - 2 - Claimed
12062// - 4 - Preparing
12063// - 8 - Approved
12064// - 16 - Executing
12065// - 32 - Restoring
12066// - 64 - Completed
12067// executorFilter - the name of the repair executor whose claimed tasks should be included in the list.
12068func (client BaseClient) GetRepairTaskList(ctx context.Context, taskIDFilter string, stateFilter *int32, executorFilter string) (result ListRepairTask, err error) {
12069	if tracing.IsEnabled() {
12070		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetRepairTaskList")
12071		defer func() {
12072			sc := -1
12073			if result.Response.Response != nil {
12074				sc = result.Response.Response.StatusCode
12075			}
12076			tracing.EndSpan(ctx, sc, err)
12077		}()
12078	}
12079	req, err := client.GetRepairTaskListPreparer(ctx, taskIDFilter, stateFilter, executorFilter)
12080	if err != nil {
12081		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", nil, "Failure preparing request")
12082		return
12083	}
12084
12085	resp, err := client.GetRepairTaskListSender(req)
12086	if err != nil {
12087		result.Response = autorest.Response{Response: resp}
12088		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", resp, "Failure sending request")
12089		return
12090	}
12091
12092	result, err = client.GetRepairTaskListResponder(resp)
12093	if err != nil {
12094		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", resp, "Failure responding to request")
12095	}
12096
12097	return
12098}
12099
12100// GetRepairTaskListPreparer prepares the GetRepairTaskList request.
12101func (client BaseClient) GetRepairTaskListPreparer(ctx context.Context, taskIDFilter string, stateFilter *int32, executorFilter string) (*http.Request, error) {
12102	const APIVersion = "6.0"
12103	queryParameters := map[string]interface{}{
12104		"api-version": APIVersion,
12105	}
12106	if len(taskIDFilter) > 0 {
12107		queryParameters["TaskIdFilter"] = autorest.Encode("query", taskIDFilter)
12108	}
12109	if stateFilter != nil {
12110		queryParameters["StateFilter"] = autorest.Encode("query", *stateFilter)
12111	}
12112	if len(executorFilter) > 0 {
12113		queryParameters["ExecutorFilter"] = autorest.Encode("query", executorFilter)
12114	}
12115
12116	preparer := autorest.CreatePreparer(
12117		autorest.AsGet(),
12118		autorest.WithBaseURL(client.BaseURI),
12119		autorest.WithPath("/$/GetRepairTaskList"),
12120		autorest.WithQueryParameters(queryParameters))
12121	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12122}
12123
12124// GetRepairTaskListSender sends the GetRepairTaskList request. The method will close the
12125// http.Response Body if it receives an error.
12126func (client BaseClient) GetRepairTaskListSender(req *http.Request) (*http.Response, error) {
12127	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12128}
12129
12130// GetRepairTaskListResponder handles the response to the GetRepairTaskList request. The method always
12131// closes the http.Response Body.
12132func (client BaseClient) GetRepairTaskListResponder(resp *http.Response) (result ListRepairTask, err error) {
12133	err = autorest.Respond(
12134		resp,
12135		client.ByInspecting(),
12136		azure.WithErrorUnlessStatusCode(http.StatusOK),
12137		autorest.ByUnmarshallingJSON(&result.Value),
12138		autorest.ByClosing())
12139	result.Response = autorest.Response{Response: resp}
12140	return
12141}
12142
12143// GetReplicaHealth gets the health of a Service Fabric replica.
12144// Use EventsHealthStateFilter to filter the collection of health events reported on the replica based on the health
12145// state.
12146// Parameters:
12147// partitionID - the identity of the partition.
12148// replicaID - the identifier of the replica.
12149// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
12150// state.
12151// The possible values for this parameter include integer value of one of the following health states.
12152// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
12153// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
12154// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
12155// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
12156//
12157// - Default - Default value. Matches any HealthState. The value is zero.
12158// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
12159// collection of states. The value is 1.
12160// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
12161// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
12162// - Error - Filter that matches input with HealthState value Error. The value is 8.
12163// - All - Filter that matches input with any HealthState value. The value is 65535.
12164// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12165// duration that the client is willing to wait for the requested operation to complete. The default value for
12166// this parameter is 60 seconds.
12167func (client BaseClient) GetReplicaHealth(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, timeout *int64) (result ReplicaHealthModel, err error) {
12168	if tracing.IsEnabled() {
12169		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaHealth")
12170		defer func() {
12171			sc := -1
12172			if result.Response.Response != nil {
12173				sc = result.Response.Response.StatusCode
12174			}
12175			tracing.EndSpan(ctx, sc, err)
12176		}()
12177	}
12178	if err := validation.Validate([]validation.Validation{
12179		{TargetValue: timeout,
12180			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12181				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12182					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12183				}}}}}); err != nil {
12184		return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealth", err.Error())
12185	}
12186
12187	req, err := client.GetReplicaHealthPreparer(ctx, partitionID, replicaID, eventsHealthStateFilter, timeout)
12188	if err != nil {
12189		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", nil, "Failure preparing request")
12190		return
12191	}
12192
12193	resp, err := client.GetReplicaHealthSender(req)
12194	if err != nil {
12195		result.Response = autorest.Response{Response: resp}
12196		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", resp, "Failure sending request")
12197		return
12198	}
12199
12200	result, err = client.GetReplicaHealthResponder(resp)
12201	if err != nil {
12202		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", resp, "Failure responding to request")
12203	}
12204
12205	return
12206}
12207
12208// GetReplicaHealthPreparer prepares the GetReplicaHealth request.
12209func (client BaseClient) GetReplicaHealthPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) {
12210	pathParameters := map[string]interface{}{
12211		"partitionId": partitionID,
12212		"replicaId":   replicaID,
12213	}
12214
12215	const APIVersion = "6.0"
12216	queryParameters := map[string]interface{}{
12217		"api-version": APIVersion,
12218	}
12219	if eventsHealthStateFilter != nil {
12220		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
12221	} else {
12222		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
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.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth", pathParameters),
12234		autorest.WithQueryParameters(queryParameters))
12235	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12236}
12237
12238// GetReplicaHealthSender sends the GetReplicaHealth request. The method will close the
12239// http.Response Body if it receives an error.
12240func (client BaseClient) GetReplicaHealthSender(req *http.Request) (*http.Response, error) {
12241	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12242}
12243
12244// GetReplicaHealthResponder handles the response to the GetReplicaHealth request. The method always
12245// closes the http.Response Body.
12246func (client BaseClient) GetReplicaHealthResponder(resp *http.Response) (result ReplicaHealthModel, err error) {
12247	err = autorest.Respond(
12248		resp,
12249		client.ByInspecting(),
12250		azure.WithErrorUnlessStatusCode(http.StatusOK),
12251		autorest.ByUnmarshallingJSON(&result),
12252		autorest.ByClosing())
12253	result.Response = autorest.Response{Response: resp}
12254	return
12255}
12256
12257// GetReplicaHealthUsingPolicy gets the health of a Service Fabric stateful service replica or stateless service
12258// instance.
12259// Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health
12260// state.
12261// Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only
12262// uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while
12263// evaluating the health of the replica.
12264// Parameters:
12265// partitionID - the identity of the partition.
12266// replicaID - the identifier of the replica.
12267// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
12268// state.
12269// The possible values for this parameter include integer value of one of the following health states.
12270// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
12271// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
12272// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
12273// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
12274//
12275// - Default - Default value. Matches any HealthState. The value is zero.
12276// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
12277// collection of states. The value is 1.
12278// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
12279// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
12280// - Error - Filter that matches input with HealthState value Error. The value is 8.
12281// - All - Filter that matches input with any HealthState value. The value is 65535.
12282// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
12283// of its children.
12284// If not present, the health evaluation uses the health policy from application manifest or the default health
12285// policy.
12286// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12287// duration that the client is willing to wait for the requested operation to complete. The default value for
12288// this parameter is 60 seconds.
12289func (client BaseClient) GetReplicaHealthUsingPolicy(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result ReplicaHealthModel, err error) {
12290	if tracing.IsEnabled() {
12291		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaHealthUsingPolicy")
12292		defer func() {
12293			sc := -1
12294			if result.Response.Response != nil {
12295				sc = result.Response.Response.StatusCode
12296			}
12297			tracing.EndSpan(ctx, sc, err)
12298		}()
12299	}
12300	if err := validation.Validate([]validation.Validation{
12301		{TargetValue: timeout,
12302			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12303				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12304					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12305				}}}}}); err != nil {
12306		return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", err.Error())
12307	}
12308
12309	req, err := client.GetReplicaHealthUsingPolicyPreparer(ctx, partitionID, replicaID, eventsHealthStateFilter, applicationHealthPolicy, timeout)
12310	if err != nil {
12311		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", nil, "Failure preparing request")
12312		return
12313	}
12314
12315	resp, err := client.GetReplicaHealthUsingPolicySender(req)
12316	if err != nil {
12317		result.Response = autorest.Response{Response: resp}
12318		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", resp, "Failure sending request")
12319		return
12320	}
12321
12322	result, err = client.GetReplicaHealthUsingPolicyResponder(resp)
12323	if err != nil {
12324		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", resp, "Failure responding to request")
12325	}
12326
12327	return
12328}
12329
12330// GetReplicaHealthUsingPolicyPreparer prepares the GetReplicaHealthUsingPolicy request.
12331func (client BaseClient) GetReplicaHealthUsingPolicyPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) {
12332	pathParameters := map[string]interface{}{
12333		"partitionId": partitionID,
12334		"replicaId":   replicaID,
12335	}
12336
12337	const APIVersion = "6.0"
12338	queryParameters := map[string]interface{}{
12339		"api-version": APIVersion,
12340	}
12341	if eventsHealthStateFilter != nil {
12342		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
12343	} else {
12344		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
12345	}
12346	if timeout != nil {
12347		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12348	} else {
12349		queryParameters["timeout"] = autorest.Encode("query", 60)
12350	}
12351
12352	preparer := autorest.CreatePreparer(
12353		autorest.AsContentType("application/json; charset=utf-8"),
12354		autorest.AsPost(),
12355		autorest.WithBaseURL(client.BaseURI),
12356		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth", pathParameters),
12357		autorest.WithQueryParameters(queryParameters))
12358	if applicationHealthPolicy != nil {
12359		preparer = autorest.DecoratePreparer(preparer,
12360			autorest.WithJSON(applicationHealthPolicy))
12361	}
12362	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12363}
12364
12365// GetReplicaHealthUsingPolicySender sends the GetReplicaHealthUsingPolicy request. The method will close the
12366// http.Response Body if it receives an error.
12367func (client BaseClient) GetReplicaHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
12368	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12369}
12370
12371// GetReplicaHealthUsingPolicyResponder handles the response to the GetReplicaHealthUsingPolicy request. The method always
12372// closes the http.Response Body.
12373func (client BaseClient) GetReplicaHealthUsingPolicyResponder(resp *http.Response) (result ReplicaHealthModel, err error) {
12374	err = autorest.Respond(
12375		resp,
12376		client.ByInspecting(),
12377		azure.WithErrorUnlessStatusCode(http.StatusOK),
12378		autorest.ByUnmarshallingJSON(&result),
12379		autorest.ByClosing())
12380	result.Response = autorest.Response{Response: resp}
12381	return
12382}
12383
12384// GetReplicaInfo the response includes the id, role, status, health, node name, uptime, and other details about the
12385// replica.
12386// Parameters:
12387// partitionID - the identity of the partition.
12388// replicaID - the identifier of the replica.
12389// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12390// duration that the client is willing to wait for the requested operation to complete. The default value for
12391// this parameter is 60 seconds.
12392func (client BaseClient) GetReplicaInfo(ctx context.Context, partitionID uuid.UUID, replicaID string, timeout *int64) (result ReplicaInfoModel, err error) {
12393	if tracing.IsEnabled() {
12394		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaInfo")
12395		defer func() {
12396			sc := -1
12397			if result.Response.Response != nil {
12398				sc = result.Response.Response.StatusCode
12399			}
12400			tracing.EndSpan(ctx, sc, err)
12401		}()
12402	}
12403	if err := validation.Validate([]validation.Validation{
12404		{TargetValue: timeout,
12405			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12406				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12407					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12408				}}}}}); err != nil {
12409		return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfo", err.Error())
12410	}
12411
12412	req, err := client.GetReplicaInfoPreparer(ctx, partitionID, replicaID, timeout)
12413	if err != nil {
12414		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", nil, "Failure preparing request")
12415		return
12416	}
12417
12418	resp, err := client.GetReplicaInfoSender(req)
12419	if err != nil {
12420		result.Response = autorest.Response{Response: resp}
12421		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", resp, "Failure sending request")
12422		return
12423	}
12424
12425	result, err = client.GetReplicaInfoResponder(resp)
12426	if err != nil {
12427		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", resp, "Failure responding to request")
12428	}
12429
12430	return
12431}
12432
12433// GetReplicaInfoPreparer prepares the GetReplicaInfo request.
12434func (client BaseClient) GetReplicaInfoPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) {
12435	pathParameters := map[string]interface{}{
12436		"partitionId": partitionID,
12437		"replicaId":   replicaID,
12438	}
12439
12440	const APIVersion = "6.0"
12441	queryParameters := map[string]interface{}{
12442		"api-version": APIVersion,
12443	}
12444	if timeout != nil {
12445		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12446	} else {
12447		queryParameters["timeout"] = autorest.Encode("query", 60)
12448	}
12449
12450	preparer := autorest.CreatePreparer(
12451		autorest.AsGet(),
12452		autorest.WithBaseURL(client.BaseURI),
12453		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}", pathParameters),
12454		autorest.WithQueryParameters(queryParameters))
12455	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12456}
12457
12458// GetReplicaInfoSender sends the GetReplicaInfo request. The method will close the
12459// http.Response Body if it receives an error.
12460func (client BaseClient) GetReplicaInfoSender(req *http.Request) (*http.Response, error) {
12461	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12462}
12463
12464// GetReplicaInfoResponder handles the response to the GetReplicaInfo request. The method always
12465// closes the http.Response Body.
12466func (client BaseClient) GetReplicaInfoResponder(resp *http.Response) (result ReplicaInfoModel, err error) {
12467	err = autorest.Respond(
12468		resp,
12469		client.ByInspecting(),
12470		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
12471		autorest.ByUnmarshallingJSON(&result),
12472		autorest.ByClosing())
12473	result.Response = autorest.Response{Response: resp}
12474	return
12475}
12476
12477// GetReplicaInfoList the GetReplicas endpoint returns information about the replicas of the specified partition. The
12478// response includes the id, role, status, health, node name, uptime, and other details about the replica.
12479// Parameters:
12480// partitionID - the identity of the partition.
12481// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
12482// token with a non empty value is included in the response of the API when the results from the system do not
12483// fit in a single response. When this value is passed to the next API call, the API returns next set of
12484// results. If there are no further results then the continuation token does not contain a value. The value of
12485// this parameter should not be URL encoded.
12486// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12487// duration that the client is willing to wait for the requested operation to complete. The default value for
12488// this parameter is 60 seconds.
12489func (client BaseClient) GetReplicaInfoList(ctx context.Context, partitionID uuid.UUID, continuationToken string, timeout *int64) (result PagedReplicaInfoList, err error) {
12490	if tracing.IsEnabled() {
12491		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaInfoList")
12492		defer func() {
12493			sc := -1
12494			if result.Response.Response != nil {
12495				sc = result.Response.Response.StatusCode
12496			}
12497			tracing.EndSpan(ctx, sc, err)
12498		}()
12499	}
12500	if err := validation.Validate([]validation.Validation{
12501		{TargetValue: timeout,
12502			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12503				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12504					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12505				}}}}}); err != nil {
12506		return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfoList", err.Error())
12507	}
12508
12509	req, err := client.GetReplicaInfoListPreparer(ctx, partitionID, continuationToken, timeout)
12510	if err != nil {
12511		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", nil, "Failure preparing request")
12512		return
12513	}
12514
12515	resp, err := client.GetReplicaInfoListSender(req)
12516	if err != nil {
12517		result.Response = autorest.Response{Response: resp}
12518		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", resp, "Failure sending request")
12519		return
12520	}
12521
12522	result, err = client.GetReplicaInfoListResponder(resp)
12523	if err != nil {
12524		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", resp, "Failure responding to request")
12525	}
12526
12527	return
12528}
12529
12530// GetReplicaInfoListPreparer prepares the GetReplicaInfoList request.
12531func (client BaseClient) GetReplicaInfoListPreparer(ctx context.Context, partitionID uuid.UUID, continuationToken string, timeout *int64) (*http.Request, error) {
12532	pathParameters := map[string]interface{}{
12533		"partitionId": partitionID,
12534	}
12535
12536	const APIVersion = "6.0"
12537	queryParameters := map[string]interface{}{
12538		"api-version": APIVersion,
12539	}
12540	if len(continuationToken) > 0 {
12541		queryParameters["ContinuationToken"] = continuationToken
12542	}
12543	if timeout != nil {
12544		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12545	} else {
12546		queryParameters["timeout"] = autorest.Encode("query", 60)
12547	}
12548
12549	preparer := autorest.CreatePreparer(
12550		autorest.AsGet(),
12551		autorest.WithBaseURL(client.BaseURI),
12552		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas", pathParameters),
12553		autorest.WithQueryParameters(queryParameters))
12554	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12555}
12556
12557// GetReplicaInfoListSender sends the GetReplicaInfoList request. The method will close the
12558// http.Response Body if it receives an error.
12559func (client BaseClient) GetReplicaInfoListSender(req *http.Request) (*http.Response, error) {
12560	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12561}
12562
12563// GetReplicaInfoListResponder handles the response to the GetReplicaInfoList request. The method always
12564// closes the http.Response Body.
12565func (client BaseClient) GetReplicaInfoListResponder(resp *http.Response) (result PagedReplicaInfoList, err error) {
12566	err = autorest.Respond(
12567		resp,
12568		client.ByInspecting(),
12569		azure.WithErrorUnlessStatusCode(http.StatusOK),
12570		autorest.ByUnmarshallingJSON(&result),
12571		autorest.ByClosing())
12572	result.Response = autorest.Response{Response: resp}
12573	return
12574}
12575
12576// GetServiceBackupConfigurationInfo gets the Service Fabric backup configuration information for the service and the
12577// partitions under this service.
12578// Parameters:
12579// serviceID - the identity of the service. This is typically the full name of the service without the
12580// 'fabric:' URI scheme.
12581// Starting from version 6.0, hierarchical names are delimited with the "~" character.
12582// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
12583// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
12584// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
12585// token with a non empty value is included in the response of the API when the results from the system do not
12586// fit in a single response. When this value is passed to the next API call, the API returns next set of
12587// results. If there are no further results then the continuation token does not contain a value. The value of
12588// this parameter should not be URL encoded.
12589// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
12590// defines the upper bound on the number of results returned. The results returned can be less than the
12591// specified maximum results if they do not fit in the message as per the max message size restrictions defined
12592// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
12593// as possible that fit in the return message.
12594// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12595// duration that the client is willing to wait for the requested operation to complete. The default value for
12596// this parameter is 60 seconds.
12597func (client BaseClient) GetServiceBackupConfigurationInfo(ctx context.Context, serviceID string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupConfigurationInfoList, err error) {
12598	if tracing.IsEnabled() {
12599		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceBackupConfigurationInfo")
12600		defer func() {
12601			sc := -1
12602			if result.Response.Response != nil {
12603				sc = result.Response.Response.StatusCode
12604			}
12605			tracing.EndSpan(ctx, sc, err)
12606		}()
12607	}
12608	if err := validation.Validate([]validation.Validation{
12609		{TargetValue: maxResults,
12610			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
12611				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
12612		{TargetValue: timeout,
12613			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12614				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12615					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12616				}}}}}); err != nil {
12617		return result, validation.NewError("servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", err.Error())
12618	}
12619
12620	req, err := client.GetServiceBackupConfigurationInfoPreparer(ctx, serviceID, continuationToken, maxResults, timeout)
12621	if err != nil {
12622		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", nil, "Failure preparing request")
12623		return
12624	}
12625
12626	resp, err := client.GetServiceBackupConfigurationInfoSender(req)
12627	if err != nil {
12628		result.Response = autorest.Response{Response: resp}
12629		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", resp, "Failure sending request")
12630		return
12631	}
12632
12633	result, err = client.GetServiceBackupConfigurationInfoResponder(resp)
12634	if err != nil {
12635		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", resp, "Failure responding to request")
12636	}
12637
12638	return
12639}
12640
12641// GetServiceBackupConfigurationInfoPreparer prepares the GetServiceBackupConfigurationInfo request.
12642func (client BaseClient) GetServiceBackupConfigurationInfoPreparer(ctx context.Context, serviceID string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) {
12643	pathParameters := map[string]interface{}{
12644		"serviceId": serviceID,
12645	}
12646
12647	const APIVersion = "6.2-preview"
12648	queryParameters := map[string]interface{}{
12649		"api-version": APIVersion,
12650	}
12651	if len(continuationToken) > 0 {
12652		queryParameters["ContinuationToken"] = continuationToken
12653	}
12654	if maxResults != nil {
12655		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
12656	} else {
12657		queryParameters["MaxResults"] = autorest.Encode("query", 0)
12658	}
12659	if timeout != nil {
12660		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12661	} else {
12662		queryParameters["timeout"] = autorest.Encode("query", 60)
12663	}
12664
12665	preparer := autorest.CreatePreparer(
12666		autorest.AsGet(),
12667		autorest.WithBaseURL(client.BaseURI),
12668		autorest.WithPathParameters("/Services/{serviceId}/$/GetBackupConfigurationInfo", pathParameters),
12669		autorest.WithQueryParameters(queryParameters))
12670	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12671}
12672
12673// GetServiceBackupConfigurationInfoSender sends the GetServiceBackupConfigurationInfo request. The method will close the
12674// http.Response Body if it receives an error.
12675func (client BaseClient) GetServiceBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) {
12676	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12677}
12678
12679// GetServiceBackupConfigurationInfoResponder handles the response to the GetServiceBackupConfigurationInfo request. The method always
12680// closes the http.Response Body.
12681func (client BaseClient) GetServiceBackupConfigurationInfoResponder(resp *http.Response) (result PagedBackupConfigurationInfoList, err error) {
12682	err = autorest.Respond(
12683		resp,
12684		client.ByInspecting(),
12685		azure.WithErrorUnlessStatusCode(http.StatusOK),
12686		autorest.ByUnmarshallingJSON(&result),
12687		autorest.ByClosing())
12688	result.Response = autorest.Response{Response: resp}
12689	return
12690}
12691
12692// GetServiceBackupList returns a list of backups available for every partition in this Service Fabric service. The
12693// server enumerates all the backups available in the backup store configured in the backup policy. It also allows
12694// filtering of the result based on start and end datetime or just fetching the latest available backup for every
12695// partition.
12696// Parameters:
12697// serviceID - the identity of the service. This is typically the full name of the service without the
12698// 'fabric:' URI scheme.
12699// Starting from version 6.0, hierarchical names are delimited with the "~" character.
12700// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
12701// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
12702// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12703// duration that the client is willing to wait for the requested operation to complete. The default value for
12704// this parameter is 60 seconds.
12705// latest - specifies whether to get only the most recent backup available for a partition for the specified
12706// time range.
12707// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The
12708// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups
12709// from the beginning are enumerated.
12710// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date
12711// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is
12712// done till the most recent backup.
12713// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
12714// token with a non empty value is included in the response of the API when the results from the system do not
12715// fit in a single response. When this value is passed to the next API call, the API returns next set of
12716// results. If there are no further results then the continuation token does not contain a value. The value of
12717// this parameter should not be URL encoded.
12718// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter
12719// defines the upper bound on the number of results returned. The results returned can be less than the
12720// specified maximum results if they do not fit in the message as per the max message size restrictions defined
12721// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results
12722// as possible that fit in the return message.
12723func (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) {
12724	if tracing.IsEnabled() {
12725		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceBackupList")
12726		defer func() {
12727			sc := -1
12728			if result.Response.Response != nil {
12729				sc = result.Response.Response.StatusCode
12730			}
12731			tracing.EndSpan(ctx, sc, err)
12732		}()
12733	}
12734	if err := validation.Validate([]validation.Validation{
12735		{TargetValue: timeout,
12736			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12737				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12738					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12739				}}}},
12740		{TargetValue: maxResults,
12741			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
12742				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil {
12743		return result, validation.NewError("servicefabric.BaseClient", "GetServiceBackupList", err.Error())
12744	}
12745
12746	req, err := client.GetServiceBackupListPreparer(ctx, serviceID, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults)
12747	if err != nil {
12748		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", nil, "Failure preparing request")
12749		return
12750	}
12751
12752	resp, err := client.GetServiceBackupListSender(req)
12753	if err != nil {
12754		result.Response = autorest.Response{Response: resp}
12755		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", resp, "Failure sending request")
12756		return
12757	}
12758
12759	result, err = client.GetServiceBackupListResponder(resp)
12760	if err != nil {
12761		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", resp, "Failure responding to request")
12762	}
12763
12764	return
12765}
12766
12767// GetServiceBackupListPreparer prepares the GetServiceBackupList request.
12768func (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) {
12769	pathParameters := map[string]interface{}{
12770		"serviceId": serviceID,
12771	}
12772
12773	const APIVersion = "6.2-preview"
12774	queryParameters := map[string]interface{}{
12775		"api-version": APIVersion,
12776	}
12777	if timeout != nil {
12778		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12779	} else {
12780		queryParameters["timeout"] = autorest.Encode("query", 60)
12781	}
12782	if latest != nil {
12783		queryParameters["Latest"] = autorest.Encode("query", *latest)
12784	} else {
12785		queryParameters["Latest"] = autorest.Encode("query", false)
12786	}
12787	if startDateTimeFilter != nil {
12788		queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter)
12789	}
12790	if endDateTimeFilter != nil {
12791		queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter)
12792	}
12793	if len(continuationToken) > 0 {
12794		queryParameters["ContinuationToken"] = continuationToken
12795	}
12796	if maxResults != nil {
12797		queryParameters["MaxResults"] = autorest.Encode("query", *maxResults)
12798	} else {
12799		queryParameters["MaxResults"] = autorest.Encode("query", 0)
12800	}
12801
12802	preparer := autorest.CreatePreparer(
12803		autorest.AsGet(),
12804		autorest.WithBaseURL(client.BaseURI),
12805		autorest.WithPathParameters("/Services/{serviceId}/$/GetBackups", pathParameters),
12806		autorest.WithQueryParameters(queryParameters))
12807	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12808}
12809
12810// GetServiceBackupListSender sends the GetServiceBackupList request. The method will close the
12811// http.Response Body if it receives an error.
12812func (client BaseClient) GetServiceBackupListSender(req *http.Request) (*http.Response, error) {
12813	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12814}
12815
12816// GetServiceBackupListResponder handles the response to the GetServiceBackupList request. The method always
12817// closes the http.Response Body.
12818func (client BaseClient) GetServiceBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) {
12819	err = autorest.Respond(
12820		resp,
12821		client.ByInspecting(),
12822		azure.WithErrorUnlessStatusCode(http.StatusOK),
12823		autorest.ByUnmarshallingJSON(&result),
12824		autorest.ByClosing())
12825	result.Response = autorest.Response{Response: resp}
12826	return
12827}
12828
12829// GetServiceDescription gets the description of an existing Service Fabric service. A service must be created before
12830// its description can be obtained.
12831// Parameters:
12832// serviceID - the identity of the service. This is typically the full name of the service without the
12833// 'fabric:' URI scheme.
12834// Starting from version 6.0, hierarchical names are delimited with the "~" character.
12835// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
12836// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
12837// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12838// duration that the client is willing to wait for the requested operation to complete. The default value for
12839// this parameter is 60 seconds.
12840func (client BaseClient) GetServiceDescription(ctx context.Context, serviceID string, timeout *int64) (result ServiceDescriptionModel, err error) {
12841	if tracing.IsEnabled() {
12842		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceDescription")
12843		defer func() {
12844			sc := -1
12845			if result.Response.Response != nil {
12846				sc = result.Response.Response.StatusCode
12847			}
12848			tracing.EndSpan(ctx, sc, err)
12849		}()
12850	}
12851	if err := validation.Validate([]validation.Validation{
12852		{TargetValue: timeout,
12853			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12854				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12855					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12856				}}}}}); err != nil {
12857		return result, validation.NewError("servicefabric.BaseClient", "GetServiceDescription", err.Error())
12858	}
12859
12860	req, err := client.GetServiceDescriptionPreparer(ctx, serviceID, timeout)
12861	if err != nil {
12862		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", nil, "Failure preparing request")
12863		return
12864	}
12865
12866	resp, err := client.GetServiceDescriptionSender(req)
12867	if err != nil {
12868		result.Response = autorest.Response{Response: resp}
12869		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", resp, "Failure sending request")
12870		return
12871	}
12872
12873	result, err = client.GetServiceDescriptionResponder(resp)
12874	if err != nil {
12875		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", resp, "Failure responding to request")
12876	}
12877
12878	return
12879}
12880
12881// GetServiceDescriptionPreparer prepares the GetServiceDescription request.
12882func (client BaseClient) GetServiceDescriptionPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
12883	pathParameters := map[string]interface{}{
12884		"serviceId": serviceID,
12885	}
12886
12887	const APIVersion = "6.0"
12888	queryParameters := map[string]interface{}{
12889		"api-version": APIVersion,
12890	}
12891	if timeout != nil {
12892		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12893	} else {
12894		queryParameters["timeout"] = autorest.Encode("query", 60)
12895	}
12896
12897	preparer := autorest.CreatePreparer(
12898		autorest.AsGet(),
12899		autorest.WithBaseURL(client.BaseURI),
12900		autorest.WithPathParameters("/Services/{serviceId}/$/GetDescription", pathParameters),
12901		autorest.WithQueryParameters(queryParameters))
12902	return preparer.Prepare((&http.Request{}).WithContext(ctx))
12903}
12904
12905// GetServiceDescriptionSender sends the GetServiceDescription request. The method will close the
12906// http.Response Body if it receives an error.
12907func (client BaseClient) GetServiceDescriptionSender(req *http.Request) (*http.Response, error) {
12908	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12909}
12910
12911// GetServiceDescriptionResponder handles the response to the GetServiceDescription request. The method always
12912// closes the http.Response Body.
12913func (client BaseClient) GetServiceDescriptionResponder(resp *http.Response) (result ServiceDescriptionModel, err error) {
12914	err = autorest.Respond(
12915		resp,
12916		client.ByInspecting(),
12917		azure.WithErrorUnlessStatusCode(http.StatusOK),
12918		autorest.ByUnmarshallingJSON(&result),
12919		autorest.ByClosing())
12920	result.Response = autorest.Response{Response: resp}
12921	return
12922}
12923
12924// GetServiceEventList the response is list of ServiceEvent objects.
12925// Parameters:
12926// serviceID - the identity of the service. This is typically the full name of the service without the
12927// 'fabric:' URI scheme.
12928// Starting from version 6.0, hierarchical names are delimited with the "~" character.
12929// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
12930// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
12931// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
12932// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
12933// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
12934// duration that the client is willing to wait for the requested operation to complete. The default value for
12935// this parameter is 60 seconds.
12936// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
12937// be included in the response.
12938// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
12939// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
12940// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
12941// populated.
12942func (client BaseClient) GetServiceEventList(ctx context.Context, serviceID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListServiceEvent, err error) {
12943	if tracing.IsEnabled() {
12944		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceEventList")
12945		defer func() {
12946			sc := -1
12947			if result.Response.Response != nil {
12948				sc = result.Response.Response.StatusCode
12949			}
12950			tracing.EndSpan(ctx, sc, err)
12951		}()
12952	}
12953	if err := validation.Validate([]validation.Validation{
12954		{TargetValue: timeout,
12955			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
12956				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
12957					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
12958				}}}}}); err != nil {
12959		return result, validation.NewError("servicefabric.BaseClient", "GetServiceEventList", err.Error())
12960	}
12961
12962	req, err := client.GetServiceEventListPreparer(ctx, serviceID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
12963	if err != nil {
12964		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", nil, "Failure preparing request")
12965		return
12966	}
12967
12968	resp, err := client.GetServiceEventListSender(req)
12969	if err != nil {
12970		result.Response = autorest.Response{Response: resp}
12971		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", resp, "Failure sending request")
12972		return
12973	}
12974
12975	result, err = client.GetServiceEventListResponder(resp)
12976	if err != nil {
12977		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", resp, "Failure responding to request")
12978	}
12979
12980	return
12981}
12982
12983// GetServiceEventListPreparer prepares the GetServiceEventList request.
12984func (client BaseClient) GetServiceEventListPreparer(ctx context.Context, serviceID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
12985	pathParameters := map[string]interface{}{
12986		"serviceId": serviceID,
12987	}
12988
12989	const APIVersion = "6.2-preview"
12990	queryParameters := map[string]interface{}{
12991		"api-version":  APIVersion,
12992		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
12993		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
12994	}
12995	if timeout != nil {
12996		queryParameters["timeout"] = autorest.Encode("query", *timeout)
12997	} else {
12998		queryParameters["timeout"] = autorest.Encode("query", 60)
12999	}
13000	if len(eventsTypesFilter) > 0 {
13001		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
13002	}
13003	if excludeAnalysisEvents != nil {
13004		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
13005	}
13006	if skipCorrelationLookup != nil {
13007		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
13008	}
13009
13010	preparer := autorest.CreatePreparer(
13011		autorest.AsGet(),
13012		autorest.WithBaseURL(client.BaseURI),
13013		autorest.WithPathParameters("/EventsStore/Services/{serviceId}/$/Events", pathParameters),
13014		autorest.WithQueryParameters(queryParameters))
13015	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13016}
13017
13018// GetServiceEventListSender sends the GetServiceEventList request. The method will close the
13019// http.Response Body if it receives an error.
13020func (client BaseClient) GetServiceEventListSender(req *http.Request) (*http.Response, error) {
13021	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13022}
13023
13024// GetServiceEventListResponder handles the response to the GetServiceEventList request. The method always
13025// closes the http.Response Body.
13026func (client BaseClient) GetServiceEventListResponder(resp *http.Response) (result ListServiceEvent, err error) {
13027	err = autorest.Respond(
13028		resp,
13029		client.ByInspecting(),
13030		azure.WithErrorUnlessStatusCode(http.StatusOK),
13031		autorest.ByUnmarshallingJSON(&result),
13032		autorest.ByClosing())
13033	result.Response = autorest.Response{Response: resp}
13034	return
13035}
13036
13037// GetServiceHealth gets the health information of the specified service.
13038// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health
13039// state.
13040// Use PartitionsHealthStateFilter to filter the collection of partitions returned.
13041// If you specify a service that does not exist in the health store, this request returns an error.
13042// Parameters:
13043// serviceID - the identity of the service. This is typically the full name of the service without the
13044// 'fabric:' URI scheme.
13045// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13046// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
13047// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
13048// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
13049// state.
13050// The possible values for this parameter include integer value of one of the following health states.
13051// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
13052// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
13053// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
13054// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
13055//
13056// - Default - Default value. Matches any HealthState. The value is zero.
13057// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
13058// collection of states. The value is 1.
13059// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
13060// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
13061// - Error - Filter that matches input with HealthState value Error. The value is 8.
13062// - All - Filter that matches input with any HealthState value. The value is 65535.
13063// partitionsHealthStateFilter - allows filtering of the partitions health state objects returned in the result
13064// of service health query based on their health state.
13065// The possible values for this parameter include integer value of one of the following health states.
13066// Only partitions that match the filter are returned. All partitions are used to evaluate the aggregated
13067// health state.
13068// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
13069// be a combination of these value
13070// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of
13071// partitions with HealthState value of OK (2) and Warning (4) will be returned.
13072//
13073// - Default - Default value. Matches any HealthState. The value is zero.
13074// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
13075// collection of states. The value is 1.
13076// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
13077// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
13078// - Error - Filter that matches input with HealthState value Error. The value is 8.
13079// - All - Filter that matches input with any HealthState value. The value is 65535.
13080// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
13081// result. False by default.
13082// The statistics show the number of children entities in health state Ok, Warning, and Error.
13083// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13084// duration that the client is willing to wait for the requested operation to complete. The default value for
13085// this parameter is 60 seconds.
13086func (client BaseClient) GetServiceHealth(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result ServiceHealth, err error) {
13087	if tracing.IsEnabled() {
13088		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceHealth")
13089		defer func() {
13090			sc := -1
13091			if result.Response.Response != nil {
13092				sc = result.Response.Response.StatusCode
13093			}
13094			tracing.EndSpan(ctx, sc, err)
13095		}()
13096	}
13097	if err := validation.Validate([]validation.Validation{
13098		{TargetValue: timeout,
13099			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13100				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13101					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13102				}}}}}); err != nil {
13103		return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealth", err.Error())
13104	}
13105
13106	req, err := client.GetServiceHealthPreparer(ctx, serviceID, eventsHealthStateFilter, partitionsHealthStateFilter, excludeHealthStatistics, timeout)
13107	if err != nil {
13108		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", nil, "Failure preparing request")
13109		return
13110	}
13111
13112	resp, err := client.GetServiceHealthSender(req)
13113	if err != nil {
13114		result.Response = autorest.Response{Response: resp}
13115		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", resp, "Failure sending request")
13116		return
13117	}
13118
13119	result, err = client.GetServiceHealthResponder(resp)
13120	if err != nil {
13121		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", resp, "Failure responding to request")
13122	}
13123
13124	return
13125}
13126
13127// GetServiceHealthPreparer prepares the GetServiceHealth request.
13128func (client BaseClient) GetServiceHealthPreparer(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
13129	pathParameters := map[string]interface{}{
13130		"serviceId": serviceID,
13131	}
13132
13133	const APIVersion = "6.0"
13134	queryParameters := map[string]interface{}{
13135		"api-version": APIVersion,
13136	}
13137	if eventsHealthStateFilter != nil {
13138		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
13139	} else {
13140		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
13141	}
13142	if partitionsHealthStateFilter != nil {
13143		queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", *partitionsHealthStateFilter)
13144	} else {
13145		queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", 0)
13146	}
13147	if excludeHealthStatistics != nil {
13148		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
13149	} else {
13150		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
13151	}
13152	if timeout != nil {
13153		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13154	} else {
13155		queryParameters["timeout"] = autorest.Encode("query", 60)
13156	}
13157
13158	preparer := autorest.CreatePreparer(
13159		autorest.AsGet(),
13160		autorest.WithBaseURL(client.BaseURI),
13161		autorest.WithPathParameters("/Services/{serviceId}/$/GetHealth", pathParameters),
13162		autorest.WithQueryParameters(queryParameters))
13163	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13164}
13165
13166// GetServiceHealthSender sends the GetServiceHealth request. The method will close the
13167// http.Response Body if it receives an error.
13168func (client BaseClient) GetServiceHealthSender(req *http.Request) (*http.Response, error) {
13169	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13170}
13171
13172// GetServiceHealthResponder handles the response to the GetServiceHealth request. The method always
13173// closes the http.Response Body.
13174func (client BaseClient) GetServiceHealthResponder(resp *http.Response) (result ServiceHealth, err error) {
13175	err = autorest.Respond(
13176		resp,
13177		client.ByInspecting(),
13178		azure.WithErrorUnlessStatusCode(http.StatusOK),
13179		autorest.ByUnmarshallingJSON(&result),
13180		autorest.ByClosing())
13181	result.Response = autorest.Response{Response: resp}
13182	return
13183}
13184
13185// GetServiceHealthUsingPolicy gets the health information of the specified service.
13186// If the application health policy is specified, the health evaluation uses it to get the aggregated health state.
13187// If the policy is not specified, the health evaluation uses the application health policy defined in the application
13188// manifest, or the default health policy, if no policy is defined in the manifest.
13189// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health
13190// state.
13191// Use PartitionsHealthStateFilter to filter the collection of partitions returned.
13192// If you specify a service that does not exist in the health store, this request returns an error.
13193// Parameters:
13194// serviceID - the identity of the service. This is typically the full name of the service without the
13195// 'fabric:' URI scheme.
13196// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13197// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
13198// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
13199// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health
13200// state.
13201// The possible values for this parameter include integer value of one of the following health states.
13202// Only events that match the filter are returned. All events are used to evaluate the aggregated health state.
13203// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
13204// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is
13205// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
13206//
13207// - Default - Default value. Matches any HealthState. The value is zero.
13208// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
13209// collection of states. The value is 1.
13210// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
13211// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
13212// - Error - Filter that matches input with HealthState value Error. The value is 8.
13213// - All - Filter that matches input with any HealthState value. The value is 65535.
13214// partitionsHealthStateFilter - allows filtering of the partitions health state objects returned in the result
13215// of service health query based on their health state.
13216// The possible values for this parameter include integer value of one of the following health states.
13217// Only partitions that match the filter are returned. All partitions are used to evaluate the aggregated
13218// health state.
13219// If not specified, all entries are returned. The state values are flag based enumeration, so the value could
13220// be a combination of these value
13221// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of
13222// partitions with HealthState value of OK (2) and Warning (4) will be returned.
13223//
13224// - Default - Default value. Matches any HealthState. The value is zero.
13225// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given
13226// collection of states. The value is 1.
13227// - Ok - Filter that matches input with HealthState value Ok. The value is 2.
13228// - Warning - Filter that matches input with HealthState value Warning. The value is 4.
13229// - Error - Filter that matches input with HealthState value Error. The value is 8.
13230// - All - Filter that matches input with any HealthState value. The value is 65535.
13231// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one
13232// of its children.
13233// If not present, the health evaluation uses the health policy from application manifest or the default health
13234// policy.
13235// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query
13236// result. False by default.
13237// The statistics show the number of children entities in health state Ok, Warning, and Error.
13238// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13239// duration that the client is willing to wait for the requested operation to complete. The default value for
13240// this parameter is 60 seconds.
13241func (client BaseClient) GetServiceHealthUsingPolicy(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result ServiceHealth, err error) {
13242	if tracing.IsEnabled() {
13243		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceHealthUsingPolicy")
13244		defer func() {
13245			sc := -1
13246			if result.Response.Response != nil {
13247				sc = result.Response.Response.StatusCode
13248			}
13249			tracing.EndSpan(ctx, sc, err)
13250		}()
13251	}
13252	if err := validation.Validate([]validation.Validation{
13253		{TargetValue: timeout,
13254			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13255				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13256					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13257				}}}}}); err != nil {
13258		return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealthUsingPolicy", err.Error())
13259	}
13260
13261	req, err := client.GetServiceHealthUsingPolicyPreparer(ctx, serviceID, eventsHealthStateFilter, partitionsHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout)
13262	if err != nil {
13263		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", nil, "Failure preparing request")
13264		return
13265	}
13266
13267	resp, err := client.GetServiceHealthUsingPolicySender(req)
13268	if err != nil {
13269		result.Response = autorest.Response{Response: resp}
13270		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", resp, "Failure sending request")
13271		return
13272	}
13273
13274	result, err = client.GetServiceHealthUsingPolicyResponder(resp)
13275	if err != nil {
13276		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", resp, "Failure responding to request")
13277	}
13278
13279	return
13280}
13281
13282// GetServiceHealthUsingPolicyPreparer prepares the GetServiceHealthUsingPolicy request.
13283func (client BaseClient) GetServiceHealthUsingPolicyPreparer(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) {
13284	pathParameters := map[string]interface{}{
13285		"serviceId": serviceID,
13286	}
13287
13288	const APIVersion = "6.0"
13289	queryParameters := map[string]interface{}{
13290		"api-version": APIVersion,
13291	}
13292	if eventsHealthStateFilter != nil {
13293		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter)
13294	} else {
13295		queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0)
13296	}
13297	if partitionsHealthStateFilter != nil {
13298		queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", *partitionsHealthStateFilter)
13299	} else {
13300		queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", 0)
13301	}
13302	if excludeHealthStatistics != nil {
13303		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics)
13304	} else {
13305		queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false)
13306	}
13307	if timeout != nil {
13308		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13309	} else {
13310		queryParameters["timeout"] = autorest.Encode("query", 60)
13311	}
13312
13313	preparer := autorest.CreatePreparer(
13314		autorest.AsContentType("application/json; charset=utf-8"),
13315		autorest.AsPost(),
13316		autorest.WithBaseURL(client.BaseURI),
13317		autorest.WithPathParameters("/Services/{serviceId}/$/GetHealth", pathParameters),
13318		autorest.WithQueryParameters(queryParameters))
13319	if applicationHealthPolicy != nil {
13320		preparer = autorest.DecoratePreparer(preparer,
13321			autorest.WithJSON(applicationHealthPolicy))
13322	}
13323	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13324}
13325
13326// GetServiceHealthUsingPolicySender sends the GetServiceHealthUsingPolicy request. The method will close the
13327// http.Response Body if it receives an error.
13328func (client BaseClient) GetServiceHealthUsingPolicySender(req *http.Request) (*http.Response, error) {
13329	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13330}
13331
13332// GetServiceHealthUsingPolicyResponder handles the response to the GetServiceHealthUsingPolicy request. The method always
13333// closes the http.Response Body.
13334func (client BaseClient) GetServiceHealthUsingPolicyResponder(resp *http.Response) (result ServiceHealth, err error) {
13335	err = autorest.Respond(
13336		resp,
13337		client.ByInspecting(),
13338		azure.WithErrorUnlessStatusCode(http.StatusOK),
13339		autorest.ByUnmarshallingJSON(&result),
13340		autorest.ByClosing())
13341	result.Response = autorest.Response{Response: resp}
13342	return
13343}
13344
13345// GetServiceInfo returns the information about the specified service belonging to the specified Service Fabric
13346// application.
13347// Parameters:
13348// applicationID - the identity of the application. This is typically the full name of the application without
13349// the 'fabric:' URI scheme.
13350// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13351// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
13352// in 6.0+ and "myapp/app1" in previous versions.
13353// serviceID - the identity of the service. This is typically the full name of the service without the
13354// 'fabric:' URI scheme.
13355// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13356// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
13357// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
13358// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13359// duration that the client is willing to wait for the requested operation to complete. The default value for
13360// this parameter is 60 seconds.
13361func (client BaseClient) GetServiceInfo(ctx context.Context, applicationID string, serviceID string, timeout *int64) (result ServiceInfoModel, err error) {
13362	if tracing.IsEnabled() {
13363		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceInfo")
13364		defer func() {
13365			sc := -1
13366			if result.Response.Response != nil {
13367				sc = result.Response.Response.StatusCode
13368			}
13369			tracing.EndSpan(ctx, sc, err)
13370		}()
13371	}
13372	if err := validation.Validate([]validation.Validation{
13373		{TargetValue: timeout,
13374			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13375				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13376					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13377				}}}}}); err != nil {
13378		return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfo", err.Error())
13379	}
13380
13381	req, err := client.GetServiceInfoPreparer(ctx, applicationID, serviceID, timeout)
13382	if err != nil {
13383		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", nil, "Failure preparing request")
13384		return
13385	}
13386
13387	resp, err := client.GetServiceInfoSender(req)
13388	if err != nil {
13389		result.Response = autorest.Response{Response: resp}
13390		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", resp, "Failure sending request")
13391		return
13392	}
13393
13394	result, err = client.GetServiceInfoResponder(resp)
13395	if err != nil {
13396		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", resp, "Failure responding to request")
13397	}
13398
13399	return
13400}
13401
13402// GetServiceInfoPreparer prepares the GetServiceInfo request.
13403func (client BaseClient) GetServiceInfoPreparer(ctx context.Context, applicationID string, serviceID string, timeout *int64) (*http.Request, error) {
13404	pathParameters := map[string]interface{}{
13405		"applicationId": applicationID,
13406		"serviceId":     serviceID,
13407	}
13408
13409	const APIVersion = "6.0"
13410	queryParameters := map[string]interface{}{
13411		"api-version": APIVersion,
13412	}
13413	if timeout != nil {
13414		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13415	} else {
13416		queryParameters["timeout"] = autorest.Encode("query", 60)
13417	}
13418
13419	preparer := autorest.CreatePreparer(
13420		autorest.AsGet(),
13421		autorest.WithBaseURL(client.BaseURI),
13422		autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/{serviceId}", pathParameters),
13423		autorest.WithQueryParameters(queryParameters))
13424	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13425}
13426
13427// GetServiceInfoSender sends the GetServiceInfo request. The method will close the
13428// http.Response Body if it receives an error.
13429func (client BaseClient) GetServiceInfoSender(req *http.Request) (*http.Response, error) {
13430	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13431}
13432
13433// GetServiceInfoResponder handles the response to the GetServiceInfo request. The method always
13434// closes the http.Response Body.
13435func (client BaseClient) GetServiceInfoResponder(resp *http.Response) (result ServiceInfoModel, err error) {
13436	err = autorest.Respond(
13437		resp,
13438		client.ByInspecting(),
13439		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
13440		autorest.ByUnmarshallingJSON(&result),
13441		autorest.ByClosing())
13442	result.Response = autorest.Response{Response: resp}
13443	return
13444}
13445
13446// GetServiceInfoList returns the information about all services belonging to the application specified by the
13447// application id.
13448// Parameters:
13449// applicationID - the identity of the application. This is typically the full name of the application without
13450// the 'fabric:' URI scheme.
13451// Starting from version 6.0, hierarchical names are delimited with the "~" character.
13452// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
13453// in 6.0+ and "myapp/app1" in previous versions.
13454// serviceTypeName - the service type name used to filter the services to query for.
13455// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
13456// token with a non empty value is included in the response of the API when the results from the system do not
13457// fit in a single response. When this value is passed to the next API call, the API returns next set of
13458// results. If there are no further results then the continuation token does not contain a value. The value of
13459// this parameter should not be URL encoded.
13460// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13461// duration that the client is willing to wait for the requested operation to complete. The default value for
13462// this parameter is 60 seconds.
13463func (client BaseClient) GetServiceInfoList(ctx context.Context, applicationID string, serviceTypeName string, continuationToken string, timeout *int64) (result PagedServiceInfoList, err error) {
13464	if tracing.IsEnabled() {
13465		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceInfoList")
13466		defer func() {
13467			sc := -1
13468			if result.Response.Response != nil {
13469				sc = result.Response.Response.StatusCode
13470			}
13471			tracing.EndSpan(ctx, sc, err)
13472		}()
13473	}
13474	if err := validation.Validate([]validation.Validation{
13475		{TargetValue: timeout,
13476			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13477				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13478					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13479				}}}}}); err != nil {
13480		return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfoList", err.Error())
13481	}
13482
13483	req, err := client.GetServiceInfoListPreparer(ctx, applicationID, serviceTypeName, continuationToken, timeout)
13484	if err != nil {
13485		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", nil, "Failure preparing request")
13486		return
13487	}
13488
13489	resp, err := client.GetServiceInfoListSender(req)
13490	if err != nil {
13491		result.Response = autorest.Response{Response: resp}
13492		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", resp, "Failure sending request")
13493		return
13494	}
13495
13496	result, err = client.GetServiceInfoListResponder(resp)
13497	if err != nil {
13498		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", resp, "Failure responding to request")
13499	}
13500
13501	return
13502}
13503
13504// GetServiceInfoListPreparer prepares the GetServiceInfoList request.
13505func (client BaseClient) GetServiceInfoListPreparer(ctx context.Context, applicationID string, serviceTypeName string, continuationToken string, timeout *int64) (*http.Request, error) {
13506	pathParameters := map[string]interface{}{
13507		"applicationId": applicationID,
13508	}
13509
13510	const APIVersion = "6.0"
13511	queryParameters := map[string]interface{}{
13512		"api-version": APIVersion,
13513	}
13514	if len(serviceTypeName) > 0 {
13515		queryParameters["ServiceTypeName"] = autorest.Encode("query", serviceTypeName)
13516	}
13517	if len(continuationToken) > 0 {
13518		queryParameters["ContinuationToken"] = continuationToken
13519	}
13520	if timeout != nil {
13521		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13522	} else {
13523		queryParameters["timeout"] = autorest.Encode("query", 60)
13524	}
13525
13526	preparer := autorest.CreatePreparer(
13527		autorest.AsGet(),
13528		autorest.WithBaseURL(client.BaseURI),
13529		autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices", pathParameters),
13530		autorest.WithQueryParameters(queryParameters))
13531	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13532}
13533
13534// GetServiceInfoListSender sends the GetServiceInfoList request. The method will close the
13535// http.Response Body if it receives an error.
13536func (client BaseClient) GetServiceInfoListSender(req *http.Request) (*http.Response, error) {
13537	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13538}
13539
13540// GetServiceInfoListResponder handles the response to the GetServiceInfoList request. The method always
13541// closes the http.Response Body.
13542func (client BaseClient) GetServiceInfoListResponder(resp *http.Response) (result PagedServiceInfoList, err error) {
13543	err = autorest.Respond(
13544		resp,
13545		client.ByInspecting(),
13546		azure.WithErrorUnlessStatusCode(http.StatusOK),
13547		autorest.ByUnmarshallingJSON(&result),
13548		autorest.ByClosing())
13549	result.Response = autorest.Response{Response: resp}
13550	return
13551}
13552
13553// GetServiceManifest gets the manifest describing a service type. The response contains the service manifest XML as a
13554// string.
13555// Parameters:
13556// applicationTypeName - the name of the application type.
13557// applicationTypeVersion - the version of the application type.
13558// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
13559// Fabric cluster.
13560// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13561// duration that the client is willing to wait for the requested operation to complete. The default value for
13562// this parameter is 60 seconds.
13563func (client BaseClient) GetServiceManifest(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceManifestName string, timeout *int64) (result ServiceTypeManifest, err error) {
13564	if tracing.IsEnabled() {
13565		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceManifest")
13566		defer func() {
13567			sc := -1
13568			if result.Response.Response != nil {
13569				sc = result.Response.Response.StatusCode
13570			}
13571			tracing.EndSpan(ctx, sc, err)
13572		}()
13573	}
13574	if err := validation.Validate([]validation.Validation{
13575		{TargetValue: timeout,
13576			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13577				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13578					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13579				}}}}}); err != nil {
13580		return result, validation.NewError("servicefabric.BaseClient", "GetServiceManifest", err.Error())
13581	}
13582
13583	req, err := client.GetServiceManifestPreparer(ctx, applicationTypeName, applicationTypeVersion, serviceManifestName, timeout)
13584	if err != nil {
13585		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", nil, "Failure preparing request")
13586		return
13587	}
13588
13589	resp, err := client.GetServiceManifestSender(req)
13590	if err != nil {
13591		result.Response = autorest.Response{Response: resp}
13592		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", resp, "Failure sending request")
13593		return
13594	}
13595
13596	result, err = client.GetServiceManifestResponder(resp)
13597	if err != nil {
13598		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", resp, "Failure responding to request")
13599	}
13600
13601	return
13602}
13603
13604// GetServiceManifestPreparer prepares the GetServiceManifest request.
13605func (client BaseClient) GetServiceManifestPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceManifestName string, timeout *int64) (*http.Request, error) {
13606	pathParameters := map[string]interface{}{
13607		"applicationTypeName": autorest.Encode("path", applicationTypeName),
13608	}
13609
13610	const APIVersion = "6.0"
13611	queryParameters := map[string]interface{}{
13612		"api-version":            APIVersion,
13613		"ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion),
13614		"ServiceManifestName":    autorest.Encode("query", serviceManifestName),
13615	}
13616	if timeout != nil {
13617		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13618	} else {
13619		queryParameters["timeout"] = autorest.Encode("query", 60)
13620	}
13621
13622	preparer := autorest.CreatePreparer(
13623		autorest.AsGet(),
13624		autorest.WithBaseURL(client.BaseURI),
13625		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceManifest", pathParameters),
13626		autorest.WithQueryParameters(queryParameters))
13627	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13628}
13629
13630// GetServiceManifestSender sends the GetServiceManifest request. The method will close the
13631// http.Response Body if it receives an error.
13632func (client BaseClient) GetServiceManifestSender(req *http.Request) (*http.Response, error) {
13633	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13634}
13635
13636// GetServiceManifestResponder handles the response to the GetServiceManifest request. The method always
13637// closes the http.Response Body.
13638func (client BaseClient) GetServiceManifestResponder(resp *http.Response) (result ServiceTypeManifest, err error) {
13639	err = autorest.Respond(
13640		resp,
13641		client.ByInspecting(),
13642		azure.WithErrorUnlessStatusCode(http.StatusOK),
13643		autorest.ByUnmarshallingJSON(&result),
13644		autorest.ByClosing())
13645	result.Response = autorest.Response{Response: resp}
13646	return
13647}
13648
13649// GetServiceNameInfo gets name of the service for the specified partition. A 404 error is returned if the partition ID
13650// does not exist in the cluster.
13651// Parameters:
13652// partitionID - the identity of the partition.
13653// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13654// duration that the client is willing to wait for the requested operation to complete. The default value for
13655// this parameter is 60 seconds.
13656func (client BaseClient) GetServiceNameInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result ServiceNameInfo, err error) {
13657	if tracing.IsEnabled() {
13658		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceNameInfo")
13659		defer func() {
13660			sc := -1
13661			if result.Response.Response != nil {
13662				sc = result.Response.Response.StatusCode
13663			}
13664			tracing.EndSpan(ctx, sc, err)
13665		}()
13666	}
13667	if err := validation.Validate([]validation.Validation{
13668		{TargetValue: timeout,
13669			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13670				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13671					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13672				}}}}}); err != nil {
13673		return result, validation.NewError("servicefabric.BaseClient", "GetServiceNameInfo", err.Error())
13674	}
13675
13676	req, err := client.GetServiceNameInfoPreparer(ctx, partitionID, timeout)
13677	if err != nil {
13678		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", nil, "Failure preparing request")
13679		return
13680	}
13681
13682	resp, err := client.GetServiceNameInfoSender(req)
13683	if err != nil {
13684		result.Response = autorest.Response{Response: resp}
13685		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", resp, "Failure sending request")
13686		return
13687	}
13688
13689	result, err = client.GetServiceNameInfoResponder(resp)
13690	if err != nil {
13691		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", resp, "Failure responding to request")
13692	}
13693
13694	return
13695}
13696
13697// GetServiceNameInfoPreparer prepares the GetServiceNameInfo request.
13698func (client BaseClient) GetServiceNameInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
13699	pathParameters := map[string]interface{}{
13700		"partitionId": partitionID,
13701	}
13702
13703	const APIVersion = "6.0"
13704	queryParameters := map[string]interface{}{
13705		"api-version": APIVersion,
13706	}
13707	if timeout != nil {
13708		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13709	} else {
13710		queryParameters["timeout"] = autorest.Encode("query", 60)
13711	}
13712
13713	preparer := autorest.CreatePreparer(
13714		autorest.AsGet(),
13715		autorest.WithBaseURL(client.BaseURI),
13716		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetServiceName", pathParameters),
13717		autorest.WithQueryParameters(queryParameters))
13718	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13719}
13720
13721// GetServiceNameInfoSender sends the GetServiceNameInfo request. The method will close the
13722// http.Response Body if it receives an error.
13723func (client BaseClient) GetServiceNameInfoSender(req *http.Request) (*http.Response, error) {
13724	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13725}
13726
13727// GetServiceNameInfoResponder handles the response to the GetServiceNameInfo request. The method always
13728// closes the http.Response Body.
13729func (client BaseClient) GetServiceNameInfoResponder(resp *http.Response) (result ServiceNameInfo, err error) {
13730	err = autorest.Respond(
13731		resp,
13732		client.ByInspecting(),
13733		azure.WithErrorUnlessStatusCode(http.StatusOK),
13734		autorest.ByUnmarshallingJSON(&result),
13735		autorest.ByClosing())
13736	result.Response = autorest.Response{Response: resp}
13737	return
13738}
13739
13740// GetServicesEventList the response is list of ServiceEvent objects.
13741// Parameters:
13742// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
13743// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ.
13744// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13745// duration that the client is willing to wait for the requested operation to complete. The default value for
13746// this parameter is 60 seconds.
13747// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only
13748// be included in the response.
13749// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed.
13750// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed.
13751// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets
13752// populated.
13753func (client BaseClient) GetServicesEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListServiceEvent, err error) {
13754	if tracing.IsEnabled() {
13755		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServicesEventList")
13756		defer func() {
13757			sc := -1
13758			if result.Response.Response != nil {
13759				sc = result.Response.Response.StatusCode
13760			}
13761			tracing.EndSpan(ctx, sc, err)
13762		}()
13763	}
13764	if err := validation.Validate([]validation.Validation{
13765		{TargetValue: timeout,
13766			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13767				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13768					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13769				}}}}}); err != nil {
13770		return result, validation.NewError("servicefabric.BaseClient", "GetServicesEventList", err.Error())
13771	}
13772
13773	req, err := client.GetServicesEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup)
13774	if err != nil {
13775		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", nil, "Failure preparing request")
13776		return
13777	}
13778
13779	resp, err := client.GetServicesEventListSender(req)
13780	if err != nil {
13781		result.Response = autorest.Response{Response: resp}
13782		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", resp, "Failure sending request")
13783		return
13784	}
13785
13786	result, err = client.GetServicesEventListResponder(resp)
13787	if err != nil {
13788		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", resp, "Failure responding to request")
13789	}
13790
13791	return
13792}
13793
13794// GetServicesEventListPreparer prepares the GetServicesEventList request.
13795func (client BaseClient) GetServicesEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) {
13796	const APIVersion = "6.2-preview"
13797	queryParameters := map[string]interface{}{
13798		"api-version":  APIVersion,
13799		"EndTimeUtc":   autorest.Encode("query", endTimeUtc),
13800		"StartTimeUtc": autorest.Encode("query", startTimeUtc),
13801	}
13802	if timeout != nil {
13803		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13804	} else {
13805		queryParameters["timeout"] = autorest.Encode("query", 60)
13806	}
13807	if len(eventsTypesFilter) > 0 {
13808		queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter)
13809	}
13810	if excludeAnalysisEvents != nil {
13811		queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents)
13812	}
13813	if skipCorrelationLookup != nil {
13814		queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup)
13815	}
13816
13817	preparer := autorest.CreatePreparer(
13818		autorest.AsGet(),
13819		autorest.WithBaseURL(client.BaseURI),
13820		autorest.WithPath("/EventsStore/Services/Events"),
13821		autorest.WithQueryParameters(queryParameters))
13822	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13823}
13824
13825// GetServicesEventListSender sends the GetServicesEventList request. The method will close the
13826// http.Response Body if it receives an error.
13827func (client BaseClient) GetServicesEventListSender(req *http.Request) (*http.Response, error) {
13828	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13829}
13830
13831// GetServicesEventListResponder handles the response to the GetServicesEventList request. The method always
13832// closes the http.Response Body.
13833func (client BaseClient) GetServicesEventListResponder(resp *http.Response) (result ListServiceEvent, err error) {
13834	err = autorest.Respond(
13835		resp,
13836		client.ByInspecting(),
13837		azure.WithErrorUnlessStatusCode(http.StatusOK),
13838		autorest.ByUnmarshallingJSON(&result),
13839		autorest.ByClosing())
13840	result.Response = autorest.Response{Response: resp}
13841	return
13842}
13843
13844// GetServiceTypeInfoByName gets the information about a specific service type that is supported by a provisioned
13845// application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is
13846// returned. A 204 response is returned if the specified service type is not found in the cluster.
13847// Parameters:
13848// applicationTypeName - the name of the application type.
13849// applicationTypeVersion - the version of the application type.
13850// serviceTypeName - specifies the name of a Service Fabric service type.
13851// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13852// duration that the client is willing to wait for the requested operation to complete. The default value for
13853// this parameter is 60 seconds.
13854func (client BaseClient) GetServiceTypeInfoByName(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceTypeName string, timeout *int64) (result ServiceTypeInfo, err error) {
13855	if tracing.IsEnabled() {
13856		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceTypeInfoByName")
13857		defer func() {
13858			sc := -1
13859			if result.Response.Response != nil {
13860				sc = result.Response.Response.StatusCode
13861			}
13862			tracing.EndSpan(ctx, sc, err)
13863		}()
13864	}
13865	if err := validation.Validate([]validation.Validation{
13866		{TargetValue: timeout,
13867			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13868				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13869					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13870				}}}}}); err != nil {
13871		return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoByName", err.Error())
13872	}
13873
13874	req, err := client.GetServiceTypeInfoByNamePreparer(ctx, applicationTypeName, applicationTypeVersion, serviceTypeName, timeout)
13875	if err != nil {
13876		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", nil, "Failure preparing request")
13877		return
13878	}
13879
13880	resp, err := client.GetServiceTypeInfoByNameSender(req)
13881	if err != nil {
13882		result.Response = autorest.Response{Response: resp}
13883		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", resp, "Failure sending request")
13884		return
13885	}
13886
13887	result, err = client.GetServiceTypeInfoByNameResponder(resp)
13888	if err != nil {
13889		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", resp, "Failure responding to request")
13890	}
13891
13892	return
13893}
13894
13895// GetServiceTypeInfoByNamePreparer prepares the GetServiceTypeInfoByName request.
13896func (client BaseClient) GetServiceTypeInfoByNamePreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceTypeName string, timeout *int64) (*http.Request, error) {
13897	pathParameters := map[string]interface{}{
13898		"applicationTypeName": autorest.Encode("path", applicationTypeName),
13899		"serviceTypeName":     serviceTypeName,
13900	}
13901
13902	const APIVersion = "6.0"
13903	queryParameters := map[string]interface{}{
13904		"api-version":            APIVersion,
13905		"ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion),
13906	}
13907	if timeout != nil {
13908		queryParameters["timeout"] = autorest.Encode("query", *timeout)
13909	} else {
13910		queryParameters["timeout"] = autorest.Encode("query", 60)
13911	}
13912
13913	preparer := autorest.CreatePreparer(
13914		autorest.AsGet(),
13915		autorest.WithBaseURL(client.BaseURI),
13916		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceTypes/{serviceTypeName}", pathParameters),
13917		autorest.WithQueryParameters(queryParameters))
13918	return preparer.Prepare((&http.Request{}).WithContext(ctx))
13919}
13920
13921// GetServiceTypeInfoByNameSender sends the GetServiceTypeInfoByName request. The method will close the
13922// http.Response Body if it receives an error.
13923func (client BaseClient) GetServiceTypeInfoByNameSender(req *http.Request) (*http.Response, error) {
13924	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13925}
13926
13927// GetServiceTypeInfoByNameResponder handles the response to the GetServiceTypeInfoByName request. The method always
13928// closes the http.Response Body.
13929func (client BaseClient) GetServiceTypeInfoByNameResponder(resp *http.Response) (result ServiceTypeInfo, err error) {
13930	err = autorest.Respond(
13931		resp,
13932		client.ByInspecting(),
13933		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
13934		autorest.ByUnmarshallingJSON(&result),
13935		autorest.ByClosing())
13936	result.Response = autorest.Response{Response: resp}
13937	return
13938}
13939
13940// GetServiceTypeInfoList gets the list containing the information about service types that are supported by a
13941// provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404
13942// status is returned.
13943// Parameters:
13944// applicationTypeName - the name of the application type.
13945// applicationTypeVersion - the version of the application type.
13946// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
13947// duration that the client is willing to wait for the requested operation to complete. The default value for
13948// this parameter is 60 seconds.
13949func (client BaseClient) GetServiceTypeInfoList(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (result ListServiceTypeInfo, err error) {
13950	if tracing.IsEnabled() {
13951		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceTypeInfoList")
13952		defer func() {
13953			sc := -1
13954			if result.Response.Response != nil {
13955				sc = result.Response.Response.StatusCode
13956			}
13957			tracing.EndSpan(ctx, sc, err)
13958		}()
13959	}
13960	if err := validation.Validate([]validation.Validation{
13961		{TargetValue: timeout,
13962			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
13963				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
13964					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
13965				}}}}}); err != nil {
13966		return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoList", err.Error())
13967	}
13968
13969	req, err := client.GetServiceTypeInfoListPreparer(ctx, applicationTypeName, applicationTypeVersion, timeout)
13970	if err != nil {
13971		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", nil, "Failure preparing request")
13972		return
13973	}
13974
13975	resp, err := client.GetServiceTypeInfoListSender(req)
13976	if err != nil {
13977		result.Response = autorest.Response{Response: resp}
13978		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", resp, "Failure sending request")
13979		return
13980	}
13981
13982	result, err = client.GetServiceTypeInfoListResponder(resp)
13983	if err != nil {
13984		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", resp, "Failure responding to request")
13985	}
13986
13987	return
13988}
13989
13990// GetServiceTypeInfoListPreparer prepares the GetServiceTypeInfoList request.
13991func (client BaseClient) GetServiceTypeInfoListPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (*http.Request, error) {
13992	pathParameters := map[string]interface{}{
13993		"applicationTypeName": autorest.Encode("path", applicationTypeName),
13994	}
13995
13996	const APIVersion = "6.0"
13997	queryParameters := map[string]interface{}{
13998		"api-version":            APIVersion,
13999		"ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion),
14000	}
14001	if timeout != nil {
14002		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14003	} else {
14004		queryParameters["timeout"] = autorest.Encode("query", 60)
14005	}
14006
14007	preparer := autorest.CreatePreparer(
14008		autorest.AsGet(),
14009		autorest.WithBaseURL(client.BaseURI),
14010		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceTypes", pathParameters),
14011		autorest.WithQueryParameters(queryParameters))
14012	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14013}
14014
14015// GetServiceTypeInfoListSender sends the GetServiceTypeInfoList request. The method will close the
14016// http.Response Body if it receives an error.
14017func (client BaseClient) GetServiceTypeInfoListSender(req *http.Request) (*http.Response, error) {
14018	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14019}
14020
14021// GetServiceTypeInfoListResponder handles the response to the GetServiceTypeInfoList request. The method always
14022// closes the http.Response Body.
14023func (client BaseClient) GetServiceTypeInfoListResponder(resp *http.Response) (result ListServiceTypeInfo, err error) {
14024	err = autorest.Respond(
14025		resp,
14026		client.ByInspecting(),
14027		azure.WithErrorUnlessStatusCode(http.StatusOK),
14028		autorest.ByUnmarshallingJSON(&result.Value),
14029		autorest.ByClosing())
14030	result.Response = autorest.Response{Response: resp}
14031	return
14032}
14033
14034// GetSubNameInfoList enumerates all the Service Fabric names under a given name. If the subnames do not fit in a page,
14035// one page of results is returned as well as a continuation token which can be used to get the next page. Querying a
14036// name that doesn't exist will fail.
14037// Parameters:
14038// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
14039// recursive - allows specifying that the search performed should be recursive.
14040// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation
14041// token with a non empty value is included in the response of the API when the results from the system do not
14042// fit in a single response. When this value is passed to the next API call, the API returns next set of
14043// results. If there are no further results then the continuation token does not contain a value. The value of
14044// this parameter should not be URL encoded.
14045// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14046// duration that the client is willing to wait for the requested operation to complete. The default value for
14047// this parameter is 60 seconds.
14048func (client BaseClient) GetSubNameInfoList(ctx context.Context, nameID string, recursive *bool, continuationToken string, timeout *int64) (result PagedSubNameInfoList, err error) {
14049	if tracing.IsEnabled() {
14050		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSubNameInfoList")
14051		defer func() {
14052			sc := -1
14053			if result.Response.Response != nil {
14054				sc = result.Response.Response.StatusCode
14055			}
14056			tracing.EndSpan(ctx, sc, err)
14057		}()
14058	}
14059	if err := validation.Validate([]validation.Validation{
14060		{TargetValue: timeout,
14061			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14062				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14063					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14064				}}}}}); err != nil {
14065		return result, validation.NewError("servicefabric.BaseClient", "GetSubNameInfoList", err.Error())
14066	}
14067
14068	req, err := client.GetSubNameInfoListPreparer(ctx, nameID, recursive, continuationToken, timeout)
14069	if err != nil {
14070		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", nil, "Failure preparing request")
14071		return
14072	}
14073
14074	resp, err := client.GetSubNameInfoListSender(req)
14075	if err != nil {
14076		result.Response = autorest.Response{Response: resp}
14077		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", resp, "Failure sending request")
14078		return
14079	}
14080
14081	result, err = client.GetSubNameInfoListResponder(resp)
14082	if err != nil {
14083		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", resp, "Failure responding to request")
14084	}
14085
14086	return
14087}
14088
14089// GetSubNameInfoListPreparer prepares the GetSubNameInfoList request.
14090func (client BaseClient) GetSubNameInfoListPreparer(ctx context.Context, nameID string, recursive *bool, continuationToken string, timeout *int64) (*http.Request, error) {
14091	pathParameters := map[string]interface{}{
14092		"nameId": nameID,
14093	}
14094
14095	const APIVersion = "6.0"
14096	queryParameters := map[string]interface{}{
14097		"api-version": APIVersion,
14098	}
14099	if recursive != nil {
14100		queryParameters["Recursive"] = autorest.Encode("query", *recursive)
14101	} else {
14102		queryParameters["Recursive"] = autorest.Encode("query", false)
14103	}
14104	if len(continuationToken) > 0 {
14105		queryParameters["ContinuationToken"] = continuationToken
14106	}
14107	if timeout != nil {
14108		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14109	} else {
14110		queryParameters["timeout"] = autorest.Encode("query", 60)
14111	}
14112
14113	preparer := autorest.CreatePreparer(
14114		autorest.AsGet(),
14115		autorest.WithBaseURL(client.BaseURI),
14116		autorest.WithPathParameters("/Names/{nameId}/$/GetSubNames", pathParameters),
14117		autorest.WithQueryParameters(queryParameters))
14118	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14119}
14120
14121// GetSubNameInfoListSender sends the GetSubNameInfoList request. The method will close the
14122// http.Response Body if it receives an error.
14123func (client BaseClient) GetSubNameInfoListSender(req *http.Request) (*http.Response, error) {
14124	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14125}
14126
14127// GetSubNameInfoListResponder handles the response to the GetSubNameInfoList request. The method always
14128// closes the http.Response Body.
14129func (client BaseClient) GetSubNameInfoListResponder(resp *http.Response) (result PagedSubNameInfoList, err error) {
14130	err = autorest.Respond(
14131		resp,
14132		client.ByInspecting(),
14133		azure.WithErrorUnlessStatusCode(http.StatusOK),
14134		autorest.ByUnmarshallingJSON(&result),
14135		autorest.ByClosing())
14136	result.Response = autorest.Response{Response: resp}
14137	return
14138}
14139
14140// GetUpgradeOrchestrationServiceState get the service state of Service Fabric Upgrade Orchestration Service. This API
14141// is internally used for support purposes.
14142// Parameters:
14143// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14144// duration that the client is willing to wait for the requested operation to complete. The default value for
14145// this parameter is 60 seconds.
14146func (client BaseClient) GetUpgradeOrchestrationServiceState(ctx context.Context, timeout *int64) (result UpgradeOrchestrationServiceState, err error) {
14147	if tracing.IsEnabled() {
14148		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetUpgradeOrchestrationServiceState")
14149		defer func() {
14150			sc := -1
14151			if result.Response.Response != nil {
14152				sc = result.Response.Response.StatusCode
14153			}
14154			tracing.EndSpan(ctx, sc, err)
14155		}()
14156	}
14157	if err := validation.Validate([]validation.Validation{
14158		{TargetValue: timeout,
14159			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14160				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14161					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14162				}}}}}); err != nil {
14163		return result, validation.NewError("servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", err.Error())
14164	}
14165
14166	req, err := client.GetUpgradeOrchestrationServiceStatePreparer(ctx, timeout)
14167	if err != nil {
14168		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", nil, "Failure preparing request")
14169		return
14170	}
14171
14172	resp, err := client.GetUpgradeOrchestrationServiceStateSender(req)
14173	if err != nil {
14174		result.Response = autorest.Response{Response: resp}
14175		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", resp, "Failure sending request")
14176		return
14177	}
14178
14179	result, err = client.GetUpgradeOrchestrationServiceStateResponder(resp)
14180	if err != nil {
14181		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", resp, "Failure responding to request")
14182	}
14183
14184	return
14185}
14186
14187// GetUpgradeOrchestrationServiceStatePreparer prepares the GetUpgradeOrchestrationServiceState request.
14188func (client BaseClient) GetUpgradeOrchestrationServiceStatePreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
14189	const APIVersion = "6.0"
14190	queryParameters := map[string]interface{}{
14191		"api-version": APIVersion,
14192	}
14193	if timeout != nil {
14194		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14195	} else {
14196		queryParameters["timeout"] = autorest.Encode("query", 60)
14197	}
14198
14199	preparer := autorest.CreatePreparer(
14200		autorest.AsGet(),
14201		autorest.WithBaseURL(client.BaseURI),
14202		autorest.WithPath("/$/GetUpgradeOrchestrationServiceState"),
14203		autorest.WithQueryParameters(queryParameters))
14204	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14205}
14206
14207// GetUpgradeOrchestrationServiceStateSender sends the GetUpgradeOrchestrationServiceState request. The method will close the
14208// http.Response Body if it receives an error.
14209func (client BaseClient) GetUpgradeOrchestrationServiceStateSender(req *http.Request) (*http.Response, error) {
14210	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14211}
14212
14213// GetUpgradeOrchestrationServiceStateResponder handles the response to the GetUpgradeOrchestrationServiceState request. The method always
14214// closes the http.Response Body.
14215func (client BaseClient) GetUpgradeOrchestrationServiceStateResponder(resp *http.Response) (result UpgradeOrchestrationServiceState, err error) {
14216	err = autorest.Respond(
14217		resp,
14218		client.ByInspecting(),
14219		azure.WithErrorUnlessStatusCode(http.StatusOK),
14220		autorest.ByUnmarshallingJSON(&result),
14221		autorest.ByClosing())
14222	result.Response = autorest.Response{Response: resp}
14223	return
14224}
14225
14226// InvokeContainerAPI invoke container API on a container deployed on a Service Fabric node for the given code package.
14227// Parameters:
14228// nodeName - the name of the node.
14229// applicationID - the identity of the application. This is typically the full name of the application without
14230// the 'fabric:' URI scheme.
14231// Starting from version 6.0, hierarchical names are delimited with the "~" character.
14232// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
14233// in 6.0+ and "myapp/app1" in previous versions.
14234// serviceManifestName - the name of a service manifest registered as part of an application type in a Service
14235// Fabric cluster.
14236// codePackageName - the name of code package specified in service manifest registered as part of an
14237// application type in a Service Fabric cluster.
14238// codePackageInstanceID - ID that uniquely identifies a code package instance deployed on a service fabric
14239// node.
14240// containerAPIRequestBody - parameters for making container API call
14241// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14242// duration that the client is willing to wait for the requested operation to complete. The default value for
14243// this parameter is 60 seconds.
14244func (client BaseClient) InvokeContainerAPI(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, codePackageInstanceID string, containerAPIRequestBody ContainerAPIRequestBody, timeout *int64) (result ContainerAPIResponse, err error) {
14245	if tracing.IsEnabled() {
14246		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeContainerAPI")
14247		defer func() {
14248			sc := -1
14249			if result.Response.Response != nil {
14250				sc = result.Response.Response.StatusCode
14251			}
14252			tracing.EndSpan(ctx, sc, err)
14253		}()
14254	}
14255	if err := validation.Validate([]validation.Validation{
14256		{TargetValue: timeout,
14257			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14258				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14259					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14260				}}}},
14261		{TargetValue: containerAPIRequestBody,
14262			Constraints: []validation.Constraint{{Target: "containerAPIRequestBody.URIPath", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
14263		return result, validation.NewError("servicefabric.BaseClient", "InvokeContainerAPI", err.Error())
14264	}
14265
14266	req, err := client.InvokeContainerAPIPreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, codePackageInstanceID, containerAPIRequestBody, timeout)
14267	if err != nil {
14268		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", nil, "Failure preparing request")
14269		return
14270	}
14271
14272	resp, err := client.InvokeContainerAPISender(req)
14273	if err != nil {
14274		result.Response = autorest.Response{Response: resp}
14275		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", resp, "Failure sending request")
14276		return
14277	}
14278
14279	result, err = client.InvokeContainerAPIResponder(resp)
14280	if err != nil {
14281		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", resp, "Failure responding to request")
14282	}
14283
14284	return
14285}
14286
14287// InvokeContainerAPIPreparer prepares the InvokeContainerAPI request.
14288func (client BaseClient) InvokeContainerAPIPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, codePackageInstanceID string, containerAPIRequestBody ContainerAPIRequestBody, timeout *int64) (*http.Request, error) {
14289	pathParameters := map[string]interface{}{
14290		"applicationId": applicationID,
14291		"nodeName":      autorest.Encode("path", nodeName),
14292	}
14293
14294	const APIVersion = "6.2"
14295	queryParameters := map[string]interface{}{
14296		"api-version":           APIVersion,
14297		"CodePackageInstanceId": autorest.Encode("query", codePackageInstanceID),
14298		"CodePackageName":       autorest.Encode("query", codePackageName),
14299		"ServiceManifestName":   autorest.Encode("query", serviceManifestName),
14300	}
14301	if timeout != nil {
14302		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14303	} else {
14304		queryParameters["timeout"] = autorest.Encode("query", 60)
14305	}
14306
14307	preparer := autorest.CreatePreparer(
14308		autorest.AsContentType("application/json; charset=utf-8"),
14309		autorest.AsPost(),
14310		autorest.WithBaseURL(client.BaseURI),
14311		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerApi", pathParameters),
14312		autorest.WithJSON(containerAPIRequestBody),
14313		autorest.WithQueryParameters(queryParameters))
14314	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14315}
14316
14317// InvokeContainerAPISender sends the InvokeContainerAPI request. The method will close the
14318// http.Response Body if it receives an error.
14319func (client BaseClient) InvokeContainerAPISender(req *http.Request) (*http.Response, error) {
14320	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14321}
14322
14323// InvokeContainerAPIResponder handles the response to the InvokeContainerAPI request. The method always
14324// closes the http.Response Body.
14325func (client BaseClient) InvokeContainerAPIResponder(resp *http.Response) (result ContainerAPIResponse, err error) {
14326	err = autorest.Respond(
14327		resp,
14328		client.ByInspecting(),
14329		azure.WithErrorUnlessStatusCode(http.StatusOK),
14330		autorest.ByUnmarshallingJSON(&result),
14331		autorest.ByClosing())
14332	result.Response = autorest.Response{Response: resp}
14333	return
14334}
14335
14336// InvokeInfrastructureCommand for clusters that have one or more instances of the Infrastructure Service configured,
14337// this API provides a way to send infrastructure-specific commands to a particular
14338// instance of the Infrastructure Service.
14339//
14340// Available commands and their corresponding response formats vary depending upon
14341// the infrastructure on which the cluster is running.
14342//
14343// This API supports the Service Fabric platform; it is not meant to be used directly from your code.
14344// Parameters:
14345// command - the text of the command to be invoked. The content of the command is infrastructure-specific.
14346// serviceID - the identity of the infrastructure service. This is  the full name of the infrastructure service
14347// without the 'fabric:' URI scheme. This parameter required only for the cluster that have more than one
14348// instance of infrastructure service running.
14349// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14350// duration that the client is willing to wait for the requested operation to complete. The default value for
14351// this parameter is 60 seconds.
14352func (client BaseClient) InvokeInfrastructureCommand(ctx context.Context, command string, serviceID string, timeout *int64) (result String, err error) {
14353	if tracing.IsEnabled() {
14354		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeInfrastructureCommand")
14355		defer func() {
14356			sc := -1
14357			if result.Response.Response != nil {
14358				sc = result.Response.Response.StatusCode
14359			}
14360			tracing.EndSpan(ctx, sc, err)
14361		}()
14362	}
14363	if err := validation.Validate([]validation.Validation{
14364		{TargetValue: timeout,
14365			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14366				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14367					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14368				}}}}}); err != nil {
14369		return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureCommand", err.Error())
14370	}
14371
14372	req, err := client.InvokeInfrastructureCommandPreparer(ctx, command, serviceID, timeout)
14373	if err != nil {
14374		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", nil, "Failure preparing request")
14375		return
14376	}
14377
14378	resp, err := client.InvokeInfrastructureCommandSender(req)
14379	if err != nil {
14380		result.Response = autorest.Response{Response: resp}
14381		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", resp, "Failure sending request")
14382		return
14383	}
14384
14385	result, err = client.InvokeInfrastructureCommandResponder(resp)
14386	if err != nil {
14387		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", resp, "Failure responding to request")
14388	}
14389
14390	return
14391}
14392
14393// InvokeInfrastructureCommandPreparer prepares the InvokeInfrastructureCommand request.
14394func (client BaseClient) InvokeInfrastructureCommandPreparer(ctx context.Context, command string, serviceID string, timeout *int64) (*http.Request, error) {
14395	const APIVersion = "6.0"
14396	queryParameters := map[string]interface{}{
14397		"api-version": APIVersion,
14398		"Command":     autorest.Encode("query", command),
14399	}
14400	if len(serviceID) > 0 {
14401		queryParameters["ServiceId"] = autorest.Encode("query", serviceID)
14402	}
14403	if timeout != nil {
14404		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14405	} else {
14406		queryParameters["timeout"] = autorest.Encode("query", 60)
14407	}
14408
14409	preparer := autorest.CreatePreparer(
14410		autorest.AsPost(),
14411		autorest.WithBaseURL(client.BaseURI),
14412		autorest.WithPath("/$/InvokeInfrastructureCommand"),
14413		autorest.WithQueryParameters(queryParameters))
14414	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14415}
14416
14417// InvokeInfrastructureCommandSender sends the InvokeInfrastructureCommand request. The method will close the
14418// http.Response Body if it receives an error.
14419func (client BaseClient) InvokeInfrastructureCommandSender(req *http.Request) (*http.Response, error) {
14420	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14421}
14422
14423// InvokeInfrastructureCommandResponder handles the response to the InvokeInfrastructureCommand request. The method always
14424// closes the http.Response Body.
14425func (client BaseClient) InvokeInfrastructureCommandResponder(resp *http.Response) (result String, err error) {
14426	err = autorest.Respond(
14427		resp,
14428		client.ByInspecting(),
14429		azure.WithErrorUnlessStatusCode(http.StatusOK),
14430		autorest.ByUnmarshallingJSON(&result.Value),
14431		autorest.ByClosing())
14432	result.Response = autorest.Response{Response: resp}
14433	return
14434}
14435
14436// InvokeInfrastructureQuery for clusters that have one or more instances of the Infrastructure Service configured,
14437// this API provides a way to send infrastructure-specific queries to a particular
14438// instance of the Infrastructure Service.
14439//
14440// Available commands and their corresponding response formats vary depending upon
14441// the infrastructure on which the cluster is running.
14442//
14443// This API supports the Service Fabric platform; it is not meant to be used directly from your code.
14444// Parameters:
14445// command - the text of the command to be invoked. The content of the command is infrastructure-specific.
14446// serviceID - the identity of the infrastructure service. This is  the full name of the infrastructure service
14447// without the 'fabric:' URI scheme. This parameter required only for the cluster that have more than one
14448// instance of infrastructure service running.
14449// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14450// duration that the client is willing to wait for the requested operation to complete. The default value for
14451// this parameter is 60 seconds.
14452func (client BaseClient) InvokeInfrastructureQuery(ctx context.Context, command string, serviceID string, timeout *int64) (result String, err error) {
14453	if tracing.IsEnabled() {
14454		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeInfrastructureQuery")
14455		defer func() {
14456			sc := -1
14457			if result.Response.Response != nil {
14458				sc = result.Response.Response.StatusCode
14459			}
14460			tracing.EndSpan(ctx, sc, err)
14461		}()
14462	}
14463	if err := validation.Validate([]validation.Validation{
14464		{TargetValue: timeout,
14465			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14466				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14467					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14468				}}}}}); err != nil {
14469		return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureQuery", err.Error())
14470	}
14471
14472	req, err := client.InvokeInfrastructureQueryPreparer(ctx, command, serviceID, timeout)
14473	if err != nil {
14474		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", nil, "Failure preparing request")
14475		return
14476	}
14477
14478	resp, err := client.InvokeInfrastructureQuerySender(req)
14479	if err != nil {
14480		result.Response = autorest.Response{Response: resp}
14481		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", resp, "Failure sending request")
14482		return
14483	}
14484
14485	result, err = client.InvokeInfrastructureQueryResponder(resp)
14486	if err != nil {
14487		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", resp, "Failure responding to request")
14488	}
14489
14490	return
14491}
14492
14493// InvokeInfrastructureQueryPreparer prepares the InvokeInfrastructureQuery request.
14494func (client BaseClient) InvokeInfrastructureQueryPreparer(ctx context.Context, command string, serviceID string, timeout *int64) (*http.Request, error) {
14495	const APIVersion = "6.0"
14496	queryParameters := map[string]interface{}{
14497		"api-version": APIVersion,
14498		"Command":     autorest.Encode("query", command),
14499	}
14500	if len(serviceID) > 0 {
14501		queryParameters["ServiceId"] = autorest.Encode("query", serviceID)
14502	}
14503	if timeout != nil {
14504		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14505	} else {
14506		queryParameters["timeout"] = autorest.Encode("query", 60)
14507	}
14508
14509	preparer := autorest.CreatePreparer(
14510		autorest.AsGet(),
14511		autorest.WithBaseURL(client.BaseURI),
14512		autorest.WithPath("/$/InvokeInfrastructureQuery"),
14513		autorest.WithQueryParameters(queryParameters))
14514	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14515}
14516
14517// InvokeInfrastructureQuerySender sends the InvokeInfrastructureQuery request. The method will close the
14518// http.Response Body if it receives an error.
14519func (client BaseClient) InvokeInfrastructureQuerySender(req *http.Request) (*http.Response, error) {
14520	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14521}
14522
14523// InvokeInfrastructureQueryResponder handles the response to the InvokeInfrastructureQuery request. The method always
14524// closes the http.Response Body.
14525func (client BaseClient) InvokeInfrastructureQueryResponder(resp *http.Response) (result String, err error) {
14526	err = autorest.Respond(
14527		resp,
14528		client.ByInspecting(),
14529		azure.WithErrorUnlessStatusCode(http.StatusOK),
14530		autorest.ByUnmarshallingJSON(&result.Value),
14531		autorest.ByClosing())
14532	result.Response = autorest.Response{Response: resp}
14533	return
14534}
14535
14536// PostChaosSchedule set the Chaos Schedule currently in use by Chaos. Chaos will automatically schedule runs based on
14537// the Chaos Schedule.
14538// The version in the provided input schedule must match the version of the Chaos Schedule on the server.
14539// If the version provided does not match the version on the server, the Chaos Schedule is not updated.
14540// If the version provided matches the version on the server, then the Chaos Schedule is updated and the version of the
14541// Chaos Schedule on the server is incremented up by one and wraps back to 0 after 2,147,483,647.
14542// If Chaos is running when this call is made, the call will fail.
14543// Parameters:
14544// chaosSchedule - describes the schedule used by Chaos.
14545func (client BaseClient) PostChaosSchedule(ctx context.Context, chaosSchedule ChaosScheduleDescription) (result autorest.Response, err error) {
14546	if tracing.IsEnabled() {
14547		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PostChaosSchedule")
14548		defer func() {
14549			sc := -1
14550			if result.Response != nil {
14551				sc = result.Response.StatusCode
14552			}
14553			tracing.EndSpan(ctx, sc, err)
14554		}()
14555	}
14556	if err := validation.Validate([]validation.Validation{
14557		{TargetValue: chaosSchedule,
14558			Constraints: []validation.Constraint{{Target: "chaosSchedule.Version", Name: validation.Null, Rule: false,
14559				Chain: []validation.Constraint{{Target: "chaosSchedule.Version", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil {
14560		return result, validation.NewError("servicefabric.BaseClient", "PostChaosSchedule", err.Error())
14561	}
14562
14563	req, err := client.PostChaosSchedulePreparer(ctx, chaosSchedule)
14564	if err != nil {
14565		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", nil, "Failure preparing request")
14566		return
14567	}
14568
14569	resp, err := client.PostChaosScheduleSender(req)
14570	if err != nil {
14571		result.Response = resp
14572		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", resp, "Failure sending request")
14573		return
14574	}
14575
14576	result, err = client.PostChaosScheduleResponder(resp)
14577	if err != nil {
14578		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", resp, "Failure responding to request")
14579	}
14580
14581	return
14582}
14583
14584// PostChaosSchedulePreparer prepares the PostChaosSchedule request.
14585func (client BaseClient) PostChaosSchedulePreparer(ctx context.Context, chaosSchedule ChaosScheduleDescription) (*http.Request, error) {
14586	const APIVersion = "6.2"
14587	queryParameters := map[string]interface{}{
14588		"api-version": APIVersion,
14589	}
14590
14591	preparer := autorest.CreatePreparer(
14592		autorest.AsContentType("application/json; charset=utf-8"),
14593		autorest.AsPost(),
14594		autorest.WithBaseURL(client.BaseURI),
14595		autorest.WithPath("/Tools/Chaos/Schedule"),
14596		autorest.WithJSON(chaosSchedule),
14597		autorest.WithQueryParameters(queryParameters))
14598	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14599}
14600
14601// PostChaosScheduleSender sends the PostChaosSchedule request. The method will close the
14602// http.Response Body if it receives an error.
14603func (client BaseClient) PostChaosScheduleSender(req *http.Request) (*http.Response, error) {
14604	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14605}
14606
14607// PostChaosScheduleResponder handles the response to the PostChaosSchedule request. The method always
14608// closes the http.Response Body.
14609func (client BaseClient) PostChaosScheduleResponder(resp *http.Response) (result autorest.Response, err error) {
14610	err = autorest.Respond(
14611		resp,
14612		client.ByInspecting(),
14613		azure.WithErrorUnlessStatusCode(http.StatusOK),
14614		autorest.ByClosing())
14615	result.Response = resp
14616	return
14617}
14618
14619// ProvisionApplicationType provisions a Service Fabric application type with the cluster. The provision is required
14620// before any new applications can be instantiated.
14621// The provision operation can be performed either on the application package specified by the
14622// relativePathInImageStore, or by using the URI of the external '.sfpkg'.
14623// Parameters:
14624// provisionApplicationTypeDescriptionBaseRequiredBodyParam - the base type of provision application type
14625// description which supports either image store-based provision or external store-based provision.
14626// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14627// duration that the client is willing to wait for the requested operation to complete. The default value for
14628// this parameter is 60 seconds.
14629func (client BaseClient) ProvisionApplicationType(ctx context.Context, provisionApplicationTypeDescriptionBaseRequiredBodyParam BasicProvisionApplicationTypeDescriptionBase, timeout *int64) (result autorest.Response, err error) {
14630	if tracing.IsEnabled() {
14631		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ProvisionApplicationType")
14632		defer func() {
14633			sc := -1
14634			if result.Response != nil {
14635				sc = result.Response.StatusCode
14636			}
14637			tracing.EndSpan(ctx, sc, err)
14638		}()
14639	}
14640	if err := validation.Validate([]validation.Validation{
14641		{TargetValue: provisionApplicationTypeDescriptionBaseRequiredBodyParam,
14642			Constraints: []validation.Constraint{{Target: "provisionApplicationTypeDescriptionBaseRequiredBodyParam.Async", Name: validation.Null, Rule: true, Chain: nil}}},
14643		{TargetValue: timeout,
14644			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14645				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14646					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14647				}}}}}); err != nil {
14648		return result, validation.NewError("servicefabric.BaseClient", "ProvisionApplicationType", err.Error())
14649	}
14650
14651	req, err := client.ProvisionApplicationTypePreparer(ctx, provisionApplicationTypeDescriptionBaseRequiredBodyParam, timeout)
14652	if err != nil {
14653		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", nil, "Failure preparing request")
14654		return
14655	}
14656
14657	resp, err := client.ProvisionApplicationTypeSender(req)
14658	if err != nil {
14659		result.Response = resp
14660		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", resp, "Failure sending request")
14661		return
14662	}
14663
14664	result, err = client.ProvisionApplicationTypeResponder(resp)
14665	if err != nil {
14666		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", resp, "Failure responding to request")
14667	}
14668
14669	return
14670}
14671
14672// ProvisionApplicationTypePreparer prepares the ProvisionApplicationType request.
14673func (client BaseClient) ProvisionApplicationTypePreparer(ctx context.Context, provisionApplicationTypeDescriptionBaseRequiredBodyParam BasicProvisionApplicationTypeDescriptionBase, timeout *int64) (*http.Request, error) {
14674	const APIVersion = "6.2"
14675	queryParameters := map[string]interface{}{
14676		"api-version": APIVersion,
14677	}
14678	if timeout != nil {
14679		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14680	} else {
14681		queryParameters["timeout"] = autorest.Encode("query", 60)
14682	}
14683
14684	preparer := autorest.CreatePreparer(
14685		autorest.AsContentType("application/json; charset=utf-8"),
14686		autorest.AsPost(),
14687		autorest.WithBaseURL(client.BaseURI),
14688		autorest.WithPath("/ApplicationTypes/$/Provision"),
14689		autorest.WithJSON(provisionApplicationTypeDescriptionBaseRequiredBodyParam),
14690		autorest.WithQueryParameters(queryParameters))
14691	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14692}
14693
14694// ProvisionApplicationTypeSender sends the ProvisionApplicationType request. The method will close the
14695// http.Response Body if it receives an error.
14696func (client BaseClient) ProvisionApplicationTypeSender(req *http.Request) (*http.Response, error) {
14697	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14698}
14699
14700// ProvisionApplicationTypeResponder handles the response to the ProvisionApplicationType request. The method always
14701// closes the http.Response Body.
14702func (client BaseClient) ProvisionApplicationTypeResponder(resp *http.Response) (result autorest.Response, err error) {
14703	err = autorest.Respond(
14704		resp,
14705		client.ByInspecting(),
14706		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
14707		autorest.ByClosing())
14708	result.Response = resp
14709	return
14710}
14711
14712// ProvisionCluster validate and provision the code or configuration packages of a Service Fabric cluster.
14713// Parameters:
14714// provisionFabricDescription - describes the parameters for provisioning a cluster.
14715// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14716// duration that the client is willing to wait for the requested operation to complete. The default value for
14717// this parameter is 60 seconds.
14718func (client BaseClient) ProvisionCluster(ctx context.Context, provisionFabricDescription ProvisionFabricDescription, timeout *int64) (result autorest.Response, err error) {
14719	if tracing.IsEnabled() {
14720		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ProvisionCluster")
14721		defer func() {
14722			sc := -1
14723			if result.Response != nil {
14724				sc = result.Response.StatusCode
14725			}
14726			tracing.EndSpan(ctx, sc, err)
14727		}()
14728	}
14729	if err := validation.Validate([]validation.Validation{
14730		{TargetValue: timeout,
14731			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14732				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14733					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14734				}}}}}); err != nil {
14735		return result, validation.NewError("servicefabric.BaseClient", "ProvisionCluster", err.Error())
14736	}
14737
14738	req, err := client.ProvisionClusterPreparer(ctx, provisionFabricDescription, timeout)
14739	if err != nil {
14740		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", nil, "Failure preparing request")
14741		return
14742	}
14743
14744	resp, err := client.ProvisionClusterSender(req)
14745	if err != nil {
14746		result.Response = resp
14747		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", resp, "Failure sending request")
14748		return
14749	}
14750
14751	result, err = client.ProvisionClusterResponder(resp)
14752	if err != nil {
14753		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", resp, "Failure responding to request")
14754	}
14755
14756	return
14757}
14758
14759// ProvisionClusterPreparer prepares the ProvisionCluster request.
14760func (client BaseClient) ProvisionClusterPreparer(ctx context.Context, provisionFabricDescription ProvisionFabricDescription, timeout *int64) (*http.Request, error) {
14761	const APIVersion = "6.0"
14762	queryParameters := map[string]interface{}{
14763		"api-version": APIVersion,
14764	}
14765	if timeout != nil {
14766		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14767	} else {
14768		queryParameters["timeout"] = autorest.Encode("query", 60)
14769	}
14770
14771	preparer := autorest.CreatePreparer(
14772		autorest.AsContentType("application/json; charset=utf-8"),
14773		autorest.AsPost(),
14774		autorest.WithBaseURL(client.BaseURI),
14775		autorest.WithPath("/$/Provision"),
14776		autorest.WithJSON(provisionFabricDescription),
14777		autorest.WithQueryParameters(queryParameters))
14778	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14779}
14780
14781// ProvisionClusterSender sends the ProvisionCluster request. The method will close the
14782// http.Response Body if it receives an error.
14783func (client BaseClient) ProvisionClusterSender(req *http.Request) (*http.Response, error) {
14784	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14785}
14786
14787// ProvisionClusterResponder handles the response to the ProvisionCluster request. The method always
14788// closes the http.Response Body.
14789func (client BaseClient) ProvisionClusterResponder(resp *http.Response) (result autorest.Response, err error) {
14790	err = autorest.Respond(
14791		resp,
14792		client.ByInspecting(),
14793		azure.WithErrorUnlessStatusCode(http.StatusOK),
14794		autorest.ByClosing())
14795	result.Response = resp
14796	return
14797}
14798
14799// PutProperty creates or updates the specified Service Fabric property under a given name.
14800// Parameters:
14801// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
14802// propertyDescription - describes the Service Fabric property to be created.
14803// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14804// duration that the client is willing to wait for the requested operation to complete. The default value for
14805// this parameter is 60 seconds.
14806func (client BaseClient) PutProperty(ctx context.Context, nameID string, propertyDescription PropertyDescription, timeout *int64) (result autorest.Response, err error) {
14807	if tracing.IsEnabled() {
14808		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PutProperty")
14809		defer func() {
14810			sc := -1
14811			if result.Response != nil {
14812				sc = result.Response.StatusCode
14813			}
14814			tracing.EndSpan(ctx, sc, err)
14815		}()
14816	}
14817	if err := validation.Validate([]validation.Validation{
14818		{TargetValue: propertyDescription,
14819			Constraints: []validation.Constraint{{Target: "propertyDescription.PropertyName", Name: validation.Null, Rule: true, Chain: nil},
14820				{Target: "propertyDescription.Value", Name: validation.Null, Rule: true, Chain: nil}}},
14821		{TargetValue: timeout,
14822			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14823				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14824					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14825				}}}}}); err != nil {
14826		return result, validation.NewError("servicefabric.BaseClient", "PutProperty", err.Error())
14827	}
14828
14829	req, err := client.PutPropertyPreparer(ctx, nameID, propertyDescription, timeout)
14830	if err != nil {
14831		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", nil, "Failure preparing request")
14832		return
14833	}
14834
14835	resp, err := client.PutPropertySender(req)
14836	if err != nil {
14837		result.Response = resp
14838		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", resp, "Failure sending request")
14839		return
14840	}
14841
14842	result, err = client.PutPropertyResponder(resp)
14843	if err != nil {
14844		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", resp, "Failure responding to request")
14845	}
14846
14847	return
14848}
14849
14850// PutPropertyPreparer prepares the PutProperty request.
14851func (client BaseClient) PutPropertyPreparer(ctx context.Context, nameID string, propertyDescription PropertyDescription, timeout *int64) (*http.Request, error) {
14852	pathParameters := map[string]interface{}{
14853		"nameId": nameID,
14854	}
14855
14856	const APIVersion = "6.0"
14857	queryParameters := map[string]interface{}{
14858		"api-version": APIVersion,
14859	}
14860	if timeout != nil {
14861		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14862	} else {
14863		queryParameters["timeout"] = autorest.Encode("query", 60)
14864	}
14865
14866	preparer := autorest.CreatePreparer(
14867		autorest.AsContentType("application/json; charset=utf-8"),
14868		autorest.AsPut(),
14869		autorest.WithBaseURL(client.BaseURI),
14870		autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters),
14871		autorest.WithJSON(propertyDescription),
14872		autorest.WithQueryParameters(queryParameters))
14873	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14874}
14875
14876// PutPropertySender sends the PutProperty request. The method will close the
14877// http.Response Body if it receives an error.
14878func (client BaseClient) PutPropertySender(req *http.Request) (*http.Response, error) {
14879	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14880}
14881
14882// PutPropertyResponder handles the response to the PutProperty request. The method always
14883// closes the http.Response Body.
14884func (client BaseClient) PutPropertyResponder(resp *http.Response) (result autorest.Response, err error) {
14885	err = autorest.Respond(
14886		resp,
14887		client.ByInspecting(),
14888		azure.WithErrorUnlessStatusCode(http.StatusOK),
14889		autorest.ByClosing())
14890	result.Response = resp
14891	return
14892}
14893
14894// RecoverAllPartitions indicates to the Service Fabric cluster that it should attempt to recover any services
14895// (including system services) which are currently stuck in quorum loss. This operation should only be performed if it
14896// is known that the replicas that are down cannot be recovered. Incorrect use of this API can cause potential data
14897// loss.
14898// Parameters:
14899// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14900// duration that the client is willing to wait for the requested operation to complete. The default value for
14901// this parameter is 60 seconds.
14902func (client BaseClient) RecoverAllPartitions(ctx context.Context, timeout *int64) (result autorest.Response, err error) {
14903	if tracing.IsEnabled() {
14904		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverAllPartitions")
14905		defer func() {
14906			sc := -1
14907			if result.Response != nil {
14908				sc = result.Response.StatusCode
14909			}
14910			tracing.EndSpan(ctx, sc, err)
14911		}()
14912	}
14913	if err := validation.Validate([]validation.Validation{
14914		{TargetValue: timeout,
14915			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
14916				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
14917					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
14918				}}}}}); err != nil {
14919		return result, validation.NewError("servicefabric.BaseClient", "RecoverAllPartitions", err.Error())
14920	}
14921
14922	req, err := client.RecoverAllPartitionsPreparer(ctx, timeout)
14923	if err != nil {
14924		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", nil, "Failure preparing request")
14925		return
14926	}
14927
14928	resp, err := client.RecoverAllPartitionsSender(req)
14929	if err != nil {
14930		result.Response = resp
14931		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", resp, "Failure sending request")
14932		return
14933	}
14934
14935	result, err = client.RecoverAllPartitionsResponder(resp)
14936	if err != nil {
14937		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", resp, "Failure responding to request")
14938	}
14939
14940	return
14941}
14942
14943// RecoverAllPartitionsPreparer prepares the RecoverAllPartitions request.
14944func (client BaseClient) RecoverAllPartitionsPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
14945	const APIVersion = "6.0"
14946	queryParameters := map[string]interface{}{
14947		"api-version": APIVersion,
14948	}
14949	if timeout != nil {
14950		queryParameters["timeout"] = autorest.Encode("query", *timeout)
14951	} else {
14952		queryParameters["timeout"] = autorest.Encode("query", 60)
14953	}
14954
14955	preparer := autorest.CreatePreparer(
14956		autorest.AsPost(),
14957		autorest.WithBaseURL(client.BaseURI),
14958		autorest.WithPath("/$/RecoverAllPartitions"),
14959		autorest.WithQueryParameters(queryParameters))
14960	return preparer.Prepare((&http.Request{}).WithContext(ctx))
14961}
14962
14963// RecoverAllPartitionsSender sends the RecoverAllPartitions request. The method will close the
14964// http.Response Body if it receives an error.
14965func (client BaseClient) RecoverAllPartitionsSender(req *http.Request) (*http.Response, error) {
14966	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14967}
14968
14969// RecoverAllPartitionsResponder handles the response to the RecoverAllPartitions request. The method always
14970// closes the http.Response Body.
14971func (client BaseClient) RecoverAllPartitionsResponder(resp *http.Response) (result autorest.Response, err error) {
14972	err = autorest.Respond(
14973		resp,
14974		client.ByInspecting(),
14975		azure.WithErrorUnlessStatusCode(http.StatusOK),
14976		autorest.ByClosing())
14977	result.Response = resp
14978	return
14979}
14980
14981// RecoverPartition indicates to the Service Fabric cluster that it should attempt to recover a specific partition
14982// which is currently stuck in quorum loss. This operation should only be performed if it is known that the replicas
14983// that are down cannot be recovered. Incorrect use of this API can cause potential data loss.
14984// Parameters:
14985// partitionID - the identity of the partition.
14986// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
14987// duration that the client is willing to wait for the requested operation to complete. The default value for
14988// this parameter is 60 seconds.
14989func (client BaseClient) RecoverPartition(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
14990	if tracing.IsEnabled() {
14991		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverPartition")
14992		defer func() {
14993			sc := -1
14994			if result.Response != nil {
14995				sc = result.Response.StatusCode
14996			}
14997			tracing.EndSpan(ctx, sc, err)
14998		}()
14999	}
15000	if err := validation.Validate([]validation.Validation{
15001		{TargetValue: timeout,
15002			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15003				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15004					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15005				}}}}}); err != nil {
15006		return result, validation.NewError("servicefabric.BaseClient", "RecoverPartition", err.Error())
15007	}
15008
15009	req, err := client.RecoverPartitionPreparer(ctx, partitionID, timeout)
15010	if err != nil {
15011		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", nil, "Failure preparing request")
15012		return
15013	}
15014
15015	resp, err := client.RecoverPartitionSender(req)
15016	if err != nil {
15017		result.Response = resp
15018		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", resp, "Failure sending request")
15019		return
15020	}
15021
15022	result, err = client.RecoverPartitionResponder(resp)
15023	if err != nil {
15024		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", resp, "Failure responding to request")
15025	}
15026
15027	return
15028}
15029
15030// RecoverPartitionPreparer prepares the RecoverPartition request.
15031func (client BaseClient) RecoverPartitionPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
15032	pathParameters := map[string]interface{}{
15033		"partitionId": partitionID,
15034	}
15035
15036	const APIVersion = "6.0"
15037	queryParameters := map[string]interface{}{
15038		"api-version": APIVersion,
15039	}
15040	if timeout != nil {
15041		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15042	} else {
15043		queryParameters["timeout"] = autorest.Encode("query", 60)
15044	}
15045
15046	preparer := autorest.CreatePreparer(
15047		autorest.AsPost(),
15048		autorest.WithBaseURL(client.BaseURI),
15049		autorest.WithPathParameters("/Partitions/{partitionId}/$/Recover", pathParameters),
15050		autorest.WithQueryParameters(queryParameters))
15051	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15052}
15053
15054// RecoverPartitionSender sends the RecoverPartition request. The method will close the
15055// http.Response Body if it receives an error.
15056func (client BaseClient) RecoverPartitionSender(req *http.Request) (*http.Response, error) {
15057	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15058}
15059
15060// RecoverPartitionResponder handles the response to the RecoverPartition request. The method always
15061// closes the http.Response Body.
15062func (client BaseClient) RecoverPartitionResponder(resp *http.Response) (result autorest.Response, err error) {
15063	err = autorest.Respond(
15064		resp,
15065		client.ByInspecting(),
15066		azure.WithErrorUnlessStatusCode(http.StatusOK),
15067		autorest.ByClosing())
15068	result.Response = resp
15069	return
15070}
15071
15072// RecoverServicePartitions indicates to the Service Fabric cluster that it should attempt to recover the specified
15073// service which is currently stuck in quorum loss. This operation should only be performed if it is known that the
15074// replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss.
15075// Parameters:
15076// serviceID - the identity of the service. This is typically the full name of the service without the
15077// 'fabric:' URI scheme.
15078// Starting from version 6.0, hierarchical names are delimited with the "~" character.
15079// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
15080// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
15081// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15082// duration that the client is willing to wait for the requested operation to complete. The default value for
15083// this parameter is 60 seconds.
15084func (client BaseClient) RecoverServicePartitions(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) {
15085	if tracing.IsEnabled() {
15086		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverServicePartitions")
15087		defer func() {
15088			sc := -1
15089			if result.Response != nil {
15090				sc = result.Response.StatusCode
15091			}
15092			tracing.EndSpan(ctx, sc, err)
15093		}()
15094	}
15095	if err := validation.Validate([]validation.Validation{
15096		{TargetValue: timeout,
15097			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15098				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15099					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15100				}}}}}); err != nil {
15101		return result, validation.NewError("servicefabric.BaseClient", "RecoverServicePartitions", err.Error())
15102	}
15103
15104	req, err := client.RecoverServicePartitionsPreparer(ctx, serviceID, timeout)
15105	if err != nil {
15106		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", nil, "Failure preparing request")
15107		return
15108	}
15109
15110	resp, err := client.RecoverServicePartitionsSender(req)
15111	if err != nil {
15112		result.Response = resp
15113		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", resp, "Failure sending request")
15114		return
15115	}
15116
15117	result, err = client.RecoverServicePartitionsResponder(resp)
15118	if err != nil {
15119		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", resp, "Failure responding to request")
15120	}
15121
15122	return
15123}
15124
15125// RecoverServicePartitionsPreparer prepares the RecoverServicePartitions request.
15126func (client BaseClient) RecoverServicePartitionsPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
15127	pathParameters := map[string]interface{}{
15128		"serviceId": serviceID,
15129	}
15130
15131	const APIVersion = "6.0"
15132	queryParameters := map[string]interface{}{
15133		"api-version": APIVersion,
15134	}
15135	if timeout != nil {
15136		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15137	} else {
15138		queryParameters["timeout"] = autorest.Encode("query", 60)
15139	}
15140
15141	preparer := autorest.CreatePreparer(
15142		autorest.AsPost(),
15143		autorest.WithBaseURL(client.BaseURI),
15144		autorest.WithPathParameters("/Services/$/{serviceId}/$/GetPartitions/$/Recover", pathParameters),
15145		autorest.WithQueryParameters(queryParameters))
15146	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15147}
15148
15149// RecoverServicePartitionsSender sends the RecoverServicePartitions request. The method will close the
15150// http.Response Body if it receives an error.
15151func (client BaseClient) RecoverServicePartitionsSender(req *http.Request) (*http.Response, error) {
15152	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15153}
15154
15155// RecoverServicePartitionsResponder handles the response to the RecoverServicePartitions request. The method always
15156// closes the http.Response Body.
15157func (client BaseClient) RecoverServicePartitionsResponder(resp *http.Response) (result autorest.Response, err error) {
15158	err = autorest.Respond(
15159		resp,
15160		client.ByInspecting(),
15161		azure.WithErrorUnlessStatusCode(http.StatusOK),
15162		autorest.ByClosing())
15163	result.Response = resp
15164	return
15165}
15166
15167// RecoverSystemPartitions indicates to the Service Fabric cluster that it should attempt to recover the system
15168// services which are currently stuck in quorum loss. This operation should only be performed if it is known that the
15169// replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss.
15170// Parameters:
15171// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15172// duration that the client is willing to wait for the requested operation to complete. The default value for
15173// this parameter is 60 seconds.
15174func (client BaseClient) RecoverSystemPartitions(ctx context.Context, timeout *int64) (result autorest.Response, err error) {
15175	if tracing.IsEnabled() {
15176		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverSystemPartitions")
15177		defer func() {
15178			sc := -1
15179			if result.Response != nil {
15180				sc = result.Response.StatusCode
15181			}
15182			tracing.EndSpan(ctx, sc, err)
15183		}()
15184	}
15185	if err := validation.Validate([]validation.Validation{
15186		{TargetValue: timeout,
15187			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15188				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15189					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15190				}}}}}); err != nil {
15191		return result, validation.NewError("servicefabric.BaseClient", "RecoverSystemPartitions", err.Error())
15192	}
15193
15194	req, err := client.RecoverSystemPartitionsPreparer(ctx, timeout)
15195	if err != nil {
15196		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", nil, "Failure preparing request")
15197		return
15198	}
15199
15200	resp, err := client.RecoverSystemPartitionsSender(req)
15201	if err != nil {
15202		result.Response = resp
15203		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", resp, "Failure sending request")
15204		return
15205	}
15206
15207	result, err = client.RecoverSystemPartitionsResponder(resp)
15208	if err != nil {
15209		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", resp, "Failure responding to request")
15210	}
15211
15212	return
15213}
15214
15215// RecoverSystemPartitionsPreparer prepares the RecoverSystemPartitions request.
15216func (client BaseClient) RecoverSystemPartitionsPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
15217	const APIVersion = "6.0"
15218	queryParameters := map[string]interface{}{
15219		"api-version": APIVersion,
15220	}
15221	if timeout != nil {
15222		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15223	} else {
15224		queryParameters["timeout"] = autorest.Encode("query", 60)
15225	}
15226
15227	preparer := autorest.CreatePreparer(
15228		autorest.AsPost(),
15229		autorest.WithBaseURL(client.BaseURI),
15230		autorest.WithPath("/$/RecoverSystemPartitions"),
15231		autorest.WithQueryParameters(queryParameters))
15232	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15233}
15234
15235// RecoverSystemPartitionsSender sends the RecoverSystemPartitions request. The method will close the
15236// http.Response Body if it receives an error.
15237func (client BaseClient) RecoverSystemPartitionsSender(req *http.Request) (*http.Response, error) {
15238	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15239}
15240
15241// RecoverSystemPartitionsResponder handles the response to the RecoverSystemPartitions request. The method always
15242// closes the http.Response Body.
15243func (client BaseClient) RecoverSystemPartitionsResponder(resp *http.Response) (result autorest.Response, err error) {
15244	err = autorest.Respond(
15245		resp,
15246		client.ByInspecting(),
15247		azure.WithErrorUnlessStatusCode(http.StatusOK),
15248		autorest.ByClosing())
15249	result.Response = resp
15250	return
15251}
15252
15253// RemoveComposeDeployment deletes an existing Service Fabric compose deployment.
15254// Parameters:
15255// deploymentName - the identity of the deployment.
15256// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15257// duration that the client is willing to wait for the requested operation to complete. The default value for
15258// this parameter is 60 seconds.
15259func (client BaseClient) RemoveComposeDeployment(ctx context.Context, deploymentName string, timeout *int64) (result autorest.Response, err error) {
15260	if tracing.IsEnabled() {
15261		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveComposeDeployment")
15262		defer func() {
15263			sc := -1
15264			if result.Response != nil {
15265				sc = result.Response.StatusCode
15266			}
15267			tracing.EndSpan(ctx, sc, err)
15268		}()
15269	}
15270	if err := validation.Validate([]validation.Validation{
15271		{TargetValue: timeout,
15272			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15273				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15274					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15275				}}}}}); err != nil {
15276		return result, validation.NewError("servicefabric.BaseClient", "RemoveComposeDeployment", err.Error())
15277	}
15278
15279	req, err := client.RemoveComposeDeploymentPreparer(ctx, deploymentName, timeout)
15280	if err != nil {
15281		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", nil, "Failure preparing request")
15282		return
15283	}
15284
15285	resp, err := client.RemoveComposeDeploymentSender(req)
15286	if err != nil {
15287		result.Response = resp
15288		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", resp, "Failure sending request")
15289		return
15290	}
15291
15292	result, err = client.RemoveComposeDeploymentResponder(resp)
15293	if err != nil {
15294		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", resp, "Failure responding to request")
15295	}
15296
15297	return
15298}
15299
15300// RemoveComposeDeploymentPreparer prepares the RemoveComposeDeployment request.
15301func (client BaseClient) RemoveComposeDeploymentPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) {
15302	pathParameters := map[string]interface{}{
15303		"deploymentName": deploymentName,
15304	}
15305
15306	const APIVersion = "6.0-preview"
15307	queryParameters := map[string]interface{}{
15308		"api-version": APIVersion,
15309	}
15310	if timeout != nil {
15311		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15312	} else {
15313		queryParameters["timeout"] = autorest.Encode("query", 60)
15314	}
15315
15316	preparer := autorest.CreatePreparer(
15317		autorest.AsPost(),
15318		autorest.WithBaseURL(client.BaseURI),
15319		autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/Delete", pathParameters),
15320		autorest.WithQueryParameters(queryParameters))
15321	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15322}
15323
15324// RemoveComposeDeploymentSender sends the RemoveComposeDeployment request. The method will close the
15325// http.Response Body if it receives an error.
15326func (client BaseClient) RemoveComposeDeploymentSender(req *http.Request) (*http.Response, error) {
15327	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15328}
15329
15330// RemoveComposeDeploymentResponder handles the response to the RemoveComposeDeployment request. The method always
15331// closes the http.Response Body.
15332func (client BaseClient) RemoveComposeDeploymentResponder(resp *http.Response) (result autorest.Response, err error) {
15333	err = autorest.Respond(
15334		resp,
15335		client.ByInspecting(),
15336		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
15337		autorest.ByClosing())
15338	result.Response = resp
15339	return
15340}
15341
15342// RemoveNodeState notifies Service Fabric that the persisted state on a node has been permanently removed or lost.
15343// This implies that it is not possible to recover the persisted state of that node. This generally happens if a hard
15344// disk has been wiped clean, or if a hard disk crashes. The node has to be down for this operation to be successful.
15345// This operation lets Service Fabric know that the replicas on that node no longer exist, and that Service Fabric
15346// should stop waiting for those replicas to come back up. Do not run this cmdlet if the state on the node has not been
15347// removed and the node can comes back up with its state intact.
15348// Parameters:
15349// nodeName - the name of the node.
15350// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15351// duration that the client is willing to wait for the requested operation to complete. The default value for
15352// this parameter is 60 seconds.
15353func (client BaseClient) RemoveNodeState(ctx context.Context, nodeName string, timeout *int64) (result autorest.Response, err error) {
15354	if tracing.IsEnabled() {
15355		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveNodeState")
15356		defer func() {
15357			sc := -1
15358			if result.Response != nil {
15359				sc = result.Response.StatusCode
15360			}
15361			tracing.EndSpan(ctx, sc, err)
15362		}()
15363	}
15364	if err := validation.Validate([]validation.Validation{
15365		{TargetValue: timeout,
15366			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15367				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15368					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15369				}}}}}); err != nil {
15370		return result, validation.NewError("servicefabric.BaseClient", "RemoveNodeState", err.Error())
15371	}
15372
15373	req, err := client.RemoveNodeStatePreparer(ctx, nodeName, timeout)
15374	if err != nil {
15375		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", nil, "Failure preparing request")
15376		return
15377	}
15378
15379	resp, err := client.RemoveNodeStateSender(req)
15380	if err != nil {
15381		result.Response = resp
15382		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", resp, "Failure sending request")
15383		return
15384	}
15385
15386	result, err = client.RemoveNodeStateResponder(resp)
15387	if err != nil {
15388		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", resp, "Failure responding to request")
15389	}
15390
15391	return
15392}
15393
15394// RemoveNodeStatePreparer prepares the RemoveNodeState request.
15395func (client BaseClient) RemoveNodeStatePreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) {
15396	pathParameters := map[string]interface{}{
15397		"nodeName": autorest.Encode("path", nodeName),
15398	}
15399
15400	const APIVersion = "6.0"
15401	queryParameters := map[string]interface{}{
15402		"api-version": APIVersion,
15403	}
15404	if timeout != nil {
15405		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15406	} else {
15407		queryParameters["timeout"] = autorest.Encode("query", 60)
15408	}
15409
15410	preparer := autorest.CreatePreparer(
15411		autorest.AsPost(),
15412		autorest.WithBaseURL(client.BaseURI),
15413		autorest.WithPathParameters("/Nodes/{nodeName}/$/RemoveNodeState", pathParameters),
15414		autorest.WithQueryParameters(queryParameters))
15415	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15416}
15417
15418// RemoveNodeStateSender sends the RemoveNodeState request. The method will close the
15419// http.Response Body if it receives an error.
15420func (client BaseClient) RemoveNodeStateSender(req *http.Request) (*http.Response, error) {
15421	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15422}
15423
15424// RemoveNodeStateResponder handles the response to the RemoveNodeState request. The method always
15425// closes the http.Response Body.
15426func (client BaseClient) RemoveNodeStateResponder(resp *http.Response) (result autorest.Response, err error) {
15427	err = autorest.Respond(
15428		resp,
15429		client.ByInspecting(),
15430		azure.WithErrorUnlessStatusCode(http.StatusOK),
15431		autorest.ByClosing())
15432	result.Response = resp
15433	return
15434}
15435
15436// RemoveReplica this API simulates a Service Fabric replica failure by removing a replica from a Service Fabric
15437// cluster. The removal closes the replica, transitions the replica to the role None, and then removes all of the state
15438// information of the replica from the cluster. This API tests the replica state removal path, and simulates the report
15439// fault permanent path through client APIs. Warning - There are no safety checks performed when this API is used.
15440// Incorrect use of this API can lead to data loss for stateful services.In addition, the forceRemove flag impacts all
15441// other replicas hosted in the same process.
15442// Parameters:
15443// nodeName - the name of the node.
15444// partitionID - the identity of the partition.
15445// replicaID - the identifier of the replica.
15446// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful
15447// shutdown sequence. This parameter can be used to forcefully delete an application or service for which
15448// delete is timing out due to issues in the service code that prevents graceful close of replicas.
15449// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15450// duration that the client is willing to wait for the requested operation to complete. The default value for
15451// this parameter is 60 seconds.
15452func (client BaseClient) RemoveReplica(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) {
15453	if tracing.IsEnabled() {
15454		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveReplica")
15455		defer func() {
15456			sc := -1
15457			if result.Response != nil {
15458				sc = result.Response.StatusCode
15459			}
15460			tracing.EndSpan(ctx, sc, err)
15461		}()
15462	}
15463	if err := validation.Validate([]validation.Validation{
15464		{TargetValue: timeout,
15465			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15466				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15467					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15468				}}}}}); err != nil {
15469		return result, validation.NewError("servicefabric.BaseClient", "RemoveReplica", err.Error())
15470	}
15471
15472	req, err := client.RemoveReplicaPreparer(ctx, nodeName, partitionID, replicaID, forceRemove, timeout)
15473	if err != nil {
15474		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", nil, "Failure preparing request")
15475		return
15476	}
15477
15478	resp, err := client.RemoveReplicaSender(req)
15479	if err != nil {
15480		result.Response = resp
15481		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", resp, "Failure sending request")
15482		return
15483	}
15484
15485	result, err = client.RemoveReplicaResponder(resp)
15486	if err != nil {
15487		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", resp, "Failure responding to request")
15488	}
15489
15490	return
15491}
15492
15493// RemoveReplicaPreparer prepares the RemoveReplica request.
15494func (client BaseClient) RemoveReplicaPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, forceRemove *bool, timeout *int64) (*http.Request, error) {
15495	pathParameters := map[string]interface{}{
15496		"nodeName":    autorest.Encode("path", nodeName),
15497		"partitionId": partitionID,
15498		"replicaId":   replicaID,
15499	}
15500
15501	const APIVersion = "6.0"
15502	queryParameters := map[string]interface{}{
15503		"api-version": APIVersion,
15504	}
15505	if forceRemove != nil {
15506		queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove)
15507	}
15508	if timeout != nil {
15509		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15510	} else {
15511		queryParameters["timeout"] = autorest.Encode("query", 60)
15512	}
15513
15514	preparer := autorest.CreatePreparer(
15515		autorest.AsPost(),
15516		autorest.WithBaseURL(client.BaseURI),
15517		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Delete", pathParameters),
15518		autorest.WithQueryParameters(queryParameters))
15519	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15520}
15521
15522// RemoveReplicaSender sends the RemoveReplica request. The method will close the
15523// http.Response Body if it receives an error.
15524func (client BaseClient) RemoveReplicaSender(req *http.Request) (*http.Response, error) {
15525	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15526}
15527
15528// RemoveReplicaResponder handles the response to the RemoveReplica request. The method always
15529// closes the http.Response Body.
15530func (client BaseClient) RemoveReplicaResponder(resp *http.Response) (result autorest.Response, err error) {
15531	err = autorest.Respond(
15532		resp,
15533		client.ByInspecting(),
15534		azure.WithErrorUnlessStatusCode(http.StatusOK),
15535		autorest.ByClosing())
15536	result.Response = resp
15537	return
15538}
15539
15540// ReportApplicationHealth reports health state of the specified Service Fabric application. The report must contain
15541// the information about the source of the health report and property on which it is reported.
15542// The report is sent to a Service Fabric gateway Application, which forwards to the health store.
15543// The report may be accepted by the gateway, but rejected by the health store after extra validation.
15544// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
15545// To see whether the report was applied in the health store, get application health and check that the report appears
15546// in the HealthEvents section.
15547// Parameters:
15548// applicationID - the identity of the application. This is typically the full name of the application without
15549// the 'fabric:' URI scheme.
15550// Starting from version 6.0, hierarchical names are delimited with the "~" character.
15551// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
15552// in 6.0+ and "myapp/app1" in previous versions.
15553// healthInformation - describes the health information for the health report. This information needs to be
15554// present in all of the health reports sent to the health manager.
15555// immediate - a flag which indicates whether the report should be sent immediately.
15556// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
15557// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
15558// regardless of the fabric client settings that the HTTP Gateway Application is using.
15559// This is useful for critical reports that should be sent as soon as possible.
15560// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
15561// is closed or the message doesn't reach the Gateway.
15562// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
15563// Therefore, it will be batched according to the HealthReportSendInterval configuration.
15564// This is the recommended setting because it allows the health client to optimize health reporting messages to
15565// health store as well as health report processing.
15566// By default, reports are not sent immediately.
15567// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15568// duration that the client is willing to wait for the requested operation to complete. The default value for
15569// this parameter is 60 seconds.
15570func (client BaseClient) ReportApplicationHealth(ctx context.Context, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
15571	if tracing.IsEnabled() {
15572		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportApplicationHealth")
15573		defer func() {
15574			sc := -1
15575			if result.Response != nil {
15576				sc = result.Response.StatusCode
15577			}
15578			tracing.EndSpan(ctx, sc, err)
15579		}()
15580	}
15581	if err := validation.Validate([]validation.Validation{
15582		{TargetValue: healthInformation,
15583			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
15584				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
15585		{TargetValue: timeout,
15586			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15587				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15588					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15589				}}}}}); err != nil {
15590		return result, validation.NewError("servicefabric.BaseClient", "ReportApplicationHealth", err.Error())
15591	}
15592
15593	req, err := client.ReportApplicationHealthPreparer(ctx, applicationID, healthInformation, immediate, timeout)
15594	if err != nil {
15595		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", nil, "Failure preparing request")
15596		return
15597	}
15598
15599	resp, err := client.ReportApplicationHealthSender(req)
15600	if err != nil {
15601		result.Response = resp
15602		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", resp, "Failure sending request")
15603		return
15604	}
15605
15606	result, err = client.ReportApplicationHealthResponder(resp)
15607	if err != nil {
15608		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", resp, "Failure responding to request")
15609	}
15610
15611	return
15612}
15613
15614// ReportApplicationHealthPreparer prepares the ReportApplicationHealth request.
15615func (client BaseClient) ReportApplicationHealthPreparer(ctx context.Context, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
15616	pathParameters := map[string]interface{}{
15617		"applicationId": applicationID,
15618	}
15619
15620	const APIVersion = "6.0"
15621	queryParameters := map[string]interface{}{
15622		"api-version": APIVersion,
15623	}
15624	if immediate != nil {
15625		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
15626	} else {
15627		queryParameters["Immediate"] = autorest.Encode("query", false)
15628	}
15629	if timeout != nil {
15630		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15631	} else {
15632		queryParameters["timeout"] = autorest.Encode("query", 60)
15633	}
15634
15635	preparer := autorest.CreatePreparer(
15636		autorest.AsContentType("application/json; charset=utf-8"),
15637		autorest.AsPost(),
15638		autorest.WithBaseURL(client.BaseURI),
15639		autorest.WithPathParameters("/Applications/{applicationId}/$/ReportHealth", pathParameters),
15640		autorest.WithJSON(healthInformation),
15641		autorest.WithQueryParameters(queryParameters))
15642	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15643}
15644
15645// ReportApplicationHealthSender sends the ReportApplicationHealth request. The method will close the
15646// http.Response Body if it receives an error.
15647func (client BaseClient) ReportApplicationHealthSender(req *http.Request) (*http.Response, error) {
15648	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15649}
15650
15651// ReportApplicationHealthResponder handles the response to the ReportApplicationHealth request. The method always
15652// closes the http.Response Body.
15653func (client BaseClient) ReportApplicationHealthResponder(resp *http.Response) (result autorest.Response, err error) {
15654	err = autorest.Respond(
15655		resp,
15656		client.ByInspecting(),
15657		azure.WithErrorUnlessStatusCode(http.StatusOK),
15658		autorest.ByClosing())
15659	result.Response = resp
15660	return
15661}
15662
15663// ReportClusterHealth sends a health report on a Service Fabric cluster. The report must contain the information about
15664// the source of the health report and property on which it is reported.
15665// The report is sent to a Service Fabric gateway node, which forwards to the health store.
15666// The report may be accepted by the gateway, but rejected by the health store after extra validation.
15667// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
15668// To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in
15669// the HealthEvents section.
15670// Parameters:
15671// healthInformation - describes the health information for the health report. This information needs to be
15672// present in all of the health reports sent to the health manager.
15673// immediate - a flag which indicates whether the report should be sent immediately.
15674// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
15675// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
15676// regardless of the fabric client settings that the HTTP Gateway Application is using.
15677// This is useful for critical reports that should be sent as soon as possible.
15678// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
15679// is closed or the message doesn't reach the Gateway.
15680// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
15681// Therefore, it will be batched according to the HealthReportSendInterval configuration.
15682// This is the recommended setting because it allows the health client to optimize health reporting messages to
15683// health store as well as health report processing.
15684// By default, reports are not sent immediately.
15685// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15686// duration that the client is willing to wait for the requested operation to complete. The default value for
15687// this parameter is 60 seconds.
15688func (client BaseClient) ReportClusterHealth(ctx context.Context, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
15689	if tracing.IsEnabled() {
15690		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportClusterHealth")
15691		defer func() {
15692			sc := -1
15693			if result.Response != nil {
15694				sc = result.Response.StatusCode
15695			}
15696			tracing.EndSpan(ctx, sc, err)
15697		}()
15698	}
15699	if err := validation.Validate([]validation.Validation{
15700		{TargetValue: healthInformation,
15701			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
15702				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
15703		{TargetValue: timeout,
15704			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15705				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15706					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15707				}}}}}); err != nil {
15708		return result, validation.NewError("servicefabric.BaseClient", "ReportClusterHealth", err.Error())
15709	}
15710
15711	req, err := client.ReportClusterHealthPreparer(ctx, healthInformation, immediate, timeout)
15712	if err != nil {
15713		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", nil, "Failure preparing request")
15714		return
15715	}
15716
15717	resp, err := client.ReportClusterHealthSender(req)
15718	if err != nil {
15719		result.Response = resp
15720		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", resp, "Failure sending request")
15721		return
15722	}
15723
15724	result, err = client.ReportClusterHealthResponder(resp)
15725	if err != nil {
15726		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", resp, "Failure responding to request")
15727	}
15728
15729	return
15730}
15731
15732// ReportClusterHealthPreparer prepares the ReportClusterHealth request.
15733func (client BaseClient) ReportClusterHealthPreparer(ctx context.Context, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
15734	const APIVersion = "6.0"
15735	queryParameters := map[string]interface{}{
15736		"api-version": APIVersion,
15737	}
15738	if immediate != nil {
15739		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
15740	} else {
15741		queryParameters["Immediate"] = autorest.Encode("query", false)
15742	}
15743	if timeout != nil {
15744		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15745	} else {
15746		queryParameters["timeout"] = autorest.Encode("query", 60)
15747	}
15748
15749	preparer := autorest.CreatePreparer(
15750		autorest.AsContentType("application/json; charset=utf-8"),
15751		autorest.AsPost(),
15752		autorest.WithBaseURL(client.BaseURI),
15753		autorest.WithPath("/$/ReportClusterHealth"),
15754		autorest.WithJSON(healthInformation),
15755		autorest.WithQueryParameters(queryParameters))
15756	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15757}
15758
15759// ReportClusterHealthSender sends the ReportClusterHealth request. The method will close the
15760// http.Response Body if it receives an error.
15761func (client BaseClient) ReportClusterHealthSender(req *http.Request) (*http.Response, error) {
15762	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15763}
15764
15765// ReportClusterHealthResponder handles the response to the ReportClusterHealth request. The method always
15766// closes the http.Response Body.
15767func (client BaseClient) ReportClusterHealthResponder(resp *http.Response) (result autorest.Response, err error) {
15768	err = autorest.Respond(
15769		resp,
15770		client.ByInspecting(),
15771		azure.WithErrorUnlessStatusCode(http.StatusOK),
15772		autorest.ByClosing())
15773	result.Response = resp
15774	return
15775}
15776
15777// ReportDeployedApplicationHealth reports health state of the application deployed on a Service Fabric node. The
15778// report must contain the information about the source of the health report and property on which it is reported.
15779// The report is sent to a Service Fabric gateway Service, which forwards to the health store.
15780// The report may be accepted by the gateway, but rejected by the health store after extra validation.
15781// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
15782// To see whether the report was applied in the health store, get deployed application health and check that the report
15783// appears in the HealthEvents section.
15784// Parameters:
15785// nodeName - the name of the node.
15786// applicationID - the identity of the application. This is typically the full name of the application without
15787// the 'fabric:' URI scheme.
15788// Starting from version 6.0, hierarchical names are delimited with the "~" character.
15789// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
15790// in 6.0+ and "myapp/app1" in previous versions.
15791// healthInformation - describes the health information for the health report. This information needs to be
15792// present in all of the health reports sent to the health manager.
15793// immediate - a flag which indicates whether the report should be sent immediately.
15794// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
15795// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
15796// regardless of the fabric client settings that the HTTP Gateway Application is using.
15797// This is useful for critical reports that should be sent as soon as possible.
15798// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
15799// is closed or the message doesn't reach the Gateway.
15800// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
15801// Therefore, it will be batched according to the HealthReportSendInterval configuration.
15802// This is the recommended setting because it allows the health client to optimize health reporting messages to
15803// health store as well as health report processing.
15804// By default, reports are not sent immediately.
15805// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15806// duration that the client is willing to wait for the requested operation to complete. The default value for
15807// this parameter is 60 seconds.
15808func (client BaseClient) ReportDeployedApplicationHealth(ctx context.Context, nodeName string, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
15809	if tracing.IsEnabled() {
15810		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportDeployedApplicationHealth")
15811		defer func() {
15812			sc := -1
15813			if result.Response != nil {
15814				sc = result.Response.StatusCode
15815			}
15816			tracing.EndSpan(ctx, sc, err)
15817		}()
15818	}
15819	if err := validation.Validate([]validation.Validation{
15820		{TargetValue: healthInformation,
15821			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
15822				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
15823		{TargetValue: timeout,
15824			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15825				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15826					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15827				}}}}}); err != nil {
15828		return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedApplicationHealth", err.Error())
15829	}
15830
15831	req, err := client.ReportDeployedApplicationHealthPreparer(ctx, nodeName, applicationID, healthInformation, immediate, timeout)
15832	if err != nil {
15833		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", nil, "Failure preparing request")
15834		return
15835	}
15836
15837	resp, err := client.ReportDeployedApplicationHealthSender(req)
15838	if err != nil {
15839		result.Response = resp
15840		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", resp, "Failure sending request")
15841		return
15842	}
15843
15844	result, err = client.ReportDeployedApplicationHealthResponder(resp)
15845	if err != nil {
15846		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", resp, "Failure responding to request")
15847	}
15848
15849	return
15850}
15851
15852// ReportDeployedApplicationHealthPreparer prepares the ReportDeployedApplicationHealth request.
15853func (client BaseClient) ReportDeployedApplicationHealthPreparer(ctx context.Context, nodeName string, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
15854	pathParameters := map[string]interface{}{
15855		"applicationId": applicationID,
15856		"nodeName":      autorest.Encode("path", nodeName),
15857	}
15858
15859	const APIVersion = "6.0"
15860	queryParameters := map[string]interface{}{
15861		"api-version": APIVersion,
15862	}
15863	if immediate != nil {
15864		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
15865	} else {
15866		queryParameters["Immediate"] = autorest.Encode("query", false)
15867	}
15868	if timeout != nil {
15869		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15870	} else {
15871		queryParameters["timeout"] = autorest.Encode("query", 60)
15872	}
15873
15874	preparer := autorest.CreatePreparer(
15875		autorest.AsContentType("application/json; charset=utf-8"),
15876		autorest.AsPost(),
15877		autorest.WithBaseURL(client.BaseURI),
15878		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/ReportHealth", pathParameters),
15879		autorest.WithJSON(healthInformation),
15880		autorest.WithQueryParameters(queryParameters))
15881	return preparer.Prepare((&http.Request{}).WithContext(ctx))
15882}
15883
15884// ReportDeployedApplicationHealthSender sends the ReportDeployedApplicationHealth request. The method will close the
15885// http.Response Body if it receives an error.
15886func (client BaseClient) ReportDeployedApplicationHealthSender(req *http.Request) (*http.Response, error) {
15887	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15888}
15889
15890// ReportDeployedApplicationHealthResponder handles the response to the ReportDeployedApplicationHealth request. The method always
15891// closes the http.Response Body.
15892func (client BaseClient) ReportDeployedApplicationHealthResponder(resp *http.Response) (result autorest.Response, err error) {
15893	err = autorest.Respond(
15894		resp,
15895		client.ByInspecting(),
15896		azure.WithErrorUnlessStatusCode(http.StatusOK),
15897		autorest.ByClosing())
15898	result.Response = resp
15899	return
15900}
15901
15902// ReportDeployedServicePackageHealth reports health state of the service package of the application deployed on a
15903// Service Fabric node. The report must contain the information about the source of the health report and property on
15904// which it is reported.
15905// The report is sent to a Service Fabric gateway Service, which forwards to the health store.
15906// The report may be accepted by the gateway, but rejected by the health store after extra validation.
15907// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
15908// To see whether the report was applied in the health store, get deployed service package health and check that the
15909// report appears in the HealthEvents section.
15910// Parameters:
15911// nodeName - the name of the node.
15912// applicationID - the identity of the application. This is typically the full name of the application without
15913// the 'fabric:' URI scheme.
15914// Starting from version 6.0, hierarchical names are delimited with the "~" character.
15915// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
15916// in 6.0+ and "myapp/app1" in previous versions.
15917// servicePackageName - the name of the service package.
15918// healthInformation - describes the health information for the health report. This information needs to be
15919// present in all of the health reports sent to the health manager.
15920// immediate - a flag which indicates whether the report should be sent immediately.
15921// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
15922// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
15923// regardless of the fabric client settings that the HTTP Gateway Application is using.
15924// This is useful for critical reports that should be sent as soon as possible.
15925// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
15926// is closed or the message doesn't reach the Gateway.
15927// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
15928// Therefore, it will be batched according to the HealthReportSendInterval configuration.
15929// This is the recommended setting because it allows the health client to optimize health reporting messages to
15930// health store as well as health report processing.
15931// By default, reports are not sent immediately.
15932// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
15933// duration that the client is willing to wait for the requested operation to complete. The default value for
15934// this parameter is 60 seconds.
15935func (client BaseClient) ReportDeployedServicePackageHealth(ctx context.Context, nodeName string, applicationID string, servicePackageName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
15936	if tracing.IsEnabled() {
15937		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportDeployedServicePackageHealth")
15938		defer func() {
15939			sc := -1
15940			if result.Response != nil {
15941				sc = result.Response.StatusCode
15942			}
15943			tracing.EndSpan(ctx, sc, err)
15944		}()
15945	}
15946	if err := validation.Validate([]validation.Validation{
15947		{TargetValue: healthInformation,
15948			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
15949				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
15950		{TargetValue: timeout,
15951			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
15952				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
15953					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
15954				}}}}}); err != nil {
15955		return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedServicePackageHealth", err.Error())
15956	}
15957
15958	req, err := client.ReportDeployedServicePackageHealthPreparer(ctx, nodeName, applicationID, servicePackageName, healthInformation, immediate, timeout)
15959	if err != nil {
15960		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", nil, "Failure preparing request")
15961		return
15962	}
15963
15964	resp, err := client.ReportDeployedServicePackageHealthSender(req)
15965	if err != nil {
15966		result.Response = resp
15967		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", resp, "Failure sending request")
15968		return
15969	}
15970
15971	result, err = client.ReportDeployedServicePackageHealthResponder(resp)
15972	if err != nil {
15973		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", resp, "Failure responding to request")
15974	}
15975
15976	return
15977}
15978
15979// ReportDeployedServicePackageHealthPreparer prepares the ReportDeployedServicePackageHealth request.
15980func (client BaseClient) ReportDeployedServicePackageHealthPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
15981	pathParameters := map[string]interface{}{
15982		"applicationId":      applicationID,
15983		"nodeName":           autorest.Encode("path", nodeName),
15984		"servicePackageName": servicePackageName,
15985	}
15986
15987	const APIVersion = "6.0"
15988	queryParameters := map[string]interface{}{
15989		"api-version": APIVersion,
15990	}
15991	if immediate != nil {
15992		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
15993	} else {
15994		queryParameters["Immediate"] = autorest.Encode("query", false)
15995	}
15996	if timeout != nil {
15997		queryParameters["timeout"] = autorest.Encode("query", *timeout)
15998	} else {
15999		queryParameters["timeout"] = autorest.Encode("query", 60)
16000	}
16001
16002	preparer := autorest.CreatePreparer(
16003		autorest.AsContentType("application/json; charset=utf-8"),
16004		autorest.AsPost(),
16005		autorest.WithBaseURL(client.BaseURI),
16006		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/ReportHealth", pathParameters),
16007		autorest.WithJSON(healthInformation),
16008		autorest.WithQueryParameters(queryParameters))
16009	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16010}
16011
16012// ReportDeployedServicePackageHealthSender sends the ReportDeployedServicePackageHealth request. The method will close the
16013// http.Response Body if it receives an error.
16014func (client BaseClient) ReportDeployedServicePackageHealthSender(req *http.Request) (*http.Response, error) {
16015	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16016}
16017
16018// ReportDeployedServicePackageHealthResponder handles the response to the ReportDeployedServicePackageHealth request. The method always
16019// closes the http.Response Body.
16020func (client BaseClient) ReportDeployedServicePackageHealthResponder(resp *http.Response) (result autorest.Response, err error) {
16021	err = autorest.Respond(
16022		resp,
16023		client.ByInspecting(),
16024		azure.WithErrorUnlessStatusCode(http.StatusOK),
16025		autorest.ByClosing())
16026	result.Response = resp
16027	return
16028}
16029
16030// ReportNodeHealth reports health state of the specified Service Fabric node. The report must contain the information
16031// about the source of the health report and property on which it is reported.
16032// The report is sent to a Service Fabric gateway node, which forwards to the health store.
16033// The report may be accepted by the gateway, but rejected by the health store after extra validation.
16034// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
16035// To see whether the report was applied in the health store, run GetNodeHealth and check that the report appears in
16036// the HealthEvents section.
16037// Parameters:
16038// nodeName - the name of the node.
16039// healthInformation - describes the health information for the health report. This information needs to be
16040// present in all of the health reports sent to the health manager.
16041// immediate - a flag which indicates whether the report should be sent immediately.
16042// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
16043// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
16044// regardless of the fabric client settings that the HTTP Gateway Application is using.
16045// This is useful for critical reports that should be sent as soon as possible.
16046// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
16047// is closed or the message doesn't reach the Gateway.
16048// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
16049// Therefore, it will be batched according to the HealthReportSendInterval configuration.
16050// This is the recommended setting because it allows the health client to optimize health reporting messages to
16051// health store as well as health report processing.
16052// By default, reports are not sent immediately.
16053// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16054// duration that the client is willing to wait for the requested operation to complete. The default value for
16055// this parameter is 60 seconds.
16056func (client BaseClient) ReportNodeHealth(ctx context.Context, nodeName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
16057	if tracing.IsEnabled() {
16058		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportNodeHealth")
16059		defer func() {
16060			sc := -1
16061			if result.Response != nil {
16062				sc = result.Response.StatusCode
16063			}
16064			tracing.EndSpan(ctx, sc, err)
16065		}()
16066	}
16067	if err := validation.Validate([]validation.Validation{
16068		{TargetValue: healthInformation,
16069			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
16070				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
16071		{TargetValue: timeout,
16072			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16073				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16074					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16075				}}}}}); err != nil {
16076		return result, validation.NewError("servicefabric.BaseClient", "ReportNodeHealth", err.Error())
16077	}
16078
16079	req, err := client.ReportNodeHealthPreparer(ctx, nodeName, healthInformation, immediate, timeout)
16080	if err != nil {
16081		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", nil, "Failure preparing request")
16082		return
16083	}
16084
16085	resp, err := client.ReportNodeHealthSender(req)
16086	if err != nil {
16087		result.Response = resp
16088		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", resp, "Failure sending request")
16089		return
16090	}
16091
16092	result, err = client.ReportNodeHealthResponder(resp)
16093	if err != nil {
16094		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", resp, "Failure responding to request")
16095	}
16096
16097	return
16098}
16099
16100// ReportNodeHealthPreparer prepares the ReportNodeHealth request.
16101func (client BaseClient) ReportNodeHealthPreparer(ctx context.Context, nodeName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
16102	pathParameters := map[string]interface{}{
16103		"nodeName": autorest.Encode("path", nodeName),
16104	}
16105
16106	const APIVersion = "6.0"
16107	queryParameters := map[string]interface{}{
16108		"api-version": APIVersion,
16109	}
16110	if immediate != nil {
16111		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
16112	} else {
16113		queryParameters["Immediate"] = autorest.Encode("query", false)
16114	}
16115	if timeout != nil {
16116		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16117	} else {
16118		queryParameters["timeout"] = autorest.Encode("query", 60)
16119	}
16120
16121	preparer := autorest.CreatePreparer(
16122		autorest.AsContentType("application/json; charset=utf-8"),
16123		autorest.AsPost(),
16124		autorest.WithBaseURL(client.BaseURI),
16125		autorest.WithPathParameters("/Nodes/{nodeName}/$/ReportHealth", pathParameters),
16126		autorest.WithJSON(healthInformation),
16127		autorest.WithQueryParameters(queryParameters))
16128	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16129}
16130
16131// ReportNodeHealthSender sends the ReportNodeHealth request. The method will close the
16132// http.Response Body if it receives an error.
16133func (client BaseClient) ReportNodeHealthSender(req *http.Request) (*http.Response, error) {
16134	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16135}
16136
16137// ReportNodeHealthResponder handles the response to the ReportNodeHealth request. The method always
16138// closes the http.Response Body.
16139func (client BaseClient) ReportNodeHealthResponder(resp *http.Response) (result autorest.Response, err error) {
16140	err = autorest.Respond(
16141		resp,
16142		client.ByInspecting(),
16143		azure.WithErrorUnlessStatusCode(http.StatusOK),
16144		autorest.ByClosing())
16145	result.Response = resp
16146	return
16147}
16148
16149// ReportPartitionHealth reports health state of the specified Service Fabric partition. The report must contain the
16150// information about the source of the health report and property on which it is reported.
16151// The report is sent to a Service Fabric gateway Partition, which forwards to the health store.
16152// The report may be accepted by the gateway, but rejected by the health store after extra validation.
16153// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
16154// To see whether the report was applied in the health store, run GetPartitionHealth and check that the report appears
16155// in the HealthEvents section.
16156// Parameters:
16157// partitionID - the identity of the partition.
16158// healthInformation - describes the health information for the health report. This information needs to be
16159// present in all of the health reports sent to the health manager.
16160// immediate - a flag which indicates whether the report should be sent immediately.
16161// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
16162// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
16163// regardless of the fabric client settings that the HTTP Gateway Application is using.
16164// This is useful for critical reports that should be sent as soon as possible.
16165// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
16166// is closed or the message doesn't reach the Gateway.
16167// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
16168// Therefore, it will be batched according to the HealthReportSendInterval configuration.
16169// This is the recommended setting because it allows the health client to optimize health reporting messages to
16170// health store as well as health report processing.
16171// By default, reports are not sent immediately.
16172// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16173// duration that the client is willing to wait for the requested operation to complete. The default value for
16174// this parameter is 60 seconds.
16175func (client BaseClient) ReportPartitionHealth(ctx context.Context, partitionID uuid.UUID, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
16176	if tracing.IsEnabled() {
16177		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportPartitionHealth")
16178		defer func() {
16179			sc := -1
16180			if result.Response != nil {
16181				sc = result.Response.StatusCode
16182			}
16183			tracing.EndSpan(ctx, sc, err)
16184		}()
16185	}
16186	if err := validation.Validate([]validation.Validation{
16187		{TargetValue: healthInformation,
16188			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
16189				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
16190		{TargetValue: timeout,
16191			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16192				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16193					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16194				}}}}}); err != nil {
16195		return result, validation.NewError("servicefabric.BaseClient", "ReportPartitionHealth", err.Error())
16196	}
16197
16198	req, err := client.ReportPartitionHealthPreparer(ctx, partitionID, healthInformation, immediate, timeout)
16199	if err != nil {
16200		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", nil, "Failure preparing request")
16201		return
16202	}
16203
16204	resp, err := client.ReportPartitionHealthSender(req)
16205	if err != nil {
16206		result.Response = resp
16207		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", resp, "Failure sending request")
16208		return
16209	}
16210
16211	result, err = client.ReportPartitionHealthResponder(resp)
16212	if err != nil {
16213		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", resp, "Failure responding to request")
16214	}
16215
16216	return
16217}
16218
16219// ReportPartitionHealthPreparer prepares the ReportPartitionHealth request.
16220func (client BaseClient) ReportPartitionHealthPreparer(ctx context.Context, partitionID uuid.UUID, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
16221	pathParameters := map[string]interface{}{
16222		"partitionId": partitionID,
16223	}
16224
16225	const APIVersion = "6.0"
16226	queryParameters := map[string]interface{}{
16227		"api-version": APIVersion,
16228	}
16229	if immediate != nil {
16230		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
16231	} else {
16232		queryParameters["Immediate"] = autorest.Encode("query", false)
16233	}
16234	if timeout != nil {
16235		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16236	} else {
16237		queryParameters["timeout"] = autorest.Encode("query", 60)
16238	}
16239
16240	preparer := autorest.CreatePreparer(
16241		autorest.AsContentType("application/json; charset=utf-8"),
16242		autorest.AsPost(),
16243		autorest.WithBaseURL(client.BaseURI),
16244		autorest.WithPathParameters("/Partitions/{partitionId}/$/ReportHealth", pathParameters),
16245		autorest.WithJSON(healthInformation),
16246		autorest.WithQueryParameters(queryParameters))
16247	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16248}
16249
16250// ReportPartitionHealthSender sends the ReportPartitionHealth request. The method will close the
16251// http.Response Body if it receives an error.
16252func (client BaseClient) ReportPartitionHealthSender(req *http.Request) (*http.Response, error) {
16253	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16254}
16255
16256// ReportPartitionHealthResponder handles the response to the ReportPartitionHealth request. The method always
16257// closes the http.Response Body.
16258func (client BaseClient) ReportPartitionHealthResponder(resp *http.Response) (result autorest.Response, err error) {
16259	err = autorest.Respond(
16260		resp,
16261		client.ByInspecting(),
16262		azure.WithErrorUnlessStatusCode(http.StatusOK),
16263		autorest.ByClosing())
16264	result.Response = resp
16265	return
16266}
16267
16268// ReportReplicaHealth reports health state of the specified Service Fabric replica. The report must contain the
16269// information about the source of the health report and property on which it is reported.
16270// The report is sent to a Service Fabric gateway Replica, which forwards to the health store.
16271// The report may be accepted by the gateway, but rejected by the health store after extra validation.
16272// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
16273// To see whether the report was applied in the health store, run GetReplicaHealth and check that the report appears in
16274// the HealthEvents section.
16275// Parameters:
16276// partitionID - the identity of the partition.
16277// replicaID - the identifier of the replica.
16278// replicaHealthReportServiceKind - the kind of service replica (Stateless or Stateful) for which the health is
16279// being reported. Following are the possible values.
16280// healthInformation - describes the health information for the health report. This information needs to be
16281// present in all of the health reports sent to the health manager.
16282// immediate - a flag which indicates whether the report should be sent immediately.
16283// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
16284// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
16285// regardless of the fabric client settings that the HTTP Gateway Application is using.
16286// This is useful for critical reports that should be sent as soon as possible.
16287// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
16288// is closed or the message doesn't reach the Gateway.
16289// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
16290// Therefore, it will be batched according to the HealthReportSendInterval configuration.
16291// This is the recommended setting because it allows the health client to optimize health reporting messages to
16292// health store as well as health report processing.
16293// By default, reports are not sent immediately.
16294// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16295// duration that the client is willing to wait for the requested operation to complete. The default value for
16296// this parameter is 60 seconds.
16297func (client BaseClient) ReportReplicaHealth(ctx context.Context, partitionID uuid.UUID, replicaID string, replicaHealthReportServiceKind ReplicaHealthReportServiceKind, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
16298	if tracing.IsEnabled() {
16299		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportReplicaHealth")
16300		defer func() {
16301			sc := -1
16302			if result.Response != nil {
16303				sc = result.Response.StatusCode
16304			}
16305			tracing.EndSpan(ctx, sc, err)
16306		}()
16307	}
16308	if err := validation.Validate([]validation.Validation{
16309		{TargetValue: healthInformation,
16310			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
16311				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
16312		{TargetValue: timeout,
16313			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16314				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16315					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16316				}}}}}); err != nil {
16317		return result, validation.NewError("servicefabric.BaseClient", "ReportReplicaHealth", err.Error())
16318	}
16319
16320	req, err := client.ReportReplicaHealthPreparer(ctx, partitionID, replicaID, replicaHealthReportServiceKind, healthInformation, immediate, timeout)
16321	if err != nil {
16322		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", nil, "Failure preparing request")
16323		return
16324	}
16325
16326	resp, err := client.ReportReplicaHealthSender(req)
16327	if err != nil {
16328		result.Response = resp
16329		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", resp, "Failure sending request")
16330		return
16331	}
16332
16333	result, err = client.ReportReplicaHealthResponder(resp)
16334	if err != nil {
16335		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", resp, "Failure responding to request")
16336	}
16337
16338	return
16339}
16340
16341// ReportReplicaHealthPreparer prepares the ReportReplicaHealth request.
16342func (client BaseClient) ReportReplicaHealthPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, replicaHealthReportServiceKind ReplicaHealthReportServiceKind, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
16343	pathParameters := map[string]interface{}{
16344		"partitionId": partitionID,
16345		"replicaId":   replicaID,
16346	}
16347
16348	const APIVersion = "6.0"
16349	queryParameters := map[string]interface{}{
16350		"api-version":                    APIVersion,
16351		"ReplicaHealthReportServiceKind": autorest.Encode("query", replicaHealthReportServiceKind),
16352	}
16353	if immediate != nil {
16354		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
16355	} else {
16356		queryParameters["Immediate"] = autorest.Encode("query", false)
16357	}
16358	if timeout != nil {
16359		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16360	} else {
16361		queryParameters["timeout"] = autorest.Encode("query", 60)
16362	}
16363
16364	preparer := autorest.CreatePreparer(
16365		autorest.AsContentType("application/json; charset=utf-8"),
16366		autorest.AsPost(),
16367		autorest.WithBaseURL(client.BaseURI),
16368		autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/ReportHealth", pathParameters),
16369		autorest.WithJSON(healthInformation),
16370		autorest.WithQueryParameters(queryParameters))
16371	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16372}
16373
16374// ReportReplicaHealthSender sends the ReportReplicaHealth request. The method will close the
16375// http.Response Body if it receives an error.
16376func (client BaseClient) ReportReplicaHealthSender(req *http.Request) (*http.Response, error) {
16377	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16378}
16379
16380// ReportReplicaHealthResponder handles the response to the ReportReplicaHealth request. The method always
16381// closes the http.Response Body.
16382func (client BaseClient) ReportReplicaHealthResponder(resp *http.Response) (result autorest.Response, err error) {
16383	err = autorest.Respond(
16384		resp,
16385		client.ByInspecting(),
16386		azure.WithErrorUnlessStatusCode(http.StatusOK),
16387		autorest.ByClosing())
16388	result.Response = resp
16389	return
16390}
16391
16392// ReportServiceHealth reports health state of the specified Service Fabric service. The report must contain the
16393// information about the source of the health report and property on which it is reported.
16394// The report is sent to a Service Fabric gateway Service, which forwards to the health store.
16395// The report may be accepted by the gateway, but rejected by the health store after extra validation.
16396// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number.
16397// To see whether the report was applied in the health store, run GetServiceHealth and check that the report appears in
16398// the HealthEvents section.
16399// Parameters:
16400// serviceID - the identity of the service. This is typically the full name of the service without the
16401// 'fabric:' URI scheme.
16402// Starting from version 6.0, hierarchical names are delimited with the "~" character.
16403// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
16404// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
16405// healthInformation - describes the health information for the health report. This information needs to be
16406// present in all of the health reports sent to the health manager.
16407// immediate - a flag which indicates whether the report should be sent immediately.
16408// A health report is sent to a Service Fabric gateway Application, which forwards to the health store.
16409// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store,
16410// regardless of the fabric client settings that the HTTP Gateway Application is using.
16411// This is useful for critical reports that should be sent as soon as possible.
16412// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway
16413// is closed or the message doesn't reach the Gateway.
16414// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway.
16415// Therefore, it will be batched according to the HealthReportSendInterval configuration.
16416// This is the recommended setting because it allows the health client to optimize health reporting messages to
16417// health store as well as health report processing.
16418// By default, reports are not sent immediately.
16419// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16420// duration that the client is willing to wait for the requested operation to complete. The default value for
16421// this parameter is 60 seconds.
16422func (client BaseClient) ReportServiceHealth(ctx context.Context, serviceID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) {
16423	if tracing.IsEnabled() {
16424		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportServiceHealth")
16425		defer func() {
16426			sc := -1
16427			if result.Response != nil {
16428				sc = result.Response.StatusCode
16429			}
16430			tracing.EndSpan(ctx, sc, err)
16431		}()
16432	}
16433	if err := validation.Validate([]validation.Validation{
16434		{TargetValue: healthInformation,
16435			Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil},
16436				{Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}},
16437		{TargetValue: timeout,
16438			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16439				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16440					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16441				}}}}}); err != nil {
16442		return result, validation.NewError("servicefabric.BaseClient", "ReportServiceHealth", err.Error())
16443	}
16444
16445	req, err := client.ReportServiceHealthPreparer(ctx, serviceID, healthInformation, immediate, timeout)
16446	if err != nil {
16447		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", nil, "Failure preparing request")
16448		return
16449	}
16450
16451	resp, err := client.ReportServiceHealthSender(req)
16452	if err != nil {
16453		result.Response = resp
16454		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", resp, "Failure sending request")
16455		return
16456	}
16457
16458	result, err = client.ReportServiceHealthResponder(resp)
16459	if err != nil {
16460		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", resp, "Failure responding to request")
16461	}
16462
16463	return
16464}
16465
16466// ReportServiceHealthPreparer prepares the ReportServiceHealth request.
16467func (client BaseClient) ReportServiceHealthPreparer(ctx context.Context, serviceID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) {
16468	pathParameters := map[string]interface{}{
16469		"serviceId": serviceID,
16470	}
16471
16472	const APIVersion = "6.0"
16473	queryParameters := map[string]interface{}{
16474		"api-version": APIVersion,
16475	}
16476	if immediate != nil {
16477		queryParameters["Immediate"] = autorest.Encode("query", *immediate)
16478	} else {
16479		queryParameters["Immediate"] = autorest.Encode("query", false)
16480	}
16481	if timeout != nil {
16482		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16483	} else {
16484		queryParameters["timeout"] = autorest.Encode("query", 60)
16485	}
16486
16487	preparer := autorest.CreatePreparer(
16488		autorest.AsContentType("application/json; charset=utf-8"),
16489		autorest.AsPost(),
16490		autorest.WithBaseURL(client.BaseURI),
16491		autorest.WithPathParameters("/Services/{serviceId}/$/ReportHealth", pathParameters),
16492		autorest.WithJSON(healthInformation),
16493		autorest.WithQueryParameters(queryParameters))
16494	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16495}
16496
16497// ReportServiceHealthSender sends the ReportServiceHealth request. The method will close the
16498// http.Response Body if it receives an error.
16499func (client BaseClient) ReportServiceHealthSender(req *http.Request) (*http.Response, error) {
16500	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16501}
16502
16503// ReportServiceHealthResponder handles the response to the ReportServiceHealth request. The method always
16504// closes the http.Response Body.
16505func (client BaseClient) ReportServiceHealthResponder(resp *http.Response) (result autorest.Response, err error) {
16506	err = autorest.Respond(
16507		resp,
16508		client.ByInspecting(),
16509		azure.WithErrorUnlessStatusCode(http.StatusOK),
16510		autorest.ByClosing())
16511	result.Response = resp
16512	return
16513}
16514
16515// ResetPartitionLoad resets the current load of a Service Fabric partition to the default load for the service.
16516// Parameters:
16517// partitionID - the identity of the partition.
16518// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16519// duration that the client is willing to wait for the requested operation to complete. The default value for
16520// this parameter is 60 seconds.
16521func (client BaseClient) ResetPartitionLoad(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
16522	if tracing.IsEnabled() {
16523		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResetPartitionLoad")
16524		defer func() {
16525			sc := -1
16526			if result.Response != nil {
16527				sc = result.Response.StatusCode
16528			}
16529			tracing.EndSpan(ctx, sc, err)
16530		}()
16531	}
16532	if err := validation.Validate([]validation.Validation{
16533		{TargetValue: timeout,
16534			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16535				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16536					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16537				}}}}}); err != nil {
16538		return result, validation.NewError("servicefabric.BaseClient", "ResetPartitionLoad", err.Error())
16539	}
16540
16541	req, err := client.ResetPartitionLoadPreparer(ctx, partitionID, timeout)
16542	if err != nil {
16543		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", nil, "Failure preparing request")
16544		return
16545	}
16546
16547	resp, err := client.ResetPartitionLoadSender(req)
16548	if err != nil {
16549		result.Response = resp
16550		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", resp, "Failure sending request")
16551		return
16552	}
16553
16554	result, err = client.ResetPartitionLoadResponder(resp)
16555	if err != nil {
16556		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", resp, "Failure responding to request")
16557	}
16558
16559	return
16560}
16561
16562// ResetPartitionLoadPreparer prepares the ResetPartitionLoad request.
16563func (client BaseClient) ResetPartitionLoadPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
16564	pathParameters := map[string]interface{}{
16565		"partitionId": partitionID,
16566	}
16567
16568	const APIVersion = "6.0"
16569	queryParameters := map[string]interface{}{
16570		"api-version": APIVersion,
16571	}
16572	if timeout != nil {
16573		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16574	} else {
16575		queryParameters["timeout"] = autorest.Encode("query", 60)
16576	}
16577
16578	preparer := autorest.CreatePreparer(
16579		autorest.AsPost(),
16580		autorest.WithBaseURL(client.BaseURI),
16581		autorest.WithPathParameters("/Partitions/{partitionId}/$/ResetLoad", pathParameters),
16582		autorest.WithQueryParameters(queryParameters))
16583	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16584}
16585
16586// ResetPartitionLoadSender sends the ResetPartitionLoad request. The method will close the
16587// http.Response Body if it receives an error.
16588func (client BaseClient) ResetPartitionLoadSender(req *http.Request) (*http.Response, error) {
16589	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16590}
16591
16592// ResetPartitionLoadResponder handles the response to the ResetPartitionLoad request. The method always
16593// closes the http.Response Body.
16594func (client BaseClient) ResetPartitionLoadResponder(resp *http.Response) (result autorest.Response, err error) {
16595	err = autorest.Respond(
16596		resp,
16597		client.ByInspecting(),
16598		azure.WithErrorUnlessStatusCode(http.StatusOK),
16599		autorest.ByClosing())
16600	result.Response = resp
16601	return
16602}
16603
16604// ResolveService resolve a Service Fabric service partition to get the endpoints of the service replicas.
16605// Parameters:
16606// serviceID - the identity of the service. This is typically the full name of the service without the
16607// 'fabric:' URI scheme.
16608// Starting from version 6.0, hierarchical names are delimited with the "~" character.
16609// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
16610// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
16611// partitionKeyType - key type for the partition. This parameter is required if the partition scheme for the
16612// service is Int64Range or Named. The possible values are following.
16613// - None (1) - Indicates that the PartitionKeyValue parameter is not specified. This is valid for the
16614// partitions with partitioning scheme as Singleton. This is the default value. The value is 1.
16615// - Int64Range (2) - Indicates that the PartitionKeyValue parameter is an int64 partition key. This is valid
16616// for the partitions with partitioning scheme as Int64Range. The value is 2.
16617// - Named (3) - Indicates that the PartitionKeyValue parameter is a name of the partition. This is valid for
16618// the partitions with partitioning scheme as Named. The value is 3.
16619// partitionKeyValue - partition key. This is required if the partition scheme for the service is Int64Range or
16620// Named.
16621// previousRspVersion - the value in the Version field of the response that was received previously. This is
16622// required if the user knows that the result that was got previously is stale.
16623// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16624// duration that the client is willing to wait for the requested operation to complete. The default value for
16625// this parameter is 60 seconds.
16626func (client BaseClient) ResolveService(ctx context.Context, serviceID string, partitionKeyType *int32, partitionKeyValue string, previousRspVersion string, timeout *int64) (result ResolvedServicePartition, err error) {
16627	if tracing.IsEnabled() {
16628		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResolveService")
16629		defer func() {
16630			sc := -1
16631			if result.Response.Response != nil {
16632				sc = result.Response.Response.StatusCode
16633			}
16634			tracing.EndSpan(ctx, sc, err)
16635		}()
16636	}
16637	if err := validation.Validate([]validation.Validation{
16638		{TargetValue: timeout,
16639			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16640				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16641					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16642				}}}}}); err != nil {
16643		return result, validation.NewError("servicefabric.BaseClient", "ResolveService", err.Error())
16644	}
16645
16646	req, err := client.ResolveServicePreparer(ctx, serviceID, partitionKeyType, partitionKeyValue, previousRspVersion, timeout)
16647	if err != nil {
16648		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", nil, "Failure preparing request")
16649		return
16650	}
16651
16652	resp, err := client.ResolveServiceSender(req)
16653	if err != nil {
16654		result.Response = autorest.Response{Response: resp}
16655		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", resp, "Failure sending request")
16656		return
16657	}
16658
16659	result, err = client.ResolveServiceResponder(resp)
16660	if err != nil {
16661		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", resp, "Failure responding to request")
16662	}
16663
16664	return
16665}
16666
16667// ResolveServicePreparer prepares the ResolveService request.
16668func (client BaseClient) ResolveServicePreparer(ctx context.Context, serviceID string, partitionKeyType *int32, partitionKeyValue string, previousRspVersion string, timeout *int64) (*http.Request, error) {
16669	pathParameters := map[string]interface{}{
16670		"serviceId": serviceID,
16671	}
16672
16673	const APIVersion = "6.0"
16674	queryParameters := map[string]interface{}{
16675		"api-version": APIVersion,
16676	}
16677	if partitionKeyType != nil {
16678		queryParameters["PartitionKeyType"] = autorest.Encode("query", *partitionKeyType)
16679	}
16680	if len(partitionKeyValue) > 0 {
16681		queryParameters["PartitionKeyValue"] = partitionKeyValue
16682	}
16683	if len(previousRspVersion) > 0 {
16684		queryParameters["PreviousRspVersion"] = previousRspVersion
16685	}
16686	if timeout != nil {
16687		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16688	} else {
16689		queryParameters["timeout"] = autorest.Encode("query", 60)
16690	}
16691
16692	preparer := autorest.CreatePreparer(
16693		autorest.AsGet(),
16694		autorest.WithBaseURL(client.BaseURI),
16695		autorest.WithPathParameters("/Services/{serviceId}/$/ResolvePartition", pathParameters),
16696		autorest.WithQueryParameters(queryParameters))
16697	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16698}
16699
16700// ResolveServiceSender sends the ResolveService request. The method will close the
16701// http.Response Body if it receives an error.
16702func (client BaseClient) ResolveServiceSender(req *http.Request) (*http.Response, error) {
16703	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16704}
16705
16706// ResolveServiceResponder handles the response to the ResolveService request. The method always
16707// closes the http.Response Body.
16708func (client BaseClient) ResolveServiceResponder(resp *http.Response) (result ResolvedServicePartition, err error) {
16709	err = autorest.Respond(
16710		resp,
16711		client.ByInspecting(),
16712		azure.WithErrorUnlessStatusCode(http.StatusOK),
16713		autorest.ByUnmarshallingJSON(&result),
16714		autorest.ByClosing())
16715	result.Response = autorest.Response{Response: resp}
16716	return
16717}
16718
16719// RestartDeployedCodePackage restarts a code package deployed on a Service Fabric node in a cluster. This aborts the
16720// code package process, which will restart all the user service replicas hosted in that process.
16721// Parameters:
16722// nodeName - the name of the node.
16723// applicationID - the identity of the application. This is typically the full name of the application without
16724// the 'fabric:' URI scheme.
16725// Starting from version 6.0, hierarchical names are delimited with the "~" character.
16726// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
16727// in 6.0+ and "myapp/app1" in previous versions.
16728// restartDeployedCodePackageDescription - describes the deployed code package on Service Fabric node to
16729// restart.
16730// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16731// duration that the client is willing to wait for the requested operation to complete. The default value for
16732// this parameter is 60 seconds.
16733func (client BaseClient) RestartDeployedCodePackage(ctx context.Context, nodeName string, applicationID string, restartDeployedCodePackageDescription RestartDeployedCodePackageDescription, timeout *int64) (result autorest.Response, err error) {
16734	if tracing.IsEnabled() {
16735		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartDeployedCodePackage")
16736		defer func() {
16737			sc := -1
16738			if result.Response != nil {
16739				sc = result.Response.StatusCode
16740			}
16741			tracing.EndSpan(ctx, sc, err)
16742		}()
16743	}
16744	if err := validation.Validate([]validation.Validation{
16745		{TargetValue: restartDeployedCodePackageDescription,
16746			Constraints: []validation.Constraint{{Target: "restartDeployedCodePackageDescription.ServiceManifestName", Name: validation.Null, Rule: true, Chain: nil},
16747				{Target: "restartDeployedCodePackageDescription.CodePackageName", Name: validation.Null, Rule: true, Chain: nil},
16748				{Target: "restartDeployedCodePackageDescription.CodePackageInstanceID", Name: validation.Null, Rule: true, Chain: nil}}},
16749		{TargetValue: timeout,
16750			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16751				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16752					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16753				}}}}}); err != nil {
16754		return result, validation.NewError("servicefabric.BaseClient", "RestartDeployedCodePackage", err.Error())
16755	}
16756
16757	req, err := client.RestartDeployedCodePackagePreparer(ctx, nodeName, applicationID, restartDeployedCodePackageDescription, timeout)
16758	if err != nil {
16759		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", nil, "Failure preparing request")
16760		return
16761	}
16762
16763	resp, err := client.RestartDeployedCodePackageSender(req)
16764	if err != nil {
16765		result.Response = resp
16766		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", resp, "Failure sending request")
16767		return
16768	}
16769
16770	result, err = client.RestartDeployedCodePackageResponder(resp)
16771	if err != nil {
16772		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", resp, "Failure responding to request")
16773	}
16774
16775	return
16776}
16777
16778// RestartDeployedCodePackagePreparer prepares the RestartDeployedCodePackage request.
16779func (client BaseClient) RestartDeployedCodePackagePreparer(ctx context.Context, nodeName string, applicationID string, restartDeployedCodePackageDescription RestartDeployedCodePackageDescription, timeout *int64) (*http.Request, error) {
16780	pathParameters := map[string]interface{}{
16781		"applicationId": applicationID,
16782		"nodeName":      autorest.Encode("path", nodeName),
16783	}
16784
16785	const APIVersion = "6.0"
16786	queryParameters := map[string]interface{}{
16787		"api-version": APIVersion,
16788	}
16789	if timeout != nil {
16790		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16791	} else {
16792		queryParameters["timeout"] = autorest.Encode("query", 60)
16793	}
16794
16795	preparer := autorest.CreatePreparer(
16796		autorest.AsContentType("application/json; charset=utf-8"),
16797		autorest.AsPost(),
16798		autorest.WithBaseURL(client.BaseURI),
16799		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/Restart", pathParameters),
16800		autorest.WithJSON(restartDeployedCodePackageDescription),
16801		autorest.WithQueryParameters(queryParameters))
16802	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16803}
16804
16805// RestartDeployedCodePackageSender sends the RestartDeployedCodePackage request. The method will close the
16806// http.Response Body if it receives an error.
16807func (client BaseClient) RestartDeployedCodePackageSender(req *http.Request) (*http.Response, error) {
16808	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16809}
16810
16811// RestartDeployedCodePackageResponder handles the response to the RestartDeployedCodePackage request. The method always
16812// closes the http.Response Body.
16813func (client BaseClient) RestartDeployedCodePackageResponder(resp *http.Response) (result autorest.Response, err error) {
16814	err = autorest.Respond(
16815		resp,
16816		client.ByInspecting(),
16817		azure.WithErrorUnlessStatusCode(http.StatusOK),
16818		autorest.ByClosing())
16819	result.Response = resp
16820	return
16821}
16822
16823// RestartNode restarts a Service Fabric cluster node that is already started.
16824// Parameters:
16825// nodeName - the name of the node.
16826// restartNodeDescription - the instance of the node to be restarted and a flag indicating the need to take
16827// dump of the fabric process.
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) RestartNode(ctx context.Context, nodeName string, restartNodeDescription RestartNodeDescription, timeout *int64) (result autorest.Response, err error) {
16832	if tracing.IsEnabled() {
16833		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartNode")
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: restartNodeDescription,
16844			Constraints: []validation.Constraint{{Target: "restartNodeDescription.NodeInstanceID", Name: validation.Null, Rule: true, Chain: nil}}},
16845		{TargetValue: timeout,
16846			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16847				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16848					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16849				}}}}}); err != nil {
16850		return result, validation.NewError("servicefabric.BaseClient", "RestartNode", err.Error())
16851	}
16852
16853	req, err := client.RestartNodePreparer(ctx, nodeName, restartNodeDescription, timeout)
16854	if err != nil {
16855		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", nil, "Failure preparing request")
16856		return
16857	}
16858
16859	resp, err := client.RestartNodeSender(req)
16860	if err != nil {
16861		result.Response = resp
16862		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", resp, "Failure sending request")
16863		return
16864	}
16865
16866	result, err = client.RestartNodeResponder(resp)
16867	if err != nil {
16868		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", resp, "Failure responding to request")
16869	}
16870
16871	return
16872}
16873
16874// RestartNodePreparer prepares the RestartNode request.
16875func (client BaseClient) RestartNodePreparer(ctx context.Context, nodeName string, restartNodeDescription RestartNodeDescription, timeout *int64) (*http.Request, error) {
16876	pathParameters := map[string]interface{}{
16877		"nodeName": autorest.Encode("path", nodeName),
16878	}
16879
16880	const APIVersion = "6.0"
16881	queryParameters := map[string]interface{}{
16882		"api-version": APIVersion,
16883	}
16884	if timeout != nil {
16885		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16886	} else {
16887		queryParameters["timeout"] = autorest.Encode("query", 60)
16888	}
16889
16890	preparer := autorest.CreatePreparer(
16891		autorest.AsContentType("application/json; charset=utf-8"),
16892		autorest.AsPost(),
16893		autorest.WithBaseURL(client.BaseURI),
16894		autorest.WithPathParameters("/Nodes/{nodeName}/$/Restart", pathParameters),
16895		autorest.WithJSON(restartNodeDescription),
16896		autorest.WithQueryParameters(queryParameters))
16897	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16898}
16899
16900// RestartNodeSender sends the RestartNode request. The method will close the
16901// http.Response Body if it receives an error.
16902func (client BaseClient) RestartNodeSender(req *http.Request) (*http.Response, error) {
16903	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16904}
16905
16906// RestartNodeResponder handles the response to the RestartNode request. The method always
16907// closes the http.Response Body.
16908func (client BaseClient) RestartNodeResponder(resp *http.Response) (result autorest.Response, err error) {
16909	err = autorest.Respond(
16910		resp,
16911		client.ByInspecting(),
16912		azure.WithErrorUnlessStatusCode(http.StatusOK),
16913		autorest.ByClosing())
16914	result.Response = resp
16915	return
16916}
16917
16918// RestartReplica restarts a service replica of a persisted service running on a node. Warning - There are no safety
16919// checks performed when this API is used. Incorrect use of this API can lead to availability loss for stateful
16920// services.
16921// Parameters:
16922// nodeName - the name of the node.
16923// partitionID - the identity of the partition.
16924// replicaID - the identifier of the replica.
16925// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
16926// duration that the client is willing to wait for the requested operation to complete. The default value for
16927// this parameter is 60 seconds.
16928func (client BaseClient) RestartReplica(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (result autorest.Response, err error) {
16929	if tracing.IsEnabled() {
16930		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartReplica")
16931		defer func() {
16932			sc := -1
16933			if result.Response != nil {
16934				sc = result.Response.StatusCode
16935			}
16936			tracing.EndSpan(ctx, sc, err)
16937		}()
16938	}
16939	if err := validation.Validate([]validation.Validation{
16940		{TargetValue: timeout,
16941			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
16942				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
16943					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
16944				}}}}}); err != nil {
16945		return result, validation.NewError("servicefabric.BaseClient", "RestartReplica", err.Error())
16946	}
16947
16948	req, err := client.RestartReplicaPreparer(ctx, nodeName, partitionID, replicaID, timeout)
16949	if err != nil {
16950		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", nil, "Failure preparing request")
16951		return
16952	}
16953
16954	resp, err := client.RestartReplicaSender(req)
16955	if err != nil {
16956		result.Response = resp
16957		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", resp, "Failure sending request")
16958		return
16959	}
16960
16961	result, err = client.RestartReplicaResponder(resp)
16962	if err != nil {
16963		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", resp, "Failure responding to request")
16964	}
16965
16966	return
16967}
16968
16969// RestartReplicaPreparer prepares the RestartReplica request.
16970func (client BaseClient) RestartReplicaPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) {
16971	pathParameters := map[string]interface{}{
16972		"nodeName":    autorest.Encode("path", nodeName),
16973		"partitionId": partitionID,
16974		"replicaId":   replicaID,
16975	}
16976
16977	const APIVersion = "6.0"
16978	queryParameters := map[string]interface{}{
16979		"api-version": APIVersion,
16980	}
16981	if timeout != nil {
16982		queryParameters["timeout"] = autorest.Encode("query", *timeout)
16983	} else {
16984		queryParameters["timeout"] = autorest.Encode("query", 60)
16985	}
16986
16987	preparer := autorest.CreatePreparer(
16988		autorest.AsPost(),
16989		autorest.WithBaseURL(client.BaseURI),
16990		autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Restart", pathParameters),
16991		autorest.WithQueryParameters(queryParameters))
16992	return preparer.Prepare((&http.Request{}).WithContext(ctx))
16993}
16994
16995// RestartReplicaSender sends the RestartReplica request. The method will close the
16996// http.Response Body if it receives an error.
16997func (client BaseClient) RestartReplicaSender(req *http.Request) (*http.Response, error) {
16998	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16999}
17000
17001// RestartReplicaResponder handles the response to the RestartReplica request. The method always
17002// closes the http.Response Body.
17003func (client BaseClient) RestartReplicaResponder(resp *http.Response) (result autorest.Response, err error) {
17004	err = autorest.Respond(
17005		resp,
17006		client.ByInspecting(),
17007		azure.WithErrorUnlessStatusCode(http.StatusOK),
17008		autorest.ByClosing())
17009	result.Response = resp
17010	return
17011}
17012
17013// RestorePartition restores the state of a of the stateful persisted partition using the specified backup point. In
17014// case the partition is already being periodically backed up, then by default the backup point is looked for in the
17015// storage specified in backup policy. One can also override the same by specifying the backup storage details as part
17016// of the restore partition description in body. Once the restore is initiated, its progress can be tracked using the
17017// GetRestoreProgress operation.
17018// In case, the operation times out, specify a greater restore timeout value in the query parameter.
17019// Parameters:
17020// partitionID - the identity of the partition.
17021// restorePartitionDescription - describes the parameters to restore the partition.
17022// restoreTimeout - specifies the maximum amount of time to wait, in minutes, for the restore operation to
17023// complete. Post that, the operation returns back with timeout error. However, in certain corner cases it
17024// could be that the restore operation goes through even though it completes with timeout. In case of timeout
17025// error, its recommended to invoke this operation again with a greater timeout value. the default value for
17026// the same is 10 minutes.
17027// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17028// duration that the client is willing to wait for the requested operation to complete. The default value for
17029// this parameter is 60 seconds.
17030func (client BaseClient) RestorePartition(ctx context.Context, partitionID uuid.UUID, restorePartitionDescription RestorePartitionDescription, restoreTimeout *int32, timeout *int64) (result autorest.Response, err error) {
17031	if tracing.IsEnabled() {
17032		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestorePartition")
17033		defer func() {
17034			sc := -1
17035			if result.Response != nil {
17036				sc = result.Response.StatusCode
17037			}
17038			tracing.EndSpan(ctx, sc, err)
17039		}()
17040	}
17041	if err := validation.Validate([]validation.Validation{
17042		{TargetValue: restorePartitionDescription,
17043			Constraints: []validation.Constraint{{Target: "restorePartitionDescription.BackupID", Name: validation.Null, Rule: true, Chain: nil},
17044				{Target: "restorePartitionDescription.BackupLocation", Name: validation.Null, Rule: true, Chain: nil}}},
17045		{TargetValue: timeout,
17046			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17047				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17048					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17049				}}}}}); err != nil {
17050		return result, validation.NewError("servicefabric.BaseClient", "RestorePartition", err.Error())
17051	}
17052
17053	req, err := client.RestorePartitionPreparer(ctx, partitionID, restorePartitionDescription, restoreTimeout, timeout)
17054	if err != nil {
17055		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", nil, "Failure preparing request")
17056		return
17057	}
17058
17059	resp, err := client.RestorePartitionSender(req)
17060	if err != nil {
17061		result.Response = resp
17062		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", resp, "Failure sending request")
17063		return
17064	}
17065
17066	result, err = client.RestorePartitionResponder(resp)
17067	if err != nil {
17068		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", resp, "Failure responding to request")
17069	}
17070
17071	return
17072}
17073
17074// RestorePartitionPreparer prepares the RestorePartition request.
17075func (client BaseClient) RestorePartitionPreparer(ctx context.Context, partitionID uuid.UUID, restorePartitionDescription RestorePartitionDescription, restoreTimeout *int32, timeout *int64) (*http.Request, error) {
17076	pathParameters := map[string]interface{}{
17077		"partitionId": partitionID,
17078	}
17079
17080	const APIVersion = "6.2-preview"
17081	queryParameters := map[string]interface{}{
17082		"api-version": APIVersion,
17083	}
17084	if restoreTimeout != nil {
17085		queryParameters["RestoreTimeout"] = autorest.Encode("query", *restoreTimeout)
17086	} else {
17087		queryParameters["RestoreTimeout"] = autorest.Encode("query", 10)
17088	}
17089	if timeout != nil {
17090		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17091	} else {
17092		queryParameters["timeout"] = autorest.Encode("query", 60)
17093	}
17094
17095	preparer := autorest.CreatePreparer(
17096		autorest.AsContentType("application/json; charset=utf-8"),
17097		autorest.AsPost(),
17098		autorest.WithBaseURL(client.BaseURI),
17099		autorest.WithPathParameters("/Partitions/{partitionId}/$/Restore", pathParameters),
17100		autorest.WithJSON(restorePartitionDescription),
17101		autorest.WithQueryParameters(queryParameters))
17102	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17103}
17104
17105// RestorePartitionSender sends the RestorePartition request. The method will close the
17106// http.Response Body if it receives an error.
17107func (client BaseClient) RestorePartitionSender(req *http.Request) (*http.Response, error) {
17108	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17109}
17110
17111// RestorePartitionResponder handles the response to the RestorePartition request. The method always
17112// closes the http.Response Body.
17113func (client BaseClient) RestorePartitionResponder(resp *http.Response) (result autorest.Response, err error) {
17114	err = autorest.Respond(
17115		resp,
17116		client.ByInspecting(),
17117		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
17118		autorest.ByClosing())
17119	result.Response = resp
17120	return
17121}
17122
17123// ResumeApplicationBackup the previously suspended Service Fabric application resumes taking periodic backup as per
17124// the backup policy currently configured for the same.
17125// Parameters:
17126// applicationID - the identity of the application. This is typically the full name of the application without
17127// the 'fabric:' URI scheme.
17128// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17129// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
17130// in 6.0+ and "myapp/app1" in previous versions.
17131// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17132// duration that the client is willing to wait for the requested operation to complete. The default value for
17133// this parameter is 60 seconds.
17134func (client BaseClient) ResumeApplicationBackup(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) {
17135	if tracing.IsEnabled() {
17136		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeApplicationBackup")
17137		defer func() {
17138			sc := -1
17139			if result.Response != nil {
17140				sc = result.Response.StatusCode
17141			}
17142			tracing.EndSpan(ctx, sc, err)
17143		}()
17144	}
17145	if err := validation.Validate([]validation.Validation{
17146		{TargetValue: timeout,
17147			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17148				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17149					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17150				}}}}}); err != nil {
17151		return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationBackup", err.Error())
17152	}
17153
17154	req, err := client.ResumeApplicationBackupPreparer(ctx, applicationID, timeout)
17155	if err != nil {
17156		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", nil, "Failure preparing request")
17157		return
17158	}
17159
17160	resp, err := client.ResumeApplicationBackupSender(req)
17161	if err != nil {
17162		result.Response = resp
17163		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", resp, "Failure sending request")
17164		return
17165	}
17166
17167	result, err = client.ResumeApplicationBackupResponder(resp)
17168	if err != nil {
17169		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", resp, "Failure responding to request")
17170	}
17171
17172	return
17173}
17174
17175// ResumeApplicationBackupPreparer prepares the ResumeApplicationBackup request.
17176func (client BaseClient) ResumeApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
17177	pathParameters := map[string]interface{}{
17178		"applicationId": applicationID,
17179	}
17180
17181	const APIVersion = "6.2-preview"
17182	queryParameters := map[string]interface{}{
17183		"api-version": APIVersion,
17184	}
17185	if timeout != nil {
17186		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17187	} else {
17188		queryParameters["timeout"] = autorest.Encode("query", 60)
17189	}
17190
17191	preparer := autorest.CreatePreparer(
17192		autorest.AsPost(),
17193		autorest.WithBaseURL(client.BaseURI),
17194		autorest.WithPathParameters("/Applications/{applicationId}/$/ResumeBackup", pathParameters),
17195		autorest.WithQueryParameters(queryParameters))
17196	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17197}
17198
17199// ResumeApplicationBackupSender sends the ResumeApplicationBackup request. The method will close the
17200// http.Response Body if it receives an error.
17201func (client BaseClient) ResumeApplicationBackupSender(req *http.Request) (*http.Response, error) {
17202	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17203}
17204
17205// ResumeApplicationBackupResponder handles the response to the ResumeApplicationBackup request. The method always
17206// closes the http.Response Body.
17207func (client BaseClient) ResumeApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) {
17208	err = autorest.Respond(
17209		resp,
17210		client.ByInspecting(),
17211		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
17212		autorest.ByClosing())
17213	result.Response = resp
17214	return
17215}
17216
17217// ResumeApplicationUpgrade resumes an unmonitored manual Service Fabric application upgrade. Service Fabric upgrades
17218// one upgrade domain at a time. For unmonitored manual upgrades, after Service Fabric finishes an upgrade domain, it
17219// waits for you to call this API before proceeding to the next upgrade domain.
17220// Parameters:
17221// applicationID - the identity of the application. This is typically the full name of the application without
17222// the 'fabric:' URI scheme.
17223// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17224// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
17225// in 6.0+ and "myapp/app1" in previous versions.
17226// resumeApplicationUpgradeDescription - describes the parameters for resuming an application upgrade.
17227// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17228// duration that the client is willing to wait for the requested operation to complete. The default value for
17229// this parameter is 60 seconds.
17230func (client BaseClient) ResumeApplicationUpgrade(ctx context.Context, applicationID string, resumeApplicationUpgradeDescription ResumeApplicationUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
17231	if tracing.IsEnabled() {
17232		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeApplicationUpgrade")
17233		defer func() {
17234			sc := -1
17235			if result.Response != nil {
17236				sc = result.Response.StatusCode
17237			}
17238			tracing.EndSpan(ctx, sc, err)
17239		}()
17240	}
17241	if err := validation.Validate([]validation.Validation{
17242		{TargetValue: resumeApplicationUpgradeDescription,
17243			Constraints: []validation.Constraint{{Target: "resumeApplicationUpgradeDescription.UpgradeDomainName", Name: validation.Null, Rule: true, Chain: nil}}},
17244		{TargetValue: timeout,
17245			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17246				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17247					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17248				}}}}}); err != nil {
17249		return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationUpgrade", err.Error())
17250	}
17251
17252	req, err := client.ResumeApplicationUpgradePreparer(ctx, applicationID, resumeApplicationUpgradeDescription, timeout)
17253	if err != nil {
17254		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", nil, "Failure preparing request")
17255		return
17256	}
17257
17258	resp, err := client.ResumeApplicationUpgradeSender(req)
17259	if err != nil {
17260		result.Response = resp
17261		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", resp, "Failure sending request")
17262		return
17263	}
17264
17265	result, err = client.ResumeApplicationUpgradeResponder(resp)
17266	if err != nil {
17267		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", resp, "Failure responding to request")
17268	}
17269
17270	return
17271}
17272
17273// ResumeApplicationUpgradePreparer prepares the ResumeApplicationUpgrade request.
17274func (client BaseClient) ResumeApplicationUpgradePreparer(ctx context.Context, applicationID string, resumeApplicationUpgradeDescription ResumeApplicationUpgradeDescription, timeout *int64) (*http.Request, error) {
17275	pathParameters := map[string]interface{}{
17276		"applicationId": applicationID,
17277	}
17278
17279	const APIVersion = "6.0"
17280	queryParameters := map[string]interface{}{
17281		"api-version": APIVersion,
17282	}
17283	if timeout != nil {
17284		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17285	} else {
17286		queryParameters["timeout"] = autorest.Encode("query", 60)
17287	}
17288
17289	preparer := autorest.CreatePreparer(
17290		autorest.AsContentType("application/json; charset=utf-8"),
17291		autorest.AsPost(),
17292		autorest.WithBaseURL(client.BaseURI),
17293		autorest.WithPathParameters("/Applications/{applicationId}/$/MoveToNextUpgradeDomain", pathParameters),
17294		autorest.WithJSON(resumeApplicationUpgradeDescription),
17295		autorest.WithQueryParameters(queryParameters))
17296	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17297}
17298
17299// ResumeApplicationUpgradeSender sends the ResumeApplicationUpgrade request. The method will close the
17300// http.Response Body if it receives an error.
17301func (client BaseClient) ResumeApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
17302	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17303}
17304
17305// ResumeApplicationUpgradeResponder handles the response to the ResumeApplicationUpgrade request. The method always
17306// closes the http.Response Body.
17307func (client BaseClient) ResumeApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
17308	err = autorest.Respond(
17309		resp,
17310		client.ByInspecting(),
17311		azure.WithErrorUnlessStatusCode(http.StatusOK),
17312		autorest.ByClosing())
17313	result.Response = resp
17314	return
17315}
17316
17317// ResumeClusterUpgrade make the cluster code or configuration upgrade move on to the next upgrade domain if
17318// appropriate.
17319// Parameters:
17320// resumeClusterUpgradeDescription - describes the parameters for resuming a cluster upgrade.
17321// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17322// duration that the client is willing to wait for the requested operation to complete. The default value for
17323// this parameter is 60 seconds.
17324func (client BaseClient) ResumeClusterUpgrade(ctx context.Context, resumeClusterUpgradeDescription ResumeClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
17325	if tracing.IsEnabled() {
17326		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeClusterUpgrade")
17327		defer func() {
17328			sc := -1
17329			if result.Response != nil {
17330				sc = result.Response.StatusCode
17331			}
17332			tracing.EndSpan(ctx, sc, err)
17333		}()
17334	}
17335	if err := validation.Validate([]validation.Validation{
17336		{TargetValue: resumeClusterUpgradeDescription,
17337			Constraints: []validation.Constraint{{Target: "resumeClusterUpgradeDescription.UpgradeDomain", Name: validation.Null, Rule: true, Chain: nil}}},
17338		{TargetValue: timeout,
17339			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17340				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17341					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17342				}}}}}); err != nil {
17343		return result, validation.NewError("servicefabric.BaseClient", "ResumeClusterUpgrade", err.Error())
17344	}
17345
17346	req, err := client.ResumeClusterUpgradePreparer(ctx, resumeClusterUpgradeDescription, timeout)
17347	if err != nil {
17348		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", nil, "Failure preparing request")
17349		return
17350	}
17351
17352	resp, err := client.ResumeClusterUpgradeSender(req)
17353	if err != nil {
17354		result.Response = resp
17355		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", resp, "Failure sending request")
17356		return
17357	}
17358
17359	result, err = client.ResumeClusterUpgradeResponder(resp)
17360	if err != nil {
17361		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", resp, "Failure responding to request")
17362	}
17363
17364	return
17365}
17366
17367// ResumeClusterUpgradePreparer prepares the ResumeClusterUpgrade request.
17368func (client BaseClient) ResumeClusterUpgradePreparer(ctx context.Context, resumeClusterUpgradeDescription ResumeClusterUpgradeDescription, timeout *int64) (*http.Request, error) {
17369	const APIVersion = "6.0"
17370	queryParameters := map[string]interface{}{
17371		"api-version": APIVersion,
17372	}
17373	if timeout != nil {
17374		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17375	} else {
17376		queryParameters["timeout"] = autorest.Encode("query", 60)
17377	}
17378
17379	preparer := autorest.CreatePreparer(
17380		autorest.AsContentType("application/json; charset=utf-8"),
17381		autorest.AsPost(),
17382		autorest.WithBaseURL(client.BaseURI),
17383		autorest.WithPath("/$/MoveToNextUpgradeDomain"),
17384		autorest.WithJSON(resumeClusterUpgradeDescription),
17385		autorest.WithQueryParameters(queryParameters))
17386	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17387}
17388
17389// ResumeClusterUpgradeSender sends the ResumeClusterUpgrade request. The method will close the
17390// http.Response Body if it receives an error.
17391func (client BaseClient) ResumeClusterUpgradeSender(req *http.Request) (*http.Response, error) {
17392	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17393}
17394
17395// ResumeClusterUpgradeResponder handles the response to the ResumeClusterUpgrade request. The method always
17396// closes the http.Response Body.
17397func (client BaseClient) ResumeClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
17398	err = autorest.Respond(
17399		resp,
17400		client.ByInspecting(),
17401		azure.WithErrorUnlessStatusCode(http.StatusOK),
17402		autorest.ByClosing())
17403	result.Response = resp
17404	return
17405}
17406
17407// ResumePartitionBackup the previously suspended partition resumes taking periodic backup as per the backup policy
17408// currently configured for the same.
17409// Parameters:
17410// partitionID - the identity of the partition.
17411// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17412// duration that the client is willing to wait for the requested operation to complete. The default value for
17413// this parameter is 60 seconds.
17414func (client BaseClient) ResumePartitionBackup(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
17415	if tracing.IsEnabled() {
17416		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumePartitionBackup")
17417		defer func() {
17418			sc := -1
17419			if result.Response != nil {
17420				sc = result.Response.StatusCode
17421			}
17422			tracing.EndSpan(ctx, sc, err)
17423		}()
17424	}
17425	if err := validation.Validate([]validation.Validation{
17426		{TargetValue: timeout,
17427			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17428				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17429					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17430				}}}}}); err != nil {
17431		return result, validation.NewError("servicefabric.BaseClient", "ResumePartitionBackup", err.Error())
17432	}
17433
17434	req, err := client.ResumePartitionBackupPreparer(ctx, partitionID, timeout)
17435	if err != nil {
17436		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", nil, "Failure preparing request")
17437		return
17438	}
17439
17440	resp, err := client.ResumePartitionBackupSender(req)
17441	if err != nil {
17442		result.Response = resp
17443		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", resp, "Failure sending request")
17444		return
17445	}
17446
17447	result, err = client.ResumePartitionBackupResponder(resp)
17448	if err != nil {
17449		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", resp, "Failure responding to request")
17450	}
17451
17452	return
17453}
17454
17455// ResumePartitionBackupPreparer prepares the ResumePartitionBackup request.
17456func (client BaseClient) ResumePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
17457	pathParameters := map[string]interface{}{
17458		"partitionId": partitionID,
17459	}
17460
17461	const APIVersion = "6.2-preview"
17462	queryParameters := map[string]interface{}{
17463		"api-version": APIVersion,
17464	}
17465	if timeout != nil {
17466		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17467	} else {
17468		queryParameters["timeout"] = autorest.Encode("query", 60)
17469	}
17470
17471	preparer := autorest.CreatePreparer(
17472		autorest.AsPost(),
17473		autorest.WithBaseURL(client.BaseURI),
17474		autorest.WithPathParameters("/Partitions/{partitionId}/$/ResumeBackup", pathParameters),
17475		autorest.WithQueryParameters(queryParameters))
17476	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17477}
17478
17479// ResumePartitionBackupSender sends the ResumePartitionBackup request. The method will close the
17480// http.Response Body if it receives an error.
17481func (client BaseClient) ResumePartitionBackupSender(req *http.Request) (*http.Response, error) {
17482	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17483}
17484
17485// ResumePartitionBackupResponder handles the response to the ResumePartitionBackup request. The method always
17486// closes the http.Response Body.
17487func (client BaseClient) ResumePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) {
17488	err = autorest.Respond(
17489		resp,
17490		client.ByInspecting(),
17491		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
17492		autorest.ByClosing())
17493	result.Response = resp
17494	return
17495}
17496
17497// ResumeServiceBackup the previously suspended Service Fabric service resumes taking periodic backup as per the backup
17498// policy currently configured for the same.
17499// Parameters:
17500// serviceID - the identity of the service. This is typically the full name of the service without the
17501// 'fabric:' URI scheme.
17502// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17503// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
17504// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
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) ResumeServiceBackup(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) {
17509	if tracing.IsEnabled() {
17510		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeServiceBackup")
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: timeout,
17521			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17522				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17523					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17524				}}}}}); err != nil {
17525		return result, validation.NewError("servicefabric.BaseClient", "ResumeServiceBackup", err.Error())
17526	}
17527
17528	req, err := client.ResumeServiceBackupPreparer(ctx, serviceID, timeout)
17529	if err != nil {
17530		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", nil, "Failure preparing request")
17531		return
17532	}
17533
17534	resp, err := client.ResumeServiceBackupSender(req)
17535	if err != nil {
17536		result.Response = resp
17537		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", resp, "Failure sending request")
17538		return
17539	}
17540
17541	result, err = client.ResumeServiceBackupResponder(resp)
17542	if err != nil {
17543		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", resp, "Failure responding to request")
17544	}
17545
17546	return
17547}
17548
17549// ResumeServiceBackupPreparer prepares the ResumeServiceBackup request.
17550func (client BaseClient) ResumeServiceBackupPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
17551	pathParameters := map[string]interface{}{
17552		"serviceId": serviceID,
17553	}
17554
17555	const APIVersion = "6.2-preview"
17556	queryParameters := map[string]interface{}{
17557		"api-version": APIVersion,
17558	}
17559	if timeout != nil {
17560		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17561	} else {
17562		queryParameters["timeout"] = autorest.Encode("query", 60)
17563	}
17564
17565	preparer := autorest.CreatePreparer(
17566		autorest.AsPost(),
17567		autorest.WithBaseURL(client.BaseURI),
17568		autorest.WithPathParameters("/Services/{serviceId}/$/ResumeBackup", pathParameters),
17569		autorest.WithQueryParameters(queryParameters))
17570	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17571}
17572
17573// ResumeServiceBackupSender sends the ResumeServiceBackup request. The method will close the
17574// http.Response Body if it receives an error.
17575func (client BaseClient) ResumeServiceBackupSender(req *http.Request) (*http.Response, error) {
17576	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17577}
17578
17579// ResumeServiceBackupResponder handles the response to the ResumeServiceBackup request. The method always
17580// closes the http.Response Body.
17581func (client BaseClient) ResumeServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) {
17582	err = autorest.Respond(
17583		resp,
17584		client.ByInspecting(),
17585		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
17586		autorest.ByClosing())
17587	result.Response = resp
17588	return
17589}
17590
17591// RollbackApplicationUpgrade starts rolling back the current application upgrade to the previous version. This API can
17592// only be used to rollback the current in-progress upgrade that is rolling forward to new version. If the application
17593// is not currently being upgraded use StartApplicationUpgrade API to upgrade it to desired version, including rolling
17594// back to a previous version.
17595// Parameters:
17596// applicationID - the identity of the application. This is typically the full name of the application without
17597// the 'fabric:' URI scheme.
17598// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17599// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
17600// in 6.0+ and "myapp/app1" in previous versions.
17601// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17602// duration that the client is willing to wait for the requested operation to complete. The default value for
17603// this parameter is 60 seconds.
17604func (client BaseClient) RollbackApplicationUpgrade(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) {
17605	if tracing.IsEnabled() {
17606		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RollbackApplicationUpgrade")
17607		defer func() {
17608			sc := -1
17609			if result.Response != nil {
17610				sc = result.Response.StatusCode
17611			}
17612			tracing.EndSpan(ctx, sc, err)
17613		}()
17614	}
17615	if err := validation.Validate([]validation.Validation{
17616		{TargetValue: timeout,
17617			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17618				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17619					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17620				}}}}}); err != nil {
17621		return result, validation.NewError("servicefabric.BaseClient", "RollbackApplicationUpgrade", err.Error())
17622	}
17623
17624	req, err := client.RollbackApplicationUpgradePreparer(ctx, applicationID, timeout)
17625	if err != nil {
17626		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", nil, "Failure preparing request")
17627		return
17628	}
17629
17630	resp, err := client.RollbackApplicationUpgradeSender(req)
17631	if err != nil {
17632		result.Response = resp
17633		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", resp, "Failure sending request")
17634		return
17635	}
17636
17637	result, err = client.RollbackApplicationUpgradeResponder(resp)
17638	if err != nil {
17639		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", resp, "Failure responding to request")
17640	}
17641
17642	return
17643}
17644
17645// RollbackApplicationUpgradePreparer prepares the RollbackApplicationUpgrade request.
17646func (client BaseClient) RollbackApplicationUpgradePreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
17647	pathParameters := map[string]interface{}{
17648		"applicationId": applicationID,
17649	}
17650
17651	const APIVersion = "6.0"
17652	queryParameters := map[string]interface{}{
17653		"api-version": APIVersion,
17654	}
17655	if timeout != nil {
17656		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17657	} else {
17658		queryParameters["timeout"] = autorest.Encode("query", 60)
17659	}
17660
17661	preparer := autorest.CreatePreparer(
17662		autorest.AsPost(),
17663		autorest.WithBaseURL(client.BaseURI),
17664		autorest.WithPathParameters("/Applications/{applicationId}/$/RollbackUpgrade", pathParameters),
17665		autorest.WithQueryParameters(queryParameters))
17666	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17667}
17668
17669// RollbackApplicationUpgradeSender sends the RollbackApplicationUpgrade request. The method will close the
17670// http.Response Body if it receives an error.
17671func (client BaseClient) RollbackApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
17672	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17673}
17674
17675// RollbackApplicationUpgradeResponder handles the response to the RollbackApplicationUpgrade request. The method always
17676// closes the http.Response Body.
17677func (client BaseClient) RollbackApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
17678	err = autorest.Respond(
17679		resp,
17680		client.ByInspecting(),
17681		azure.WithErrorUnlessStatusCode(http.StatusOK),
17682		autorest.ByClosing())
17683	result.Response = resp
17684	return
17685}
17686
17687// RollbackClusterUpgrade rollback the code or configuration upgrade of a Service Fabric cluster.
17688// Parameters:
17689// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17690// duration that the client is willing to wait for the requested operation to complete. The default value for
17691// this parameter is 60 seconds.
17692func (client BaseClient) RollbackClusterUpgrade(ctx context.Context, timeout *int64) (result autorest.Response, err error) {
17693	if tracing.IsEnabled() {
17694		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RollbackClusterUpgrade")
17695		defer func() {
17696			sc := -1
17697			if result.Response != nil {
17698				sc = result.Response.StatusCode
17699			}
17700			tracing.EndSpan(ctx, sc, err)
17701		}()
17702	}
17703	if err := validation.Validate([]validation.Validation{
17704		{TargetValue: timeout,
17705			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17706				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17707					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17708				}}}}}); err != nil {
17709		return result, validation.NewError("servicefabric.BaseClient", "RollbackClusterUpgrade", err.Error())
17710	}
17711
17712	req, err := client.RollbackClusterUpgradePreparer(ctx, timeout)
17713	if err != nil {
17714		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", nil, "Failure preparing request")
17715		return
17716	}
17717
17718	resp, err := client.RollbackClusterUpgradeSender(req)
17719	if err != nil {
17720		result.Response = resp
17721		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", resp, "Failure sending request")
17722		return
17723	}
17724
17725	result, err = client.RollbackClusterUpgradeResponder(resp)
17726	if err != nil {
17727		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", resp, "Failure responding to request")
17728	}
17729
17730	return
17731}
17732
17733// RollbackClusterUpgradePreparer prepares the RollbackClusterUpgrade request.
17734func (client BaseClient) RollbackClusterUpgradePreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
17735	const APIVersion = "6.0"
17736	queryParameters := map[string]interface{}{
17737		"api-version": APIVersion,
17738	}
17739	if timeout != nil {
17740		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17741	} else {
17742		queryParameters["timeout"] = autorest.Encode("query", 60)
17743	}
17744
17745	preparer := autorest.CreatePreparer(
17746		autorest.AsPost(),
17747		autorest.WithBaseURL(client.BaseURI),
17748		autorest.WithPath("/$/RollbackUpgrade"),
17749		autorest.WithQueryParameters(queryParameters))
17750	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17751}
17752
17753// RollbackClusterUpgradeSender sends the RollbackClusterUpgrade request. The method will close the
17754// http.Response Body if it receives an error.
17755func (client BaseClient) RollbackClusterUpgradeSender(req *http.Request) (*http.Response, error) {
17756	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17757}
17758
17759// RollbackClusterUpgradeResponder handles the response to the RollbackClusterUpgrade request. The method always
17760// closes the http.Response Body.
17761func (client BaseClient) RollbackClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
17762	err = autorest.Respond(
17763		resp,
17764		client.ByInspecting(),
17765		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
17766		autorest.ByClosing())
17767	result.Response = resp
17768	return
17769}
17770
17771// SetUpgradeOrchestrationServiceState update the service state of Service Fabric Upgrade Orchestration Service. This
17772// API is internally used for support purposes.
17773// Parameters:
17774// upgradeOrchestrationServiceState - service state of Service Fabric Upgrade Orchestration Service.
17775// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17776// duration that the client is willing to wait for the requested operation to complete. The default value for
17777// this parameter is 60 seconds.
17778func (client BaseClient) SetUpgradeOrchestrationServiceState(ctx context.Context, upgradeOrchestrationServiceState UpgradeOrchestrationServiceState, timeout *int64) (result UpgradeOrchestrationServiceStateSummary, err error) {
17779	if tracing.IsEnabled() {
17780		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SetUpgradeOrchestrationServiceState")
17781		defer func() {
17782			sc := -1
17783			if result.Response.Response != nil {
17784				sc = result.Response.Response.StatusCode
17785			}
17786			tracing.EndSpan(ctx, sc, err)
17787		}()
17788	}
17789	if err := validation.Validate([]validation.Validation{
17790		{TargetValue: timeout,
17791			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17792				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17793					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17794				}}}}}); err != nil {
17795		return result, validation.NewError("servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", err.Error())
17796	}
17797
17798	req, err := client.SetUpgradeOrchestrationServiceStatePreparer(ctx, upgradeOrchestrationServiceState, timeout)
17799	if err != nil {
17800		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", nil, "Failure preparing request")
17801		return
17802	}
17803
17804	resp, err := client.SetUpgradeOrchestrationServiceStateSender(req)
17805	if err != nil {
17806		result.Response = autorest.Response{Response: resp}
17807		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", resp, "Failure sending request")
17808		return
17809	}
17810
17811	result, err = client.SetUpgradeOrchestrationServiceStateResponder(resp)
17812	if err != nil {
17813		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", resp, "Failure responding to request")
17814	}
17815
17816	return
17817}
17818
17819// SetUpgradeOrchestrationServiceStatePreparer prepares the SetUpgradeOrchestrationServiceState request.
17820func (client BaseClient) SetUpgradeOrchestrationServiceStatePreparer(ctx context.Context, upgradeOrchestrationServiceState UpgradeOrchestrationServiceState, timeout *int64) (*http.Request, error) {
17821	const APIVersion = "6.0"
17822	queryParameters := map[string]interface{}{
17823		"api-version": APIVersion,
17824	}
17825	if timeout != nil {
17826		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17827	} else {
17828		queryParameters["timeout"] = autorest.Encode("query", 60)
17829	}
17830
17831	preparer := autorest.CreatePreparer(
17832		autorest.AsContentType("application/json; charset=utf-8"),
17833		autorest.AsPost(),
17834		autorest.WithBaseURL(client.BaseURI),
17835		autorest.WithPath("/$/SetUpgradeOrchestrationServiceState"),
17836		autorest.WithJSON(upgradeOrchestrationServiceState),
17837		autorest.WithQueryParameters(queryParameters))
17838	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17839}
17840
17841// SetUpgradeOrchestrationServiceStateSender sends the SetUpgradeOrchestrationServiceState request. The method will close the
17842// http.Response Body if it receives an error.
17843func (client BaseClient) SetUpgradeOrchestrationServiceStateSender(req *http.Request) (*http.Response, error) {
17844	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17845}
17846
17847// SetUpgradeOrchestrationServiceStateResponder handles the response to the SetUpgradeOrchestrationServiceState request. The method always
17848// closes the http.Response Body.
17849func (client BaseClient) SetUpgradeOrchestrationServiceStateResponder(resp *http.Response) (result UpgradeOrchestrationServiceStateSummary, err error) {
17850	err = autorest.Respond(
17851		resp,
17852		client.ByInspecting(),
17853		azure.WithErrorUnlessStatusCode(http.StatusOK),
17854		autorest.ByUnmarshallingJSON(&result),
17855		autorest.ByClosing())
17856	result.Response = autorest.Response{Response: resp}
17857	return
17858}
17859
17860// StartApplicationUpgrade validates the supplied application upgrade parameters and starts upgrading the application
17861// if the parameters are valid.
17862// Parameters:
17863// applicationID - the identity of the application. This is typically the full name of the application without
17864// the 'fabric:' URI scheme.
17865// Starting from version 6.0, hierarchical names are delimited with the "~" character.
17866// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
17867// in 6.0+ and "myapp/app1" in previous versions.
17868// applicationUpgradeDescription - parameters for an application upgrade.
17869// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17870// duration that the client is willing to wait for the requested operation to complete. The default value for
17871// this parameter is 60 seconds.
17872func (client BaseClient) StartApplicationUpgrade(ctx context.Context, applicationID string, applicationUpgradeDescription ApplicationUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
17873	if tracing.IsEnabled() {
17874		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartApplicationUpgrade")
17875		defer func() {
17876			sc := -1
17877			if result.Response != nil {
17878				sc = result.Response.StatusCode
17879			}
17880			tracing.EndSpan(ctx, sc, err)
17881		}()
17882	}
17883	if err := validation.Validate([]validation.Validation{
17884		{TargetValue: applicationUpgradeDescription,
17885			Constraints: []validation.Constraint{{Target: "applicationUpgradeDescription.Name", Name: validation.Null, Rule: true, Chain: nil},
17886				{Target: "applicationUpgradeDescription.TargetApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil},
17887				{Target: "applicationUpgradeDescription.Parameters", Name: validation.Null, Rule: true, Chain: nil}}},
17888		{TargetValue: timeout,
17889			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
17890				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17891					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
17892				}}}}}); err != nil {
17893		return result, validation.NewError("servicefabric.BaseClient", "StartApplicationUpgrade", err.Error())
17894	}
17895
17896	req, err := client.StartApplicationUpgradePreparer(ctx, applicationID, applicationUpgradeDescription, timeout)
17897	if err != nil {
17898		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", nil, "Failure preparing request")
17899		return
17900	}
17901
17902	resp, err := client.StartApplicationUpgradeSender(req)
17903	if err != nil {
17904		result.Response = resp
17905		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", resp, "Failure sending request")
17906		return
17907	}
17908
17909	result, err = client.StartApplicationUpgradeResponder(resp)
17910	if err != nil {
17911		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", resp, "Failure responding to request")
17912	}
17913
17914	return
17915}
17916
17917// StartApplicationUpgradePreparer prepares the StartApplicationUpgrade request.
17918func (client BaseClient) StartApplicationUpgradePreparer(ctx context.Context, applicationID string, applicationUpgradeDescription ApplicationUpgradeDescription, timeout *int64) (*http.Request, error) {
17919	pathParameters := map[string]interface{}{
17920		"applicationId": applicationID,
17921	}
17922
17923	const APIVersion = "6.0"
17924	queryParameters := map[string]interface{}{
17925		"api-version": APIVersion,
17926	}
17927	if timeout != nil {
17928		queryParameters["timeout"] = autorest.Encode("query", *timeout)
17929	} else {
17930		queryParameters["timeout"] = autorest.Encode("query", 60)
17931	}
17932
17933	preparer := autorest.CreatePreparer(
17934		autorest.AsContentType("application/json; charset=utf-8"),
17935		autorest.AsPost(),
17936		autorest.WithBaseURL(client.BaseURI),
17937		autorest.WithPathParameters("/Applications/{applicationId}/$/Upgrade", pathParameters),
17938		autorest.WithJSON(applicationUpgradeDescription),
17939		autorest.WithQueryParameters(queryParameters))
17940	return preparer.Prepare((&http.Request{}).WithContext(ctx))
17941}
17942
17943// StartApplicationUpgradeSender sends the StartApplicationUpgrade request. The method will close the
17944// http.Response Body if it receives an error.
17945func (client BaseClient) StartApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
17946	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17947}
17948
17949// StartApplicationUpgradeResponder handles the response to the StartApplicationUpgrade request. The method always
17950// closes the http.Response Body.
17951func (client BaseClient) StartApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
17952	err = autorest.Respond(
17953		resp,
17954		client.ByInspecting(),
17955		azure.WithErrorUnlessStatusCode(http.StatusOK),
17956		autorest.ByClosing())
17957	result.Response = resp
17958	return
17959}
17960
17961// StartChaos if Chaos is not already running in the cluster, it starts Chaos with the passed in Chaos parameters.
17962// If Chaos is already running when this call is made, the call fails with the error code
17963// FABRIC_E_CHAOS_ALREADY_RUNNING.
17964// Please refer to the article [Induce controlled Chaos in Service Fabric
17965// clusters](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-controlled-chaos) for more details.
17966// Parameters:
17967// chaosParameters - describes all the parameters to configure a Chaos run.
17968// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
17969// duration that the client is willing to wait for the requested operation to complete. The default value for
17970// this parameter is 60 seconds.
17971func (client BaseClient) StartChaos(ctx context.Context, chaosParameters ChaosParameters, timeout *int64) (result autorest.Response, err error) {
17972	if tracing.IsEnabled() {
17973		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartChaos")
17974		defer func() {
17975			sc := -1
17976			if result.Response != nil {
17977				sc = result.Response.StatusCode
17978			}
17979			tracing.EndSpan(ctx, sc, err)
17980		}()
17981	}
17982	if err := validation.Validate([]validation.Validation{
17983		{TargetValue: chaosParameters,
17984			Constraints: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.Null, Rule: false,
17985				Chain: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17986					{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
17987				}},
17988				{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.Null, Rule: false,
17989					Chain: []validation.Constraint{{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17990						{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
17991					}},
17992				{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.Null, Rule: false,
17993					Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17994						{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
17995					}},
17996				{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.Null, Rule: false,
17997					Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
17998						{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
17999					}}}},
18000		{TargetValue: timeout,
18001			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18002				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18003					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18004				}}}}}); err != nil {
18005		return result, validation.NewError("servicefabric.BaseClient", "StartChaos", err.Error())
18006	}
18007
18008	req, err := client.StartChaosPreparer(ctx, chaosParameters, timeout)
18009	if err != nil {
18010		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", nil, "Failure preparing request")
18011		return
18012	}
18013
18014	resp, err := client.StartChaosSender(req)
18015	if err != nil {
18016		result.Response = resp
18017		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", resp, "Failure sending request")
18018		return
18019	}
18020
18021	result, err = client.StartChaosResponder(resp)
18022	if err != nil {
18023		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", resp, "Failure responding to request")
18024	}
18025
18026	return
18027}
18028
18029// StartChaosPreparer prepares the StartChaos request.
18030func (client BaseClient) StartChaosPreparer(ctx context.Context, chaosParameters ChaosParameters, timeout *int64) (*http.Request, error) {
18031	const APIVersion = "6.0"
18032	queryParameters := map[string]interface{}{
18033		"api-version": APIVersion,
18034	}
18035	if timeout != nil {
18036		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18037	} else {
18038		queryParameters["timeout"] = autorest.Encode("query", 60)
18039	}
18040
18041	preparer := autorest.CreatePreparer(
18042		autorest.AsContentType("application/json; charset=utf-8"),
18043		autorest.AsPost(),
18044		autorest.WithBaseURL(client.BaseURI),
18045		autorest.WithPath("/Tools/Chaos/$/Start"),
18046		autorest.WithJSON(chaosParameters),
18047		autorest.WithQueryParameters(queryParameters))
18048	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18049}
18050
18051// StartChaosSender sends the StartChaos request. The method will close the
18052// http.Response Body if it receives an error.
18053func (client BaseClient) StartChaosSender(req *http.Request) (*http.Response, error) {
18054	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18055}
18056
18057// StartChaosResponder handles the response to the StartChaos request. The method always
18058// closes the http.Response Body.
18059func (client BaseClient) StartChaosResponder(resp *http.Response) (result autorest.Response, err error) {
18060	err = autorest.Respond(
18061		resp,
18062		client.ByInspecting(),
18063		azure.WithErrorUnlessStatusCode(http.StatusOK),
18064		autorest.ByClosing())
18065	result.Response = resp
18066	return
18067}
18068
18069// StartClusterConfigurationUpgrade validate the supplied configuration upgrade parameters and start upgrading the
18070// cluster configuration if the parameters are valid.
18071// Parameters:
18072// clusterConfigurationUpgradeDescription - parameters for a standalone cluster configuration upgrade.
18073// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18074// duration that the client is willing to wait for the requested operation to complete. The default value for
18075// this parameter is 60 seconds.
18076func (client BaseClient) StartClusterConfigurationUpgrade(ctx context.Context, clusterConfigurationUpgradeDescription ClusterConfigurationUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
18077	if tracing.IsEnabled() {
18078		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartClusterConfigurationUpgrade")
18079		defer func() {
18080			sc := -1
18081			if result.Response != nil {
18082				sc = result.Response.StatusCode
18083			}
18084			tracing.EndSpan(ctx, sc, err)
18085		}()
18086	}
18087	if err := validation.Validate([]validation.Validation{
18088		{TargetValue: clusterConfigurationUpgradeDescription,
18089			Constraints: []validation.Constraint{{Target: "clusterConfigurationUpgradeDescription.ClusterConfig", Name: validation.Null, Rule: true, Chain: nil}}},
18090		{TargetValue: timeout,
18091			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18092				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18093					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18094				}}}}}); err != nil {
18095		return result, validation.NewError("servicefabric.BaseClient", "StartClusterConfigurationUpgrade", err.Error())
18096	}
18097
18098	req, err := client.StartClusterConfigurationUpgradePreparer(ctx, clusterConfigurationUpgradeDescription, timeout)
18099	if err != nil {
18100		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", nil, "Failure preparing request")
18101		return
18102	}
18103
18104	resp, err := client.StartClusterConfigurationUpgradeSender(req)
18105	if err != nil {
18106		result.Response = resp
18107		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", resp, "Failure sending request")
18108		return
18109	}
18110
18111	result, err = client.StartClusterConfigurationUpgradeResponder(resp)
18112	if err != nil {
18113		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", resp, "Failure responding to request")
18114	}
18115
18116	return
18117}
18118
18119// StartClusterConfigurationUpgradePreparer prepares the StartClusterConfigurationUpgrade request.
18120func (client BaseClient) StartClusterConfigurationUpgradePreparer(ctx context.Context, clusterConfigurationUpgradeDescription ClusterConfigurationUpgradeDescription, timeout *int64) (*http.Request, error) {
18121	const APIVersion = "6.0"
18122	queryParameters := map[string]interface{}{
18123		"api-version": APIVersion,
18124	}
18125	if timeout != nil {
18126		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18127	} else {
18128		queryParameters["timeout"] = autorest.Encode("query", 60)
18129	}
18130
18131	preparer := autorest.CreatePreparer(
18132		autorest.AsContentType("application/json; charset=utf-8"),
18133		autorest.AsPost(),
18134		autorest.WithBaseURL(client.BaseURI),
18135		autorest.WithPath("/$/StartClusterConfigurationUpgrade"),
18136		autorest.WithJSON(clusterConfigurationUpgradeDescription),
18137		autorest.WithQueryParameters(queryParameters))
18138	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18139}
18140
18141// StartClusterConfigurationUpgradeSender sends the StartClusterConfigurationUpgrade request. The method will close the
18142// http.Response Body if it receives an error.
18143func (client BaseClient) StartClusterConfigurationUpgradeSender(req *http.Request) (*http.Response, error) {
18144	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18145}
18146
18147// StartClusterConfigurationUpgradeResponder handles the response to the StartClusterConfigurationUpgrade request. The method always
18148// closes the http.Response Body.
18149func (client BaseClient) StartClusterConfigurationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
18150	err = autorest.Respond(
18151		resp,
18152		client.ByInspecting(),
18153		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18154		autorest.ByClosing())
18155	result.Response = resp
18156	return
18157}
18158
18159// StartClusterUpgrade validate the supplied upgrade parameters and start upgrading the code or configuration version
18160// of a Service Fabric cluster if the parameters are valid.
18161// Parameters:
18162// startClusterUpgradeDescription - describes the parameters for starting a cluster upgrade.
18163// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18164// duration that the client is willing to wait for the requested operation to complete. The default value for
18165// this parameter is 60 seconds.
18166func (client BaseClient) StartClusterUpgrade(ctx context.Context, startClusterUpgradeDescription StartClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
18167	if tracing.IsEnabled() {
18168		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartClusterUpgrade")
18169		defer func() {
18170			sc := -1
18171			if result.Response != nil {
18172				sc = result.Response.StatusCode
18173			}
18174			tracing.EndSpan(ctx, sc, err)
18175		}()
18176	}
18177	if err := validation.Validate([]validation.Validation{
18178		{TargetValue: startClusterUpgradeDescription,
18179			Constraints: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false,
18180				Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false,
18181					Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
18182						{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
18183					}},
18184					{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false,
18185						Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
18186							{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
18187						}},
18188				}}}},
18189		{TargetValue: timeout,
18190			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18191				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18192					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18193				}}}}}); err != nil {
18194		return result, validation.NewError("servicefabric.BaseClient", "StartClusterUpgrade", err.Error())
18195	}
18196
18197	req, err := client.StartClusterUpgradePreparer(ctx, startClusterUpgradeDescription, timeout)
18198	if err != nil {
18199		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", nil, "Failure preparing request")
18200		return
18201	}
18202
18203	resp, err := client.StartClusterUpgradeSender(req)
18204	if err != nil {
18205		result.Response = resp
18206		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", resp, "Failure sending request")
18207		return
18208	}
18209
18210	result, err = client.StartClusterUpgradeResponder(resp)
18211	if err != nil {
18212		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", resp, "Failure responding to request")
18213	}
18214
18215	return
18216}
18217
18218// StartClusterUpgradePreparer prepares the StartClusterUpgrade request.
18219func (client BaseClient) StartClusterUpgradePreparer(ctx context.Context, startClusterUpgradeDescription StartClusterUpgradeDescription, timeout *int64) (*http.Request, error) {
18220	const APIVersion = "6.0"
18221	queryParameters := map[string]interface{}{
18222		"api-version": APIVersion,
18223	}
18224	if timeout != nil {
18225		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18226	} else {
18227		queryParameters["timeout"] = autorest.Encode("query", 60)
18228	}
18229
18230	preparer := autorest.CreatePreparer(
18231		autorest.AsContentType("application/json; charset=utf-8"),
18232		autorest.AsPost(),
18233		autorest.WithBaseURL(client.BaseURI),
18234		autorest.WithPath("/$/Upgrade"),
18235		autorest.WithJSON(startClusterUpgradeDescription),
18236		autorest.WithQueryParameters(queryParameters))
18237	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18238}
18239
18240// StartClusterUpgradeSender sends the StartClusterUpgrade request. The method will close the
18241// http.Response Body if it receives an error.
18242func (client BaseClient) StartClusterUpgradeSender(req *http.Request) (*http.Response, error) {
18243	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18244}
18245
18246// StartClusterUpgradeResponder handles the response to the StartClusterUpgrade request. The method always
18247// closes the http.Response Body.
18248func (client BaseClient) StartClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
18249	err = autorest.Respond(
18250		resp,
18251		client.ByInspecting(),
18252		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18253		autorest.ByClosing())
18254	result.Response = resp
18255	return
18256}
18257
18258// StartComposeDeploymentUpgrade validates the supplied upgrade parameters and starts upgrading the deployment if the
18259// parameters are valid.
18260// Parameters:
18261// deploymentName - the identity of the deployment.
18262// composeDeploymentUpgradeDescription - parameters for upgrading compose deployment.
18263// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18264// duration that the client is willing to wait for the requested operation to complete. The default value for
18265// this parameter is 60 seconds.
18266func (client BaseClient) StartComposeDeploymentUpgrade(ctx context.Context, deploymentName string, composeDeploymentUpgradeDescription ComposeDeploymentUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
18267	if tracing.IsEnabled() {
18268		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartComposeDeploymentUpgrade")
18269		defer func() {
18270			sc := -1
18271			if result.Response != nil {
18272				sc = result.Response.StatusCode
18273			}
18274			tracing.EndSpan(ctx, sc, err)
18275		}()
18276	}
18277	if err := validation.Validate([]validation.Validation{
18278		{TargetValue: composeDeploymentUpgradeDescription,
18279			Constraints: []validation.Constraint{{Target: "composeDeploymentUpgradeDescription.DeploymentName", Name: validation.Null, Rule: true, Chain: nil},
18280				{Target: "composeDeploymentUpgradeDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}},
18281		{TargetValue: timeout,
18282			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18283				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18284					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18285				}}}}}); err != nil {
18286		return result, validation.NewError("servicefabric.BaseClient", "StartComposeDeploymentUpgrade", err.Error())
18287	}
18288
18289	req, err := client.StartComposeDeploymentUpgradePreparer(ctx, deploymentName, composeDeploymentUpgradeDescription, timeout)
18290	if err != nil {
18291		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", nil, "Failure preparing request")
18292		return
18293	}
18294
18295	resp, err := client.StartComposeDeploymentUpgradeSender(req)
18296	if err != nil {
18297		result.Response = resp
18298		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", resp, "Failure sending request")
18299		return
18300	}
18301
18302	result, err = client.StartComposeDeploymentUpgradeResponder(resp)
18303	if err != nil {
18304		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", resp, "Failure responding to request")
18305	}
18306
18307	return
18308}
18309
18310// StartComposeDeploymentUpgradePreparer prepares the StartComposeDeploymentUpgrade request.
18311func (client BaseClient) StartComposeDeploymentUpgradePreparer(ctx context.Context, deploymentName string, composeDeploymentUpgradeDescription ComposeDeploymentUpgradeDescription, timeout *int64) (*http.Request, error) {
18312	pathParameters := map[string]interface{}{
18313		"deploymentName": deploymentName,
18314	}
18315
18316	const APIVersion = "6.0-preview"
18317	queryParameters := map[string]interface{}{
18318		"api-version": APIVersion,
18319	}
18320	if timeout != nil {
18321		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18322	} else {
18323		queryParameters["timeout"] = autorest.Encode("query", 60)
18324	}
18325
18326	preparer := autorest.CreatePreparer(
18327		autorest.AsContentType("application/json; charset=utf-8"),
18328		autorest.AsPost(),
18329		autorest.WithBaseURL(client.BaseURI),
18330		autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/Upgrade", pathParameters),
18331		autorest.WithJSON(composeDeploymentUpgradeDescription),
18332		autorest.WithQueryParameters(queryParameters))
18333	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18334}
18335
18336// StartComposeDeploymentUpgradeSender sends the StartComposeDeploymentUpgrade request. The method will close the
18337// http.Response Body if it receives an error.
18338func (client BaseClient) StartComposeDeploymentUpgradeSender(req *http.Request) (*http.Response, error) {
18339	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18340}
18341
18342// StartComposeDeploymentUpgradeResponder handles the response to the StartComposeDeploymentUpgrade request. The method always
18343// closes the http.Response Body.
18344func (client BaseClient) StartComposeDeploymentUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
18345	err = autorest.Respond(
18346		resp,
18347		client.ByInspecting(),
18348		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18349		autorest.ByClosing())
18350	result.Response = resp
18351	return
18352}
18353
18354// StartDataLoss this API will induce data loss for the specified partition. It will trigger a call to the OnDataLoss
18355// API of the partition.
18356// Actual data loss will depend on the specified DataLossMode
18357// PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is triggered for the partition but actual
18358// data loss depends on the presence of in-flight replication.
18359// FullDataLoss - All replicas are removed hence all data is lost and OnDataLoss is triggered.
18360//
18361// This API should only be called with a stateful service as the target.
18362//
18363// Calling this API with a system service as the target is not advised.
18364//
18365// Note:  Once this API has been called, it cannot be reversed. Calling CancelOperation will only stop execution and
18366// clean up internal system state.
18367// It will not restore data if the command has progressed far enough to cause data loss.
18368//
18369// Call the GetDataLossProgress API with the same OperationId to return information on the operation started with this
18370// API.
18371// Parameters:
18372// serviceID - the identity of the service. This is typically the full name of the service without the
18373// 'fabric:' URI scheme.
18374// Starting from version 6.0, hierarchical names are delimited with the "~" character.
18375// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
18376// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
18377// partitionID - the identity of the partition.
18378// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
18379// API
18380// dataLossMode - this enum is passed to the StartDataLoss API to indicate what type of data loss to induce.
18381// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18382// duration that the client is willing to wait for the requested operation to complete. The default value for
18383// this parameter is 60 seconds.
18384func (client BaseClient) StartDataLoss(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, dataLossMode DataLossMode, timeout *int64) (result autorest.Response, err error) {
18385	if tracing.IsEnabled() {
18386		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartDataLoss")
18387		defer func() {
18388			sc := -1
18389			if result.Response != nil {
18390				sc = result.Response.StatusCode
18391			}
18392			tracing.EndSpan(ctx, sc, err)
18393		}()
18394	}
18395	if err := validation.Validate([]validation.Validation{
18396		{TargetValue: timeout,
18397			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18398				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18399					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18400				}}}}}); err != nil {
18401		return result, validation.NewError("servicefabric.BaseClient", "StartDataLoss", err.Error())
18402	}
18403
18404	req, err := client.StartDataLossPreparer(ctx, serviceID, partitionID, operationID, dataLossMode, timeout)
18405	if err != nil {
18406		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", nil, "Failure preparing request")
18407		return
18408	}
18409
18410	resp, err := client.StartDataLossSender(req)
18411	if err != nil {
18412		result.Response = resp
18413		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", resp, "Failure sending request")
18414		return
18415	}
18416
18417	result, err = client.StartDataLossResponder(resp)
18418	if err != nil {
18419		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", resp, "Failure responding to request")
18420	}
18421
18422	return
18423}
18424
18425// StartDataLossPreparer prepares the StartDataLoss request.
18426func (client BaseClient) StartDataLossPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, dataLossMode DataLossMode, timeout *int64) (*http.Request, error) {
18427	pathParameters := map[string]interface{}{
18428		"partitionId": partitionID,
18429		"serviceId":   serviceID,
18430	}
18431
18432	const APIVersion = "6.0"
18433	queryParameters := map[string]interface{}{
18434		"api-version":  APIVersion,
18435		"DataLossMode": autorest.Encode("query", dataLossMode),
18436		"OperationId":  autorest.Encode("query", operationID),
18437	}
18438	if timeout != nil {
18439		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18440	} else {
18441		queryParameters["timeout"] = autorest.Encode("query", 60)
18442	}
18443
18444	preparer := autorest.CreatePreparer(
18445		autorest.AsPost(),
18446		autorest.WithBaseURL(client.BaseURI),
18447		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartDataLoss", pathParameters),
18448		autorest.WithQueryParameters(queryParameters))
18449	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18450}
18451
18452// StartDataLossSender sends the StartDataLoss request. The method will close the
18453// http.Response Body if it receives an error.
18454func (client BaseClient) StartDataLossSender(req *http.Request) (*http.Response, error) {
18455	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18456}
18457
18458// StartDataLossResponder handles the response to the StartDataLoss request. The method always
18459// closes the http.Response Body.
18460func (client BaseClient) StartDataLossResponder(resp *http.Response) (result autorest.Response, err error) {
18461	err = autorest.Respond(
18462		resp,
18463		client.ByInspecting(),
18464		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18465		autorest.ByClosing())
18466	result.Response = resp
18467	return
18468}
18469
18470// StartNodeTransition starts or stops a cluster node.  A cluster node is a process, not the OS instance itself.  To
18471// start a node, pass in "Start" for the NodeTransitionType parameter.
18472// To stop a node, pass in "Stop" for the NodeTransitionType parameter.  This API starts the operation - when the API
18473// returns the node may not have finished transitioning yet.
18474// Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation.
18475// Parameters:
18476// nodeName - the name of the node.
18477// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
18478// API
18479// nodeTransitionType - indicates the type of transition to perform.  NodeTransitionType.Start will start a
18480// stopped node.  NodeTransitionType.Stop will stop a node that is up.
18481// nodeInstanceID - the node instance ID of the target node.  This can be determined through GetNodeInfo API.
18482// stopDurationInSeconds - the duration, in seconds, to keep the node stopped.  The minimum value is 600, the
18483// maximum is 14400.  After this time expires, the node will automatically come back up.
18484// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18485// duration that the client is willing to wait for the requested operation to complete. The default value for
18486// this parameter is 60 seconds.
18487func (client BaseClient) StartNodeTransition(ctx context.Context, nodeName string, operationID uuid.UUID, nodeTransitionType NodeTransitionType, nodeInstanceID string, stopDurationInSeconds int32, timeout *int64) (result autorest.Response, err error) {
18488	if tracing.IsEnabled() {
18489		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartNodeTransition")
18490		defer func() {
18491			sc := -1
18492			if result.Response != nil {
18493				sc = result.Response.StatusCode
18494			}
18495			tracing.EndSpan(ctx, sc, err)
18496		}()
18497	}
18498	if err := validation.Validate([]validation.Validation{
18499		{TargetValue: stopDurationInSeconds,
18500			Constraints: []validation.Constraint{{Target: "stopDurationInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}},
18501		{TargetValue: timeout,
18502			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18503				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18504					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18505				}}}}}); err != nil {
18506		return result, validation.NewError("servicefabric.BaseClient", "StartNodeTransition", err.Error())
18507	}
18508
18509	req, err := client.StartNodeTransitionPreparer(ctx, nodeName, operationID, nodeTransitionType, nodeInstanceID, stopDurationInSeconds, timeout)
18510	if err != nil {
18511		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", nil, "Failure preparing request")
18512		return
18513	}
18514
18515	resp, err := client.StartNodeTransitionSender(req)
18516	if err != nil {
18517		result.Response = resp
18518		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", resp, "Failure sending request")
18519		return
18520	}
18521
18522	result, err = client.StartNodeTransitionResponder(resp)
18523	if err != nil {
18524		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", resp, "Failure responding to request")
18525	}
18526
18527	return
18528}
18529
18530// StartNodeTransitionPreparer prepares the StartNodeTransition request.
18531func (client BaseClient) StartNodeTransitionPreparer(ctx context.Context, nodeName string, operationID uuid.UUID, nodeTransitionType NodeTransitionType, nodeInstanceID string, stopDurationInSeconds int32, timeout *int64) (*http.Request, error) {
18532	pathParameters := map[string]interface{}{
18533		"nodeName": autorest.Encode("path", nodeName),
18534	}
18535
18536	const APIVersion = "6.0"
18537	queryParameters := map[string]interface{}{
18538		"api-version":           APIVersion,
18539		"NodeInstanceId":        autorest.Encode("query", nodeInstanceID),
18540		"NodeTransitionType":    autorest.Encode("query", nodeTransitionType),
18541		"OperationId":           autorest.Encode("query", operationID),
18542		"StopDurationInSeconds": autorest.Encode("query", stopDurationInSeconds),
18543	}
18544	if timeout != nil {
18545		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18546	} else {
18547		queryParameters["timeout"] = autorest.Encode("query", 60)
18548	}
18549
18550	preparer := autorest.CreatePreparer(
18551		autorest.AsPost(),
18552		autorest.WithBaseURL(client.BaseURI),
18553		autorest.WithPathParameters("/Faults/Nodes/{nodeName}/$/StartTransition/", pathParameters),
18554		autorest.WithQueryParameters(queryParameters))
18555	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18556}
18557
18558// StartNodeTransitionSender sends the StartNodeTransition request. The method will close the
18559// http.Response Body if it receives an error.
18560func (client BaseClient) StartNodeTransitionSender(req *http.Request) (*http.Response, error) {
18561	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18562}
18563
18564// StartNodeTransitionResponder handles the response to the StartNodeTransition request. The method always
18565// closes the http.Response Body.
18566func (client BaseClient) StartNodeTransitionResponder(resp *http.Response) (result autorest.Response, err error) {
18567	err = autorest.Respond(
18568		resp,
18569		client.ByInspecting(),
18570		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18571		autorest.ByClosing())
18572	result.Response = resp
18573	return
18574}
18575
18576// StartPartitionRestart this API is useful for testing failover.
18577//
18578// If used to target a stateless service partition, RestartPartitionMode must be AllReplicasOrInstances.
18579//
18580// Call the GetPartitionRestartProgress API using the same OperationId to get the progress.
18581// Parameters:
18582// serviceID - the identity of the service. This is typically the full name of the service without the
18583// 'fabric:' URI scheme.
18584// Starting from version 6.0, hierarchical names are delimited with the "~" character.
18585// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
18586// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
18587// partitionID - the identity of the partition.
18588// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
18589// API
18590// restartPartitionMode - describe which partitions to restart.
18591// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18592// duration that the client is willing to wait for the requested operation to complete. The default value for
18593// this parameter is 60 seconds.
18594func (client BaseClient) StartPartitionRestart(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, restartPartitionMode RestartPartitionMode, timeout *int64) (result autorest.Response, err error) {
18595	if tracing.IsEnabled() {
18596		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartPartitionRestart")
18597		defer func() {
18598			sc := -1
18599			if result.Response != nil {
18600				sc = result.Response.StatusCode
18601			}
18602			tracing.EndSpan(ctx, sc, err)
18603		}()
18604	}
18605	if err := validation.Validate([]validation.Validation{
18606		{TargetValue: timeout,
18607			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18608				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18609					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18610				}}}}}); err != nil {
18611		return result, validation.NewError("servicefabric.BaseClient", "StartPartitionRestart", err.Error())
18612	}
18613
18614	req, err := client.StartPartitionRestartPreparer(ctx, serviceID, partitionID, operationID, restartPartitionMode, timeout)
18615	if err != nil {
18616		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", nil, "Failure preparing request")
18617		return
18618	}
18619
18620	resp, err := client.StartPartitionRestartSender(req)
18621	if err != nil {
18622		result.Response = resp
18623		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", resp, "Failure sending request")
18624		return
18625	}
18626
18627	result, err = client.StartPartitionRestartResponder(resp)
18628	if err != nil {
18629		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", resp, "Failure responding to request")
18630	}
18631
18632	return
18633}
18634
18635// StartPartitionRestartPreparer prepares the StartPartitionRestart request.
18636func (client BaseClient) StartPartitionRestartPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, restartPartitionMode RestartPartitionMode, timeout *int64) (*http.Request, error) {
18637	pathParameters := map[string]interface{}{
18638		"partitionId": partitionID,
18639		"serviceId":   serviceID,
18640	}
18641
18642	const APIVersion = "6.0"
18643	queryParameters := map[string]interface{}{
18644		"api-version":          APIVersion,
18645		"OperationId":          autorest.Encode("query", operationID),
18646		"RestartPartitionMode": autorest.Encode("query", restartPartitionMode),
18647	}
18648	if timeout != nil {
18649		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18650	} else {
18651		queryParameters["timeout"] = autorest.Encode("query", 60)
18652	}
18653
18654	preparer := autorest.CreatePreparer(
18655		autorest.AsPost(),
18656		autorest.WithBaseURL(client.BaseURI),
18657		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartRestart", pathParameters),
18658		autorest.WithQueryParameters(queryParameters))
18659	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18660}
18661
18662// StartPartitionRestartSender sends the StartPartitionRestart request. The method will close the
18663// http.Response Body if it receives an error.
18664func (client BaseClient) StartPartitionRestartSender(req *http.Request) (*http.Response, error) {
18665	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18666}
18667
18668// StartPartitionRestartResponder handles the response to the StartPartitionRestart request. The method always
18669// closes the http.Response Body.
18670func (client BaseClient) StartPartitionRestartResponder(resp *http.Response) (result autorest.Response, err error) {
18671	err = autorest.Respond(
18672		resp,
18673		client.ByInspecting(),
18674		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18675		autorest.ByClosing())
18676	result.Response = resp
18677	return
18678}
18679
18680// StartQuorumLoss induces quorum loss for a given stateful service partition.  This API is useful for a temporary
18681// quorum loss situation on your service.
18682//
18683// Call the GetQuorumLossProgress API with the same OperationId to return information on the operation started with
18684// this API.
18685//
18686// This can only be called on stateful persisted (HasPersistedState==true) services.  Do not use this API on stateless
18687// services or stateful in-memory only services.
18688// Parameters:
18689// serviceID - the identity of the service. This is typically the full name of the service without the
18690// 'fabric:' URI scheme.
18691// Starting from version 6.0, hierarchical names are delimited with the "~" character.
18692// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
18693// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
18694// partitionID - the identity of the partition.
18695// operationID - a GUID that identifies a call of this API.  This is passed into the corresponding GetProgress
18696// API
18697// quorumLossMode - this enum is passed to the StartQuorumLoss API to indicate what type of quorum loss to
18698// induce.
18699// quorumLossDuration - the amount of time for which the partition will be kept in quorum loss.  This must be
18700// specified in seconds.
18701// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18702// duration that the client is willing to wait for the requested operation to complete. The default value for
18703// this parameter is 60 seconds.
18704func (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) {
18705	if tracing.IsEnabled() {
18706		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartQuorumLoss")
18707		defer func() {
18708			sc := -1
18709			if result.Response != nil {
18710				sc = result.Response.StatusCode
18711			}
18712			tracing.EndSpan(ctx, sc, err)
18713		}()
18714	}
18715	if err := validation.Validate([]validation.Validation{
18716		{TargetValue: timeout,
18717			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18718				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18719					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18720				}}}}}); err != nil {
18721		return result, validation.NewError("servicefabric.BaseClient", "StartQuorumLoss", err.Error())
18722	}
18723
18724	req, err := client.StartQuorumLossPreparer(ctx, serviceID, partitionID, operationID, quorumLossMode, quorumLossDuration, timeout)
18725	if err != nil {
18726		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", nil, "Failure preparing request")
18727		return
18728	}
18729
18730	resp, err := client.StartQuorumLossSender(req)
18731	if err != nil {
18732		result.Response = resp
18733		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", resp, "Failure sending request")
18734		return
18735	}
18736
18737	result, err = client.StartQuorumLossResponder(resp)
18738	if err != nil {
18739		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", resp, "Failure responding to request")
18740	}
18741
18742	return
18743}
18744
18745// StartQuorumLossPreparer prepares the StartQuorumLoss request.
18746func (client BaseClient) StartQuorumLossPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, quorumLossMode QuorumLossMode, quorumLossDuration int32, timeout *int64) (*http.Request, error) {
18747	pathParameters := map[string]interface{}{
18748		"partitionId": partitionID,
18749		"serviceId":   serviceID,
18750	}
18751
18752	const APIVersion = "6.0"
18753	queryParameters := map[string]interface{}{
18754		"api-version":        APIVersion,
18755		"OperationId":        autorest.Encode("query", operationID),
18756		"QuorumLossDuration": autorest.Encode("query", quorumLossDuration),
18757		"QuorumLossMode":     autorest.Encode("query", quorumLossMode),
18758	}
18759	if timeout != nil {
18760		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18761	} else {
18762		queryParameters["timeout"] = autorest.Encode("query", 60)
18763	}
18764
18765	preparer := autorest.CreatePreparer(
18766		autorest.AsPost(),
18767		autorest.WithBaseURL(client.BaseURI),
18768		autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartQuorumLoss", pathParameters),
18769		autorest.WithQueryParameters(queryParameters))
18770	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18771}
18772
18773// StartQuorumLossSender sends the StartQuorumLoss request. The method will close the
18774// http.Response Body if it receives an error.
18775func (client BaseClient) StartQuorumLossSender(req *http.Request) (*http.Response, error) {
18776	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18777}
18778
18779// StartQuorumLossResponder handles the response to the StartQuorumLoss request. The method always
18780// closes the http.Response Body.
18781func (client BaseClient) StartQuorumLossResponder(resp *http.Response) (result autorest.Response, err error) {
18782	err = autorest.Respond(
18783		resp,
18784		client.ByInspecting(),
18785		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
18786		autorest.ByClosing())
18787	result.Response = resp
18788	return
18789}
18790
18791// StopChaos stops Chaos from executing new faults. In-flight faults will continue to execute until they are complete.
18792// The current Chaos Schedule is put into a stopped state.
18793// Once a schedule is stopped it will stay in the stopped state and not be used to Chaos Schedule new runs of Chaos. A
18794// new Chaos Schedule must be set in order to resume scheduling.
18795// Parameters:
18796// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18797// duration that the client is willing to wait for the requested operation to complete. The default value for
18798// this parameter is 60 seconds.
18799func (client BaseClient) StopChaos(ctx context.Context, timeout *int64) (result autorest.Response, err error) {
18800	if tracing.IsEnabled() {
18801		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StopChaos")
18802		defer func() {
18803			sc := -1
18804			if result.Response != nil {
18805				sc = result.Response.StatusCode
18806			}
18807			tracing.EndSpan(ctx, sc, err)
18808		}()
18809	}
18810	if err := validation.Validate([]validation.Validation{
18811		{TargetValue: timeout,
18812			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18813				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18814					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18815				}}}}}); err != nil {
18816		return result, validation.NewError("servicefabric.BaseClient", "StopChaos", err.Error())
18817	}
18818
18819	req, err := client.StopChaosPreparer(ctx, timeout)
18820	if err != nil {
18821		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", nil, "Failure preparing request")
18822		return
18823	}
18824
18825	resp, err := client.StopChaosSender(req)
18826	if err != nil {
18827		result.Response = resp
18828		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", resp, "Failure sending request")
18829		return
18830	}
18831
18832	result, err = client.StopChaosResponder(resp)
18833	if err != nil {
18834		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", resp, "Failure responding to request")
18835	}
18836
18837	return
18838}
18839
18840// StopChaosPreparer prepares the StopChaos request.
18841func (client BaseClient) StopChaosPreparer(ctx context.Context, timeout *int64) (*http.Request, error) {
18842	const APIVersion = "6.0"
18843	queryParameters := map[string]interface{}{
18844		"api-version": APIVersion,
18845	}
18846	if timeout != nil {
18847		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18848	} else {
18849		queryParameters["timeout"] = autorest.Encode("query", 60)
18850	}
18851
18852	preparer := autorest.CreatePreparer(
18853		autorest.AsPost(),
18854		autorest.WithBaseURL(client.BaseURI),
18855		autorest.WithPath("/Tools/Chaos/$/Stop"),
18856		autorest.WithQueryParameters(queryParameters))
18857	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18858}
18859
18860// StopChaosSender sends the StopChaos request. The method will close the
18861// http.Response Body if it receives an error.
18862func (client BaseClient) StopChaosSender(req *http.Request) (*http.Response, error) {
18863	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18864}
18865
18866// StopChaosResponder handles the response to the StopChaos request. The method always
18867// closes the http.Response Body.
18868func (client BaseClient) StopChaosResponder(resp *http.Response) (result autorest.Response, err error) {
18869	err = autorest.Respond(
18870		resp,
18871		client.ByInspecting(),
18872		azure.WithErrorUnlessStatusCode(http.StatusOK),
18873		autorest.ByClosing())
18874	result.Response = resp
18875	return
18876}
18877
18878// SubmitPropertyBatch submits a batch of property operations. Either all or none of the operations will be committed.
18879// Parameters:
18880// nameID - the Service Fabric name, without the 'fabric:' URI scheme.
18881// propertyBatchDescriptionList - describes the property batch operations to be submitted.
18882// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18883// duration that the client is willing to wait for the requested operation to complete. The default value for
18884// this parameter is 60 seconds.
18885func (client BaseClient) SubmitPropertyBatch(ctx context.Context, nameID string, propertyBatchDescriptionList PropertyBatchDescriptionList, timeout *int64) (result PropertyBatchInfoModel, err error) {
18886	if tracing.IsEnabled() {
18887		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SubmitPropertyBatch")
18888		defer func() {
18889			sc := -1
18890			if result.Response.Response != nil {
18891				sc = result.Response.Response.StatusCode
18892			}
18893			tracing.EndSpan(ctx, sc, err)
18894		}()
18895	}
18896	if err := validation.Validate([]validation.Validation{
18897		{TargetValue: timeout,
18898			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18899				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18900					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18901				}}}}}); err != nil {
18902		return result, validation.NewError("servicefabric.BaseClient", "SubmitPropertyBatch", err.Error())
18903	}
18904
18905	req, err := client.SubmitPropertyBatchPreparer(ctx, nameID, propertyBatchDescriptionList, timeout)
18906	if err != nil {
18907		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", nil, "Failure preparing request")
18908		return
18909	}
18910
18911	resp, err := client.SubmitPropertyBatchSender(req)
18912	if err != nil {
18913		result.Response = autorest.Response{Response: resp}
18914		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", resp, "Failure sending request")
18915		return
18916	}
18917
18918	result, err = client.SubmitPropertyBatchResponder(resp)
18919	if err != nil {
18920		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", resp, "Failure responding to request")
18921	}
18922
18923	return
18924}
18925
18926// SubmitPropertyBatchPreparer prepares the SubmitPropertyBatch request.
18927func (client BaseClient) SubmitPropertyBatchPreparer(ctx context.Context, nameID string, propertyBatchDescriptionList PropertyBatchDescriptionList, timeout *int64) (*http.Request, error) {
18928	pathParameters := map[string]interface{}{
18929		"nameId": nameID,
18930	}
18931
18932	const APIVersion = "6.0"
18933	queryParameters := map[string]interface{}{
18934		"api-version": APIVersion,
18935	}
18936	if timeout != nil {
18937		queryParameters["timeout"] = autorest.Encode("query", *timeout)
18938	} else {
18939		queryParameters["timeout"] = autorest.Encode("query", 60)
18940	}
18941
18942	preparer := autorest.CreatePreparer(
18943		autorest.AsContentType("application/json; charset=utf-8"),
18944		autorest.AsPost(),
18945		autorest.WithBaseURL(client.BaseURI),
18946		autorest.WithPathParameters("/Names/{nameId}/$/GetProperties/$/SubmitBatch", pathParameters),
18947		autorest.WithJSON(propertyBatchDescriptionList),
18948		autorest.WithQueryParameters(queryParameters))
18949	return preparer.Prepare((&http.Request{}).WithContext(ctx))
18950}
18951
18952// SubmitPropertyBatchSender sends the SubmitPropertyBatch request. The method will close the
18953// http.Response Body if it receives an error.
18954func (client BaseClient) SubmitPropertyBatchSender(req *http.Request) (*http.Response, error) {
18955	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18956}
18957
18958// SubmitPropertyBatchResponder handles the response to the SubmitPropertyBatch request. The method always
18959// closes the http.Response Body.
18960func (client BaseClient) SubmitPropertyBatchResponder(resp *http.Response) (result PropertyBatchInfoModel, err error) {
18961	err = autorest.Respond(
18962		resp,
18963		client.ByInspecting(),
18964		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusConflict),
18965		autorest.ByUnmarshallingJSON(&result),
18966		autorest.ByClosing())
18967	result.Response = autorest.Response{Response: resp}
18968	return
18969}
18970
18971// SuspendApplicationBackup the application which is configured to take periodic backups, is suspended for taking
18972// further backups till it is resumed again. This operation applies to the entire application's hierarchy. It means all
18973// the services and partitions under this application are now suspended for backup.
18974// Parameters:
18975// applicationID - the identity of the application. This is typically the full name of the application without
18976// the 'fabric:' URI scheme.
18977// Starting from version 6.0, hierarchical names are delimited with the "~" character.
18978// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
18979// in 6.0+ and "myapp/app1" in previous versions.
18980// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
18981// duration that the client is willing to wait for the requested operation to complete. The default value for
18982// this parameter is 60 seconds.
18983func (client BaseClient) SuspendApplicationBackup(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) {
18984	if tracing.IsEnabled() {
18985		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendApplicationBackup")
18986		defer func() {
18987			sc := -1
18988			if result.Response != nil {
18989				sc = result.Response.StatusCode
18990			}
18991			tracing.EndSpan(ctx, sc, err)
18992		}()
18993	}
18994	if err := validation.Validate([]validation.Validation{
18995		{TargetValue: timeout,
18996			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
18997				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
18998					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
18999				}}}}}); err != nil {
19000		return result, validation.NewError("servicefabric.BaseClient", "SuspendApplicationBackup", err.Error())
19001	}
19002
19003	req, err := client.SuspendApplicationBackupPreparer(ctx, applicationID, timeout)
19004	if err != nil {
19005		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", nil, "Failure preparing request")
19006		return
19007	}
19008
19009	resp, err := client.SuspendApplicationBackupSender(req)
19010	if err != nil {
19011		result.Response = resp
19012		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", resp, "Failure sending request")
19013		return
19014	}
19015
19016	result, err = client.SuspendApplicationBackupResponder(resp)
19017	if err != nil {
19018		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", resp, "Failure responding to request")
19019	}
19020
19021	return
19022}
19023
19024// SuspendApplicationBackupPreparer prepares the SuspendApplicationBackup request.
19025func (client BaseClient) SuspendApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) {
19026	pathParameters := map[string]interface{}{
19027		"applicationId": applicationID,
19028	}
19029
19030	const APIVersion = "6.2-preview"
19031	queryParameters := map[string]interface{}{
19032		"api-version": APIVersion,
19033	}
19034	if timeout != nil {
19035		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19036	} else {
19037		queryParameters["timeout"] = autorest.Encode("query", 60)
19038	}
19039
19040	preparer := autorest.CreatePreparer(
19041		autorest.AsPost(),
19042		autorest.WithBaseURL(client.BaseURI),
19043		autorest.WithPathParameters("/Applications/{applicationId}/$/SuspendBackup", pathParameters),
19044		autorest.WithQueryParameters(queryParameters))
19045	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19046}
19047
19048// SuspendApplicationBackupSender sends the SuspendApplicationBackup request. The method will close the
19049// http.Response Body if it receives an error.
19050func (client BaseClient) SuspendApplicationBackupSender(req *http.Request) (*http.Response, error) {
19051	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19052}
19053
19054// SuspendApplicationBackupResponder handles the response to the SuspendApplicationBackup request. The method always
19055// closes the http.Response Body.
19056func (client BaseClient) SuspendApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) {
19057	err = autorest.Respond(
19058		resp,
19059		client.ByInspecting(),
19060		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19061		autorest.ByClosing())
19062	result.Response = resp
19063	return
19064}
19065
19066// SuspendPartitionBackup the partition which is configured to take periodic backups, is suspended for taking further
19067// backups till it is resumed again.
19068// Parameters:
19069// partitionID - the identity of the partition.
19070// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19071// duration that the client is willing to wait for the requested operation to complete. The default value for
19072// this parameter is 60 seconds.
19073func (client BaseClient) SuspendPartitionBackup(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) {
19074	if tracing.IsEnabled() {
19075		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendPartitionBackup")
19076		defer func() {
19077			sc := -1
19078			if result.Response != nil {
19079				sc = result.Response.StatusCode
19080			}
19081			tracing.EndSpan(ctx, sc, err)
19082		}()
19083	}
19084	if err := validation.Validate([]validation.Validation{
19085		{TargetValue: timeout,
19086			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19087				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19088					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19089				}}}}}); err != nil {
19090		return result, validation.NewError("servicefabric.BaseClient", "SuspendPartitionBackup", err.Error())
19091	}
19092
19093	req, err := client.SuspendPartitionBackupPreparer(ctx, partitionID, timeout)
19094	if err != nil {
19095		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", nil, "Failure preparing request")
19096		return
19097	}
19098
19099	resp, err := client.SuspendPartitionBackupSender(req)
19100	if err != nil {
19101		result.Response = resp
19102		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", resp, "Failure sending request")
19103		return
19104	}
19105
19106	result, err = client.SuspendPartitionBackupResponder(resp)
19107	if err != nil {
19108		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", resp, "Failure responding to request")
19109	}
19110
19111	return
19112}
19113
19114// SuspendPartitionBackupPreparer prepares the SuspendPartitionBackup request.
19115func (client BaseClient) SuspendPartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) {
19116	pathParameters := map[string]interface{}{
19117		"partitionId": partitionID,
19118	}
19119
19120	const APIVersion = "6.2-preview"
19121	queryParameters := map[string]interface{}{
19122		"api-version": APIVersion,
19123	}
19124	if timeout != nil {
19125		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19126	} else {
19127		queryParameters["timeout"] = autorest.Encode("query", 60)
19128	}
19129
19130	preparer := autorest.CreatePreparer(
19131		autorest.AsPost(),
19132		autorest.WithBaseURL(client.BaseURI),
19133		autorest.WithPathParameters("/Partitions/{partitionId}/$/SuspendBackup", pathParameters),
19134		autorest.WithQueryParameters(queryParameters))
19135	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19136}
19137
19138// SuspendPartitionBackupSender sends the SuspendPartitionBackup request. The method will close the
19139// http.Response Body if it receives an error.
19140func (client BaseClient) SuspendPartitionBackupSender(req *http.Request) (*http.Response, error) {
19141	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19142}
19143
19144// SuspendPartitionBackupResponder handles the response to the SuspendPartitionBackup request. The method always
19145// closes the http.Response Body.
19146func (client BaseClient) SuspendPartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) {
19147	err = autorest.Respond(
19148		resp,
19149		client.ByInspecting(),
19150		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19151		autorest.ByClosing())
19152	result.Response = resp
19153	return
19154}
19155
19156// SuspendServiceBackup the service which is configured to take periodic backups, is suspended for taking further
19157// backups till it is resumed again. This operation applies to the entire service's hierarchy. It means all the
19158// partitions under this service are now suspended for backup.
19159// Parameters:
19160// serviceID - the identity of the service. This is typically the full name of the service without the
19161// 'fabric:' URI scheme.
19162// Starting from version 6.0, hierarchical names are delimited with the "~" character.
19163// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
19164// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
19165// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19166// duration that the client is willing to wait for the requested operation to complete. The default value for
19167// this parameter is 60 seconds.
19168func (client BaseClient) SuspendServiceBackup(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) {
19169	if tracing.IsEnabled() {
19170		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendServiceBackup")
19171		defer func() {
19172			sc := -1
19173			if result.Response != nil {
19174				sc = result.Response.StatusCode
19175			}
19176			tracing.EndSpan(ctx, sc, err)
19177		}()
19178	}
19179	if err := validation.Validate([]validation.Validation{
19180		{TargetValue: timeout,
19181			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19182				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19183					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19184				}}}}}); err != nil {
19185		return result, validation.NewError("servicefabric.BaseClient", "SuspendServiceBackup", err.Error())
19186	}
19187
19188	req, err := client.SuspendServiceBackupPreparer(ctx, serviceID, timeout)
19189	if err != nil {
19190		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", nil, "Failure preparing request")
19191		return
19192	}
19193
19194	resp, err := client.SuspendServiceBackupSender(req)
19195	if err != nil {
19196		result.Response = resp
19197		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", resp, "Failure sending request")
19198		return
19199	}
19200
19201	result, err = client.SuspendServiceBackupResponder(resp)
19202	if err != nil {
19203		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", resp, "Failure responding to request")
19204	}
19205
19206	return
19207}
19208
19209// SuspendServiceBackupPreparer prepares the SuspendServiceBackup request.
19210func (client BaseClient) SuspendServiceBackupPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) {
19211	pathParameters := map[string]interface{}{
19212		"serviceId": serviceID,
19213	}
19214
19215	const APIVersion = "6.2-preview"
19216	queryParameters := map[string]interface{}{
19217		"api-version": APIVersion,
19218	}
19219	if timeout != nil {
19220		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19221	} else {
19222		queryParameters["timeout"] = autorest.Encode("query", 60)
19223	}
19224
19225	preparer := autorest.CreatePreparer(
19226		autorest.AsPost(),
19227		autorest.WithBaseURL(client.BaseURI),
19228		autorest.WithPathParameters("/Services/{serviceId}/$/SuspendBackup", pathParameters),
19229		autorest.WithQueryParameters(queryParameters))
19230	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19231}
19232
19233// SuspendServiceBackupSender sends the SuspendServiceBackup request. The method will close the
19234// http.Response Body if it receives an error.
19235func (client BaseClient) SuspendServiceBackupSender(req *http.Request) (*http.Response, error) {
19236	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19237}
19238
19239// SuspendServiceBackupResponder handles the response to the SuspendServiceBackup request. The method always
19240// closes the http.Response Body.
19241func (client BaseClient) SuspendServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) {
19242	err = autorest.Respond(
19243		resp,
19244		client.ByInspecting(),
19245		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19246		autorest.ByClosing())
19247	result.Response = resp
19248	return
19249}
19250
19251// UnprovisionApplicationType removes or unregisters a Service Fabric application type from the cluster. This operation
19252// can only be performed if all application instances of the application type has been deleted. Once the application
19253// type is unregistered, no new application instances can be created for this particular application type.
19254// Parameters:
19255// applicationTypeName - the name of the application type.
19256// unprovisionApplicationTypeDescriptionInfo - the relative path for the application package in the image store
19257// specified during the prior copy operation.
19258// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19259// duration that the client is willing to wait for the requested operation to complete. The default value for
19260// this parameter is 60 seconds.
19261func (client BaseClient) UnprovisionApplicationType(ctx context.Context, applicationTypeName string, unprovisionApplicationTypeDescriptionInfo UnprovisionApplicationTypeDescriptionInfo, timeout *int64) (result autorest.Response, err error) {
19262	if tracing.IsEnabled() {
19263		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UnprovisionApplicationType")
19264		defer func() {
19265			sc := -1
19266			if result.Response != nil {
19267				sc = result.Response.StatusCode
19268			}
19269			tracing.EndSpan(ctx, sc, err)
19270		}()
19271	}
19272	if err := validation.Validate([]validation.Validation{
19273		{TargetValue: unprovisionApplicationTypeDescriptionInfo,
19274			Constraints: []validation.Constraint{{Target: "unprovisionApplicationTypeDescriptionInfo.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}}},
19275		{TargetValue: timeout,
19276			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19277				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19278					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19279				}}}}}); err != nil {
19280		return result, validation.NewError("servicefabric.BaseClient", "UnprovisionApplicationType", err.Error())
19281	}
19282
19283	req, err := client.UnprovisionApplicationTypePreparer(ctx, applicationTypeName, unprovisionApplicationTypeDescriptionInfo, timeout)
19284	if err != nil {
19285		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", nil, "Failure preparing request")
19286		return
19287	}
19288
19289	resp, err := client.UnprovisionApplicationTypeSender(req)
19290	if err != nil {
19291		result.Response = resp
19292		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", resp, "Failure sending request")
19293		return
19294	}
19295
19296	result, err = client.UnprovisionApplicationTypeResponder(resp)
19297	if err != nil {
19298		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", resp, "Failure responding to request")
19299	}
19300
19301	return
19302}
19303
19304// UnprovisionApplicationTypePreparer prepares the UnprovisionApplicationType request.
19305func (client BaseClient) UnprovisionApplicationTypePreparer(ctx context.Context, applicationTypeName string, unprovisionApplicationTypeDescriptionInfo UnprovisionApplicationTypeDescriptionInfo, timeout *int64) (*http.Request, error) {
19306	pathParameters := map[string]interface{}{
19307		"applicationTypeName": autorest.Encode("path", applicationTypeName),
19308	}
19309
19310	const APIVersion = "6.0"
19311	queryParameters := map[string]interface{}{
19312		"api-version": APIVersion,
19313	}
19314	if timeout != nil {
19315		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19316	} else {
19317		queryParameters["timeout"] = autorest.Encode("query", 60)
19318	}
19319
19320	preparer := autorest.CreatePreparer(
19321		autorest.AsContentType("application/json; charset=utf-8"),
19322		autorest.AsPost(),
19323		autorest.WithBaseURL(client.BaseURI),
19324		autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/Unprovision", pathParameters),
19325		autorest.WithJSON(unprovisionApplicationTypeDescriptionInfo),
19326		autorest.WithQueryParameters(queryParameters))
19327	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19328}
19329
19330// UnprovisionApplicationTypeSender sends the UnprovisionApplicationType request. The method will close the
19331// http.Response Body if it receives an error.
19332func (client BaseClient) UnprovisionApplicationTypeSender(req *http.Request) (*http.Response, error) {
19333	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19334}
19335
19336// UnprovisionApplicationTypeResponder handles the response to the UnprovisionApplicationType request. The method always
19337// closes the http.Response Body.
19338func (client BaseClient) UnprovisionApplicationTypeResponder(resp *http.Response) (result autorest.Response, err error) {
19339	err = autorest.Respond(
19340		resp,
19341		client.ByInspecting(),
19342		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
19343		autorest.ByClosing())
19344	result.Response = resp
19345	return
19346}
19347
19348// UnprovisionCluster unprovision the code or configuration packages of a Service Fabric cluster. It is supported to
19349// unprovision code and configuration separately.
19350// Parameters:
19351// unprovisionFabricDescription - describes the parameters for unprovisioning a cluster.
19352// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19353// duration that the client is willing to wait for the requested operation to complete. The default value for
19354// this parameter is 60 seconds.
19355func (client BaseClient) UnprovisionCluster(ctx context.Context, unprovisionFabricDescription UnprovisionFabricDescription, timeout *int64) (result autorest.Response, err error) {
19356	if tracing.IsEnabled() {
19357		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UnprovisionCluster")
19358		defer func() {
19359			sc := -1
19360			if result.Response != nil {
19361				sc = result.Response.StatusCode
19362			}
19363			tracing.EndSpan(ctx, sc, err)
19364		}()
19365	}
19366	if err := validation.Validate([]validation.Validation{
19367		{TargetValue: timeout,
19368			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19369				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19370					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19371				}}}}}); err != nil {
19372		return result, validation.NewError("servicefabric.BaseClient", "UnprovisionCluster", err.Error())
19373	}
19374
19375	req, err := client.UnprovisionClusterPreparer(ctx, unprovisionFabricDescription, timeout)
19376	if err != nil {
19377		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", nil, "Failure preparing request")
19378		return
19379	}
19380
19381	resp, err := client.UnprovisionClusterSender(req)
19382	if err != nil {
19383		result.Response = resp
19384		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", resp, "Failure sending request")
19385		return
19386	}
19387
19388	result, err = client.UnprovisionClusterResponder(resp)
19389	if err != nil {
19390		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", resp, "Failure responding to request")
19391	}
19392
19393	return
19394}
19395
19396// UnprovisionClusterPreparer prepares the UnprovisionCluster request.
19397func (client BaseClient) UnprovisionClusterPreparer(ctx context.Context, unprovisionFabricDescription UnprovisionFabricDescription, timeout *int64) (*http.Request, error) {
19398	const APIVersion = "6.0"
19399	queryParameters := map[string]interface{}{
19400		"api-version": APIVersion,
19401	}
19402	if timeout != nil {
19403		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19404	} else {
19405		queryParameters["timeout"] = autorest.Encode("query", 60)
19406	}
19407
19408	preparer := autorest.CreatePreparer(
19409		autorest.AsContentType("application/json; charset=utf-8"),
19410		autorest.AsPost(),
19411		autorest.WithBaseURL(client.BaseURI),
19412		autorest.WithPath("/$/Unprovision"),
19413		autorest.WithJSON(unprovisionFabricDescription),
19414		autorest.WithQueryParameters(queryParameters))
19415	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19416}
19417
19418// UnprovisionClusterSender sends the UnprovisionCluster request. The method will close the
19419// http.Response Body if it receives an error.
19420func (client BaseClient) UnprovisionClusterSender(req *http.Request) (*http.Response, error) {
19421	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19422}
19423
19424// UnprovisionClusterResponder handles the response to the UnprovisionCluster request. The method always
19425// closes the http.Response Body.
19426func (client BaseClient) UnprovisionClusterResponder(resp *http.Response) (result autorest.Response, err error) {
19427	err = autorest.Respond(
19428		resp,
19429		client.ByInspecting(),
19430		azure.WithErrorUnlessStatusCode(http.StatusOK),
19431		autorest.ByClosing())
19432	result.Response = resp
19433	return
19434}
19435
19436// UpdateApplicationUpgrade updates the parameters of an ongoing application upgrade from the ones specified at the
19437// time of starting the application upgrade. This may be required to mitigate stuck application upgrades due to
19438// incorrect parameters or issues in the application to make progress.
19439// Parameters:
19440// applicationID - the identity of the application. This is typically the full name of the application without
19441// the 'fabric:' URI scheme.
19442// Starting from version 6.0, hierarchical names are delimited with the "~" character.
19443// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1"
19444// in 6.0+ and "myapp/app1" in previous versions.
19445// applicationUpgradeUpdateDescription - parameters for updating an existing application upgrade.
19446// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19447// duration that the client is willing to wait for the requested operation to complete. The default value for
19448// this parameter is 60 seconds.
19449func (client BaseClient) UpdateApplicationUpgrade(ctx context.Context, applicationID string, applicationUpgradeUpdateDescription ApplicationUpgradeUpdateDescription, timeout *int64) (result autorest.Response, err error) {
19450	if tracing.IsEnabled() {
19451		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateApplicationUpgrade")
19452		defer func() {
19453			sc := -1
19454			if result.Response != nil {
19455				sc = result.Response.StatusCode
19456			}
19457			tracing.EndSpan(ctx, sc, err)
19458		}()
19459	}
19460	if err := validation.Validate([]validation.Validation{
19461		{TargetValue: applicationUpgradeUpdateDescription,
19462			Constraints: []validation.Constraint{{Target: "applicationUpgradeUpdateDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}},
19463		{TargetValue: timeout,
19464			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19465				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19466					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19467				}}}}}); err != nil {
19468		return result, validation.NewError("servicefabric.BaseClient", "UpdateApplicationUpgrade", err.Error())
19469	}
19470
19471	req, err := client.UpdateApplicationUpgradePreparer(ctx, applicationID, applicationUpgradeUpdateDescription, timeout)
19472	if err != nil {
19473		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", nil, "Failure preparing request")
19474		return
19475	}
19476
19477	resp, err := client.UpdateApplicationUpgradeSender(req)
19478	if err != nil {
19479		result.Response = resp
19480		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", resp, "Failure sending request")
19481		return
19482	}
19483
19484	result, err = client.UpdateApplicationUpgradeResponder(resp)
19485	if err != nil {
19486		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", resp, "Failure responding to request")
19487	}
19488
19489	return
19490}
19491
19492// UpdateApplicationUpgradePreparer prepares the UpdateApplicationUpgrade request.
19493func (client BaseClient) UpdateApplicationUpgradePreparer(ctx context.Context, applicationID string, applicationUpgradeUpdateDescription ApplicationUpgradeUpdateDescription, timeout *int64) (*http.Request, error) {
19494	pathParameters := map[string]interface{}{
19495		"applicationId": applicationID,
19496	}
19497
19498	const APIVersion = "6.0"
19499	queryParameters := map[string]interface{}{
19500		"api-version": APIVersion,
19501	}
19502	if timeout != nil {
19503		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19504	} else {
19505		queryParameters["timeout"] = autorest.Encode("query", 60)
19506	}
19507
19508	preparer := autorest.CreatePreparer(
19509		autorest.AsContentType("application/json; charset=utf-8"),
19510		autorest.AsPost(),
19511		autorest.WithBaseURL(client.BaseURI),
19512		autorest.WithPathParameters("/Applications/{applicationId}/$/UpdateUpgrade", pathParameters),
19513		autorest.WithJSON(applicationUpgradeUpdateDescription),
19514		autorest.WithQueryParameters(queryParameters))
19515	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19516}
19517
19518// UpdateApplicationUpgradeSender sends the UpdateApplicationUpgrade request. The method will close the
19519// http.Response Body if it receives an error.
19520func (client BaseClient) UpdateApplicationUpgradeSender(req *http.Request) (*http.Response, error) {
19521	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19522}
19523
19524// UpdateApplicationUpgradeResponder handles the response to the UpdateApplicationUpgrade request. The method always
19525// closes the http.Response Body.
19526func (client BaseClient) UpdateApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
19527	err = autorest.Respond(
19528		resp,
19529		client.ByInspecting(),
19530		azure.WithErrorUnlessStatusCode(http.StatusOK),
19531		autorest.ByClosing())
19532	result.Response = resp
19533	return
19534}
19535
19536// UpdateBackupPolicy updates the backup policy identified by {backupPolicyName}
19537// Parameters:
19538// backupPolicyDescription - describes the backup policy.
19539// backupPolicyName - the name of the backup policy.
19540// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19541// duration that the client is willing to wait for the requested operation to complete. The default value for
19542// this parameter is 60 seconds.
19543func (client BaseClient) UpdateBackupPolicy(ctx context.Context, backupPolicyDescription BackupPolicyDescription, backupPolicyName string, timeout *int64) (result autorest.Response, err error) {
19544	if tracing.IsEnabled() {
19545		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateBackupPolicy")
19546		defer func() {
19547			sc := -1
19548			if result.Response != nil {
19549				sc = result.Response.StatusCode
19550			}
19551			tracing.EndSpan(ctx, sc, err)
19552		}()
19553	}
19554	if err := validation.Validate([]validation.Validation{
19555		{TargetValue: backupPolicyDescription,
19556			Constraints: []validation.Constraint{{Target: "backupPolicyDescription.Name", Name: validation.Null, Rule: true, Chain: nil},
19557				{Target: "backupPolicyDescription.AutoRestoreOnDataLoss", Name: validation.Null, Rule: true, Chain: nil},
19558				{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.Null, Rule: true,
19559					Chain: []validation.Constraint{{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMaximum, Rule: int64(255), Chain: nil},
19560						{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
19561					}},
19562				{Target: "backupPolicyDescription.Schedule", Name: validation.Null, Rule: true, Chain: nil},
19563				{Target: "backupPolicyDescription.Storage", Name: validation.Null, Rule: true, Chain: nil}}},
19564		{TargetValue: timeout,
19565			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19566				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19567					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19568				}}}}}); err != nil {
19569		return result, validation.NewError("servicefabric.BaseClient", "UpdateBackupPolicy", err.Error())
19570	}
19571
19572	req, err := client.UpdateBackupPolicyPreparer(ctx, backupPolicyDescription, backupPolicyName, timeout)
19573	if err != nil {
19574		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", nil, "Failure preparing request")
19575		return
19576	}
19577
19578	resp, err := client.UpdateBackupPolicySender(req)
19579	if err != nil {
19580		result.Response = resp
19581		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", resp, "Failure sending request")
19582		return
19583	}
19584
19585	result, err = client.UpdateBackupPolicyResponder(resp)
19586	if err != nil {
19587		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", resp, "Failure responding to request")
19588	}
19589
19590	return
19591}
19592
19593// UpdateBackupPolicyPreparer prepares the UpdateBackupPolicy request.
19594func (client BaseClient) UpdateBackupPolicyPreparer(ctx context.Context, backupPolicyDescription BackupPolicyDescription, backupPolicyName string, timeout *int64) (*http.Request, error) {
19595	pathParameters := map[string]interface{}{
19596		"backupPolicyName": autorest.Encode("path", backupPolicyName),
19597	}
19598
19599	const APIVersion = "6.2-preview"
19600	queryParameters := map[string]interface{}{
19601		"api-version": APIVersion,
19602	}
19603	if timeout != nil {
19604		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19605	} else {
19606		queryParameters["timeout"] = autorest.Encode("query", 60)
19607	}
19608
19609	preparer := autorest.CreatePreparer(
19610		autorest.AsContentType("application/json; charset=utf-8"),
19611		autorest.AsPost(),
19612		autorest.WithBaseURL(client.BaseURI),
19613		autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/Update", pathParameters),
19614		autorest.WithJSON(backupPolicyDescription),
19615		autorest.WithQueryParameters(queryParameters))
19616	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19617}
19618
19619// UpdateBackupPolicySender sends the UpdateBackupPolicy request. The method will close the
19620// http.Response Body if it receives an error.
19621func (client BaseClient) UpdateBackupPolicySender(req *http.Request) (*http.Response, error) {
19622	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19623}
19624
19625// UpdateBackupPolicyResponder handles the response to the UpdateBackupPolicy request. The method always
19626// closes the http.Response Body.
19627func (client BaseClient) UpdateBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) {
19628	err = autorest.Respond(
19629		resp,
19630		client.ByInspecting(),
19631		azure.WithErrorUnlessStatusCode(http.StatusOK),
19632		autorest.ByClosing())
19633	result.Response = resp
19634	return
19635}
19636
19637// UpdateClusterUpgrade update the upgrade parameters used during a Service Fabric cluster upgrade.
19638// Parameters:
19639// updateClusterUpgradeDescription - parameters for updating a cluster upgrade.
19640// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19641// duration that the client is willing to wait for the requested operation to complete. The default value for
19642// this parameter is 60 seconds.
19643func (client BaseClient) UpdateClusterUpgrade(ctx context.Context, updateClusterUpgradeDescription UpdateClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) {
19644	if tracing.IsEnabled() {
19645		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateClusterUpgrade")
19646		defer func() {
19647			sc := -1
19648			if result.Response != nil {
19649				sc = result.Response.StatusCode
19650			}
19651			tracing.EndSpan(ctx, sc, err)
19652		}()
19653	}
19654	if err := validation.Validate([]validation.Validation{
19655		{TargetValue: updateClusterUpgradeDescription,
19656			Constraints: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false,
19657				Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false,
19658					Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
19659						{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
19660					}},
19661					{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false,
19662						Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
19663							{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
19664						}},
19665				}}}},
19666		{TargetValue: timeout,
19667			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19668				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19669					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19670				}}}}}); err != nil {
19671		return result, validation.NewError("servicefabric.BaseClient", "UpdateClusterUpgrade", err.Error())
19672	}
19673
19674	req, err := client.UpdateClusterUpgradePreparer(ctx, updateClusterUpgradeDescription, timeout)
19675	if err != nil {
19676		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", nil, "Failure preparing request")
19677		return
19678	}
19679
19680	resp, err := client.UpdateClusterUpgradeSender(req)
19681	if err != nil {
19682		result.Response = resp
19683		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", resp, "Failure sending request")
19684		return
19685	}
19686
19687	result, err = client.UpdateClusterUpgradeResponder(resp)
19688	if err != nil {
19689		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", resp, "Failure responding to request")
19690	}
19691
19692	return
19693}
19694
19695// UpdateClusterUpgradePreparer prepares the UpdateClusterUpgrade request.
19696func (client BaseClient) UpdateClusterUpgradePreparer(ctx context.Context, updateClusterUpgradeDescription UpdateClusterUpgradeDescription, timeout *int64) (*http.Request, error) {
19697	const APIVersion = "6.0"
19698	queryParameters := map[string]interface{}{
19699		"api-version": APIVersion,
19700	}
19701	if timeout != nil {
19702		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19703	} else {
19704		queryParameters["timeout"] = autorest.Encode("query", 60)
19705	}
19706
19707	preparer := autorest.CreatePreparer(
19708		autorest.AsContentType("application/json; charset=utf-8"),
19709		autorest.AsPost(),
19710		autorest.WithBaseURL(client.BaseURI),
19711		autorest.WithPath("/$/UpdateUpgrade"),
19712		autorest.WithJSON(updateClusterUpgradeDescription),
19713		autorest.WithQueryParameters(queryParameters))
19714	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19715}
19716
19717// UpdateClusterUpgradeSender sends the UpdateClusterUpgrade request. The method will close the
19718// http.Response Body if it receives an error.
19719func (client BaseClient) UpdateClusterUpgradeSender(req *http.Request) (*http.Response, error) {
19720	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19721}
19722
19723// UpdateClusterUpgradeResponder handles the response to the UpdateClusterUpgrade request. The method always
19724// closes the http.Response Body.
19725func (client BaseClient) UpdateClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
19726	err = autorest.Respond(
19727		resp,
19728		client.ByInspecting(),
19729		azure.WithErrorUnlessStatusCode(http.StatusOK),
19730		autorest.ByClosing())
19731	result.Response = resp
19732	return
19733}
19734
19735// UpdateRepairExecutionState this API supports the Service Fabric platform; it is not meant to be used directly from
19736// your code.
19737// Parameters:
19738// repairTask - describes the repair task to be created or updated.
19739func (client BaseClient) UpdateRepairExecutionState(ctx context.Context, repairTask RepairTask) (result RepairTaskUpdateInfo, err error) {
19740	if tracing.IsEnabled() {
19741		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateRepairExecutionState")
19742		defer func() {
19743			sc := -1
19744			if result.Response.Response != nil {
19745				sc = result.Response.Response.StatusCode
19746			}
19747			tracing.EndSpan(ctx, sc, err)
19748		}()
19749	}
19750	if err := validation.Validate([]validation.Validation{
19751		{TargetValue: repairTask,
19752			Constraints: []validation.Constraint{{Target: "repairTask.TaskID", Name: validation.Null, Rule: true, Chain: nil},
19753				{Target: "repairTask.Action", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
19754		return result, validation.NewError("servicefabric.BaseClient", "UpdateRepairExecutionState", err.Error())
19755	}
19756
19757	req, err := client.UpdateRepairExecutionStatePreparer(ctx, repairTask)
19758	if err != nil {
19759		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", nil, "Failure preparing request")
19760		return
19761	}
19762
19763	resp, err := client.UpdateRepairExecutionStateSender(req)
19764	if err != nil {
19765		result.Response = autorest.Response{Response: resp}
19766		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", resp, "Failure sending request")
19767		return
19768	}
19769
19770	result, err = client.UpdateRepairExecutionStateResponder(resp)
19771	if err != nil {
19772		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", resp, "Failure responding to request")
19773	}
19774
19775	return
19776}
19777
19778// UpdateRepairExecutionStatePreparer prepares the UpdateRepairExecutionState request.
19779func (client BaseClient) UpdateRepairExecutionStatePreparer(ctx context.Context, repairTask RepairTask) (*http.Request, error) {
19780	const APIVersion = "6.0"
19781	queryParameters := map[string]interface{}{
19782		"api-version": APIVersion,
19783	}
19784
19785	preparer := autorest.CreatePreparer(
19786		autorest.AsContentType("application/json; charset=utf-8"),
19787		autorest.AsPost(),
19788		autorest.WithBaseURL(client.BaseURI),
19789		autorest.WithPath("/$/UpdateRepairExecutionState"),
19790		autorest.WithJSON(repairTask),
19791		autorest.WithQueryParameters(queryParameters))
19792	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19793}
19794
19795// UpdateRepairExecutionStateSender sends the UpdateRepairExecutionState request. The method will close the
19796// http.Response Body if it receives an error.
19797func (client BaseClient) UpdateRepairExecutionStateSender(req *http.Request) (*http.Response, error) {
19798	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19799}
19800
19801// UpdateRepairExecutionStateResponder handles the response to the UpdateRepairExecutionState request. The method always
19802// closes the http.Response Body.
19803func (client BaseClient) UpdateRepairExecutionStateResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
19804	err = autorest.Respond(
19805		resp,
19806		client.ByInspecting(),
19807		azure.WithErrorUnlessStatusCode(http.StatusOK),
19808		autorest.ByUnmarshallingJSON(&result),
19809		autorest.ByClosing())
19810	result.Response = autorest.Response{Response: resp}
19811	return
19812}
19813
19814// UpdateRepairTaskHealthPolicy this API supports the Service Fabric platform; it is not meant to be used directly from
19815// your code.
19816// Parameters:
19817// repairTaskUpdateHealthPolicyDescription - describes the repair task healthy policy to be updated.
19818func (client BaseClient) UpdateRepairTaskHealthPolicy(ctx context.Context, repairTaskUpdateHealthPolicyDescription RepairTaskUpdateHealthPolicyDescription) (result RepairTaskUpdateInfo, err error) {
19819	if tracing.IsEnabled() {
19820		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateRepairTaskHealthPolicy")
19821		defer func() {
19822			sc := -1
19823			if result.Response.Response != nil {
19824				sc = result.Response.Response.StatusCode
19825			}
19826			tracing.EndSpan(ctx, sc, err)
19827		}()
19828	}
19829	if err := validation.Validate([]validation.Validation{
19830		{TargetValue: repairTaskUpdateHealthPolicyDescription,
19831			Constraints: []validation.Constraint{{Target: "repairTaskUpdateHealthPolicyDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
19832		return result, validation.NewError("servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", err.Error())
19833	}
19834
19835	req, err := client.UpdateRepairTaskHealthPolicyPreparer(ctx, repairTaskUpdateHealthPolicyDescription)
19836	if err != nil {
19837		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", nil, "Failure preparing request")
19838		return
19839	}
19840
19841	resp, err := client.UpdateRepairTaskHealthPolicySender(req)
19842	if err != nil {
19843		result.Response = autorest.Response{Response: resp}
19844		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", resp, "Failure sending request")
19845		return
19846	}
19847
19848	result, err = client.UpdateRepairTaskHealthPolicyResponder(resp)
19849	if err != nil {
19850		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", resp, "Failure responding to request")
19851	}
19852
19853	return
19854}
19855
19856// UpdateRepairTaskHealthPolicyPreparer prepares the UpdateRepairTaskHealthPolicy request.
19857func (client BaseClient) UpdateRepairTaskHealthPolicyPreparer(ctx context.Context, repairTaskUpdateHealthPolicyDescription RepairTaskUpdateHealthPolicyDescription) (*http.Request, error) {
19858	const APIVersion = "6.0"
19859	queryParameters := map[string]interface{}{
19860		"api-version": APIVersion,
19861	}
19862
19863	preparer := autorest.CreatePreparer(
19864		autorest.AsContentType("application/json; charset=utf-8"),
19865		autorest.AsPost(),
19866		autorest.WithBaseURL(client.BaseURI),
19867		autorest.WithPath("/$/UpdateRepairTaskHealthPolicy"),
19868		autorest.WithJSON(repairTaskUpdateHealthPolicyDescription),
19869		autorest.WithQueryParameters(queryParameters))
19870	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19871}
19872
19873// UpdateRepairTaskHealthPolicySender sends the UpdateRepairTaskHealthPolicy request. The method will close the
19874// http.Response Body if it receives an error.
19875func (client BaseClient) UpdateRepairTaskHealthPolicySender(req *http.Request) (*http.Response, error) {
19876	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19877}
19878
19879// UpdateRepairTaskHealthPolicyResponder handles the response to the UpdateRepairTaskHealthPolicy request. The method always
19880// closes the http.Response Body.
19881func (client BaseClient) UpdateRepairTaskHealthPolicyResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) {
19882	err = autorest.Respond(
19883		resp,
19884		client.ByInspecting(),
19885		azure.WithErrorUnlessStatusCode(http.StatusOK),
19886		autorest.ByUnmarshallingJSON(&result),
19887		autorest.ByClosing())
19888	result.Response = autorest.Response{Response: resp}
19889	return
19890}
19891
19892// UpdateService this API allows updating properties of a running Service Fabric service. The set of properties that
19893// can be updated are a subset of the properties that were specified at the time of creating the service. The current
19894// set of properties can be obtained using `GetServiceDescription` API. Please note that updating the properties of a
19895// running service is different than upgrading your application using `StartApplicationUpgrade` API. The upgrade is a
19896// long running background operation that involves moving the application from one version to another, one upgrade
19897// domain at a time, whereas update applies the new properties immediately to the service.
19898// Parameters:
19899// serviceID - the identity of the service. This is typically the full name of the service without the
19900// 'fabric:' URI scheme.
19901// Starting from version 6.0, hierarchical names are delimited with the "~" character.
19902// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be
19903// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
19904// serviceUpdateDescription - the information necessary to update a service.
19905// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
19906// duration that the client is willing to wait for the requested operation to complete. The default value for
19907// this parameter is 60 seconds.
19908func (client BaseClient) UpdateService(ctx context.Context, serviceID string, serviceUpdateDescription BasicServiceUpdateDescription, timeout *int64) (result autorest.Response, err error) {
19909	if tracing.IsEnabled() {
19910		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateService")
19911		defer func() {
19912			sc := -1
19913			if result.Response != nil {
19914				sc = result.Response.StatusCode
19915			}
19916			tracing.EndSpan(ctx, sc, err)
19917		}()
19918	}
19919	if err := validation.Validate([]validation.Validation{
19920		{TargetValue: timeout,
19921			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
19922				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
19923					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
19924				}}}}}); err != nil {
19925		return result, validation.NewError("servicefabric.BaseClient", "UpdateService", err.Error())
19926	}
19927
19928	req, err := client.UpdateServicePreparer(ctx, serviceID, serviceUpdateDescription, timeout)
19929	if err != nil {
19930		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", nil, "Failure preparing request")
19931		return
19932	}
19933
19934	resp, err := client.UpdateServiceSender(req)
19935	if err != nil {
19936		result.Response = resp
19937		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", resp, "Failure sending request")
19938		return
19939	}
19940
19941	result, err = client.UpdateServiceResponder(resp)
19942	if err != nil {
19943		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", resp, "Failure responding to request")
19944	}
19945
19946	return
19947}
19948
19949// UpdateServicePreparer prepares the UpdateService request.
19950func (client BaseClient) UpdateServicePreparer(ctx context.Context, serviceID string, serviceUpdateDescription BasicServiceUpdateDescription, timeout *int64) (*http.Request, error) {
19951	pathParameters := map[string]interface{}{
19952		"serviceId": serviceID,
19953	}
19954
19955	const APIVersion = "6.0"
19956	queryParameters := map[string]interface{}{
19957		"api-version": APIVersion,
19958	}
19959	if timeout != nil {
19960		queryParameters["timeout"] = autorest.Encode("query", *timeout)
19961	} else {
19962		queryParameters["timeout"] = autorest.Encode("query", 60)
19963	}
19964
19965	preparer := autorest.CreatePreparer(
19966		autorest.AsContentType("application/json; charset=utf-8"),
19967		autorest.AsPost(),
19968		autorest.WithBaseURL(client.BaseURI),
19969		autorest.WithPathParameters("/Services/{serviceId}/$/Update", pathParameters),
19970		autorest.WithJSON(serviceUpdateDescription),
19971		autorest.WithQueryParameters(queryParameters))
19972	return preparer.Prepare((&http.Request{}).WithContext(ctx))
19973}
19974
19975// UpdateServiceSender sends the UpdateService request. The method will close the
19976// http.Response Body if it receives an error.
19977func (client BaseClient) UpdateServiceSender(req *http.Request) (*http.Response, error) {
19978	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19979}
19980
19981// UpdateServiceResponder handles the response to the UpdateService request. The method always
19982// closes the http.Response Body.
19983func (client BaseClient) UpdateServiceResponder(resp *http.Response) (result autorest.Response, err error) {
19984	err = autorest.Respond(
19985		resp,
19986		client.ByInspecting(),
19987		azure.WithErrorUnlessStatusCode(http.StatusOK),
19988		autorest.ByClosing())
19989	result.Response = resp
19990	return
19991}
19992
19993// UploadFile uploads contents of the file to the image store. Use this API if the file is small enough to upload again
19994// if the connection fails. The file's data needs to be added to the request body. The contents will be uploaded to the
19995// specified path. Image store service uses a mark file to indicate the availability of the folder. The mark file is an
19996// empty file named "_.dir". The mark file is generated by the image store service when all files in a folder are
19997// uploaded. When using File-by-File approach to upload application package in REST, the image store service isn't
19998// aware of the file hierarchy of the application package; you need to create a mark file per folder and upload it
19999// last, to let the image store service know that the folder is complete.
20000// Parameters:
20001// contentPath - relative path to file or folder in the image store from its root.
20002// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
20003// duration that the client is willing to wait for the requested operation to complete. The default value for
20004// this parameter is 60 seconds.
20005func (client BaseClient) UploadFile(ctx context.Context, contentPath string, timeout *int64) (result autorest.Response, err error) {
20006	if tracing.IsEnabled() {
20007		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UploadFile")
20008		defer func() {
20009			sc := -1
20010			if result.Response != nil {
20011				sc = result.Response.StatusCode
20012			}
20013			tracing.EndSpan(ctx, sc, err)
20014		}()
20015	}
20016	if err := validation.Validate([]validation.Validation{
20017		{TargetValue: timeout,
20018			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
20019				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
20020					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
20021				}}}}}); err != nil {
20022		return result, validation.NewError("servicefabric.BaseClient", "UploadFile", err.Error())
20023	}
20024
20025	req, err := client.UploadFilePreparer(ctx, contentPath, timeout)
20026	if err != nil {
20027		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", nil, "Failure preparing request")
20028		return
20029	}
20030
20031	resp, err := client.UploadFileSender(req)
20032	if err != nil {
20033		result.Response = resp
20034		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", resp, "Failure sending request")
20035		return
20036	}
20037
20038	result, err = client.UploadFileResponder(resp)
20039	if err != nil {
20040		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", resp, "Failure responding to request")
20041	}
20042
20043	return
20044}
20045
20046// UploadFilePreparer prepares the UploadFile request.
20047func (client BaseClient) UploadFilePreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) {
20048	pathParameters := map[string]interface{}{
20049		"contentPath": autorest.Encode("path", contentPath),
20050	}
20051
20052	const APIVersion = "6.0"
20053	queryParameters := map[string]interface{}{
20054		"api-version": APIVersion,
20055	}
20056	if timeout != nil {
20057		queryParameters["timeout"] = autorest.Encode("query", *timeout)
20058	} else {
20059		queryParameters["timeout"] = autorest.Encode("query", 60)
20060	}
20061
20062	preparer := autorest.CreatePreparer(
20063		autorest.AsPut(),
20064		autorest.WithBaseURL(client.BaseURI),
20065		autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters),
20066		autorest.WithQueryParameters(queryParameters))
20067	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20068}
20069
20070// UploadFileSender sends the UploadFile request. The method will close the
20071// http.Response Body if it receives an error.
20072func (client BaseClient) UploadFileSender(req *http.Request) (*http.Response, error) {
20073	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20074}
20075
20076// UploadFileResponder handles the response to the UploadFile request. The method always
20077// closes the http.Response Body.
20078func (client BaseClient) UploadFileResponder(resp *http.Response) (result autorest.Response, err error) {
20079	err = autorest.Respond(
20080		resp,
20081		client.ByInspecting(),
20082		azure.WithErrorUnlessStatusCode(http.StatusOK),
20083		autorest.ByClosing())
20084	result.Response = resp
20085	return
20086}
20087
20088// UploadFileChunk uploads a file chunk to the image store with the specified upload session ID and image store
20089// relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file
20090// upload from scratch whenever there is a network interruption. Use this option if the file size is large.
20091//
20092// To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the
20093// image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store
20094// relative path already exists, it will be overwritten when the upload session commits.
20095// Parameters:
20096// contentPath - relative path to file or folder in the image store from its root.
20097// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session
20098// which keeps track of all file chunks until it is committed.
20099// contentRange - when uploading file chunks to the image store, the Content-Range header field need to be
20100// configured and sent with a request. The format should looks like "bytes
20101// {First-Byte-Position}-{Last-Byte-Position}/{File-Length}". For example, Content-Range:bytes 300-5000/20000
20102// indicates that user is sending bytes 300 through 5,000 and the total file length is 20,000 bytes.
20103// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time
20104// duration that the client is willing to wait for the requested operation to complete. The default value for
20105// this parameter is 60 seconds.
20106func (client BaseClient) UploadFileChunk(ctx context.Context, contentPath string, sessionID uuid.UUID, contentRange string, timeout *int64) (result autorest.Response, err error) {
20107	if tracing.IsEnabled() {
20108		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UploadFileChunk")
20109		defer func() {
20110			sc := -1
20111			if result.Response != nil {
20112				sc = result.Response.StatusCode
20113			}
20114			tracing.EndSpan(ctx, sc, err)
20115		}()
20116	}
20117	if err := validation.Validate([]validation.Validation{
20118		{TargetValue: timeout,
20119			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
20120				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
20121					{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
20122				}}}}}); err != nil {
20123		return result, validation.NewError("servicefabric.BaseClient", "UploadFileChunk", err.Error())
20124	}
20125
20126	req, err := client.UploadFileChunkPreparer(ctx, contentPath, sessionID, contentRange, timeout)
20127	if err != nil {
20128		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", nil, "Failure preparing request")
20129		return
20130	}
20131
20132	resp, err := client.UploadFileChunkSender(req)
20133	if err != nil {
20134		result.Response = resp
20135		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", resp, "Failure sending request")
20136		return
20137	}
20138
20139	result, err = client.UploadFileChunkResponder(resp)
20140	if err != nil {
20141		err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", resp, "Failure responding to request")
20142	}
20143
20144	return
20145}
20146
20147// UploadFileChunkPreparer prepares the UploadFileChunk request.
20148func (client BaseClient) UploadFileChunkPreparer(ctx context.Context, contentPath string, sessionID uuid.UUID, contentRange string, timeout *int64) (*http.Request, error) {
20149	pathParameters := map[string]interface{}{
20150		"contentPath": autorest.Encode("path", contentPath),
20151	}
20152
20153	const APIVersion = "6.0"
20154	queryParameters := map[string]interface{}{
20155		"api-version": APIVersion,
20156		"session-id":  autorest.Encode("query", sessionID),
20157	}
20158	if timeout != nil {
20159		queryParameters["timeout"] = autorest.Encode("query", *timeout)
20160	} else {
20161		queryParameters["timeout"] = autorest.Encode("query", 60)
20162	}
20163
20164	preparer := autorest.CreatePreparer(
20165		autorest.AsPut(),
20166		autorest.WithBaseURL(client.BaseURI),
20167		autorest.WithPathParameters("/ImageStore/{contentPath}/$/UploadChunk", pathParameters),
20168		autorest.WithQueryParameters(queryParameters),
20169		autorest.WithHeader("Content-Range", autorest.String(contentRange)))
20170	return preparer.Prepare((&http.Request{}).WithContext(ctx))
20171}
20172
20173// UploadFileChunkSender sends the UploadFileChunk request. The method will close the
20174// http.Response Body if it receives an error.
20175func (client BaseClient) UploadFileChunkSender(req *http.Request) (*http.Response, error) {
20176	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20177}
20178
20179// UploadFileChunkResponder handles the response to the UploadFileChunk request. The method always
20180// closes the http.Response Body.
20181func (client BaseClient) UploadFileChunkResponder(resp *http.Response) (result autorest.Response, err error) {
20182	err = autorest.Respond(
20183		resp,
20184		client.ByInspecting(),
20185		azure.WithErrorUnlessStatusCode(http.StatusOK),
20186		autorest.ByClosing())
20187	result.Response = resp
20188	return
20189}
20190