1package datamigration 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 "net/http" 25) 26 27// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 28// TasksClient is the data Migration Client 29type TasksClient struct { 30 BaseClient 31} 32 33// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 34// NewTasksClient creates an instance of the TasksClient client. 35func NewTasksClient(subscriptionID string) TasksClient { 36 return NewTasksClientWithBaseURI(DefaultBaseURI, subscriptionID) 37} 38 39// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 40// NewTasksClientWithBaseURI creates an instance of the TasksClient client. 41func NewTasksClientWithBaseURI(baseURI string, subscriptionID string) TasksClient { 42 return TasksClient{NewWithBaseURI(baseURI, subscriptionID)} 43} 44 45// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 46// Cancel the tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This 47// method cancels a task if it's currently queued or running. 48// 49// groupName is name of the resource group serviceName is name of the service projectName is name of the project 50// taskName is name of the Task 51func (client TasksClient) Cancel(ctx context.Context, groupName string, serviceName string, projectName string, taskName string) (result ProjectTask, err error) { 52 req, err := client.CancelPreparer(ctx, groupName, serviceName, projectName, taskName) 53 if err != nil { 54 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "Cancel", nil, "Failure preparing request") 55 return 56 } 57 58 resp, err := client.CancelSender(req) 59 if err != nil { 60 result.Response = autorest.Response{Response: resp} 61 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "Cancel", resp, "Failure sending request") 62 return 63 } 64 65 result, err = client.CancelResponder(resp) 66 if err != nil { 67 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "Cancel", resp, "Failure responding to request") 68 } 69 70 return 71} 72 73// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 74// CancelPreparer prepares the Cancel request. 75func (client TasksClient) CancelPreparer(ctx context.Context, groupName string, serviceName string, projectName string, taskName string) (*http.Request, error) { 76 pathParameters := map[string]interface{}{ 77 "groupName": autorest.Encode("path", groupName), 78 "projectName": autorest.Encode("path", projectName), 79 "serviceName": autorest.Encode("path", serviceName), 80 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 81 "taskName": autorest.Encode("path", taskName), 82 } 83 84 const APIVersion = "2017-11-15-preview" 85 queryParameters := map[string]interface{}{ 86 "api-version": APIVersion, 87 } 88 89 preparer := autorest.CreatePreparer( 90 autorest.AsPost(), 91 autorest.WithBaseURL(client.BaseURI), 92 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/cancel", pathParameters), 93 autorest.WithQueryParameters(queryParameters)) 94 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 95} 96 97// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 98// CancelSender sends the Cancel request. The method will close the 99// http.Response Body if it receives an error. 100func (client TasksClient) CancelSender(req *http.Request) (*http.Response, error) { 101 return autorest.SendWithSender(client, req, 102 azure.DoRetryWithRegistration(client.Client)) 103} 104 105// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 106// CancelResponder handles the response to the Cancel request. The method always 107// closes the http.Response Body. 108func (client TasksClient) CancelResponder(resp *http.Response) (result ProjectTask, err error) { 109 err = autorest.Respond( 110 resp, 111 client.ByInspecting(), 112 azure.WithErrorUnlessStatusCode(http.StatusOK), 113 autorest.ByUnmarshallingJSON(&result), 114 autorest.ByClosing()) 115 result.Response = autorest.Response{Response: resp} 116 return 117} 118 119// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 120// CreateOrUpdate the tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. 121// The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom 122// properties, there is little reason to update an exising one. 123// 124// parameters is information about the task groupName is name of the resource group serviceName is name of the 125// service projectName is name of the project taskName is name of the Task 126func (client TasksClient) CreateOrUpdate(ctx context.Context, parameters ProjectTask, groupName string, serviceName string, projectName string, taskName string) (result ProjectTask, err error) { 127 req, err := client.CreateOrUpdatePreparer(ctx, parameters, groupName, serviceName, projectName, taskName) 128 if err != nil { 129 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "CreateOrUpdate", nil, "Failure preparing request") 130 return 131 } 132 133 resp, err := client.CreateOrUpdateSender(req) 134 if err != nil { 135 result.Response = autorest.Response{Response: resp} 136 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "CreateOrUpdate", resp, "Failure sending request") 137 return 138 } 139 140 result, err = client.CreateOrUpdateResponder(resp) 141 if err != nil { 142 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "CreateOrUpdate", resp, "Failure responding to request") 143 } 144 145 return 146} 147 148// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 149// CreateOrUpdatePreparer prepares the CreateOrUpdate request. 150func (client TasksClient) CreateOrUpdatePreparer(ctx context.Context, parameters ProjectTask, groupName string, serviceName string, projectName string, taskName string) (*http.Request, error) { 151 pathParameters := map[string]interface{}{ 152 "groupName": autorest.Encode("path", groupName), 153 "projectName": autorest.Encode("path", projectName), 154 "serviceName": autorest.Encode("path", serviceName), 155 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 156 "taskName": autorest.Encode("path", taskName), 157 } 158 159 const APIVersion = "2017-11-15-preview" 160 queryParameters := map[string]interface{}{ 161 "api-version": APIVersion, 162 } 163 164 preparer := autorest.CreatePreparer( 165 autorest.AsContentType("application/json; charset=utf-8"), 166 autorest.AsPut(), 167 autorest.WithBaseURL(client.BaseURI), 168 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}", pathParameters), 169 autorest.WithJSON(parameters), 170 autorest.WithQueryParameters(queryParameters)) 171 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 172} 173 174// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 175// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the 176// http.Response Body if it receives an error. 177func (client TasksClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { 178 return autorest.SendWithSender(client, req, 179 azure.DoRetryWithRegistration(client.Client)) 180} 181 182// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 183// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always 184// closes the http.Response Body. 185func (client TasksClient) CreateOrUpdateResponder(resp *http.Response) (result ProjectTask, err error) { 186 err = autorest.Respond( 187 resp, 188 client.ByInspecting(), 189 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 190 autorest.ByUnmarshallingJSON(&result), 191 autorest.ByClosing()) 192 result.Response = autorest.Response{Response: resp} 193 return 194} 195 196// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 197// Delete the tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE 198// method deletes a task, canceling it first if it's running. 199// 200// groupName is name of the resource group serviceName is name of the service projectName is name of the project 201// taskName is name of the Task deleteRunningTasks is delete the resource even if it contains running tasks 202func (client TasksClient) Delete(ctx context.Context, groupName string, serviceName string, projectName string, taskName string, deleteRunningTasks *bool) (result autorest.Response, err error) { 203 req, err := client.DeletePreparer(ctx, groupName, serviceName, projectName, taskName, deleteRunningTasks) 204 if err != nil { 205 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "Delete", nil, "Failure preparing request") 206 return 207 } 208 209 resp, err := client.DeleteSender(req) 210 if err != nil { 211 result.Response = resp 212 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "Delete", resp, "Failure sending request") 213 return 214 } 215 216 result, err = client.DeleteResponder(resp) 217 if err != nil { 218 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "Delete", resp, "Failure responding to request") 219 } 220 221 return 222} 223 224// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 225// DeletePreparer prepares the Delete request. 226func (client TasksClient) DeletePreparer(ctx context.Context, groupName string, serviceName string, projectName string, taskName string, deleteRunningTasks *bool) (*http.Request, error) { 227 pathParameters := map[string]interface{}{ 228 "groupName": autorest.Encode("path", groupName), 229 "projectName": autorest.Encode("path", projectName), 230 "serviceName": autorest.Encode("path", serviceName), 231 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 232 "taskName": autorest.Encode("path", taskName), 233 } 234 235 const APIVersion = "2017-11-15-preview" 236 queryParameters := map[string]interface{}{ 237 "api-version": APIVersion, 238 } 239 if deleteRunningTasks != nil { 240 queryParameters["deleteRunningTasks"] = autorest.Encode("query", *deleteRunningTasks) 241 } 242 243 preparer := autorest.CreatePreparer( 244 autorest.AsDelete(), 245 autorest.WithBaseURL(client.BaseURI), 246 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}", pathParameters), 247 autorest.WithQueryParameters(queryParameters)) 248 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 249} 250 251// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 252// DeleteSender sends the Delete request. The method will close the 253// http.Response Body if it receives an error. 254func (client TasksClient) DeleteSender(req *http.Request) (*http.Response, error) { 255 return autorest.SendWithSender(client, req, 256 azure.DoRetryWithRegistration(client.Client)) 257} 258 259// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 260// DeleteResponder handles the response to the Delete request. The method always 261// closes the http.Response Body. 262func (client TasksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 263 err = autorest.Respond( 264 resp, 265 client.ByInspecting(), 266 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 267 autorest.ByClosing()) 268 result.Response = resp 269 return 270} 271 272// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 273// Get the tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET 274// method retrieves information about a task. 275// 276// groupName is name of the resource group serviceName is name of the service projectName is name of the project 277// taskName is name of the Task expand is expand the response 278func (client TasksClient) Get(ctx context.Context, groupName string, serviceName string, projectName string, taskName string, expand string) (result ProjectTask, err error) { 279 req, err := client.GetPreparer(ctx, groupName, serviceName, projectName, taskName, expand) 280 if err != nil { 281 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "Get", nil, "Failure preparing request") 282 return 283 } 284 285 resp, err := client.GetSender(req) 286 if err != nil { 287 result.Response = autorest.Response{Response: resp} 288 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "Get", resp, "Failure sending request") 289 return 290 } 291 292 result, err = client.GetResponder(resp) 293 if err != nil { 294 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "Get", resp, "Failure responding to request") 295 } 296 297 return 298} 299 300// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 301// GetPreparer prepares the Get request. 302func (client TasksClient) GetPreparer(ctx context.Context, groupName string, serviceName string, projectName string, taskName string, expand string) (*http.Request, error) { 303 pathParameters := map[string]interface{}{ 304 "groupName": autorest.Encode("path", groupName), 305 "projectName": autorest.Encode("path", projectName), 306 "serviceName": autorest.Encode("path", serviceName), 307 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 308 "taskName": autorest.Encode("path", taskName), 309 } 310 311 const APIVersion = "2017-11-15-preview" 312 queryParameters := map[string]interface{}{ 313 "api-version": APIVersion, 314 } 315 if len(expand) > 0 { 316 queryParameters["$expand"] = autorest.Encode("query", expand) 317 } 318 319 preparer := autorest.CreatePreparer( 320 autorest.AsGet(), 321 autorest.WithBaseURL(client.BaseURI), 322 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}", pathParameters), 323 autorest.WithQueryParameters(queryParameters)) 324 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 325} 326 327// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 328// GetSender sends the Get request. The method will close the 329// http.Response Body if it receives an error. 330func (client TasksClient) GetSender(req *http.Request) (*http.Response, error) { 331 return autorest.SendWithSender(client, req, 332 azure.DoRetryWithRegistration(client.Client)) 333} 334 335// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 336// GetResponder handles the response to the Get request. The method always 337// closes the http.Response Body. 338func (client TasksClient) GetResponder(resp *http.Response) (result ProjectTask, err error) { 339 err = autorest.Respond( 340 resp, 341 client.ByInspecting(), 342 azure.WithErrorUnlessStatusCode(http.StatusOK), 343 autorest.ByUnmarshallingJSON(&result), 344 autorest.ByClosing()) 345 result.Response = autorest.Response{Response: resp} 346 return 347} 348 349// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 350// List the services resource is the top-level resource that represents the Data Migration Service. This method returns 351// a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error 352// occurred while querying the status of that task. 353// 354// groupName is name of the resource group serviceName is name of the service projectName is name of the project 355// taskType is filter tasks by task type 356func (client TasksClient) List(ctx context.Context, groupName string, serviceName string, projectName string, taskType string) (result TaskListPage, err error) { 357 result.fn = client.listNextResults 358 req, err := client.ListPreparer(ctx, groupName, serviceName, projectName, taskType) 359 if err != nil { 360 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "List", nil, "Failure preparing request") 361 return 362 } 363 364 resp, err := client.ListSender(req) 365 if err != nil { 366 result.tl.Response = autorest.Response{Response: resp} 367 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "List", resp, "Failure sending request") 368 return 369 } 370 371 result.tl, err = client.ListResponder(resp) 372 if err != nil { 373 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "List", resp, "Failure responding to request") 374 } 375 376 return 377} 378 379// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 380// ListPreparer prepares the List request. 381func (client TasksClient) ListPreparer(ctx context.Context, groupName string, serviceName string, projectName string, taskType string) (*http.Request, error) { 382 pathParameters := map[string]interface{}{ 383 "groupName": autorest.Encode("path", groupName), 384 "projectName": autorest.Encode("path", projectName), 385 "serviceName": autorest.Encode("path", serviceName), 386 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 387 } 388 389 const APIVersion = "2017-11-15-preview" 390 queryParameters := map[string]interface{}{ 391 "api-version": APIVersion, 392 } 393 if len(taskType) > 0 { 394 queryParameters["taskType"] = autorest.Encode("query", taskType) 395 } 396 397 preparer := autorest.CreatePreparer( 398 autorest.AsGet(), 399 autorest.WithBaseURL(client.BaseURI), 400 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks", pathParameters), 401 autorest.WithQueryParameters(queryParameters)) 402 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 403} 404 405// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 406// ListSender sends the List request. The method will close the 407// http.Response Body if it receives an error. 408func (client TasksClient) ListSender(req *http.Request) (*http.Response, error) { 409 return autorest.SendWithSender(client, req, 410 azure.DoRetryWithRegistration(client.Client)) 411} 412 413// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 414// ListResponder handles the response to the List request. The method always 415// closes the http.Response Body. 416func (client TasksClient) ListResponder(resp *http.Response) (result TaskList, err error) { 417 err = autorest.Respond( 418 resp, 419 client.ByInspecting(), 420 azure.WithErrorUnlessStatusCode(http.StatusOK), 421 autorest.ByUnmarshallingJSON(&result), 422 autorest.ByClosing()) 423 result.Response = autorest.Response{Response: resp} 424 return 425} 426 427// listNextResults retrieves the next set of results, if any. 428func (client TasksClient) listNextResults(lastResults TaskList) (result TaskList, err error) { 429 req, err := lastResults.taskListPreparer() 430 if err != nil { 431 return result, autorest.NewErrorWithError(err, "datamigration.TasksClient", "listNextResults", nil, "Failure preparing next results request") 432 } 433 if req == nil { 434 return 435 } 436 resp, err := client.ListSender(req) 437 if err != nil { 438 result.Response = autorest.Response{Response: resp} 439 return result, autorest.NewErrorWithError(err, "datamigration.TasksClient", "listNextResults", resp, "Failure sending next results request") 440 } 441 result, err = client.ListResponder(resp) 442 if err != nil { 443 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "listNextResults", resp, "Failure responding to next results request") 444 } 445 return 446} 447 448// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 449// ListComplete enumerates all values, automatically crossing page boundaries as required. 450func (client TasksClient) ListComplete(ctx context.Context, groupName string, serviceName string, projectName string, taskType string) (result TaskListIterator, err error) { 451 result.page, err = client.List(ctx, groupName, serviceName, projectName, taskType) 452 return 453} 454 455// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 456// Update the tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH 457// method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. 458// 459// parameters is information about the task groupName is name of the resource group serviceName is name of the 460// service projectName is name of the project taskName is name of the Task 461func (client TasksClient) Update(ctx context.Context, parameters ProjectTask, groupName string, serviceName string, projectName string, taskName string) (result ProjectTask, err error) { 462 req, err := client.UpdatePreparer(ctx, parameters, groupName, serviceName, projectName, taskName) 463 if err != nil { 464 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "Update", nil, "Failure preparing request") 465 return 466 } 467 468 resp, err := client.UpdateSender(req) 469 if err != nil { 470 result.Response = autorest.Response{Response: resp} 471 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "Update", resp, "Failure sending request") 472 return 473 } 474 475 result, err = client.UpdateResponder(resp) 476 if err != nil { 477 err = autorest.NewErrorWithError(err, "datamigration.TasksClient", "Update", resp, "Failure responding to request") 478 } 479 480 return 481} 482 483// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 484// UpdatePreparer prepares the Update request. 485func (client TasksClient) UpdatePreparer(ctx context.Context, parameters ProjectTask, groupName string, serviceName string, projectName string, taskName string) (*http.Request, error) { 486 pathParameters := map[string]interface{}{ 487 "groupName": autorest.Encode("path", groupName), 488 "projectName": autorest.Encode("path", projectName), 489 "serviceName": autorest.Encode("path", serviceName), 490 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 491 "taskName": autorest.Encode("path", taskName), 492 } 493 494 const APIVersion = "2017-11-15-preview" 495 queryParameters := map[string]interface{}{ 496 "api-version": APIVersion, 497 } 498 499 preparer := autorest.CreatePreparer( 500 autorest.AsContentType("application/json; charset=utf-8"), 501 autorest.AsPatch(), 502 autorest.WithBaseURL(client.BaseURI), 503 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}", pathParameters), 504 autorest.WithJSON(parameters), 505 autorest.WithQueryParameters(queryParameters)) 506 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 507} 508 509// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 510// UpdateSender sends the Update request. The method will close the 511// http.Response Body if it receives an error. 512func (client TasksClient) UpdateSender(req *http.Request) (*http.Response, error) { 513 return autorest.SendWithSender(client, req, 514 azure.DoRetryWithRegistration(client.Client)) 515} 516 517// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/datamigration/mgmt/2017-11-15-preview/datamigration instead. 518// UpdateResponder handles the response to the Update request. The method always 519// closes the http.Response Body. 520func (client TasksClient) UpdateResponder(resp *http.Response) (result ProjectTask, err error) { 521 err = autorest.Respond( 522 resp, 523 client.ByInspecting(), 524 azure.WithErrorUnlessStatusCode(http.StatusOK), 525 autorest.ByUnmarshallingJSON(&result), 526 autorest.ByClosing()) 527 result.Response = autorest.Response{Response: resp} 528 return 529} 530