1// Package keyvault implements the Azure ARM Keyvault service API version 2016-10-01.
2//
3// The key vault client performs cryptographic key operations and vault operations against the Key Vault service.
4package keyvault
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/validation"
28	"github.com/Azure/go-autorest/tracing"
29	"net/http"
30)
31
32// BaseClient is the base client for Keyvault.
33type BaseClient struct {
34	autorest.Client
35}
36
37// New creates an instance of the BaseClient client.
38func New() BaseClient {
39	return NewWithoutDefaults()
40}
41
42// NewWithoutDefaults creates an instance of the BaseClient client.
43func NewWithoutDefaults() BaseClient {
44	return BaseClient{
45		Client: autorest.NewClientWithUserAgent(UserAgent()),
46	}
47}
48
49// BackupKey the Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation
50// does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key
51// material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is
52// to allow a client to GENERATE a key in one Azure Key Vault instance, BACKUP the key, and then RESTORE it into
53// another Azure Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from
54// Azure Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within
55// geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another
56// geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical
57// area. This operation requires the key/backup permission.
58// Parameters:
59// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
60// keyName - the name of the key.
61func (client BaseClient) BackupKey(ctx context.Context, vaultBaseURL string, keyName string) (result BackupKeyResult, err error) {
62	if tracing.IsEnabled() {
63		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.BackupKey")
64		defer func() {
65			sc := -1
66			if result.Response.Response != nil {
67				sc = result.Response.Response.StatusCode
68			}
69			tracing.EndSpan(ctx, sc, err)
70		}()
71	}
72	req, err := client.BackupKeyPreparer(ctx, vaultBaseURL, keyName)
73	if err != nil {
74		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupKey", nil, "Failure preparing request")
75		return
76	}
77
78	resp, err := client.BackupKeySender(req)
79	if err != nil {
80		result.Response = autorest.Response{Response: resp}
81		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupKey", resp, "Failure sending request")
82		return
83	}
84
85	result, err = client.BackupKeyResponder(resp)
86	if err != nil {
87		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupKey", resp, "Failure responding to request")
88	}
89
90	return
91}
92
93// BackupKeyPreparer prepares the BackupKey request.
94func (client BaseClient) BackupKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string) (*http.Request, error) {
95	urlParameters := map[string]interface{}{
96		"vaultBaseUrl": vaultBaseURL,
97	}
98
99	pathParameters := map[string]interface{}{
100		"key-name": autorest.Encode("path", keyName),
101	}
102
103	const APIVersion = "2016-10-01"
104	queryParameters := map[string]interface{}{
105		"api-version": APIVersion,
106	}
107
108	preparer := autorest.CreatePreparer(
109		autorest.AsPost(),
110		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
111		autorest.WithPathParameters("/keys/{key-name}/backup", pathParameters),
112		autorest.WithQueryParameters(queryParameters))
113	return preparer.Prepare((&http.Request{}).WithContext(ctx))
114}
115
116// BackupKeySender sends the BackupKey request. The method will close the
117// http.Response Body if it receives an error.
118func (client BaseClient) BackupKeySender(req *http.Request) (*http.Response, error) {
119	return autorest.SendWithSender(client, req,
120		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
121}
122
123// BackupKeyResponder handles the response to the BackupKey request. The method always
124// closes the http.Response Body.
125func (client BaseClient) BackupKeyResponder(resp *http.Response) (result BackupKeyResult, err error) {
126	err = autorest.Respond(
127		resp,
128		client.ByInspecting(),
129		azure.WithErrorUnlessStatusCode(http.StatusOK),
130		autorest.ByUnmarshallingJSON(&result),
131		autorest.ByClosing())
132	result.Response = autorest.Response{Response: resp}
133	return
134}
135
136// BackupSecret requests that a backup of the specified secret be downloaded to the client. All versions of the secret
137// will be downloaded. This operation requires the secrets/backup permission.
138// Parameters:
139// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
140// secretName - the name of the secret.
141func (client BaseClient) BackupSecret(ctx context.Context, vaultBaseURL string, secretName string) (result BackupSecretResult, err error) {
142	if tracing.IsEnabled() {
143		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.BackupSecret")
144		defer func() {
145			sc := -1
146			if result.Response.Response != nil {
147				sc = result.Response.Response.StatusCode
148			}
149			tracing.EndSpan(ctx, sc, err)
150		}()
151	}
152	req, err := client.BackupSecretPreparer(ctx, vaultBaseURL, secretName)
153	if err != nil {
154		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupSecret", nil, "Failure preparing request")
155		return
156	}
157
158	resp, err := client.BackupSecretSender(req)
159	if err != nil {
160		result.Response = autorest.Response{Response: resp}
161		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupSecret", resp, "Failure sending request")
162		return
163	}
164
165	result, err = client.BackupSecretResponder(resp)
166	if err != nil {
167		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "BackupSecret", resp, "Failure responding to request")
168	}
169
170	return
171}
172
173// BackupSecretPreparer prepares the BackupSecret request.
174func (client BaseClient) BackupSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string) (*http.Request, error) {
175	urlParameters := map[string]interface{}{
176		"vaultBaseUrl": vaultBaseURL,
177	}
178
179	pathParameters := map[string]interface{}{
180		"secret-name": autorest.Encode("path", secretName),
181	}
182
183	const APIVersion = "2016-10-01"
184	queryParameters := map[string]interface{}{
185		"api-version": APIVersion,
186	}
187
188	preparer := autorest.CreatePreparer(
189		autorest.AsPost(),
190		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
191		autorest.WithPathParameters("/secrets/{secret-name}/backup", pathParameters),
192		autorest.WithQueryParameters(queryParameters))
193	return preparer.Prepare((&http.Request{}).WithContext(ctx))
194}
195
196// BackupSecretSender sends the BackupSecret request. The method will close the
197// http.Response Body if it receives an error.
198func (client BaseClient) BackupSecretSender(req *http.Request) (*http.Response, error) {
199	return autorest.SendWithSender(client, req,
200		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
201}
202
203// BackupSecretResponder handles the response to the BackupSecret request. The method always
204// closes the http.Response Body.
205func (client BaseClient) BackupSecretResponder(resp *http.Response) (result BackupSecretResult, err error) {
206	err = autorest.Respond(
207		resp,
208		client.ByInspecting(),
209		azure.WithErrorUnlessStatusCode(http.StatusOK),
210		autorest.ByUnmarshallingJSON(&result),
211		autorest.ByClosing())
212	result.Response = autorest.Response{Response: resp}
213	return
214}
215
216// CreateCertificate if this is the first version, the certificate resource is created. This operation requires the
217// certificates/create permission.
218// Parameters:
219// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
220// certificateName - the name of the certificate.
221// parameters - the parameters to create a certificate.
222func (client BaseClient) CreateCertificate(ctx context.Context, vaultBaseURL string, certificateName string, parameters CertificateCreateParameters) (result CertificateOperation, err error) {
223	if tracing.IsEnabled() {
224		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateCertificate")
225		defer func() {
226			sc := -1
227			if result.Response.Response != nil {
228				sc = result.Response.Response.StatusCode
229			}
230			tracing.EndSpan(ctx, sc, err)
231		}()
232	}
233	if err := validation.Validate([]validation.Validation{
234		{TargetValue: certificateName,
235			Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z-]+$`, Chain: nil}}},
236		{TargetValue: parameters,
237			Constraints: []validation.Constraint{{Target: "parameters.CertificatePolicy", Name: validation.Null, Rule: false,
238				Chain: []validation.Constraint{{Target: "parameters.CertificatePolicy.X509CertificateProperties", Name: validation.Null, Rule: false,
239					Chain: []validation.Constraint{{Target: "parameters.CertificatePolicy.X509CertificateProperties.ValidityInMonths", Name: validation.Null, Rule: false,
240						Chain: []validation.Constraint{{Target: "parameters.CertificatePolicy.X509CertificateProperties.ValidityInMonths", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}},
241					}},
242				}}}}}); err != nil {
243		return result, validation.NewError("keyvault.BaseClient", "CreateCertificate", err.Error())
244	}
245
246	req, err := client.CreateCertificatePreparer(ctx, vaultBaseURL, certificateName, parameters)
247	if err != nil {
248		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "CreateCertificate", nil, "Failure preparing request")
249		return
250	}
251
252	resp, err := client.CreateCertificateSender(req)
253	if err != nil {
254		result.Response = autorest.Response{Response: resp}
255		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "CreateCertificate", resp, "Failure sending request")
256		return
257	}
258
259	result, err = client.CreateCertificateResponder(resp)
260	if err != nil {
261		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "CreateCertificate", resp, "Failure responding to request")
262	}
263
264	return
265}
266
267// CreateCertificatePreparer prepares the CreateCertificate request.
268func (client BaseClient) CreateCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string, parameters CertificateCreateParameters) (*http.Request, error) {
269	urlParameters := map[string]interface{}{
270		"vaultBaseUrl": vaultBaseURL,
271	}
272
273	pathParameters := map[string]interface{}{
274		"certificate-name": autorest.Encode("path", certificateName),
275	}
276
277	const APIVersion = "2016-10-01"
278	queryParameters := map[string]interface{}{
279		"api-version": APIVersion,
280	}
281
282	preparer := autorest.CreatePreparer(
283		autorest.AsContentType("application/json; charset=utf-8"),
284		autorest.AsPost(),
285		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
286		autorest.WithPathParameters("/certificates/{certificate-name}/create", pathParameters),
287		autorest.WithJSON(parameters),
288		autorest.WithQueryParameters(queryParameters))
289	return preparer.Prepare((&http.Request{}).WithContext(ctx))
290}
291
292// CreateCertificateSender sends the CreateCertificate request. The method will close the
293// http.Response Body if it receives an error.
294func (client BaseClient) CreateCertificateSender(req *http.Request) (*http.Response, error) {
295	return autorest.SendWithSender(client, req,
296		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
297}
298
299// CreateCertificateResponder handles the response to the CreateCertificate request. The method always
300// closes the http.Response Body.
301func (client BaseClient) CreateCertificateResponder(resp *http.Response) (result CertificateOperation, err error) {
302	err = autorest.Respond(
303		resp,
304		client.ByInspecting(),
305		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
306		autorest.ByUnmarshallingJSON(&result),
307		autorest.ByClosing())
308	result.Response = autorest.Response{Response: resp}
309	return
310}
311
312// CreateKey the create key operation can be used to create any key type in Azure Key Vault. If the named key already
313// exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission.
314// Parameters:
315// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
316// keyName - the name for the new key. The system will generate the version name for the new key.
317// parameters - the parameters to create a key.
318func (client BaseClient) CreateKey(ctx context.Context, vaultBaseURL string, keyName string, parameters KeyCreateParameters) (result KeyBundle, err error) {
319	if tracing.IsEnabled() {
320		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateKey")
321		defer func() {
322			sc := -1
323			if result.Response.Response != nil {
324				sc = result.Response.Response.StatusCode
325			}
326			tracing.EndSpan(ctx, sc, err)
327		}()
328	}
329	if err := validation.Validate([]validation.Validation{
330		{TargetValue: keyName,
331			Constraints: []validation.Constraint{{Target: "keyName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z-]+$`, Chain: nil}}}}); err != nil {
332		return result, validation.NewError("keyvault.BaseClient", "CreateKey", err.Error())
333	}
334
335	req, err := client.CreateKeyPreparer(ctx, vaultBaseURL, keyName, parameters)
336	if err != nil {
337		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "CreateKey", nil, "Failure preparing request")
338		return
339	}
340
341	resp, err := client.CreateKeySender(req)
342	if err != nil {
343		result.Response = autorest.Response{Response: resp}
344		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "CreateKey", resp, "Failure sending request")
345		return
346	}
347
348	result, err = client.CreateKeyResponder(resp)
349	if err != nil {
350		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "CreateKey", resp, "Failure responding to request")
351	}
352
353	return
354}
355
356// CreateKeyPreparer prepares the CreateKey request.
357func (client BaseClient) CreateKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string, parameters KeyCreateParameters) (*http.Request, error) {
358	urlParameters := map[string]interface{}{
359		"vaultBaseUrl": vaultBaseURL,
360	}
361
362	pathParameters := map[string]interface{}{
363		"key-name": autorest.Encode("path", keyName),
364	}
365
366	const APIVersion = "2016-10-01"
367	queryParameters := map[string]interface{}{
368		"api-version": APIVersion,
369	}
370
371	preparer := autorest.CreatePreparer(
372		autorest.AsContentType("application/json; charset=utf-8"),
373		autorest.AsPost(),
374		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
375		autorest.WithPathParameters("/keys/{key-name}/create", pathParameters),
376		autorest.WithJSON(parameters),
377		autorest.WithQueryParameters(queryParameters))
378	return preparer.Prepare((&http.Request{}).WithContext(ctx))
379}
380
381// CreateKeySender sends the CreateKey request. The method will close the
382// http.Response Body if it receives an error.
383func (client BaseClient) CreateKeySender(req *http.Request) (*http.Response, error) {
384	return autorest.SendWithSender(client, req,
385		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
386}
387
388// CreateKeyResponder handles the response to the CreateKey request. The method always
389// closes the http.Response Body.
390func (client BaseClient) CreateKeyResponder(resp *http.Response) (result KeyBundle, err error) {
391	err = autorest.Respond(
392		resp,
393		client.ByInspecting(),
394		azure.WithErrorUnlessStatusCode(http.StatusOK),
395		autorest.ByUnmarshallingJSON(&result),
396		autorest.ByClosing())
397	result.Response = autorest.Response{Response: resp}
398	return
399}
400
401// Decrypt the DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and
402// specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be
403// decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation
404// applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key.
405// This operation requires the keys/decrypt permission.
406// Parameters:
407// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
408// keyName - the name of the key.
409// keyVersion - the version of the key.
410// parameters - the parameters for the decryption operation.
411func (client BaseClient) Decrypt(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (result KeyOperationResult, err error) {
412	if tracing.IsEnabled() {
413		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.Decrypt")
414		defer func() {
415			sc := -1
416			if result.Response.Response != nil {
417				sc = result.Response.Response.StatusCode
418			}
419			tracing.EndSpan(ctx, sc, err)
420		}()
421	}
422	if err := validation.Validate([]validation.Validation{
423		{TargetValue: parameters,
424			Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
425		return result, validation.NewError("keyvault.BaseClient", "Decrypt", err.Error())
426	}
427
428	req, err := client.DecryptPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters)
429	if err != nil {
430		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Decrypt", nil, "Failure preparing request")
431		return
432	}
433
434	resp, err := client.DecryptSender(req)
435	if err != nil {
436		result.Response = autorest.Response{Response: resp}
437		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Decrypt", resp, "Failure sending request")
438		return
439	}
440
441	result, err = client.DecryptResponder(resp)
442	if err != nil {
443		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Decrypt", resp, "Failure responding to request")
444	}
445
446	return
447}
448
449// DecryptPreparer prepares the Decrypt request.
450func (client BaseClient) DecryptPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (*http.Request, error) {
451	urlParameters := map[string]interface{}{
452		"vaultBaseUrl": vaultBaseURL,
453	}
454
455	pathParameters := map[string]interface{}{
456		"key-name":    autorest.Encode("path", keyName),
457		"key-version": autorest.Encode("path", keyVersion),
458	}
459
460	const APIVersion = "2016-10-01"
461	queryParameters := map[string]interface{}{
462		"api-version": APIVersion,
463	}
464
465	preparer := autorest.CreatePreparer(
466		autorest.AsContentType("application/json; charset=utf-8"),
467		autorest.AsPost(),
468		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
469		autorest.WithPathParameters("/keys/{key-name}/{key-version}/decrypt", pathParameters),
470		autorest.WithJSON(parameters),
471		autorest.WithQueryParameters(queryParameters))
472	return preparer.Prepare((&http.Request{}).WithContext(ctx))
473}
474
475// DecryptSender sends the Decrypt request. The method will close the
476// http.Response Body if it receives an error.
477func (client BaseClient) DecryptSender(req *http.Request) (*http.Response, error) {
478	return autorest.SendWithSender(client, req,
479		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
480}
481
482// DecryptResponder handles the response to the Decrypt request. The method always
483// closes the http.Response Body.
484func (client BaseClient) DecryptResponder(resp *http.Response) (result KeyOperationResult, err error) {
485	err = autorest.Respond(
486		resp,
487		client.ByInspecting(),
488		azure.WithErrorUnlessStatusCode(http.StatusOK),
489		autorest.ByUnmarshallingJSON(&result),
490		autorest.ByClosing())
491	result.Response = autorest.Response{Response: resp}
492	return
493}
494
495// DeleteCertificate deletes all versions of a certificate object along with its associated policy. Delete certificate
496// cannot be used to remove individual versions of a certificate object. This operation requires the
497// certificates/delete permission.
498// Parameters:
499// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
500// certificateName - the name of the certificate.
501func (client BaseClient) DeleteCertificate(ctx context.Context, vaultBaseURL string, certificateName string) (result DeletedCertificateBundle, err error) {
502	if tracing.IsEnabled() {
503		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteCertificate")
504		defer func() {
505			sc := -1
506			if result.Response.Response != nil {
507				sc = result.Response.Response.StatusCode
508			}
509			tracing.EndSpan(ctx, sc, err)
510		}()
511	}
512	req, err := client.DeleteCertificatePreparer(ctx, vaultBaseURL, certificateName)
513	if err != nil {
514		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificate", nil, "Failure preparing request")
515		return
516	}
517
518	resp, err := client.DeleteCertificateSender(req)
519	if err != nil {
520		result.Response = autorest.Response{Response: resp}
521		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificate", resp, "Failure sending request")
522		return
523	}
524
525	result, err = client.DeleteCertificateResponder(resp)
526	if err != nil {
527		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificate", resp, "Failure responding to request")
528	}
529
530	return
531}
532
533// DeleteCertificatePreparer prepares the DeleteCertificate request.
534func (client BaseClient) DeleteCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) {
535	urlParameters := map[string]interface{}{
536		"vaultBaseUrl": vaultBaseURL,
537	}
538
539	pathParameters := map[string]interface{}{
540		"certificate-name": autorest.Encode("path", certificateName),
541	}
542
543	const APIVersion = "2016-10-01"
544	queryParameters := map[string]interface{}{
545		"api-version": APIVersion,
546	}
547
548	preparer := autorest.CreatePreparer(
549		autorest.AsDelete(),
550		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
551		autorest.WithPathParameters("/certificates/{certificate-name}", pathParameters),
552		autorest.WithQueryParameters(queryParameters))
553	return preparer.Prepare((&http.Request{}).WithContext(ctx))
554}
555
556// DeleteCertificateSender sends the DeleteCertificate request. The method will close the
557// http.Response Body if it receives an error.
558func (client BaseClient) DeleteCertificateSender(req *http.Request) (*http.Response, error) {
559	return autorest.SendWithSender(client, req,
560		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
561}
562
563// DeleteCertificateResponder handles the response to the DeleteCertificate request. The method always
564// closes the http.Response Body.
565func (client BaseClient) DeleteCertificateResponder(resp *http.Response) (result DeletedCertificateBundle, err error) {
566	err = autorest.Respond(
567		resp,
568		client.ByInspecting(),
569		azure.WithErrorUnlessStatusCode(http.StatusOK),
570		autorest.ByUnmarshallingJSON(&result),
571		autorest.ByClosing())
572	result.Response = autorest.Response{Response: resp}
573	return
574}
575
576// DeleteCertificateContacts deletes the certificate contacts for a specified key vault certificate. This operation
577// requires the certificates/managecontacts permission.
578// Parameters:
579// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
580func (client BaseClient) DeleteCertificateContacts(ctx context.Context, vaultBaseURL string) (result Contacts, err error) {
581	if tracing.IsEnabled() {
582		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteCertificateContacts")
583		defer func() {
584			sc := -1
585			if result.Response.Response != nil {
586				sc = result.Response.Response.StatusCode
587			}
588			tracing.EndSpan(ctx, sc, err)
589		}()
590	}
591	req, err := client.DeleteCertificateContactsPreparer(ctx, vaultBaseURL)
592	if err != nil {
593		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateContacts", nil, "Failure preparing request")
594		return
595	}
596
597	resp, err := client.DeleteCertificateContactsSender(req)
598	if err != nil {
599		result.Response = autorest.Response{Response: resp}
600		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateContacts", resp, "Failure sending request")
601		return
602	}
603
604	result, err = client.DeleteCertificateContactsResponder(resp)
605	if err != nil {
606		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateContacts", resp, "Failure responding to request")
607	}
608
609	return
610}
611
612// DeleteCertificateContactsPreparer prepares the DeleteCertificateContacts request.
613func (client BaseClient) DeleteCertificateContactsPreparer(ctx context.Context, vaultBaseURL string) (*http.Request, error) {
614	urlParameters := map[string]interface{}{
615		"vaultBaseUrl": vaultBaseURL,
616	}
617
618	const APIVersion = "2016-10-01"
619	queryParameters := map[string]interface{}{
620		"api-version": APIVersion,
621	}
622
623	preparer := autorest.CreatePreparer(
624		autorest.AsDelete(),
625		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
626		autorest.WithPath("/certificates/contacts"),
627		autorest.WithQueryParameters(queryParameters))
628	return preparer.Prepare((&http.Request{}).WithContext(ctx))
629}
630
631// DeleteCertificateContactsSender sends the DeleteCertificateContacts request. The method will close the
632// http.Response Body if it receives an error.
633func (client BaseClient) DeleteCertificateContactsSender(req *http.Request) (*http.Response, error) {
634	return autorest.SendWithSender(client, req,
635		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
636}
637
638// DeleteCertificateContactsResponder handles the response to the DeleteCertificateContacts request. The method always
639// closes the http.Response Body.
640func (client BaseClient) DeleteCertificateContactsResponder(resp *http.Response) (result Contacts, err error) {
641	err = autorest.Respond(
642		resp,
643		client.ByInspecting(),
644		azure.WithErrorUnlessStatusCode(http.StatusOK),
645		autorest.ByUnmarshallingJSON(&result),
646		autorest.ByClosing())
647	result.Response = autorest.Response{Response: resp}
648	return
649}
650
651// DeleteCertificateIssuer the DeleteCertificateIssuer operation permanently removes the specified certificate issuer
652// from the vault. This operation requires the certificates/manageissuers/deleteissuers permission.
653// Parameters:
654// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
655// issuerName - the name of the issuer.
656func (client BaseClient) DeleteCertificateIssuer(ctx context.Context, vaultBaseURL string, issuerName string) (result IssuerBundle, err error) {
657	if tracing.IsEnabled() {
658		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteCertificateIssuer")
659		defer func() {
660			sc := -1
661			if result.Response.Response != nil {
662				sc = result.Response.Response.StatusCode
663			}
664			tracing.EndSpan(ctx, sc, err)
665		}()
666	}
667	req, err := client.DeleteCertificateIssuerPreparer(ctx, vaultBaseURL, issuerName)
668	if err != nil {
669		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateIssuer", nil, "Failure preparing request")
670		return
671	}
672
673	resp, err := client.DeleteCertificateIssuerSender(req)
674	if err != nil {
675		result.Response = autorest.Response{Response: resp}
676		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateIssuer", resp, "Failure sending request")
677		return
678	}
679
680	result, err = client.DeleteCertificateIssuerResponder(resp)
681	if err != nil {
682		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateIssuer", resp, "Failure responding to request")
683	}
684
685	return
686}
687
688// DeleteCertificateIssuerPreparer prepares the DeleteCertificateIssuer request.
689func (client BaseClient) DeleteCertificateIssuerPreparer(ctx context.Context, vaultBaseURL string, issuerName string) (*http.Request, error) {
690	urlParameters := map[string]interface{}{
691		"vaultBaseUrl": vaultBaseURL,
692	}
693
694	pathParameters := map[string]interface{}{
695		"issuer-name": autorest.Encode("path", issuerName),
696	}
697
698	const APIVersion = "2016-10-01"
699	queryParameters := map[string]interface{}{
700		"api-version": APIVersion,
701	}
702
703	preparer := autorest.CreatePreparer(
704		autorest.AsDelete(),
705		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
706		autorest.WithPathParameters("/certificates/issuers/{issuer-name}", pathParameters),
707		autorest.WithQueryParameters(queryParameters))
708	return preparer.Prepare((&http.Request{}).WithContext(ctx))
709}
710
711// DeleteCertificateIssuerSender sends the DeleteCertificateIssuer request. The method will close the
712// http.Response Body if it receives an error.
713func (client BaseClient) DeleteCertificateIssuerSender(req *http.Request) (*http.Response, error) {
714	return autorest.SendWithSender(client, req,
715		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
716}
717
718// DeleteCertificateIssuerResponder handles the response to the DeleteCertificateIssuer request. The method always
719// closes the http.Response Body.
720func (client BaseClient) DeleteCertificateIssuerResponder(resp *http.Response) (result IssuerBundle, err error) {
721	err = autorest.Respond(
722		resp,
723		client.ByInspecting(),
724		azure.WithErrorUnlessStatusCode(http.StatusOK),
725		autorest.ByUnmarshallingJSON(&result),
726		autorest.ByClosing())
727	result.Response = autorest.Response{Response: resp}
728	return
729}
730
731// DeleteCertificateOperation deletes the creation operation for a specified certificate that is in the process of
732// being created. The certificate is no longer created. This operation requires the certificates/update permission.
733// Parameters:
734// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
735// certificateName - the name of the certificate.
736func (client BaseClient) DeleteCertificateOperation(ctx context.Context, vaultBaseURL string, certificateName string) (result CertificateOperation, err error) {
737	if tracing.IsEnabled() {
738		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteCertificateOperation")
739		defer func() {
740			sc := -1
741			if result.Response.Response != nil {
742				sc = result.Response.Response.StatusCode
743			}
744			tracing.EndSpan(ctx, sc, err)
745		}()
746	}
747	req, err := client.DeleteCertificateOperationPreparer(ctx, vaultBaseURL, certificateName)
748	if err != nil {
749		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateOperation", nil, "Failure preparing request")
750		return
751	}
752
753	resp, err := client.DeleteCertificateOperationSender(req)
754	if err != nil {
755		result.Response = autorest.Response{Response: resp}
756		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateOperation", resp, "Failure sending request")
757		return
758	}
759
760	result, err = client.DeleteCertificateOperationResponder(resp)
761	if err != nil {
762		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteCertificateOperation", resp, "Failure responding to request")
763	}
764
765	return
766}
767
768// DeleteCertificateOperationPreparer prepares the DeleteCertificateOperation request.
769func (client BaseClient) DeleteCertificateOperationPreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) {
770	urlParameters := map[string]interface{}{
771		"vaultBaseUrl": vaultBaseURL,
772	}
773
774	pathParameters := map[string]interface{}{
775		"certificate-name": autorest.Encode("path", certificateName),
776	}
777
778	const APIVersion = "2016-10-01"
779	queryParameters := map[string]interface{}{
780		"api-version": APIVersion,
781	}
782
783	preparer := autorest.CreatePreparer(
784		autorest.AsDelete(),
785		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
786		autorest.WithPathParameters("/certificates/{certificate-name}/pending", pathParameters),
787		autorest.WithQueryParameters(queryParameters))
788	return preparer.Prepare((&http.Request{}).WithContext(ctx))
789}
790
791// DeleteCertificateOperationSender sends the DeleteCertificateOperation request. The method will close the
792// http.Response Body if it receives an error.
793func (client BaseClient) DeleteCertificateOperationSender(req *http.Request) (*http.Response, error) {
794	return autorest.SendWithSender(client, req,
795		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
796}
797
798// DeleteCertificateOperationResponder handles the response to the DeleteCertificateOperation request. The method always
799// closes the http.Response Body.
800func (client BaseClient) DeleteCertificateOperationResponder(resp *http.Response) (result CertificateOperation, err error) {
801	err = autorest.Respond(
802		resp,
803		client.ByInspecting(),
804		azure.WithErrorUnlessStatusCode(http.StatusOK),
805		autorest.ByUnmarshallingJSON(&result),
806		autorest.ByClosing())
807	result.Response = autorest.Response{Response: resp}
808	return
809}
810
811// DeleteKey the delete key operation cannot be used to remove individual versions of a key. This operation removes the
812// cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or
813// Encrypt/Decrypt operations. This operation requires the keys/delete permission.
814// Parameters:
815// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
816// keyName - the name of the key to delete.
817func (client BaseClient) DeleteKey(ctx context.Context, vaultBaseURL string, keyName string) (result DeletedKeyBundle, err error) {
818	if tracing.IsEnabled() {
819		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteKey")
820		defer func() {
821			sc := -1
822			if result.Response.Response != nil {
823				sc = result.Response.Response.StatusCode
824			}
825			tracing.EndSpan(ctx, sc, err)
826		}()
827	}
828	req, err := client.DeleteKeyPreparer(ctx, vaultBaseURL, keyName)
829	if err != nil {
830		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteKey", nil, "Failure preparing request")
831		return
832	}
833
834	resp, err := client.DeleteKeySender(req)
835	if err != nil {
836		result.Response = autorest.Response{Response: resp}
837		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteKey", resp, "Failure sending request")
838		return
839	}
840
841	result, err = client.DeleteKeyResponder(resp)
842	if err != nil {
843		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteKey", resp, "Failure responding to request")
844	}
845
846	return
847}
848
849// DeleteKeyPreparer prepares the DeleteKey request.
850func (client BaseClient) DeleteKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string) (*http.Request, error) {
851	urlParameters := map[string]interface{}{
852		"vaultBaseUrl": vaultBaseURL,
853	}
854
855	pathParameters := map[string]interface{}{
856		"key-name": autorest.Encode("path", keyName),
857	}
858
859	const APIVersion = "2016-10-01"
860	queryParameters := map[string]interface{}{
861		"api-version": APIVersion,
862	}
863
864	preparer := autorest.CreatePreparer(
865		autorest.AsDelete(),
866		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
867		autorest.WithPathParameters("/keys/{key-name}", pathParameters),
868		autorest.WithQueryParameters(queryParameters))
869	return preparer.Prepare((&http.Request{}).WithContext(ctx))
870}
871
872// DeleteKeySender sends the DeleteKey request. The method will close the
873// http.Response Body if it receives an error.
874func (client BaseClient) DeleteKeySender(req *http.Request) (*http.Response, error) {
875	return autorest.SendWithSender(client, req,
876		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
877}
878
879// DeleteKeyResponder handles the response to the DeleteKey request. The method always
880// closes the http.Response Body.
881func (client BaseClient) DeleteKeyResponder(resp *http.Response) (result DeletedKeyBundle, err error) {
882	err = autorest.Respond(
883		resp,
884		client.ByInspecting(),
885		azure.WithErrorUnlessStatusCode(http.StatusOK),
886		autorest.ByUnmarshallingJSON(&result),
887		autorest.ByClosing())
888	result.Response = autorest.Response{Response: resp}
889	return
890}
891
892// DeleteSasDefinition deletes a SAS definition from a specified storage account. This operation requires the
893// storage/deletesas permission.
894// Parameters:
895// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
896// storageAccountName - the name of the storage account.
897// sasDefinitionName - the name of the SAS definition.
898func (client BaseClient) DeleteSasDefinition(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string) (result SasDefinitionBundle, err error) {
899	if tracing.IsEnabled() {
900		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteSasDefinition")
901		defer func() {
902			sc := -1
903			if result.Response.Response != nil {
904				sc = result.Response.Response.StatusCode
905			}
906			tracing.EndSpan(ctx, sc, err)
907		}()
908	}
909	if err := validation.Validate([]validation.Validation{
910		{TargetValue: storageAccountName,
911			Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}},
912		{TargetValue: sasDefinitionName,
913			Constraints: []validation.Constraint{{Target: "sasDefinitionName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil {
914		return result, validation.NewError("keyvault.BaseClient", "DeleteSasDefinition", err.Error())
915	}
916
917	req, err := client.DeleteSasDefinitionPreparer(ctx, vaultBaseURL, storageAccountName, sasDefinitionName)
918	if err != nil {
919		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteSasDefinition", nil, "Failure preparing request")
920		return
921	}
922
923	resp, err := client.DeleteSasDefinitionSender(req)
924	if err != nil {
925		result.Response = autorest.Response{Response: resp}
926		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteSasDefinition", resp, "Failure sending request")
927		return
928	}
929
930	result, err = client.DeleteSasDefinitionResponder(resp)
931	if err != nil {
932		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteSasDefinition", resp, "Failure responding to request")
933	}
934
935	return
936}
937
938// DeleteSasDefinitionPreparer prepares the DeleteSasDefinition request.
939func (client BaseClient) DeleteSasDefinitionPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string) (*http.Request, error) {
940	urlParameters := map[string]interface{}{
941		"vaultBaseUrl": vaultBaseURL,
942	}
943
944	pathParameters := map[string]interface{}{
945		"sas-definition-name":  autorest.Encode("path", sasDefinitionName),
946		"storage-account-name": autorest.Encode("path", storageAccountName),
947	}
948
949	const APIVersion = "2016-10-01"
950	queryParameters := map[string]interface{}{
951		"api-version": APIVersion,
952	}
953
954	preparer := autorest.CreatePreparer(
955		autorest.AsDelete(),
956		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
957		autorest.WithPathParameters("/storage/{storage-account-name}/sas/{sas-definition-name}", pathParameters),
958		autorest.WithQueryParameters(queryParameters))
959	return preparer.Prepare((&http.Request{}).WithContext(ctx))
960}
961
962// DeleteSasDefinitionSender sends the DeleteSasDefinition request. The method will close the
963// http.Response Body if it receives an error.
964func (client BaseClient) DeleteSasDefinitionSender(req *http.Request) (*http.Response, error) {
965	return autorest.SendWithSender(client, req,
966		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
967}
968
969// DeleteSasDefinitionResponder handles the response to the DeleteSasDefinition request. The method always
970// closes the http.Response Body.
971func (client BaseClient) DeleteSasDefinitionResponder(resp *http.Response) (result SasDefinitionBundle, err error) {
972	err = autorest.Respond(
973		resp,
974		client.ByInspecting(),
975		azure.WithErrorUnlessStatusCode(http.StatusOK),
976		autorest.ByUnmarshallingJSON(&result),
977		autorest.ByClosing())
978	result.Response = autorest.Response{Response: resp}
979	return
980}
981
982// DeleteSecret the DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an
983// individual version of a secret. This operation requires the secrets/delete permission.
984// Parameters:
985// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
986// secretName - the name of the secret.
987func (client BaseClient) DeleteSecret(ctx context.Context, vaultBaseURL string, secretName string) (result DeletedSecretBundle, err error) {
988	if tracing.IsEnabled() {
989		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteSecret")
990		defer func() {
991			sc := -1
992			if result.Response.Response != nil {
993				sc = result.Response.Response.StatusCode
994			}
995			tracing.EndSpan(ctx, sc, err)
996		}()
997	}
998	req, err := client.DeleteSecretPreparer(ctx, vaultBaseURL, secretName)
999	if err != nil {
1000		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteSecret", nil, "Failure preparing request")
1001		return
1002	}
1003
1004	resp, err := client.DeleteSecretSender(req)
1005	if err != nil {
1006		result.Response = autorest.Response{Response: resp}
1007		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteSecret", resp, "Failure sending request")
1008		return
1009	}
1010
1011	result, err = client.DeleteSecretResponder(resp)
1012	if err != nil {
1013		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteSecret", resp, "Failure responding to request")
1014	}
1015
1016	return
1017}
1018
1019// DeleteSecretPreparer prepares the DeleteSecret request.
1020func (client BaseClient) DeleteSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string) (*http.Request, error) {
1021	urlParameters := map[string]interface{}{
1022		"vaultBaseUrl": vaultBaseURL,
1023	}
1024
1025	pathParameters := map[string]interface{}{
1026		"secret-name": autorest.Encode("path", secretName),
1027	}
1028
1029	const APIVersion = "2016-10-01"
1030	queryParameters := map[string]interface{}{
1031		"api-version": APIVersion,
1032	}
1033
1034	preparer := autorest.CreatePreparer(
1035		autorest.AsDelete(),
1036		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
1037		autorest.WithPathParameters("/secrets/{secret-name}", pathParameters),
1038		autorest.WithQueryParameters(queryParameters))
1039	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1040}
1041
1042// DeleteSecretSender sends the DeleteSecret request. The method will close the
1043// http.Response Body if it receives an error.
1044func (client BaseClient) DeleteSecretSender(req *http.Request) (*http.Response, error) {
1045	return autorest.SendWithSender(client, req,
1046		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1047}
1048
1049// DeleteSecretResponder handles the response to the DeleteSecret request. The method always
1050// closes the http.Response Body.
1051func (client BaseClient) DeleteSecretResponder(resp *http.Response) (result DeletedSecretBundle, err error) {
1052	err = autorest.Respond(
1053		resp,
1054		client.ByInspecting(),
1055		azure.WithErrorUnlessStatusCode(http.StatusOK),
1056		autorest.ByUnmarshallingJSON(&result),
1057		autorest.ByClosing())
1058	result.Response = autorest.Response{Response: resp}
1059	return
1060}
1061
1062// DeleteStorageAccount deletes a storage account. This operation requires the storage/delete permission.
1063// Parameters:
1064// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
1065// storageAccountName - the name of the storage account.
1066func (client BaseClient) DeleteStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string) (result StorageBundle, err error) {
1067	if tracing.IsEnabled() {
1068		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteStorageAccount")
1069		defer func() {
1070			sc := -1
1071			if result.Response.Response != nil {
1072				sc = result.Response.Response.StatusCode
1073			}
1074			tracing.EndSpan(ctx, sc, err)
1075		}()
1076	}
1077	if err := validation.Validate([]validation.Validation{
1078		{TargetValue: storageAccountName,
1079			Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil {
1080		return result, validation.NewError("keyvault.BaseClient", "DeleteStorageAccount", err.Error())
1081	}
1082
1083	req, err := client.DeleteStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName)
1084	if err != nil {
1085		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteStorageAccount", nil, "Failure preparing request")
1086		return
1087	}
1088
1089	resp, err := client.DeleteStorageAccountSender(req)
1090	if err != nil {
1091		result.Response = autorest.Response{Response: resp}
1092		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteStorageAccount", resp, "Failure sending request")
1093		return
1094	}
1095
1096	result, err = client.DeleteStorageAccountResponder(resp)
1097	if err != nil {
1098		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "DeleteStorageAccount", resp, "Failure responding to request")
1099	}
1100
1101	return
1102}
1103
1104// DeleteStorageAccountPreparer prepares the DeleteStorageAccount request.
1105func (client BaseClient) DeleteStorageAccountPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string) (*http.Request, error) {
1106	urlParameters := map[string]interface{}{
1107		"vaultBaseUrl": vaultBaseURL,
1108	}
1109
1110	pathParameters := map[string]interface{}{
1111		"storage-account-name": autorest.Encode("path", storageAccountName),
1112	}
1113
1114	const APIVersion = "2016-10-01"
1115	queryParameters := map[string]interface{}{
1116		"api-version": APIVersion,
1117	}
1118
1119	preparer := autorest.CreatePreparer(
1120		autorest.AsDelete(),
1121		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
1122		autorest.WithPathParameters("/storage/{storage-account-name}", pathParameters),
1123		autorest.WithQueryParameters(queryParameters))
1124	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1125}
1126
1127// DeleteStorageAccountSender sends the DeleteStorageAccount request. The method will close the
1128// http.Response Body if it receives an error.
1129func (client BaseClient) DeleteStorageAccountSender(req *http.Request) (*http.Response, error) {
1130	return autorest.SendWithSender(client, req,
1131		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1132}
1133
1134// DeleteStorageAccountResponder handles the response to the DeleteStorageAccount request. The method always
1135// closes the http.Response Body.
1136func (client BaseClient) DeleteStorageAccountResponder(resp *http.Response) (result StorageBundle, err error) {
1137	err = autorest.Respond(
1138		resp,
1139		client.ByInspecting(),
1140		azure.WithErrorUnlessStatusCode(http.StatusOK),
1141		autorest.ByUnmarshallingJSON(&result),
1142		autorest.ByClosing())
1143	result.Response = autorest.Response{Response: resp}
1144	return
1145}
1146
1147// Encrypt the ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in
1148// Azure Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is
1149// dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly
1150// necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed
1151// using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that
1152// have a key-reference but do not have access to the public key material. This operation requires the keys/encrypt
1153// permission.
1154// Parameters:
1155// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
1156// keyName - the name of the key.
1157// keyVersion - the version of the key.
1158// parameters - the parameters for the encryption operation.
1159func (client BaseClient) Encrypt(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (result KeyOperationResult, err error) {
1160	if tracing.IsEnabled() {
1161		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.Encrypt")
1162		defer func() {
1163			sc := -1
1164			if result.Response.Response != nil {
1165				sc = result.Response.Response.StatusCode
1166			}
1167			tracing.EndSpan(ctx, sc, err)
1168		}()
1169	}
1170	if err := validation.Validate([]validation.Validation{
1171		{TargetValue: parameters,
1172			Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
1173		return result, validation.NewError("keyvault.BaseClient", "Encrypt", err.Error())
1174	}
1175
1176	req, err := client.EncryptPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters)
1177	if err != nil {
1178		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Encrypt", nil, "Failure preparing request")
1179		return
1180	}
1181
1182	resp, err := client.EncryptSender(req)
1183	if err != nil {
1184		result.Response = autorest.Response{Response: resp}
1185		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Encrypt", resp, "Failure sending request")
1186		return
1187	}
1188
1189	result, err = client.EncryptResponder(resp)
1190	if err != nil {
1191		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Encrypt", resp, "Failure responding to request")
1192	}
1193
1194	return
1195}
1196
1197// EncryptPreparer prepares the Encrypt request.
1198func (client BaseClient) EncryptPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (*http.Request, error) {
1199	urlParameters := map[string]interface{}{
1200		"vaultBaseUrl": vaultBaseURL,
1201	}
1202
1203	pathParameters := map[string]interface{}{
1204		"key-name":    autorest.Encode("path", keyName),
1205		"key-version": autorest.Encode("path", keyVersion),
1206	}
1207
1208	const APIVersion = "2016-10-01"
1209	queryParameters := map[string]interface{}{
1210		"api-version": APIVersion,
1211	}
1212
1213	preparer := autorest.CreatePreparer(
1214		autorest.AsContentType("application/json; charset=utf-8"),
1215		autorest.AsPost(),
1216		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
1217		autorest.WithPathParameters("/keys/{key-name}/{key-version}/encrypt", pathParameters),
1218		autorest.WithJSON(parameters),
1219		autorest.WithQueryParameters(queryParameters))
1220	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1221}
1222
1223// EncryptSender sends the Encrypt request. The method will close the
1224// http.Response Body if it receives an error.
1225func (client BaseClient) EncryptSender(req *http.Request) (*http.Response, error) {
1226	return autorest.SendWithSender(client, req,
1227		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1228}
1229
1230// EncryptResponder handles the response to the Encrypt request. The method always
1231// closes the http.Response Body.
1232func (client BaseClient) EncryptResponder(resp *http.Response) (result KeyOperationResult, err error) {
1233	err = autorest.Respond(
1234		resp,
1235		client.ByInspecting(),
1236		azure.WithErrorUnlessStatusCode(http.StatusOK),
1237		autorest.ByUnmarshallingJSON(&result),
1238		autorest.ByClosing())
1239	result.Response = autorest.Response{Response: resp}
1240	return
1241}
1242
1243// GetCertificate gets information about a specific certificate. This operation requires the certificates/get
1244// permission.
1245// Parameters:
1246// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
1247// certificateName - the name of the certificate in the given vault.
1248// certificateVersion - the version of the certificate.
1249func (client BaseClient) GetCertificate(ctx context.Context, vaultBaseURL string, certificateName string, certificateVersion string) (result CertificateBundle, err error) {
1250	if tracing.IsEnabled() {
1251		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCertificate")
1252		defer func() {
1253			sc := -1
1254			if result.Response.Response != nil {
1255				sc = result.Response.Response.StatusCode
1256			}
1257			tracing.EndSpan(ctx, sc, err)
1258		}()
1259	}
1260	req, err := client.GetCertificatePreparer(ctx, vaultBaseURL, certificateName, certificateVersion)
1261	if err != nil {
1262		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificate", nil, "Failure preparing request")
1263		return
1264	}
1265
1266	resp, err := client.GetCertificateSender(req)
1267	if err != nil {
1268		result.Response = autorest.Response{Response: resp}
1269		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificate", resp, "Failure sending request")
1270		return
1271	}
1272
1273	result, err = client.GetCertificateResponder(resp)
1274	if err != nil {
1275		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificate", resp, "Failure responding to request")
1276	}
1277
1278	return
1279}
1280
1281// GetCertificatePreparer prepares the GetCertificate request.
1282func (client BaseClient) GetCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string, certificateVersion string) (*http.Request, error) {
1283	urlParameters := map[string]interface{}{
1284		"vaultBaseUrl": vaultBaseURL,
1285	}
1286
1287	pathParameters := map[string]interface{}{
1288		"certificate-name":    autorest.Encode("path", certificateName),
1289		"certificate-version": autorest.Encode("path", certificateVersion),
1290	}
1291
1292	const APIVersion = "2016-10-01"
1293	queryParameters := map[string]interface{}{
1294		"api-version": APIVersion,
1295	}
1296
1297	preparer := autorest.CreatePreparer(
1298		autorest.AsGet(),
1299		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
1300		autorest.WithPathParameters("/certificates/{certificate-name}/{certificate-version}", pathParameters),
1301		autorest.WithQueryParameters(queryParameters))
1302	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1303}
1304
1305// GetCertificateSender sends the GetCertificate request. The method will close the
1306// http.Response Body if it receives an error.
1307func (client BaseClient) GetCertificateSender(req *http.Request) (*http.Response, error) {
1308	return autorest.SendWithSender(client, req,
1309		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1310}
1311
1312// GetCertificateResponder handles the response to the GetCertificate request. The method always
1313// closes the http.Response Body.
1314func (client BaseClient) GetCertificateResponder(resp *http.Response) (result CertificateBundle, err error) {
1315	err = autorest.Respond(
1316		resp,
1317		client.ByInspecting(),
1318		azure.WithErrorUnlessStatusCode(http.StatusOK),
1319		autorest.ByUnmarshallingJSON(&result),
1320		autorest.ByClosing())
1321	result.Response = autorest.Response{Response: resp}
1322	return
1323}
1324
1325// GetCertificateContacts the GetCertificateContacts operation returns the set of certificate contact resources in the
1326// specified key vault. This operation requires the certificates/managecontacts permission.
1327// Parameters:
1328// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
1329func (client BaseClient) GetCertificateContacts(ctx context.Context, vaultBaseURL string) (result Contacts, err error) {
1330	if tracing.IsEnabled() {
1331		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCertificateContacts")
1332		defer func() {
1333			sc := -1
1334			if result.Response.Response != nil {
1335				sc = result.Response.Response.StatusCode
1336			}
1337			tracing.EndSpan(ctx, sc, err)
1338		}()
1339	}
1340	req, err := client.GetCertificateContactsPreparer(ctx, vaultBaseURL)
1341	if err != nil {
1342		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateContacts", nil, "Failure preparing request")
1343		return
1344	}
1345
1346	resp, err := client.GetCertificateContactsSender(req)
1347	if err != nil {
1348		result.Response = autorest.Response{Response: resp}
1349		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateContacts", resp, "Failure sending request")
1350		return
1351	}
1352
1353	result, err = client.GetCertificateContactsResponder(resp)
1354	if err != nil {
1355		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateContacts", resp, "Failure responding to request")
1356	}
1357
1358	return
1359}
1360
1361// GetCertificateContactsPreparer prepares the GetCertificateContacts request.
1362func (client BaseClient) GetCertificateContactsPreparer(ctx context.Context, vaultBaseURL string) (*http.Request, error) {
1363	urlParameters := map[string]interface{}{
1364		"vaultBaseUrl": vaultBaseURL,
1365	}
1366
1367	const APIVersion = "2016-10-01"
1368	queryParameters := map[string]interface{}{
1369		"api-version": APIVersion,
1370	}
1371
1372	preparer := autorest.CreatePreparer(
1373		autorest.AsGet(),
1374		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
1375		autorest.WithPath("/certificates/contacts"),
1376		autorest.WithQueryParameters(queryParameters))
1377	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1378}
1379
1380// GetCertificateContactsSender sends the GetCertificateContacts request. The method will close the
1381// http.Response Body if it receives an error.
1382func (client BaseClient) GetCertificateContactsSender(req *http.Request) (*http.Response, error) {
1383	return autorest.SendWithSender(client, req,
1384		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1385}
1386
1387// GetCertificateContactsResponder handles the response to the GetCertificateContacts request. The method always
1388// closes the http.Response Body.
1389func (client BaseClient) GetCertificateContactsResponder(resp *http.Response) (result Contacts, err error) {
1390	err = autorest.Respond(
1391		resp,
1392		client.ByInspecting(),
1393		azure.WithErrorUnlessStatusCode(http.StatusOK),
1394		autorest.ByUnmarshallingJSON(&result),
1395		autorest.ByClosing())
1396	result.Response = autorest.Response{Response: resp}
1397	return
1398}
1399
1400// GetCertificateIssuer the GetCertificateIssuer operation returns the specified certificate issuer resources in the
1401// specified key vault. This operation requires the certificates/manageissuers/getissuers permission.
1402// Parameters:
1403// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
1404// issuerName - the name of the issuer.
1405func (client BaseClient) GetCertificateIssuer(ctx context.Context, vaultBaseURL string, issuerName string) (result IssuerBundle, err error) {
1406	if tracing.IsEnabled() {
1407		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCertificateIssuer")
1408		defer func() {
1409			sc := -1
1410			if result.Response.Response != nil {
1411				sc = result.Response.Response.StatusCode
1412			}
1413			tracing.EndSpan(ctx, sc, err)
1414		}()
1415	}
1416	req, err := client.GetCertificateIssuerPreparer(ctx, vaultBaseURL, issuerName)
1417	if err != nil {
1418		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateIssuer", nil, "Failure preparing request")
1419		return
1420	}
1421
1422	resp, err := client.GetCertificateIssuerSender(req)
1423	if err != nil {
1424		result.Response = autorest.Response{Response: resp}
1425		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateIssuer", resp, "Failure sending request")
1426		return
1427	}
1428
1429	result, err = client.GetCertificateIssuerResponder(resp)
1430	if err != nil {
1431		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateIssuer", resp, "Failure responding to request")
1432	}
1433
1434	return
1435}
1436
1437// GetCertificateIssuerPreparer prepares the GetCertificateIssuer request.
1438func (client BaseClient) GetCertificateIssuerPreparer(ctx context.Context, vaultBaseURL string, issuerName string) (*http.Request, error) {
1439	urlParameters := map[string]interface{}{
1440		"vaultBaseUrl": vaultBaseURL,
1441	}
1442
1443	pathParameters := map[string]interface{}{
1444		"issuer-name": autorest.Encode("path", issuerName),
1445	}
1446
1447	const APIVersion = "2016-10-01"
1448	queryParameters := map[string]interface{}{
1449		"api-version": APIVersion,
1450	}
1451
1452	preparer := autorest.CreatePreparer(
1453		autorest.AsGet(),
1454		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
1455		autorest.WithPathParameters("/certificates/issuers/{issuer-name}", pathParameters),
1456		autorest.WithQueryParameters(queryParameters))
1457	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1458}
1459
1460// GetCertificateIssuerSender sends the GetCertificateIssuer request. The method will close the
1461// http.Response Body if it receives an error.
1462func (client BaseClient) GetCertificateIssuerSender(req *http.Request) (*http.Response, error) {
1463	return autorest.SendWithSender(client, req,
1464		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1465}
1466
1467// GetCertificateIssuerResponder handles the response to the GetCertificateIssuer request. The method always
1468// closes the http.Response Body.
1469func (client BaseClient) GetCertificateIssuerResponder(resp *http.Response) (result IssuerBundle, err error) {
1470	err = autorest.Respond(
1471		resp,
1472		client.ByInspecting(),
1473		azure.WithErrorUnlessStatusCode(http.StatusOK),
1474		autorest.ByUnmarshallingJSON(&result),
1475		autorest.ByClosing())
1476	result.Response = autorest.Response{Response: resp}
1477	return
1478}
1479
1480// GetCertificateIssuers the GetCertificateIssuers operation returns the set of certificate issuer resources in the
1481// specified key vault. This operation requires the certificates/manageissuers/getissuers permission.
1482// Parameters:
1483// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
1484// maxresults - maximum number of results to return in a page. If not specified the service will return up to
1485// 25 results.
1486func (client BaseClient) GetCertificateIssuers(ctx context.Context, vaultBaseURL string, maxresults *int32) (result CertificateIssuerListResultPage, err error) {
1487	if tracing.IsEnabled() {
1488		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCertificateIssuers")
1489		defer func() {
1490			sc := -1
1491			if result.cilr.Response.Response != nil {
1492				sc = result.cilr.Response.Response.StatusCode
1493			}
1494			tracing.EndSpan(ctx, sc, err)
1495		}()
1496	}
1497	if err := validation.Validate([]validation.Validation{
1498		{TargetValue: maxresults,
1499			Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false,
1500				Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil},
1501					{Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
1502				}}}}}); err != nil {
1503		return result, validation.NewError("keyvault.BaseClient", "GetCertificateIssuers", err.Error())
1504	}
1505
1506	result.fn = client.getCertificateIssuersNextResults
1507	req, err := client.GetCertificateIssuersPreparer(ctx, vaultBaseURL, maxresults)
1508	if err != nil {
1509		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateIssuers", nil, "Failure preparing request")
1510		return
1511	}
1512
1513	resp, err := client.GetCertificateIssuersSender(req)
1514	if err != nil {
1515		result.cilr.Response = autorest.Response{Response: resp}
1516		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateIssuers", resp, "Failure sending request")
1517		return
1518	}
1519
1520	result.cilr, err = client.GetCertificateIssuersResponder(resp)
1521	if err != nil {
1522		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateIssuers", resp, "Failure responding to request")
1523	}
1524
1525	return
1526}
1527
1528// GetCertificateIssuersPreparer prepares the GetCertificateIssuers request.
1529func (client BaseClient) GetCertificateIssuersPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) {
1530	urlParameters := map[string]interface{}{
1531		"vaultBaseUrl": vaultBaseURL,
1532	}
1533
1534	const APIVersion = "2016-10-01"
1535	queryParameters := map[string]interface{}{
1536		"api-version": APIVersion,
1537	}
1538	if maxresults != nil {
1539		queryParameters["maxresults"] = autorest.Encode("query", *maxresults)
1540	}
1541
1542	preparer := autorest.CreatePreparer(
1543		autorest.AsGet(),
1544		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
1545		autorest.WithPath("/certificates/issuers"),
1546		autorest.WithQueryParameters(queryParameters))
1547	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1548}
1549
1550// GetCertificateIssuersSender sends the GetCertificateIssuers request. The method will close the
1551// http.Response Body if it receives an error.
1552func (client BaseClient) GetCertificateIssuersSender(req *http.Request) (*http.Response, error) {
1553	return autorest.SendWithSender(client, req,
1554		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1555}
1556
1557// GetCertificateIssuersResponder handles the response to the GetCertificateIssuers request. The method always
1558// closes the http.Response Body.
1559func (client BaseClient) GetCertificateIssuersResponder(resp *http.Response) (result CertificateIssuerListResult, err error) {
1560	err = autorest.Respond(
1561		resp,
1562		client.ByInspecting(),
1563		azure.WithErrorUnlessStatusCode(http.StatusOK),
1564		autorest.ByUnmarshallingJSON(&result),
1565		autorest.ByClosing())
1566	result.Response = autorest.Response{Response: resp}
1567	return
1568}
1569
1570// getCertificateIssuersNextResults retrieves the next set of results, if any.
1571func (client BaseClient) getCertificateIssuersNextResults(ctx context.Context, lastResults CertificateIssuerListResult) (result CertificateIssuerListResult, err error) {
1572	req, err := lastResults.certificateIssuerListResultPreparer(ctx)
1573	if err != nil {
1574		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificateIssuersNextResults", nil, "Failure preparing next results request")
1575	}
1576	if req == nil {
1577		return
1578	}
1579	resp, err := client.GetCertificateIssuersSender(req)
1580	if err != nil {
1581		result.Response = autorest.Response{Response: resp}
1582		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificateIssuersNextResults", resp, "Failure sending next results request")
1583	}
1584	result, err = client.GetCertificateIssuersResponder(resp)
1585	if err != nil {
1586		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificateIssuersNextResults", resp, "Failure responding to next results request")
1587	}
1588	return
1589}
1590
1591// GetCertificateIssuersComplete enumerates all values, automatically crossing page boundaries as required.
1592func (client BaseClient) GetCertificateIssuersComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result CertificateIssuerListResultIterator, err error) {
1593	if tracing.IsEnabled() {
1594		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCertificateIssuers")
1595		defer func() {
1596			sc := -1
1597			if result.Response().Response.Response != nil {
1598				sc = result.page.Response().Response.Response.StatusCode
1599			}
1600			tracing.EndSpan(ctx, sc, err)
1601		}()
1602	}
1603	result.page, err = client.GetCertificateIssuers(ctx, vaultBaseURL, maxresults)
1604	return
1605}
1606
1607// GetCertificateOperation gets the creation operation associated with a specified certificate. This operation requires
1608// the certificates/get permission.
1609// Parameters:
1610// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
1611// certificateName - the name of the certificate.
1612func (client BaseClient) GetCertificateOperation(ctx context.Context, vaultBaseURL string, certificateName string) (result CertificateOperation, err error) {
1613	if tracing.IsEnabled() {
1614		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCertificateOperation")
1615		defer func() {
1616			sc := -1
1617			if result.Response.Response != nil {
1618				sc = result.Response.Response.StatusCode
1619			}
1620			tracing.EndSpan(ctx, sc, err)
1621		}()
1622	}
1623	req, err := client.GetCertificateOperationPreparer(ctx, vaultBaseURL, certificateName)
1624	if err != nil {
1625		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateOperation", nil, "Failure preparing request")
1626		return
1627	}
1628
1629	resp, err := client.GetCertificateOperationSender(req)
1630	if err != nil {
1631		result.Response = autorest.Response{Response: resp}
1632		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateOperation", resp, "Failure sending request")
1633		return
1634	}
1635
1636	result, err = client.GetCertificateOperationResponder(resp)
1637	if err != nil {
1638		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateOperation", resp, "Failure responding to request")
1639	}
1640
1641	return
1642}
1643
1644// GetCertificateOperationPreparer prepares the GetCertificateOperation request.
1645func (client BaseClient) GetCertificateOperationPreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) {
1646	urlParameters := map[string]interface{}{
1647		"vaultBaseUrl": vaultBaseURL,
1648	}
1649
1650	pathParameters := map[string]interface{}{
1651		"certificate-name": autorest.Encode("path", certificateName),
1652	}
1653
1654	const APIVersion = "2016-10-01"
1655	queryParameters := map[string]interface{}{
1656		"api-version": APIVersion,
1657	}
1658
1659	preparer := autorest.CreatePreparer(
1660		autorest.AsGet(),
1661		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
1662		autorest.WithPathParameters("/certificates/{certificate-name}/pending", pathParameters),
1663		autorest.WithQueryParameters(queryParameters))
1664	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1665}
1666
1667// GetCertificateOperationSender sends the GetCertificateOperation request. The method will close the
1668// http.Response Body if it receives an error.
1669func (client BaseClient) GetCertificateOperationSender(req *http.Request) (*http.Response, error) {
1670	return autorest.SendWithSender(client, req,
1671		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1672}
1673
1674// GetCertificateOperationResponder handles the response to the GetCertificateOperation request. The method always
1675// closes the http.Response Body.
1676func (client BaseClient) GetCertificateOperationResponder(resp *http.Response) (result CertificateOperation, err error) {
1677	err = autorest.Respond(
1678		resp,
1679		client.ByInspecting(),
1680		azure.WithErrorUnlessStatusCode(http.StatusOK),
1681		autorest.ByUnmarshallingJSON(&result),
1682		autorest.ByClosing())
1683	result.Response = autorest.Response{Response: resp}
1684	return
1685}
1686
1687// GetCertificatePolicy the GetCertificatePolicy operation returns the specified certificate policy resources in the
1688// specified key vault. This operation requires the certificates/get permission.
1689// Parameters:
1690// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
1691// certificateName - the name of the certificate in a given key vault.
1692func (client BaseClient) GetCertificatePolicy(ctx context.Context, vaultBaseURL string, certificateName string) (result CertificatePolicy, err error) {
1693	if tracing.IsEnabled() {
1694		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCertificatePolicy")
1695		defer func() {
1696			sc := -1
1697			if result.Response.Response != nil {
1698				sc = result.Response.Response.StatusCode
1699			}
1700			tracing.EndSpan(ctx, sc, err)
1701		}()
1702	}
1703	req, err := client.GetCertificatePolicyPreparer(ctx, vaultBaseURL, certificateName)
1704	if err != nil {
1705		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificatePolicy", nil, "Failure preparing request")
1706		return
1707	}
1708
1709	resp, err := client.GetCertificatePolicySender(req)
1710	if err != nil {
1711		result.Response = autorest.Response{Response: resp}
1712		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificatePolicy", resp, "Failure sending request")
1713		return
1714	}
1715
1716	result, err = client.GetCertificatePolicyResponder(resp)
1717	if err != nil {
1718		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificatePolicy", resp, "Failure responding to request")
1719	}
1720
1721	return
1722}
1723
1724// GetCertificatePolicyPreparer prepares the GetCertificatePolicy request.
1725func (client BaseClient) GetCertificatePolicyPreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) {
1726	urlParameters := map[string]interface{}{
1727		"vaultBaseUrl": vaultBaseURL,
1728	}
1729
1730	pathParameters := map[string]interface{}{
1731		"certificate-name": autorest.Encode("path", certificateName),
1732	}
1733
1734	const APIVersion = "2016-10-01"
1735	queryParameters := map[string]interface{}{
1736		"api-version": APIVersion,
1737	}
1738
1739	preparer := autorest.CreatePreparer(
1740		autorest.AsGet(),
1741		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
1742		autorest.WithPathParameters("/certificates/{certificate-name}/policy", pathParameters),
1743		autorest.WithQueryParameters(queryParameters))
1744	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1745}
1746
1747// GetCertificatePolicySender sends the GetCertificatePolicy request. The method will close the
1748// http.Response Body if it receives an error.
1749func (client BaseClient) GetCertificatePolicySender(req *http.Request) (*http.Response, error) {
1750	return autorest.SendWithSender(client, req,
1751		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1752}
1753
1754// GetCertificatePolicyResponder handles the response to the GetCertificatePolicy request. The method always
1755// closes the http.Response Body.
1756func (client BaseClient) GetCertificatePolicyResponder(resp *http.Response) (result CertificatePolicy, err error) {
1757	err = autorest.Respond(
1758		resp,
1759		client.ByInspecting(),
1760		azure.WithErrorUnlessStatusCode(http.StatusOK),
1761		autorest.ByUnmarshallingJSON(&result),
1762		autorest.ByClosing())
1763	result.Response = autorest.Response{Response: resp}
1764	return
1765}
1766
1767// GetCertificates the GetCertificates operation returns the set of certificates resources in the specified key vault.
1768// This operation requires the certificates/list permission.
1769// Parameters:
1770// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
1771// maxresults - maximum number of results to return in a page. If not specified the service will return up to
1772// 25 results.
1773func (client BaseClient) GetCertificates(ctx context.Context, vaultBaseURL string, maxresults *int32) (result CertificateListResultPage, err error) {
1774	if tracing.IsEnabled() {
1775		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCertificates")
1776		defer func() {
1777			sc := -1
1778			if result.clr.Response.Response != nil {
1779				sc = result.clr.Response.Response.StatusCode
1780			}
1781			tracing.EndSpan(ctx, sc, err)
1782		}()
1783	}
1784	if err := validation.Validate([]validation.Validation{
1785		{TargetValue: maxresults,
1786			Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false,
1787				Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil},
1788					{Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
1789				}}}}}); err != nil {
1790		return result, validation.NewError("keyvault.BaseClient", "GetCertificates", err.Error())
1791	}
1792
1793	result.fn = client.getCertificatesNextResults
1794	req, err := client.GetCertificatesPreparer(ctx, vaultBaseURL, maxresults)
1795	if err != nil {
1796		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificates", nil, "Failure preparing request")
1797		return
1798	}
1799
1800	resp, err := client.GetCertificatesSender(req)
1801	if err != nil {
1802		result.clr.Response = autorest.Response{Response: resp}
1803		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificates", resp, "Failure sending request")
1804		return
1805	}
1806
1807	result.clr, err = client.GetCertificatesResponder(resp)
1808	if err != nil {
1809		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificates", resp, "Failure responding to request")
1810	}
1811
1812	return
1813}
1814
1815// GetCertificatesPreparer prepares the GetCertificates request.
1816func (client BaseClient) GetCertificatesPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) {
1817	urlParameters := map[string]interface{}{
1818		"vaultBaseUrl": vaultBaseURL,
1819	}
1820
1821	const APIVersion = "2016-10-01"
1822	queryParameters := map[string]interface{}{
1823		"api-version": APIVersion,
1824	}
1825	if maxresults != nil {
1826		queryParameters["maxresults"] = autorest.Encode("query", *maxresults)
1827	}
1828
1829	preparer := autorest.CreatePreparer(
1830		autorest.AsGet(),
1831		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
1832		autorest.WithPath("/certificates"),
1833		autorest.WithQueryParameters(queryParameters))
1834	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1835}
1836
1837// GetCertificatesSender sends the GetCertificates request. The method will close the
1838// http.Response Body if it receives an error.
1839func (client BaseClient) GetCertificatesSender(req *http.Request) (*http.Response, error) {
1840	return autorest.SendWithSender(client, req,
1841		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1842}
1843
1844// GetCertificatesResponder handles the response to the GetCertificates request. The method always
1845// closes the http.Response Body.
1846func (client BaseClient) GetCertificatesResponder(resp *http.Response) (result CertificateListResult, err error) {
1847	err = autorest.Respond(
1848		resp,
1849		client.ByInspecting(),
1850		azure.WithErrorUnlessStatusCode(http.StatusOK),
1851		autorest.ByUnmarshallingJSON(&result),
1852		autorest.ByClosing())
1853	result.Response = autorest.Response{Response: resp}
1854	return
1855}
1856
1857// getCertificatesNextResults retrieves the next set of results, if any.
1858func (client BaseClient) getCertificatesNextResults(ctx context.Context, lastResults CertificateListResult) (result CertificateListResult, err error) {
1859	req, err := lastResults.certificateListResultPreparer(ctx)
1860	if err != nil {
1861		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificatesNextResults", nil, "Failure preparing next results request")
1862	}
1863	if req == nil {
1864		return
1865	}
1866	resp, err := client.GetCertificatesSender(req)
1867	if err != nil {
1868		result.Response = autorest.Response{Response: resp}
1869		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificatesNextResults", resp, "Failure sending next results request")
1870	}
1871	result, err = client.GetCertificatesResponder(resp)
1872	if err != nil {
1873		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificatesNextResults", resp, "Failure responding to next results request")
1874	}
1875	return
1876}
1877
1878// GetCertificatesComplete enumerates all values, automatically crossing page boundaries as required.
1879func (client BaseClient) GetCertificatesComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result CertificateListResultIterator, err error) {
1880	if tracing.IsEnabled() {
1881		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCertificates")
1882		defer func() {
1883			sc := -1
1884			if result.Response().Response.Response != nil {
1885				sc = result.page.Response().Response.Response.StatusCode
1886			}
1887			tracing.EndSpan(ctx, sc, err)
1888		}()
1889	}
1890	result.page, err = client.GetCertificates(ctx, vaultBaseURL, maxresults)
1891	return
1892}
1893
1894// GetCertificateVersions the GetCertificateVersions operation returns the versions of a certificate in the specified
1895// key vault. This operation requires the certificates/list permission.
1896// Parameters:
1897// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
1898// certificateName - the name of the certificate.
1899// maxresults - maximum number of results to return in a page. If not specified the service will return up to
1900// 25 results.
1901func (client BaseClient) GetCertificateVersions(ctx context.Context, vaultBaseURL string, certificateName string, maxresults *int32) (result CertificateListResultPage, err error) {
1902	if tracing.IsEnabled() {
1903		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCertificateVersions")
1904		defer func() {
1905			sc := -1
1906			if result.clr.Response.Response != nil {
1907				sc = result.clr.Response.Response.StatusCode
1908			}
1909			tracing.EndSpan(ctx, sc, err)
1910		}()
1911	}
1912	if err := validation.Validate([]validation.Validation{
1913		{TargetValue: maxresults,
1914			Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false,
1915				Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil},
1916					{Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
1917				}}}}}); err != nil {
1918		return result, validation.NewError("keyvault.BaseClient", "GetCertificateVersions", err.Error())
1919	}
1920
1921	result.fn = client.getCertificateVersionsNextResults
1922	req, err := client.GetCertificateVersionsPreparer(ctx, vaultBaseURL, certificateName, maxresults)
1923	if err != nil {
1924		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateVersions", nil, "Failure preparing request")
1925		return
1926	}
1927
1928	resp, err := client.GetCertificateVersionsSender(req)
1929	if err != nil {
1930		result.clr.Response = autorest.Response{Response: resp}
1931		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateVersions", resp, "Failure sending request")
1932		return
1933	}
1934
1935	result.clr, err = client.GetCertificateVersionsResponder(resp)
1936	if err != nil {
1937		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetCertificateVersions", resp, "Failure responding to request")
1938	}
1939
1940	return
1941}
1942
1943// GetCertificateVersionsPreparer prepares the GetCertificateVersions request.
1944func (client BaseClient) GetCertificateVersionsPreparer(ctx context.Context, vaultBaseURL string, certificateName string, maxresults *int32) (*http.Request, error) {
1945	urlParameters := map[string]interface{}{
1946		"vaultBaseUrl": vaultBaseURL,
1947	}
1948
1949	pathParameters := map[string]interface{}{
1950		"certificate-name": autorest.Encode("path", certificateName),
1951	}
1952
1953	const APIVersion = "2016-10-01"
1954	queryParameters := map[string]interface{}{
1955		"api-version": APIVersion,
1956	}
1957	if maxresults != nil {
1958		queryParameters["maxresults"] = autorest.Encode("query", *maxresults)
1959	}
1960
1961	preparer := autorest.CreatePreparer(
1962		autorest.AsGet(),
1963		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
1964		autorest.WithPathParameters("/certificates/{certificate-name}/versions", pathParameters),
1965		autorest.WithQueryParameters(queryParameters))
1966	return preparer.Prepare((&http.Request{}).WithContext(ctx))
1967}
1968
1969// GetCertificateVersionsSender sends the GetCertificateVersions request. The method will close the
1970// http.Response Body if it receives an error.
1971func (client BaseClient) GetCertificateVersionsSender(req *http.Request) (*http.Response, error) {
1972	return autorest.SendWithSender(client, req,
1973		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1974}
1975
1976// GetCertificateVersionsResponder handles the response to the GetCertificateVersions request. The method always
1977// closes the http.Response Body.
1978func (client BaseClient) GetCertificateVersionsResponder(resp *http.Response) (result CertificateListResult, err error) {
1979	err = autorest.Respond(
1980		resp,
1981		client.ByInspecting(),
1982		azure.WithErrorUnlessStatusCode(http.StatusOK),
1983		autorest.ByUnmarshallingJSON(&result),
1984		autorest.ByClosing())
1985	result.Response = autorest.Response{Response: resp}
1986	return
1987}
1988
1989// getCertificateVersionsNextResults retrieves the next set of results, if any.
1990func (client BaseClient) getCertificateVersionsNextResults(ctx context.Context, lastResults CertificateListResult) (result CertificateListResult, err error) {
1991	req, err := lastResults.certificateListResultPreparer(ctx)
1992	if err != nil {
1993		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificateVersionsNextResults", nil, "Failure preparing next results request")
1994	}
1995	if req == nil {
1996		return
1997	}
1998	resp, err := client.GetCertificateVersionsSender(req)
1999	if err != nil {
2000		result.Response = autorest.Response{Response: resp}
2001		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificateVersionsNextResults", resp, "Failure sending next results request")
2002	}
2003	result, err = client.GetCertificateVersionsResponder(resp)
2004	if err != nil {
2005		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getCertificateVersionsNextResults", resp, "Failure responding to next results request")
2006	}
2007	return
2008}
2009
2010// GetCertificateVersionsComplete enumerates all values, automatically crossing page boundaries as required.
2011func (client BaseClient) GetCertificateVersionsComplete(ctx context.Context, vaultBaseURL string, certificateName string, maxresults *int32) (result CertificateListResultIterator, err error) {
2012	if tracing.IsEnabled() {
2013		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCertificateVersions")
2014		defer func() {
2015			sc := -1
2016			if result.Response().Response.Response != nil {
2017				sc = result.page.Response().Response.Response.StatusCode
2018			}
2019			tracing.EndSpan(ctx, sc, err)
2020		}()
2021	}
2022	result.page, err = client.GetCertificateVersions(ctx, vaultBaseURL, certificateName, maxresults)
2023	return
2024}
2025
2026// GetDeletedCertificate the GetDeletedCertificate operation retrieves the deleted certificate information plus its
2027// attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This
2028// operation requires the certificates/get permission.
2029// Parameters:
2030// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
2031// certificateName - the name of the certificate
2032func (client BaseClient) GetDeletedCertificate(ctx context.Context, vaultBaseURL string, certificateName string) (result DeletedCertificateBundle, err error) {
2033	if tracing.IsEnabled() {
2034		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeletedCertificate")
2035		defer func() {
2036			sc := -1
2037			if result.Response.Response != nil {
2038				sc = result.Response.Response.StatusCode
2039			}
2040			tracing.EndSpan(ctx, sc, err)
2041		}()
2042	}
2043	req, err := client.GetDeletedCertificatePreparer(ctx, vaultBaseURL, certificateName)
2044	if err != nil {
2045		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedCertificate", nil, "Failure preparing request")
2046		return
2047	}
2048
2049	resp, err := client.GetDeletedCertificateSender(req)
2050	if err != nil {
2051		result.Response = autorest.Response{Response: resp}
2052		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedCertificate", resp, "Failure sending request")
2053		return
2054	}
2055
2056	result, err = client.GetDeletedCertificateResponder(resp)
2057	if err != nil {
2058		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedCertificate", resp, "Failure responding to request")
2059	}
2060
2061	return
2062}
2063
2064// GetDeletedCertificatePreparer prepares the GetDeletedCertificate request.
2065func (client BaseClient) GetDeletedCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) {
2066	urlParameters := map[string]interface{}{
2067		"vaultBaseUrl": vaultBaseURL,
2068	}
2069
2070	pathParameters := map[string]interface{}{
2071		"certificate-name": autorest.Encode("path", certificateName),
2072	}
2073
2074	const APIVersion = "2016-10-01"
2075	queryParameters := map[string]interface{}{
2076		"api-version": APIVersion,
2077	}
2078
2079	preparer := autorest.CreatePreparer(
2080		autorest.AsGet(),
2081		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
2082		autorest.WithPathParameters("/deletedcertificates/{certificate-name}", pathParameters),
2083		autorest.WithQueryParameters(queryParameters))
2084	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2085}
2086
2087// GetDeletedCertificateSender sends the GetDeletedCertificate request. The method will close the
2088// http.Response Body if it receives an error.
2089func (client BaseClient) GetDeletedCertificateSender(req *http.Request) (*http.Response, error) {
2090	return autorest.SendWithSender(client, req,
2091		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2092}
2093
2094// GetDeletedCertificateResponder handles the response to the GetDeletedCertificate request. The method always
2095// closes the http.Response Body.
2096func (client BaseClient) GetDeletedCertificateResponder(resp *http.Response) (result DeletedCertificateBundle, err error) {
2097	err = autorest.Respond(
2098		resp,
2099		client.ByInspecting(),
2100		azure.WithErrorUnlessStatusCode(http.StatusOK),
2101		autorest.ByUnmarshallingJSON(&result),
2102		autorest.ByClosing())
2103	result.Response = autorest.Response{Response: resp}
2104	return
2105}
2106
2107// GetDeletedCertificates the GetDeletedCertificates operation retrieves the certificates in the current vault which
2108// are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information.
2109// This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete
2110// enabled vaults.
2111// Parameters:
2112// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
2113// maxresults - maximum number of results to return in a page. If not specified the service will return up to
2114// 25 results.
2115func (client BaseClient) GetDeletedCertificates(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedCertificateListResultPage, err error) {
2116	if tracing.IsEnabled() {
2117		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeletedCertificates")
2118		defer func() {
2119			sc := -1
2120			if result.dclr.Response.Response != nil {
2121				sc = result.dclr.Response.Response.StatusCode
2122			}
2123			tracing.EndSpan(ctx, sc, err)
2124		}()
2125	}
2126	if err := validation.Validate([]validation.Validation{
2127		{TargetValue: maxresults,
2128			Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false,
2129				Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil},
2130					{Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
2131				}}}}}); err != nil {
2132		return result, validation.NewError("keyvault.BaseClient", "GetDeletedCertificates", err.Error())
2133	}
2134
2135	result.fn = client.getDeletedCertificatesNextResults
2136	req, err := client.GetDeletedCertificatesPreparer(ctx, vaultBaseURL, maxresults)
2137	if err != nil {
2138		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedCertificates", nil, "Failure preparing request")
2139		return
2140	}
2141
2142	resp, err := client.GetDeletedCertificatesSender(req)
2143	if err != nil {
2144		result.dclr.Response = autorest.Response{Response: resp}
2145		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedCertificates", resp, "Failure sending request")
2146		return
2147	}
2148
2149	result.dclr, err = client.GetDeletedCertificatesResponder(resp)
2150	if err != nil {
2151		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedCertificates", resp, "Failure responding to request")
2152	}
2153
2154	return
2155}
2156
2157// GetDeletedCertificatesPreparer prepares the GetDeletedCertificates request.
2158func (client BaseClient) GetDeletedCertificatesPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) {
2159	urlParameters := map[string]interface{}{
2160		"vaultBaseUrl": vaultBaseURL,
2161	}
2162
2163	const APIVersion = "2016-10-01"
2164	queryParameters := map[string]interface{}{
2165		"api-version": APIVersion,
2166	}
2167	if maxresults != nil {
2168		queryParameters["maxresults"] = autorest.Encode("query", *maxresults)
2169	}
2170
2171	preparer := autorest.CreatePreparer(
2172		autorest.AsGet(),
2173		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
2174		autorest.WithPath("/deletedcertificates"),
2175		autorest.WithQueryParameters(queryParameters))
2176	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2177}
2178
2179// GetDeletedCertificatesSender sends the GetDeletedCertificates request. The method will close the
2180// http.Response Body if it receives an error.
2181func (client BaseClient) GetDeletedCertificatesSender(req *http.Request) (*http.Response, error) {
2182	return autorest.SendWithSender(client, req,
2183		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2184}
2185
2186// GetDeletedCertificatesResponder handles the response to the GetDeletedCertificates request. The method always
2187// closes the http.Response Body.
2188func (client BaseClient) GetDeletedCertificatesResponder(resp *http.Response) (result DeletedCertificateListResult, err error) {
2189	err = autorest.Respond(
2190		resp,
2191		client.ByInspecting(),
2192		azure.WithErrorUnlessStatusCode(http.StatusOK),
2193		autorest.ByUnmarshallingJSON(&result),
2194		autorest.ByClosing())
2195	result.Response = autorest.Response{Response: resp}
2196	return
2197}
2198
2199// getDeletedCertificatesNextResults retrieves the next set of results, if any.
2200func (client BaseClient) getDeletedCertificatesNextResults(ctx context.Context, lastResults DeletedCertificateListResult) (result DeletedCertificateListResult, err error) {
2201	req, err := lastResults.deletedCertificateListResultPreparer(ctx)
2202	if err != nil {
2203		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedCertificatesNextResults", nil, "Failure preparing next results request")
2204	}
2205	if req == nil {
2206		return
2207	}
2208	resp, err := client.GetDeletedCertificatesSender(req)
2209	if err != nil {
2210		result.Response = autorest.Response{Response: resp}
2211		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedCertificatesNextResults", resp, "Failure sending next results request")
2212	}
2213	result, err = client.GetDeletedCertificatesResponder(resp)
2214	if err != nil {
2215		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedCertificatesNextResults", resp, "Failure responding to next results request")
2216	}
2217	return
2218}
2219
2220// GetDeletedCertificatesComplete enumerates all values, automatically crossing page boundaries as required.
2221func (client BaseClient) GetDeletedCertificatesComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedCertificateListResultIterator, err error) {
2222	if tracing.IsEnabled() {
2223		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeletedCertificates")
2224		defer func() {
2225			sc := -1
2226			if result.Response().Response.Response != nil {
2227				sc = result.page.Response().Response.Response.StatusCode
2228			}
2229			tracing.EndSpan(ctx, sc, err)
2230		}()
2231	}
2232	result.page, err = client.GetDeletedCertificates(ctx, vaultBaseURL, maxresults)
2233	return
2234}
2235
2236// GetDeletedKey the Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be
2237// invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires
2238// the keys/get permission.
2239// Parameters:
2240// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
2241// keyName - the name of the key.
2242func (client BaseClient) GetDeletedKey(ctx context.Context, vaultBaseURL string, keyName string) (result DeletedKeyBundle, err error) {
2243	if tracing.IsEnabled() {
2244		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeletedKey")
2245		defer func() {
2246			sc := -1
2247			if result.Response.Response != nil {
2248				sc = result.Response.Response.StatusCode
2249			}
2250			tracing.EndSpan(ctx, sc, err)
2251		}()
2252	}
2253	req, err := client.GetDeletedKeyPreparer(ctx, vaultBaseURL, keyName)
2254	if err != nil {
2255		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedKey", nil, "Failure preparing request")
2256		return
2257	}
2258
2259	resp, err := client.GetDeletedKeySender(req)
2260	if err != nil {
2261		result.Response = autorest.Response{Response: resp}
2262		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedKey", resp, "Failure sending request")
2263		return
2264	}
2265
2266	result, err = client.GetDeletedKeyResponder(resp)
2267	if err != nil {
2268		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedKey", resp, "Failure responding to request")
2269	}
2270
2271	return
2272}
2273
2274// GetDeletedKeyPreparer prepares the GetDeletedKey request.
2275func (client BaseClient) GetDeletedKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string) (*http.Request, error) {
2276	urlParameters := map[string]interface{}{
2277		"vaultBaseUrl": vaultBaseURL,
2278	}
2279
2280	pathParameters := map[string]interface{}{
2281		"key-name": autorest.Encode("path", keyName),
2282	}
2283
2284	const APIVersion = "2016-10-01"
2285	queryParameters := map[string]interface{}{
2286		"api-version": APIVersion,
2287	}
2288
2289	preparer := autorest.CreatePreparer(
2290		autorest.AsGet(),
2291		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
2292		autorest.WithPathParameters("/deletedkeys/{key-name}", pathParameters),
2293		autorest.WithQueryParameters(queryParameters))
2294	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2295}
2296
2297// GetDeletedKeySender sends the GetDeletedKey request. The method will close the
2298// http.Response Body if it receives an error.
2299func (client BaseClient) GetDeletedKeySender(req *http.Request) (*http.Response, error) {
2300	return autorest.SendWithSender(client, req,
2301		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2302}
2303
2304// GetDeletedKeyResponder handles the response to the GetDeletedKey request. The method always
2305// closes the http.Response Body.
2306func (client BaseClient) GetDeletedKeyResponder(resp *http.Response) (result DeletedKeyBundle, err error) {
2307	err = autorest.Respond(
2308		resp,
2309		client.ByInspecting(),
2310		azure.WithErrorUnlessStatusCode(http.StatusOK),
2311		autorest.ByUnmarshallingJSON(&result),
2312		autorest.ByClosing())
2313	result.Response = autorest.Response{Response: resp}
2314	return
2315}
2316
2317// GetDeletedKeys retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part
2318// of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is
2319// applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an
2320// error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.
2321// Parameters:
2322// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
2323// maxresults - maximum number of results to return in a page. If not specified the service will return up to
2324// 25 results.
2325func (client BaseClient) GetDeletedKeys(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedKeyListResultPage, err error) {
2326	if tracing.IsEnabled() {
2327		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeletedKeys")
2328		defer func() {
2329			sc := -1
2330			if result.dklr.Response.Response != nil {
2331				sc = result.dklr.Response.Response.StatusCode
2332			}
2333			tracing.EndSpan(ctx, sc, err)
2334		}()
2335	}
2336	if err := validation.Validate([]validation.Validation{
2337		{TargetValue: maxresults,
2338			Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false,
2339				Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil},
2340					{Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
2341				}}}}}); err != nil {
2342		return result, validation.NewError("keyvault.BaseClient", "GetDeletedKeys", err.Error())
2343	}
2344
2345	result.fn = client.getDeletedKeysNextResults
2346	req, err := client.GetDeletedKeysPreparer(ctx, vaultBaseURL, maxresults)
2347	if err != nil {
2348		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedKeys", nil, "Failure preparing request")
2349		return
2350	}
2351
2352	resp, err := client.GetDeletedKeysSender(req)
2353	if err != nil {
2354		result.dklr.Response = autorest.Response{Response: resp}
2355		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedKeys", resp, "Failure sending request")
2356		return
2357	}
2358
2359	result.dklr, err = client.GetDeletedKeysResponder(resp)
2360	if err != nil {
2361		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedKeys", resp, "Failure responding to request")
2362	}
2363
2364	return
2365}
2366
2367// GetDeletedKeysPreparer prepares the GetDeletedKeys request.
2368func (client BaseClient) GetDeletedKeysPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) {
2369	urlParameters := map[string]interface{}{
2370		"vaultBaseUrl": vaultBaseURL,
2371	}
2372
2373	const APIVersion = "2016-10-01"
2374	queryParameters := map[string]interface{}{
2375		"api-version": APIVersion,
2376	}
2377	if maxresults != nil {
2378		queryParameters["maxresults"] = autorest.Encode("query", *maxresults)
2379	}
2380
2381	preparer := autorest.CreatePreparer(
2382		autorest.AsGet(),
2383		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
2384		autorest.WithPath("/deletedkeys"),
2385		autorest.WithQueryParameters(queryParameters))
2386	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2387}
2388
2389// GetDeletedKeysSender sends the GetDeletedKeys request. The method will close the
2390// http.Response Body if it receives an error.
2391func (client BaseClient) GetDeletedKeysSender(req *http.Request) (*http.Response, error) {
2392	return autorest.SendWithSender(client, req,
2393		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2394}
2395
2396// GetDeletedKeysResponder handles the response to the GetDeletedKeys request. The method always
2397// closes the http.Response Body.
2398func (client BaseClient) GetDeletedKeysResponder(resp *http.Response) (result DeletedKeyListResult, err error) {
2399	err = autorest.Respond(
2400		resp,
2401		client.ByInspecting(),
2402		azure.WithErrorUnlessStatusCode(http.StatusOK),
2403		autorest.ByUnmarshallingJSON(&result),
2404		autorest.ByClosing())
2405	result.Response = autorest.Response{Response: resp}
2406	return
2407}
2408
2409// getDeletedKeysNextResults retrieves the next set of results, if any.
2410func (client BaseClient) getDeletedKeysNextResults(ctx context.Context, lastResults DeletedKeyListResult) (result DeletedKeyListResult, err error) {
2411	req, err := lastResults.deletedKeyListResultPreparer(ctx)
2412	if err != nil {
2413		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedKeysNextResults", nil, "Failure preparing next results request")
2414	}
2415	if req == nil {
2416		return
2417	}
2418	resp, err := client.GetDeletedKeysSender(req)
2419	if err != nil {
2420		result.Response = autorest.Response{Response: resp}
2421		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedKeysNextResults", resp, "Failure sending next results request")
2422	}
2423	result, err = client.GetDeletedKeysResponder(resp)
2424	if err != nil {
2425		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedKeysNextResults", resp, "Failure responding to next results request")
2426	}
2427	return
2428}
2429
2430// GetDeletedKeysComplete enumerates all values, automatically crossing page boundaries as required.
2431func (client BaseClient) GetDeletedKeysComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedKeyListResultIterator, err error) {
2432	if tracing.IsEnabled() {
2433		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeletedKeys")
2434		defer func() {
2435			sc := -1
2436			if result.Response().Response.Response != nil {
2437				sc = result.page.Response().Response.Response.StatusCode
2438			}
2439			tracing.EndSpan(ctx, sc, err)
2440		}()
2441	}
2442	result.page, err = client.GetDeletedKeys(ctx, vaultBaseURL, maxresults)
2443	return
2444}
2445
2446// GetDeletedSecret the Get Deleted Secret operation returns the specified deleted secret along with its attributes.
2447// This operation requires the secrets/get permission.
2448// Parameters:
2449// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
2450// secretName - the name of the secret.
2451func (client BaseClient) GetDeletedSecret(ctx context.Context, vaultBaseURL string, secretName string) (result DeletedSecretBundle, err error) {
2452	if tracing.IsEnabled() {
2453		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeletedSecret")
2454		defer func() {
2455			sc := -1
2456			if result.Response.Response != nil {
2457				sc = result.Response.Response.StatusCode
2458			}
2459			tracing.EndSpan(ctx, sc, err)
2460		}()
2461	}
2462	req, err := client.GetDeletedSecretPreparer(ctx, vaultBaseURL, secretName)
2463	if err != nil {
2464		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSecret", nil, "Failure preparing request")
2465		return
2466	}
2467
2468	resp, err := client.GetDeletedSecretSender(req)
2469	if err != nil {
2470		result.Response = autorest.Response{Response: resp}
2471		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSecret", resp, "Failure sending request")
2472		return
2473	}
2474
2475	result, err = client.GetDeletedSecretResponder(resp)
2476	if err != nil {
2477		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSecret", resp, "Failure responding to request")
2478	}
2479
2480	return
2481}
2482
2483// GetDeletedSecretPreparer prepares the GetDeletedSecret request.
2484func (client BaseClient) GetDeletedSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string) (*http.Request, error) {
2485	urlParameters := map[string]interface{}{
2486		"vaultBaseUrl": vaultBaseURL,
2487	}
2488
2489	pathParameters := map[string]interface{}{
2490		"secret-name": autorest.Encode("path", secretName),
2491	}
2492
2493	const APIVersion = "2016-10-01"
2494	queryParameters := map[string]interface{}{
2495		"api-version": APIVersion,
2496	}
2497
2498	preparer := autorest.CreatePreparer(
2499		autorest.AsGet(),
2500		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
2501		autorest.WithPathParameters("/deletedsecrets/{secret-name}", pathParameters),
2502		autorest.WithQueryParameters(queryParameters))
2503	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2504}
2505
2506// GetDeletedSecretSender sends the GetDeletedSecret request. The method will close the
2507// http.Response Body if it receives an error.
2508func (client BaseClient) GetDeletedSecretSender(req *http.Request) (*http.Response, error) {
2509	return autorest.SendWithSender(client, req,
2510		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2511}
2512
2513// GetDeletedSecretResponder handles the response to the GetDeletedSecret request. The method always
2514// closes the http.Response Body.
2515func (client BaseClient) GetDeletedSecretResponder(resp *http.Response) (result DeletedSecretBundle, err error) {
2516	err = autorest.Respond(
2517		resp,
2518		client.ByInspecting(),
2519		azure.WithErrorUnlessStatusCode(http.StatusOK),
2520		autorest.ByUnmarshallingJSON(&result),
2521		autorest.ByClosing())
2522	result.Response = autorest.Response{Response: resp}
2523	return
2524}
2525
2526// GetDeletedSecrets the Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled
2527// for soft-delete. This operation requires the secrets/list permission.
2528// Parameters:
2529// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
2530// maxresults - maximum number of results to return in a page. If not specified the service will return up to
2531// 25 results.
2532func (client BaseClient) GetDeletedSecrets(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedSecretListResultPage, err error) {
2533	if tracing.IsEnabled() {
2534		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeletedSecrets")
2535		defer func() {
2536			sc := -1
2537			if result.dslr.Response.Response != nil {
2538				sc = result.dslr.Response.Response.StatusCode
2539			}
2540			tracing.EndSpan(ctx, sc, err)
2541		}()
2542	}
2543	if err := validation.Validate([]validation.Validation{
2544		{TargetValue: maxresults,
2545			Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false,
2546				Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil},
2547					{Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
2548				}}}}}); err != nil {
2549		return result, validation.NewError("keyvault.BaseClient", "GetDeletedSecrets", err.Error())
2550	}
2551
2552	result.fn = client.getDeletedSecretsNextResults
2553	req, err := client.GetDeletedSecretsPreparer(ctx, vaultBaseURL, maxresults)
2554	if err != nil {
2555		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSecrets", nil, "Failure preparing request")
2556		return
2557	}
2558
2559	resp, err := client.GetDeletedSecretsSender(req)
2560	if err != nil {
2561		result.dslr.Response = autorest.Response{Response: resp}
2562		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSecrets", resp, "Failure sending request")
2563		return
2564	}
2565
2566	result.dslr, err = client.GetDeletedSecretsResponder(resp)
2567	if err != nil {
2568		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetDeletedSecrets", resp, "Failure responding to request")
2569	}
2570
2571	return
2572}
2573
2574// GetDeletedSecretsPreparer prepares the GetDeletedSecrets request.
2575func (client BaseClient) GetDeletedSecretsPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) {
2576	urlParameters := map[string]interface{}{
2577		"vaultBaseUrl": vaultBaseURL,
2578	}
2579
2580	const APIVersion = "2016-10-01"
2581	queryParameters := map[string]interface{}{
2582		"api-version": APIVersion,
2583	}
2584	if maxresults != nil {
2585		queryParameters["maxresults"] = autorest.Encode("query", *maxresults)
2586	}
2587
2588	preparer := autorest.CreatePreparer(
2589		autorest.AsGet(),
2590		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
2591		autorest.WithPath("/deletedsecrets"),
2592		autorest.WithQueryParameters(queryParameters))
2593	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2594}
2595
2596// GetDeletedSecretsSender sends the GetDeletedSecrets request. The method will close the
2597// http.Response Body if it receives an error.
2598func (client BaseClient) GetDeletedSecretsSender(req *http.Request) (*http.Response, error) {
2599	return autorest.SendWithSender(client, req,
2600		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2601}
2602
2603// GetDeletedSecretsResponder handles the response to the GetDeletedSecrets request. The method always
2604// closes the http.Response Body.
2605func (client BaseClient) GetDeletedSecretsResponder(resp *http.Response) (result DeletedSecretListResult, err error) {
2606	err = autorest.Respond(
2607		resp,
2608		client.ByInspecting(),
2609		azure.WithErrorUnlessStatusCode(http.StatusOK),
2610		autorest.ByUnmarshallingJSON(&result),
2611		autorest.ByClosing())
2612	result.Response = autorest.Response{Response: resp}
2613	return
2614}
2615
2616// getDeletedSecretsNextResults retrieves the next set of results, if any.
2617func (client BaseClient) getDeletedSecretsNextResults(ctx context.Context, lastResults DeletedSecretListResult) (result DeletedSecretListResult, err error) {
2618	req, err := lastResults.deletedSecretListResultPreparer(ctx)
2619	if err != nil {
2620		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedSecretsNextResults", nil, "Failure preparing next results request")
2621	}
2622	if req == nil {
2623		return
2624	}
2625	resp, err := client.GetDeletedSecretsSender(req)
2626	if err != nil {
2627		result.Response = autorest.Response{Response: resp}
2628		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedSecretsNextResults", resp, "Failure sending next results request")
2629	}
2630	result, err = client.GetDeletedSecretsResponder(resp)
2631	if err != nil {
2632		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getDeletedSecretsNextResults", resp, "Failure responding to next results request")
2633	}
2634	return
2635}
2636
2637// GetDeletedSecretsComplete enumerates all values, automatically crossing page boundaries as required.
2638func (client BaseClient) GetDeletedSecretsComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedSecretListResultIterator, err error) {
2639	if tracing.IsEnabled() {
2640		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeletedSecrets")
2641		defer func() {
2642			sc := -1
2643			if result.Response().Response.Response != nil {
2644				sc = result.page.Response().Response.Response.StatusCode
2645			}
2646			tracing.EndSpan(ctx, sc, err)
2647		}()
2648	}
2649	result.page, err = client.GetDeletedSecrets(ctx, vaultBaseURL, maxresults)
2650	return
2651}
2652
2653// GetKey the get key operation is applicable to all key types. If the requested key is symmetric, then no key material
2654// is released in the response. This operation requires the keys/get permission.
2655// Parameters:
2656// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
2657// keyName - the name of the key to get.
2658// keyVersion - adding the version parameter retrieves a specific version of a key.
2659func (client BaseClient) GetKey(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string) (result KeyBundle, err error) {
2660	if tracing.IsEnabled() {
2661		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetKey")
2662		defer func() {
2663			sc := -1
2664			if result.Response.Response != nil {
2665				sc = result.Response.Response.StatusCode
2666			}
2667			tracing.EndSpan(ctx, sc, err)
2668		}()
2669	}
2670	req, err := client.GetKeyPreparer(ctx, vaultBaseURL, keyName, keyVersion)
2671	if err != nil {
2672		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKey", nil, "Failure preparing request")
2673		return
2674	}
2675
2676	resp, err := client.GetKeySender(req)
2677	if err != nil {
2678		result.Response = autorest.Response{Response: resp}
2679		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKey", resp, "Failure sending request")
2680		return
2681	}
2682
2683	result, err = client.GetKeyResponder(resp)
2684	if err != nil {
2685		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKey", resp, "Failure responding to request")
2686	}
2687
2688	return
2689}
2690
2691// GetKeyPreparer prepares the GetKey request.
2692func (client BaseClient) GetKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string) (*http.Request, error) {
2693	urlParameters := map[string]interface{}{
2694		"vaultBaseUrl": vaultBaseURL,
2695	}
2696
2697	pathParameters := map[string]interface{}{
2698		"key-name":    autorest.Encode("path", keyName),
2699		"key-version": autorest.Encode("path", keyVersion),
2700	}
2701
2702	const APIVersion = "2016-10-01"
2703	queryParameters := map[string]interface{}{
2704		"api-version": APIVersion,
2705	}
2706
2707	preparer := autorest.CreatePreparer(
2708		autorest.AsGet(),
2709		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
2710		autorest.WithPathParameters("/keys/{key-name}/{key-version}", pathParameters),
2711		autorest.WithQueryParameters(queryParameters))
2712	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2713}
2714
2715// GetKeySender sends the GetKey request. The method will close the
2716// http.Response Body if it receives an error.
2717func (client BaseClient) GetKeySender(req *http.Request) (*http.Response, error) {
2718	return autorest.SendWithSender(client, req,
2719		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2720}
2721
2722// GetKeyResponder handles the response to the GetKey request. The method always
2723// closes the http.Response Body.
2724func (client BaseClient) GetKeyResponder(resp *http.Response) (result KeyBundle, err error) {
2725	err = autorest.Respond(
2726		resp,
2727		client.ByInspecting(),
2728		azure.WithErrorUnlessStatusCode(http.StatusOK),
2729		autorest.ByUnmarshallingJSON(&result),
2730		autorest.ByClosing())
2731	result.Response = autorest.Response{Response: resp}
2732	return
2733}
2734
2735// GetKeys retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a
2736// stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and
2737// tags are provided in the response. Individual versions of a key are not listed in the response. This operation
2738// requires the keys/list permission.
2739// Parameters:
2740// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
2741// maxresults - maximum number of results to return in a page. If not specified the service will return up to
2742// 25 results.
2743func (client BaseClient) GetKeys(ctx context.Context, vaultBaseURL string, maxresults *int32) (result KeyListResultPage, err error) {
2744	if tracing.IsEnabled() {
2745		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetKeys")
2746		defer func() {
2747			sc := -1
2748			if result.klr.Response.Response != nil {
2749				sc = result.klr.Response.Response.StatusCode
2750			}
2751			tracing.EndSpan(ctx, sc, err)
2752		}()
2753	}
2754	if err := validation.Validate([]validation.Validation{
2755		{TargetValue: maxresults,
2756			Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false,
2757				Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil},
2758					{Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
2759				}}}}}); err != nil {
2760		return result, validation.NewError("keyvault.BaseClient", "GetKeys", err.Error())
2761	}
2762
2763	result.fn = client.getKeysNextResults
2764	req, err := client.GetKeysPreparer(ctx, vaultBaseURL, maxresults)
2765	if err != nil {
2766		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKeys", nil, "Failure preparing request")
2767		return
2768	}
2769
2770	resp, err := client.GetKeysSender(req)
2771	if err != nil {
2772		result.klr.Response = autorest.Response{Response: resp}
2773		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKeys", resp, "Failure sending request")
2774		return
2775	}
2776
2777	result.klr, err = client.GetKeysResponder(resp)
2778	if err != nil {
2779		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKeys", resp, "Failure responding to request")
2780	}
2781
2782	return
2783}
2784
2785// GetKeysPreparer prepares the GetKeys request.
2786func (client BaseClient) GetKeysPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) {
2787	urlParameters := map[string]interface{}{
2788		"vaultBaseUrl": vaultBaseURL,
2789	}
2790
2791	const APIVersion = "2016-10-01"
2792	queryParameters := map[string]interface{}{
2793		"api-version": APIVersion,
2794	}
2795	if maxresults != nil {
2796		queryParameters["maxresults"] = autorest.Encode("query", *maxresults)
2797	}
2798
2799	preparer := autorest.CreatePreparer(
2800		autorest.AsGet(),
2801		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
2802		autorest.WithPath("/keys"),
2803		autorest.WithQueryParameters(queryParameters))
2804	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2805}
2806
2807// GetKeysSender sends the GetKeys request. The method will close the
2808// http.Response Body if it receives an error.
2809func (client BaseClient) GetKeysSender(req *http.Request) (*http.Response, error) {
2810	return autorest.SendWithSender(client, req,
2811		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2812}
2813
2814// GetKeysResponder handles the response to the GetKeys request. The method always
2815// closes the http.Response Body.
2816func (client BaseClient) GetKeysResponder(resp *http.Response) (result KeyListResult, err error) {
2817	err = autorest.Respond(
2818		resp,
2819		client.ByInspecting(),
2820		azure.WithErrorUnlessStatusCode(http.StatusOK),
2821		autorest.ByUnmarshallingJSON(&result),
2822		autorest.ByClosing())
2823	result.Response = autorest.Response{Response: resp}
2824	return
2825}
2826
2827// getKeysNextResults retrieves the next set of results, if any.
2828func (client BaseClient) getKeysNextResults(ctx context.Context, lastResults KeyListResult) (result KeyListResult, err error) {
2829	req, err := lastResults.keyListResultPreparer(ctx)
2830	if err != nil {
2831		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getKeysNextResults", nil, "Failure preparing next results request")
2832	}
2833	if req == nil {
2834		return
2835	}
2836	resp, err := client.GetKeysSender(req)
2837	if err != nil {
2838		result.Response = autorest.Response{Response: resp}
2839		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getKeysNextResults", resp, "Failure sending next results request")
2840	}
2841	result, err = client.GetKeysResponder(resp)
2842	if err != nil {
2843		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getKeysNextResults", resp, "Failure responding to next results request")
2844	}
2845	return
2846}
2847
2848// GetKeysComplete enumerates all values, automatically crossing page boundaries as required.
2849func (client BaseClient) GetKeysComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result KeyListResultIterator, err error) {
2850	if tracing.IsEnabled() {
2851		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetKeys")
2852		defer func() {
2853			sc := -1
2854			if result.Response().Response.Response != nil {
2855				sc = result.page.Response().Response.Response.StatusCode
2856			}
2857			tracing.EndSpan(ctx, sc, err)
2858		}()
2859	}
2860	result.page, err = client.GetKeys(ctx, vaultBaseURL, maxresults)
2861	return
2862}
2863
2864// GetKeyVersions the full key identifier, attributes, and tags are provided in the response. This operation requires
2865// the keys/list permission.
2866// Parameters:
2867// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
2868// keyName - the name of the key.
2869// maxresults - maximum number of results to return in a page. If not specified the service will return up to
2870// 25 results.
2871func (client BaseClient) GetKeyVersions(ctx context.Context, vaultBaseURL string, keyName string, maxresults *int32) (result KeyListResultPage, err error) {
2872	if tracing.IsEnabled() {
2873		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetKeyVersions")
2874		defer func() {
2875			sc := -1
2876			if result.klr.Response.Response != nil {
2877				sc = result.klr.Response.Response.StatusCode
2878			}
2879			tracing.EndSpan(ctx, sc, err)
2880		}()
2881	}
2882	if err := validation.Validate([]validation.Validation{
2883		{TargetValue: maxresults,
2884			Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false,
2885				Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil},
2886					{Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
2887				}}}}}); err != nil {
2888		return result, validation.NewError("keyvault.BaseClient", "GetKeyVersions", err.Error())
2889	}
2890
2891	result.fn = client.getKeyVersionsNextResults
2892	req, err := client.GetKeyVersionsPreparer(ctx, vaultBaseURL, keyName, maxresults)
2893	if err != nil {
2894		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKeyVersions", nil, "Failure preparing request")
2895		return
2896	}
2897
2898	resp, err := client.GetKeyVersionsSender(req)
2899	if err != nil {
2900		result.klr.Response = autorest.Response{Response: resp}
2901		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKeyVersions", resp, "Failure sending request")
2902		return
2903	}
2904
2905	result.klr, err = client.GetKeyVersionsResponder(resp)
2906	if err != nil {
2907		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetKeyVersions", resp, "Failure responding to request")
2908	}
2909
2910	return
2911}
2912
2913// GetKeyVersionsPreparer prepares the GetKeyVersions request.
2914func (client BaseClient) GetKeyVersionsPreparer(ctx context.Context, vaultBaseURL string, keyName string, maxresults *int32) (*http.Request, error) {
2915	urlParameters := map[string]interface{}{
2916		"vaultBaseUrl": vaultBaseURL,
2917	}
2918
2919	pathParameters := map[string]interface{}{
2920		"key-name": autorest.Encode("path", keyName),
2921	}
2922
2923	const APIVersion = "2016-10-01"
2924	queryParameters := map[string]interface{}{
2925		"api-version": APIVersion,
2926	}
2927	if maxresults != nil {
2928		queryParameters["maxresults"] = autorest.Encode("query", *maxresults)
2929	}
2930
2931	preparer := autorest.CreatePreparer(
2932		autorest.AsGet(),
2933		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
2934		autorest.WithPathParameters("/keys/{key-name}/versions", pathParameters),
2935		autorest.WithQueryParameters(queryParameters))
2936	return preparer.Prepare((&http.Request{}).WithContext(ctx))
2937}
2938
2939// GetKeyVersionsSender sends the GetKeyVersions request. The method will close the
2940// http.Response Body if it receives an error.
2941func (client BaseClient) GetKeyVersionsSender(req *http.Request) (*http.Response, error) {
2942	return autorest.SendWithSender(client, req,
2943		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2944}
2945
2946// GetKeyVersionsResponder handles the response to the GetKeyVersions request. The method always
2947// closes the http.Response Body.
2948func (client BaseClient) GetKeyVersionsResponder(resp *http.Response) (result KeyListResult, err error) {
2949	err = autorest.Respond(
2950		resp,
2951		client.ByInspecting(),
2952		azure.WithErrorUnlessStatusCode(http.StatusOK),
2953		autorest.ByUnmarshallingJSON(&result),
2954		autorest.ByClosing())
2955	result.Response = autorest.Response{Response: resp}
2956	return
2957}
2958
2959// getKeyVersionsNextResults retrieves the next set of results, if any.
2960func (client BaseClient) getKeyVersionsNextResults(ctx context.Context, lastResults KeyListResult) (result KeyListResult, err error) {
2961	req, err := lastResults.keyListResultPreparer(ctx)
2962	if err != nil {
2963		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getKeyVersionsNextResults", nil, "Failure preparing next results request")
2964	}
2965	if req == nil {
2966		return
2967	}
2968	resp, err := client.GetKeyVersionsSender(req)
2969	if err != nil {
2970		result.Response = autorest.Response{Response: resp}
2971		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getKeyVersionsNextResults", resp, "Failure sending next results request")
2972	}
2973	result, err = client.GetKeyVersionsResponder(resp)
2974	if err != nil {
2975		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getKeyVersionsNextResults", resp, "Failure responding to next results request")
2976	}
2977	return
2978}
2979
2980// GetKeyVersionsComplete enumerates all values, automatically crossing page boundaries as required.
2981func (client BaseClient) GetKeyVersionsComplete(ctx context.Context, vaultBaseURL string, keyName string, maxresults *int32) (result KeyListResultIterator, err error) {
2982	if tracing.IsEnabled() {
2983		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetKeyVersions")
2984		defer func() {
2985			sc := -1
2986			if result.Response().Response.Response != nil {
2987				sc = result.page.Response().Response.Response.StatusCode
2988			}
2989			tracing.EndSpan(ctx, sc, err)
2990		}()
2991	}
2992	result.page, err = client.GetKeyVersions(ctx, vaultBaseURL, keyName, maxresults)
2993	return
2994}
2995
2996// GetSasDefinition gets information about a SAS definition for the specified storage account. This operation requires
2997// the storage/getsas permission.
2998// Parameters:
2999// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
3000// storageAccountName - the name of the storage account.
3001// sasDefinitionName - the name of the SAS definition.
3002func (client BaseClient) GetSasDefinition(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string) (result SasDefinitionBundle, err error) {
3003	if tracing.IsEnabled() {
3004		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSasDefinition")
3005		defer func() {
3006			sc := -1
3007			if result.Response.Response != nil {
3008				sc = result.Response.Response.StatusCode
3009			}
3010			tracing.EndSpan(ctx, sc, err)
3011		}()
3012	}
3013	if err := validation.Validate([]validation.Validation{
3014		{TargetValue: storageAccountName,
3015			Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}},
3016		{TargetValue: sasDefinitionName,
3017			Constraints: []validation.Constraint{{Target: "sasDefinitionName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil {
3018		return result, validation.NewError("keyvault.BaseClient", "GetSasDefinition", err.Error())
3019	}
3020
3021	req, err := client.GetSasDefinitionPreparer(ctx, vaultBaseURL, storageAccountName, sasDefinitionName)
3022	if err != nil {
3023		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSasDefinition", nil, "Failure preparing request")
3024		return
3025	}
3026
3027	resp, err := client.GetSasDefinitionSender(req)
3028	if err != nil {
3029		result.Response = autorest.Response{Response: resp}
3030		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSasDefinition", resp, "Failure sending request")
3031		return
3032	}
3033
3034	result, err = client.GetSasDefinitionResponder(resp)
3035	if err != nil {
3036		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSasDefinition", resp, "Failure responding to request")
3037	}
3038
3039	return
3040}
3041
3042// GetSasDefinitionPreparer prepares the GetSasDefinition request.
3043func (client BaseClient) GetSasDefinitionPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string) (*http.Request, error) {
3044	urlParameters := map[string]interface{}{
3045		"vaultBaseUrl": vaultBaseURL,
3046	}
3047
3048	pathParameters := map[string]interface{}{
3049		"sas-definition-name":  autorest.Encode("path", sasDefinitionName),
3050		"storage-account-name": autorest.Encode("path", storageAccountName),
3051	}
3052
3053	const APIVersion = "2016-10-01"
3054	queryParameters := map[string]interface{}{
3055		"api-version": APIVersion,
3056	}
3057
3058	preparer := autorest.CreatePreparer(
3059		autorest.AsGet(),
3060		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
3061		autorest.WithPathParameters("/storage/{storage-account-name}/sas/{sas-definition-name}", pathParameters),
3062		autorest.WithQueryParameters(queryParameters))
3063	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3064}
3065
3066// GetSasDefinitionSender sends the GetSasDefinition request. The method will close the
3067// http.Response Body if it receives an error.
3068func (client BaseClient) GetSasDefinitionSender(req *http.Request) (*http.Response, error) {
3069	return autorest.SendWithSender(client, req,
3070		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3071}
3072
3073// GetSasDefinitionResponder handles the response to the GetSasDefinition request. The method always
3074// closes the http.Response Body.
3075func (client BaseClient) GetSasDefinitionResponder(resp *http.Response) (result SasDefinitionBundle, err error) {
3076	err = autorest.Respond(
3077		resp,
3078		client.ByInspecting(),
3079		azure.WithErrorUnlessStatusCode(http.StatusOK),
3080		autorest.ByUnmarshallingJSON(&result),
3081		autorest.ByClosing())
3082	result.Response = autorest.Response{Response: resp}
3083	return
3084}
3085
3086// GetSasDefinitions list storage SAS definitions for the given storage account. This operation requires the
3087// storage/listsas permission.
3088// Parameters:
3089// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
3090// storageAccountName - the name of the storage account.
3091// maxresults - maximum number of results to return in a page. If not specified the service will return up to
3092// 25 results.
3093func (client BaseClient) GetSasDefinitions(ctx context.Context, vaultBaseURL string, storageAccountName string, maxresults *int32) (result SasDefinitionListResultPage, err error) {
3094	if tracing.IsEnabled() {
3095		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSasDefinitions")
3096		defer func() {
3097			sc := -1
3098			if result.sdlr.Response.Response != nil {
3099				sc = result.sdlr.Response.Response.StatusCode
3100			}
3101			tracing.EndSpan(ctx, sc, err)
3102		}()
3103	}
3104	if err := validation.Validate([]validation.Validation{
3105		{TargetValue: storageAccountName,
3106			Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}},
3107		{TargetValue: maxresults,
3108			Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false,
3109				Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil},
3110					{Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
3111				}}}}}); err != nil {
3112		return result, validation.NewError("keyvault.BaseClient", "GetSasDefinitions", err.Error())
3113	}
3114
3115	result.fn = client.getSasDefinitionsNextResults
3116	req, err := client.GetSasDefinitionsPreparer(ctx, vaultBaseURL, storageAccountName, maxresults)
3117	if err != nil {
3118		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSasDefinitions", nil, "Failure preparing request")
3119		return
3120	}
3121
3122	resp, err := client.GetSasDefinitionsSender(req)
3123	if err != nil {
3124		result.sdlr.Response = autorest.Response{Response: resp}
3125		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSasDefinitions", resp, "Failure sending request")
3126		return
3127	}
3128
3129	result.sdlr, err = client.GetSasDefinitionsResponder(resp)
3130	if err != nil {
3131		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSasDefinitions", resp, "Failure responding to request")
3132	}
3133
3134	return
3135}
3136
3137// GetSasDefinitionsPreparer prepares the GetSasDefinitions request.
3138func (client BaseClient) GetSasDefinitionsPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, maxresults *int32) (*http.Request, error) {
3139	urlParameters := map[string]interface{}{
3140		"vaultBaseUrl": vaultBaseURL,
3141	}
3142
3143	pathParameters := map[string]interface{}{
3144		"storage-account-name": autorest.Encode("path", storageAccountName),
3145	}
3146
3147	const APIVersion = "2016-10-01"
3148	queryParameters := map[string]interface{}{
3149		"api-version": APIVersion,
3150	}
3151	if maxresults != nil {
3152		queryParameters["maxresults"] = autorest.Encode("query", *maxresults)
3153	}
3154
3155	preparer := autorest.CreatePreparer(
3156		autorest.AsGet(),
3157		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
3158		autorest.WithPathParameters("/storage/{storage-account-name}/sas", pathParameters),
3159		autorest.WithQueryParameters(queryParameters))
3160	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3161}
3162
3163// GetSasDefinitionsSender sends the GetSasDefinitions request. The method will close the
3164// http.Response Body if it receives an error.
3165func (client BaseClient) GetSasDefinitionsSender(req *http.Request) (*http.Response, error) {
3166	return autorest.SendWithSender(client, req,
3167		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3168}
3169
3170// GetSasDefinitionsResponder handles the response to the GetSasDefinitions request. The method always
3171// closes the http.Response Body.
3172func (client BaseClient) GetSasDefinitionsResponder(resp *http.Response) (result SasDefinitionListResult, err error) {
3173	err = autorest.Respond(
3174		resp,
3175		client.ByInspecting(),
3176		azure.WithErrorUnlessStatusCode(http.StatusOK),
3177		autorest.ByUnmarshallingJSON(&result),
3178		autorest.ByClosing())
3179	result.Response = autorest.Response{Response: resp}
3180	return
3181}
3182
3183// getSasDefinitionsNextResults retrieves the next set of results, if any.
3184func (client BaseClient) getSasDefinitionsNextResults(ctx context.Context, lastResults SasDefinitionListResult) (result SasDefinitionListResult, err error) {
3185	req, err := lastResults.sasDefinitionListResultPreparer(ctx)
3186	if err != nil {
3187		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSasDefinitionsNextResults", nil, "Failure preparing next results request")
3188	}
3189	if req == nil {
3190		return
3191	}
3192	resp, err := client.GetSasDefinitionsSender(req)
3193	if err != nil {
3194		result.Response = autorest.Response{Response: resp}
3195		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSasDefinitionsNextResults", resp, "Failure sending next results request")
3196	}
3197	result, err = client.GetSasDefinitionsResponder(resp)
3198	if err != nil {
3199		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSasDefinitionsNextResults", resp, "Failure responding to next results request")
3200	}
3201	return
3202}
3203
3204// GetSasDefinitionsComplete enumerates all values, automatically crossing page boundaries as required.
3205func (client BaseClient) GetSasDefinitionsComplete(ctx context.Context, vaultBaseURL string, storageAccountName string, maxresults *int32) (result SasDefinitionListResultIterator, err error) {
3206	if tracing.IsEnabled() {
3207		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSasDefinitions")
3208		defer func() {
3209			sc := -1
3210			if result.Response().Response.Response != nil {
3211				sc = result.page.Response().Response.Response.StatusCode
3212			}
3213			tracing.EndSpan(ctx, sc, err)
3214		}()
3215	}
3216	result.page, err = client.GetSasDefinitions(ctx, vaultBaseURL, storageAccountName, maxresults)
3217	return
3218}
3219
3220// GetSecret the GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the
3221// secrets/get permission.
3222// Parameters:
3223// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
3224// secretName - the name of the secret.
3225// secretVersion - the version of the secret.
3226func (client BaseClient) GetSecret(ctx context.Context, vaultBaseURL string, secretName string, secretVersion string) (result SecretBundle, err error) {
3227	if tracing.IsEnabled() {
3228		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSecret")
3229		defer func() {
3230			sc := -1
3231			if result.Response.Response != nil {
3232				sc = result.Response.Response.StatusCode
3233			}
3234			tracing.EndSpan(ctx, sc, err)
3235		}()
3236	}
3237	req, err := client.GetSecretPreparer(ctx, vaultBaseURL, secretName, secretVersion)
3238	if err != nil {
3239		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecret", nil, "Failure preparing request")
3240		return
3241	}
3242
3243	resp, err := client.GetSecretSender(req)
3244	if err != nil {
3245		result.Response = autorest.Response{Response: resp}
3246		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecret", resp, "Failure sending request")
3247		return
3248	}
3249
3250	result, err = client.GetSecretResponder(resp)
3251	if err != nil {
3252		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecret", resp, "Failure responding to request")
3253	}
3254
3255	return
3256}
3257
3258// GetSecretPreparer prepares the GetSecret request.
3259func (client BaseClient) GetSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string, secretVersion string) (*http.Request, error) {
3260	urlParameters := map[string]interface{}{
3261		"vaultBaseUrl": vaultBaseURL,
3262	}
3263
3264	pathParameters := map[string]interface{}{
3265		"secret-name":    autorest.Encode("path", secretName),
3266		"secret-version": autorest.Encode("path", secretVersion),
3267	}
3268
3269	const APIVersion = "2016-10-01"
3270	queryParameters := map[string]interface{}{
3271		"api-version": APIVersion,
3272	}
3273
3274	preparer := autorest.CreatePreparer(
3275		autorest.AsGet(),
3276		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
3277		autorest.WithPathParameters("/secrets/{secret-name}/{secret-version}", pathParameters),
3278		autorest.WithQueryParameters(queryParameters))
3279	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3280}
3281
3282// GetSecretSender sends the GetSecret request. The method will close the
3283// http.Response Body if it receives an error.
3284func (client BaseClient) GetSecretSender(req *http.Request) (*http.Response, error) {
3285	return autorest.SendWithSender(client, req,
3286		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3287}
3288
3289// GetSecretResponder handles the response to the GetSecret request. The method always
3290// closes the http.Response Body.
3291func (client BaseClient) GetSecretResponder(resp *http.Response) (result SecretBundle, err error) {
3292	err = autorest.Respond(
3293		resp,
3294		client.ByInspecting(),
3295		azure.WithErrorUnlessStatusCode(http.StatusOK),
3296		autorest.ByUnmarshallingJSON(&result),
3297		autorest.ByClosing())
3298	result.Response = autorest.Response{Response: resp}
3299	return
3300}
3301
3302// GetSecrets the Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and
3303// its attributes are provided in the response. Individual secret versions are not listed in the response. This
3304// operation requires the secrets/list permission.
3305// Parameters:
3306// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
3307// maxresults - maximum number of results to return in a page. If not specified, the service will return up to
3308// 25 results.
3309func (client BaseClient) GetSecrets(ctx context.Context, vaultBaseURL string, maxresults *int32) (result SecretListResultPage, err error) {
3310	if tracing.IsEnabled() {
3311		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSecrets")
3312		defer func() {
3313			sc := -1
3314			if result.slr.Response.Response != nil {
3315				sc = result.slr.Response.Response.StatusCode
3316			}
3317			tracing.EndSpan(ctx, sc, err)
3318		}()
3319	}
3320	if err := validation.Validate([]validation.Validation{
3321		{TargetValue: maxresults,
3322			Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false,
3323				Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil},
3324					{Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
3325				}}}}}); err != nil {
3326		return result, validation.NewError("keyvault.BaseClient", "GetSecrets", err.Error())
3327	}
3328
3329	result.fn = client.getSecretsNextResults
3330	req, err := client.GetSecretsPreparer(ctx, vaultBaseURL, maxresults)
3331	if err != nil {
3332		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecrets", nil, "Failure preparing request")
3333		return
3334	}
3335
3336	resp, err := client.GetSecretsSender(req)
3337	if err != nil {
3338		result.slr.Response = autorest.Response{Response: resp}
3339		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecrets", resp, "Failure sending request")
3340		return
3341	}
3342
3343	result.slr, err = client.GetSecretsResponder(resp)
3344	if err != nil {
3345		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecrets", resp, "Failure responding to request")
3346	}
3347
3348	return
3349}
3350
3351// GetSecretsPreparer prepares the GetSecrets request.
3352func (client BaseClient) GetSecretsPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) {
3353	urlParameters := map[string]interface{}{
3354		"vaultBaseUrl": vaultBaseURL,
3355	}
3356
3357	const APIVersion = "2016-10-01"
3358	queryParameters := map[string]interface{}{
3359		"api-version": APIVersion,
3360	}
3361	if maxresults != nil {
3362		queryParameters["maxresults"] = autorest.Encode("query", *maxresults)
3363	}
3364
3365	preparer := autorest.CreatePreparer(
3366		autorest.AsGet(),
3367		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
3368		autorest.WithPath("/secrets"),
3369		autorest.WithQueryParameters(queryParameters))
3370	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3371}
3372
3373// GetSecretsSender sends the GetSecrets request. The method will close the
3374// http.Response Body if it receives an error.
3375func (client BaseClient) GetSecretsSender(req *http.Request) (*http.Response, error) {
3376	return autorest.SendWithSender(client, req,
3377		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3378}
3379
3380// GetSecretsResponder handles the response to the GetSecrets request. The method always
3381// closes the http.Response Body.
3382func (client BaseClient) GetSecretsResponder(resp *http.Response) (result SecretListResult, err error) {
3383	err = autorest.Respond(
3384		resp,
3385		client.ByInspecting(),
3386		azure.WithErrorUnlessStatusCode(http.StatusOK),
3387		autorest.ByUnmarshallingJSON(&result),
3388		autorest.ByClosing())
3389	result.Response = autorest.Response{Response: resp}
3390	return
3391}
3392
3393// getSecretsNextResults retrieves the next set of results, if any.
3394func (client BaseClient) getSecretsNextResults(ctx context.Context, lastResults SecretListResult) (result SecretListResult, err error) {
3395	req, err := lastResults.secretListResultPreparer(ctx)
3396	if err != nil {
3397		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSecretsNextResults", nil, "Failure preparing next results request")
3398	}
3399	if req == nil {
3400		return
3401	}
3402	resp, err := client.GetSecretsSender(req)
3403	if err != nil {
3404		result.Response = autorest.Response{Response: resp}
3405		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSecretsNextResults", resp, "Failure sending next results request")
3406	}
3407	result, err = client.GetSecretsResponder(resp)
3408	if err != nil {
3409		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSecretsNextResults", resp, "Failure responding to next results request")
3410	}
3411	return
3412}
3413
3414// GetSecretsComplete enumerates all values, automatically crossing page boundaries as required.
3415func (client BaseClient) GetSecretsComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result SecretListResultIterator, err error) {
3416	if tracing.IsEnabled() {
3417		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSecrets")
3418		defer func() {
3419			sc := -1
3420			if result.Response().Response.Response != nil {
3421				sc = result.page.Response().Response.Response.StatusCode
3422			}
3423			tracing.EndSpan(ctx, sc, err)
3424		}()
3425	}
3426	result.page, err = client.GetSecrets(ctx, vaultBaseURL, maxresults)
3427	return
3428}
3429
3430// GetSecretVersions the full secret identifier and attributes are provided in the response. No values are returned for
3431// the secrets. This operations requires the secrets/list permission.
3432// Parameters:
3433// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
3434// secretName - the name of the secret.
3435// maxresults - maximum number of results to return in a page. If not specified, the service will return up to
3436// 25 results.
3437func (client BaseClient) GetSecretVersions(ctx context.Context, vaultBaseURL string, secretName string, maxresults *int32) (result SecretListResultPage, err error) {
3438	if tracing.IsEnabled() {
3439		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSecretVersions")
3440		defer func() {
3441			sc := -1
3442			if result.slr.Response.Response != nil {
3443				sc = result.slr.Response.Response.StatusCode
3444			}
3445			tracing.EndSpan(ctx, sc, err)
3446		}()
3447	}
3448	if err := validation.Validate([]validation.Validation{
3449		{TargetValue: maxresults,
3450			Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false,
3451				Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil},
3452					{Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
3453				}}}}}); err != nil {
3454		return result, validation.NewError("keyvault.BaseClient", "GetSecretVersions", err.Error())
3455	}
3456
3457	result.fn = client.getSecretVersionsNextResults
3458	req, err := client.GetSecretVersionsPreparer(ctx, vaultBaseURL, secretName, maxresults)
3459	if err != nil {
3460		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecretVersions", nil, "Failure preparing request")
3461		return
3462	}
3463
3464	resp, err := client.GetSecretVersionsSender(req)
3465	if err != nil {
3466		result.slr.Response = autorest.Response{Response: resp}
3467		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecretVersions", resp, "Failure sending request")
3468		return
3469	}
3470
3471	result.slr, err = client.GetSecretVersionsResponder(resp)
3472	if err != nil {
3473		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetSecretVersions", resp, "Failure responding to request")
3474	}
3475
3476	return
3477}
3478
3479// GetSecretVersionsPreparer prepares the GetSecretVersions request.
3480func (client BaseClient) GetSecretVersionsPreparer(ctx context.Context, vaultBaseURL string, secretName string, maxresults *int32) (*http.Request, error) {
3481	urlParameters := map[string]interface{}{
3482		"vaultBaseUrl": vaultBaseURL,
3483	}
3484
3485	pathParameters := map[string]interface{}{
3486		"secret-name": autorest.Encode("path", secretName),
3487	}
3488
3489	const APIVersion = "2016-10-01"
3490	queryParameters := map[string]interface{}{
3491		"api-version": APIVersion,
3492	}
3493	if maxresults != nil {
3494		queryParameters["maxresults"] = autorest.Encode("query", *maxresults)
3495	}
3496
3497	preparer := autorest.CreatePreparer(
3498		autorest.AsGet(),
3499		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
3500		autorest.WithPathParameters("/secrets/{secret-name}/versions", pathParameters),
3501		autorest.WithQueryParameters(queryParameters))
3502	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3503}
3504
3505// GetSecretVersionsSender sends the GetSecretVersions request. The method will close the
3506// http.Response Body if it receives an error.
3507func (client BaseClient) GetSecretVersionsSender(req *http.Request) (*http.Response, error) {
3508	return autorest.SendWithSender(client, req,
3509		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3510}
3511
3512// GetSecretVersionsResponder handles the response to the GetSecretVersions request. The method always
3513// closes the http.Response Body.
3514func (client BaseClient) GetSecretVersionsResponder(resp *http.Response) (result SecretListResult, err error) {
3515	err = autorest.Respond(
3516		resp,
3517		client.ByInspecting(),
3518		azure.WithErrorUnlessStatusCode(http.StatusOK),
3519		autorest.ByUnmarshallingJSON(&result),
3520		autorest.ByClosing())
3521	result.Response = autorest.Response{Response: resp}
3522	return
3523}
3524
3525// getSecretVersionsNextResults retrieves the next set of results, if any.
3526func (client BaseClient) getSecretVersionsNextResults(ctx context.Context, lastResults SecretListResult) (result SecretListResult, err error) {
3527	req, err := lastResults.secretListResultPreparer(ctx)
3528	if err != nil {
3529		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSecretVersionsNextResults", nil, "Failure preparing next results request")
3530	}
3531	if req == nil {
3532		return
3533	}
3534	resp, err := client.GetSecretVersionsSender(req)
3535	if err != nil {
3536		result.Response = autorest.Response{Response: resp}
3537		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSecretVersionsNextResults", resp, "Failure sending next results request")
3538	}
3539	result, err = client.GetSecretVersionsResponder(resp)
3540	if err != nil {
3541		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getSecretVersionsNextResults", resp, "Failure responding to next results request")
3542	}
3543	return
3544}
3545
3546// GetSecretVersionsComplete enumerates all values, automatically crossing page boundaries as required.
3547func (client BaseClient) GetSecretVersionsComplete(ctx context.Context, vaultBaseURL string, secretName string, maxresults *int32) (result SecretListResultIterator, err error) {
3548	if tracing.IsEnabled() {
3549		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSecretVersions")
3550		defer func() {
3551			sc := -1
3552			if result.Response().Response.Response != nil {
3553				sc = result.page.Response().Response.Response.StatusCode
3554			}
3555			tracing.EndSpan(ctx, sc, err)
3556		}()
3557	}
3558	result.page, err = client.GetSecretVersions(ctx, vaultBaseURL, secretName, maxresults)
3559	return
3560}
3561
3562// GetStorageAccount gets information about a specified storage account. This operation requires the storage/get
3563// permission.
3564// Parameters:
3565// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
3566// storageAccountName - the name of the storage account.
3567func (client BaseClient) GetStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string) (result StorageBundle, err error) {
3568	if tracing.IsEnabled() {
3569		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetStorageAccount")
3570		defer func() {
3571			sc := -1
3572			if result.Response.Response != nil {
3573				sc = result.Response.Response.StatusCode
3574			}
3575			tracing.EndSpan(ctx, sc, err)
3576		}()
3577	}
3578	if err := validation.Validate([]validation.Validation{
3579		{TargetValue: storageAccountName,
3580			Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil {
3581		return result, validation.NewError("keyvault.BaseClient", "GetStorageAccount", err.Error())
3582	}
3583
3584	req, err := client.GetStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName)
3585	if err != nil {
3586		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetStorageAccount", nil, "Failure preparing request")
3587		return
3588	}
3589
3590	resp, err := client.GetStorageAccountSender(req)
3591	if err != nil {
3592		result.Response = autorest.Response{Response: resp}
3593		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetStorageAccount", resp, "Failure sending request")
3594		return
3595	}
3596
3597	result, err = client.GetStorageAccountResponder(resp)
3598	if err != nil {
3599		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetStorageAccount", resp, "Failure responding to request")
3600	}
3601
3602	return
3603}
3604
3605// GetStorageAccountPreparer prepares the GetStorageAccount request.
3606func (client BaseClient) GetStorageAccountPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string) (*http.Request, error) {
3607	urlParameters := map[string]interface{}{
3608		"vaultBaseUrl": vaultBaseURL,
3609	}
3610
3611	pathParameters := map[string]interface{}{
3612		"storage-account-name": autorest.Encode("path", storageAccountName),
3613	}
3614
3615	const APIVersion = "2016-10-01"
3616	queryParameters := map[string]interface{}{
3617		"api-version": APIVersion,
3618	}
3619
3620	preparer := autorest.CreatePreparer(
3621		autorest.AsGet(),
3622		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
3623		autorest.WithPathParameters("/storage/{storage-account-name}", pathParameters),
3624		autorest.WithQueryParameters(queryParameters))
3625	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3626}
3627
3628// GetStorageAccountSender sends the GetStorageAccount request. The method will close the
3629// http.Response Body if it receives an error.
3630func (client BaseClient) GetStorageAccountSender(req *http.Request) (*http.Response, error) {
3631	return autorest.SendWithSender(client, req,
3632		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3633}
3634
3635// GetStorageAccountResponder handles the response to the GetStorageAccount request. The method always
3636// closes the http.Response Body.
3637func (client BaseClient) GetStorageAccountResponder(resp *http.Response) (result StorageBundle, err error) {
3638	err = autorest.Respond(
3639		resp,
3640		client.ByInspecting(),
3641		azure.WithErrorUnlessStatusCode(http.StatusOK),
3642		autorest.ByUnmarshallingJSON(&result),
3643		autorest.ByClosing())
3644	result.Response = autorest.Response{Response: resp}
3645	return
3646}
3647
3648// GetStorageAccounts list storage accounts managed by the specified key vault. This operation requires the
3649// storage/list permission.
3650// Parameters:
3651// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
3652// maxresults - maximum number of results to return in a page. If not specified the service will return up to
3653// 25 results.
3654func (client BaseClient) GetStorageAccounts(ctx context.Context, vaultBaseURL string, maxresults *int32) (result StorageListResultPage, err error) {
3655	if tracing.IsEnabled() {
3656		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetStorageAccounts")
3657		defer func() {
3658			sc := -1
3659			if result.slr.Response.Response != nil {
3660				sc = result.slr.Response.Response.StatusCode
3661			}
3662			tracing.EndSpan(ctx, sc, err)
3663		}()
3664	}
3665	if err := validation.Validate([]validation.Validation{
3666		{TargetValue: maxresults,
3667			Constraints: []validation.Constraint{{Target: "maxresults", Name: validation.Null, Rule: false,
3668				Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: int64(25), Chain: nil},
3669					{Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
3670				}}}}}); err != nil {
3671		return result, validation.NewError("keyvault.BaseClient", "GetStorageAccounts", err.Error())
3672	}
3673
3674	result.fn = client.getStorageAccountsNextResults
3675	req, err := client.GetStorageAccountsPreparer(ctx, vaultBaseURL, maxresults)
3676	if err != nil {
3677		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetStorageAccounts", nil, "Failure preparing request")
3678		return
3679	}
3680
3681	resp, err := client.GetStorageAccountsSender(req)
3682	if err != nil {
3683		result.slr.Response = autorest.Response{Response: resp}
3684		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetStorageAccounts", resp, "Failure sending request")
3685		return
3686	}
3687
3688	result.slr, err = client.GetStorageAccountsResponder(resp)
3689	if err != nil {
3690		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "GetStorageAccounts", resp, "Failure responding to request")
3691	}
3692
3693	return
3694}
3695
3696// GetStorageAccountsPreparer prepares the GetStorageAccounts request.
3697func (client BaseClient) GetStorageAccountsPreparer(ctx context.Context, vaultBaseURL string, maxresults *int32) (*http.Request, error) {
3698	urlParameters := map[string]interface{}{
3699		"vaultBaseUrl": vaultBaseURL,
3700	}
3701
3702	const APIVersion = "2016-10-01"
3703	queryParameters := map[string]interface{}{
3704		"api-version": APIVersion,
3705	}
3706	if maxresults != nil {
3707		queryParameters["maxresults"] = autorest.Encode("query", *maxresults)
3708	}
3709
3710	preparer := autorest.CreatePreparer(
3711		autorest.AsGet(),
3712		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
3713		autorest.WithPath("/storage"),
3714		autorest.WithQueryParameters(queryParameters))
3715	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3716}
3717
3718// GetStorageAccountsSender sends the GetStorageAccounts request. The method will close the
3719// http.Response Body if it receives an error.
3720func (client BaseClient) GetStorageAccountsSender(req *http.Request) (*http.Response, error) {
3721	return autorest.SendWithSender(client, req,
3722		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3723}
3724
3725// GetStorageAccountsResponder handles the response to the GetStorageAccounts request. The method always
3726// closes the http.Response Body.
3727func (client BaseClient) GetStorageAccountsResponder(resp *http.Response) (result StorageListResult, err error) {
3728	err = autorest.Respond(
3729		resp,
3730		client.ByInspecting(),
3731		azure.WithErrorUnlessStatusCode(http.StatusOK),
3732		autorest.ByUnmarshallingJSON(&result),
3733		autorest.ByClosing())
3734	result.Response = autorest.Response{Response: resp}
3735	return
3736}
3737
3738// getStorageAccountsNextResults retrieves the next set of results, if any.
3739func (client BaseClient) getStorageAccountsNextResults(ctx context.Context, lastResults StorageListResult) (result StorageListResult, err error) {
3740	req, err := lastResults.storageListResultPreparer(ctx)
3741	if err != nil {
3742		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getStorageAccountsNextResults", nil, "Failure preparing next results request")
3743	}
3744	if req == nil {
3745		return
3746	}
3747	resp, err := client.GetStorageAccountsSender(req)
3748	if err != nil {
3749		result.Response = autorest.Response{Response: resp}
3750		return result, autorest.NewErrorWithError(err, "keyvault.BaseClient", "getStorageAccountsNextResults", resp, "Failure sending next results request")
3751	}
3752	result, err = client.GetStorageAccountsResponder(resp)
3753	if err != nil {
3754		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "getStorageAccountsNextResults", resp, "Failure responding to next results request")
3755	}
3756	return
3757}
3758
3759// GetStorageAccountsComplete enumerates all values, automatically crossing page boundaries as required.
3760func (client BaseClient) GetStorageAccountsComplete(ctx context.Context, vaultBaseURL string, maxresults *int32) (result StorageListResultIterator, err error) {
3761	if tracing.IsEnabled() {
3762		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetStorageAccounts")
3763		defer func() {
3764			sc := -1
3765			if result.Response().Response.Response != nil {
3766				sc = result.page.Response().Response.Response.StatusCode
3767			}
3768			tracing.EndSpan(ctx, sc, err)
3769		}()
3770	}
3771	result.page, err = client.GetStorageAccounts(ctx, vaultBaseURL, maxresults)
3772	return
3773}
3774
3775// ImportCertificate imports an existing valid certificate, containing a private key, into Azure Key Vault. The
3776// certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must
3777// contain the key as well as x509 certificates. This operation requires the certificates/import permission.
3778// Parameters:
3779// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
3780// certificateName - the name of the certificate.
3781// parameters - the parameters to import the certificate.
3782func (client BaseClient) ImportCertificate(ctx context.Context, vaultBaseURL string, certificateName string, parameters CertificateImportParameters) (result CertificateBundle, err error) {
3783	if tracing.IsEnabled() {
3784		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ImportCertificate")
3785		defer func() {
3786			sc := -1
3787			if result.Response.Response != nil {
3788				sc = result.Response.Response.StatusCode
3789			}
3790			tracing.EndSpan(ctx, sc, err)
3791		}()
3792	}
3793	if err := validation.Validate([]validation.Validation{
3794		{TargetValue: certificateName,
3795			Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z-]+$`, Chain: nil}}},
3796		{TargetValue: parameters,
3797			Constraints: []validation.Constraint{{Target: "parameters.Base64EncodedCertificate", Name: validation.Null, Rule: true, Chain: nil},
3798				{Target: "parameters.CertificatePolicy", Name: validation.Null, Rule: false,
3799					Chain: []validation.Constraint{{Target: "parameters.CertificatePolicy.X509CertificateProperties", Name: validation.Null, Rule: false,
3800						Chain: []validation.Constraint{{Target: "parameters.CertificatePolicy.X509CertificateProperties.ValidityInMonths", Name: validation.Null, Rule: false,
3801							Chain: []validation.Constraint{{Target: "parameters.CertificatePolicy.X509CertificateProperties.ValidityInMonths", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}},
3802						}},
3803					}}}}}); err != nil {
3804		return result, validation.NewError("keyvault.BaseClient", "ImportCertificate", err.Error())
3805	}
3806
3807	req, err := client.ImportCertificatePreparer(ctx, vaultBaseURL, certificateName, parameters)
3808	if err != nil {
3809		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "ImportCertificate", nil, "Failure preparing request")
3810		return
3811	}
3812
3813	resp, err := client.ImportCertificateSender(req)
3814	if err != nil {
3815		result.Response = autorest.Response{Response: resp}
3816		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "ImportCertificate", resp, "Failure sending request")
3817		return
3818	}
3819
3820	result, err = client.ImportCertificateResponder(resp)
3821	if err != nil {
3822		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "ImportCertificate", resp, "Failure responding to request")
3823	}
3824
3825	return
3826}
3827
3828// ImportCertificatePreparer prepares the ImportCertificate request.
3829func (client BaseClient) ImportCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string, parameters CertificateImportParameters) (*http.Request, error) {
3830	urlParameters := map[string]interface{}{
3831		"vaultBaseUrl": vaultBaseURL,
3832	}
3833
3834	pathParameters := map[string]interface{}{
3835		"certificate-name": autorest.Encode("path", certificateName),
3836	}
3837
3838	const APIVersion = "2016-10-01"
3839	queryParameters := map[string]interface{}{
3840		"api-version": APIVersion,
3841	}
3842
3843	preparer := autorest.CreatePreparer(
3844		autorest.AsContentType("application/json; charset=utf-8"),
3845		autorest.AsPost(),
3846		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
3847		autorest.WithPathParameters("/certificates/{certificate-name}/import", pathParameters),
3848		autorest.WithJSON(parameters),
3849		autorest.WithQueryParameters(queryParameters))
3850	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3851}
3852
3853// ImportCertificateSender sends the ImportCertificate request. The method will close the
3854// http.Response Body if it receives an error.
3855func (client BaseClient) ImportCertificateSender(req *http.Request) (*http.Response, error) {
3856	return autorest.SendWithSender(client, req,
3857		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3858}
3859
3860// ImportCertificateResponder handles the response to the ImportCertificate request. The method always
3861// closes the http.Response Body.
3862func (client BaseClient) ImportCertificateResponder(resp *http.Response) (result CertificateBundle, err error) {
3863	err = autorest.Respond(
3864		resp,
3865		client.ByInspecting(),
3866		azure.WithErrorUnlessStatusCode(http.StatusOK),
3867		autorest.ByUnmarshallingJSON(&result),
3868		autorest.ByClosing())
3869	result.Response = autorest.Response{Response: resp}
3870	return
3871}
3872
3873// ImportKey the import key operation may be used to import any key type into an Azure Key Vault. If the named key
3874// already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import
3875// permission.
3876// Parameters:
3877// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
3878// keyName - name for the imported key.
3879// parameters - the parameters to import a key.
3880func (client BaseClient) ImportKey(ctx context.Context, vaultBaseURL string, keyName string, parameters KeyImportParameters) (result KeyBundle, err error) {
3881	if tracing.IsEnabled() {
3882		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ImportKey")
3883		defer func() {
3884			sc := -1
3885			if result.Response.Response != nil {
3886				sc = result.Response.Response.StatusCode
3887			}
3888			tracing.EndSpan(ctx, sc, err)
3889		}()
3890	}
3891	if err := validation.Validate([]validation.Validation{
3892		{TargetValue: keyName,
3893			Constraints: []validation.Constraint{{Target: "keyName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z-]+$`, Chain: nil}}},
3894		{TargetValue: parameters,
3895			Constraints: []validation.Constraint{{Target: "parameters.Key", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
3896		return result, validation.NewError("keyvault.BaseClient", "ImportKey", err.Error())
3897	}
3898
3899	req, err := client.ImportKeyPreparer(ctx, vaultBaseURL, keyName, parameters)
3900	if err != nil {
3901		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "ImportKey", nil, "Failure preparing request")
3902		return
3903	}
3904
3905	resp, err := client.ImportKeySender(req)
3906	if err != nil {
3907		result.Response = autorest.Response{Response: resp}
3908		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "ImportKey", resp, "Failure sending request")
3909		return
3910	}
3911
3912	result, err = client.ImportKeyResponder(resp)
3913	if err != nil {
3914		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "ImportKey", resp, "Failure responding to request")
3915	}
3916
3917	return
3918}
3919
3920// ImportKeyPreparer prepares the ImportKey request.
3921func (client BaseClient) ImportKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string, parameters KeyImportParameters) (*http.Request, error) {
3922	urlParameters := map[string]interface{}{
3923		"vaultBaseUrl": vaultBaseURL,
3924	}
3925
3926	pathParameters := map[string]interface{}{
3927		"key-name": autorest.Encode("path", keyName),
3928	}
3929
3930	const APIVersion = "2016-10-01"
3931	queryParameters := map[string]interface{}{
3932		"api-version": APIVersion,
3933	}
3934
3935	preparer := autorest.CreatePreparer(
3936		autorest.AsContentType("application/json; charset=utf-8"),
3937		autorest.AsPut(),
3938		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
3939		autorest.WithPathParameters("/keys/{key-name}", pathParameters),
3940		autorest.WithJSON(parameters),
3941		autorest.WithQueryParameters(queryParameters))
3942	return preparer.Prepare((&http.Request{}).WithContext(ctx))
3943}
3944
3945// ImportKeySender sends the ImportKey request. The method will close the
3946// http.Response Body if it receives an error.
3947func (client BaseClient) ImportKeySender(req *http.Request) (*http.Response, error) {
3948	return autorest.SendWithSender(client, req,
3949		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3950}
3951
3952// ImportKeyResponder handles the response to the ImportKey request. The method always
3953// closes the http.Response Body.
3954func (client BaseClient) ImportKeyResponder(resp *http.Response) (result KeyBundle, err error) {
3955	err = autorest.Respond(
3956		resp,
3957		client.ByInspecting(),
3958		azure.WithErrorUnlessStatusCode(http.StatusOK),
3959		autorest.ByUnmarshallingJSON(&result),
3960		autorest.ByClosing())
3961	result.Response = autorest.Response{Response: resp}
3962	return
3963}
3964
3965// MergeCertificate the MergeCertificate operation performs the merging of a certificate or certificate chain with a
3966// key pair currently available in the service. This operation requires the certificates/create permission.
3967// Parameters:
3968// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
3969// certificateName - the name of the certificate.
3970// parameters - the parameters to merge certificate.
3971func (client BaseClient) MergeCertificate(ctx context.Context, vaultBaseURL string, certificateName string, parameters CertificateMergeParameters) (result CertificateBundle, err error) {
3972	if tracing.IsEnabled() {
3973		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.MergeCertificate")
3974		defer func() {
3975			sc := -1
3976			if result.Response.Response != nil {
3977				sc = result.Response.Response.StatusCode
3978			}
3979			tracing.EndSpan(ctx, sc, err)
3980		}()
3981	}
3982	if err := validation.Validate([]validation.Validation{
3983		{TargetValue: parameters,
3984			Constraints: []validation.Constraint{{Target: "parameters.X509Certificates", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
3985		return result, validation.NewError("keyvault.BaseClient", "MergeCertificate", err.Error())
3986	}
3987
3988	req, err := client.MergeCertificatePreparer(ctx, vaultBaseURL, certificateName, parameters)
3989	if err != nil {
3990		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "MergeCertificate", nil, "Failure preparing request")
3991		return
3992	}
3993
3994	resp, err := client.MergeCertificateSender(req)
3995	if err != nil {
3996		result.Response = autorest.Response{Response: resp}
3997		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "MergeCertificate", resp, "Failure sending request")
3998		return
3999	}
4000
4001	result, err = client.MergeCertificateResponder(resp)
4002	if err != nil {
4003		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "MergeCertificate", resp, "Failure responding to request")
4004	}
4005
4006	return
4007}
4008
4009// MergeCertificatePreparer prepares the MergeCertificate request.
4010func (client BaseClient) MergeCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string, parameters CertificateMergeParameters) (*http.Request, error) {
4011	urlParameters := map[string]interface{}{
4012		"vaultBaseUrl": vaultBaseURL,
4013	}
4014
4015	pathParameters := map[string]interface{}{
4016		"certificate-name": autorest.Encode("path", certificateName),
4017	}
4018
4019	const APIVersion = "2016-10-01"
4020	queryParameters := map[string]interface{}{
4021		"api-version": APIVersion,
4022	}
4023
4024	preparer := autorest.CreatePreparer(
4025		autorest.AsContentType("application/json; charset=utf-8"),
4026		autorest.AsPost(),
4027		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
4028		autorest.WithPathParameters("/certificates/{certificate-name}/pending/merge", pathParameters),
4029		autorest.WithJSON(parameters),
4030		autorest.WithQueryParameters(queryParameters))
4031	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4032}
4033
4034// MergeCertificateSender sends the MergeCertificate request. The method will close the
4035// http.Response Body if it receives an error.
4036func (client BaseClient) MergeCertificateSender(req *http.Request) (*http.Response, error) {
4037	return autorest.SendWithSender(client, req,
4038		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4039}
4040
4041// MergeCertificateResponder handles the response to the MergeCertificate request. The method always
4042// closes the http.Response Body.
4043func (client BaseClient) MergeCertificateResponder(resp *http.Response) (result CertificateBundle, err error) {
4044	err = autorest.Respond(
4045		resp,
4046		client.ByInspecting(),
4047		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
4048		autorest.ByUnmarshallingJSON(&result),
4049		autorest.ByClosing())
4050	result.Response = autorest.Response{Response: resp}
4051	return
4052}
4053
4054// PurgeDeletedCertificate the PurgeDeletedCertificate operation performs an irreversible deletion of the specified
4055// certificate, without possibility for recovery. The operation is not available if the recovery level does not specify
4056// 'Purgeable'. This operation requires the certificate/purge permission.
4057// Parameters:
4058// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
4059// certificateName - the name of the certificate
4060func (client BaseClient) PurgeDeletedCertificate(ctx context.Context, vaultBaseURL string, certificateName string) (result autorest.Response, err error) {
4061	if tracing.IsEnabled() {
4062		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PurgeDeletedCertificate")
4063		defer func() {
4064			sc := -1
4065			if result.Response != nil {
4066				sc = result.Response.StatusCode
4067			}
4068			tracing.EndSpan(ctx, sc, err)
4069		}()
4070	}
4071	req, err := client.PurgeDeletedCertificatePreparer(ctx, vaultBaseURL, certificateName)
4072	if err != nil {
4073		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedCertificate", nil, "Failure preparing request")
4074		return
4075	}
4076
4077	resp, err := client.PurgeDeletedCertificateSender(req)
4078	if err != nil {
4079		result.Response = resp
4080		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedCertificate", resp, "Failure sending request")
4081		return
4082	}
4083
4084	result, err = client.PurgeDeletedCertificateResponder(resp)
4085	if err != nil {
4086		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedCertificate", resp, "Failure responding to request")
4087	}
4088
4089	return
4090}
4091
4092// PurgeDeletedCertificatePreparer prepares the PurgeDeletedCertificate request.
4093func (client BaseClient) PurgeDeletedCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) {
4094	urlParameters := map[string]interface{}{
4095		"vaultBaseUrl": vaultBaseURL,
4096	}
4097
4098	pathParameters := map[string]interface{}{
4099		"certificate-name": autorest.Encode("path", certificateName),
4100	}
4101
4102	const APIVersion = "2016-10-01"
4103	queryParameters := map[string]interface{}{
4104		"api-version": APIVersion,
4105	}
4106
4107	preparer := autorest.CreatePreparer(
4108		autorest.AsDelete(),
4109		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
4110		autorest.WithPathParameters("/deletedcertificates/{certificate-name}", pathParameters),
4111		autorest.WithQueryParameters(queryParameters))
4112	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4113}
4114
4115// PurgeDeletedCertificateSender sends the PurgeDeletedCertificate request. The method will close the
4116// http.Response Body if it receives an error.
4117func (client BaseClient) PurgeDeletedCertificateSender(req *http.Request) (*http.Response, error) {
4118	return autorest.SendWithSender(client, req,
4119		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4120}
4121
4122// PurgeDeletedCertificateResponder handles the response to the PurgeDeletedCertificate request. The method always
4123// closes the http.Response Body.
4124func (client BaseClient) PurgeDeletedCertificateResponder(resp *http.Response) (result autorest.Response, err error) {
4125	err = autorest.Respond(
4126		resp,
4127		client.ByInspecting(),
4128		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
4129		autorest.ByClosing())
4130	result.Response = resp
4131	return
4132}
4133
4134// PurgeDeletedKey the Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation
4135// can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation
4136// requires the keys/purge permission.
4137// Parameters:
4138// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
4139// keyName - the name of the key
4140func (client BaseClient) PurgeDeletedKey(ctx context.Context, vaultBaseURL string, keyName string) (result autorest.Response, err error) {
4141	if tracing.IsEnabled() {
4142		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PurgeDeletedKey")
4143		defer func() {
4144			sc := -1
4145			if result.Response != nil {
4146				sc = result.Response.StatusCode
4147			}
4148			tracing.EndSpan(ctx, sc, err)
4149		}()
4150	}
4151	req, err := client.PurgeDeletedKeyPreparer(ctx, vaultBaseURL, keyName)
4152	if err != nil {
4153		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedKey", nil, "Failure preparing request")
4154		return
4155	}
4156
4157	resp, err := client.PurgeDeletedKeySender(req)
4158	if err != nil {
4159		result.Response = resp
4160		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedKey", resp, "Failure sending request")
4161		return
4162	}
4163
4164	result, err = client.PurgeDeletedKeyResponder(resp)
4165	if err != nil {
4166		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedKey", resp, "Failure responding to request")
4167	}
4168
4169	return
4170}
4171
4172// PurgeDeletedKeyPreparer prepares the PurgeDeletedKey request.
4173func (client BaseClient) PurgeDeletedKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string) (*http.Request, error) {
4174	urlParameters := map[string]interface{}{
4175		"vaultBaseUrl": vaultBaseURL,
4176	}
4177
4178	pathParameters := map[string]interface{}{
4179		"key-name": autorest.Encode("path", keyName),
4180	}
4181
4182	const APIVersion = "2016-10-01"
4183	queryParameters := map[string]interface{}{
4184		"api-version": APIVersion,
4185	}
4186
4187	preparer := autorest.CreatePreparer(
4188		autorest.AsDelete(),
4189		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
4190		autorest.WithPathParameters("/deletedkeys/{key-name}", pathParameters),
4191		autorest.WithQueryParameters(queryParameters))
4192	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4193}
4194
4195// PurgeDeletedKeySender sends the PurgeDeletedKey request. The method will close the
4196// http.Response Body if it receives an error.
4197func (client BaseClient) PurgeDeletedKeySender(req *http.Request) (*http.Response, error) {
4198	return autorest.SendWithSender(client, req,
4199		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4200}
4201
4202// PurgeDeletedKeyResponder handles the response to the PurgeDeletedKey request. The method always
4203// closes the http.Response Body.
4204func (client BaseClient) PurgeDeletedKeyResponder(resp *http.Response) (result autorest.Response, err error) {
4205	err = autorest.Respond(
4206		resp,
4207		client.ByInspecting(),
4208		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
4209		autorest.ByClosing())
4210	result.Response = resp
4211	return
4212}
4213
4214// PurgeDeletedSecret the purge deleted secret operation removes the secret permanently, without the possibility of
4215// recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the
4216// secrets/purge permission.
4217// Parameters:
4218// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
4219// secretName - the name of the secret.
4220func (client BaseClient) PurgeDeletedSecret(ctx context.Context, vaultBaseURL string, secretName string) (result autorest.Response, err error) {
4221	if tracing.IsEnabled() {
4222		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PurgeDeletedSecret")
4223		defer func() {
4224			sc := -1
4225			if result.Response != nil {
4226				sc = result.Response.StatusCode
4227			}
4228			tracing.EndSpan(ctx, sc, err)
4229		}()
4230	}
4231	req, err := client.PurgeDeletedSecretPreparer(ctx, vaultBaseURL, secretName)
4232	if err != nil {
4233		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedSecret", nil, "Failure preparing request")
4234		return
4235	}
4236
4237	resp, err := client.PurgeDeletedSecretSender(req)
4238	if err != nil {
4239		result.Response = resp
4240		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedSecret", resp, "Failure sending request")
4241		return
4242	}
4243
4244	result, err = client.PurgeDeletedSecretResponder(resp)
4245	if err != nil {
4246		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "PurgeDeletedSecret", resp, "Failure responding to request")
4247	}
4248
4249	return
4250}
4251
4252// PurgeDeletedSecretPreparer prepares the PurgeDeletedSecret request.
4253func (client BaseClient) PurgeDeletedSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string) (*http.Request, error) {
4254	urlParameters := map[string]interface{}{
4255		"vaultBaseUrl": vaultBaseURL,
4256	}
4257
4258	pathParameters := map[string]interface{}{
4259		"secret-name": autorest.Encode("path", secretName),
4260	}
4261
4262	const APIVersion = "2016-10-01"
4263	queryParameters := map[string]interface{}{
4264		"api-version": APIVersion,
4265	}
4266
4267	preparer := autorest.CreatePreparer(
4268		autorest.AsDelete(),
4269		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
4270		autorest.WithPathParameters("/deletedsecrets/{secret-name}", pathParameters),
4271		autorest.WithQueryParameters(queryParameters))
4272	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4273}
4274
4275// PurgeDeletedSecretSender sends the PurgeDeletedSecret request. The method will close the
4276// http.Response Body if it receives an error.
4277func (client BaseClient) PurgeDeletedSecretSender(req *http.Request) (*http.Response, error) {
4278	return autorest.SendWithSender(client, req,
4279		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4280}
4281
4282// PurgeDeletedSecretResponder handles the response to the PurgeDeletedSecret request. The method always
4283// closes the http.Response Body.
4284func (client BaseClient) PurgeDeletedSecretResponder(resp *http.Response) (result autorest.Response, err error) {
4285	err = autorest.Respond(
4286		resp,
4287		client.ByInspecting(),
4288		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
4289		autorest.ByClosing())
4290	result.Response = resp
4291	return
4292}
4293
4294// RecoverDeletedCertificate the RecoverDeletedCertificate operation performs the reversal of the Delete operation. The
4295// operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval
4296// (available in the deleted certificate's attributes). This operation requires the certificates/recover permission.
4297// Parameters:
4298// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
4299// certificateName - the name of the deleted certificate
4300func (client BaseClient) RecoverDeletedCertificate(ctx context.Context, vaultBaseURL string, certificateName string) (result CertificateBundle, err error) {
4301	if tracing.IsEnabled() {
4302		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverDeletedCertificate")
4303		defer func() {
4304			sc := -1
4305			if result.Response.Response != nil {
4306				sc = result.Response.Response.StatusCode
4307			}
4308			tracing.EndSpan(ctx, sc, err)
4309		}()
4310	}
4311	req, err := client.RecoverDeletedCertificatePreparer(ctx, vaultBaseURL, certificateName)
4312	if err != nil {
4313		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedCertificate", nil, "Failure preparing request")
4314		return
4315	}
4316
4317	resp, err := client.RecoverDeletedCertificateSender(req)
4318	if err != nil {
4319		result.Response = autorest.Response{Response: resp}
4320		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedCertificate", resp, "Failure sending request")
4321		return
4322	}
4323
4324	result, err = client.RecoverDeletedCertificateResponder(resp)
4325	if err != nil {
4326		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedCertificate", resp, "Failure responding to request")
4327	}
4328
4329	return
4330}
4331
4332// RecoverDeletedCertificatePreparer prepares the RecoverDeletedCertificate request.
4333func (client BaseClient) RecoverDeletedCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string) (*http.Request, error) {
4334	urlParameters := map[string]interface{}{
4335		"vaultBaseUrl": vaultBaseURL,
4336	}
4337
4338	pathParameters := map[string]interface{}{
4339		"certificate-name": autorest.Encode("path", certificateName),
4340	}
4341
4342	const APIVersion = "2016-10-01"
4343	queryParameters := map[string]interface{}{
4344		"api-version": APIVersion,
4345	}
4346
4347	preparer := autorest.CreatePreparer(
4348		autorest.AsPost(),
4349		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
4350		autorest.WithPathParameters("/deletedcertificates/{certificate-name}/recover", pathParameters),
4351		autorest.WithQueryParameters(queryParameters))
4352	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4353}
4354
4355// RecoverDeletedCertificateSender sends the RecoverDeletedCertificate request. The method will close the
4356// http.Response Body if it receives an error.
4357func (client BaseClient) RecoverDeletedCertificateSender(req *http.Request) (*http.Response, error) {
4358	return autorest.SendWithSender(client, req,
4359		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4360}
4361
4362// RecoverDeletedCertificateResponder handles the response to the RecoverDeletedCertificate request. The method always
4363// closes the http.Response Body.
4364func (client BaseClient) RecoverDeletedCertificateResponder(resp *http.Response) (result CertificateBundle, err error) {
4365	err = autorest.Respond(
4366		resp,
4367		client.ByInspecting(),
4368		azure.WithErrorUnlessStatusCode(http.StatusOK),
4369		autorest.ByUnmarshallingJSON(&result),
4370		autorest.ByClosing())
4371	result.Response = autorest.Response{Response: resp}
4372	return
4373}
4374
4375// RecoverDeletedKey the Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It
4376// recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will
4377// return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation
4378// requires the keys/recover permission.
4379// Parameters:
4380// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
4381// keyName - the name of the deleted key.
4382func (client BaseClient) RecoverDeletedKey(ctx context.Context, vaultBaseURL string, keyName string) (result KeyBundle, err error) {
4383	if tracing.IsEnabled() {
4384		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverDeletedKey")
4385		defer func() {
4386			sc := -1
4387			if result.Response.Response != nil {
4388				sc = result.Response.Response.StatusCode
4389			}
4390			tracing.EndSpan(ctx, sc, err)
4391		}()
4392	}
4393	req, err := client.RecoverDeletedKeyPreparer(ctx, vaultBaseURL, keyName)
4394	if err != nil {
4395		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedKey", nil, "Failure preparing request")
4396		return
4397	}
4398
4399	resp, err := client.RecoverDeletedKeySender(req)
4400	if err != nil {
4401		result.Response = autorest.Response{Response: resp}
4402		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedKey", resp, "Failure sending request")
4403		return
4404	}
4405
4406	result, err = client.RecoverDeletedKeyResponder(resp)
4407	if err != nil {
4408		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedKey", resp, "Failure responding to request")
4409	}
4410
4411	return
4412}
4413
4414// RecoverDeletedKeyPreparer prepares the RecoverDeletedKey request.
4415func (client BaseClient) RecoverDeletedKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string) (*http.Request, error) {
4416	urlParameters := map[string]interface{}{
4417		"vaultBaseUrl": vaultBaseURL,
4418	}
4419
4420	pathParameters := map[string]interface{}{
4421		"key-name": autorest.Encode("path", keyName),
4422	}
4423
4424	const APIVersion = "2016-10-01"
4425	queryParameters := map[string]interface{}{
4426		"api-version": APIVersion,
4427	}
4428
4429	preparer := autorest.CreatePreparer(
4430		autorest.AsPost(),
4431		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
4432		autorest.WithPathParameters("/deletedkeys/{key-name}/recover", pathParameters),
4433		autorest.WithQueryParameters(queryParameters))
4434	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4435}
4436
4437// RecoverDeletedKeySender sends the RecoverDeletedKey request. The method will close the
4438// http.Response Body if it receives an error.
4439func (client BaseClient) RecoverDeletedKeySender(req *http.Request) (*http.Response, error) {
4440	return autorest.SendWithSender(client, req,
4441		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4442}
4443
4444// RecoverDeletedKeyResponder handles the response to the RecoverDeletedKey request. The method always
4445// closes the http.Response Body.
4446func (client BaseClient) RecoverDeletedKeyResponder(resp *http.Response) (result KeyBundle, err error) {
4447	err = autorest.Respond(
4448		resp,
4449		client.ByInspecting(),
4450		azure.WithErrorUnlessStatusCode(http.StatusOK),
4451		autorest.ByUnmarshallingJSON(&result),
4452		autorest.ByClosing())
4453	result.Response = autorest.Response{Response: resp}
4454	return
4455}
4456
4457// RecoverDeletedSecret recovers the deleted secret in the specified vault. This operation can only be performed on a
4458// soft-delete enabled vault. This operation requires the secrets/recover permission.
4459// Parameters:
4460// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
4461// secretName - the name of the deleted secret.
4462func (client BaseClient) RecoverDeletedSecret(ctx context.Context, vaultBaseURL string, secretName string) (result SecretBundle, err error) {
4463	if tracing.IsEnabled() {
4464		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverDeletedSecret")
4465		defer func() {
4466			sc := -1
4467			if result.Response.Response != nil {
4468				sc = result.Response.Response.StatusCode
4469			}
4470			tracing.EndSpan(ctx, sc, err)
4471		}()
4472	}
4473	req, err := client.RecoverDeletedSecretPreparer(ctx, vaultBaseURL, secretName)
4474	if err != nil {
4475		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedSecret", nil, "Failure preparing request")
4476		return
4477	}
4478
4479	resp, err := client.RecoverDeletedSecretSender(req)
4480	if err != nil {
4481		result.Response = autorest.Response{Response: resp}
4482		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedSecret", resp, "Failure sending request")
4483		return
4484	}
4485
4486	result, err = client.RecoverDeletedSecretResponder(resp)
4487	if err != nil {
4488		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RecoverDeletedSecret", resp, "Failure responding to request")
4489	}
4490
4491	return
4492}
4493
4494// RecoverDeletedSecretPreparer prepares the RecoverDeletedSecret request.
4495func (client BaseClient) RecoverDeletedSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string) (*http.Request, error) {
4496	urlParameters := map[string]interface{}{
4497		"vaultBaseUrl": vaultBaseURL,
4498	}
4499
4500	pathParameters := map[string]interface{}{
4501		"secret-name": autorest.Encode("path", secretName),
4502	}
4503
4504	const APIVersion = "2016-10-01"
4505	queryParameters := map[string]interface{}{
4506		"api-version": APIVersion,
4507	}
4508
4509	preparer := autorest.CreatePreparer(
4510		autorest.AsPost(),
4511		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
4512		autorest.WithPathParameters("/deletedsecrets/{secret-name}/recover", pathParameters),
4513		autorest.WithQueryParameters(queryParameters))
4514	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4515}
4516
4517// RecoverDeletedSecretSender sends the RecoverDeletedSecret request. The method will close the
4518// http.Response Body if it receives an error.
4519func (client BaseClient) RecoverDeletedSecretSender(req *http.Request) (*http.Response, error) {
4520	return autorest.SendWithSender(client, req,
4521		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4522}
4523
4524// RecoverDeletedSecretResponder handles the response to the RecoverDeletedSecret request. The method always
4525// closes the http.Response Body.
4526func (client BaseClient) RecoverDeletedSecretResponder(resp *http.Response) (result SecretBundle, err error) {
4527	err = autorest.Respond(
4528		resp,
4529		client.ByInspecting(),
4530		azure.WithErrorUnlessStatusCode(http.StatusOK),
4531		autorest.ByUnmarshallingJSON(&result),
4532		autorest.ByClosing())
4533	result.Response = autorest.Response{Response: resp}
4534	return
4535}
4536
4537// RegenerateStorageAccountKey regenerates the specified key value for the given storage account. This operation
4538// requires the storage/regeneratekey permission.
4539// Parameters:
4540// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
4541// storageAccountName - the name of the storage account.
4542// parameters - the parameters to regenerate storage account key.
4543func (client BaseClient) RegenerateStorageAccountKey(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountRegenerteKeyParameters) (result StorageBundle, err error) {
4544	if tracing.IsEnabled() {
4545		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RegenerateStorageAccountKey")
4546		defer func() {
4547			sc := -1
4548			if result.Response.Response != nil {
4549				sc = result.Response.Response.StatusCode
4550			}
4551			tracing.EndSpan(ctx, sc, err)
4552		}()
4553	}
4554	if err := validation.Validate([]validation.Validation{
4555		{TargetValue: storageAccountName,
4556			Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}},
4557		{TargetValue: parameters,
4558			Constraints: []validation.Constraint{{Target: "parameters.KeyName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
4559		return result, validation.NewError("keyvault.BaseClient", "RegenerateStorageAccountKey", err.Error())
4560	}
4561
4562	req, err := client.RegenerateStorageAccountKeyPreparer(ctx, vaultBaseURL, storageAccountName, parameters)
4563	if err != nil {
4564		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RegenerateStorageAccountKey", nil, "Failure preparing request")
4565		return
4566	}
4567
4568	resp, err := client.RegenerateStorageAccountKeySender(req)
4569	if err != nil {
4570		result.Response = autorest.Response{Response: resp}
4571		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RegenerateStorageAccountKey", resp, "Failure sending request")
4572		return
4573	}
4574
4575	result, err = client.RegenerateStorageAccountKeyResponder(resp)
4576	if err != nil {
4577		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RegenerateStorageAccountKey", resp, "Failure responding to request")
4578	}
4579
4580	return
4581}
4582
4583// RegenerateStorageAccountKeyPreparer prepares the RegenerateStorageAccountKey request.
4584func (client BaseClient) RegenerateStorageAccountKeyPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountRegenerteKeyParameters) (*http.Request, error) {
4585	urlParameters := map[string]interface{}{
4586		"vaultBaseUrl": vaultBaseURL,
4587	}
4588
4589	pathParameters := map[string]interface{}{
4590		"storage-account-name": autorest.Encode("path", storageAccountName),
4591	}
4592
4593	const APIVersion = "2016-10-01"
4594	queryParameters := map[string]interface{}{
4595		"api-version": APIVersion,
4596	}
4597
4598	preparer := autorest.CreatePreparer(
4599		autorest.AsContentType("application/json; charset=utf-8"),
4600		autorest.AsPost(),
4601		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
4602		autorest.WithPathParameters("/storage/{storage-account-name}/regeneratekey", pathParameters),
4603		autorest.WithJSON(parameters),
4604		autorest.WithQueryParameters(queryParameters))
4605	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4606}
4607
4608// RegenerateStorageAccountKeySender sends the RegenerateStorageAccountKey request. The method will close the
4609// http.Response Body if it receives an error.
4610func (client BaseClient) RegenerateStorageAccountKeySender(req *http.Request) (*http.Response, error) {
4611	return autorest.SendWithSender(client, req,
4612		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4613}
4614
4615// RegenerateStorageAccountKeyResponder handles the response to the RegenerateStorageAccountKey request. The method always
4616// closes the http.Response Body.
4617func (client BaseClient) RegenerateStorageAccountKeyResponder(resp *http.Response) (result StorageBundle, err error) {
4618	err = autorest.Respond(
4619		resp,
4620		client.ByInspecting(),
4621		azure.WithErrorUnlessStatusCode(http.StatusOK),
4622		autorest.ByUnmarshallingJSON(&result),
4623		autorest.ByClosing())
4624	result.Response = autorest.Response{Response: resp}
4625	return
4626}
4627
4628// RestoreKey imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier,
4629// attributes and access control policies. The RESTORE operation may be used to import a previously backed up key.
4630// Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it
4631// had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be
4632// rejected. While the key name is retained during restore, the final key identifier will change if the key is restored
4633// to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is
4634// subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure Subscription as the
4635// source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the
4636// keys/restore permission.
4637// Parameters:
4638// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
4639// parameters - the parameters to restore the key.
4640func (client BaseClient) RestoreKey(ctx context.Context, vaultBaseURL string, parameters KeyRestoreParameters) (result KeyBundle, err error) {
4641	if tracing.IsEnabled() {
4642		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestoreKey")
4643		defer func() {
4644			sc := -1
4645			if result.Response.Response != nil {
4646				sc = result.Response.Response.StatusCode
4647			}
4648			tracing.EndSpan(ctx, sc, err)
4649		}()
4650	}
4651	if err := validation.Validate([]validation.Validation{
4652		{TargetValue: parameters,
4653			Constraints: []validation.Constraint{{Target: "parameters.KeyBundleBackup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
4654		return result, validation.NewError("keyvault.BaseClient", "RestoreKey", err.Error())
4655	}
4656
4657	req, err := client.RestoreKeyPreparer(ctx, vaultBaseURL, parameters)
4658	if err != nil {
4659		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreKey", nil, "Failure preparing request")
4660		return
4661	}
4662
4663	resp, err := client.RestoreKeySender(req)
4664	if err != nil {
4665		result.Response = autorest.Response{Response: resp}
4666		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreKey", resp, "Failure sending request")
4667		return
4668	}
4669
4670	result, err = client.RestoreKeyResponder(resp)
4671	if err != nil {
4672		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreKey", resp, "Failure responding to request")
4673	}
4674
4675	return
4676}
4677
4678// RestoreKeyPreparer prepares the RestoreKey request.
4679func (client BaseClient) RestoreKeyPreparer(ctx context.Context, vaultBaseURL string, parameters KeyRestoreParameters) (*http.Request, error) {
4680	urlParameters := map[string]interface{}{
4681		"vaultBaseUrl": vaultBaseURL,
4682	}
4683
4684	const APIVersion = "2016-10-01"
4685	queryParameters := map[string]interface{}{
4686		"api-version": APIVersion,
4687	}
4688
4689	preparer := autorest.CreatePreparer(
4690		autorest.AsContentType("application/json; charset=utf-8"),
4691		autorest.AsPost(),
4692		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
4693		autorest.WithPath("/keys/restore"),
4694		autorest.WithJSON(parameters),
4695		autorest.WithQueryParameters(queryParameters))
4696	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4697}
4698
4699// RestoreKeySender sends the RestoreKey request. The method will close the
4700// http.Response Body if it receives an error.
4701func (client BaseClient) RestoreKeySender(req *http.Request) (*http.Response, error) {
4702	return autorest.SendWithSender(client, req,
4703		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4704}
4705
4706// RestoreKeyResponder handles the response to the RestoreKey request. The method always
4707// closes the http.Response Body.
4708func (client BaseClient) RestoreKeyResponder(resp *http.Response) (result KeyBundle, err error) {
4709	err = autorest.Respond(
4710		resp,
4711		client.ByInspecting(),
4712		azure.WithErrorUnlessStatusCode(http.StatusOK),
4713		autorest.ByUnmarshallingJSON(&result),
4714		autorest.ByClosing())
4715	result.Response = autorest.Response{Response: resp}
4716	return
4717}
4718
4719// RestoreSecret restores a backed up secret, and all its versions, to a vault. This operation requires the
4720// secrets/restore permission.
4721// Parameters:
4722// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
4723// parameters - the parameters to restore the secret.
4724func (client BaseClient) RestoreSecret(ctx context.Context, vaultBaseURL string, parameters SecretRestoreParameters) (result SecretBundle, err error) {
4725	if tracing.IsEnabled() {
4726		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestoreSecret")
4727		defer func() {
4728			sc := -1
4729			if result.Response.Response != nil {
4730				sc = result.Response.Response.StatusCode
4731			}
4732			tracing.EndSpan(ctx, sc, err)
4733		}()
4734	}
4735	if err := validation.Validate([]validation.Validation{
4736		{TargetValue: parameters,
4737			Constraints: []validation.Constraint{{Target: "parameters.SecretBundleBackup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
4738		return result, validation.NewError("keyvault.BaseClient", "RestoreSecret", err.Error())
4739	}
4740
4741	req, err := client.RestoreSecretPreparer(ctx, vaultBaseURL, parameters)
4742	if err != nil {
4743		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreSecret", nil, "Failure preparing request")
4744		return
4745	}
4746
4747	resp, err := client.RestoreSecretSender(req)
4748	if err != nil {
4749		result.Response = autorest.Response{Response: resp}
4750		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreSecret", resp, "Failure sending request")
4751		return
4752	}
4753
4754	result, err = client.RestoreSecretResponder(resp)
4755	if err != nil {
4756		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "RestoreSecret", resp, "Failure responding to request")
4757	}
4758
4759	return
4760}
4761
4762// RestoreSecretPreparer prepares the RestoreSecret request.
4763func (client BaseClient) RestoreSecretPreparer(ctx context.Context, vaultBaseURL string, parameters SecretRestoreParameters) (*http.Request, error) {
4764	urlParameters := map[string]interface{}{
4765		"vaultBaseUrl": vaultBaseURL,
4766	}
4767
4768	const APIVersion = "2016-10-01"
4769	queryParameters := map[string]interface{}{
4770		"api-version": APIVersion,
4771	}
4772
4773	preparer := autorest.CreatePreparer(
4774		autorest.AsContentType("application/json; charset=utf-8"),
4775		autorest.AsPost(),
4776		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
4777		autorest.WithPath("/secrets/restore"),
4778		autorest.WithJSON(parameters),
4779		autorest.WithQueryParameters(queryParameters))
4780	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4781}
4782
4783// RestoreSecretSender sends the RestoreSecret request. The method will close the
4784// http.Response Body if it receives an error.
4785func (client BaseClient) RestoreSecretSender(req *http.Request) (*http.Response, error) {
4786	return autorest.SendWithSender(client, req,
4787		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4788}
4789
4790// RestoreSecretResponder handles the response to the RestoreSecret request. The method always
4791// closes the http.Response Body.
4792func (client BaseClient) RestoreSecretResponder(resp *http.Response) (result SecretBundle, err error) {
4793	err = autorest.Respond(
4794		resp,
4795		client.ByInspecting(),
4796		azure.WithErrorUnlessStatusCode(http.StatusOK),
4797		autorest.ByUnmarshallingJSON(&result),
4798		autorest.ByClosing())
4799	result.Response = autorest.Response{Response: resp}
4800	return
4801}
4802
4803// SetCertificateContacts sets the certificate contacts for the specified key vault. This operation requires the
4804// certificates/managecontacts permission.
4805// Parameters:
4806// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
4807// contacts - the contacts for the key vault certificate.
4808func (client BaseClient) SetCertificateContacts(ctx context.Context, vaultBaseURL string, contacts Contacts) (result Contacts, err error) {
4809	if tracing.IsEnabled() {
4810		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SetCertificateContacts")
4811		defer func() {
4812			sc := -1
4813			if result.Response.Response != nil {
4814				sc = result.Response.Response.StatusCode
4815			}
4816			tracing.EndSpan(ctx, sc, err)
4817		}()
4818	}
4819	req, err := client.SetCertificateContactsPreparer(ctx, vaultBaseURL, contacts)
4820	if err != nil {
4821		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetCertificateContacts", nil, "Failure preparing request")
4822		return
4823	}
4824
4825	resp, err := client.SetCertificateContactsSender(req)
4826	if err != nil {
4827		result.Response = autorest.Response{Response: resp}
4828		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetCertificateContacts", resp, "Failure sending request")
4829		return
4830	}
4831
4832	result, err = client.SetCertificateContactsResponder(resp)
4833	if err != nil {
4834		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetCertificateContacts", resp, "Failure responding to request")
4835	}
4836
4837	return
4838}
4839
4840// SetCertificateContactsPreparer prepares the SetCertificateContacts request.
4841func (client BaseClient) SetCertificateContactsPreparer(ctx context.Context, vaultBaseURL string, contacts Contacts) (*http.Request, error) {
4842	urlParameters := map[string]interface{}{
4843		"vaultBaseUrl": vaultBaseURL,
4844	}
4845
4846	const APIVersion = "2016-10-01"
4847	queryParameters := map[string]interface{}{
4848		"api-version": APIVersion,
4849	}
4850
4851	contacts.ID = nil
4852	preparer := autorest.CreatePreparer(
4853		autorest.AsContentType("application/json; charset=utf-8"),
4854		autorest.AsPut(),
4855		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
4856		autorest.WithPath("/certificates/contacts"),
4857		autorest.WithJSON(contacts),
4858		autorest.WithQueryParameters(queryParameters))
4859	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4860}
4861
4862// SetCertificateContactsSender sends the SetCertificateContacts request. The method will close the
4863// http.Response Body if it receives an error.
4864func (client BaseClient) SetCertificateContactsSender(req *http.Request) (*http.Response, error) {
4865	return autorest.SendWithSender(client, req,
4866		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4867}
4868
4869// SetCertificateContactsResponder handles the response to the SetCertificateContacts request. The method always
4870// closes the http.Response Body.
4871func (client BaseClient) SetCertificateContactsResponder(resp *http.Response) (result Contacts, err error) {
4872	err = autorest.Respond(
4873		resp,
4874		client.ByInspecting(),
4875		azure.WithErrorUnlessStatusCode(http.StatusOK),
4876		autorest.ByUnmarshallingJSON(&result),
4877		autorest.ByClosing())
4878	result.Response = autorest.Response{Response: resp}
4879	return
4880}
4881
4882// SetCertificateIssuer the SetCertificateIssuer operation adds or updates the specified certificate issuer. This
4883// operation requires the certificates/setissuers permission.
4884// Parameters:
4885// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
4886// issuerName - the name of the issuer.
4887// parameter - certificate issuer set parameter.
4888func (client BaseClient) SetCertificateIssuer(ctx context.Context, vaultBaseURL string, issuerName string, parameter CertificateIssuerSetParameters) (result IssuerBundle, err error) {
4889	if tracing.IsEnabled() {
4890		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SetCertificateIssuer")
4891		defer func() {
4892			sc := -1
4893			if result.Response.Response != nil {
4894				sc = result.Response.Response.StatusCode
4895			}
4896			tracing.EndSpan(ctx, sc, err)
4897		}()
4898	}
4899	if err := validation.Validate([]validation.Validation{
4900		{TargetValue: parameter,
4901			Constraints: []validation.Constraint{{Target: "parameter.Provider", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
4902		return result, validation.NewError("keyvault.BaseClient", "SetCertificateIssuer", err.Error())
4903	}
4904
4905	req, err := client.SetCertificateIssuerPreparer(ctx, vaultBaseURL, issuerName, parameter)
4906	if err != nil {
4907		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetCertificateIssuer", nil, "Failure preparing request")
4908		return
4909	}
4910
4911	resp, err := client.SetCertificateIssuerSender(req)
4912	if err != nil {
4913		result.Response = autorest.Response{Response: resp}
4914		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetCertificateIssuer", resp, "Failure sending request")
4915		return
4916	}
4917
4918	result, err = client.SetCertificateIssuerResponder(resp)
4919	if err != nil {
4920		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetCertificateIssuer", resp, "Failure responding to request")
4921	}
4922
4923	return
4924}
4925
4926// SetCertificateIssuerPreparer prepares the SetCertificateIssuer request.
4927func (client BaseClient) SetCertificateIssuerPreparer(ctx context.Context, vaultBaseURL string, issuerName string, parameter CertificateIssuerSetParameters) (*http.Request, error) {
4928	urlParameters := map[string]interface{}{
4929		"vaultBaseUrl": vaultBaseURL,
4930	}
4931
4932	pathParameters := map[string]interface{}{
4933		"issuer-name": autorest.Encode("path", issuerName),
4934	}
4935
4936	const APIVersion = "2016-10-01"
4937	queryParameters := map[string]interface{}{
4938		"api-version": APIVersion,
4939	}
4940
4941	preparer := autorest.CreatePreparer(
4942		autorest.AsContentType("application/json; charset=utf-8"),
4943		autorest.AsPut(),
4944		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
4945		autorest.WithPathParameters("/certificates/issuers/{issuer-name}", pathParameters),
4946		autorest.WithJSON(parameter),
4947		autorest.WithQueryParameters(queryParameters))
4948	return preparer.Prepare((&http.Request{}).WithContext(ctx))
4949}
4950
4951// SetCertificateIssuerSender sends the SetCertificateIssuer request. The method will close the
4952// http.Response Body if it receives an error.
4953func (client BaseClient) SetCertificateIssuerSender(req *http.Request) (*http.Response, error) {
4954	return autorest.SendWithSender(client, req,
4955		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4956}
4957
4958// SetCertificateIssuerResponder handles the response to the SetCertificateIssuer request. The method always
4959// closes the http.Response Body.
4960func (client BaseClient) SetCertificateIssuerResponder(resp *http.Response) (result IssuerBundle, err error) {
4961	err = autorest.Respond(
4962		resp,
4963		client.ByInspecting(),
4964		azure.WithErrorUnlessStatusCode(http.StatusOK),
4965		autorest.ByUnmarshallingJSON(&result),
4966		autorest.ByClosing())
4967	result.Response = autorest.Response{Response: resp}
4968	return
4969}
4970
4971// SetSasDefinition creates or updates a new SAS definition for the specified storage account. This operation requires
4972// the storage/setsas permission.
4973// Parameters:
4974// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
4975// storageAccountName - the name of the storage account.
4976// sasDefinitionName - the name of the SAS definition.
4977// parameters - the parameters to create a SAS definition.
4978func (client BaseClient) SetSasDefinition(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string, parameters SasDefinitionCreateParameters) (result SasDefinitionBundle, err error) {
4979	if tracing.IsEnabled() {
4980		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SetSasDefinition")
4981		defer func() {
4982			sc := -1
4983			if result.Response.Response != nil {
4984				sc = result.Response.Response.StatusCode
4985			}
4986			tracing.EndSpan(ctx, sc, err)
4987		}()
4988	}
4989	if err := validation.Validate([]validation.Validation{
4990		{TargetValue: storageAccountName,
4991			Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}},
4992		{TargetValue: sasDefinitionName,
4993			Constraints: []validation.Constraint{{Target: "sasDefinitionName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}},
4994		{TargetValue: parameters,
4995			Constraints: []validation.Constraint{{Target: "parameters.Parameters", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
4996		return result, validation.NewError("keyvault.BaseClient", "SetSasDefinition", err.Error())
4997	}
4998
4999	req, err := client.SetSasDefinitionPreparer(ctx, vaultBaseURL, storageAccountName, sasDefinitionName, parameters)
5000	if err != nil {
5001		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetSasDefinition", nil, "Failure preparing request")
5002		return
5003	}
5004
5005	resp, err := client.SetSasDefinitionSender(req)
5006	if err != nil {
5007		result.Response = autorest.Response{Response: resp}
5008		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetSasDefinition", resp, "Failure sending request")
5009		return
5010	}
5011
5012	result, err = client.SetSasDefinitionResponder(resp)
5013	if err != nil {
5014		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetSasDefinition", resp, "Failure responding to request")
5015	}
5016
5017	return
5018}
5019
5020// SetSasDefinitionPreparer prepares the SetSasDefinition request.
5021func (client BaseClient) SetSasDefinitionPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string, parameters SasDefinitionCreateParameters) (*http.Request, error) {
5022	urlParameters := map[string]interface{}{
5023		"vaultBaseUrl": vaultBaseURL,
5024	}
5025
5026	pathParameters := map[string]interface{}{
5027		"sas-definition-name":  autorest.Encode("path", sasDefinitionName),
5028		"storage-account-name": autorest.Encode("path", storageAccountName),
5029	}
5030
5031	const APIVersion = "2016-10-01"
5032	queryParameters := map[string]interface{}{
5033		"api-version": APIVersion,
5034	}
5035
5036	preparer := autorest.CreatePreparer(
5037		autorest.AsContentType("application/json; charset=utf-8"),
5038		autorest.AsPut(),
5039		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
5040		autorest.WithPathParameters("/storage/{storage-account-name}/sas/{sas-definition-name}", pathParameters),
5041		autorest.WithJSON(parameters),
5042		autorest.WithQueryParameters(queryParameters))
5043	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5044}
5045
5046// SetSasDefinitionSender sends the SetSasDefinition request. The method will close the
5047// http.Response Body if it receives an error.
5048func (client BaseClient) SetSasDefinitionSender(req *http.Request) (*http.Response, error) {
5049	return autorest.SendWithSender(client, req,
5050		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5051}
5052
5053// SetSasDefinitionResponder handles the response to the SetSasDefinition request. The method always
5054// closes the http.Response Body.
5055func (client BaseClient) SetSasDefinitionResponder(resp *http.Response) (result SasDefinitionBundle, err error) {
5056	err = autorest.Respond(
5057		resp,
5058		client.ByInspecting(),
5059		azure.WithErrorUnlessStatusCode(http.StatusOK),
5060		autorest.ByUnmarshallingJSON(&result),
5061		autorest.ByClosing())
5062	result.Response = autorest.Response{Response: resp}
5063	return
5064}
5065
5066// SetSecret the SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key
5067// Vault creates a new version of that secret. This operation requires the secrets/set permission.
5068// Parameters:
5069// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
5070// secretName - the name of the secret.
5071// parameters - the parameters for setting the secret.
5072func (client BaseClient) SetSecret(ctx context.Context, vaultBaseURL string, secretName string, parameters SecretSetParameters) (result SecretBundle, err error) {
5073	if tracing.IsEnabled() {
5074		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SetSecret")
5075		defer func() {
5076			sc := -1
5077			if result.Response.Response != nil {
5078				sc = result.Response.Response.StatusCode
5079			}
5080			tracing.EndSpan(ctx, sc, err)
5081		}()
5082	}
5083	if err := validation.Validate([]validation.Validation{
5084		{TargetValue: secretName,
5085			Constraints: []validation.Constraint{{Target: "secretName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z-]+$`, Chain: nil}}},
5086		{TargetValue: parameters,
5087			Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
5088		return result, validation.NewError("keyvault.BaseClient", "SetSecret", err.Error())
5089	}
5090
5091	req, err := client.SetSecretPreparer(ctx, vaultBaseURL, secretName, parameters)
5092	if err != nil {
5093		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetSecret", nil, "Failure preparing request")
5094		return
5095	}
5096
5097	resp, err := client.SetSecretSender(req)
5098	if err != nil {
5099		result.Response = autorest.Response{Response: resp}
5100		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetSecret", resp, "Failure sending request")
5101		return
5102	}
5103
5104	result, err = client.SetSecretResponder(resp)
5105	if err != nil {
5106		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetSecret", resp, "Failure responding to request")
5107	}
5108
5109	return
5110}
5111
5112// SetSecretPreparer prepares the SetSecret request.
5113func (client BaseClient) SetSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string, parameters SecretSetParameters) (*http.Request, error) {
5114	urlParameters := map[string]interface{}{
5115		"vaultBaseUrl": vaultBaseURL,
5116	}
5117
5118	pathParameters := map[string]interface{}{
5119		"secret-name": autorest.Encode("path", secretName),
5120	}
5121
5122	const APIVersion = "2016-10-01"
5123	queryParameters := map[string]interface{}{
5124		"api-version": APIVersion,
5125	}
5126
5127	preparer := autorest.CreatePreparer(
5128		autorest.AsContentType("application/json; charset=utf-8"),
5129		autorest.AsPut(),
5130		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
5131		autorest.WithPathParameters("/secrets/{secret-name}", pathParameters),
5132		autorest.WithJSON(parameters),
5133		autorest.WithQueryParameters(queryParameters))
5134	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5135}
5136
5137// SetSecretSender sends the SetSecret request. The method will close the
5138// http.Response Body if it receives an error.
5139func (client BaseClient) SetSecretSender(req *http.Request) (*http.Response, error) {
5140	return autorest.SendWithSender(client, req,
5141		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5142}
5143
5144// SetSecretResponder handles the response to the SetSecret request. The method always
5145// closes the http.Response Body.
5146func (client BaseClient) SetSecretResponder(resp *http.Response) (result SecretBundle, err error) {
5147	err = autorest.Respond(
5148		resp,
5149		client.ByInspecting(),
5150		azure.WithErrorUnlessStatusCode(http.StatusOK),
5151		autorest.ByUnmarshallingJSON(&result),
5152		autorest.ByClosing())
5153	result.Response = autorest.Response{Response: resp}
5154	return
5155}
5156
5157// SetStorageAccount creates or updates a new storage account. This operation requires the storage/set permission.
5158// Parameters:
5159// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
5160// storageAccountName - the name of the storage account.
5161// parameters - the parameters to create a storage account.
5162func (client BaseClient) SetStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountCreateParameters) (result StorageBundle, err error) {
5163	if tracing.IsEnabled() {
5164		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SetStorageAccount")
5165		defer func() {
5166			sc := -1
5167			if result.Response.Response != nil {
5168				sc = result.Response.Response.StatusCode
5169			}
5170			tracing.EndSpan(ctx, sc, err)
5171		}()
5172	}
5173	if err := validation.Validate([]validation.Validation{
5174		{TargetValue: storageAccountName,
5175			Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}},
5176		{TargetValue: parameters,
5177			Constraints: []validation.Constraint{{Target: "parameters.ResourceID", Name: validation.Null, Rule: true, Chain: nil},
5178				{Target: "parameters.ActiveKeyName", Name: validation.Null, Rule: true, Chain: nil},
5179				{Target: "parameters.AutoRegenerateKey", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
5180		return result, validation.NewError("keyvault.BaseClient", "SetStorageAccount", err.Error())
5181	}
5182
5183	req, err := client.SetStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName, parameters)
5184	if err != nil {
5185		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetStorageAccount", nil, "Failure preparing request")
5186		return
5187	}
5188
5189	resp, err := client.SetStorageAccountSender(req)
5190	if err != nil {
5191		result.Response = autorest.Response{Response: resp}
5192		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetStorageAccount", resp, "Failure sending request")
5193		return
5194	}
5195
5196	result, err = client.SetStorageAccountResponder(resp)
5197	if err != nil {
5198		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "SetStorageAccount", resp, "Failure responding to request")
5199	}
5200
5201	return
5202}
5203
5204// SetStorageAccountPreparer prepares the SetStorageAccount request.
5205func (client BaseClient) SetStorageAccountPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountCreateParameters) (*http.Request, error) {
5206	urlParameters := map[string]interface{}{
5207		"vaultBaseUrl": vaultBaseURL,
5208	}
5209
5210	pathParameters := map[string]interface{}{
5211		"storage-account-name": autorest.Encode("path", storageAccountName),
5212	}
5213
5214	const APIVersion = "2016-10-01"
5215	queryParameters := map[string]interface{}{
5216		"api-version": APIVersion,
5217	}
5218
5219	preparer := autorest.CreatePreparer(
5220		autorest.AsContentType("application/json; charset=utf-8"),
5221		autorest.AsPut(),
5222		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
5223		autorest.WithPathParameters("/storage/{storage-account-name}", pathParameters),
5224		autorest.WithJSON(parameters),
5225		autorest.WithQueryParameters(queryParameters))
5226	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5227}
5228
5229// SetStorageAccountSender sends the SetStorageAccount request. The method will close the
5230// http.Response Body if it receives an error.
5231func (client BaseClient) SetStorageAccountSender(req *http.Request) (*http.Response, error) {
5232	return autorest.SendWithSender(client, req,
5233		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5234}
5235
5236// SetStorageAccountResponder handles the response to the SetStorageAccount request. The method always
5237// closes the http.Response Body.
5238func (client BaseClient) SetStorageAccountResponder(resp *http.Response) (result StorageBundle, err error) {
5239	err = autorest.Respond(
5240		resp,
5241		client.ByInspecting(),
5242		azure.WithErrorUnlessStatusCode(http.StatusOK),
5243		autorest.ByUnmarshallingJSON(&result),
5244		autorest.ByClosing())
5245	result.Response = autorest.Response{Response: resp}
5246	return
5247}
5248
5249// Sign the SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this
5250// operation uses the private portion of the key. This operation requires the keys/sign permission.
5251// Parameters:
5252// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
5253// keyName - the name of the key.
5254// keyVersion - the version of the key.
5255// parameters - the parameters for the signing operation.
5256func (client BaseClient) Sign(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeySignParameters) (result KeyOperationResult, err error) {
5257	if tracing.IsEnabled() {
5258		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.Sign")
5259		defer func() {
5260			sc := -1
5261			if result.Response.Response != nil {
5262				sc = result.Response.Response.StatusCode
5263			}
5264			tracing.EndSpan(ctx, sc, err)
5265		}()
5266	}
5267	if err := validation.Validate([]validation.Validation{
5268		{TargetValue: parameters,
5269			Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
5270		return result, validation.NewError("keyvault.BaseClient", "Sign", err.Error())
5271	}
5272
5273	req, err := client.SignPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters)
5274	if err != nil {
5275		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Sign", nil, "Failure preparing request")
5276		return
5277	}
5278
5279	resp, err := client.SignSender(req)
5280	if err != nil {
5281		result.Response = autorest.Response{Response: resp}
5282		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Sign", resp, "Failure sending request")
5283		return
5284	}
5285
5286	result, err = client.SignResponder(resp)
5287	if err != nil {
5288		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Sign", resp, "Failure responding to request")
5289	}
5290
5291	return
5292}
5293
5294// SignPreparer prepares the Sign request.
5295func (client BaseClient) SignPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeySignParameters) (*http.Request, error) {
5296	urlParameters := map[string]interface{}{
5297		"vaultBaseUrl": vaultBaseURL,
5298	}
5299
5300	pathParameters := map[string]interface{}{
5301		"key-name":    autorest.Encode("path", keyName),
5302		"key-version": autorest.Encode("path", keyVersion),
5303	}
5304
5305	const APIVersion = "2016-10-01"
5306	queryParameters := map[string]interface{}{
5307		"api-version": APIVersion,
5308	}
5309
5310	preparer := autorest.CreatePreparer(
5311		autorest.AsContentType("application/json; charset=utf-8"),
5312		autorest.AsPost(),
5313		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
5314		autorest.WithPathParameters("/keys/{key-name}/{key-version}/sign", pathParameters),
5315		autorest.WithJSON(parameters),
5316		autorest.WithQueryParameters(queryParameters))
5317	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5318}
5319
5320// SignSender sends the Sign request. The method will close the
5321// http.Response Body if it receives an error.
5322func (client BaseClient) SignSender(req *http.Request) (*http.Response, error) {
5323	return autorest.SendWithSender(client, req,
5324		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5325}
5326
5327// SignResponder handles the response to the Sign request. The method always
5328// closes the http.Response Body.
5329func (client BaseClient) SignResponder(resp *http.Response) (result KeyOperationResult, err error) {
5330	err = autorest.Respond(
5331		resp,
5332		client.ByInspecting(),
5333		azure.WithErrorUnlessStatusCode(http.StatusOK),
5334		autorest.ByUnmarshallingJSON(&result),
5335		autorest.ByClosing())
5336	result.Response = autorest.Response{Response: resp}
5337	return
5338}
5339
5340// UnwrapKey the UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This
5341// operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored
5342// in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey
5343// permission.
5344// Parameters:
5345// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
5346// keyName - the name of the key.
5347// keyVersion - the version of the key.
5348// parameters - the parameters for the key operation.
5349func (client BaseClient) UnwrapKey(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (result KeyOperationResult, err error) {
5350	if tracing.IsEnabled() {
5351		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UnwrapKey")
5352		defer func() {
5353			sc := -1
5354			if result.Response.Response != nil {
5355				sc = result.Response.Response.StatusCode
5356			}
5357			tracing.EndSpan(ctx, sc, err)
5358		}()
5359	}
5360	if err := validation.Validate([]validation.Validation{
5361		{TargetValue: parameters,
5362			Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
5363		return result, validation.NewError("keyvault.BaseClient", "UnwrapKey", err.Error())
5364	}
5365
5366	req, err := client.UnwrapKeyPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters)
5367	if err != nil {
5368		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UnwrapKey", nil, "Failure preparing request")
5369		return
5370	}
5371
5372	resp, err := client.UnwrapKeySender(req)
5373	if err != nil {
5374		result.Response = autorest.Response{Response: resp}
5375		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UnwrapKey", resp, "Failure sending request")
5376		return
5377	}
5378
5379	result, err = client.UnwrapKeyResponder(resp)
5380	if err != nil {
5381		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UnwrapKey", resp, "Failure responding to request")
5382	}
5383
5384	return
5385}
5386
5387// UnwrapKeyPreparer prepares the UnwrapKey request.
5388func (client BaseClient) UnwrapKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (*http.Request, error) {
5389	urlParameters := map[string]interface{}{
5390		"vaultBaseUrl": vaultBaseURL,
5391	}
5392
5393	pathParameters := map[string]interface{}{
5394		"key-name":    autorest.Encode("path", keyName),
5395		"key-version": autorest.Encode("path", keyVersion),
5396	}
5397
5398	const APIVersion = "2016-10-01"
5399	queryParameters := map[string]interface{}{
5400		"api-version": APIVersion,
5401	}
5402
5403	preparer := autorest.CreatePreparer(
5404		autorest.AsContentType("application/json; charset=utf-8"),
5405		autorest.AsPost(),
5406		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
5407		autorest.WithPathParameters("/keys/{key-name}/{key-version}/unwrapkey", pathParameters),
5408		autorest.WithJSON(parameters),
5409		autorest.WithQueryParameters(queryParameters))
5410	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5411}
5412
5413// UnwrapKeySender sends the UnwrapKey request. The method will close the
5414// http.Response Body if it receives an error.
5415func (client BaseClient) UnwrapKeySender(req *http.Request) (*http.Response, error) {
5416	return autorest.SendWithSender(client, req,
5417		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5418}
5419
5420// UnwrapKeyResponder handles the response to the UnwrapKey request. The method always
5421// closes the http.Response Body.
5422func (client BaseClient) UnwrapKeyResponder(resp *http.Response) (result KeyOperationResult, err error) {
5423	err = autorest.Respond(
5424		resp,
5425		client.ByInspecting(),
5426		azure.WithErrorUnlessStatusCode(http.StatusOK),
5427		autorest.ByUnmarshallingJSON(&result),
5428		autorest.ByClosing())
5429	result.Response = autorest.Response{Response: resp}
5430	return
5431}
5432
5433// UpdateCertificate the UpdateCertificate operation applies the specified update on the given certificate; the only
5434// elements updated are the certificate's attributes. This operation requires the certificates/update permission.
5435// Parameters:
5436// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
5437// certificateName - the name of the certificate in the given key vault.
5438// certificateVersion - the version of the certificate.
5439// parameters - the parameters for certificate update.
5440func (client BaseClient) UpdateCertificate(ctx context.Context, vaultBaseURL string, certificateName string, certificateVersion string, parameters CertificateUpdateParameters) (result CertificateBundle, err error) {
5441	if tracing.IsEnabled() {
5442		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateCertificate")
5443		defer func() {
5444			sc := -1
5445			if result.Response.Response != nil {
5446				sc = result.Response.Response.StatusCode
5447			}
5448			tracing.EndSpan(ctx, sc, err)
5449		}()
5450	}
5451	req, err := client.UpdateCertificatePreparer(ctx, vaultBaseURL, certificateName, certificateVersion, parameters)
5452	if err != nil {
5453		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificate", nil, "Failure preparing request")
5454		return
5455	}
5456
5457	resp, err := client.UpdateCertificateSender(req)
5458	if err != nil {
5459		result.Response = autorest.Response{Response: resp}
5460		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificate", resp, "Failure sending request")
5461		return
5462	}
5463
5464	result, err = client.UpdateCertificateResponder(resp)
5465	if err != nil {
5466		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificate", resp, "Failure responding to request")
5467	}
5468
5469	return
5470}
5471
5472// UpdateCertificatePreparer prepares the UpdateCertificate request.
5473func (client BaseClient) UpdateCertificatePreparer(ctx context.Context, vaultBaseURL string, certificateName string, certificateVersion string, parameters CertificateUpdateParameters) (*http.Request, error) {
5474	urlParameters := map[string]interface{}{
5475		"vaultBaseUrl": vaultBaseURL,
5476	}
5477
5478	pathParameters := map[string]interface{}{
5479		"certificate-name":    autorest.Encode("path", certificateName),
5480		"certificate-version": autorest.Encode("path", certificateVersion),
5481	}
5482
5483	const APIVersion = "2016-10-01"
5484	queryParameters := map[string]interface{}{
5485		"api-version": APIVersion,
5486	}
5487
5488	preparer := autorest.CreatePreparer(
5489		autorest.AsContentType("application/json; charset=utf-8"),
5490		autorest.AsPatch(),
5491		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
5492		autorest.WithPathParameters("/certificates/{certificate-name}/{certificate-version}", pathParameters),
5493		autorest.WithJSON(parameters),
5494		autorest.WithQueryParameters(queryParameters))
5495	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5496}
5497
5498// UpdateCertificateSender sends the UpdateCertificate request. The method will close the
5499// http.Response Body if it receives an error.
5500func (client BaseClient) UpdateCertificateSender(req *http.Request) (*http.Response, error) {
5501	return autorest.SendWithSender(client, req,
5502		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5503}
5504
5505// UpdateCertificateResponder handles the response to the UpdateCertificate request. The method always
5506// closes the http.Response Body.
5507func (client BaseClient) UpdateCertificateResponder(resp *http.Response) (result CertificateBundle, err error) {
5508	err = autorest.Respond(
5509		resp,
5510		client.ByInspecting(),
5511		azure.WithErrorUnlessStatusCode(http.StatusOK),
5512		autorest.ByUnmarshallingJSON(&result),
5513		autorest.ByClosing())
5514	result.Response = autorest.Response{Response: resp}
5515	return
5516}
5517
5518// UpdateCertificateIssuer the UpdateCertificateIssuer operation performs an update on the specified certificate issuer
5519// entity. This operation requires the certificates/setissuers permission.
5520// Parameters:
5521// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
5522// issuerName - the name of the issuer.
5523// parameter - certificate issuer update parameter.
5524func (client BaseClient) UpdateCertificateIssuer(ctx context.Context, vaultBaseURL string, issuerName string, parameter CertificateIssuerUpdateParameters) (result IssuerBundle, err error) {
5525	if tracing.IsEnabled() {
5526		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateCertificateIssuer")
5527		defer func() {
5528			sc := -1
5529			if result.Response.Response != nil {
5530				sc = result.Response.Response.StatusCode
5531			}
5532			tracing.EndSpan(ctx, sc, err)
5533		}()
5534	}
5535	req, err := client.UpdateCertificateIssuerPreparer(ctx, vaultBaseURL, issuerName, parameter)
5536	if err != nil {
5537		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificateIssuer", nil, "Failure preparing request")
5538		return
5539	}
5540
5541	resp, err := client.UpdateCertificateIssuerSender(req)
5542	if err != nil {
5543		result.Response = autorest.Response{Response: resp}
5544		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificateIssuer", resp, "Failure sending request")
5545		return
5546	}
5547
5548	result, err = client.UpdateCertificateIssuerResponder(resp)
5549	if err != nil {
5550		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificateIssuer", resp, "Failure responding to request")
5551	}
5552
5553	return
5554}
5555
5556// UpdateCertificateIssuerPreparer prepares the UpdateCertificateIssuer request.
5557func (client BaseClient) UpdateCertificateIssuerPreparer(ctx context.Context, vaultBaseURL string, issuerName string, parameter CertificateIssuerUpdateParameters) (*http.Request, error) {
5558	urlParameters := map[string]interface{}{
5559		"vaultBaseUrl": vaultBaseURL,
5560	}
5561
5562	pathParameters := map[string]interface{}{
5563		"issuer-name": autorest.Encode("path", issuerName),
5564	}
5565
5566	const APIVersion = "2016-10-01"
5567	queryParameters := map[string]interface{}{
5568		"api-version": APIVersion,
5569	}
5570
5571	preparer := autorest.CreatePreparer(
5572		autorest.AsContentType("application/json; charset=utf-8"),
5573		autorest.AsPatch(),
5574		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
5575		autorest.WithPathParameters("/certificates/issuers/{issuer-name}", pathParameters),
5576		autorest.WithJSON(parameter),
5577		autorest.WithQueryParameters(queryParameters))
5578	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5579}
5580
5581// UpdateCertificateIssuerSender sends the UpdateCertificateIssuer request. The method will close the
5582// http.Response Body if it receives an error.
5583func (client BaseClient) UpdateCertificateIssuerSender(req *http.Request) (*http.Response, error) {
5584	return autorest.SendWithSender(client, req,
5585		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5586}
5587
5588// UpdateCertificateIssuerResponder handles the response to the UpdateCertificateIssuer request. The method always
5589// closes the http.Response Body.
5590func (client BaseClient) UpdateCertificateIssuerResponder(resp *http.Response) (result IssuerBundle, err error) {
5591	err = autorest.Respond(
5592		resp,
5593		client.ByInspecting(),
5594		azure.WithErrorUnlessStatusCode(http.StatusOK),
5595		autorest.ByUnmarshallingJSON(&result),
5596		autorest.ByClosing())
5597	result.Response = autorest.Response{Response: resp}
5598	return
5599}
5600
5601// UpdateCertificateOperation updates a certificate creation operation that is already in progress. This operation
5602// requires the certificates/update permission.
5603// Parameters:
5604// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
5605// certificateName - the name of the certificate.
5606// certificateOperation - the certificate operation response.
5607func (client BaseClient) UpdateCertificateOperation(ctx context.Context, vaultBaseURL string, certificateName string, certificateOperation CertificateOperationUpdateParameter) (result CertificateOperation, err error) {
5608	if tracing.IsEnabled() {
5609		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateCertificateOperation")
5610		defer func() {
5611			sc := -1
5612			if result.Response.Response != nil {
5613				sc = result.Response.Response.StatusCode
5614			}
5615			tracing.EndSpan(ctx, sc, err)
5616		}()
5617	}
5618	req, err := client.UpdateCertificateOperationPreparer(ctx, vaultBaseURL, certificateName, certificateOperation)
5619	if err != nil {
5620		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificateOperation", nil, "Failure preparing request")
5621		return
5622	}
5623
5624	resp, err := client.UpdateCertificateOperationSender(req)
5625	if err != nil {
5626		result.Response = autorest.Response{Response: resp}
5627		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificateOperation", resp, "Failure sending request")
5628		return
5629	}
5630
5631	result, err = client.UpdateCertificateOperationResponder(resp)
5632	if err != nil {
5633		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificateOperation", resp, "Failure responding to request")
5634	}
5635
5636	return
5637}
5638
5639// UpdateCertificateOperationPreparer prepares the UpdateCertificateOperation request.
5640func (client BaseClient) UpdateCertificateOperationPreparer(ctx context.Context, vaultBaseURL string, certificateName string, certificateOperation CertificateOperationUpdateParameter) (*http.Request, error) {
5641	urlParameters := map[string]interface{}{
5642		"vaultBaseUrl": vaultBaseURL,
5643	}
5644
5645	pathParameters := map[string]interface{}{
5646		"certificate-name": autorest.Encode("path", certificateName),
5647	}
5648
5649	const APIVersion = "2016-10-01"
5650	queryParameters := map[string]interface{}{
5651		"api-version": APIVersion,
5652	}
5653
5654	preparer := autorest.CreatePreparer(
5655		autorest.AsContentType("application/json; charset=utf-8"),
5656		autorest.AsPatch(),
5657		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
5658		autorest.WithPathParameters("/certificates/{certificate-name}/pending", pathParameters),
5659		autorest.WithJSON(certificateOperation),
5660		autorest.WithQueryParameters(queryParameters))
5661	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5662}
5663
5664// UpdateCertificateOperationSender sends the UpdateCertificateOperation request. The method will close the
5665// http.Response Body if it receives an error.
5666func (client BaseClient) UpdateCertificateOperationSender(req *http.Request) (*http.Response, error) {
5667	return autorest.SendWithSender(client, req,
5668		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5669}
5670
5671// UpdateCertificateOperationResponder handles the response to the UpdateCertificateOperation request. The method always
5672// closes the http.Response Body.
5673func (client BaseClient) UpdateCertificateOperationResponder(resp *http.Response) (result CertificateOperation, err error) {
5674	err = autorest.Respond(
5675		resp,
5676		client.ByInspecting(),
5677		azure.WithErrorUnlessStatusCode(http.StatusOK),
5678		autorest.ByUnmarshallingJSON(&result),
5679		autorest.ByClosing())
5680	result.Response = autorest.Response{Response: resp}
5681	return
5682}
5683
5684// UpdateCertificatePolicy set specified members in the certificate policy. Leave others as null. This operation
5685// requires the certificates/update permission.
5686// Parameters:
5687// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
5688// certificateName - the name of the certificate in the given vault.
5689// certificatePolicy - the policy for the certificate.
5690func (client BaseClient) UpdateCertificatePolicy(ctx context.Context, vaultBaseURL string, certificateName string, certificatePolicy CertificatePolicy) (result CertificatePolicy, err error) {
5691	if tracing.IsEnabled() {
5692		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateCertificatePolicy")
5693		defer func() {
5694			sc := -1
5695			if result.Response.Response != nil {
5696				sc = result.Response.Response.StatusCode
5697			}
5698			tracing.EndSpan(ctx, sc, err)
5699		}()
5700	}
5701	req, err := client.UpdateCertificatePolicyPreparer(ctx, vaultBaseURL, certificateName, certificatePolicy)
5702	if err != nil {
5703		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificatePolicy", nil, "Failure preparing request")
5704		return
5705	}
5706
5707	resp, err := client.UpdateCertificatePolicySender(req)
5708	if err != nil {
5709		result.Response = autorest.Response{Response: resp}
5710		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificatePolicy", resp, "Failure sending request")
5711		return
5712	}
5713
5714	result, err = client.UpdateCertificatePolicyResponder(resp)
5715	if err != nil {
5716		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateCertificatePolicy", resp, "Failure responding to request")
5717	}
5718
5719	return
5720}
5721
5722// UpdateCertificatePolicyPreparer prepares the UpdateCertificatePolicy request.
5723func (client BaseClient) UpdateCertificatePolicyPreparer(ctx context.Context, vaultBaseURL string, certificateName string, certificatePolicy CertificatePolicy) (*http.Request, error) {
5724	urlParameters := map[string]interface{}{
5725		"vaultBaseUrl": vaultBaseURL,
5726	}
5727
5728	pathParameters := map[string]interface{}{
5729		"certificate-name": autorest.Encode("path", certificateName),
5730	}
5731
5732	const APIVersion = "2016-10-01"
5733	queryParameters := map[string]interface{}{
5734		"api-version": APIVersion,
5735	}
5736
5737	certificatePolicy.ID = nil
5738	preparer := autorest.CreatePreparer(
5739		autorest.AsContentType("application/json; charset=utf-8"),
5740		autorest.AsPatch(),
5741		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
5742		autorest.WithPathParameters("/certificates/{certificate-name}/policy", pathParameters),
5743		autorest.WithJSON(certificatePolicy),
5744		autorest.WithQueryParameters(queryParameters))
5745	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5746}
5747
5748// UpdateCertificatePolicySender sends the UpdateCertificatePolicy request. The method will close the
5749// http.Response Body if it receives an error.
5750func (client BaseClient) UpdateCertificatePolicySender(req *http.Request) (*http.Response, error) {
5751	return autorest.SendWithSender(client, req,
5752		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5753}
5754
5755// UpdateCertificatePolicyResponder handles the response to the UpdateCertificatePolicy request. The method always
5756// closes the http.Response Body.
5757func (client BaseClient) UpdateCertificatePolicyResponder(resp *http.Response) (result CertificatePolicy, err error) {
5758	err = autorest.Respond(
5759		resp,
5760		client.ByInspecting(),
5761		azure.WithErrorUnlessStatusCode(http.StatusOK),
5762		autorest.ByUnmarshallingJSON(&result),
5763		autorest.ByClosing())
5764	result.Response = autorest.Response{Response: resp}
5765	return
5766}
5767
5768// UpdateKey in order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic
5769// material of a key itself cannot be changed. This operation requires the keys/update permission.
5770// Parameters:
5771// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
5772// keyName - the name of key to update.
5773// keyVersion - the version of the key to update.
5774// parameters - the parameters of the key to update.
5775func (client BaseClient) UpdateKey(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyUpdateParameters) (result KeyBundle, err error) {
5776	if tracing.IsEnabled() {
5777		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateKey")
5778		defer func() {
5779			sc := -1
5780			if result.Response.Response != nil {
5781				sc = result.Response.Response.StatusCode
5782			}
5783			tracing.EndSpan(ctx, sc, err)
5784		}()
5785	}
5786	req, err := client.UpdateKeyPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters)
5787	if err != nil {
5788		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateKey", nil, "Failure preparing request")
5789		return
5790	}
5791
5792	resp, err := client.UpdateKeySender(req)
5793	if err != nil {
5794		result.Response = autorest.Response{Response: resp}
5795		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateKey", resp, "Failure sending request")
5796		return
5797	}
5798
5799	result, err = client.UpdateKeyResponder(resp)
5800	if err != nil {
5801		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateKey", resp, "Failure responding to request")
5802	}
5803
5804	return
5805}
5806
5807// UpdateKeyPreparer prepares the UpdateKey request.
5808func (client BaseClient) UpdateKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyUpdateParameters) (*http.Request, error) {
5809	urlParameters := map[string]interface{}{
5810		"vaultBaseUrl": vaultBaseURL,
5811	}
5812
5813	pathParameters := map[string]interface{}{
5814		"key-name":    autorest.Encode("path", keyName),
5815		"key-version": autorest.Encode("path", keyVersion),
5816	}
5817
5818	const APIVersion = "2016-10-01"
5819	queryParameters := map[string]interface{}{
5820		"api-version": APIVersion,
5821	}
5822
5823	preparer := autorest.CreatePreparer(
5824		autorest.AsContentType("application/json; charset=utf-8"),
5825		autorest.AsPatch(),
5826		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
5827		autorest.WithPathParameters("/keys/{key-name}/{key-version}", pathParameters),
5828		autorest.WithJSON(parameters),
5829		autorest.WithQueryParameters(queryParameters))
5830	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5831}
5832
5833// UpdateKeySender sends the UpdateKey request. The method will close the
5834// http.Response Body if it receives an error.
5835func (client BaseClient) UpdateKeySender(req *http.Request) (*http.Response, error) {
5836	return autorest.SendWithSender(client, req,
5837		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5838}
5839
5840// UpdateKeyResponder handles the response to the UpdateKey request. The method always
5841// closes the http.Response Body.
5842func (client BaseClient) UpdateKeyResponder(resp *http.Response) (result KeyBundle, err error) {
5843	err = autorest.Respond(
5844		resp,
5845		client.ByInspecting(),
5846		azure.WithErrorUnlessStatusCode(http.StatusOK),
5847		autorest.ByUnmarshallingJSON(&result),
5848		autorest.ByClosing())
5849	result.Response = autorest.Response{Response: resp}
5850	return
5851}
5852
5853// UpdateSasDefinition updates the specified attributes associated with the given SAS definition. This operation
5854// requires the storage/setsas permission.
5855// Parameters:
5856// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
5857// storageAccountName - the name of the storage account.
5858// sasDefinitionName - the name of the SAS definition.
5859// parameters - the parameters to update a SAS definition.
5860func (client BaseClient) UpdateSasDefinition(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string, parameters SasDefinitionUpdateParameters) (result SasDefinitionBundle, err error) {
5861	if tracing.IsEnabled() {
5862		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateSasDefinition")
5863		defer func() {
5864			sc := -1
5865			if result.Response.Response != nil {
5866				sc = result.Response.Response.StatusCode
5867			}
5868			tracing.EndSpan(ctx, sc, err)
5869		}()
5870	}
5871	if err := validation.Validate([]validation.Validation{
5872		{TargetValue: storageAccountName,
5873			Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}},
5874		{TargetValue: sasDefinitionName,
5875			Constraints: []validation.Constraint{{Target: "sasDefinitionName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil {
5876		return result, validation.NewError("keyvault.BaseClient", "UpdateSasDefinition", err.Error())
5877	}
5878
5879	req, err := client.UpdateSasDefinitionPreparer(ctx, vaultBaseURL, storageAccountName, sasDefinitionName, parameters)
5880	if err != nil {
5881		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateSasDefinition", nil, "Failure preparing request")
5882		return
5883	}
5884
5885	resp, err := client.UpdateSasDefinitionSender(req)
5886	if err != nil {
5887		result.Response = autorest.Response{Response: resp}
5888		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateSasDefinition", resp, "Failure sending request")
5889		return
5890	}
5891
5892	result, err = client.UpdateSasDefinitionResponder(resp)
5893	if err != nil {
5894		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateSasDefinition", resp, "Failure responding to request")
5895	}
5896
5897	return
5898}
5899
5900// UpdateSasDefinitionPreparer prepares the UpdateSasDefinition request.
5901func (client BaseClient) UpdateSasDefinitionPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string, parameters SasDefinitionUpdateParameters) (*http.Request, error) {
5902	urlParameters := map[string]interface{}{
5903		"vaultBaseUrl": vaultBaseURL,
5904	}
5905
5906	pathParameters := map[string]interface{}{
5907		"sas-definition-name":  autorest.Encode("path", sasDefinitionName),
5908		"storage-account-name": autorest.Encode("path", storageAccountName),
5909	}
5910
5911	const APIVersion = "2016-10-01"
5912	queryParameters := map[string]interface{}{
5913		"api-version": APIVersion,
5914	}
5915
5916	preparer := autorest.CreatePreparer(
5917		autorest.AsContentType("application/json; charset=utf-8"),
5918		autorest.AsPatch(),
5919		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
5920		autorest.WithPathParameters("/storage/{storage-account-name}/sas/{sas-definition-name}", pathParameters),
5921		autorest.WithJSON(parameters),
5922		autorest.WithQueryParameters(queryParameters))
5923	return preparer.Prepare((&http.Request{}).WithContext(ctx))
5924}
5925
5926// UpdateSasDefinitionSender sends the UpdateSasDefinition request. The method will close the
5927// http.Response Body if it receives an error.
5928func (client BaseClient) UpdateSasDefinitionSender(req *http.Request) (*http.Response, error) {
5929	return autorest.SendWithSender(client, req,
5930		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5931}
5932
5933// UpdateSasDefinitionResponder handles the response to the UpdateSasDefinition request. The method always
5934// closes the http.Response Body.
5935func (client BaseClient) UpdateSasDefinitionResponder(resp *http.Response) (result SasDefinitionBundle, err error) {
5936	err = autorest.Respond(
5937		resp,
5938		client.ByInspecting(),
5939		azure.WithErrorUnlessStatusCode(http.StatusOK),
5940		autorest.ByUnmarshallingJSON(&result),
5941		autorest.ByClosing())
5942	result.Response = autorest.Response{Response: resp}
5943	return
5944}
5945
5946// UpdateSecret the UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not
5947// specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires
5948// the secrets/set permission.
5949// Parameters:
5950// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
5951// secretName - the name of the secret.
5952// secretVersion - the version of the secret.
5953// parameters - the parameters for update secret operation.
5954func (client BaseClient) UpdateSecret(ctx context.Context, vaultBaseURL string, secretName string, secretVersion string, parameters SecretUpdateParameters) (result SecretBundle, err error) {
5955	if tracing.IsEnabled() {
5956		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateSecret")
5957		defer func() {
5958			sc := -1
5959			if result.Response.Response != nil {
5960				sc = result.Response.Response.StatusCode
5961			}
5962			tracing.EndSpan(ctx, sc, err)
5963		}()
5964	}
5965	req, err := client.UpdateSecretPreparer(ctx, vaultBaseURL, secretName, secretVersion, parameters)
5966	if err != nil {
5967		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateSecret", nil, "Failure preparing request")
5968		return
5969	}
5970
5971	resp, err := client.UpdateSecretSender(req)
5972	if err != nil {
5973		result.Response = autorest.Response{Response: resp}
5974		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateSecret", resp, "Failure sending request")
5975		return
5976	}
5977
5978	result, err = client.UpdateSecretResponder(resp)
5979	if err != nil {
5980		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateSecret", resp, "Failure responding to request")
5981	}
5982
5983	return
5984}
5985
5986// UpdateSecretPreparer prepares the UpdateSecret request.
5987func (client BaseClient) UpdateSecretPreparer(ctx context.Context, vaultBaseURL string, secretName string, secretVersion string, parameters SecretUpdateParameters) (*http.Request, error) {
5988	urlParameters := map[string]interface{}{
5989		"vaultBaseUrl": vaultBaseURL,
5990	}
5991
5992	pathParameters := map[string]interface{}{
5993		"secret-name":    autorest.Encode("path", secretName),
5994		"secret-version": autorest.Encode("path", secretVersion),
5995	}
5996
5997	const APIVersion = "2016-10-01"
5998	queryParameters := map[string]interface{}{
5999		"api-version": APIVersion,
6000	}
6001
6002	preparer := autorest.CreatePreparer(
6003		autorest.AsContentType("application/json; charset=utf-8"),
6004		autorest.AsPatch(),
6005		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
6006		autorest.WithPathParameters("/secrets/{secret-name}/{secret-version}", pathParameters),
6007		autorest.WithJSON(parameters),
6008		autorest.WithQueryParameters(queryParameters))
6009	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6010}
6011
6012// UpdateSecretSender sends the UpdateSecret request. The method will close the
6013// http.Response Body if it receives an error.
6014func (client BaseClient) UpdateSecretSender(req *http.Request) (*http.Response, error) {
6015	return autorest.SendWithSender(client, req,
6016		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6017}
6018
6019// UpdateSecretResponder handles the response to the UpdateSecret request. The method always
6020// closes the http.Response Body.
6021func (client BaseClient) UpdateSecretResponder(resp *http.Response) (result SecretBundle, err error) {
6022	err = autorest.Respond(
6023		resp,
6024		client.ByInspecting(),
6025		azure.WithErrorUnlessStatusCode(http.StatusOK),
6026		autorest.ByUnmarshallingJSON(&result),
6027		autorest.ByClosing())
6028	result.Response = autorest.Response{Response: resp}
6029	return
6030}
6031
6032// UpdateStorageAccount updates the specified attributes associated with the given storage account. This operation
6033// requires the storage/set/update permission.
6034// Parameters:
6035// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
6036// storageAccountName - the name of the storage account.
6037// parameters - the parameters to update a storage account.
6038func (client BaseClient) UpdateStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountUpdateParameters) (result StorageBundle, err error) {
6039	if tracing.IsEnabled() {
6040		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateStorageAccount")
6041		defer func() {
6042			sc := -1
6043			if result.Response.Response != nil {
6044				sc = result.Response.Response.StatusCode
6045			}
6046			tracing.EndSpan(ctx, sc, err)
6047		}()
6048	}
6049	if err := validation.Validate([]validation.Validation{
6050		{TargetValue: storageAccountName,
6051			Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil {
6052		return result, validation.NewError("keyvault.BaseClient", "UpdateStorageAccount", err.Error())
6053	}
6054
6055	req, err := client.UpdateStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName, parameters)
6056	if err != nil {
6057		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateStorageAccount", nil, "Failure preparing request")
6058		return
6059	}
6060
6061	resp, err := client.UpdateStorageAccountSender(req)
6062	if err != nil {
6063		result.Response = autorest.Response{Response: resp}
6064		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateStorageAccount", resp, "Failure sending request")
6065		return
6066	}
6067
6068	result, err = client.UpdateStorageAccountResponder(resp)
6069	if err != nil {
6070		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "UpdateStorageAccount", resp, "Failure responding to request")
6071	}
6072
6073	return
6074}
6075
6076// UpdateStorageAccountPreparer prepares the UpdateStorageAccount request.
6077func (client BaseClient) UpdateStorageAccountPreparer(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountUpdateParameters) (*http.Request, error) {
6078	urlParameters := map[string]interface{}{
6079		"vaultBaseUrl": vaultBaseURL,
6080	}
6081
6082	pathParameters := map[string]interface{}{
6083		"storage-account-name": autorest.Encode("path", storageAccountName),
6084	}
6085
6086	const APIVersion = "2016-10-01"
6087	queryParameters := map[string]interface{}{
6088		"api-version": APIVersion,
6089	}
6090
6091	preparer := autorest.CreatePreparer(
6092		autorest.AsContentType("application/json; charset=utf-8"),
6093		autorest.AsPatch(),
6094		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
6095		autorest.WithPathParameters("/storage/{storage-account-name}", pathParameters),
6096		autorest.WithJSON(parameters),
6097		autorest.WithQueryParameters(queryParameters))
6098	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6099}
6100
6101// UpdateStorageAccountSender sends the UpdateStorageAccount request. The method will close the
6102// http.Response Body if it receives an error.
6103func (client BaseClient) UpdateStorageAccountSender(req *http.Request) (*http.Response, error) {
6104	return autorest.SendWithSender(client, req,
6105		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6106}
6107
6108// UpdateStorageAccountResponder handles the response to the UpdateStorageAccount request. The method always
6109// closes the http.Response Body.
6110func (client BaseClient) UpdateStorageAccountResponder(resp *http.Response) (result StorageBundle, err error) {
6111	err = autorest.Respond(
6112		resp,
6113		client.ByInspecting(),
6114		azure.WithErrorUnlessStatusCode(http.StatusOK),
6115		autorest.ByUnmarshallingJSON(&result),
6116		autorest.ByClosing())
6117	result.Response = autorest.Response{Response: resp}
6118	return
6119}
6120
6121// Verify the VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly
6122// necessary for asymmetric keys stored in Azure Key Vault since signature verification can be performed using the
6123// public portion of the key but this operation is supported as a convenience for callers that only have a
6124// key-reference and not the public portion of the key. This operation requires the keys/verify permission.
6125// Parameters:
6126// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
6127// keyName - the name of the key.
6128// keyVersion - the version of the key.
6129// parameters - the parameters for verify operations.
6130func (client BaseClient) Verify(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyVerifyParameters) (result KeyVerifyResult, err error) {
6131	if tracing.IsEnabled() {
6132		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.Verify")
6133		defer func() {
6134			sc := -1
6135			if result.Response.Response != nil {
6136				sc = result.Response.Response.StatusCode
6137			}
6138			tracing.EndSpan(ctx, sc, err)
6139		}()
6140	}
6141	if err := validation.Validate([]validation.Validation{
6142		{TargetValue: parameters,
6143			Constraints: []validation.Constraint{{Target: "parameters.Digest", Name: validation.Null, Rule: true, Chain: nil},
6144				{Target: "parameters.Signature", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
6145		return result, validation.NewError("keyvault.BaseClient", "Verify", err.Error())
6146	}
6147
6148	req, err := client.VerifyPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters)
6149	if err != nil {
6150		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Verify", nil, "Failure preparing request")
6151		return
6152	}
6153
6154	resp, err := client.VerifySender(req)
6155	if err != nil {
6156		result.Response = autorest.Response{Response: resp}
6157		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Verify", resp, "Failure sending request")
6158		return
6159	}
6160
6161	result, err = client.VerifyResponder(resp)
6162	if err != nil {
6163		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "Verify", resp, "Failure responding to request")
6164	}
6165
6166	return
6167}
6168
6169// VerifyPreparer prepares the Verify request.
6170func (client BaseClient) VerifyPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyVerifyParameters) (*http.Request, error) {
6171	urlParameters := map[string]interface{}{
6172		"vaultBaseUrl": vaultBaseURL,
6173	}
6174
6175	pathParameters := map[string]interface{}{
6176		"key-name":    autorest.Encode("path", keyName),
6177		"key-version": autorest.Encode("path", keyVersion),
6178	}
6179
6180	const APIVersion = "2016-10-01"
6181	queryParameters := map[string]interface{}{
6182		"api-version": APIVersion,
6183	}
6184
6185	preparer := autorest.CreatePreparer(
6186		autorest.AsContentType("application/json; charset=utf-8"),
6187		autorest.AsPost(),
6188		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
6189		autorest.WithPathParameters("/keys/{key-name}/{key-version}/verify", pathParameters),
6190		autorest.WithJSON(parameters),
6191		autorest.WithQueryParameters(queryParameters))
6192	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6193}
6194
6195// VerifySender sends the Verify request. The method will close the
6196// http.Response Body if it receives an error.
6197func (client BaseClient) VerifySender(req *http.Request) (*http.Response, error) {
6198	return autorest.SendWithSender(client, req,
6199		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6200}
6201
6202// VerifyResponder handles the response to the Verify request. The method always
6203// closes the http.Response Body.
6204func (client BaseClient) VerifyResponder(resp *http.Response) (result KeyVerifyResult, err error) {
6205	err = autorest.Respond(
6206		resp,
6207		client.ByInspecting(),
6208		azure.WithErrorUnlessStatusCode(http.StatusOK),
6209		autorest.ByUnmarshallingJSON(&result),
6210		autorest.ByClosing())
6211	result.Response = autorest.Response{Response: resp}
6212	return
6213}
6214
6215// WrapKey the WRAP operation supports encryption of a symmetric key using a key encryption key that has previously
6216// been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure
6217// Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This
6218// operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have
6219// access to the public key material. This operation requires the keys/wrapKey permission.
6220// Parameters:
6221// vaultBaseURL - the vault name, for example https://myvault.vault.azure.net.
6222// keyName - the name of the key.
6223// keyVersion - the version of the key.
6224// parameters - the parameters for wrap operation.
6225func (client BaseClient) WrapKey(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (result KeyOperationResult, err error) {
6226	if tracing.IsEnabled() {
6227		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.WrapKey")
6228		defer func() {
6229			sc := -1
6230			if result.Response.Response != nil {
6231				sc = result.Response.Response.StatusCode
6232			}
6233			tracing.EndSpan(ctx, sc, err)
6234		}()
6235	}
6236	if err := validation.Validate([]validation.Validation{
6237		{TargetValue: parameters,
6238			Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
6239		return result, validation.NewError("keyvault.BaseClient", "WrapKey", err.Error())
6240	}
6241
6242	req, err := client.WrapKeyPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters)
6243	if err != nil {
6244		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "WrapKey", nil, "Failure preparing request")
6245		return
6246	}
6247
6248	resp, err := client.WrapKeySender(req)
6249	if err != nil {
6250		result.Response = autorest.Response{Response: resp}
6251		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "WrapKey", resp, "Failure sending request")
6252		return
6253	}
6254
6255	result, err = client.WrapKeyResponder(resp)
6256	if err != nil {
6257		err = autorest.NewErrorWithError(err, "keyvault.BaseClient", "WrapKey", resp, "Failure responding to request")
6258	}
6259
6260	return
6261}
6262
6263// WrapKeyPreparer prepares the WrapKey request.
6264func (client BaseClient) WrapKeyPreparer(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters) (*http.Request, error) {
6265	urlParameters := map[string]interface{}{
6266		"vaultBaseUrl": vaultBaseURL,
6267	}
6268
6269	pathParameters := map[string]interface{}{
6270		"key-name":    autorest.Encode("path", keyName),
6271		"key-version": autorest.Encode("path", keyVersion),
6272	}
6273
6274	const APIVersion = "2016-10-01"
6275	queryParameters := map[string]interface{}{
6276		"api-version": APIVersion,
6277	}
6278
6279	preparer := autorest.CreatePreparer(
6280		autorest.AsContentType("application/json; charset=utf-8"),
6281		autorest.AsPost(),
6282		autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters),
6283		autorest.WithPathParameters("/keys/{key-name}/{key-version}/wrapkey", pathParameters),
6284		autorest.WithJSON(parameters),
6285		autorest.WithQueryParameters(queryParameters))
6286	return preparer.Prepare((&http.Request{}).WithContext(ctx))
6287}
6288
6289// WrapKeySender sends the WrapKey request. The method will close the
6290// http.Response Body if it receives an error.
6291func (client BaseClient) WrapKeySender(req *http.Request) (*http.Response, error) {
6292	return autorest.SendWithSender(client, req,
6293		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6294}
6295
6296// WrapKeyResponder handles the response to the WrapKey request. The method always
6297// closes the http.Response Body.
6298func (client BaseClient) WrapKeyResponder(resp *http.Response) (result KeyOperationResult, err error) {
6299	err = autorest.Respond(
6300		resp,
6301		client.ByInspecting(),
6302		azure.WithErrorUnlessStatusCode(http.StatusOK),
6303		autorest.ByUnmarshallingJSON(&result),
6304		autorest.ByClosing())
6305	result.Response = autorest.Response{Response: resp}
6306	return
6307}
6308