1package migrate
2
3// Copyright (c) Microsoft and contributors.  All rights reserved.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13//
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
17// Code generated by Microsoft (R) AutoRest Code Generator.
18// Changes may cause incorrect behavior and will be lost if the code is regenerated.
19
20import (
21	"context"
22	"github.com/Azure/go-autorest/autorest"
23	"github.com/Azure/go-autorest/autorest/azure"
24	"github.com/Azure/go-autorest/tracing"
25	"net/http"
26)
27
28// ProjectsClient is the migrate your workloads to Azure.
29type ProjectsClient struct {
30	BaseClient
31}
32
33// NewProjectsClient creates an instance of the ProjectsClient client.
34func NewProjectsClient(subscriptionID string, acceptLanguage string) ProjectsClient {
35	return NewProjectsClientWithBaseURI(DefaultBaseURI, subscriptionID, acceptLanguage)
36}
37
38// NewProjectsClientWithBaseURI creates an instance of the ProjectsClient client.
39func NewProjectsClientWithBaseURI(baseURI string, subscriptionID string, acceptLanguage string) ProjectsClient {
40	return ProjectsClient{NewWithBaseURI(baseURI, subscriptionID, acceptLanguage)}
41}
42
43// DeleteMigrateProject delete the migrate project. Deleting non-existent project is a no-operation.
44// Parameters:
45// resourceGroupName - name of the Azure Resource Group that migrate project is part of.
46// migrateProjectName - name of the Azure Migrate project.
47func (client ProjectsClient) DeleteMigrateProject(ctx context.Context, resourceGroupName string, migrateProjectName string) (result autorest.Response, err error) {
48	if tracing.IsEnabled() {
49		ctx = tracing.StartSpan(ctx, fqdn+"/ProjectsClient.DeleteMigrateProject")
50		defer func() {
51			sc := -1
52			if result.Response != nil {
53				sc = result.Response.StatusCode
54			}
55			tracing.EndSpan(ctx, sc, err)
56		}()
57	}
58	req, err := client.DeleteMigrateProjectPreparer(ctx, resourceGroupName, migrateProjectName)
59	if err != nil {
60		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "DeleteMigrateProject", nil, "Failure preparing request")
61		return
62	}
63
64	resp, err := client.DeleteMigrateProjectSender(req)
65	if err != nil {
66		result.Response = resp
67		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "DeleteMigrateProject", resp, "Failure sending request")
68		return
69	}
70
71	result, err = client.DeleteMigrateProjectResponder(resp)
72	if err != nil {
73		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "DeleteMigrateProject", resp, "Failure responding to request")
74	}
75
76	return
77}
78
79// DeleteMigrateProjectPreparer prepares the DeleteMigrateProject request.
80func (client ProjectsClient) DeleteMigrateProjectPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string) (*http.Request, error) {
81	pathParameters := map[string]interface{}{
82		"migrateProjectName": autorest.Encode("path", migrateProjectName),
83		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
84		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
85	}
86
87	const APIVersion = "2018-09-01-preview"
88	queryParameters := map[string]interface{}{
89		"api-version": APIVersion,
90	}
91
92	preparer := autorest.CreatePreparer(
93		autorest.AsDelete(),
94		autorest.WithBaseURL(client.BaseURI),
95		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}", pathParameters),
96		autorest.WithQueryParameters(queryParameters))
97	if len(client.AcceptLanguage) > 0 {
98		preparer = autorest.DecoratePreparer(preparer,
99			autorest.WithHeader("Accept-Language", autorest.String(client.AcceptLanguage)))
100	}
101	return preparer.Prepare((&http.Request{}).WithContext(ctx))
102}
103
104// DeleteMigrateProjectSender sends the DeleteMigrateProject request. The method will close the
105// http.Response Body if it receives an error.
106func (client ProjectsClient) DeleteMigrateProjectSender(req *http.Request) (*http.Response, error) {
107	sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
108	return autorest.SendWithSender(client, req, sd...)
109}
110
111// DeleteMigrateProjectResponder handles the response to the DeleteMigrateProject request. The method always
112// closes the http.Response Body.
113func (client ProjectsClient) DeleteMigrateProjectResponder(resp *http.Response) (result autorest.Response, err error) {
114	err = autorest.Respond(
115		resp,
116		client.ByInspecting(),
117		azure.WithErrorUnlessStatusCode(http.StatusOK),
118		autorest.ByClosing())
119	result.Response = resp
120	return
121}
122
123// GetMigrateProject sends the get migrate project request.
124// Parameters:
125// resourceGroupName - name of the Azure Resource Group that migrate project is part of.
126// migrateProjectName - name of the Azure Migrate project.
127func (client ProjectsClient) GetMigrateProject(ctx context.Context, resourceGroupName string, migrateProjectName string) (result Project, err error) {
128	if tracing.IsEnabled() {
129		ctx = tracing.StartSpan(ctx, fqdn+"/ProjectsClient.GetMigrateProject")
130		defer func() {
131			sc := -1
132			if result.Response.Response != nil {
133				sc = result.Response.Response.StatusCode
134			}
135			tracing.EndSpan(ctx, sc, err)
136		}()
137	}
138	req, err := client.GetMigrateProjectPreparer(ctx, resourceGroupName, migrateProjectName)
139	if err != nil {
140		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "GetMigrateProject", nil, "Failure preparing request")
141		return
142	}
143
144	resp, err := client.GetMigrateProjectSender(req)
145	if err != nil {
146		result.Response = autorest.Response{Response: resp}
147		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "GetMigrateProject", resp, "Failure sending request")
148		return
149	}
150
151	result, err = client.GetMigrateProjectResponder(resp)
152	if err != nil {
153		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "GetMigrateProject", resp, "Failure responding to request")
154	}
155
156	return
157}
158
159// GetMigrateProjectPreparer prepares the GetMigrateProject request.
160func (client ProjectsClient) GetMigrateProjectPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string) (*http.Request, error) {
161	pathParameters := map[string]interface{}{
162		"migrateProjectName": autorest.Encode("path", migrateProjectName),
163		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
164		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
165	}
166
167	const APIVersion = "2018-09-01-preview"
168	queryParameters := map[string]interface{}{
169		"api-version": APIVersion,
170	}
171
172	preparer := autorest.CreatePreparer(
173		autorest.AsGet(),
174		autorest.WithBaseURL(client.BaseURI),
175		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}", pathParameters),
176		autorest.WithQueryParameters(queryParameters))
177	return preparer.Prepare((&http.Request{}).WithContext(ctx))
178}
179
180// GetMigrateProjectSender sends the GetMigrateProject request. The method will close the
181// http.Response Body if it receives an error.
182func (client ProjectsClient) GetMigrateProjectSender(req *http.Request) (*http.Response, error) {
183	sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
184	return autorest.SendWithSender(client, req, sd...)
185}
186
187// GetMigrateProjectResponder handles the response to the GetMigrateProject request. The method always
188// closes the http.Response Body.
189func (client ProjectsClient) GetMigrateProjectResponder(resp *http.Response) (result Project, err error) {
190	err = autorest.Respond(
191		resp,
192		client.ByInspecting(),
193		azure.WithErrorUnlessStatusCode(http.StatusOK),
194		autorest.ByUnmarshallingJSON(&result),
195		autorest.ByClosing())
196	result.Response = autorest.Response{Response: resp}
197	return
198}
199
200// PatchMigrateProject update a migrate project with specified name. Supports partial updates, for example only tags
201// can be provided.
202// Parameters:
203// resourceGroupName - name of the Azure Resource Group that migrate project is part of.
204// migrateProjectName - name of the Azure Migrate project.
205// body - body with migrate project details.
206func (client ProjectsClient) PatchMigrateProject(ctx context.Context, resourceGroupName string, migrateProjectName string, body Project) (result Project, err error) {
207	if tracing.IsEnabled() {
208		ctx = tracing.StartSpan(ctx, fqdn+"/ProjectsClient.PatchMigrateProject")
209		defer func() {
210			sc := -1
211			if result.Response.Response != nil {
212				sc = result.Response.Response.StatusCode
213			}
214			tracing.EndSpan(ctx, sc, err)
215		}()
216	}
217	req, err := client.PatchMigrateProjectPreparer(ctx, resourceGroupName, migrateProjectName, body)
218	if err != nil {
219		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "PatchMigrateProject", nil, "Failure preparing request")
220		return
221	}
222
223	resp, err := client.PatchMigrateProjectSender(req)
224	if err != nil {
225		result.Response = autorest.Response{Response: resp}
226		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "PatchMigrateProject", resp, "Failure sending request")
227		return
228	}
229
230	result, err = client.PatchMigrateProjectResponder(resp)
231	if err != nil {
232		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "PatchMigrateProject", resp, "Failure responding to request")
233	}
234
235	return
236}
237
238// PatchMigrateProjectPreparer prepares the PatchMigrateProject request.
239func (client ProjectsClient) PatchMigrateProjectPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string, body Project) (*http.Request, error) {
240	pathParameters := map[string]interface{}{
241		"migrateProjectName": autorest.Encode("path", migrateProjectName),
242		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
243		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
244	}
245
246	const APIVersion = "2018-09-01-preview"
247	queryParameters := map[string]interface{}{
248		"api-version": APIVersion,
249	}
250
251	body.ID = nil
252	body.Name = nil
253	body.Type = nil
254	preparer := autorest.CreatePreparer(
255		autorest.AsContentType("application/json; charset=utf-8"),
256		autorest.AsPatch(),
257		autorest.WithBaseURL(client.BaseURI),
258		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}", pathParameters),
259		autorest.WithJSON(body),
260		autorest.WithQueryParameters(queryParameters))
261	if len(client.AcceptLanguage) > 0 {
262		preparer = autorest.DecoratePreparer(preparer,
263			autorest.WithHeader("Accept-Language", autorest.String(client.AcceptLanguage)))
264	}
265	return preparer.Prepare((&http.Request{}).WithContext(ctx))
266}
267
268// PatchMigrateProjectSender sends the PatchMigrateProject request. The method will close the
269// http.Response Body if it receives an error.
270func (client ProjectsClient) PatchMigrateProjectSender(req *http.Request) (*http.Response, error) {
271	sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
272	return autorest.SendWithSender(client, req, sd...)
273}
274
275// PatchMigrateProjectResponder handles the response to the PatchMigrateProject request. The method always
276// closes the http.Response Body.
277func (client ProjectsClient) PatchMigrateProjectResponder(resp *http.Response) (result Project, err error) {
278	err = autorest.Respond(
279		resp,
280		client.ByInspecting(),
281		azure.WithErrorUnlessStatusCode(http.StatusOK),
282		autorest.ByUnmarshallingJSON(&result),
283		autorest.ByClosing())
284	result.Response = autorest.Response{Response: resp}
285	return
286}
287
288// PutMigrateProject sends the put migrate project request.
289// Parameters:
290// resourceGroupName - name of the Azure Resource Group that migrate project is part of.
291// migrateProjectName - name of the Azure Migrate project.
292// body - body with migrate project details.
293func (client ProjectsClient) PutMigrateProject(ctx context.Context, resourceGroupName string, migrateProjectName string, body Project) (result Project, err error) {
294	if tracing.IsEnabled() {
295		ctx = tracing.StartSpan(ctx, fqdn+"/ProjectsClient.PutMigrateProject")
296		defer func() {
297			sc := -1
298			if result.Response.Response != nil {
299				sc = result.Response.Response.StatusCode
300			}
301			tracing.EndSpan(ctx, sc, err)
302		}()
303	}
304	req, err := client.PutMigrateProjectPreparer(ctx, resourceGroupName, migrateProjectName, body)
305	if err != nil {
306		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "PutMigrateProject", nil, "Failure preparing request")
307		return
308	}
309
310	resp, err := client.PutMigrateProjectSender(req)
311	if err != nil {
312		result.Response = autorest.Response{Response: resp}
313		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "PutMigrateProject", resp, "Failure sending request")
314		return
315	}
316
317	result, err = client.PutMigrateProjectResponder(resp)
318	if err != nil {
319		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "PutMigrateProject", resp, "Failure responding to request")
320	}
321
322	return
323}
324
325// PutMigrateProjectPreparer prepares the PutMigrateProject request.
326func (client ProjectsClient) PutMigrateProjectPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string, body Project) (*http.Request, error) {
327	pathParameters := map[string]interface{}{
328		"migrateProjectName": autorest.Encode("path", migrateProjectName),
329		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
330		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
331	}
332
333	const APIVersion = "2018-09-01-preview"
334	queryParameters := map[string]interface{}{
335		"api-version": APIVersion,
336	}
337
338	body.ID = nil
339	body.Name = nil
340	body.Type = nil
341	preparer := autorest.CreatePreparer(
342		autorest.AsContentType("application/json; charset=utf-8"),
343		autorest.AsPut(),
344		autorest.WithBaseURL(client.BaseURI),
345		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}", pathParameters),
346		autorest.WithJSON(body),
347		autorest.WithQueryParameters(queryParameters))
348	if len(client.AcceptLanguage) > 0 {
349		preparer = autorest.DecoratePreparer(preparer,
350			autorest.WithHeader("Accept-Language", autorest.String(client.AcceptLanguage)))
351	}
352	return preparer.Prepare((&http.Request{}).WithContext(ctx))
353}
354
355// PutMigrateProjectSender sends the PutMigrateProject request. The method will close the
356// http.Response Body if it receives an error.
357func (client ProjectsClient) PutMigrateProjectSender(req *http.Request) (*http.Response, error) {
358	sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
359	return autorest.SendWithSender(client, req, sd...)
360}
361
362// PutMigrateProjectResponder handles the response to the PutMigrateProject request. The method always
363// closes the http.Response Body.
364func (client ProjectsClient) PutMigrateProjectResponder(resp *http.Response) (result Project, err error) {
365	err = autorest.Respond(
366		resp,
367		client.ByInspecting(),
368		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
369		autorest.ByUnmarshallingJSON(&result),
370		autorest.ByClosing())
371	result.Response = autorest.Response{Response: resp}
372	return
373}
374
375// RefreshMigrateProjectSummary sends the refresh migrate project summary request.
376// Parameters:
377// resourceGroupName - name of the Azure Resource Group that migrate project is part of.
378// migrateProjectName - name of the Azure Migrate project.
379// input - the goal input which needs to be refreshed.
380func (client ProjectsClient) RefreshMigrateProjectSummary(ctx context.Context, resourceGroupName string, migrateProjectName string, input RefreshSummaryInput) (result RefreshSummaryResult, err error) {
381	if tracing.IsEnabled() {
382		ctx = tracing.StartSpan(ctx, fqdn+"/ProjectsClient.RefreshMigrateProjectSummary")
383		defer func() {
384			sc := -1
385			if result.Response.Response != nil {
386				sc = result.Response.Response.StatusCode
387			}
388			tracing.EndSpan(ctx, sc, err)
389		}()
390	}
391	req, err := client.RefreshMigrateProjectSummaryPreparer(ctx, resourceGroupName, migrateProjectName, input)
392	if err != nil {
393		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "RefreshMigrateProjectSummary", nil, "Failure preparing request")
394		return
395	}
396
397	resp, err := client.RefreshMigrateProjectSummarySender(req)
398	if err != nil {
399		result.Response = autorest.Response{Response: resp}
400		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "RefreshMigrateProjectSummary", resp, "Failure sending request")
401		return
402	}
403
404	result, err = client.RefreshMigrateProjectSummaryResponder(resp)
405	if err != nil {
406		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "RefreshMigrateProjectSummary", resp, "Failure responding to request")
407	}
408
409	return
410}
411
412// RefreshMigrateProjectSummaryPreparer prepares the RefreshMigrateProjectSummary request.
413func (client ProjectsClient) RefreshMigrateProjectSummaryPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string, input RefreshSummaryInput) (*http.Request, error) {
414	pathParameters := map[string]interface{}{
415		"migrateProjectName": autorest.Encode("path", migrateProjectName),
416		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
417		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
418	}
419
420	const APIVersion = "2018-09-01-preview"
421	queryParameters := map[string]interface{}{
422		"api-version": APIVersion,
423	}
424
425	preparer := autorest.CreatePreparer(
426		autorest.AsContentType("application/json; charset=utf-8"),
427		autorest.AsPost(),
428		autorest.WithBaseURL(client.BaseURI),
429		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/refreshSummary", pathParameters),
430		autorest.WithJSON(input),
431		autorest.WithQueryParameters(queryParameters))
432	return preparer.Prepare((&http.Request{}).WithContext(ctx))
433}
434
435// RefreshMigrateProjectSummarySender sends the RefreshMigrateProjectSummary request. The method will close the
436// http.Response Body if it receives an error.
437func (client ProjectsClient) RefreshMigrateProjectSummarySender(req *http.Request) (*http.Response, error) {
438	sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
439	return autorest.SendWithSender(client, req, sd...)
440}
441
442// RefreshMigrateProjectSummaryResponder handles the response to the RefreshMigrateProjectSummary request. The method always
443// closes the http.Response Body.
444func (client ProjectsClient) RefreshMigrateProjectSummaryResponder(resp *http.Response) (result RefreshSummaryResult, err error) {
445	err = autorest.Respond(
446		resp,
447		client.ByInspecting(),
448		azure.WithErrorUnlessStatusCode(http.StatusOK),
449		autorest.ByUnmarshallingJSON(&result),
450		autorest.ByClosing())
451	result.Response = autorest.Response{Response: resp}
452	return
453}
454
455// RegisterTool sends the register tool request.
456// Parameters:
457// resourceGroupName - name of the Azure Resource Group that migrate project is part of.
458// migrateProjectName - name of the Azure Migrate project.
459// input - input containing the name of the tool to be registered.
460func (client ProjectsClient) RegisterTool(ctx context.Context, resourceGroupName string, migrateProjectName string, input RegisterToolInput) (result RegistrationResult, err error) {
461	if tracing.IsEnabled() {
462		ctx = tracing.StartSpan(ctx, fqdn+"/ProjectsClient.RegisterTool")
463		defer func() {
464			sc := -1
465			if result.Response.Response != nil {
466				sc = result.Response.Response.StatusCode
467			}
468			tracing.EndSpan(ctx, sc, err)
469		}()
470	}
471	req, err := client.RegisterToolPreparer(ctx, resourceGroupName, migrateProjectName, input)
472	if err != nil {
473		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "RegisterTool", nil, "Failure preparing request")
474		return
475	}
476
477	resp, err := client.RegisterToolSender(req)
478	if err != nil {
479		result.Response = autorest.Response{Response: resp}
480		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "RegisterTool", resp, "Failure sending request")
481		return
482	}
483
484	result, err = client.RegisterToolResponder(resp)
485	if err != nil {
486		err = autorest.NewErrorWithError(err, "migrate.ProjectsClient", "RegisterTool", resp, "Failure responding to request")
487	}
488
489	return
490}
491
492// RegisterToolPreparer prepares the RegisterTool request.
493func (client ProjectsClient) RegisterToolPreparer(ctx context.Context, resourceGroupName string, migrateProjectName string, input RegisterToolInput) (*http.Request, error) {
494	pathParameters := map[string]interface{}{
495		"migrateProjectName": autorest.Encode("path", migrateProjectName),
496		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
497		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
498	}
499
500	const APIVersion = "2018-09-01-preview"
501	queryParameters := map[string]interface{}{
502		"api-version": APIVersion,
503	}
504
505	preparer := autorest.CreatePreparer(
506		autorest.AsContentType("application/json; charset=utf-8"),
507		autorest.AsPost(),
508		autorest.WithBaseURL(client.BaseURI),
509		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/migrateProjects/{migrateProjectName}/registerTool", pathParameters),
510		autorest.WithJSON(input),
511		autorest.WithQueryParameters(queryParameters))
512	if len(client.AcceptLanguage) > 0 {
513		preparer = autorest.DecoratePreparer(preparer,
514			autorest.WithHeader("Accept-Language", autorest.String(client.AcceptLanguage)))
515	}
516	return preparer.Prepare((&http.Request{}).WithContext(ctx))
517}
518
519// RegisterToolSender sends the RegisterTool request. The method will close the
520// http.Response Body if it receives an error.
521func (client ProjectsClient) RegisterToolSender(req *http.Request) (*http.Response, error) {
522	sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
523	return autorest.SendWithSender(client, req, sd...)
524}
525
526// RegisterToolResponder handles the response to the RegisterTool request. The method always
527// closes the http.Response Body.
528func (client ProjectsClient) RegisterToolResponder(resp *http.Response) (result RegistrationResult, err error) {
529	err = autorest.Respond(
530		resp,
531		client.ByInspecting(),
532		azure.WithErrorUnlessStatusCode(http.StatusOK),
533		autorest.ByUnmarshallingJSON(&result),
534		autorest.ByClosing())
535	result.Response = autorest.Response{Response: resp}
536	return
537}
538