...

Source file src/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.3/customvision/training/client.go

Documentation: github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.3/customvision/training

     1  // Package training implements the Azure ARM Training service API version 3.3.
     2  //
     3  //
     4  package training
     5  
     6  // Copyright (c) Microsoft Corporation. All rights reserved.
     7  // Licensed under the MIT License. See License.txt in the project root for license information.
     8  //
     9  // Code generated by Microsoft (R) AutoRest Code Generator.
    10  // Changes may cause incorrect behavior and will be lost if the code is regenerated.
    11  
    12  import (
    13  	"context"
    14  	"github.com/Azure/go-autorest/autorest"
    15  	"github.com/Azure/go-autorest/autorest/azure"
    16  	"github.com/Azure/go-autorest/autorest/validation"
    17  	"github.com/Azure/go-autorest/tracing"
    18  	"github.com/gofrs/uuid"
    19  	"io"
    20  	"net/http"
    21  )
    22  
    23  // BaseClient is the base client for Training.
    24  type BaseClient struct {
    25  	autorest.Client
    26  	Endpoint string
    27  }
    28  
    29  // New creates an instance of the BaseClient client.
    30  func New(endpoint string) BaseClient {
    31  	return NewWithoutDefaults(endpoint)
    32  }
    33  
    34  // NewWithoutDefaults creates an instance of the BaseClient client.
    35  func NewWithoutDefaults(endpoint string) BaseClient {
    36  	return BaseClient{
    37  		Client:   autorest.NewClientWithUserAgent(UserAgent()),
    38  		Endpoint: endpoint,
    39  	}
    40  }
    41  
    42  // CreateImageRegions this API accepts a batch of image regions, and optionally tags, to update existing images with
    43  // region information.
    44  // There is a limit of 64 entries in the batch.
    45  // If all regions are successful created, 200(OK) status code will be returned.
    46  // Otherwise, 207 (Multi-Status) status code will be returned and detail status for each region will be listed in the
    47  // response payload.
    48  // Parameters:
    49  // projectID - the project id.
    50  // batch - batch of image regions which include a tag and bounding box. Limited to 64.
    51  func (client BaseClient) CreateImageRegions(ctx context.Context, projectID uuid.UUID, batch ImageRegionCreateBatch) (result ImageRegionCreateSummary, err error) {
    52  	if tracing.IsEnabled() {
    53  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateImageRegions")
    54  		defer func() {
    55  			sc := -1
    56  			if result.Response.Response != nil {
    57  				sc = result.Response.Response.StatusCode
    58  			}
    59  			tracing.EndSpan(ctx, sc, err)
    60  		}()
    61  	}
    62  	req, err := client.CreateImageRegionsPreparer(ctx, projectID, batch)
    63  	if err != nil {
    64  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImageRegions", nil, "Failure preparing request")
    65  		return
    66  	}
    67  
    68  	resp, err := client.CreateImageRegionsSender(req)
    69  	if err != nil {
    70  		result.Response = autorest.Response{Response: resp}
    71  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImageRegions", resp, "Failure sending request")
    72  		return
    73  	}
    74  
    75  	result, err = client.CreateImageRegionsResponder(resp)
    76  	if err != nil {
    77  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImageRegions", resp, "Failure responding to request")
    78  		return
    79  	}
    80  
    81  	return
    82  }
    83  
    84  // CreateImageRegionsPreparer prepares the CreateImageRegions request.
    85  func (client BaseClient) CreateImageRegionsPreparer(ctx context.Context, projectID uuid.UUID, batch ImageRegionCreateBatch) (*http.Request, error) {
    86  	urlParameters := map[string]interface{}{
    87  		"Endpoint": client.Endpoint,
    88  	}
    89  
    90  	pathParameters := map[string]interface{}{
    91  		"projectId": autorest.Encode("path", projectID),
    92  	}
    93  
    94  	preparer := autorest.CreatePreparer(
    95  		autorest.AsContentType("application/json; charset=utf-8"),
    96  		autorest.AsPost(),
    97  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
    98  		autorest.WithPathParameters("/projects/{projectId}/images/regions", pathParameters),
    99  		autorest.WithJSON(batch))
   100  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   101  }
   102  
   103  // CreateImageRegionsSender sends the CreateImageRegions request. The method will close the
   104  // http.Response Body if it receives an error.
   105  func (client BaseClient) CreateImageRegionsSender(req *http.Request) (*http.Response, error) {
   106  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   107  }
   108  
   109  // CreateImageRegionsResponder handles the response to the CreateImageRegions request. The method always
   110  // closes the http.Response Body.
   111  func (client BaseClient) CreateImageRegionsResponder(resp *http.Response) (result ImageRegionCreateSummary, err error) {
   112  	err = autorest.Respond(
   113  		resp,
   114  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusMultiStatus),
   115  		autorest.ByUnmarshallingJSON(&result),
   116  		autorest.ByClosing())
   117  	result.Response = autorest.Response{Response: resp}
   118  	return
   119  }
   120  
   121  // CreateImagesFromData this API accepts body content as multipart/form-data and application/octet-stream. When using
   122  // multipart
   123  // multiple image files can be sent at once, with a maximum of 64 files.
   124  // If all images are successful created, 200(OK) status code will be returned.
   125  // Otherwise, 207 (Multi-Status) status code will be returned and detail status for each image will be listed in the
   126  // response payload.
   127  // Parameters:
   128  // projectID - the project id.
   129  // imageData - binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB.
   130  // tagIds - the tags ids with which to tag each image. Limited to 20.
   131  func (client BaseClient) CreateImagesFromData(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, tagIds []uuid.UUID) (result ImageCreateSummary, err error) {
   132  	if tracing.IsEnabled() {
   133  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateImagesFromData")
   134  		defer func() {
   135  			sc := -1
   136  			if result.Response.Response != nil {
   137  				sc = result.Response.Response.StatusCode
   138  			}
   139  			tracing.EndSpan(ctx, sc, err)
   140  		}()
   141  	}
   142  	if err := validation.Validate([]validation.Validation{
   143  		{TargetValue: tagIds,
   144  			Constraints: []validation.Constraint{{Target: "tagIds", Name: validation.Null, Rule: false,
   145  				Chain: []validation.Constraint{{Target: "tagIds", Name: validation.MaxItems, Rule: 20, Chain: nil},
   146  					{Target: "tagIds", Name: validation.MinItems, Rule: 0, Chain: nil},
   147  				}}}}}); err != nil {
   148  		return result, validation.NewError("training.BaseClient", "CreateImagesFromData", err.Error())
   149  	}
   150  
   151  	req, err := client.CreateImagesFromDataPreparer(ctx, projectID, imageData, tagIds)
   152  	if err != nil {
   153  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromData", nil, "Failure preparing request")
   154  		return
   155  	}
   156  
   157  	resp, err := client.CreateImagesFromDataSender(req)
   158  	if err != nil {
   159  		result.Response = autorest.Response{Response: resp}
   160  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromData", resp, "Failure sending request")
   161  		return
   162  	}
   163  
   164  	result, err = client.CreateImagesFromDataResponder(resp)
   165  	if err != nil {
   166  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromData", resp, "Failure responding to request")
   167  		return
   168  	}
   169  
   170  	return
   171  }
   172  
   173  // CreateImagesFromDataPreparer prepares the CreateImagesFromData request.
   174  func (client BaseClient) CreateImagesFromDataPreparer(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, tagIds []uuid.UUID) (*http.Request, error) {
   175  	urlParameters := map[string]interface{}{
   176  		"Endpoint": client.Endpoint,
   177  	}
   178  
   179  	pathParameters := map[string]interface{}{
   180  		"projectId": autorest.Encode("path", projectID),
   181  	}
   182  
   183  	queryParameters := map[string]interface{}{}
   184  	if tagIds != nil && len(tagIds) > 0 {
   185  		queryParameters["tagIds"] = autorest.Encode("query", tagIds, ",")
   186  	}
   187  
   188  	formDataParameters := map[string]interface{}{
   189  		"imageData": imageData,
   190  	}
   191  
   192  	preparer := autorest.CreatePreparer(
   193  		autorest.AsPost(),
   194  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
   195  		autorest.WithPathParameters("/projects/{projectId}/images", pathParameters),
   196  		autorest.WithQueryParameters(queryParameters),
   197  		autorest.WithMultiPartFormData(formDataParameters))
   198  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   199  }
   200  
   201  // CreateImagesFromDataSender sends the CreateImagesFromData request. The method will close the
   202  // http.Response Body if it receives an error.
   203  func (client BaseClient) CreateImagesFromDataSender(req *http.Request) (*http.Response, error) {
   204  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   205  }
   206  
   207  // CreateImagesFromDataResponder handles the response to the CreateImagesFromData request. The method always
   208  // closes the http.Response Body.
   209  func (client BaseClient) CreateImagesFromDataResponder(resp *http.Response) (result ImageCreateSummary, err error) {
   210  	err = autorest.Respond(
   211  		resp,
   212  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusMultiStatus),
   213  		autorest.ByUnmarshallingJSON(&result),
   214  		autorest.ByClosing())
   215  	result.Response = autorest.Response{Response: resp}
   216  	return
   217  }
   218  
   219  // CreateImagesFromFiles this API accepts a batch of files, and optionally tags, to create images. There is a limit of
   220  // 64 images and 20 tags.
   221  // If all images are successful created, 200(OK) status code will be returned.
   222  // Otherwise, 207 (Multi-Status) status code will be returned and detail status for each image will be listed in the
   223  // response payload.
   224  // Parameters:
   225  // projectID - the project id.
   226  // batch - the batch of image files to add. Limited to 64 images and 20 tags per batch.
   227  func (client BaseClient) CreateImagesFromFiles(ctx context.Context, projectID uuid.UUID, batch ImageFileCreateBatch) (result ImageCreateSummary, err error) {
   228  	if tracing.IsEnabled() {
   229  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateImagesFromFiles")
   230  		defer func() {
   231  			sc := -1
   232  			if result.Response.Response != nil {
   233  				sc = result.Response.Response.StatusCode
   234  			}
   235  			tracing.EndSpan(ctx, sc, err)
   236  		}()
   237  	}
   238  	req, err := client.CreateImagesFromFilesPreparer(ctx, projectID, batch)
   239  	if err != nil {
   240  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromFiles", nil, "Failure preparing request")
   241  		return
   242  	}
   243  
   244  	resp, err := client.CreateImagesFromFilesSender(req)
   245  	if err != nil {
   246  		result.Response = autorest.Response{Response: resp}
   247  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromFiles", resp, "Failure sending request")
   248  		return
   249  	}
   250  
   251  	result, err = client.CreateImagesFromFilesResponder(resp)
   252  	if err != nil {
   253  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromFiles", resp, "Failure responding to request")
   254  		return
   255  	}
   256  
   257  	return
   258  }
   259  
   260  // CreateImagesFromFilesPreparer prepares the CreateImagesFromFiles request.
   261  func (client BaseClient) CreateImagesFromFilesPreparer(ctx context.Context, projectID uuid.UUID, batch ImageFileCreateBatch) (*http.Request, error) {
   262  	urlParameters := map[string]interface{}{
   263  		"Endpoint": client.Endpoint,
   264  	}
   265  
   266  	pathParameters := map[string]interface{}{
   267  		"projectId": autorest.Encode("path", projectID),
   268  	}
   269  
   270  	preparer := autorest.CreatePreparer(
   271  		autorest.AsContentType("application/json; charset=utf-8"),
   272  		autorest.AsPost(),
   273  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
   274  		autorest.WithPathParameters("/projects/{projectId}/images/files", pathParameters),
   275  		autorest.WithJSON(batch))
   276  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   277  }
   278  
   279  // CreateImagesFromFilesSender sends the CreateImagesFromFiles request. The method will close the
   280  // http.Response Body if it receives an error.
   281  func (client BaseClient) CreateImagesFromFilesSender(req *http.Request) (*http.Response, error) {
   282  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   283  }
   284  
   285  // CreateImagesFromFilesResponder handles the response to the CreateImagesFromFiles request. The method always
   286  // closes the http.Response Body.
   287  func (client BaseClient) CreateImagesFromFilesResponder(resp *http.Response) (result ImageCreateSummary, err error) {
   288  	err = autorest.Respond(
   289  		resp,
   290  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusMultiStatus),
   291  		autorest.ByUnmarshallingJSON(&result),
   292  		autorest.ByClosing())
   293  	result.Response = autorest.Response{Response: resp}
   294  	return
   295  }
   296  
   297  // CreateImagesFromPredictions this API creates a batch of images from predicted images specified. There is a limit of
   298  // 64 images and 20 tags.
   299  // If all images are successful created, 200(OK) status code will be returned.
   300  // Otherwise, 207 (Multi-Status) status code will be returned and detail status for each image will be listed in the
   301  // response payload.
   302  // Parameters:
   303  // projectID - the project id.
   304  // batch - image, tag ids, and metadata. Limited to 64 images and 20 tags per batch.
   305  func (client BaseClient) CreateImagesFromPredictions(ctx context.Context, projectID uuid.UUID, batch ImageIDCreateBatch) (result ImageCreateSummary, err error) {
   306  	if tracing.IsEnabled() {
   307  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateImagesFromPredictions")
   308  		defer func() {
   309  			sc := -1
   310  			if result.Response.Response != nil {
   311  				sc = result.Response.Response.StatusCode
   312  			}
   313  			tracing.EndSpan(ctx, sc, err)
   314  		}()
   315  	}
   316  	req, err := client.CreateImagesFromPredictionsPreparer(ctx, projectID, batch)
   317  	if err != nil {
   318  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromPredictions", nil, "Failure preparing request")
   319  		return
   320  	}
   321  
   322  	resp, err := client.CreateImagesFromPredictionsSender(req)
   323  	if err != nil {
   324  		result.Response = autorest.Response{Response: resp}
   325  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromPredictions", resp, "Failure sending request")
   326  		return
   327  	}
   328  
   329  	result, err = client.CreateImagesFromPredictionsResponder(resp)
   330  	if err != nil {
   331  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromPredictions", resp, "Failure responding to request")
   332  		return
   333  	}
   334  
   335  	return
   336  }
   337  
   338  // CreateImagesFromPredictionsPreparer prepares the CreateImagesFromPredictions request.
   339  func (client BaseClient) CreateImagesFromPredictionsPreparer(ctx context.Context, projectID uuid.UUID, batch ImageIDCreateBatch) (*http.Request, error) {
   340  	urlParameters := map[string]interface{}{
   341  		"Endpoint": client.Endpoint,
   342  	}
   343  
   344  	pathParameters := map[string]interface{}{
   345  		"projectId": autorest.Encode("path", projectID),
   346  	}
   347  
   348  	preparer := autorest.CreatePreparer(
   349  		autorest.AsContentType("application/json; charset=utf-8"),
   350  		autorest.AsPost(),
   351  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
   352  		autorest.WithPathParameters("/projects/{projectId}/images/predictions", pathParameters),
   353  		autorest.WithJSON(batch))
   354  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   355  }
   356  
   357  // CreateImagesFromPredictionsSender sends the CreateImagesFromPredictions request. The method will close the
   358  // http.Response Body if it receives an error.
   359  func (client BaseClient) CreateImagesFromPredictionsSender(req *http.Request) (*http.Response, error) {
   360  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   361  }
   362  
   363  // CreateImagesFromPredictionsResponder handles the response to the CreateImagesFromPredictions request. The method always
   364  // closes the http.Response Body.
   365  func (client BaseClient) CreateImagesFromPredictionsResponder(resp *http.Response) (result ImageCreateSummary, err error) {
   366  	err = autorest.Respond(
   367  		resp,
   368  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusMultiStatus),
   369  		autorest.ByUnmarshallingJSON(&result),
   370  		autorest.ByClosing())
   371  	result.Response = autorest.Response{Response: resp}
   372  	return
   373  }
   374  
   375  // CreateImagesFromUrls this API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64
   376  // images and 20 tags.
   377  // If all images are successful created, 200(OK) status code will be returned.
   378  // Otherwise, 207 (Multi-Status) status code will be returned and detail status for each image will be listed in the
   379  // response payload.
   380  // Parameters:
   381  // projectID - the project id.
   382  // batch - image urls, tag ids, and metadata. Limited to 64 images and 20 tags per batch.
   383  func (client BaseClient) CreateImagesFromUrls(ctx context.Context, projectID uuid.UUID, batch ImageURLCreateBatch) (result ImageCreateSummary, err error) {
   384  	if tracing.IsEnabled() {
   385  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateImagesFromUrls")
   386  		defer func() {
   387  			sc := -1
   388  			if result.Response.Response != nil {
   389  				sc = result.Response.Response.StatusCode
   390  			}
   391  			tracing.EndSpan(ctx, sc, err)
   392  		}()
   393  	}
   394  	req, err := client.CreateImagesFromUrlsPreparer(ctx, projectID, batch)
   395  	if err != nil {
   396  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromUrls", nil, "Failure preparing request")
   397  		return
   398  	}
   399  
   400  	resp, err := client.CreateImagesFromUrlsSender(req)
   401  	if err != nil {
   402  		result.Response = autorest.Response{Response: resp}
   403  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromUrls", resp, "Failure sending request")
   404  		return
   405  	}
   406  
   407  	result, err = client.CreateImagesFromUrlsResponder(resp)
   408  	if err != nil {
   409  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImagesFromUrls", resp, "Failure responding to request")
   410  		return
   411  	}
   412  
   413  	return
   414  }
   415  
   416  // CreateImagesFromUrlsPreparer prepares the CreateImagesFromUrls request.
   417  func (client BaseClient) CreateImagesFromUrlsPreparer(ctx context.Context, projectID uuid.UUID, batch ImageURLCreateBatch) (*http.Request, error) {
   418  	urlParameters := map[string]interface{}{
   419  		"Endpoint": client.Endpoint,
   420  	}
   421  
   422  	pathParameters := map[string]interface{}{
   423  		"projectId": autorest.Encode("path", projectID),
   424  	}
   425  
   426  	preparer := autorest.CreatePreparer(
   427  		autorest.AsContentType("application/json; charset=utf-8"),
   428  		autorest.AsPost(),
   429  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
   430  		autorest.WithPathParameters("/projects/{projectId}/images/urls", pathParameters),
   431  		autorest.WithJSON(batch))
   432  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   433  }
   434  
   435  // CreateImagesFromUrlsSender sends the CreateImagesFromUrls request. The method will close the
   436  // http.Response Body if it receives an error.
   437  func (client BaseClient) CreateImagesFromUrlsSender(req *http.Request) (*http.Response, error) {
   438  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   439  }
   440  
   441  // CreateImagesFromUrlsResponder handles the response to the CreateImagesFromUrls request. The method always
   442  // closes the http.Response Body.
   443  func (client BaseClient) CreateImagesFromUrlsResponder(resp *http.Response) (result ImageCreateSummary, err error) {
   444  	err = autorest.Respond(
   445  		resp,
   446  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusMultiStatus),
   447  		autorest.ByUnmarshallingJSON(&result),
   448  		autorest.ByClosing())
   449  	result.Response = autorest.Response{Response: resp}
   450  	return
   451  }
   452  
   453  // CreateImageTags sends the create image tags request.
   454  // Parameters:
   455  // projectID - the project id.
   456  // batch - batch of image tags. Limited to 128 tags per batch.
   457  func (client BaseClient) CreateImageTags(ctx context.Context, projectID uuid.UUID, batch ImageTagCreateBatch) (result ImageTagCreateSummary, err error) {
   458  	if tracing.IsEnabled() {
   459  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateImageTags")
   460  		defer func() {
   461  			sc := -1
   462  			if result.Response.Response != nil {
   463  				sc = result.Response.Response.StatusCode
   464  			}
   465  			tracing.EndSpan(ctx, sc, err)
   466  		}()
   467  	}
   468  	req, err := client.CreateImageTagsPreparer(ctx, projectID, batch)
   469  	if err != nil {
   470  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImageTags", nil, "Failure preparing request")
   471  		return
   472  	}
   473  
   474  	resp, err := client.CreateImageTagsSender(req)
   475  	if err != nil {
   476  		result.Response = autorest.Response{Response: resp}
   477  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImageTags", resp, "Failure sending request")
   478  		return
   479  	}
   480  
   481  	result, err = client.CreateImageTagsResponder(resp)
   482  	if err != nil {
   483  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateImageTags", resp, "Failure responding to request")
   484  		return
   485  	}
   486  
   487  	return
   488  }
   489  
   490  // CreateImageTagsPreparer prepares the CreateImageTags request.
   491  func (client BaseClient) CreateImageTagsPreparer(ctx context.Context, projectID uuid.UUID, batch ImageTagCreateBatch) (*http.Request, error) {
   492  	urlParameters := map[string]interface{}{
   493  		"Endpoint": client.Endpoint,
   494  	}
   495  
   496  	pathParameters := map[string]interface{}{
   497  		"projectId": autorest.Encode("path", projectID),
   498  	}
   499  
   500  	preparer := autorest.CreatePreparer(
   501  		autorest.AsContentType("application/json; charset=utf-8"),
   502  		autorest.AsPost(),
   503  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
   504  		autorest.WithPathParameters("/projects/{projectId}/images/tags", pathParameters),
   505  		autorest.WithJSON(batch))
   506  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   507  }
   508  
   509  // CreateImageTagsSender sends the CreateImageTags request. The method will close the
   510  // http.Response Body if it receives an error.
   511  func (client BaseClient) CreateImageTagsSender(req *http.Request) (*http.Response, error) {
   512  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   513  }
   514  
   515  // CreateImageTagsResponder handles the response to the CreateImageTags request. The method always
   516  // closes the http.Response Body.
   517  func (client BaseClient) CreateImageTagsResponder(resp *http.Response) (result ImageTagCreateSummary, err error) {
   518  	err = autorest.Respond(
   519  		resp,
   520  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   521  		autorest.ByUnmarshallingJSON(&result),
   522  		autorest.ByClosing())
   523  	result.Response = autorest.Response{Response: resp}
   524  	return
   525  }
   526  
   527  // CreateProject sends the create project request.
   528  // Parameters:
   529  // name - name of the project.
   530  // description - the description of the project.
   531  // domainID - the id of the domain to use for this project. Defaults to General.
   532  // classificationType - the type of classifier to create for this project.
   533  // targetExportPlatforms - list of platforms the trained model is intending exporting to.
   534  func (client BaseClient) CreateProject(ctx context.Context, name string, description string, domainID *uuid.UUID, classificationType string, targetExportPlatforms []string) (result Project, err error) {
   535  	if tracing.IsEnabled() {
   536  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateProject")
   537  		defer func() {
   538  			sc := -1
   539  			if result.Response.Response != nil {
   540  				sc = result.Response.Response.StatusCode
   541  			}
   542  			tracing.EndSpan(ctx, sc, err)
   543  		}()
   544  	}
   545  	req, err := client.CreateProjectPreparer(ctx, name, description, domainID, classificationType, targetExportPlatforms)
   546  	if err != nil {
   547  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateProject", nil, "Failure preparing request")
   548  		return
   549  	}
   550  
   551  	resp, err := client.CreateProjectSender(req)
   552  	if err != nil {
   553  		result.Response = autorest.Response{Response: resp}
   554  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateProject", resp, "Failure sending request")
   555  		return
   556  	}
   557  
   558  	result, err = client.CreateProjectResponder(resp)
   559  	if err != nil {
   560  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateProject", resp, "Failure responding to request")
   561  		return
   562  	}
   563  
   564  	return
   565  }
   566  
   567  // CreateProjectPreparer prepares the CreateProject request.
   568  func (client BaseClient) CreateProjectPreparer(ctx context.Context, name string, description string, domainID *uuid.UUID, classificationType string, targetExportPlatforms []string) (*http.Request, error) {
   569  	urlParameters := map[string]interface{}{
   570  		"Endpoint": client.Endpoint,
   571  	}
   572  
   573  	queryParameters := map[string]interface{}{
   574  		"name": autorest.Encode("query", name),
   575  	}
   576  	if len(description) > 0 {
   577  		queryParameters["description"] = autorest.Encode("query", description)
   578  	}
   579  	if domainID != nil {
   580  		queryParameters["domainId"] = autorest.Encode("query", *domainID)
   581  	}
   582  	if len(string(classificationType)) > 0 {
   583  		queryParameters["classificationType"] = autorest.Encode("query", classificationType)
   584  	}
   585  	if targetExportPlatforms != nil && len(targetExportPlatforms) > 0 {
   586  		queryParameters["targetExportPlatforms"] = autorest.Encode("query", targetExportPlatforms, ",")
   587  	}
   588  
   589  	preparer := autorest.CreatePreparer(
   590  		autorest.AsPost(),
   591  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
   592  		autorest.WithPath("/projects"),
   593  		autorest.WithQueryParameters(queryParameters))
   594  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   595  }
   596  
   597  // CreateProjectSender sends the CreateProject request. The method will close the
   598  // http.Response Body if it receives an error.
   599  func (client BaseClient) CreateProjectSender(req *http.Request) (*http.Response, error) {
   600  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   601  }
   602  
   603  // CreateProjectResponder handles the response to the CreateProject request. The method always
   604  // closes the http.Response Body.
   605  func (client BaseClient) CreateProjectResponder(resp *http.Response) (result Project, err error) {
   606  	err = autorest.Respond(
   607  		resp,
   608  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   609  		autorest.ByUnmarshallingJSON(&result),
   610  		autorest.ByClosing())
   611  	result.Response = autorest.Response{Response: resp}
   612  	return
   613  }
   614  
   615  // CreateTag sends the create tag request.
   616  // Parameters:
   617  // projectID - the project id.
   618  // name - the tag name.
   619  // description - optional description for the tag.
   620  // typeParameter - optional type for the tag.
   621  func (client BaseClient) CreateTag(ctx context.Context, projectID uuid.UUID, name string, description string, typeParameter string) (result Tag, err error) {
   622  	if tracing.IsEnabled() {
   623  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateTag")
   624  		defer func() {
   625  			sc := -1
   626  			if result.Response.Response != nil {
   627  				sc = result.Response.Response.StatusCode
   628  			}
   629  			tracing.EndSpan(ctx, sc, err)
   630  		}()
   631  	}
   632  	req, err := client.CreateTagPreparer(ctx, projectID, name, description, typeParameter)
   633  	if err != nil {
   634  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateTag", nil, "Failure preparing request")
   635  		return
   636  	}
   637  
   638  	resp, err := client.CreateTagSender(req)
   639  	if err != nil {
   640  		result.Response = autorest.Response{Response: resp}
   641  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateTag", resp, "Failure sending request")
   642  		return
   643  	}
   644  
   645  	result, err = client.CreateTagResponder(resp)
   646  	if err != nil {
   647  		err = autorest.NewErrorWithError(err, "training.BaseClient", "CreateTag", resp, "Failure responding to request")
   648  		return
   649  	}
   650  
   651  	return
   652  }
   653  
   654  // CreateTagPreparer prepares the CreateTag request.
   655  func (client BaseClient) CreateTagPreparer(ctx context.Context, projectID uuid.UUID, name string, description string, typeParameter string) (*http.Request, error) {
   656  	urlParameters := map[string]interface{}{
   657  		"Endpoint": client.Endpoint,
   658  	}
   659  
   660  	pathParameters := map[string]interface{}{
   661  		"projectId": autorest.Encode("path", projectID),
   662  	}
   663  
   664  	queryParameters := map[string]interface{}{
   665  		"name": autorest.Encode("query", name),
   666  	}
   667  	if len(description) > 0 {
   668  		queryParameters["description"] = autorest.Encode("query", description)
   669  	}
   670  	if len(string(typeParameter)) > 0 {
   671  		queryParameters["type"] = autorest.Encode("query", typeParameter)
   672  	}
   673  
   674  	preparer := autorest.CreatePreparer(
   675  		autorest.AsPost(),
   676  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
   677  		autorest.WithPathParameters("/projects/{projectId}/tags", pathParameters),
   678  		autorest.WithQueryParameters(queryParameters))
   679  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   680  }
   681  
   682  // CreateTagSender sends the CreateTag request. The method will close the
   683  // http.Response Body if it receives an error.
   684  func (client BaseClient) CreateTagSender(req *http.Request) (*http.Response, error) {
   685  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   686  }
   687  
   688  // CreateTagResponder handles the response to the CreateTag request. The method always
   689  // closes the http.Response Body.
   690  func (client BaseClient) CreateTagResponder(resp *http.Response) (result Tag, err error) {
   691  	err = autorest.Respond(
   692  		resp,
   693  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   694  		autorest.ByUnmarshallingJSON(&result),
   695  		autorest.ByClosing())
   696  	result.Response = autorest.Response{Response: resp}
   697  	return
   698  }
   699  
   700  // DeleteImageRegions sends the delete image regions request.
   701  // Parameters:
   702  // projectID - the project id.
   703  // regionIds - regions to delete. Limited to 64.
   704  func (client BaseClient) DeleteImageRegions(ctx context.Context, projectID uuid.UUID, regionIds []uuid.UUID) (result autorest.Response, err error) {
   705  	if tracing.IsEnabled() {
   706  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImageRegions")
   707  		defer func() {
   708  			sc := -1
   709  			if result.Response != nil {
   710  				sc = result.Response.StatusCode
   711  			}
   712  			tracing.EndSpan(ctx, sc, err)
   713  		}()
   714  	}
   715  	if err := validation.Validate([]validation.Validation{
   716  		{TargetValue: regionIds,
   717  			Constraints: []validation.Constraint{{Target: "regionIds", Name: validation.Null, Rule: true,
   718  				Chain: []validation.Constraint{{Target: "regionIds", Name: validation.MaxItems, Rule: 64, Chain: nil},
   719  					{Target: "regionIds", Name: validation.MinItems, Rule: 0, Chain: nil},
   720  				}}}}}); err != nil {
   721  		return result, validation.NewError("training.BaseClient", "DeleteImageRegions", err.Error())
   722  	}
   723  
   724  	req, err := client.DeleteImageRegionsPreparer(ctx, projectID, regionIds)
   725  	if err != nil {
   726  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImageRegions", nil, "Failure preparing request")
   727  		return
   728  	}
   729  
   730  	resp, err := client.DeleteImageRegionsSender(req)
   731  	if err != nil {
   732  		result.Response = resp
   733  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImageRegions", resp, "Failure sending request")
   734  		return
   735  	}
   736  
   737  	result, err = client.DeleteImageRegionsResponder(resp)
   738  	if err != nil {
   739  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImageRegions", resp, "Failure responding to request")
   740  		return
   741  	}
   742  
   743  	return
   744  }
   745  
   746  // DeleteImageRegionsPreparer prepares the DeleteImageRegions request.
   747  func (client BaseClient) DeleteImageRegionsPreparer(ctx context.Context, projectID uuid.UUID, regionIds []uuid.UUID) (*http.Request, error) {
   748  	urlParameters := map[string]interface{}{
   749  		"Endpoint": client.Endpoint,
   750  	}
   751  
   752  	pathParameters := map[string]interface{}{
   753  		"projectId": autorest.Encode("path", projectID),
   754  	}
   755  
   756  	queryParameters := map[string]interface{}{
   757  		"regionIds": autorest.Encode("query", regionIds, ","),
   758  	}
   759  
   760  	preparer := autorest.CreatePreparer(
   761  		autorest.AsDelete(),
   762  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
   763  		autorest.WithPathParameters("/projects/{projectId}/images/regions", pathParameters),
   764  		autorest.WithQueryParameters(queryParameters))
   765  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   766  }
   767  
   768  // DeleteImageRegionsSender sends the DeleteImageRegions request. The method will close the
   769  // http.Response Body if it receives an error.
   770  func (client BaseClient) DeleteImageRegionsSender(req *http.Request) (*http.Response, error) {
   771  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   772  }
   773  
   774  // DeleteImageRegionsResponder handles the response to the DeleteImageRegions request. The method always
   775  // closes the http.Response Body.
   776  func (client BaseClient) DeleteImageRegionsResponder(resp *http.Response) (result autorest.Response, err error) {
   777  	err = autorest.Respond(
   778  		resp,
   779  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
   780  		autorest.ByClosing())
   781  	result.Response = resp
   782  	return
   783  }
   784  
   785  // DeleteImages sends the delete images request.
   786  // Parameters:
   787  // projectID - the project id.
   788  // imageIds - ids of the images to be deleted. Limited to 256 images per batch.
   789  // allImages - flag to specify delete all images, specify this flag or a list of images. Using this flag will
   790  // return a 202 response to indicate the images are being deleted.
   791  // allIterations - removes these images from all iterations, not just the current workspace. Using this flag
   792  // will return a 202 response to indicate the images are being deleted.
   793  func (client BaseClient) DeleteImages(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, allImages *bool, allIterations *bool) (result autorest.Response, err error) {
   794  	if tracing.IsEnabled() {
   795  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImages")
   796  		defer func() {
   797  			sc := -1
   798  			if result.Response != nil {
   799  				sc = result.Response.StatusCode
   800  			}
   801  			tracing.EndSpan(ctx, sc, err)
   802  		}()
   803  	}
   804  	if err := validation.Validate([]validation.Validation{
   805  		{TargetValue: imageIds,
   806  			Constraints: []validation.Constraint{{Target: "imageIds", Name: validation.Null, Rule: false,
   807  				Chain: []validation.Constraint{{Target: "imageIds", Name: validation.MaxItems, Rule: 256, Chain: nil},
   808  					{Target: "imageIds", Name: validation.MinItems, Rule: 0, Chain: nil},
   809  				}}}}}); err != nil {
   810  		return result, validation.NewError("training.BaseClient", "DeleteImages", err.Error())
   811  	}
   812  
   813  	req, err := client.DeleteImagesPreparer(ctx, projectID, imageIds, allImages, allIterations)
   814  	if err != nil {
   815  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImages", nil, "Failure preparing request")
   816  		return
   817  	}
   818  
   819  	resp, err := client.DeleteImagesSender(req)
   820  	if err != nil {
   821  		result.Response = resp
   822  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImages", resp, "Failure sending request")
   823  		return
   824  	}
   825  
   826  	result, err = client.DeleteImagesResponder(resp)
   827  	if err != nil {
   828  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImages", resp, "Failure responding to request")
   829  		return
   830  	}
   831  
   832  	return
   833  }
   834  
   835  // DeleteImagesPreparer prepares the DeleteImages request.
   836  func (client BaseClient) DeleteImagesPreparer(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, allImages *bool, allIterations *bool) (*http.Request, error) {
   837  	urlParameters := map[string]interface{}{
   838  		"Endpoint": client.Endpoint,
   839  	}
   840  
   841  	pathParameters := map[string]interface{}{
   842  		"projectId": autorest.Encode("path", projectID),
   843  	}
   844  
   845  	queryParameters := map[string]interface{}{}
   846  	if imageIds != nil && len(imageIds) > 0 {
   847  		queryParameters["imageIds"] = autorest.Encode("query", imageIds, ",")
   848  	}
   849  	if allImages != nil {
   850  		queryParameters["allImages"] = autorest.Encode("query", *allImages)
   851  	}
   852  	if allIterations != nil {
   853  		queryParameters["allIterations"] = autorest.Encode("query", *allIterations)
   854  	}
   855  
   856  	preparer := autorest.CreatePreparer(
   857  		autorest.AsDelete(),
   858  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
   859  		autorest.WithPathParameters("/projects/{projectId}/images", pathParameters),
   860  		autorest.WithQueryParameters(queryParameters))
   861  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   862  }
   863  
   864  // DeleteImagesSender sends the DeleteImages request. The method will close the
   865  // http.Response Body if it receives an error.
   866  func (client BaseClient) DeleteImagesSender(req *http.Request) (*http.Response, error) {
   867  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   868  }
   869  
   870  // DeleteImagesResponder handles the response to the DeleteImages request. The method always
   871  // closes the http.Response Body.
   872  func (client BaseClient) DeleteImagesResponder(resp *http.Response) (result autorest.Response, err error) {
   873  	err = autorest.Respond(
   874  		resp,
   875  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
   876  		autorest.ByClosing())
   877  	result.Response = resp
   878  	return
   879  }
   880  
   881  // DeleteImageTags sends the delete image tags request.
   882  // Parameters:
   883  // projectID - the project id.
   884  // imageIds - image ids. Limited to 64 images.
   885  // tagIds - tags to be deleted from the specified images. Limited to 20 tags.
   886  func (client BaseClient) DeleteImageTags(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, tagIds []uuid.UUID) (result autorest.Response, err error) {
   887  	if tracing.IsEnabled() {
   888  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImageTags")
   889  		defer func() {
   890  			sc := -1
   891  			if result.Response != nil {
   892  				sc = result.Response.StatusCode
   893  			}
   894  			tracing.EndSpan(ctx, sc, err)
   895  		}()
   896  	}
   897  	if err := validation.Validate([]validation.Validation{
   898  		{TargetValue: imageIds,
   899  			Constraints: []validation.Constraint{{Target: "imageIds", Name: validation.Null, Rule: true,
   900  				Chain: []validation.Constraint{{Target: "imageIds", Name: validation.MaxItems, Rule: 64, Chain: nil},
   901  					{Target: "imageIds", Name: validation.MinItems, Rule: 0, Chain: nil},
   902  				}}}},
   903  		{TargetValue: tagIds,
   904  			Constraints: []validation.Constraint{{Target: "tagIds", Name: validation.Null, Rule: true,
   905  				Chain: []validation.Constraint{{Target: "tagIds", Name: validation.MaxItems, Rule: 20, Chain: nil},
   906  					{Target: "tagIds", Name: validation.MinItems, Rule: 0, Chain: nil},
   907  				}}}}}); err != nil {
   908  		return result, validation.NewError("training.BaseClient", "DeleteImageTags", err.Error())
   909  	}
   910  
   911  	req, err := client.DeleteImageTagsPreparer(ctx, projectID, imageIds, tagIds)
   912  	if err != nil {
   913  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImageTags", nil, "Failure preparing request")
   914  		return
   915  	}
   916  
   917  	resp, err := client.DeleteImageTagsSender(req)
   918  	if err != nil {
   919  		result.Response = resp
   920  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImageTags", resp, "Failure sending request")
   921  		return
   922  	}
   923  
   924  	result, err = client.DeleteImageTagsResponder(resp)
   925  	if err != nil {
   926  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteImageTags", resp, "Failure responding to request")
   927  		return
   928  	}
   929  
   930  	return
   931  }
   932  
   933  // DeleteImageTagsPreparer prepares the DeleteImageTags request.
   934  func (client BaseClient) DeleteImageTagsPreparer(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, tagIds []uuid.UUID) (*http.Request, error) {
   935  	urlParameters := map[string]interface{}{
   936  		"Endpoint": client.Endpoint,
   937  	}
   938  
   939  	pathParameters := map[string]interface{}{
   940  		"projectId": autorest.Encode("path", projectID),
   941  	}
   942  
   943  	queryParameters := map[string]interface{}{
   944  		"imageIds": autorest.Encode("query", imageIds, ","),
   945  		"tagIds":   autorest.Encode("query", tagIds, ","),
   946  	}
   947  
   948  	preparer := autorest.CreatePreparer(
   949  		autorest.AsDelete(),
   950  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
   951  		autorest.WithPathParameters("/projects/{projectId}/images/tags", pathParameters),
   952  		autorest.WithQueryParameters(queryParameters))
   953  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   954  }
   955  
   956  // DeleteImageTagsSender sends the DeleteImageTags request. The method will close the
   957  // http.Response Body if it receives an error.
   958  func (client BaseClient) DeleteImageTagsSender(req *http.Request) (*http.Response, error) {
   959  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   960  }
   961  
   962  // DeleteImageTagsResponder handles the response to the DeleteImageTags request. The method always
   963  // closes the http.Response Body.
   964  func (client BaseClient) DeleteImageTagsResponder(resp *http.Response) (result autorest.Response, err error) {
   965  	err = autorest.Respond(
   966  		resp,
   967  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
   968  		autorest.ByClosing())
   969  	result.Response = resp
   970  	return
   971  }
   972  
   973  // DeleteIteration sends the delete iteration request.
   974  // Parameters:
   975  // projectID - the project id.
   976  // iterationID - the iteration id.
   977  func (client BaseClient) DeleteIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (result autorest.Response, err error) {
   978  	if tracing.IsEnabled() {
   979  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteIteration")
   980  		defer func() {
   981  			sc := -1
   982  			if result.Response != nil {
   983  				sc = result.Response.StatusCode
   984  			}
   985  			tracing.EndSpan(ctx, sc, err)
   986  		}()
   987  	}
   988  	req, err := client.DeleteIterationPreparer(ctx, projectID, iterationID)
   989  	if err != nil {
   990  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteIteration", nil, "Failure preparing request")
   991  		return
   992  	}
   993  
   994  	resp, err := client.DeleteIterationSender(req)
   995  	if err != nil {
   996  		result.Response = resp
   997  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteIteration", resp, "Failure sending request")
   998  		return
   999  	}
  1000  
  1001  	result, err = client.DeleteIterationResponder(resp)
  1002  	if err != nil {
  1003  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteIteration", resp, "Failure responding to request")
  1004  		return
  1005  	}
  1006  
  1007  	return
  1008  }
  1009  
  1010  // DeleteIterationPreparer prepares the DeleteIteration request.
  1011  func (client BaseClient) DeleteIterationPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (*http.Request, error) {
  1012  	urlParameters := map[string]interface{}{
  1013  		"Endpoint": client.Endpoint,
  1014  	}
  1015  
  1016  	pathParameters := map[string]interface{}{
  1017  		"iterationId": autorest.Encode("path", iterationID),
  1018  		"projectId":   autorest.Encode("path", projectID),
  1019  	}
  1020  
  1021  	preparer := autorest.CreatePreparer(
  1022  		autorest.AsDelete(),
  1023  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  1024  		autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}", pathParameters))
  1025  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1026  }
  1027  
  1028  // DeleteIterationSender sends the DeleteIteration request. The method will close the
  1029  // http.Response Body if it receives an error.
  1030  func (client BaseClient) DeleteIterationSender(req *http.Request) (*http.Response, error) {
  1031  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1032  }
  1033  
  1034  // DeleteIterationResponder handles the response to the DeleteIteration request. The method always
  1035  // closes the http.Response Body.
  1036  func (client BaseClient) DeleteIterationResponder(resp *http.Response) (result autorest.Response, err error) {
  1037  	err = autorest.Respond(
  1038  		resp,
  1039  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
  1040  		autorest.ByClosing())
  1041  	result.Response = resp
  1042  	return
  1043  }
  1044  
  1045  // DeletePrediction sends the delete prediction request.
  1046  // Parameters:
  1047  // projectID - the project id.
  1048  // ids - the prediction ids. Limited to 64.
  1049  func (client BaseClient) DeletePrediction(ctx context.Context, projectID uuid.UUID, ids []uuid.UUID) (result autorest.Response, err error) {
  1050  	if tracing.IsEnabled() {
  1051  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeletePrediction")
  1052  		defer func() {
  1053  			sc := -1
  1054  			if result.Response != nil {
  1055  				sc = result.Response.StatusCode
  1056  			}
  1057  			tracing.EndSpan(ctx, sc, err)
  1058  		}()
  1059  	}
  1060  	if err := validation.Validate([]validation.Validation{
  1061  		{TargetValue: ids,
  1062  			Constraints: []validation.Constraint{{Target: "ids", Name: validation.Null, Rule: true,
  1063  				Chain: []validation.Constraint{{Target: "ids", Name: validation.MaxItems, Rule: 64, Chain: nil},
  1064  					{Target: "ids", Name: validation.MinItems, Rule: 0, Chain: nil},
  1065  				}}}}}); err != nil {
  1066  		return result, validation.NewError("training.BaseClient", "DeletePrediction", err.Error())
  1067  	}
  1068  
  1069  	req, err := client.DeletePredictionPreparer(ctx, projectID, ids)
  1070  	if err != nil {
  1071  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeletePrediction", nil, "Failure preparing request")
  1072  		return
  1073  	}
  1074  
  1075  	resp, err := client.DeletePredictionSender(req)
  1076  	if err != nil {
  1077  		result.Response = resp
  1078  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeletePrediction", resp, "Failure sending request")
  1079  		return
  1080  	}
  1081  
  1082  	result, err = client.DeletePredictionResponder(resp)
  1083  	if err != nil {
  1084  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeletePrediction", resp, "Failure responding to request")
  1085  		return
  1086  	}
  1087  
  1088  	return
  1089  }
  1090  
  1091  // DeletePredictionPreparer prepares the DeletePrediction request.
  1092  func (client BaseClient) DeletePredictionPreparer(ctx context.Context, projectID uuid.UUID, ids []uuid.UUID) (*http.Request, error) {
  1093  	urlParameters := map[string]interface{}{
  1094  		"Endpoint": client.Endpoint,
  1095  	}
  1096  
  1097  	pathParameters := map[string]interface{}{
  1098  		"projectId": autorest.Encode("path", projectID),
  1099  	}
  1100  
  1101  	queryParameters := map[string]interface{}{
  1102  		"ids": autorest.Encode("query", ids, ","),
  1103  	}
  1104  
  1105  	preparer := autorest.CreatePreparer(
  1106  		autorest.AsDelete(),
  1107  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  1108  		autorest.WithPathParameters("/projects/{projectId}/predictions", pathParameters),
  1109  		autorest.WithQueryParameters(queryParameters))
  1110  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1111  }
  1112  
  1113  // DeletePredictionSender sends the DeletePrediction request. The method will close the
  1114  // http.Response Body if it receives an error.
  1115  func (client BaseClient) DeletePredictionSender(req *http.Request) (*http.Response, error) {
  1116  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1117  }
  1118  
  1119  // DeletePredictionResponder handles the response to the DeletePrediction request. The method always
  1120  // closes the http.Response Body.
  1121  func (client BaseClient) DeletePredictionResponder(resp *http.Response) (result autorest.Response, err error) {
  1122  	err = autorest.Respond(
  1123  		resp,
  1124  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
  1125  		autorest.ByClosing())
  1126  	result.Response = resp
  1127  	return
  1128  }
  1129  
  1130  // DeleteProject sends the delete project request.
  1131  // Parameters:
  1132  // projectID - the project id.
  1133  func (client BaseClient) DeleteProject(ctx context.Context, projectID uuid.UUID) (result autorest.Response, err error) {
  1134  	if tracing.IsEnabled() {
  1135  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteProject")
  1136  		defer func() {
  1137  			sc := -1
  1138  			if result.Response != nil {
  1139  				sc = result.Response.StatusCode
  1140  			}
  1141  			tracing.EndSpan(ctx, sc, err)
  1142  		}()
  1143  	}
  1144  	req, err := client.DeleteProjectPreparer(ctx, projectID)
  1145  	if err != nil {
  1146  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteProject", nil, "Failure preparing request")
  1147  		return
  1148  	}
  1149  
  1150  	resp, err := client.DeleteProjectSender(req)
  1151  	if err != nil {
  1152  		result.Response = resp
  1153  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteProject", resp, "Failure sending request")
  1154  		return
  1155  	}
  1156  
  1157  	result, err = client.DeleteProjectResponder(resp)
  1158  	if err != nil {
  1159  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteProject", resp, "Failure responding to request")
  1160  		return
  1161  	}
  1162  
  1163  	return
  1164  }
  1165  
  1166  // DeleteProjectPreparer prepares the DeleteProject request.
  1167  func (client BaseClient) DeleteProjectPreparer(ctx context.Context, projectID uuid.UUID) (*http.Request, error) {
  1168  	urlParameters := map[string]interface{}{
  1169  		"Endpoint": client.Endpoint,
  1170  	}
  1171  
  1172  	pathParameters := map[string]interface{}{
  1173  		"projectId": autorest.Encode("path", projectID),
  1174  	}
  1175  
  1176  	preparer := autorest.CreatePreparer(
  1177  		autorest.AsDelete(),
  1178  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  1179  		autorest.WithPathParameters("/projects/{projectId}", pathParameters))
  1180  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1181  }
  1182  
  1183  // DeleteProjectSender sends the DeleteProject request. The method will close the
  1184  // http.Response Body if it receives an error.
  1185  func (client BaseClient) DeleteProjectSender(req *http.Request) (*http.Response, error) {
  1186  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1187  }
  1188  
  1189  // DeleteProjectResponder handles the response to the DeleteProject request. The method always
  1190  // closes the http.Response Body.
  1191  func (client BaseClient) DeleteProjectResponder(resp *http.Response) (result autorest.Response, err error) {
  1192  	err = autorest.Respond(
  1193  		resp,
  1194  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
  1195  		autorest.ByClosing())
  1196  	result.Response = resp
  1197  	return
  1198  }
  1199  
  1200  // DeleteTag sends the delete tag request.
  1201  // Parameters:
  1202  // projectID - the project id.
  1203  // tagID - id of the tag to be deleted.
  1204  func (client BaseClient) DeleteTag(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID) (result autorest.Response, err error) {
  1205  	if tracing.IsEnabled() {
  1206  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteTag")
  1207  		defer func() {
  1208  			sc := -1
  1209  			if result.Response != nil {
  1210  				sc = result.Response.StatusCode
  1211  			}
  1212  			tracing.EndSpan(ctx, sc, err)
  1213  		}()
  1214  	}
  1215  	req, err := client.DeleteTagPreparer(ctx, projectID, tagID)
  1216  	if err != nil {
  1217  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteTag", nil, "Failure preparing request")
  1218  		return
  1219  	}
  1220  
  1221  	resp, err := client.DeleteTagSender(req)
  1222  	if err != nil {
  1223  		result.Response = resp
  1224  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteTag", resp, "Failure sending request")
  1225  		return
  1226  	}
  1227  
  1228  	result, err = client.DeleteTagResponder(resp)
  1229  	if err != nil {
  1230  		err = autorest.NewErrorWithError(err, "training.BaseClient", "DeleteTag", resp, "Failure responding to request")
  1231  		return
  1232  	}
  1233  
  1234  	return
  1235  }
  1236  
  1237  // DeleteTagPreparer prepares the DeleteTag request.
  1238  func (client BaseClient) DeleteTagPreparer(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID) (*http.Request, error) {
  1239  	urlParameters := map[string]interface{}{
  1240  		"Endpoint": client.Endpoint,
  1241  	}
  1242  
  1243  	pathParameters := map[string]interface{}{
  1244  		"projectId": autorest.Encode("path", projectID),
  1245  		"tagId":     autorest.Encode("path", tagID),
  1246  	}
  1247  
  1248  	preparer := autorest.CreatePreparer(
  1249  		autorest.AsDelete(),
  1250  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  1251  		autorest.WithPathParameters("/projects/{projectId}/tags/{tagId}", pathParameters))
  1252  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1253  }
  1254  
  1255  // DeleteTagSender sends the DeleteTag request. The method will close the
  1256  // http.Response Body if it receives an error.
  1257  func (client BaseClient) DeleteTagSender(req *http.Request) (*http.Response, error) {
  1258  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1259  }
  1260  
  1261  // DeleteTagResponder handles the response to the DeleteTag request. The method always
  1262  // closes the http.Response Body.
  1263  func (client BaseClient) DeleteTagResponder(resp *http.Response) (result autorest.Response, err error) {
  1264  	err = autorest.Respond(
  1265  		resp,
  1266  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
  1267  		autorest.ByClosing())
  1268  	result.Response = resp
  1269  	return
  1270  }
  1271  
  1272  // ExportIteration sends the export iteration request.
  1273  // Parameters:
  1274  // projectID - the project id.
  1275  // iterationID - the iteration id.
  1276  // platform - the target platform.
  1277  // flavor - the flavor of the target platform.
  1278  func (client BaseClient) ExportIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, platform string, flavor string) (result Export, err error) {
  1279  	if tracing.IsEnabled() {
  1280  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ExportIteration")
  1281  		defer func() {
  1282  			sc := -1
  1283  			if result.Response.Response != nil {
  1284  				sc = result.Response.Response.StatusCode
  1285  			}
  1286  			tracing.EndSpan(ctx, sc, err)
  1287  		}()
  1288  	}
  1289  	req, err := client.ExportIterationPreparer(ctx, projectID, iterationID, platform, flavor)
  1290  	if err != nil {
  1291  		err = autorest.NewErrorWithError(err, "training.BaseClient", "ExportIteration", nil, "Failure preparing request")
  1292  		return
  1293  	}
  1294  
  1295  	resp, err := client.ExportIterationSender(req)
  1296  	if err != nil {
  1297  		result.Response = autorest.Response{Response: resp}
  1298  		err = autorest.NewErrorWithError(err, "training.BaseClient", "ExportIteration", resp, "Failure sending request")
  1299  		return
  1300  	}
  1301  
  1302  	result, err = client.ExportIterationResponder(resp)
  1303  	if err != nil {
  1304  		err = autorest.NewErrorWithError(err, "training.BaseClient", "ExportIteration", resp, "Failure responding to request")
  1305  		return
  1306  	}
  1307  
  1308  	return
  1309  }
  1310  
  1311  // ExportIterationPreparer prepares the ExportIteration request.
  1312  func (client BaseClient) ExportIterationPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, platform string, flavor string) (*http.Request, error) {
  1313  	urlParameters := map[string]interface{}{
  1314  		"Endpoint": client.Endpoint,
  1315  	}
  1316  
  1317  	pathParameters := map[string]interface{}{
  1318  		"iterationId": autorest.Encode("path", iterationID),
  1319  		"projectId":   autorest.Encode("path", projectID),
  1320  	}
  1321  
  1322  	queryParameters := map[string]interface{}{
  1323  		"platform": autorest.Encode("query", platform),
  1324  	}
  1325  	if len(string(flavor)) > 0 {
  1326  		queryParameters["flavor"] = autorest.Encode("query", flavor)
  1327  	}
  1328  
  1329  	preparer := autorest.CreatePreparer(
  1330  		autorest.AsPost(),
  1331  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  1332  		autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}/export", pathParameters),
  1333  		autorest.WithQueryParameters(queryParameters))
  1334  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1335  }
  1336  
  1337  // ExportIterationSender sends the ExportIteration request. The method will close the
  1338  // http.Response Body if it receives an error.
  1339  func (client BaseClient) ExportIterationSender(req *http.Request) (*http.Response, error) {
  1340  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1341  }
  1342  
  1343  // ExportIterationResponder handles the response to the ExportIteration request. The method always
  1344  // closes the http.Response Body.
  1345  func (client BaseClient) ExportIterationResponder(resp *http.Response) (result Export, err error) {
  1346  	err = autorest.Respond(
  1347  		resp,
  1348  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1349  		autorest.ByUnmarshallingJSON(&result),
  1350  		autorest.ByClosing())
  1351  	result.Response = autorest.Response{Response: resp}
  1352  	return
  1353  }
  1354  
  1355  // ExportProject sends the export project request.
  1356  // Parameters:
  1357  // projectID - the project id of the project to export.
  1358  func (client BaseClient) ExportProject(ctx context.Context, projectID uuid.UUID) (result ProjectExport, err error) {
  1359  	if tracing.IsEnabled() {
  1360  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ExportProject")
  1361  		defer func() {
  1362  			sc := -1
  1363  			if result.Response.Response != nil {
  1364  				sc = result.Response.Response.StatusCode
  1365  			}
  1366  			tracing.EndSpan(ctx, sc, err)
  1367  		}()
  1368  	}
  1369  	req, err := client.ExportProjectPreparer(ctx, projectID)
  1370  	if err != nil {
  1371  		err = autorest.NewErrorWithError(err, "training.BaseClient", "ExportProject", nil, "Failure preparing request")
  1372  		return
  1373  	}
  1374  
  1375  	resp, err := client.ExportProjectSender(req)
  1376  	if err != nil {
  1377  		result.Response = autorest.Response{Response: resp}
  1378  		err = autorest.NewErrorWithError(err, "training.BaseClient", "ExportProject", resp, "Failure sending request")
  1379  		return
  1380  	}
  1381  
  1382  	result, err = client.ExportProjectResponder(resp)
  1383  	if err != nil {
  1384  		err = autorest.NewErrorWithError(err, "training.BaseClient", "ExportProject", resp, "Failure responding to request")
  1385  		return
  1386  	}
  1387  
  1388  	return
  1389  }
  1390  
  1391  // ExportProjectPreparer prepares the ExportProject request.
  1392  func (client BaseClient) ExportProjectPreparer(ctx context.Context, projectID uuid.UUID) (*http.Request, error) {
  1393  	urlParameters := map[string]interface{}{
  1394  		"Endpoint": client.Endpoint,
  1395  	}
  1396  
  1397  	pathParameters := map[string]interface{}{
  1398  		"projectId": autorest.Encode("path", projectID),
  1399  	}
  1400  
  1401  	preparer := autorest.CreatePreparer(
  1402  		autorest.AsGet(),
  1403  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  1404  		autorest.WithPathParameters("/projects/{projectId}/export", pathParameters))
  1405  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1406  }
  1407  
  1408  // ExportProjectSender sends the ExportProject request. The method will close the
  1409  // http.Response Body if it receives an error.
  1410  func (client BaseClient) ExportProjectSender(req *http.Request) (*http.Response, error) {
  1411  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1412  }
  1413  
  1414  // ExportProjectResponder handles the response to the ExportProject request. The method always
  1415  // closes the http.Response Body.
  1416  func (client BaseClient) ExportProjectResponder(resp *http.Response) (result ProjectExport, err error) {
  1417  	err = autorest.Respond(
  1418  		resp,
  1419  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1420  		autorest.ByUnmarshallingJSON(&result),
  1421  		autorest.ByClosing())
  1422  	result.Response = autorest.Response{Response: resp}
  1423  	return
  1424  }
  1425  
  1426  // GetArtifact sends the get artifact request.
  1427  // Parameters:
  1428  // projectID - the project id.
  1429  // pathParameter - the relative path for artifact.
  1430  func (client BaseClient) GetArtifact(ctx context.Context, projectID uuid.UUID, pathParameter string) (result ReadCloser, err error) {
  1431  	if tracing.IsEnabled() {
  1432  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetArtifact")
  1433  		defer func() {
  1434  			sc := -1
  1435  			if result.Response.Response != nil {
  1436  				sc = result.Response.Response.StatusCode
  1437  			}
  1438  			tracing.EndSpan(ctx, sc, err)
  1439  		}()
  1440  	}
  1441  	req, err := client.GetArtifactPreparer(ctx, projectID, pathParameter)
  1442  	if err != nil {
  1443  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetArtifact", nil, "Failure preparing request")
  1444  		return
  1445  	}
  1446  
  1447  	resp, err := client.GetArtifactSender(req)
  1448  	if err != nil {
  1449  		result.Response = autorest.Response{Response: resp}
  1450  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetArtifact", resp, "Failure sending request")
  1451  		return
  1452  	}
  1453  
  1454  	result, err = client.GetArtifactResponder(resp)
  1455  	if err != nil {
  1456  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetArtifact", resp, "Failure responding to request")
  1457  		return
  1458  	}
  1459  
  1460  	return
  1461  }
  1462  
  1463  // GetArtifactPreparer prepares the GetArtifact request.
  1464  func (client BaseClient) GetArtifactPreparer(ctx context.Context, projectID uuid.UUID, pathParameter string) (*http.Request, error) {
  1465  	urlParameters := map[string]interface{}{
  1466  		"Endpoint": client.Endpoint,
  1467  	}
  1468  
  1469  	pathParameters := map[string]interface{}{
  1470  		"projectId": autorest.Encode("path", projectID),
  1471  	}
  1472  
  1473  	queryParameters := map[string]interface{}{
  1474  		"path": autorest.Encode("query", pathParameter),
  1475  	}
  1476  
  1477  	preparer := autorest.CreatePreparer(
  1478  		autorest.AsGet(),
  1479  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  1480  		autorest.WithPathParameters("/projects/{projectId}/artifacts", pathParameters),
  1481  		autorest.WithQueryParameters(queryParameters))
  1482  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1483  }
  1484  
  1485  // GetArtifactSender sends the GetArtifact request. The method will close the
  1486  // http.Response Body if it receives an error.
  1487  func (client BaseClient) GetArtifactSender(req *http.Request) (*http.Response, error) {
  1488  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1489  }
  1490  
  1491  // GetArtifactResponder handles the response to the GetArtifact request. The method always
  1492  // closes the http.Response Body.
  1493  func (client BaseClient) GetArtifactResponder(resp *http.Response) (result ReadCloser, err error) {
  1494  	result.Value = &resp.Body
  1495  	err = autorest.Respond(
  1496  		resp,
  1497  		azure.WithErrorUnlessStatusCode(http.StatusOK))
  1498  	result.Response = autorest.Response{Response: resp}
  1499  	return
  1500  }
  1501  
  1502  // GetDomain sends the get domain request.
  1503  // Parameters:
  1504  // domainID - the id of the domain to get information about.
  1505  func (client BaseClient) GetDomain(ctx context.Context, domainID uuid.UUID) (result Domain, err error) {
  1506  	if tracing.IsEnabled() {
  1507  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDomain")
  1508  		defer func() {
  1509  			sc := -1
  1510  			if result.Response.Response != nil {
  1511  				sc = result.Response.Response.StatusCode
  1512  			}
  1513  			tracing.EndSpan(ctx, sc, err)
  1514  		}()
  1515  	}
  1516  	req, err := client.GetDomainPreparer(ctx, domainID)
  1517  	if err != nil {
  1518  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetDomain", nil, "Failure preparing request")
  1519  		return
  1520  	}
  1521  
  1522  	resp, err := client.GetDomainSender(req)
  1523  	if err != nil {
  1524  		result.Response = autorest.Response{Response: resp}
  1525  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetDomain", resp, "Failure sending request")
  1526  		return
  1527  	}
  1528  
  1529  	result, err = client.GetDomainResponder(resp)
  1530  	if err != nil {
  1531  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetDomain", resp, "Failure responding to request")
  1532  		return
  1533  	}
  1534  
  1535  	return
  1536  }
  1537  
  1538  // GetDomainPreparer prepares the GetDomain request.
  1539  func (client BaseClient) GetDomainPreparer(ctx context.Context, domainID uuid.UUID) (*http.Request, error) {
  1540  	urlParameters := map[string]interface{}{
  1541  		"Endpoint": client.Endpoint,
  1542  	}
  1543  
  1544  	pathParameters := map[string]interface{}{
  1545  		"domainId": autorest.Encode("path", domainID),
  1546  	}
  1547  
  1548  	preparer := autorest.CreatePreparer(
  1549  		autorest.AsGet(),
  1550  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  1551  		autorest.WithPathParameters("/domains/{domainId}", pathParameters))
  1552  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1553  }
  1554  
  1555  // GetDomainSender sends the GetDomain request. The method will close the
  1556  // http.Response Body if it receives an error.
  1557  func (client BaseClient) GetDomainSender(req *http.Request) (*http.Response, error) {
  1558  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1559  }
  1560  
  1561  // GetDomainResponder handles the response to the GetDomain request. The method always
  1562  // closes the http.Response Body.
  1563  func (client BaseClient) GetDomainResponder(resp *http.Response) (result Domain, err error) {
  1564  	err = autorest.Respond(
  1565  		resp,
  1566  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1567  		autorest.ByUnmarshallingJSON(&result),
  1568  		autorest.ByClosing())
  1569  	result.Response = autorest.Response{Response: resp}
  1570  	return
  1571  }
  1572  
  1573  // GetDomains sends the get domains request.
  1574  func (client BaseClient) GetDomains(ctx context.Context) (result ListDomain, err error) {
  1575  	if tracing.IsEnabled() {
  1576  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDomains")
  1577  		defer func() {
  1578  			sc := -1
  1579  			if result.Response.Response != nil {
  1580  				sc = result.Response.Response.StatusCode
  1581  			}
  1582  			tracing.EndSpan(ctx, sc, err)
  1583  		}()
  1584  	}
  1585  	req, err := client.GetDomainsPreparer(ctx)
  1586  	if err != nil {
  1587  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetDomains", nil, "Failure preparing request")
  1588  		return
  1589  	}
  1590  
  1591  	resp, err := client.GetDomainsSender(req)
  1592  	if err != nil {
  1593  		result.Response = autorest.Response{Response: resp}
  1594  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetDomains", resp, "Failure sending request")
  1595  		return
  1596  	}
  1597  
  1598  	result, err = client.GetDomainsResponder(resp)
  1599  	if err != nil {
  1600  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetDomains", resp, "Failure responding to request")
  1601  		return
  1602  	}
  1603  
  1604  	return
  1605  }
  1606  
  1607  // GetDomainsPreparer prepares the GetDomains request.
  1608  func (client BaseClient) GetDomainsPreparer(ctx context.Context) (*http.Request, error) {
  1609  	urlParameters := map[string]interface{}{
  1610  		"Endpoint": client.Endpoint,
  1611  	}
  1612  
  1613  	preparer := autorest.CreatePreparer(
  1614  		autorest.AsGet(),
  1615  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  1616  		autorest.WithPath("/domains"))
  1617  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1618  }
  1619  
  1620  // GetDomainsSender sends the GetDomains request. The method will close the
  1621  // http.Response Body if it receives an error.
  1622  func (client BaseClient) GetDomainsSender(req *http.Request) (*http.Response, error) {
  1623  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1624  }
  1625  
  1626  // GetDomainsResponder handles the response to the GetDomains request. The method always
  1627  // closes the http.Response Body.
  1628  func (client BaseClient) GetDomainsResponder(resp *http.Response) (result ListDomain, err error) {
  1629  	err = autorest.Respond(
  1630  		resp,
  1631  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1632  		autorest.ByUnmarshallingJSON(&result.Value),
  1633  		autorest.ByClosing())
  1634  	result.Response = autorest.Response{Response: resp}
  1635  	return
  1636  }
  1637  
  1638  // GetExports sends the get exports request.
  1639  // Parameters:
  1640  // projectID - the project id.
  1641  // iterationID - the iteration id.
  1642  func (client BaseClient) GetExports(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (result ListExport, err error) {
  1643  	if tracing.IsEnabled() {
  1644  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetExports")
  1645  		defer func() {
  1646  			sc := -1
  1647  			if result.Response.Response != nil {
  1648  				sc = result.Response.Response.StatusCode
  1649  			}
  1650  			tracing.EndSpan(ctx, sc, err)
  1651  		}()
  1652  	}
  1653  	req, err := client.GetExportsPreparer(ctx, projectID, iterationID)
  1654  	if err != nil {
  1655  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetExports", nil, "Failure preparing request")
  1656  		return
  1657  	}
  1658  
  1659  	resp, err := client.GetExportsSender(req)
  1660  	if err != nil {
  1661  		result.Response = autorest.Response{Response: resp}
  1662  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetExports", resp, "Failure sending request")
  1663  		return
  1664  	}
  1665  
  1666  	result, err = client.GetExportsResponder(resp)
  1667  	if err != nil {
  1668  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetExports", resp, "Failure responding to request")
  1669  		return
  1670  	}
  1671  
  1672  	return
  1673  }
  1674  
  1675  // GetExportsPreparer prepares the GetExports request.
  1676  func (client BaseClient) GetExportsPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (*http.Request, error) {
  1677  	urlParameters := map[string]interface{}{
  1678  		"Endpoint": client.Endpoint,
  1679  	}
  1680  
  1681  	pathParameters := map[string]interface{}{
  1682  		"iterationId": autorest.Encode("path", iterationID),
  1683  		"projectId":   autorest.Encode("path", projectID),
  1684  	}
  1685  
  1686  	preparer := autorest.CreatePreparer(
  1687  		autorest.AsGet(),
  1688  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  1689  		autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}/export", pathParameters))
  1690  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1691  }
  1692  
  1693  // GetExportsSender sends the GetExports request. The method will close the
  1694  // http.Response Body if it receives an error.
  1695  func (client BaseClient) GetExportsSender(req *http.Request) (*http.Response, error) {
  1696  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1697  }
  1698  
  1699  // GetExportsResponder handles the response to the GetExports request. The method always
  1700  // closes the http.Response Body.
  1701  func (client BaseClient) GetExportsResponder(resp *http.Response) (result ListExport, err error) {
  1702  	err = autorest.Respond(
  1703  		resp,
  1704  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1705  		autorest.ByUnmarshallingJSON(&result.Value),
  1706  		autorest.ByClosing())
  1707  	result.Response = autorest.Response{Response: resp}
  1708  	return
  1709  }
  1710  
  1711  // GetImageCount the filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and
  1712  // "Cat" tags, then only images tagged with Dog and/or Cat will be returned
  1713  // Parameters:
  1714  // projectID - the project id.
  1715  // iterationID - the iteration id. Defaults to workspace.
  1716  // taggingStatus - the tagging status filter. It can be 'All', 'Tagged', or 'Untagged'. Defaults to 'All'.
  1717  // filter - an expression to filter the images against image metadata. Only images where the expression
  1718  // evaluates to true are included in the response.
  1719  // The expression supports eq (Equal), ne (Not equal), and (Logical and), or (Logical or) operators.
  1720  // Here is an example, metadata=key1 eq 'value1' and key2 ne 'value2'.
  1721  // tagIds - a list of tags ids to filter the images to count. Defaults to all tags when null.
  1722  func (client BaseClient) GetImageCount(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, taggingStatus string, filter string, tagIds []uuid.UUID) (result Int32, err error) {
  1723  	if tracing.IsEnabled() {
  1724  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageCount")
  1725  		defer func() {
  1726  			sc := -1
  1727  			if result.Response.Response != nil {
  1728  				sc = result.Response.Response.StatusCode
  1729  			}
  1730  			tracing.EndSpan(ctx, sc, err)
  1731  		}()
  1732  	}
  1733  	req, err := client.GetImageCountPreparer(ctx, projectID, iterationID, taggingStatus, filter, tagIds)
  1734  	if err != nil {
  1735  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImageCount", nil, "Failure preparing request")
  1736  		return
  1737  	}
  1738  
  1739  	resp, err := client.GetImageCountSender(req)
  1740  	if err != nil {
  1741  		result.Response = autorest.Response{Response: resp}
  1742  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImageCount", resp, "Failure sending request")
  1743  		return
  1744  	}
  1745  
  1746  	result, err = client.GetImageCountResponder(resp)
  1747  	if err != nil {
  1748  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImageCount", resp, "Failure responding to request")
  1749  		return
  1750  	}
  1751  
  1752  	return
  1753  }
  1754  
  1755  // GetImageCountPreparer prepares the GetImageCount request.
  1756  func (client BaseClient) GetImageCountPreparer(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, taggingStatus string, filter string, tagIds []uuid.UUID) (*http.Request, error) {
  1757  	urlParameters := map[string]interface{}{
  1758  		"Endpoint": client.Endpoint,
  1759  	}
  1760  
  1761  	pathParameters := map[string]interface{}{
  1762  		"projectId": autorest.Encode("path", projectID),
  1763  	}
  1764  
  1765  	queryParameters := map[string]interface{}{}
  1766  	if iterationID != nil {
  1767  		queryParameters["iterationId"] = autorest.Encode("query", *iterationID)
  1768  	}
  1769  	if len(string(taggingStatus)) > 0 {
  1770  		queryParameters["taggingStatus"] = autorest.Encode("query", taggingStatus)
  1771  	}
  1772  	if len(filter) > 0 {
  1773  		queryParameters["$filter"] = autorest.Encode("query", filter)
  1774  	}
  1775  	if tagIds != nil && len(tagIds) > 0 {
  1776  		queryParameters["tagIds"] = autorest.Encode("query", tagIds, ",")
  1777  	}
  1778  
  1779  	preparer := autorest.CreatePreparer(
  1780  		autorest.AsGet(),
  1781  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  1782  		autorest.WithPathParameters("/projects/{projectId}/images/count", pathParameters),
  1783  		autorest.WithQueryParameters(queryParameters))
  1784  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1785  }
  1786  
  1787  // GetImageCountSender sends the GetImageCount request. The method will close the
  1788  // http.Response Body if it receives an error.
  1789  func (client BaseClient) GetImageCountSender(req *http.Request) (*http.Response, error) {
  1790  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1791  }
  1792  
  1793  // GetImageCountResponder handles the response to the GetImageCount request. The method always
  1794  // closes the http.Response Body.
  1795  func (client BaseClient) GetImageCountResponder(resp *http.Response) (result Int32, err error) {
  1796  	err = autorest.Respond(
  1797  		resp,
  1798  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1799  		autorest.ByUnmarshallingJSON(&result.Value),
  1800  		autorest.ByClosing())
  1801  	result.Response = autorest.Response{Response: resp}
  1802  	return
  1803  }
  1804  
  1805  // GetImagePerformanceCount the filtering is on an and/or relationship. For example, if the provided tag ids are for
  1806  // the "Dog" and
  1807  // "Cat" tags, then only images tagged with Dog and/or Cat will be returned
  1808  // Parameters:
  1809  // projectID - the project id.
  1810  // iterationID - the iteration id. Defaults to workspace.
  1811  // tagIds - a list of tags ids to filter the images to count. Defaults to all tags when null.
  1812  func (client BaseClient) GetImagePerformanceCount(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, tagIds []uuid.UUID) (result Int32, err error) {
  1813  	if tracing.IsEnabled() {
  1814  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImagePerformanceCount")
  1815  		defer func() {
  1816  			sc := -1
  1817  			if result.Response.Response != nil {
  1818  				sc = result.Response.Response.StatusCode
  1819  			}
  1820  			tracing.EndSpan(ctx, sc, err)
  1821  		}()
  1822  	}
  1823  	req, err := client.GetImagePerformanceCountPreparer(ctx, projectID, iterationID, tagIds)
  1824  	if err != nil {
  1825  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagePerformanceCount", nil, "Failure preparing request")
  1826  		return
  1827  	}
  1828  
  1829  	resp, err := client.GetImagePerformanceCountSender(req)
  1830  	if err != nil {
  1831  		result.Response = autorest.Response{Response: resp}
  1832  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagePerformanceCount", resp, "Failure sending request")
  1833  		return
  1834  	}
  1835  
  1836  	result, err = client.GetImagePerformanceCountResponder(resp)
  1837  	if err != nil {
  1838  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagePerformanceCount", resp, "Failure responding to request")
  1839  		return
  1840  	}
  1841  
  1842  	return
  1843  }
  1844  
  1845  // GetImagePerformanceCountPreparer prepares the GetImagePerformanceCount request.
  1846  func (client BaseClient) GetImagePerformanceCountPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, tagIds []uuid.UUID) (*http.Request, error) {
  1847  	urlParameters := map[string]interface{}{
  1848  		"Endpoint": client.Endpoint,
  1849  	}
  1850  
  1851  	pathParameters := map[string]interface{}{
  1852  		"iterationId": autorest.Encode("path", iterationID),
  1853  		"projectId":   autorest.Encode("path", projectID),
  1854  	}
  1855  
  1856  	queryParameters := map[string]interface{}{}
  1857  	if tagIds != nil && len(tagIds) > 0 {
  1858  		queryParameters["tagIds"] = autorest.Encode("query", tagIds, ",")
  1859  	}
  1860  
  1861  	preparer := autorest.CreatePreparer(
  1862  		autorest.AsGet(),
  1863  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  1864  		autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}/performance/images/count", pathParameters),
  1865  		autorest.WithQueryParameters(queryParameters))
  1866  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1867  }
  1868  
  1869  // GetImagePerformanceCountSender sends the GetImagePerformanceCount request. The method will close the
  1870  // http.Response Body if it receives an error.
  1871  func (client BaseClient) GetImagePerformanceCountSender(req *http.Request) (*http.Response, error) {
  1872  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1873  }
  1874  
  1875  // GetImagePerformanceCountResponder handles the response to the GetImagePerformanceCount request. The method always
  1876  // closes the http.Response Body.
  1877  func (client BaseClient) GetImagePerformanceCountResponder(resp *http.Response) (result Int32, err error) {
  1878  	err = autorest.Respond(
  1879  		resp,
  1880  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1881  		autorest.ByUnmarshallingJSON(&result.Value),
  1882  		autorest.ByClosing())
  1883  	result.Response = autorest.Response{Response: resp}
  1884  	return
  1885  }
  1886  
  1887  // GetImagePerformances this API supports batching and range selection. By default it will only return first 50 images
  1888  // matching images.
  1889  // Use the {take} and {skip} parameters to control how many images to return in a given batch.
  1890  // The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and
  1891  // "Cat" tags, then only images tagged with Dog and/or Cat will be returned
  1892  // Parameters:
  1893  // projectID - the project id.
  1894  // iterationID - the iteration id. Defaults to workspace.
  1895  // tagIds - a list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20.
  1896  // orderBy - the ordering. Defaults to newest.
  1897  // take - maximum number of images to return. Defaults to 50, limited to 256.
  1898  // skip - number of images to skip before beginning the image batch. Defaults to 0.
  1899  func (client BaseClient) GetImagePerformances(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, tagIds []uuid.UUID, orderBy string, take *int32, skip *int32) (result ListImagePerformance, err error) {
  1900  	if tracing.IsEnabled() {
  1901  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImagePerformances")
  1902  		defer func() {
  1903  			sc := -1
  1904  			if result.Response.Response != nil {
  1905  				sc = result.Response.Response.StatusCode
  1906  			}
  1907  			tracing.EndSpan(ctx, sc, err)
  1908  		}()
  1909  	}
  1910  	if err := validation.Validate([]validation.Validation{
  1911  		{TargetValue: tagIds,
  1912  			Constraints: []validation.Constraint{{Target: "tagIds", Name: validation.Null, Rule: false,
  1913  				Chain: []validation.Constraint{{Target: "tagIds", Name: validation.MaxItems, Rule: 20, Chain: nil},
  1914  					{Target: "tagIds", Name: validation.MinItems, Rule: 0, Chain: nil},
  1915  				}}}},
  1916  		{TargetValue: take,
  1917  			Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
  1918  				Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(256), Chain: nil},
  1919  					{Target: "take", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
  1920  				}}}}}); err != nil {
  1921  		return result, validation.NewError("training.BaseClient", "GetImagePerformances", err.Error())
  1922  	}
  1923  
  1924  	req, err := client.GetImagePerformancesPreparer(ctx, projectID, iterationID, tagIds, orderBy, take, skip)
  1925  	if err != nil {
  1926  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagePerformances", nil, "Failure preparing request")
  1927  		return
  1928  	}
  1929  
  1930  	resp, err := client.GetImagePerformancesSender(req)
  1931  	if err != nil {
  1932  		result.Response = autorest.Response{Response: resp}
  1933  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagePerformances", resp, "Failure sending request")
  1934  		return
  1935  	}
  1936  
  1937  	result, err = client.GetImagePerformancesResponder(resp)
  1938  	if err != nil {
  1939  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagePerformances", resp, "Failure responding to request")
  1940  		return
  1941  	}
  1942  
  1943  	return
  1944  }
  1945  
  1946  // GetImagePerformancesPreparer prepares the GetImagePerformances request.
  1947  func (client BaseClient) GetImagePerformancesPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, tagIds []uuid.UUID, orderBy string, take *int32, skip *int32) (*http.Request, error) {
  1948  	urlParameters := map[string]interface{}{
  1949  		"Endpoint": client.Endpoint,
  1950  	}
  1951  
  1952  	pathParameters := map[string]interface{}{
  1953  		"iterationId": autorest.Encode("path", iterationID),
  1954  		"projectId":   autorest.Encode("path", projectID),
  1955  	}
  1956  
  1957  	queryParameters := map[string]interface{}{}
  1958  	if tagIds != nil && len(tagIds) > 0 {
  1959  		queryParameters["tagIds"] = autorest.Encode("query", tagIds, ",")
  1960  	}
  1961  	if len(string(orderBy)) > 0 {
  1962  		queryParameters["orderBy"] = autorest.Encode("query", orderBy)
  1963  	}
  1964  	if take != nil {
  1965  		queryParameters["take"] = autorest.Encode("query", *take)
  1966  	} else {
  1967  		queryParameters["take"] = autorest.Encode("query", 50)
  1968  	}
  1969  	if skip != nil {
  1970  		queryParameters["skip"] = autorest.Encode("query", *skip)
  1971  	} else {
  1972  		queryParameters["skip"] = autorest.Encode("query", 0)
  1973  	}
  1974  
  1975  	preparer := autorest.CreatePreparer(
  1976  		autorest.AsGet(),
  1977  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  1978  		autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}/performance/images", pathParameters),
  1979  		autorest.WithQueryParameters(queryParameters))
  1980  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1981  }
  1982  
  1983  // GetImagePerformancesSender sends the GetImagePerformances request. The method will close the
  1984  // http.Response Body if it receives an error.
  1985  func (client BaseClient) GetImagePerformancesSender(req *http.Request) (*http.Response, error) {
  1986  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1987  }
  1988  
  1989  // GetImagePerformancesResponder handles the response to the GetImagePerformances request. The method always
  1990  // closes the http.Response Body.
  1991  func (client BaseClient) GetImagePerformancesResponder(resp *http.Response) (result ListImagePerformance, err error) {
  1992  	err = autorest.Respond(
  1993  		resp,
  1994  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  1995  		autorest.ByUnmarshallingJSON(&result.Value),
  1996  		autorest.ByClosing())
  1997  	result.Response = autorest.Response{Response: resp}
  1998  	return
  1999  }
  2000  
  2001  // GetImageRegionProposals this API will get region proposals for an image along with confidences for the region. It
  2002  // returns an empty array if no proposals are found.
  2003  // Parameters:
  2004  // projectID - the project id.
  2005  // imageID - the image id.
  2006  func (client BaseClient) GetImageRegionProposals(ctx context.Context, projectID uuid.UUID, imageID uuid.UUID) (result ImageRegionProposal, err error) {
  2007  	if tracing.IsEnabled() {
  2008  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageRegionProposals")
  2009  		defer func() {
  2010  			sc := -1
  2011  			if result.Response.Response != nil {
  2012  				sc = result.Response.Response.StatusCode
  2013  			}
  2014  			tracing.EndSpan(ctx, sc, err)
  2015  		}()
  2016  	}
  2017  	req, err := client.GetImageRegionProposalsPreparer(ctx, projectID, imageID)
  2018  	if err != nil {
  2019  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImageRegionProposals", nil, "Failure preparing request")
  2020  		return
  2021  	}
  2022  
  2023  	resp, err := client.GetImageRegionProposalsSender(req)
  2024  	if err != nil {
  2025  		result.Response = autorest.Response{Response: resp}
  2026  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImageRegionProposals", resp, "Failure sending request")
  2027  		return
  2028  	}
  2029  
  2030  	result, err = client.GetImageRegionProposalsResponder(resp)
  2031  	if err != nil {
  2032  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImageRegionProposals", resp, "Failure responding to request")
  2033  		return
  2034  	}
  2035  
  2036  	return
  2037  }
  2038  
  2039  // GetImageRegionProposalsPreparer prepares the GetImageRegionProposals request.
  2040  func (client BaseClient) GetImageRegionProposalsPreparer(ctx context.Context, projectID uuid.UUID, imageID uuid.UUID) (*http.Request, error) {
  2041  	urlParameters := map[string]interface{}{
  2042  		"Endpoint": client.Endpoint,
  2043  	}
  2044  
  2045  	pathParameters := map[string]interface{}{
  2046  		"imageId":   autorest.Encode("path", imageID),
  2047  		"projectId": autorest.Encode("path", projectID),
  2048  	}
  2049  
  2050  	preparer := autorest.CreatePreparer(
  2051  		autorest.AsPost(),
  2052  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  2053  		autorest.WithPathParameters("/projects/{projectId}/images/{imageId}/regionproposals", pathParameters))
  2054  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2055  }
  2056  
  2057  // GetImageRegionProposalsSender sends the GetImageRegionProposals request. The method will close the
  2058  // http.Response Body if it receives an error.
  2059  func (client BaseClient) GetImageRegionProposalsSender(req *http.Request) (*http.Response, error) {
  2060  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2061  }
  2062  
  2063  // GetImageRegionProposalsResponder handles the response to the GetImageRegionProposals request. The method always
  2064  // closes the http.Response Body.
  2065  func (client BaseClient) GetImageRegionProposalsResponder(resp *http.Response) (result ImageRegionProposal, err error) {
  2066  	err = autorest.Respond(
  2067  		resp,
  2068  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2069  		autorest.ByUnmarshallingJSON(&result),
  2070  		autorest.ByClosing())
  2071  	result.Response = autorest.Response{Response: resp}
  2072  	return
  2073  }
  2074  
  2075  // GetImages this API supports batching and range selection. By default it will only return first 50 images matching
  2076  // images.
  2077  // Use the {take} and {skip} parameters to control how many images to return in a given batch.
  2078  // The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and
  2079  // "Cat" tags, then only images tagged with Dog and/or Cat will be returned
  2080  // Parameters:
  2081  // projectID - the project id.
  2082  // iterationID - the iteration id. Defaults to workspace.
  2083  // tagIds - a list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20.
  2084  // taggingStatus - the tagging status filter. It can be 'All', 'Tagged', or 'Untagged'. Defaults to 'All'.
  2085  // filter - an expression to filter the images against image metadata. Only images where the expression
  2086  // evaluates to true are included in the response.
  2087  // The expression supports eq (Equal), ne (Not equal), and (Logical and), or (Logical or) operators.
  2088  // Here is an example, metadata=key1 eq 'value1' and key2 ne 'value2'.
  2089  // orderBy - the ordering. Defaults to newest.
  2090  // take - maximum number of images to return. Defaults to 50, limited to 256.
  2091  // skip - number of images to skip before beginning the image batch. Defaults to 0.
  2092  func (client BaseClient) GetImages(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, tagIds []uuid.UUID, taggingStatus string, filter string, orderBy string, take *int32, skip *int32) (result ListImage, err error) {
  2093  	if tracing.IsEnabled() {
  2094  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImages")
  2095  		defer func() {
  2096  			sc := -1
  2097  			if result.Response.Response != nil {
  2098  				sc = result.Response.Response.StatusCode
  2099  			}
  2100  			tracing.EndSpan(ctx, sc, err)
  2101  		}()
  2102  	}
  2103  	if err := validation.Validate([]validation.Validation{
  2104  		{TargetValue: tagIds,
  2105  			Constraints: []validation.Constraint{{Target: "tagIds", Name: validation.Null, Rule: false,
  2106  				Chain: []validation.Constraint{{Target: "tagIds", Name: validation.MaxItems, Rule: 20, Chain: nil},
  2107  					{Target: "tagIds", Name: validation.MinItems, Rule: 0, Chain: nil},
  2108  				}}}},
  2109  		{TargetValue: take,
  2110  			Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
  2111  				Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(256), Chain: nil},
  2112  					{Target: "take", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
  2113  				}}}}}); err != nil {
  2114  		return result, validation.NewError("training.BaseClient", "GetImages", err.Error())
  2115  	}
  2116  
  2117  	req, err := client.GetImagesPreparer(ctx, projectID, iterationID, tagIds, taggingStatus, filter, orderBy, take, skip)
  2118  	if err != nil {
  2119  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImages", nil, "Failure preparing request")
  2120  		return
  2121  	}
  2122  
  2123  	resp, err := client.GetImagesSender(req)
  2124  	if err != nil {
  2125  		result.Response = autorest.Response{Response: resp}
  2126  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImages", resp, "Failure sending request")
  2127  		return
  2128  	}
  2129  
  2130  	result, err = client.GetImagesResponder(resp)
  2131  	if err != nil {
  2132  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImages", resp, "Failure responding to request")
  2133  		return
  2134  	}
  2135  
  2136  	return
  2137  }
  2138  
  2139  // GetImagesPreparer prepares the GetImages request.
  2140  func (client BaseClient) GetImagesPreparer(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, tagIds []uuid.UUID, taggingStatus string, filter string, orderBy string, take *int32, skip *int32) (*http.Request, error) {
  2141  	urlParameters := map[string]interface{}{
  2142  		"Endpoint": client.Endpoint,
  2143  	}
  2144  
  2145  	pathParameters := map[string]interface{}{
  2146  		"projectId": autorest.Encode("path", projectID),
  2147  	}
  2148  
  2149  	queryParameters := map[string]interface{}{}
  2150  	if iterationID != nil {
  2151  		queryParameters["iterationId"] = autorest.Encode("query", *iterationID)
  2152  	}
  2153  	if tagIds != nil && len(tagIds) > 0 {
  2154  		queryParameters["tagIds"] = autorest.Encode("query", tagIds, ",")
  2155  	}
  2156  	if len(string(taggingStatus)) > 0 {
  2157  		queryParameters["taggingStatus"] = autorest.Encode("query", taggingStatus)
  2158  	}
  2159  	if len(filter) > 0 {
  2160  		queryParameters["$filter"] = autorest.Encode("query", filter)
  2161  	}
  2162  	if len(string(orderBy)) > 0 {
  2163  		queryParameters["orderBy"] = autorest.Encode("query", orderBy)
  2164  	}
  2165  	if take != nil {
  2166  		queryParameters["take"] = autorest.Encode("query", *take)
  2167  	} else {
  2168  		queryParameters["take"] = autorest.Encode("query", 50)
  2169  	}
  2170  	if skip != nil {
  2171  		queryParameters["skip"] = autorest.Encode("query", *skip)
  2172  	} else {
  2173  		queryParameters["skip"] = autorest.Encode("query", 0)
  2174  	}
  2175  
  2176  	preparer := autorest.CreatePreparer(
  2177  		autorest.AsGet(),
  2178  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  2179  		autorest.WithPathParameters("/projects/{projectId}/images", pathParameters),
  2180  		autorest.WithQueryParameters(queryParameters))
  2181  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2182  }
  2183  
  2184  // GetImagesSender sends the GetImages request. The method will close the
  2185  // http.Response Body if it receives an error.
  2186  func (client BaseClient) GetImagesSender(req *http.Request) (*http.Response, error) {
  2187  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2188  }
  2189  
  2190  // GetImagesResponder handles the response to the GetImages request. The method always
  2191  // closes the http.Response Body.
  2192  func (client BaseClient) GetImagesResponder(resp *http.Response) (result ListImage, err error) {
  2193  	err = autorest.Respond(
  2194  		resp,
  2195  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2196  		autorest.ByUnmarshallingJSON(&result.Value),
  2197  		autorest.ByClosing())
  2198  	result.Response = autorest.Response{Response: resp}
  2199  	return
  2200  }
  2201  
  2202  // GetImagesByIds this API will return a set of Images for the specified tags and optionally iteration. If no iteration
  2203  // is specified the
  2204  // current workspace is used.
  2205  // Parameters:
  2206  // projectID - the project id.
  2207  // imageIds - the list of image ids to retrieve. Limited to 256.
  2208  // iterationID - the iteration id. Defaults to workspace.
  2209  func (client BaseClient) GetImagesByIds(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, iterationID *uuid.UUID) (result ListImage, err error) {
  2210  	if tracing.IsEnabled() {
  2211  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImagesByIds")
  2212  		defer func() {
  2213  			sc := -1
  2214  			if result.Response.Response != nil {
  2215  				sc = result.Response.Response.StatusCode
  2216  			}
  2217  			tracing.EndSpan(ctx, sc, err)
  2218  		}()
  2219  	}
  2220  	if err := validation.Validate([]validation.Validation{
  2221  		{TargetValue: imageIds,
  2222  			Constraints: []validation.Constraint{{Target: "imageIds", Name: validation.Null, Rule: false,
  2223  				Chain: []validation.Constraint{{Target: "imageIds", Name: validation.MaxItems, Rule: 256, Chain: nil},
  2224  					{Target: "imageIds", Name: validation.MinItems, Rule: 0, Chain: nil},
  2225  				}}}}}); err != nil {
  2226  		return result, validation.NewError("training.BaseClient", "GetImagesByIds", err.Error())
  2227  	}
  2228  
  2229  	req, err := client.GetImagesByIdsPreparer(ctx, projectID, imageIds, iterationID)
  2230  	if err != nil {
  2231  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagesByIds", nil, "Failure preparing request")
  2232  		return
  2233  	}
  2234  
  2235  	resp, err := client.GetImagesByIdsSender(req)
  2236  	if err != nil {
  2237  		result.Response = autorest.Response{Response: resp}
  2238  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagesByIds", resp, "Failure sending request")
  2239  		return
  2240  	}
  2241  
  2242  	result, err = client.GetImagesByIdsResponder(resp)
  2243  	if err != nil {
  2244  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetImagesByIds", resp, "Failure responding to request")
  2245  		return
  2246  	}
  2247  
  2248  	return
  2249  }
  2250  
  2251  // GetImagesByIdsPreparer prepares the GetImagesByIds request.
  2252  func (client BaseClient) GetImagesByIdsPreparer(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, iterationID *uuid.UUID) (*http.Request, error) {
  2253  	urlParameters := map[string]interface{}{
  2254  		"Endpoint": client.Endpoint,
  2255  	}
  2256  
  2257  	pathParameters := map[string]interface{}{
  2258  		"projectId": autorest.Encode("path", projectID),
  2259  	}
  2260  
  2261  	queryParameters := map[string]interface{}{}
  2262  	if imageIds != nil && len(imageIds) > 0 {
  2263  		queryParameters["imageIds"] = autorest.Encode("query", imageIds, ",")
  2264  	}
  2265  	if iterationID != nil {
  2266  		queryParameters["iterationId"] = autorest.Encode("query", *iterationID)
  2267  	}
  2268  
  2269  	preparer := autorest.CreatePreparer(
  2270  		autorest.AsGet(),
  2271  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  2272  		autorest.WithPathParameters("/projects/{projectId}/images/id", pathParameters),
  2273  		autorest.WithQueryParameters(queryParameters))
  2274  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2275  }
  2276  
  2277  // GetImagesByIdsSender sends the GetImagesByIds request. The method will close the
  2278  // http.Response Body if it receives an error.
  2279  func (client BaseClient) GetImagesByIdsSender(req *http.Request) (*http.Response, error) {
  2280  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2281  }
  2282  
  2283  // GetImagesByIdsResponder handles the response to the GetImagesByIds request. The method always
  2284  // closes the http.Response Body.
  2285  func (client BaseClient) GetImagesByIdsResponder(resp *http.Response) (result ListImage, err error) {
  2286  	err = autorest.Respond(
  2287  		resp,
  2288  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2289  		autorest.ByUnmarshallingJSON(&result.Value),
  2290  		autorest.ByClosing())
  2291  	result.Response = autorest.Response{Response: resp}
  2292  	return
  2293  }
  2294  
  2295  // GetIteration sends the get iteration request.
  2296  // Parameters:
  2297  // projectID - the id of the project the iteration belongs to.
  2298  // iterationID - the id of the iteration to get.
  2299  func (client BaseClient) GetIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (result Iteration, err error) {
  2300  	if tracing.IsEnabled() {
  2301  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetIteration")
  2302  		defer func() {
  2303  			sc := -1
  2304  			if result.Response.Response != nil {
  2305  				sc = result.Response.Response.StatusCode
  2306  			}
  2307  			tracing.EndSpan(ctx, sc, err)
  2308  		}()
  2309  	}
  2310  	req, err := client.GetIterationPreparer(ctx, projectID, iterationID)
  2311  	if err != nil {
  2312  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIteration", nil, "Failure preparing request")
  2313  		return
  2314  	}
  2315  
  2316  	resp, err := client.GetIterationSender(req)
  2317  	if err != nil {
  2318  		result.Response = autorest.Response{Response: resp}
  2319  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIteration", resp, "Failure sending request")
  2320  		return
  2321  	}
  2322  
  2323  	result, err = client.GetIterationResponder(resp)
  2324  	if err != nil {
  2325  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIteration", resp, "Failure responding to request")
  2326  		return
  2327  	}
  2328  
  2329  	return
  2330  }
  2331  
  2332  // GetIterationPreparer prepares the GetIteration request.
  2333  func (client BaseClient) GetIterationPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (*http.Request, error) {
  2334  	urlParameters := map[string]interface{}{
  2335  		"Endpoint": client.Endpoint,
  2336  	}
  2337  
  2338  	pathParameters := map[string]interface{}{
  2339  		"iterationId": autorest.Encode("path", iterationID),
  2340  		"projectId":   autorest.Encode("path", projectID),
  2341  	}
  2342  
  2343  	preparer := autorest.CreatePreparer(
  2344  		autorest.AsGet(),
  2345  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  2346  		autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}", pathParameters))
  2347  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2348  }
  2349  
  2350  // GetIterationSender sends the GetIteration request. The method will close the
  2351  // http.Response Body if it receives an error.
  2352  func (client BaseClient) GetIterationSender(req *http.Request) (*http.Response, error) {
  2353  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2354  }
  2355  
  2356  // GetIterationResponder handles the response to the GetIteration request. The method always
  2357  // closes the http.Response Body.
  2358  func (client BaseClient) GetIterationResponder(resp *http.Response) (result Iteration, err error) {
  2359  	err = autorest.Respond(
  2360  		resp,
  2361  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2362  		autorest.ByUnmarshallingJSON(&result),
  2363  		autorest.ByClosing())
  2364  	result.Response = autorest.Response{Response: resp}
  2365  	return
  2366  }
  2367  
  2368  // GetIterationPerformance sends the get iteration performance request.
  2369  // Parameters:
  2370  // projectID - the id of the project the iteration belongs to.
  2371  // iterationID - the id of the iteration to get.
  2372  // threshold - the threshold used to determine true predictions. Accepted values are between 1 and 0. Defaults to 0.8.
  2373  // overlapThreshold - if applicable, the bounding box overlap threshold used to determine true predictions. Accepted values are between 1 and 0. Defaults to 0.5.
  2374  func (client BaseClient) GetIterationPerformance(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, threshold *float64, overlapThreshold *float64) (result IterationPerformance, err error) {
  2375  	if tracing.IsEnabled() {
  2376  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetIterationPerformance")
  2377  		defer func() {
  2378  			sc := -1
  2379  			if result.Response.Response != nil {
  2380  				sc = result.Response.Response.StatusCode
  2381  			}
  2382  			tracing.EndSpan(ctx, sc, err)
  2383  		}()
  2384  	}
  2385  	req, err := client.GetIterationPerformancePreparer(ctx, projectID, iterationID, threshold, overlapThreshold)
  2386  	if err != nil {
  2387  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIterationPerformance", nil, "Failure preparing request")
  2388  		return
  2389  	}
  2390  
  2391  	resp, err := client.GetIterationPerformanceSender(req)
  2392  	if err != nil {
  2393  		result.Response = autorest.Response{Response: resp}
  2394  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIterationPerformance", resp, "Failure sending request")
  2395  		return
  2396  	}
  2397  
  2398  	result, err = client.GetIterationPerformanceResponder(resp)
  2399  	if err != nil {
  2400  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIterationPerformance", resp, "Failure responding to request")
  2401  		return
  2402  	}
  2403  
  2404  	return
  2405  }
  2406  
  2407  // GetIterationPerformancePreparer prepares the GetIterationPerformance request.
  2408  func (client BaseClient) GetIterationPerformancePreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, threshold *float64, overlapThreshold *float64) (*http.Request, error) {
  2409  	urlParameters := map[string]interface{}{
  2410  		"Endpoint": client.Endpoint,
  2411  	}
  2412  
  2413  	pathParameters := map[string]interface{}{
  2414  		"iterationId": autorest.Encode("path", iterationID),
  2415  		"projectId":   autorest.Encode("path", projectID),
  2416  	}
  2417  
  2418  	queryParameters := map[string]interface{}{}
  2419  	if threshold != nil {
  2420  		queryParameters["threshold"] = autorest.Encode("query", *threshold)
  2421  	}
  2422  	if overlapThreshold != nil {
  2423  		queryParameters["overlapThreshold"] = autorest.Encode("query", *overlapThreshold)
  2424  	}
  2425  
  2426  	preparer := autorest.CreatePreparer(
  2427  		autorest.AsGet(),
  2428  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  2429  		autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}/performance", pathParameters),
  2430  		autorest.WithQueryParameters(queryParameters))
  2431  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2432  }
  2433  
  2434  // GetIterationPerformanceSender sends the GetIterationPerformance request. The method will close the
  2435  // http.Response Body if it receives an error.
  2436  func (client BaseClient) GetIterationPerformanceSender(req *http.Request) (*http.Response, error) {
  2437  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2438  }
  2439  
  2440  // GetIterationPerformanceResponder handles the response to the GetIterationPerformance request. The method always
  2441  // closes the http.Response Body.
  2442  func (client BaseClient) GetIterationPerformanceResponder(resp *http.Response) (result IterationPerformance, err error) {
  2443  	err = autorest.Respond(
  2444  		resp,
  2445  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2446  		autorest.ByUnmarshallingJSON(&result),
  2447  		autorest.ByClosing())
  2448  	result.Response = autorest.Response{Response: resp}
  2449  	return
  2450  }
  2451  
  2452  // GetIterations sends the get iterations request.
  2453  // Parameters:
  2454  // projectID - the project id.
  2455  func (client BaseClient) GetIterations(ctx context.Context, projectID uuid.UUID) (result ListIteration, err error) {
  2456  	if tracing.IsEnabled() {
  2457  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetIterations")
  2458  		defer func() {
  2459  			sc := -1
  2460  			if result.Response.Response != nil {
  2461  				sc = result.Response.Response.StatusCode
  2462  			}
  2463  			tracing.EndSpan(ctx, sc, err)
  2464  		}()
  2465  	}
  2466  	req, err := client.GetIterationsPreparer(ctx, projectID)
  2467  	if err != nil {
  2468  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIterations", nil, "Failure preparing request")
  2469  		return
  2470  	}
  2471  
  2472  	resp, err := client.GetIterationsSender(req)
  2473  	if err != nil {
  2474  		result.Response = autorest.Response{Response: resp}
  2475  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIterations", resp, "Failure sending request")
  2476  		return
  2477  	}
  2478  
  2479  	result, err = client.GetIterationsResponder(resp)
  2480  	if err != nil {
  2481  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetIterations", resp, "Failure responding to request")
  2482  		return
  2483  	}
  2484  
  2485  	return
  2486  }
  2487  
  2488  // GetIterationsPreparer prepares the GetIterations request.
  2489  func (client BaseClient) GetIterationsPreparer(ctx context.Context, projectID uuid.UUID) (*http.Request, error) {
  2490  	urlParameters := map[string]interface{}{
  2491  		"Endpoint": client.Endpoint,
  2492  	}
  2493  
  2494  	pathParameters := map[string]interface{}{
  2495  		"projectId": autorest.Encode("path", projectID),
  2496  	}
  2497  
  2498  	preparer := autorest.CreatePreparer(
  2499  		autorest.AsGet(),
  2500  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  2501  		autorest.WithPathParameters("/projects/{projectId}/iterations", pathParameters))
  2502  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2503  }
  2504  
  2505  // GetIterationsSender sends the GetIterations request. The method will close the
  2506  // http.Response Body if it receives an error.
  2507  func (client BaseClient) GetIterationsSender(req *http.Request) (*http.Response, error) {
  2508  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2509  }
  2510  
  2511  // GetIterationsResponder handles the response to the GetIterations request. The method always
  2512  // closes the http.Response Body.
  2513  func (client BaseClient) GetIterationsResponder(resp *http.Response) (result ListIteration, err error) {
  2514  	err = autorest.Respond(
  2515  		resp,
  2516  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2517  		autorest.ByUnmarshallingJSON(&result.Value),
  2518  		autorest.ByClosing())
  2519  	result.Response = autorest.Response{Response: resp}
  2520  	return
  2521  }
  2522  
  2523  // GetProject sends the get project request.
  2524  // Parameters:
  2525  // projectID - the id of the project to get.
  2526  func (client BaseClient) GetProject(ctx context.Context, projectID uuid.UUID) (result Project, err error) {
  2527  	if tracing.IsEnabled() {
  2528  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetProject")
  2529  		defer func() {
  2530  			sc := -1
  2531  			if result.Response.Response != nil {
  2532  				sc = result.Response.Response.StatusCode
  2533  			}
  2534  			tracing.EndSpan(ctx, sc, err)
  2535  		}()
  2536  	}
  2537  	req, err := client.GetProjectPreparer(ctx, projectID)
  2538  	if err != nil {
  2539  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetProject", nil, "Failure preparing request")
  2540  		return
  2541  	}
  2542  
  2543  	resp, err := client.GetProjectSender(req)
  2544  	if err != nil {
  2545  		result.Response = autorest.Response{Response: resp}
  2546  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetProject", resp, "Failure sending request")
  2547  		return
  2548  	}
  2549  
  2550  	result, err = client.GetProjectResponder(resp)
  2551  	if err != nil {
  2552  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetProject", resp, "Failure responding to request")
  2553  		return
  2554  	}
  2555  
  2556  	return
  2557  }
  2558  
  2559  // GetProjectPreparer prepares the GetProject request.
  2560  func (client BaseClient) GetProjectPreparer(ctx context.Context, projectID uuid.UUID) (*http.Request, error) {
  2561  	urlParameters := map[string]interface{}{
  2562  		"Endpoint": client.Endpoint,
  2563  	}
  2564  
  2565  	pathParameters := map[string]interface{}{
  2566  		"projectId": autorest.Encode("path", projectID),
  2567  	}
  2568  
  2569  	preparer := autorest.CreatePreparer(
  2570  		autorest.AsGet(),
  2571  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  2572  		autorest.WithPathParameters("/projects/{projectId}", pathParameters))
  2573  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2574  }
  2575  
  2576  // GetProjectSender sends the GetProject request. The method will close the
  2577  // http.Response Body if it receives an error.
  2578  func (client BaseClient) GetProjectSender(req *http.Request) (*http.Response, error) {
  2579  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2580  }
  2581  
  2582  // GetProjectResponder handles the response to the GetProject request. The method always
  2583  // closes the http.Response Body.
  2584  func (client BaseClient) GetProjectResponder(resp *http.Response) (result Project, err error) {
  2585  	err = autorest.Respond(
  2586  		resp,
  2587  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2588  		autorest.ByUnmarshallingJSON(&result),
  2589  		autorest.ByClosing())
  2590  	result.Response = autorest.Response{Response: resp}
  2591  	return
  2592  }
  2593  
  2594  // GetProjects sends the get projects request.
  2595  func (client BaseClient) GetProjects(ctx context.Context) (result ListProject, err error) {
  2596  	if tracing.IsEnabled() {
  2597  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetProjects")
  2598  		defer func() {
  2599  			sc := -1
  2600  			if result.Response.Response != nil {
  2601  				sc = result.Response.Response.StatusCode
  2602  			}
  2603  			tracing.EndSpan(ctx, sc, err)
  2604  		}()
  2605  	}
  2606  	req, err := client.GetProjectsPreparer(ctx)
  2607  	if err != nil {
  2608  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetProjects", nil, "Failure preparing request")
  2609  		return
  2610  	}
  2611  
  2612  	resp, err := client.GetProjectsSender(req)
  2613  	if err != nil {
  2614  		result.Response = autorest.Response{Response: resp}
  2615  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetProjects", resp, "Failure sending request")
  2616  		return
  2617  	}
  2618  
  2619  	result, err = client.GetProjectsResponder(resp)
  2620  	if err != nil {
  2621  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetProjects", resp, "Failure responding to request")
  2622  		return
  2623  	}
  2624  
  2625  	return
  2626  }
  2627  
  2628  // GetProjectsPreparer prepares the GetProjects request.
  2629  func (client BaseClient) GetProjectsPreparer(ctx context.Context) (*http.Request, error) {
  2630  	urlParameters := map[string]interface{}{
  2631  		"Endpoint": client.Endpoint,
  2632  	}
  2633  
  2634  	preparer := autorest.CreatePreparer(
  2635  		autorest.AsGet(),
  2636  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  2637  		autorest.WithPath("/projects"))
  2638  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2639  }
  2640  
  2641  // GetProjectsSender sends the GetProjects request. The method will close the
  2642  // http.Response Body if it receives an error.
  2643  func (client BaseClient) GetProjectsSender(req *http.Request) (*http.Response, error) {
  2644  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2645  }
  2646  
  2647  // GetProjectsResponder handles the response to the GetProjects request. The method always
  2648  // closes the http.Response Body.
  2649  func (client BaseClient) GetProjectsResponder(resp *http.Response) (result ListProject, err error) {
  2650  	err = autorest.Respond(
  2651  		resp,
  2652  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2653  		autorest.ByUnmarshallingJSON(&result.Value),
  2654  		autorest.ByClosing())
  2655  	result.Response = autorest.Response{Response: resp}
  2656  	return
  2657  }
  2658  
  2659  // GetTag sends the get tag request.
  2660  // Parameters:
  2661  // projectID - the project this tag belongs to.
  2662  // tagID - the tag id.
  2663  // iterationID - the iteration to retrieve this tag from. Optional, defaults to current training set.
  2664  func (client BaseClient) GetTag(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID, iterationID *uuid.UUID) (result Tag, err error) {
  2665  	if tracing.IsEnabled() {
  2666  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetTag")
  2667  		defer func() {
  2668  			sc := -1
  2669  			if result.Response.Response != nil {
  2670  				sc = result.Response.Response.StatusCode
  2671  			}
  2672  			tracing.EndSpan(ctx, sc, err)
  2673  		}()
  2674  	}
  2675  	req, err := client.GetTagPreparer(ctx, projectID, tagID, iterationID)
  2676  	if err != nil {
  2677  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTag", nil, "Failure preparing request")
  2678  		return
  2679  	}
  2680  
  2681  	resp, err := client.GetTagSender(req)
  2682  	if err != nil {
  2683  		result.Response = autorest.Response{Response: resp}
  2684  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTag", resp, "Failure sending request")
  2685  		return
  2686  	}
  2687  
  2688  	result, err = client.GetTagResponder(resp)
  2689  	if err != nil {
  2690  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTag", resp, "Failure responding to request")
  2691  		return
  2692  	}
  2693  
  2694  	return
  2695  }
  2696  
  2697  // GetTagPreparer prepares the GetTag request.
  2698  func (client BaseClient) GetTagPreparer(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID, iterationID *uuid.UUID) (*http.Request, error) {
  2699  	urlParameters := map[string]interface{}{
  2700  		"Endpoint": client.Endpoint,
  2701  	}
  2702  
  2703  	pathParameters := map[string]interface{}{
  2704  		"projectId": autorest.Encode("path", projectID),
  2705  		"tagId":     autorest.Encode("path", tagID),
  2706  	}
  2707  
  2708  	queryParameters := map[string]interface{}{}
  2709  	if iterationID != nil {
  2710  		queryParameters["iterationId"] = autorest.Encode("query", *iterationID)
  2711  	}
  2712  
  2713  	preparer := autorest.CreatePreparer(
  2714  		autorest.AsGet(),
  2715  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  2716  		autorest.WithPathParameters("/projects/{projectId}/tags/{tagId}", pathParameters),
  2717  		autorest.WithQueryParameters(queryParameters))
  2718  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2719  }
  2720  
  2721  // GetTagSender sends the GetTag request. The method will close the
  2722  // http.Response Body if it receives an error.
  2723  func (client BaseClient) GetTagSender(req *http.Request) (*http.Response, error) {
  2724  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2725  }
  2726  
  2727  // GetTagResponder handles the response to the GetTag request. The method always
  2728  // closes the http.Response Body.
  2729  func (client BaseClient) GetTagResponder(resp *http.Response) (result Tag, err error) {
  2730  	err = autorest.Respond(
  2731  		resp,
  2732  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2733  		autorest.ByUnmarshallingJSON(&result),
  2734  		autorest.ByClosing())
  2735  	result.Response = autorest.Response{Response: resp}
  2736  	return
  2737  }
  2738  
  2739  // GetTaggedImageCount the filtering is on an and/or relationship. For example, if the provided tag ids are for the
  2740  // "Dog" and
  2741  // "Cat" tags, then only images tagged with Dog and/or Cat will be returned
  2742  // Parameters:
  2743  // projectID - the project id.
  2744  // iterationID - the iteration id. Defaults to workspace.
  2745  // tagIds - a list of tags ids to filter the images to count. Defaults to all tags when null.
  2746  func (client BaseClient) GetTaggedImageCount(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, tagIds []uuid.UUID) (result Int32, err error) {
  2747  	if tracing.IsEnabled() {
  2748  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetTaggedImageCount")
  2749  		defer func() {
  2750  			sc := -1
  2751  			if result.Response.Response != nil {
  2752  				sc = result.Response.Response.StatusCode
  2753  			}
  2754  			tracing.EndSpan(ctx, sc, err)
  2755  		}()
  2756  	}
  2757  	req, err := client.GetTaggedImageCountPreparer(ctx, projectID, iterationID, tagIds)
  2758  	if err != nil {
  2759  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTaggedImageCount", nil, "Failure preparing request")
  2760  		return
  2761  	}
  2762  
  2763  	resp, err := client.GetTaggedImageCountSender(req)
  2764  	if err != nil {
  2765  		result.Response = autorest.Response{Response: resp}
  2766  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTaggedImageCount", resp, "Failure sending request")
  2767  		return
  2768  	}
  2769  
  2770  	result, err = client.GetTaggedImageCountResponder(resp)
  2771  	if err != nil {
  2772  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTaggedImageCount", resp, "Failure responding to request")
  2773  		return
  2774  	}
  2775  
  2776  	return
  2777  }
  2778  
  2779  // GetTaggedImageCountPreparer prepares the GetTaggedImageCount request.
  2780  func (client BaseClient) GetTaggedImageCountPreparer(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, tagIds []uuid.UUID) (*http.Request, error) {
  2781  	urlParameters := map[string]interface{}{
  2782  		"Endpoint": client.Endpoint,
  2783  	}
  2784  
  2785  	pathParameters := map[string]interface{}{
  2786  		"projectId": autorest.Encode("path", projectID),
  2787  	}
  2788  
  2789  	queryParameters := map[string]interface{}{}
  2790  	if iterationID != nil {
  2791  		queryParameters["iterationId"] = autorest.Encode("query", *iterationID)
  2792  	}
  2793  	if tagIds != nil && len(tagIds) > 0 {
  2794  		queryParameters["tagIds"] = autorest.Encode("query", tagIds, ",")
  2795  	}
  2796  
  2797  	preparer := autorest.CreatePreparer(
  2798  		autorest.AsGet(),
  2799  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  2800  		autorest.WithPathParameters("/projects/{projectId}/images/tagged/count", pathParameters),
  2801  		autorest.WithQueryParameters(queryParameters))
  2802  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2803  }
  2804  
  2805  // GetTaggedImageCountSender sends the GetTaggedImageCount request. The method will close the
  2806  // http.Response Body if it receives an error.
  2807  func (client BaseClient) GetTaggedImageCountSender(req *http.Request) (*http.Response, error) {
  2808  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2809  }
  2810  
  2811  // GetTaggedImageCountResponder handles the response to the GetTaggedImageCount request. The method always
  2812  // closes the http.Response Body.
  2813  func (client BaseClient) GetTaggedImageCountResponder(resp *http.Response) (result Int32, err error) {
  2814  	err = autorest.Respond(
  2815  		resp,
  2816  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2817  		autorest.ByUnmarshallingJSON(&result.Value),
  2818  		autorest.ByClosing())
  2819  	result.Response = autorest.Response{Response: resp}
  2820  	return
  2821  }
  2822  
  2823  // GetTaggedImages this API supports batching and range selection. By default it will only return first 50 images
  2824  // matching images.
  2825  // Use the {take} and {skip} parameters to control how many images to return in a given batch.
  2826  // The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and
  2827  // "Cat" tags, then only images tagged with Dog and/or Cat will be returned
  2828  // Parameters:
  2829  // projectID - the project id.
  2830  // iterationID - the iteration id. Defaults to workspace.
  2831  // tagIds - a list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20.
  2832  // orderBy - the ordering. Defaults to newest.
  2833  // take - maximum number of images to return. Defaults to 50, limited to 256.
  2834  // skip - number of images to skip before beginning the image batch. Defaults to 0.
  2835  func (client BaseClient) GetTaggedImages(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, tagIds []uuid.UUID, orderBy string, take *int32, skip *int32) (result ListImage, err error) {
  2836  	if tracing.IsEnabled() {
  2837  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetTaggedImages")
  2838  		defer func() {
  2839  			sc := -1
  2840  			if result.Response.Response != nil {
  2841  				sc = result.Response.Response.StatusCode
  2842  			}
  2843  			tracing.EndSpan(ctx, sc, err)
  2844  		}()
  2845  	}
  2846  	if err := validation.Validate([]validation.Validation{
  2847  		{TargetValue: tagIds,
  2848  			Constraints: []validation.Constraint{{Target: "tagIds", Name: validation.Null, Rule: false,
  2849  				Chain: []validation.Constraint{{Target: "tagIds", Name: validation.MaxItems, Rule: 20, Chain: nil},
  2850  					{Target: "tagIds", Name: validation.MinItems, Rule: 0, Chain: nil},
  2851  				}}}},
  2852  		{TargetValue: take,
  2853  			Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
  2854  				Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(256), Chain: nil},
  2855  					{Target: "take", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
  2856  				}}}}}); err != nil {
  2857  		return result, validation.NewError("training.BaseClient", "GetTaggedImages", err.Error())
  2858  	}
  2859  
  2860  	req, err := client.GetTaggedImagesPreparer(ctx, projectID, iterationID, tagIds, orderBy, take, skip)
  2861  	if err != nil {
  2862  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTaggedImages", nil, "Failure preparing request")
  2863  		return
  2864  	}
  2865  
  2866  	resp, err := client.GetTaggedImagesSender(req)
  2867  	if err != nil {
  2868  		result.Response = autorest.Response{Response: resp}
  2869  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTaggedImages", resp, "Failure sending request")
  2870  		return
  2871  	}
  2872  
  2873  	result, err = client.GetTaggedImagesResponder(resp)
  2874  	if err != nil {
  2875  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTaggedImages", resp, "Failure responding to request")
  2876  		return
  2877  	}
  2878  
  2879  	return
  2880  }
  2881  
  2882  // GetTaggedImagesPreparer prepares the GetTaggedImages request.
  2883  func (client BaseClient) GetTaggedImagesPreparer(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, tagIds []uuid.UUID, orderBy string, take *int32, skip *int32) (*http.Request, error) {
  2884  	urlParameters := map[string]interface{}{
  2885  		"Endpoint": client.Endpoint,
  2886  	}
  2887  
  2888  	pathParameters := map[string]interface{}{
  2889  		"projectId": autorest.Encode("path", projectID),
  2890  	}
  2891  
  2892  	queryParameters := map[string]interface{}{}
  2893  	if iterationID != nil {
  2894  		queryParameters["iterationId"] = autorest.Encode("query", *iterationID)
  2895  	}
  2896  	if tagIds != nil && len(tagIds) > 0 {
  2897  		queryParameters["tagIds"] = autorest.Encode("query", tagIds, ",")
  2898  	}
  2899  	if len(string(orderBy)) > 0 {
  2900  		queryParameters["orderBy"] = autorest.Encode("query", orderBy)
  2901  	}
  2902  	if take != nil {
  2903  		queryParameters["take"] = autorest.Encode("query", *take)
  2904  	} else {
  2905  		queryParameters["take"] = autorest.Encode("query", 50)
  2906  	}
  2907  	if skip != nil {
  2908  		queryParameters["skip"] = autorest.Encode("query", *skip)
  2909  	} else {
  2910  		queryParameters["skip"] = autorest.Encode("query", 0)
  2911  	}
  2912  
  2913  	preparer := autorest.CreatePreparer(
  2914  		autorest.AsGet(),
  2915  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  2916  		autorest.WithPathParameters("/projects/{projectId}/images/tagged", pathParameters),
  2917  		autorest.WithQueryParameters(queryParameters))
  2918  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2919  }
  2920  
  2921  // GetTaggedImagesSender sends the GetTaggedImages request. The method will close the
  2922  // http.Response Body if it receives an error.
  2923  func (client BaseClient) GetTaggedImagesSender(req *http.Request) (*http.Response, error) {
  2924  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2925  }
  2926  
  2927  // GetTaggedImagesResponder handles the response to the GetTaggedImages request. The method always
  2928  // closes the http.Response Body.
  2929  func (client BaseClient) GetTaggedImagesResponder(resp *http.Response) (result ListImage, err error) {
  2930  	err = autorest.Respond(
  2931  		resp,
  2932  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  2933  		autorest.ByUnmarshallingJSON(&result.Value),
  2934  		autorest.ByClosing())
  2935  	result.Response = autorest.Response{Response: resp}
  2936  	return
  2937  }
  2938  
  2939  // GetTags sends the get tags request.
  2940  // Parameters:
  2941  // projectID - the project id.
  2942  // iterationID - the iteration id. Defaults to workspace.
  2943  func (client BaseClient) GetTags(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID) (result ListTag, err error) {
  2944  	if tracing.IsEnabled() {
  2945  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetTags")
  2946  		defer func() {
  2947  			sc := -1
  2948  			if result.Response.Response != nil {
  2949  				sc = result.Response.Response.StatusCode
  2950  			}
  2951  			tracing.EndSpan(ctx, sc, err)
  2952  		}()
  2953  	}
  2954  	req, err := client.GetTagsPreparer(ctx, projectID, iterationID)
  2955  	if err != nil {
  2956  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTags", nil, "Failure preparing request")
  2957  		return
  2958  	}
  2959  
  2960  	resp, err := client.GetTagsSender(req)
  2961  	if err != nil {
  2962  		result.Response = autorest.Response{Response: resp}
  2963  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTags", resp, "Failure sending request")
  2964  		return
  2965  	}
  2966  
  2967  	result, err = client.GetTagsResponder(resp)
  2968  	if err != nil {
  2969  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetTags", resp, "Failure responding to request")
  2970  		return
  2971  	}
  2972  
  2973  	return
  2974  }
  2975  
  2976  // GetTagsPreparer prepares the GetTags request.
  2977  func (client BaseClient) GetTagsPreparer(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID) (*http.Request, error) {
  2978  	urlParameters := map[string]interface{}{
  2979  		"Endpoint": client.Endpoint,
  2980  	}
  2981  
  2982  	pathParameters := map[string]interface{}{
  2983  		"projectId": autorest.Encode("path", projectID),
  2984  	}
  2985  
  2986  	queryParameters := map[string]interface{}{}
  2987  	if iterationID != nil {
  2988  		queryParameters["iterationId"] = autorest.Encode("query", *iterationID)
  2989  	}
  2990  
  2991  	preparer := autorest.CreatePreparer(
  2992  		autorest.AsGet(),
  2993  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  2994  		autorest.WithPathParameters("/projects/{projectId}/tags", pathParameters),
  2995  		autorest.WithQueryParameters(queryParameters))
  2996  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  2997  }
  2998  
  2999  // GetTagsSender sends the GetTags request. The method will close the
  3000  // http.Response Body if it receives an error.
  3001  func (client BaseClient) GetTagsSender(req *http.Request) (*http.Response, error) {
  3002  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3003  }
  3004  
  3005  // GetTagsResponder handles the response to the GetTags request. The method always
  3006  // closes the http.Response Body.
  3007  func (client BaseClient) GetTagsResponder(resp *http.Response) (result ListTag, err error) {
  3008  	err = autorest.Respond(
  3009  		resp,
  3010  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3011  		autorest.ByUnmarshallingJSON(&result.Value),
  3012  		autorest.ByClosing())
  3013  	result.Response = autorest.Response{Response: resp}
  3014  	return
  3015  }
  3016  
  3017  // GetUntaggedImageCount this API returns the images which have no tags for a given project and optionally an
  3018  // iteration. If no iteration is specified the
  3019  // current workspace is used.
  3020  // Parameters:
  3021  // projectID - the project id.
  3022  // iterationID - the iteration id. Defaults to workspace.
  3023  func (client BaseClient) GetUntaggedImageCount(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID) (result Int32, err error) {
  3024  	if tracing.IsEnabled() {
  3025  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetUntaggedImageCount")
  3026  		defer func() {
  3027  			sc := -1
  3028  			if result.Response.Response != nil {
  3029  				sc = result.Response.Response.StatusCode
  3030  			}
  3031  			tracing.EndSpan(ctx, sc, err)
  3032  		}()
  3033  	}
  3034  	req, err := client.GetUntaggedImageCountPreparer(ctx, projectID, iterationID)
  3035  	if err != nil {
  3036  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetUntaggedImageCount", nil, "Failure preparing request")
  3037  		return
  3038  	}
  3039  
  3040  	resp, err := client.GetUntaggedImageCountSender(req)
  3041  	if err != nil {
  3042  		result.Response = autorest.Response{Response: resp}
  3043  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetUntaggedImageCount", resp, "Failure sending request")
  3044  		return
  3045  	}
  3046  
  3047  	result, err = client.GetUntaggedImageCountResponder(resp)
  3048  	if err != nil {
  3049  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetUntaggedImageCount", resp, "Failure responding to request")
  3050  		return
  3051  	}
  3052  
  3053  	return
  3054  }
  3055  
  3056  // GetUntaggedImageCountPreparer prepares the GetUntaggedImageCount request.
  3057  func (client BaseClient) GetUntaggedImageCountPreparer(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID) (*http.Request, error) {
  3058  	urlParameters := map[string]interface{}{
  3059  		"Endpoint": client.Endpoint,
  3060  	}
  3061  
  3062  	pathParameters := map[string]interface{}{
  3063  		"projectId": autorest.Encode("path", projectID),
  3064  	}
  3065  
  3066  	queryParameters := map[string]interface{}{}
  3067  	if iterationID != nil {
  3068  		queryParameters["iterationId"] = autorest.Encode("query", *iterationID)
  3069  	}
  3070  
  3071  	preparer := autorest.CreatePreparer(
  3072  		autorest.AsGet(),
  3073  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  3074  		autorest.WithPathParameters("/projects/{projectId}/images/untagged/count", pathParameters),
  3075  		autorest.WithQueryParameters(queryParameters))
  3076  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  3077  }
  3078  
  3079  // GetUntaggedImageCountSender sends the GetUntaggedImageCount request. The method will close the
  3080  // http.Response Body if it receives an error.
  3081  func (client BaseClient) GetUntaggedImageCountSender(req *http.Request) (*http.Response, error) {
  3082  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3083  }
  3084  
  3085  // GetUntaggedImageCountResponder handles the response to the GetUntaggedImageCount request. The method always
  3086  // closes the http.Response Body.
  3087  func (client BaseClient) GetUntaggedImageCountResponder(resp *http.Response) (result Int32, err error) {
  3088  	err = autorest.Respond(
  3089  		resp,
  3090  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3091  		autorest.ByUnmarshallingJSON(&result.Value),
  3092  		autorest.ByClosing())
  3093  	result.Response = autorest.Response{Response: resp}
  3094  	return
  3095  }
  3096  
  3097  // GetUntaggedImages this API supports batching and range selection. By default it will only return first 50 images
  3098  // matching images.
  3099  // Use the {take} and {skip} parameters to control how many images to return in a given batch.
  3100  // Parameters:
  3101  // projectID - the project id.
  3102  // iterationID - the iteration id. Defaults to workspace.
  3103  // orderBy - the ordering. Defaults to newest.
  3104  // take - maximum number of images to return. Defaults to 50, limited to 256.
  3105  // skip - number of images to skip before beginning the image batch. Defaults to 0.
  3106  func (client BaseClient) GetUntaggedImages(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, orderBy string, take *int32, skip *int32) (result ListImage, err error) {
  3107  	if tracing.IsEnabled() {
  3108  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetUntaggedImages")
  3109  		defer func() {
  3110  			sc := -1
  3111  			if result.Response.Response != nil {
  3112  				sc = result.Response.Response.StatusCode
  3113  			}
  3114  			tracing.EndSpan(ctx, sc, err)
  3115  		}()
  3116  	}
  3117  	if err := validation.Validate([]validation.Validation{
  3118  		{TargetValue: take,
  3119  			Constraints: []validation.Constraint{{Target: "take", Name: validation.Null, Rule: false,
  3120  				Chain: []validation.Constraint{{Target: "take", Name: validation.InclusiveMaximum, Rule: int64(256), Chain: nil},
  3121  					{Target: "take", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
  3122  				}}}}}); err != nil {
  3123  		return result, validation.NewError("training.BaseClient", "GetUntaggedImages", err.Error())
  3124  	}
  3125  
  3126  	req, err := client.GetUntaggedImagesPreparer(ctx, projectID, iterationID, orderBy, take, skip)
  3127  	if err != nil {
  3128  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetUntaggedImages", nil, "Failure preparing request")
  3129  		return
  3130  	}
  3131  
  3132  	resp, err := client.GetUntaggedImagesSender(req)
  3133  	if err != nil {
  3134  		result.Response = autorest.Response{Response: resp}
  3135  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetUntaggedImages", resp, "Failure sending request")
  3136  		return
  3137  	}
  3138  
  3139  	result, err = client.GetUntaggedImagesResponder(resp)
  3140  	if err != nil {
  3141  		err = autorest.NewErrorWithError(err, "training.BaseClient", "GetUntaggedImages", resp, "Failure responding to request")
  3142  		return
  3143  	}
  3144  
  3145  	return
  3146  }
  3147  
  3148  // GetUntaggedImagesPreparer prepares the GetUntaggedImages request.
  3149  func (client BaseClient) GetUntaggedImagesPreparer(ctx context.Context, projectID uuid.UUID, iterationID *uuid.UUID, orderBy string, take *int32, skip *int32) (*http.Request, error) {
  3150  	urlParameters := map[string]interface{}{
  3151  		"Endpoint": client.Endpoint,
  3152  	}
  3153  
  3154  	pathParameters := map[string]interface{}{
  3155  		"projectId": autorest.Encode("path", projectID),
  3156  	}
  3157  
  3158  	queryParameters := map[string]interface{}{}
  3159  	if iterationID != nil {
  3160  		queryParameters["iterationId"] = autorest.Encode("query", *iterationID)
  3161  	}
  3162  	if len(string(orderBy)) > 0 {
  3163  		queryParameters["orderBy"] = autorest.Encode("query", orderBy)
  3164  	}
  3165  	if take != nil {
  3166  		queryParameters["take"] = autorest.Encode("query", *take)
  3167  	} else {
  3168  		queryParameters["take"] = autorest.Encode("query", 50)
  3169  	}
  3170  	if skip != nil {
  3171  		queryParameters["skip"] = autorest.Encode("query", *skip)
  3172  	} else {
  3173  		queryParameters["skip"] = autorest.Encode("query", 0)
  3174  	}
  3175  
  3176  	preparer := autorest.CreatePreparer(
  3177  		autorest.AsGet(),
  3178  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  3179  		autorest.WithPathParameters("/projects/{projectId}/images/untagged", pathParameters),
  3180  		autorest.WithQueryParameters(queryParameters))
  3181  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  3182  }
  3183  
  3184  // GetUntaggedImagesSender sends the GetUntaggedImages request. The method will close the
  3185  // http.Response Body if it receives an error.
  3186  func (client BaseClient) GetUntaggedImagesSender(req *http.Request) (*http.Response, error) {
  3187  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3188  }
  3189  
  3190  // GetUntaggedImagesResponder handles the response to the GetUntaggedImages request. The method always
  3191  // closes the http.Response Body.
  3192  func (client BaseClient) GetUntaggedImagesResponder(resp *http.Response) (result ListImage, err error) {
  3193  	err = autorest.Respond(
  3194  		resp,
  3195  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3196  		autorest.ByUnmarshallingJSON(&result.Value),
  3197  		autorest.ByClosing())
  3198  	result.Response = autorest.Response{Response: resp}
  3199  	return
  3200  }
  3201  
  3202  // ImportProject sends the import project request.
  3203  // Parameters:
  3204  // tokenParameter - token generated from the export project call.
  3205  // name - optional, name of the project to use instead of auto-generated name.
  3206  func (client BaseClient) ImportProject(ctx context.Context, tokenParameter string, name string) (result Project, err error) {
  3207  	if tracing.IsEnabled() {
  3208  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ImportProject")
  3209  		defer func() {
  3210  			sc := -1
  3211  			if result.Response.Response != nil {
  3212  				sc = result.Response.Response.StatusCode
  3213  			}
  3214  			tracing.EndSpan(ctx, sc, err)
  3215  		}()
  3216  	}
  3217  	req, err := client.ImportProjectPreparer(ctx, tokenParameter, name)
  3218  	if err != nil {
  3219  		err = autorest.NewErrorWithError(err, "training.BaseClient", "ImportProject", nil, "Failure preparing request")
  3220  		return
  3221  	}
  3222  
  3223  	resp, err := client.ImportProjectSender(req)
  3224  	if err != nil {
  3225  		result.Response = autorest.Response{Response: resp}
  3226  		err = autorest.NewErrorWithError(err, "training.BaseClient", "ImportProject", resp, "Failure sending request")
  3227  		return
  3228  	}
  3229  
  3230  	result, err = client.ImportProjectResponder(resp)
  3231  	if err != nil {
  3232  		err = autorest.NewErrorWithError(err, "training.BaseClient", "ImportProject", resp, "Failure responding to request")
  3233  		return
  3234  	}
  3235  
  3236  	return
  3237  }
  3238  
  3239  // ImportProjectPreparer prepares the ImportProject request.
  3240  func (client BaseClient) ImportProjectPreparer(ctx context.Context, tokenParameter string, name string) (*http.Request, error) {
  3241  	urlParameters := map[string]interface{}{
  3242  		"Endpoint": client.Endpoint,
  3243  	}
  3244  
  3245  	queryParameters := map[string]interface{}{
  3246  		"token": autorest.Encode("query", tokenParameter),
  3247  	}
  3248  	if len(name) > 0 {
  3249  		queryParameters["name"] = autorest.Encode("query", name)
  3250  	}
  3251  
  3252  	preparer := autorest.CreatePreparer(
  3253  		autorest.AsPost(),
  3254  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  3255  		autorest.WithPath("/projects/import"),
  3256  		autorest.WithQueryParameters(queryParameters))
  3257  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  3258  }
  3259  
  3260  // ImportProjectSender sends the ImportProject request. The method will close the
  3261  // http.Response Body if it receives an error.
  3262  func (client BaseClient) ImportProjectSender(req *http.Request) (*http.Response, error) {
  3263  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3264  }
  3265  
  3266  // ImportProjectResponder handles the response to the ImportProject request. The method always
  3267  // closes the http.Response Body.
  3268  func (client BaseClient) ImportProjectResponder(resp *http.Response) (result Project, err error) {
  3269  	err = autorest.Respond(
  3270  		resp,
  3271  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3272  		autorest.ByUnmarshallingJSON(&result),
  3273  		autorest.ByClosing())
  3274  	result.Response = autorest.Response{Response: resp}
  3275  	return
  3276  }
  3277  
  3278  // PublishIteration sends the publish iteration request.
  3279  // Parameters:
  3280  // projectID - the project id.
  3281  // iterationID - the iteration id.
  3282  // publishName - the name to give the published iteration.
  3283  // predictionID - the id of the prediction resource to publish to.
  3284  // overwrite - whether to overwrite the published model with the given name (default: false).
  3285  func (client BaseClient) PublishIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, publishName string, predictionID string, overwrite *bool) (result Bool, err error) {
  3286  	if tracing.IsEnabled() {
  3287  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PublishIteration")
  3288  		defer func() {
  3289  			sc := -1
  3290  			if result.Response.Response != nil {
  3291  				sc = result.Response.Response.StatusCode
  3292  			}
  3293  			tracing.EndSpan(ctx, sc, err)
  3294  		}()
  3295  	}
  3296  	req, err := client.PublishIterationPreparer(ctx, projectID, iterationID, publishName, predictionID, overwrite)
  3297  	if err != nil {
  3298  		err = autorest.NewErrorWithError(err, "training.BaseClient", "PublishIteration", nil, "Failure preparing request")
  3299  		return
  3300  	}
  3301  
  3302  	resp, err := client.PublishIterationSender(req)
  3303  	if err != nil {
  3304  		result.Response = autorest.Response{Response: resp}
  3305  		err = autorest.NewErrorWithError(err, "training.BaseClient", "PublishIteration", resp, "Failure sending request")
  3306  		return
  3307  	}
  3308  
  3309  	result, err = client.PublishIterationResponder(resp)
  3310  	if err != nil {
  3311  		err = autorest.NewErrorWithError(err, "training.BaseClient", "PublishIteration", resp, "Failure responding to request")
  3312  		return
  3313  	}
  3314  
  3315  	return
  3316  }
  3317  
  3318  // PublishIterationPreparer prepares the PublishIteration request.
  3319  func (client BaseClient) PublishIterationPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, publishName string, predictionID string, overwrite *bool) (*http.Request, error) {
  3320  	urlParameters := map[string]interface{}{
  3321  		"Endpoint": client.Endpoint,
  3322  	}
  3323  
  3324  	pathParameters := map[string]interface{}{
  3325  		"iterationId": autorest.Encode("path", iterationID),
  3326  		"projectId":   autorest.Encode("path", projectID),
  3327  	}
  3328  
  3329  	queryParameters := map[string]interface{}{
  3330  		"predictionId": autorest.Encode("query", predictionID),
  3331  		"publishName":  autorest.Encode("query", publishName),
  3332  	}
  3333  	if overwrite != nil {
  3334  		queryParameters["overwrite"] = autorest.Encode("query", *overwrite)
  3335  	}
  3336  
  3337  	preparer := autorest.CreatePreparer(
  3338  		autorest.AsPost(),
  3339  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  3340  		autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}/publish", pathParameters),
  3341  		autorest.WithQueryParameters(queryParameters))
  3342  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  3343  }
  3344  
  3345  // PublishIterationSender sends the PublishIteration request. The method will close the
  3346  // http.Response Body if it receives an error.
  3347  func (client BaseClient) PublishIterationSender(req *http.Request) (*http.Response, error) {
  3348  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3349  }
  3350  
  3351  // PublishIterationResponder handles the response to the PublishIteration request. The method always
  3352  // closes the http.Response Body.
  3353  func (client BaseClient) PublishIterationResponder(resp *http.Response) (result Bool, err error) {
  3354  	err = autorest.Respond(
  3355  		resp,
  3356  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3357  		autorest.ByUnmarshallingJSON(&result.Value),
  3358  		autorest.ByClosing())
  3359  	result.Response = autorest.Response{Response: resp}
  3360  	return
  3361  }
  3362  
  3363  // QueryPredictions sends the query predictions request.
  3364  // Parameters:
  3365  // projectID - the project id.
  3366  // query - parameters used to query the predictions. Limited to combining 2 tags.
  3367  func (client BaseClient) QueryPredictions(ctx context.Context, projectID uuid.UUID, query PredictionQueryToken) (result PredictionQueryResult, err error) {
  3368  	if tracing.IsEnabled() {
  3369  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.QueryPredictions")
  3370  		defer func() {
  3371  			sc := -1
  3372  			if result.Response.Response != nil {
  3373  				sc = result.Response.Response.StatusCode
  3374  			}
  3375  			tracing.EndSpan(ctx, sc, err)
  3376  		}()
  3377  	}
  3378  	req, err := client.QueryPredictionsPreparer(ctx, projectID, query)
  3379  	if err != nil {
  3380  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QueryPredictions", nil, "Failure preparing request")
  3381  		return
  3382  	}
  3383  
  3384  	resp, err := client.QueryPredictionsSender(req)
  3385  	if err != nil {
  3386  		result.Response = autorest.Response{Response: resp}
  3387  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QueryPredictions", resp, "Failure sending request")
  3388  		return
  3389  	}
  3390  
  3391  	result, err = client.QueryPredictionsResponder(resp)
  3392  	if err != nil {
  3393  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QueryPredictions", resp, "Failure responding to request")
  3394  		return
  3395  	}
  3396  
  3397  	return
  3398  }
  3399  
  3400  // QueryPredictionsPreparer prepares the QueryPredictions request.
  3401  func (client BaseClient) QueryPredictionsPreparer(ctx context.Context, projectID uuid.UUID, query PredictionQueryToken) (*http.Request, error) {
  3402  	urlParameters := map[string]interface{}{
  3403  		"Endpoint": client.Endpoint,
  3404  	}
  3405  
  3406  	pathParameters := map[string]interface{}{
  3407  		"projectId": autorest.Encode("path", projectID),
  3408  	}
  3409  
  3410  	preparer := autorest.CreatePreparer(
  3411  		autorest.AsContentType("application/json; charset=utf-8"),
  3412  		autorest.AsPost(),
  3413  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  3414  		autorest.WithPathParameters("/projects/{projectId}/predictions/query", pathParameters),
  3415  		autorest.WithJSON(query))
  3416  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  3417  }
  3418  
  3419  // QueryPredictionsSender sends the QueryPredictions request. The method will close the
  3420  // http.Response Body if it receives an error.
  3421  func (client BaseClient) QueryPredictionsSender(req *http.Request) (*http.Response, error) {
  3422  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3423  }
  3424  
  3425  // QueryPredictionsResponder handles the response to the QueryPredictions request. The method always
  3426  // closes the http.Response Body.
  3427  func (client BaseClient) QueryPredictionsResponder(resp *http.Response) (result PredictionQueryResult, err error) {
  3428  	err = autorest.Respond(
  3429  		resp,
  3430  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3431  		autorest.ByUnmarshallingJSON(&result),
  3432  		autorest.ByClosing())
  3433  	result.Response = autorest.Response{Response: resp}
  3434  	return
  3435  }
  3436  
  3437  // QuerySuggestedImageCount this API takes in tagIds to get count of untagged images per suggested tags for a given
  3438  // threshold.
  3439  // Parameters:
  3440  // projectID - the project id.
  3441  // iterationID - iterationId to use for the suggested tags and regions.
  3442  // query - model that contains tagIds, threshold and projectType to query by.
  3443  func (client BaseClient) QuerySuggestedImageCount(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, query TagFilter) (result SetInt32, err error) {
  3444  	if tracing.IsEnabled() {
  3445  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.QuerySuggestedImageCount")
  3446  		defer func() {
  3447  			sc := -1
  3448  			if result.Response.Response != nil {
  3449  				sc = result.Response.Response.StatusCode
  3450  			}
  3451  			tracing.EndSpan(ctx, sc, err)
  3452  		}()
  3453  	}
  3454  	req, err := client.QuerySuggestedImageCountPreparer(ctx, projectID, iterationID, query)
  3455  	if err != nil {
  3456  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QuerySuggestedImageCount", nil, "Failure preparing request")
  3457  		return
  3458  	}
  3459  
  3460  	resp, err := client.QuerySuggestedImageCountSender(req)
  3461  	if err != nil {
  3462  		result.Response = autorest.Response{Response: resp}
  3463  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QuerySuggestedImageCount", resp, "Failure sending request")
  3464  		return
  3465  	}
  3466  
  3467  	result, err = client.QuerySuggestedImageCountResponder(resp)
  3468  	if err != nil {
  3469  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QuerySuggestedImageCount", resp, "Failure responding to request")
  3470  		return
  3471  	}
  3472  
  3473  	return
  3474  }
  3475  
  3476  // QuerySuggestedImageCountPreparer prepares the QuerySuggestedImageCount request.
  3477  func (client BaseClient) QuerySuggestedImageCountPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, query TagFilter) (*http.Request, error) {
  3478  	urlParameters := map[string]interface{}{
  3479  		"Endpoint": client.Endpoint,
  3480  	}
  3481  
  3482  	pathParameters := map[string]interface{}{
  3483  		"projectId": autorest.Encode("path", projectID),
  3484  	}
  3485  
  3486  	queryParameters := map[string]interface{}{
  3487  		"iterationId": autorest.Encode("query", iterationID),
  3488  	}
  3489  
  3490  	preparer := autorest.CreatePreparer(
  3491  		autorest.AsContentType("application/json; charset=utf-8"),
  3492  		autorest.AsPost(),
  3493  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  3494  		autorest.WithPathParameters("/projects/{projectId}/images/suggested/count", pathParameters),
  3495  		autorest.WithJSON(query),
  3496  		autorest.WithQueryParameters(queryParameters))
  3497  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  3498  }
  3499  
  3500  // QuerySuggestedImageCountSender sends the QuerySuggestedImageCount request. The method will close the
  3501  // http.Response Body if it receives an error.
  3502  func (client BaseClient) QuerySuggestedImageCountSender(req *http.Request) (*http.Response, error) {
  3503  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3504  }
  3505  
  3506  // QuerySuggestedImageCountResponder handles the response to the QuerySuggestedImageCount request. The method always
  3507  // closes the http.Response Body.
  3508  func (client BaseClient) QuerySuggestedImageCountResponder(resp *http.Response) (result SetInt32, err error) {
  3509  	err = autorest.Respond(
  3510  		resp,
  3511  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3512  		autorest.ByUnmarshallingJSON(&result.Value),
  3513  		autorest.ByClosing())
  3514  	result.Response = autorest.Response{Response: resp}
  3515  	return
  3516  }
  3517  
  3518  // QuerySuggestedImages this API will fetch untagged images filtered by suggested tags Ids. It returns an empty array
  3519  // if no images are found.
  3520  // Parameters:
  3521  // projectID - the project id.
  3522  // iterationID - iterationId to use for the suggested tags and regions.
  3523  // query - contains properties we need to query suggested images.
  3524  func (client BaseClient) QuerySuggestedImages(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, query SuggestedTagAndRegionQueryToken) (result SuggestedTagAndRegionQuery, err error) {
  3525  	if tracing.IsEnabled() {
  3526  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.QuerySuggestedImages")
  3527  		defer func() {
  3528  			sc := -1
  3529  			if result.Response.Response != nil {
  3530  				sc = result.Response.Response.StatusCode
  3531  			}
  3532  			tracing.EndSpan(ctx, sc, err)
  3533  		}()
  3534  	}
  3535  	req, err := client.QuerySuggestedImagesPreparer(ctx, projectID, iterationID, query)
  3536  	if err != nil {
  3537  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QuerySuggestedImages", nil, "Failure preparing request")
  3538  		return
  3539  	}
  3540  
  3541  	resp, err := client.QuerySuggestedImagesSender(req)
  3542  	if err != nil {
  3543  		result.Response = autorest.Response{Response: resp}
  3544  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QuerySuggestedImages", resp, "Failure sending request")
  3545  		return
  3546  	}
  3547  
  3548  	result, err = client.QuerySuggestedImagesResponder(resp)
  3549  	if err != nil {
  3550  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QuerySuggestedImages", resp, "Failure responding to request")
  3551  		return
  3552  	}
  3553  
  3554  	return
  3555  }
  3556  
  3557  // QuerySuggestedImagesPreparer prepares the QuerySuggestedImages request.
  3558  func (client BaseClient) QuerySuggestedImagesPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, query SuggestedTagAndRegionQueryToken) (*http.Request, error) {
  3559  	urlParameters := map[string]interface{}{
  3560  		"Endpoint": client.Endpoint,
  3561  	}
  3562  
  3563  	pathParameters := map[string]interface{}{
  3564  		"projectId": autorest.Encode("path", projectID),
  3565  	}
  3566  
  3567  	queryParameters := map[string]interface{}{
  3568  		"iterationId": autorest.Encode("query", iterationID),
  3569  	}
  3570  
  3571  	preparer := autorest.CreatePreparer(
  3572  		autorest.AsContentType("application/json; charset=utf-8"),
  3573  		autorest.AsPost(),
  3574  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  3575  		autorest.WithPathParameters("/projects/{projectId}/images/suggested", pathParameters),
  3576  		autorest.WithJSON(query),
  3577  		autorest.WithQueryParameters(queryParameters))
  3578  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  3579  }
  3580  
  3581  // QuerySuggestedImagesSender sends the QuerySuggestedImages request. The method will close the
  3582  // http.Response Body if it receives an error.
  3583  func (client BaseClient) QuerySuggestedImagesSender(req *http.Request) (*http.Response, error) {
  3584  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3585  }
  3586  
  3587  // QuerySuggestedImagesResponder handles the response to the QuerySuggestedImages request. The method always
  3588  // closes the http.Response Body.
  3589  func (client BaseClient) QuerySuggestedImagesResponder(resp *http.Response) (result SuggestedTagAndRegionQuery, err error) {
  3590  	err = autorest.Respond(
  3591  		resp,
  3592  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3593  		autorest.ByUnmarshallingJSON(&result),
  3594  		autorest.ByClosing())
  3595  	result.Response = autorest.Response{Response: resp}
  3596  	return
  3597  }
  3598  
  3599  // QuickTestImage sends the quick test image request.
  3600  // Parameters:
  3601  // projectID - the project id.
  3602  // imageData - binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB.
  3603  // iterationID - optional. Specifies the id of a particular iteration to evaluate against.
  3604  // The default iteration for the project will be used when not specified.
  3605  // store - optional. Specifies whether or not to store the result of this prediction. The default is true, to
  3606  // store.
  3607  func (client BaseClient) QuickTestImage(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, iterationID *uuid.UUID, store *bool) (result ImagePrediction, err error) {
  3608  	if tracing.IsEnabled() {
  3609  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.QuickTestImage")
  3610  		defer func() {
  3611  			sc := -1
  3612  			if result.Response.Response != nil {
  3613  				sc = result.Response.Response.StatusCode
  3614  			}
  3615  			tracing.EndSpan(ctx, sc, err)
  3616  		}()
  3617  	}
  3618  	req, err := client.QuickTestImagePreparer(ctx, projectID, imageData, iterationID, store)
  3619  	if err != nil {
  3620  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QuickTestImage", nil, "Failure preparing request")
  3621  		return
  3622  	}
  3623  
  3624  	resp, err := client.QuickTestImageSender(req)
  3625  	if err != nil {
  3626  		result.Response = autorest.Response{Response: resp}
  3627  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QuickTestImage", resp, "Failure sending request")
  3628  		return
  3629  	}
  3630  
  3631  	result, err = client.QuickTestImageResponder(resp)
  3632  	if err != nil {
  3633  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QuickTestImage", resp, "Failure responding to request")
  3634  		return
  3635  	}
  3636  
  3637  	return
  3638  }
  3639  
  3640  // QuickTestImagePreparer prepares the QuickTestImage request.
  3641  func (client BaseClient) QuickTestImagePreparer(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, iterationID *uuid.UUID, store *bool) (*http.Request, error) {
  3642  	urlParameters := map[string]interface{}{
  3643  		"Endpoint": client.Endpoint,
  3644  	}
  3645  
  3646  	pathParameters := map[string]interface{}{
  3647  		"projectId": autorest.Encode("path", projectID),
  3648  	}
  3649  
  3650  	queryParameters := map[string]interface{}{}
  3651  	if iterationID != nil {
  3652  		queryParameters["iterationId"] = autorest.Encode("query", *iterationID)
  3653  	}
  3654  	if store != nil {
  3655  		queryParameters["store"] = autorest.Encode("query", *store)
  3656  	} else {
  3657  		queryParameters["store"] = autorest.Encode("query", true)
  3658  	}
  3659  
  3660  	formDataParameters := map[string]interface{}{
  3661  		"imageData": imageData,
  3662  	}
  3663  
  3664  	preparer := autorest.CreatePreparer(
  3665  		autorest.AsPost(),
  3666  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  3667  		autorest.WithPathParameters("/projects/{projectId}/quicktest/image", pathParameters),
  3668  		autorest.WithQueryParameters(queryParameters),
  3669  		autorest.WithMultiPartFormData(formDataParameters))
  3670  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  3671  }
  3672  
  3673  // QuickTestImageSender sends the QuickTestImage request. The method will close the
  3674  // http.Response Body if it receives an error.
  3675  func (client BaseClient) QuickTestImageSender(req *http.Request) (*http.Response, error) {
  3676  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3677  }
  3678  
  3679  // QuickTestImageResponder handles the response to the QuickTestImage request. The method always
  3680  // closes the http.Response Body.
  3681  func (client BaseClient) QuickTestImageResponder(resp *http.Response) (result ImagePrediction, err error) {
  3682  	err = autorest.Respond(
  3683  		resp,
  3684  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3685  		autorest.ByUnmarshallingJSON(&result),
  3686  		autorest.ByClosing())
  3687  	result.Response = autorest.Response{Response: resp}
  3688  	return
  3689  }
  3690  
  3691  // QuickTestImageURL sends the quick test image url request.
  3692  // Parameters:
  3693  // projectID - the project to evaluate against.
  3694  // imageURL - an ImageUrl that contains the url of the image to be evaluated.
  3695  // iterationID - optional. Specifies the id of a particular iteration to evaluate against.
  3696  // The default iteration for the project will be used when not specified.
  3697  // store - optional. Specifies whether or not to store the result of this prediction. The default is true, to
  3698  // store.
  3699  func (client BaseClient) QuickTestImageURL(ctx context.Context, projectID uuid.UUID, imageURL ImageURL, iterationID *uuid.UUID, store *bool) (result ImagePrediction, err error) {
  3700  	if tracing.IsEnabled() {
  3701  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.QuickTestImageURL")
  3702  		defer func() {
  3703  			sc := -1
  3704  			if result.Response.Response != nil {
  3705  				sc = result.Response.Response.StatusCode
  3706  			}
  3707  			tracing.EndSpan(ctx, sc, err)
  3708  		}()
  3709  	}
  3710  	if err := validation.Validate([]validation.Validation{
  3711  		{TargetValue: imageURL,
  3712  			Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
  3713  		return result, validation.NewError("training.BaseClient", "QuickTestImageURL", err.Error())
  3714  	}
  3715  
  3716  	req, err := client.QuickTestImageURLPreparer(ctx, projectID, imageURL, iterationID, store)
  3717  	if err != nil {
  3718  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QuickTestImageURL", nil, "Failure preparing request")
  3719  		return
  3720  	}
  3721  
  3722  	resp, err := client.QuickTestImageURLSender(req)
  3723  	if err != nil {
  3724  		result.Response = autorest.Response{Response: resp}
  3725  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QuickTestImageURL", resp, "Failure sending request")
  3726  		return
  3727  	}
  3728  
  3729  	result, err = client.QuickTestImageURLResponder(resp)
  3730  	if err != nil {
  3731  		err = autorest.NewErrorWithError(err, "training.BaseClient", "QuickTestImageURL", resp, "Failure responding to request")
  3732  		return
  3733  	}
  3734  
  3735  	return
  3736  }
  3737  
  3738  // QuickTestImageURLPreparer prepares the QuickTestImageURL request.
  3739  func (client BaseClient) QuickTestImageURLPreparer(ctx context.Context, projectID uuid.UUID, imageURL ImageURL, iterationID *uuid.UUID, store *bool) (*http.Request, error) {
  3740  	urlParameters := map[string]interface{}{
  3741  		"Endpoint": client.Endpoint,
  3742  	}
  3743  
  3744  	pathParameters := map[string]interface{}{
  3745  		"projectId": autorest.Encode("path", projectID),
  3746  	}
  3747  
  3748  	queryParameters := map[string]interface{}{}
  3749  	if iterationID != nil {
  3750  		queryParameters["iterationId"] = autorest.Encode("query", *iterationID)
  3751  	}
  3752  	if store != nil {
  3753  		queryParameters["store"] = autorest.Encode("query", *store)
  3754  	} else {
  3755  		queryParameters["store"] = autorest.Encode("query", true)
  3756  	}
  3757  
  3758  	preparer := autorest.CreatePreparer(
  3759  		autorest.AsContentType("application/json; charset=utf-8"),
  3760  		autorest.AsPost(),
  3761  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  3762  		autorest.WithPathParameters("/projects/{projectId}/quicktest/url", pathParameters),
  3763  		autorest.WithJSON(imageURL),
  3764  		autorest.WithQueryParameters(queryParameters))
  3765  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  3766  }
  3767  
  3768  // QuickTestImageURLSender sends the QuickTestImageURL request. The method will close the
  3769  // http.Response Body if it receives an error.
  3770  func (client BaseClient) QuickTestImageURLSender(req *http.Request) (*http.Response, error) {
  3771  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3772  }
  3773  
  3774  // QuickTestImageURLResponder handles the response to the QuickTestImageURL request. The method always
  3775  // closes the http.Response Body.
  3776  func (client BaseClient) QuickTestImageURLResponder(resp *http.Response) (result ImagePrediction, err error) {
  3777  	err = autorest.Respond(
  3778  		resp,
  3779  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3780  		autorest.ByUnmarshallingJSON(&result),
  3781  		autorest.ByClosing())
  3782  	result.Response = autorest.Response{Response: resp}
  3783  	return
  3784  }
  3785  
  3786  // SuggestTagsAndRegions this API will get suggested tags and regions for an array/batch of untagged images along with
  3787  // confidences for the tags. It returns an empty array if no tags are found.
  3788  // There is a limit of 64 images in the batch.
  3789  // Parameters:
  3790  // projectID - the project id.
  3791  // iterationID - iterationId to use for tag and region suggestion.
  3792  // imageIds - array of image ids tag suggestion are needed for. Use GetUntaggedImages API to get imageIds.
  3793  func (client BaseClient) SuggestTagsAndRegions(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, imageIds []uuid.UUID) (result ListSuggestedTagAndRegion, err error) {
  3794  	if tracing.IsEnabled() {
  3795  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuggestTagsAndRegions")
  3796  		defer func() {
  3797  			sc := -1
  3798  			if result.Response.Response != nil {
  3799  				sc = result.Response.Response.StatusCode
  3800  			}
  3801  			tracing.EndSpan(ctx, sc, err)
  3802  		}()
  3803  	}
  3804  	if err := validation.Validate([]validation.Validation{
  3805  		{TargetValue: imageIds,
  3806  			Constraints: []validation.Constraint{{Target: "imageIds", Name: validation.Null, Rule: true,
  3807  				Chain: []validation.Constraint{{Target: "imageIds", Name: validation.MaxItems, Rule: 64, Chain: nil},
  3808  					{Target: "imageIds", Name: validation.MinItems, Rule: 0, Chain: nil},
  3809  				}}}}}); err != nil {
  3810  		return result, validation.NewError("training.BaseClient", "SuggestTagsAndRegions", err.Error())
  3811  	}
  3812  
  3813  	req, err := client.SuggestTagsAndRegionsPreparer(ctx, projectID, iterationID, imageIds)
  3814  	if err != nil {
  3815  		err = autorest.NewErrorWithError(err, "training.BaseClient", "SuggestTagsAndRegions", nil, "Failure preparing request")
  3816  		return
  3817  	}
  3818  
  3819  	resp, err := client.SuggestTagsAndRegionsSender(req)
  3820  	if err != nil {
  3821  		result.Response = autorest.Response{Response: resp}
  3822  		err = autorest.NewErrorWithError(err, "training.BaseClient", "SuggestTagsAndRegions", resp, "Failure sending request")
  3823  		return
  3824  	}
  3825  
  3826  	result, err = client.SuggestTagsAndRegionsResponder(resp)
  3827  	if err != nil {
  3828  		err = autorest.NewErrorWithError(err, "training.BaseClient", "SuggestTagsAndRegions", resp, "Failure responding to request")
  3829  		return
  3830  	}
  3831  
  3832  	return
  3833  }
  3834  
  3835  // SuggestTagsAndRegionsPreparer prepares the SuggestTagsAndRegions request.
  3836  func (client BaseClient) SuggestTagsAndRegionsPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, imageIds []uuid.UUID) (*http.Request, error) {
  3837  	urlParameters := map[string]interface{}{
  3838  		"Endpoint": client.Endpoint,
  3839  	}
  3840  
  3841  	pathParameters := map[string]interface{}{
  3842  		"projectId": autorest.Encode("path", projectID),
  3843  	}
  3844  
  3845  	queryParameters := map[string]interface{}{
  3846  		"imageIds":    autorest.Encode("query", imageIds, ","),
  3847  		"iterationId": autorest.Encode("query", iterationID),
  3848  	}
  3849  
  3850  	preparer := autorest.CreatePreparer(
  3851  		autorest.AsPost(),
  3852  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  3853  		autorest.WithPathParameters("/projects/{projectId}/tagsandregions/suggestions", pathParameters),
  3854  		autorest.WithQueryParameters(queryParameters))
  3855  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  3856  }
  3857  
  3858  // SuggestTagsAndRegionsSender sends the SuggestTagsAndRegions request. The method will close the
  3859  // http.Response Body if it receives an error.
  3860  func (client BaseClient) SuggestTagsAndRegionsSender(req *http.Request) (*http.Response, error) {
  3861  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3862  }
  3863  
  3864  // SuggestTagsAndRegionsResponder handles the response to the SuggestTagsAndRegions request. The method always
  3865  // closes the http.Response Body.
  3866  func (client BaseClient) SuggestTagsAndRegionsResponder(resp *http.Response) (result ListSuggestedTagAndRegion, err error) {
  3867  	err = autorest.Respond(
  3868  		resp,
  3869  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3870  		autorest.ByUnmarshallingJSON(&result.Value),
  3871  		autorest.ByClosing())
  3872  	result.Response = autorest.Response{Response: resp}
  3873  	return
  3874  }
  3875  
  3876  // TrainProject sends the train project request.
  3877  // Parameters:
  3878  // projectID - the project id.
  3879  // trainingType - the type of training to use to train the project (default: Regular).
  3880  // reservedBudgetInHours - the number of hours reserved as budget for training (if applicable).
  3881  // forceTrain - whether to force train even if dataset and configuration does not change (default: false).
  3882  // notificationEmailAddress - the email address to send notification to when training finishes (default: null).
  3883  // trainingParameters - additional training parameters passed in to control how the project is trained.
  3884  func (client BaseClient) TrainProject(ctx context.Context, projectID uuid.UUID, trainingType string, reservedBudgetInHours *int32, forceTrain *bool, notificationEmailAddress string, trainingParameters *Parameters) (result Iteration, err error) {
  3885  	if tracing.IsEnabled() {
  3886  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.TrainProject")
  3887  		defer func() {
  3888  			sc := -1
  3889  			if result.Response.Response != nil {
  3890  				sc = result.Response.Response.StatusCode
  3891  			}
  3892  			tracing.EndSpan(ctx, sc, err)
  3893  		}()
  3894  	}
  3895  	req, err := client.TrainProjectPreparer(ctx, projectID, trainingType, reservedBudgetInHours, forceTrain, notificationEmailAddress, trainingParameters)
  3896  	if err != nil {
  3897  		err = autorest.NewErrorWithError(err, "training.BaseClient", "TrainProject", nil, "Failure preparing request")
  3898  		return
  3899  	}
  3900  
  3901  	resp, err := client.TrainProjectSender(req)
  3902  	if err != nil {
  3903  		result.Response = autorest.Response{Response: resp}
  3904  		err = autorest.NewErrorWithError(err, "training.BaseClient", "TrainProject", resp, "Failure sending request")
  3905  		return
  3906  	}
  3907  
  3908  	result, err = client.TrainProjectResponder(resp)
  3909  	if err != nil {
  3910  		err = autorest.NewErrorWithError(err, "training.BaseClient", "TrainProject", resp, "Failure responding to request")
  3911  		return
  3912  	}
  3913  
  3914  	return
  3915  }
  3916  
  3917  // TrainProjectPreparer prepares the TrainProject request.
  3918  func (client BaseClient) TrainProjectPreparer(ctx context.Context, projectID uuid.UUID, trainingType string, reservedBudgetInHours *int32, forceTrain *bool, notificationEmailAddress string, trainingParameters *Parameters) (*http.Request, error) {
  3919  	urlParameters := map[string]interface{}{
  3920  		"Endpoint": client.Endpoint,
  3921  	}
  3922  
  3923  	pathParameters := map[string]interface{}{
  3924  		"projectId": autorest.Encode("path", projectID),
  3925  	}
  3926  
  3927  	queryParameters := map[string]interface{}{}
  3928  	if len(string(trainingType)) > 0 {
  3929  		queryParameters["trainingType"] = autorest.Encode("query", trainingType)
  3930  	}
  3931  	if reservedBudgetInHours != nil {
  3932  		queryParameters["reservedBudgetInHours"] = autorest.Encode("query", *reservedBudgetInHours)
  3933  	} else {
  3934  		queryParameters["reservedBudgetInHours"] = autorest.Encode("query", 0)
  3935  	}
  3936  	if forceTrain != nil {
  3937  		queryParameters["forceTrain"] = autorest.Encode("query", *forceTrain)
  3938  	} else {
  3939  		queryParameters["forceTrain"] = autorest.Encode("query", false)
  3940  	}
  3941  	if len(notificationEmailAddress) > 0 {
  3942  		queryParameters["notificationEmailAddress"] = autorest.Encode("query", notificationEmailAddress)
  3943  	}
  3944  
  3945  	preparer := autorest.CreatePreparer(
  3946  		autorest.AsContentType("application/json; charset=utf-8"),
  3947  		autorest.AsPost(),
  3948  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  3949  		autorest.WithPathParameters("/projects/{projectId}/train", pathParameters),
  3950  		autorest.WithQueryParameters(queryParameters))
  3951  	if trainingParameters != nil {
  3952  		preparer = autorest.DecoratePreparer(preparer,
  3953  			autorest.WithJSON(trainingParameters))
  3954  	}
  3955  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  3956  }
  3957  
  3958  // TrainProjectSender sends the TrainProject request. The method will close the
  3959  // http.Response Body if it receives an error.
  3960  func (client BaseClient) TrainProjectSender(req *http.Request) (*http.Response, error) {
  3961  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3962  }
  3963  
  3964  // TrainProjectResponder handles the response to the TrainProject request. The method always
  3965  // closes the http.Response Body.
  3966  func (client BaseClient) TrainProjectResponder(resp *http.Response) (result Iteration, err error) {
  3967  	err = autorest.Respond(
  3968  		resp,
  3969  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  3970  		autorest.ByUnmarshallingJSON(&result),
  3971  		autorest.ByClosing())
  3972  	result.Response = autorest.Response{Response: resp}
  3973  	return
  3974  }
  3975  
  3976  // UnpublishIteration sends the unpublish iteration request.
  3977  // Parameters:
  3978  // projectID - the project id.
  3979  // iterationID - the iteration id.
  3980  func (client BaseClient) UnpublishIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (result autorest.Response, err error) {
  3981  	if tracing.IsEnabled() {
  3982  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UnpublishIteration")
  3983  		defer func() {
  3984  			sc := -1
  3985  			if result.Response != nil {
  3986  				sc = result.Response.StatusCode
  3987  			}
  3988  			tracing.EndSpan(ctx, sc, err)
  3989  		}()
  3990  	}
  3991  	req, err := client.UnpublishIterationPreparer(ctx, projectID, iterationID)
  3992  	if err != nil {
  3993  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UnpublishIteration", nil, "Failure preparing request")
  3994  		return
  3995  	}
  3996  
  3997  	resp, err := client.UnpublishIterationSender(req)
  3998  	if err != nil {
  3999  		result.Response = resp
  4000  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UnpublishIteration", resp, "Failure sending request")
  4001  		return
  4002  	}
  4003  
  4004  	result, err = client.UnpublishIterationResponder(resp)
  4005  	if err != nil {
  4006  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UnpublishIteration", resp, "Failure responding to request")
  4007  		return
  4008  	}
  4009  
  4010  	return
  4011  }
  4012  
  4013  // UnpublishIterationPreparer prepares the UnpublishIteration request.
  4014  func (client BaseClient) UnpublishIterationPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID) (*http.Request, error) {
  4015  	urlParameters := map[string]interface{}{
  4016  		"Endpoint": client.Endpoint,
  4017  	}
  4018  
  4019  	pathParameters := map[string]interface{}{
  4020  		"iterationId": autorest.Encode("path", iterationID),
  4021  		"projectId":   autorest.Encode("path", projectID),
  4022  	}
  4023  
  4024  	preparer := autorest.CreatePreparer(
  4025  		autorest.AsDelete(),
  4026  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  4027  		autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}/publish", pathParameters))
  4028  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  4029  }
  4030  
  4031  // UnpublishIterationSender sends the UnpublishIteration request. The method will close the
  4032  // http.Response Body if it receives an error.
  4033  func (client BaseClient) UnpublishIterationSender(req *http.Request) (*http.Response, error) {
  4034  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  4035  }
  4036  
  4037  // UnpublishIterationResponder handles the response to the UnpublishIteration request. The method always
  4038  // closes the http.Response Body.
  4039  func (client BaseClient) UnpublishIterationResponder(resp *http.Response) (result autorest.Response, err error) {
  4040  	err = autorest.Respond(
  4041  		resp,
  4042  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
  4043  		autorest.ByClosing())
  4044  	result.Response = resp
  4045  	return
  4046  }
  4047  
  4048  // UpdateImageMetadata this API accepts a batch of image Ids, and metadata, to update images. There is a limit of 64
  4049  // images.
  4050  // Parameters:
  4051  // projectID - the project id.
  4052  // imageIds - the list of image ids to update. Limited to 64.
  4053  // metadata - the metadata to be updated to the specified images. Limited to 50 key-value pairs per image. The
  4054  // length of key is limited to 256. The length of value is limited to 512.
  4055  func (client BaseClient) UpdateImageMetadata(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, metadata map[string]*string) (result ImageMetadataUpdateSummary, err error) {
  4056  	if tracing.IsEnabled() {
  4057  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateImageMetadata")
  4058  		defer func() {
  4059  			sc := -1
  4060  			if result.Response.Response != nil {
  4061  				sc = result.Response.Response.StatusCode
  4062  			}
  4063  			tracing.EndSpan(ctx, sc, err)
  4064  		}()
  4065  	}
  4066  	if err := validation.Validate([]validation.Validation{
  4067  		{TargetValue: imageIds,
  4068  			Constraints: []validation.Constraint{{Target: "imageIds", Name: validation.Null, Rule: true,
  4069  				Chain: []validation.Constraint{{Target: "imageIds", Name: validation.MaxItems, Rule: 256, Chain: nil},
  4070  					{Target: "imageIds", Name: validation.MinItems, Rule: 0, Chain: nil},
  4071  				}}}},
  4072  		{TargetValue: metadata,
  4073  			Constraints: []validation.Constraint{{Target: "metadata", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
  4074  		return result, validation.NewError("training.BaseClient", "UpdateImageMetadata", err.Error())
  4075  	}
  4076  
  4077  	req, err := client.UpdateImageMetadataPreparer(ctx, projectID, imageIds, metadata)
  4078  	if err != nil {
  4079  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateImageMetadata", nil, "Failure preparing request")
  4080  		return
  4081  	}
  4082  
  4083  	resp, err := client.UpdateImageMetadataSender(req)
  4084  	if err != nil {
  4085  		result.Response = autorest.Response{Response: resp}
  4086  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateImageMetadata", resp, "Failure sending request")
  4087  		return
  4088  	}
  4089  
  4090  	result, err = client.UpdateImageMetadataResponder(resp)
  4091  	if err != nil {
  4092  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateImageMetadata", resp, "Failure responding to request")
  4093  		return
  4094  	}
  4095  
  4096  	return
  4097  }
  4098  
  4099  // UpdateImageMetadataPreparer prepares the UpdateImageMetadata request.
  4100  func (client BaseClient) UpdateImageMetadataPreparer(ctx context.Context, projectID uuid.UUID, imageIds []uuid.UUID, metadata map[string]*string) (*http.Request, error) {
  4101  	urlParameters := map[string]interface{}{
  4102  		"Endpoint": client.Endpoint,
  4103  	}
  4104  
  4105  	pathParameters := map[string]interface{}{
  4106  		"projectId": autorest.Encode("path", projectID),
  4107  	}
  4108  
  4109  	queryParameters := map[string]interface{}{
  4110  		"imageIds": autorest.Encode("query", imageIds, ","),
  4111  	}
  4112  
  4113  	preparer := autorest.CreatePreparer(
  4114  		autorest.AsContentType("application/json; charset=utf-8"),
  4115  		autorest.AsPost(),
  4116  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  4117  		autorest.WithPathParameters("/projects/{projectId}/images/metadata", pathParameters),
  4118  		autorest.WithJSON(metadata),
  4119  		autorest.WithQueryParameters(queryParameters))
  4120  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  4121  }
  4122  
  4123  // UpdateImageMetadataSender sends the UpdateImageMetadata request. The method will close the
  4124  // http.Response Body if it receives an error.
  4125  func (client BaseClient) UpdateImageMetadataSender(req *http.Request) (*http.Response, error) {
  4126  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  4127  }
  4128  
  4129  // UpdateImageMetadataResponder handles the response to the UpdateImageMetadata request. The method always
  4130  // closes the http.Response Body.
  4131  func (client BaseClient) UpdateImageMetadataResponder(resp *http.Response) (result ImageMetadataUpdateSummary, err error) {
  4132  	err = autorest.Respond(
  4133  		resp,
  4134  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusMultiStatus),
  4135  		autorest.ByUnmarshallingJSON(&result),
  4136  		autorest.ByClosing())
  4137  	result.Response = autorest.Response{Response: resp}
  4138  	return
  4139  }
  4140  
  4141  // UpdateIteration sends the update iteration request.
  4142  // Parameters:
  4143  // projectID - project id.
  4144  // iterationID - iteration id.
  4145  // updatedIteration - the updated iteration model.
  4146  func (client BaseClient) UpdateIteration(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, updatedIteration Iteration) (result Iteration, err error) {
  4147  	if tracing.IsEnabled() {
  4148  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateIteration")
  4149  		defer func() {
  4150  			sc := -1
  4151  			if result.Response.Response != nil {
  4152  				sc = result.Response.Response.StatusCode
  4153  			}
  4154  			tracing.EndSpan(ctx, sc, err)
  4155  		}()
  4156  	}
  4157  	req, err := client.UpdateIterationPreparer(ctx, projectID, iterationID, updatedIteration)
  4158  	if err != nil {
  4159  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateIteration", nil, "Failure preparing request")
  4160  		return
  4161  	}
  4162  
  4163  	resp, err := client.UpdateIterationSender(req)
  4164  	if err != nil {
  4165  		result.Response = autorest.Response{Response: resp}
  4166  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateIteration", resp, "Failure sending request")
  4167  		return
  4168  	}
  4169  
  4170  	result, err = client.UpdateIterationResponder(resp)
  4171  	if err != nil {
  4172  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateIteration", resp, "Failure responding to request")
  4173  		return
  4174  	}
  4175  
  4176  	return
  4177  }
  4178  
  4179  // UpdateIterationPreparer prepares the UpdateIteration request.
  4180  func (client BaseClient) UpdateIterationPreparer(ctx context.Context, projectID uuid.UUID, iterationID uuid.UUID, updatedIteration Iteration) (*http.Request, error) {
  4181  	urlParameters := map[string]interface{}{
  4182  		"Endpoint": client.Endpoint,
  4183  	}
  4184  
  4185  	pathParameters := map[string]interface{}{
  4186  		"iterationId": autorest.Encode("path", iterationID),
  4187  		"projectId":   autorest.Encode("path", projectID),
  4188  	}
  4189  
  4190  	updatedIteration.ID = nil
  4191  	updatedIteration.Status = nil
  4192  	updatedIteration.Created = nil
  4193  	updatedIteration.LastModified = nil
  4194  	updatedIteration.TrainedAt = nil
  4195  	updatedIteration.ProjectID = nil
  4196  	updatedIteration.Exportable = nil
  4197  	updatedIteration.ExportableTo = nil
  4198  	updatedIteration.DomainID = nil
  4199  	updatedIteration.ClassificationType = ""
  4200  	updatedIteration.TrainingType = ""
  4201  	updatedIteration.ReservedBudgetInHours = nil
  4202  	updatedIteration.TrainingTimeInMinutes = nil
  4203  	updatedIteration.PublishName = nil
  4204  	updatedIteration.OriginalPublishResourceID = nil
  4205  	preparer := autorest.CreatePreparer(
  4206  		autorest.AsContentType("application/json; charset=utf-8"),
  4207  		autorest.AsPatch(),
  4208  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  4209  		autorest.WithPathParameters("/projects/{projectId}/iterations/{iterationId}", pathParameters),
  4210  		autorest.WithJSON(updatedIteration))
  4211  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  4212  }
  4213  
  4214  // UpdateIterationSender sends the UpdateIteration request. The method will close the
  4215  // http.Response Body if it receives an error.
  4216  func (client BaseClient) UpdateIterationSender(req *http.Request) (*http.Response, error) {
  4217  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  4218  }
  4219  
  4220  // UpdateIterationResponder handles the response to the UpdateIteration request. The method always
  4221  // closes the http.Response Body.
  4222  func (client BaseClient) UpdateIterationResponder(resp *http.Response) (result Iteration, err error) {
  4223  	err = autorest.Respond(
  4224  		resp,
  4225  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  4226  		autorest.ByUnmarshallingJSON(&result),
  4227  		autorest.ByClosing())
  4228  	result.Response = autorest.Response{Response: resp}
  4229  	return
  4230  }
  4231  
  4232  // UpdateProject sends the update project request.
  4233  // Parameters:
  4234  // projectID - the id of the project to update.
  4235  // updatedProject - the updated project model.
  4236  func (client BaseClient) UpdateProject(ctx context.Context, projectID uuid.UUID, updatedProject Project) (result Project, err error) {
  4237  	if tracing.IsEnabled() {
  4238  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateProject")
  4239  		defer func() {
  4240  			sc := -1
  4241  			if result.Response.Response != nil {
  4242  				sc = result.Response.Response.StatusCode
  4243  			}
  4244  			tracing.EndSpan(ctx, sc, err)
  4245  		}()
  4246  	}
  4247  	req, err := client.UpdateProjectPreparer(ctx, projectID, updatedProject)
  4248  	if err != nil {
  4249  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateProject", nil, "Failure preparing request")
  4250  		return
  4251  	}
  4252  
  4253  	resp, err := client.UpdateProjectSender(req)
  4254  	if err != nil {
  4255  		result.Response = autorest.Response{Response: resp}
  4256  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateProject", resp, "Failure sending request")
  4257  		return
  4258  	}
  4259  
  4260  	result, err = client.UpdateProjectResponder(resp)
  4261  	if err != nil {
  4262  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateProject", resp, "Failure responding to request")
  4263  		return
  4264  	}
  4265  
  4266  	return
  4267  }
  4268  
  4269  // UpdateProjectPreparer prepares the UpdateProject request.
  4270  func (client BaseClient) UpdateProjectPreparer(ctx context.Context, projectID uuid.UUID, updatedProject Project) (*http.Request, error) {
  4271  	urlParameters := map[string]interface{}{
  4272  		"Endpoint": client.Endpoint,
  4273  	}
  4274  
  4275  	pathParameters := map[string]interface{}{
  4276  		"projectId": autorest.Encode("path", projectID),
  4277  	}
  4278  
  4279  	updatedProject.ID = nil
  4280  	updatedProject.Created = nil
  4281  	updatedProject.LastModified = nil
  4282  	updatedProject.ThumbnailURI = nil
  4283  	updatedProject.DrModeEnabled = nil
  4284  	preparer := autorest.CreatePreparer(
  4285  		autorest.AsContentType("application/json; charset=utf-8"),
  4286  		autorest.AsPatch(),
  4287  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  4288  		autorest.WithPathParameters("/projects/{projectId}", pathParameters),
  4289  		autorest.WithJSON(updatedProject))
  4290  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  4291  }
  4292  
  4293  // UpdateProjectSender sends the UpdateProject request. The method will close the
  4294  // http.Response Body if it receives an error.
  4295  func (client BaseClient) UpdateProjectSender(req *http.Request) (*http.Response, error) {
  4296  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  4297  }
  4298  
  4299  // UpdateProjectResponder handles the response to the UpdateProject request. The method always
  4300  // closes the http.Response Body.
  4301  func (client BaseClient) UpdateProjectResponder(resp *http.Response) (result Project, err error) {
  4302  	err = autorest.Respond(
  4303  		resp,
  4304  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  4305  		autorest.ByUnmarshallingJSON(&result),
  4306  		autorest.ByClosing())
  4307  	result.Response = autorest.Response{Response: resp}
  4308  	return
  4309  }
  4310  
  4311  // UpdateTag sends the update tag request.
  4312  // Parameters:
  4313  // projectID - the project id.
  4314  // tagID - the id of the target tag.
  4315  // updatedTag - the updated tag model.
  4316  func (client BaseClient) UpdateTag(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID, updatedTag Tag) (result Tag, err error) {
  4317  	if tracing.IsEnabled() {
  4318  		ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateTag")
  4319  		defer func() {
  4320  			sc := -1
  4321  			if result.Response.Response != nil {
  4322  				sc = result.Response.Response.StatusCode
  4323  			}
  4324  			tracing.EndSpan(ctx, sc, err)
  4325  		}()
  4326  	}
  4327  	req, err := client.UpdateTagPreparer(ctx, projectID, tagID, updatedTag)
  4328  	if err != nil {
  4329  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateTag", nil, "Failure preparing request")
  4330  		return
  4331  	}
  4332  
  4333  	resp, err := client.UpdateTagSender(req)
  4334  	if err != nil {
  4335  		result.Response = autorest.Response{Response: resp}
  4336  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateTag", resp, "Failure sending request")
  4337  		return
  4338  	}
  4339  
  4340  	result, err = client.UpdateTagResponder(resp)
  4341  	if err != nil {
  4342  		err = autorest.NewErrorWithError(err, "training.BaseClient", "UpdateTag", resp, "Failure responding to request")
  4343  		return
  4344  	}
  4345  
  4346  	return
  4347  }
  4348  
  4349  // UpdateTagPreparer prepares the UpdateTag request.
  4350  func (client BaseClient) UpdateTagPreparer(ctx context.Context, projectID uuid.UUID, tagID uuid.UUID, updatedTag Tag) (*http.Request, error) {
  4351  	urlParameters := map[string]interface{}{
  4352  		"Endpoint": client.Endpoint,
  4353  	}
  4354  
  4355  	pathParameters := map[string]interface{}{
  4356  		"projectId": autorest.Encode("path", projectID),
  4357  		"tagId":     autorest.Encode("path", tagID),
  4358  	}
  4359  
  4360  	updatedTag.ID = nil
  4361  	updatedTag.ImageCount = nil
  4362  	preparer := autorest.CreatePreparer(
  4363  		autorest.AsContentType("application/json; charset=utf-8"),
  4364  		autorest.AsPatch(),
  4365  		autorest.WithCustomBaseURL("{Endpoint}/customvision/v3.3/training", urlParameters),
  4366  		autorest.WithPathParameters("/projects/{projectId}/tags/{tagId}", pathParameters),
  4367  		autorest.WithJSON(updatedTag))
  4368  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  4369  }
  4370  
  4371  // UpdateTagSender sends the UpdateTag request. The method will close the
  4372  // http.Response Body if it receives an error.
  4373  func (client BaseClient) UpdateTagSender(req *http.Request) (*http.Response, error) {
  4374  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  4375  }
  4376  
  4377  // UpdateTagResponder handles the response to the UpdateTag request. The method always
  4378  // closes the http.Response Body.
  4379  func (client BaseClient) UpdateTagResponder(resp *http.Response) (result Tag, err error) {
  4380  	err = autorest.Respond(
  4381  		resp,
  4382  		azure.WithErrorUnlessStatusCode(http.StatusOK),
  4383  		autorest.ByUnmarshallingJSON(&result),
  4384  		autorest.ByClosing())
  4385  	result.Response = autorest.Response{Response: resp}
  4386  	return
  4387  }
  4388  

View as plain text