...

Source file src/github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-11-01/media/tracks.go

Documentation: github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-11-01/media

     1  package media
     2  
     3  // Copyright (c) Microsoft Corporation. All rights reserved.
     4  // Licensed under the MIT License. See License.txt in the project root for license information.
     5  //
     6  // Code generated by Microsoft (R) AutoRest Code Generator.
     7  // Changes may cause incorrect behavior and will be lost if the code is regenerated.
     8  
     9  import (
    10  	"context"
    11  	"github.com/Azure/go-autorest/autorest"
    12  	"github.com/Azure/go-autorest/autorest/azure"
    13  	"github.com/Azure/go-autorest/tracing"
    14  	"net/http"
    15  )
    16  
    17  // TracksClient is the client for the Tracks methods of the Media service.
    18  type TracksClient struct {
    19  	BaseClient
    20  }
    21  
    22  // NewTracksClient creates an instance of the TracksClient client.
    23  func NewTracksClient(subscriptionID string) TracksClient {
    24  	return NewTracksClientWithBaseURI(DefaultBaseURI, subscriptionID)
    25  }
    26  
    27  // NewTracksClientWithBaseURI creates an instance of the TracksClient client using a custom endpoint.  Use this when
    28  // interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
    29  func NewTracksClientWithBaseURI(baseURI string, subscriptionID string) TracksClient {
    30  	return TracksClient{NewWithBaseURI(baseURI, subscriptionID)}
    31  }
    32  
    33  // CreateOrUpdate create or update a Track in the asset
    34  // Parameters:
    35  // resourceGroupName - the name of the resource group within the Azure subscription.
    36  // accountName - the Media Services account name.
    37  // assetName - the Asset name.
    38  // trackName - the Asset Track name.
    39  // parameters - the request parameters
    40  func (client TracksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, parameters AssetTrack) (result TracksCreateOrUpdateFuture, err error) {
    41  	if tracing.IsEnabled() {
    42  		ctx = tracing.StartSpan(ctx, fqdn+"/TracksClient.CreateOrUpdate")
    43  		defer func() {
    44  			sc := -1
    45  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
    46  				sc = result.FutureAPI.Response().StatusCode
    47  			}
    48  			tracing.EndSpan(ctx, sc, err)
    49  		}()
    50  	}
    51  	req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, assetName, trackName, parameters)
    52  	if err != nil {
    53  		err = autorest.NewErrorWithError(err, "media.TracksClient", "CreateOrUpdate", nil, "Failure preparing request")
    54  		return
    55  	}
    56  
    57  	result, err = client.CreateOrUpdateSender(req)
    58  	if err != nil {
    59  		err = autorest.NewErrorWithError(err, "media.TracksClient", "CreateOrUpdate", result.Response(), "Failure sending request")
    60  		return
    61  	}
    62  
    63  	return
    64  }
    65  
    66  // CreateOrUpdatePreparer prepares the CreateOrUpdate request.
    67  func (client TracksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, parameters AssetTrack) (*http.Request, error) {
    68  	pathParameters := map[string]interface{}{
    69  		"accountName":       autorest.Encode("path", accountName),
    70  		"assetName":         autorest.Encode("path", assetName),
    71  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
    72  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
    73  		"trackName":         autorest.Encode("path", trackName),
    74  	}
    75  
    76  	const APIVersion = "2021-11-01"
    77  	queryParameters := map[string]interface{}{
    78  		"api-version": APIVersion,
    79  	}
    80  
    81  	preparer := autorest.CreatePreparer(
    82  		autorest.AsContentType("application/json; charset=utf-8"),
    83  		autorest.AsPut(),
    84  		autorest.WithBaseURL(client.BaseURI),
    85  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/tracks/{trackName}", pathParameters),
    86  		autorest.WithJSON(parameters),
    87  		autorest.WithQueryParameters(queryParameters))
    88  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
    89  }
    90  
    91  // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
    92  // http.Response Body if it receives an error.
    93  func (client TracksClient) CreateOrUpdateSender(req *http.Request) (future TracksCreateOrUpdateFuture, err error) {
    94  	var resp *http.Response
    95  	future.FutureAPI = &azure.Future{}
    96  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
    97  	if err != nil {
    98  		return
    99  	}
   100  	var azf azure.Future
   101  	azf, err = azure.NewFutureFromResponse(resp)
   102  	future.FutureAPI = &azf
   103  	future.Result = future.result
   104  	return
   105  }
   106  
   107  // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
   108  // closes the http.Response Body.
   109  func (client TracksClient) CreateOrUpdateResponder(resp *http.Response) (result AssetTrack, err error) {
   110  	err = autorest.Respond(
   111  		resp,
   112  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
   113  		autorest.ByUnmarshallingJSON(&result),
   114  		autorest.ByClosing())
   115  	result.Response = autorest.Response{Response: resp}
   116  	return
   117  }
   118  
   119  // Delete deletes a Track in the asset
   120  // Parameters:
   121  // resourceGroupName - the name of the resource group within the Azure subscription.
   122  // accountName - the Media Services account name.
   123  // assetName - the Asset name.
   124  // trackName - the Asset Track name.
   125  func (client TracksClient) Delete(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string) (result TracksDeleteFuture, err error) {
   126  	if tracing.IsEnabled() {
   127  		ctx = tracing.StartSpan(ctx, fqdn+"/TracksClient.Delete")
   128  		defer func() {
   129  			sc := -1
   130  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   131  				sc = result.FutureAPI.Response().StatusCode
   132  			}
   133  			tracing.EndSpan(ctx, sc, err)
   134  		}()
   135  	}
   136  	req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, assetName, trackName)
   137  	if err != nil {
   138  		err = autorest.NewErrorWithError(err, "media.TracksClient", "Delete", nil, "Failure preparing request")
   139  		return
   140  	}
   141  
   142  	result, err = client.DeleteSender(req)
   143  	if err != nil {
   144  		err = autorest.NewErrorWithError(err, "media.TracksClient", "Delete", result.Response(), "Failure sending request")
   145  		return
   146  	}
   147  
   148  	return
   149  }
   150  
   151  // DeletePreparer prepares the Delete request.
   152  func (client TracksClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string) (*http.Request, error) {
   153  	pathParameters := map[string]interface{}{
   154  		"accountName":       autorest.Encode("path", accountName),
   155  		"assetName":         autorest.Encode("path", assetName),
   156  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   157  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   158  		"trackName":         autorest.Encode("path", trackName),
   159  	}
   160  
   161  	const APIVersion = "2021-11-01"
   162  	queryParameters := map[string]interface{}{
   163  		"api-version": APIVersion,
   164  	}
   165  
   166  	preparer := autorest.CreatePreparer(
   167  		autorest.AsDelete(),
   168  		autorest.WithBaseURL(client.BaseURI),
   169  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/tracks/{trackName}", pathParameters),
   170  		autorest.WithQueryParameters(queryParameters))
   171  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   172  }
   173  
   174  // DeleteSender sends the Delete request. The method will close the
   175  // http.Response Body if it receives an error.
   176  func (client TracksClient) DeleteSender(req *http.Request) (future TracksDeleteFuture, err error) {
   177  	var resp *http.Response
   178  	future.FutureAPI = &azure.Future{}
   179  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   180  	if err != nil {
   181  		return
   182  	}
   183  	var azf azure.Future
   184  	azf, err = azure.NewFutureFromResponse(resp)
   185  	future.FutureAPI = &azf
   186  	future.Result = future.result
   187  	return
   188  }
   189  
   190  // DeleteResponder handles the response to the Delete request. The method always
   191  // closes the http.Response Body.
   192  func (client TracksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
   193  	err = autorest.Respond(
   194  		resp,
   195  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
   196  		autorest.ByClosing())
   197  	result.Response = resp
   198  	return
   199  }
   200  
   201  // Get get the details of a Track in the Asset
   202  // Parameters:
   203  // resourceGroupName - the name of the resource group within the Azure subscription.
   204  // accountName - the Media Services account name.
   205  // assetName - the Asset name.
   206  // trackName - the Asset Track name.
   207  func (client TracksClient) Get(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string) (result AssetTrack, err error) {
   208  	if tracing.IsEnabled() {
   209  		ctx = tracing.StartSpan(ctx, fqdn+"/TracksClient.Get")
   210  		defer func() {
   211  			sc := -1
   212  			if result.Response.Response != nil {
   213  				sc = result.Response.Response.StatusCode
   214  			}
   215  			tracing.EndSpan(ctx, sc, err)
   216  		}()
   217  	}
   218  	req, err := client.GetPreparer(ctx, resourceGroupName, accountName, assetName, trackName)
   219  	if err != nil {
   220  		err = autorest.NewErrorWithError(err, "media.TracksClient", "Get", nil, "Failure preparing request")
   221  		return
   222  	}
   223  
   224  	resp, err := client.GetSender(req)
   225  	if err != nil {
   226  		result.Response = autorest.Response{Response: resp}
   227  		err = autorest.NewErrorWithError(err, "media.TracksClient", "Get", resp, "Failure sending request")
   228  		return
   229  	}
   230  
   231  	result, err = client.GetResponder(resp)
   232  	if err != nil {
   233  		err = autorest.NewErrorWithError(err, "media.TracksClient", "Get", resp, "Failure responding to request")
   234  		return
   235  	}
   236  
   237  	return
   238  }
   239  
   240  // GetPreparer prepares the Get request.
   241  func (client TracksClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string) (*http.Request, error) {
   242  	pathParameters := map[string]interface{}{
   243  		"accountName":       autorest.Encode("path", accountName),
   244  		"assetName":         autorest.Encode("path", assetName),
   245  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   246  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   247  		"trackName":         autorest.Encode("path", trackName),
   248  	}
   249  
   250  	const APIVersion = "2021-11-01"
   251  	queryParameters := map[string]interface{}{
   252  		"api-version": APIVersion,
   253  	}
   254  
   255  	preparer := autorest.CreatePreparer(
   256  		autorest.AsGet(),
   257  		autorest.WithBaseURL(client.BaseURI),
   258  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/tracks/{trackName}", pathParameters),
   259  		autorest.WithQueryParameters(queryParameters))
   260  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   261  }
   262  
   263  // GetSender sends the Get request. The method will close the
   264  // http.Response Body if it receives an error.
   265  func (client TracksClient) GetSender(req *http.Request) (*http.Response, error) {
   266  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   267  }
   268  
   269  // GetResponder handles the response to the Get request. The method always
   270  // closes the http.Response Body.
   271  func (client TracksClient) GetResponder(resp *http.Response) (result AssetTrack, err error) {
   272  	err = autorest.Respond(
   273  		resp,
   274  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   275  		autorest.ByUnmarshallingJSON(&result),
   276  		autorest.ByClosing())
   277  	result.Response = autorest.Response{Response: resp}
   278  	return
   279  }
   280  
   281  // List lists the Tracks in the asset
   282  // Parameters:
   283  // resourceGroupName - the name of the resource group within the Azure subscription.
   284  // accountName - the Media Services account name.
   285  // assetName - the Asset name.
   286  func (client TracksClient) List(ctx context.Context, resourceGroupName string, accountName string, assetName string) (result AssetTrackCollection, err error) {
   287  	if tracing.IsEnabled() {
   288  		ctx = tracing.StartSpan(ctx, fqdn+"/TracksClient.List")
   289  		defer func() {
   290  			sc := -1
   291  			if result.Response.Response != nil {
   292  				sc = result.Response.Response.StatusCode
   293  			}
   294  			tracing.EndSpan(ctx, sc, err)
   295  		}()
   296  	}
   297  	req, err := client.ListPreparer(ctx, resourceGroupName, accountName, assetName)
   298  	if err != nil {
   299  		err = autorest.NewErrorWithError(err, "media.TracksClient", "List", nil, "Failure preparing request")
   300  		return
   301  	}
   302  
   303  	resp, err := client.ListSender(req)
   304  	if err != nil {
   305  		result.Response = autorest.Response{Response: resp}
   306  		err = autorest.NewErrorWithError(err, "media.TracksClient", "List", resp, "Failure sending request")
   307  		return
   308  	}
   309  
   310  	result, err = client.ListResponder(resp)
   311  	if err != nil {
   312  		err = autorest.NewErrorWithError(err, "media.TracksClient", "List", resp, "Failure responding to request")
   313  		return
   314  	}
   315  
   316  	return
   317  }
   318  
   319  // ListPreparer prepares the List request.
   320  func (client TracksClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, assetName string) (*http.Request, error) {
   321  	pathParameters := map[string]interface{}{
   322  		"accountName":       autorest.Encode("path", accountName),
   323  		"assetName":         autorest.Encode("path", assetName),
   324  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   325  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   326  	}
   327  
   328  	const APIVersion = "2021-11-01"
   329  	queryParameters := map[string]interface{}{
   330  		"api-version": APIVersion,
   331  	}
   332  
   333  	preparer := autorest.CreatePreparer(
   334  		autorest.AsGet(),
   335  		autorest.WithBaseURL(client.BaseURI),
   336  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/tracks", pathParameters),
   337  		autorest.WithQueryParameters(queryParameters))
   338  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   339  }
   340  
   341  // ListSender sends the List request. The method will close the
   342  // http.Response Body if it receives an error.
   343  func (client TracksClient) ListSender(req *http.Request) (*http.Response, error) {
   344  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   345  }
   346  
   347  // ListResponder handles the response to the List request. The method always
   348  // closes the http.Response Body.
   349  func (client TracksClient) ListResponder(resp *http.Response) (result AssetTrackCollection, err error) {
   350  	err = autorest.Respond(
   351  		resp,
   352  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   353  		autorest.ByUnmarshallingJSON(&result),
   354  		autorest.ByClosing())
   355  	result.Response = autorest.Response{Response: resp}
   356  	return
   357  }
   358  
   359  // Update updates an existing Track in the asset
   360  // Parameters:
   361  // resourceGroupName - the name of the resource group within the Azure subscription.
   362  // accountName - the Media Services account name.
   363  // assetName - the Asset name.
   364  // trackName - the Asset Track name.
   365  // parameters - the request parameters
   366  func (client TracksClient) Update(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, parameters AssetTrack) (result TracksUpdateFuture, err error) {
   367  	if tracing.IsEnabled() {
   368  		ctx = tracing.StartSpan(ctx, fqdn+"/TracksClient.Update")
   369  		defer func() {
   370  			sc := -1
   371  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   372  				sc = result.FutureAPI.Response().StatusCode
   373  			}
   374  			tracing.EndSpan(ctx, sc, err)
   375  		}()
   376  	}
   377  	req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, assetName, trackName, parameters)
   378  	if err != nil {
   379  		err = autorest.NewErrorWithError(err, "media.TracksClient", "Update", nil, "Failure preparing request")
   380  		return
   381  	}
   382  
   383  	result, err = client.UpdateSender(req)
   384  	if err != nil {
   385  		err = autorest.NewErrorWithError(err, "media.TracksClient", "Update", result.Response(), "Failure sending request")
   386  		return
   387  	}
   388  
   389  	return
   390  }
   391  
   392  // UpdatePreparer prepares the Update request.
   393  func (client TracksClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, parameters AssetTrack) (*http.Request, error) {
   394  	pathParameters := map[string]interface{}{
   395  		"accountName":       autorest.Encode("path", accountName),
   396  		"assetName":         autorest.Encode("path", assetName),
   397  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   398  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   399  		"trackName":         autorest.Encode("path", trackName),
   400  	}
   401  
   402  	const APIVersion = "2021-11-01"
   403  	queryParameters := map[string]interface{}{
   404  		"api-version": APIVersion,
   405  	}
   406  
   407  	preparer := autorest.CreatePreparer(
   408  		autorest.AsContentType("application/json; charset=utf-8"),
   409  		autorest.AsPatch(),
   410  		autorest.WithBaseURL(client.BaseURI),
   411  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/tracks/{trackName}", pathParameters),
   412  		autorest.WithJSON(parameters),
   413  		autorest.WithQueryParameters(queryParameters))
   414  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   415  }
   416  
   417  // UpdateSender sends the Update request. The method will close the
   418  // http.Response Body if it receives an error.
   419  func (client TracksClient) UpdateSender(req *http.Request) (future TracksUpdateFuture, err error) {
   420  	var resp *http.Response
   421  	future.FutureAPI = &azure.Future{}
   422  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   423  	if err != nil {
   424  		return
   425  	}
   426  	var azf azure.Future
   427  	azf, err = azure.NewFutureFromResponse(resp)
   428  	future.FutureAPI = &azf
   429  	future.Result = future.result
   430  	return
   431  }
   432  
   433  // UpdateResponder handles the response to the Update request. The method always
   434  // closes the http.Response Body.
   435  func (client TracksClient) UpdateResponder(resp *http.Response) (result AssetTrack, err error) {
   436  	err = autorest.Respond(
   437  		resp,
   438  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   439  		autorest.ByUnmarshallingJSON(&result),
   440  		autorest.ByClosing())
   441  	result.Response = autorest.Response{Response: resp}
   442  	return
   443  }
   444  
   445  // UpdateTrackData update the track data. Call this API after any changes are made to the track data stored in the
   446  // asset container. For example, you have modified the WebVTT captions file in the Azure blob storage container for the
   447  // asset, viewers will not see the new version of the captions unless this API is called. Note, the changes may not be
   448  // reflected immediately. CDN cache may also need to be purged if applicable.
   449  // Parameters:
   450  // resourceGroupName - the name of the resource group within the Azure subscription.
   451  // accountName - the Media Services account name.
   452  // assetName - the Asset name.
   453  // trackName - the Asset Track name.
   454  func (client TracksClient) UpdateTrackData(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string) (result TracksUpdateTrackDataFuture, err error) {
   455  	if tracing.IsEnabled() {
   456  		ctx = tracing.StartSpan(ctx, fqdn+"/TracksClient.UpdateTrackData")
   457  		defer func() {
   458  			sc := -1
   459  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   460  				sc = result.FutureAPI.Response().StatusCode
   461  			}
   462  			tracing.EndSpan(ctx, sc, err)
   463  		}()
   464  	}
   465  	req, err := client.UpdateTrackDataPreparer(ctx, resourceGroupName, accountName, assetName, trackName)
   466  	if err != nil {
   467  		err = autorest.NewErrorWithError(err, "media.TracksClient", "UpdateTrackData", nil, "Failure preparing request")
   468  		return
   469  	}
   470  
   471  	result, err = client.UpdateTrackDataSender(req)
   472  	if err != nil {
   473  		err = autorest.NewErrorWithError(err, "media.TracksClient", "UpdateTrackData", result.Response(), "Failure sending request")
   474  		return
   475  	}
   476  
   477  	return
   478  }
   479  
   480  // UpdateTrackDataPreparer prepares the UpdateTrackData request.
   481  func (client TracksClient) UpdateTrackDataPreparer(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string) (*http.Request, error) {
   482  	pathParameters := map[string]interface{}{
   483  		"accountName":       autorest.Encode("path", accountName),
   484  		"assetName":         autorest.Encode("path", assetName),
   485  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   486  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   487  		"trackName":         autorest.Encode("path", trackName),
   488  	}
   489  
   490  	const APIVersion = "2021-11-01"
   491  	queryParameters := map[string]interface{}{
   492  		"api-version": APIVersion,
   493  	}
   494  
   495  	preparer := autorest.CreatePreparer(
   496  		autorest.AsPost(),
   497  		autorest.WithBaseURL(client.BaseURI),
   498  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/tracks/{trackName}/updateTrackData", pathParameters),
   499  		autorest.WithQueryParameters(queryParameters))
   500  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   501  }
   502  
   503  // UpdateTrackDataSender sends the UpdateTrackData request. The method will close the
   504  // http.Response Body if it receives an error.
   505  func (client TracksClient) UpdateTrackDataSender(req *http.Request) (future TracksUpdateTrackDataFuture, err error) {
   506  	var resp *http.Response
   507  	future.FutureAPI = &azure.Future{}
   508  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   509  	if err != nil {
   510  		return
   511  	}
   512  	var azf azure.Future
   513  	azf, err = azure.NewFutureFromResponse(resp)
   514  	future.FutureAPI = &azf
   515  	future.Result = future.result
   516  	return
   517  }
   518  
   519  // UpdateTrackDataResponder handles the response to the UpdateTrackData request. The method always
   520  // closes the http.Response Body.
   521  func (client TracksClient) UpdateTrackDataResponder(resp *http.Response) (result autorest.Response, err error) {
   522  	err = autorest.Respond(
   523  		resp,
   524  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   525  		autorest.ByClosing())
   526  	result.Response = resp
   527  	return
   528  }
   529  

View as plain text