...

Source file src/github.com/Azure/azure-sdk-for-go/services/domainservices/mgmt/2020-01-01/aad/oucontainer.go

Documentation: github.com/Azure/azure-sdk-for-go/services/domainservices/mgmt/2020-01-01/aad

     1  package aad
     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/autorest/validation"
    14  	"github.com/Azure/go-autorest/tracing"
    15  	"net/http"
    16  )
    17  
    18  // OuContainerClient is the the AAD Domain Services API.
    19  type OuContainerClient struct {
    20  	BaseClient
    21  }
    22  
    23  // NewOuContainerClient creates an instance of the OuContainerClient client.
    24  func NewOuContainerClient(subscriptionID string) OuContainerClient {
    25  	return NewOuContainerClientWithBaseURI(DefaultBaseURI, subscriptionID)
    26  }
    27  
    28  // NewOuContainerClientWithBaseURI creates an instance of the OuContainerClient client using a custom endpoint.  Use
    29  // this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
    30  func NewOuContainerClientWithBaseURI(baseURI string, subscriptionID string) OuContainerClient {
    31  	return OuContainerClient{NewWithBaseURI(baseURI, subscriptionID)}
    32  }
    33  
    34  // Create the Create OuContainer operation creates a new OuContainer under the specified Domain Service instance.
    35  // Parameters:
    36  // resourceGroupName - the name of the resource group within the user's subscription. The name is case
    37  // insensitive.
    38  // domainServiceName - the name of the domain service.
    39  // ouContainerName - the name of the OuContainer.
    40  // containerAccount - container Account Description.
    41  func (client OuContainerClient) Create(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string, containerAccount ContainerAccount) (result OuContainerCreateFuture, err error) {
    42  	if tracing.IsEnabled() {
    43  		ctx = tracing.StartSpan(ctx, fqdn+"/OuContainerClient.Create")
    44  		defer func() {
    45  			sc := -1
    46  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
    47  				sc = result.FutureAPI.Response().StatusCode
    48  			}
    49  			tracing.EndSpan(ctx, sc, err)
    50  		}()
    51  	}
    52  	if err := validation.Validate([]validation.Validation{
    53  		{TargetValue: resourceGroupName,
    54  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
    55  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
    56  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
    57  		return result, validation.NewError("aad.OuContainerClient", "Create", err.Error())
    58  	}
    59  
    60  	req, err := client.CreatePreparer(ctx, resourceGroupName, domainServiceName, ouContainerName, containerAccount)
    61  	if err != nil {
    62  		err = autorest.NewErrorWithError(err, "aad.OuContainerClient", "Create", nil, "Failure preparing request")
    63  		return
    64  	}
    65  
    66  	result, err = client.CreateSender(req)
    67  	if err != nil {
    68  		err = autorest.NewErrorWithError(err, "aad.OuContainerClient", "Create", result.Response(), "Failure sending request")
    69  		return
    70  	}
    71  
    72  	return
    73  }
    74  
    75  // CreatePreparer prepares the Create request.
    76  func (client OuContainerClient) CreatePreparer(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string, containerAccount ContainerAccount) (*http.Request, error) {
    77  	pathParameters := map[string]interface{}{
    78  		"domainServiceName": autorest.Encode("path", domainServiceName),
    79  		"ouContainerName":   autorest.Encode("path", ouContainerName),
    80  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
    81  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
    82  	}
    83  
    84  	const APIVersion = "2020-01-01"
    85  	queryParameters := map[string]interface{}{
    86  		"api-version": APIVersion,
    87  	}
    88  
    89  	preparer := autorest.CreatePreparer(
    90  		autorest.AsContentType("application/json; charset=utf-8"),
    91  		autorest.AsPut(),
    92  		autorest.WithBaseURL(client.BaseURI),
    93  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Aad/domainServices/{domainServiceName}/ouContainer/{ouContainerName}", pathParameters),
    94  		autorest.WithJSON(containerAccount),
    95  		autorest.WithQueryParameters(queryParameters))
    96  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
    97  }
    98  
    99  // CreateSender sends the Create request. The method will close the
   100  // http.Response Body if it receives an error.
   101  func (client OuContainerClient) CreateSender(req *http.Request) (future OuContainerCreateFuture, err error) {
   102  	var resp *http.Response
   103  	future.FutureAPI = &azure.Future{}
   104  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   105  	if err != nil {
   106  		return
   107  	}
   108  	var azf azure.Future
   109  	azf, err = azure.NewFutureFromResponse(resp)
   110  	future.FutureAPI = &azf
   111  	future.Result = future.result
   112  	return
   113  }
   114  
   115  // CreateResponder handles the response to the Create request. The method always
   116  // closes the http.Response Body.
   117  func (client OuContainerClient) CreateResponder(resp *http.Response) (result OuContainer, err error) {
   118  	err = autorest.Respond(
   119  		resp,
   120  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
   121  		autorest.ByUnmarshallingJSON(&result),
   122  		autorest.ByClosing())
   123  	result.Response = autorest.Response{Response: resp}
   124  	return
   125  }
   126  
   127  // Delete the Delete OuContainer operation deletes specified OuContainer.
   128  // Parameters:
   129  // resourceGroupName - the name of the resource group within the user's subscription. The name is case
   130  // insensitive.
   131  // domainServiceName - the name of the domain service.
   132  // ouContainerName - the name of the OuContainer.
   133  func (client OuContainerClient) Delete(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string) (result OuContainerDeleteFuture, err error) {
   134  	if tracing.IsEnabled() {
   135  		ctx = tracing.StartSpan(ctx, fqdn+"/OuContainerClient.Delete")
   136  		defer func() {
   137  			sc := -1
   138  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   139  				sc = result.FutureAPI.Response().StatusCode
   140  			}
   141  			tracing.EndSpan(ctx, sc, err)
   142  		}()
   143  	}
   144  	if err := validation.Validate([]validation.Validation{
   145  		{TargetValue: resourceGroupName,
   146  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   147  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   148  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
   149  		return result, validation.NewError("aad.OuContainerClient", "Delete", err.Error())
   150  	}
   151  
   152  	req, err := client.DeletePreparer(ctx, resourceGroupName, domainServiceName, ouContainerName)
   153  	if err != nil {
   154  		err = autorest.NewErrorWithError(err, "aad.OuContainerClient", "Delete", nil, "Failure preparing request")
   155  		return
   156  	}
   157  
   158  	result, err = client.DeleteSender(req)
   159  	if err != nil {
   160  		err = autorest.NewErrorWithError(err, "aad.OuContainerClient", "Delete", result.Response(), "Failure sending request")
   161  		return
   162  	}
   163  
   164  	return
   165  }
   166  
   167  // DeletePreparer prepares the Delete request.
   168  func (client OuContainerClient) DeletePreparer(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string) (*http.Request, error) {
   169  	pathParameters := map[string]interface{}{
   170  		"domainServiceName": autorest.Encode("path", domainServiceName),
   171  		"ouContainerName":   autorest.Encode("path", ouContainerName),
   172  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   173  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   174  	}
   175  
   176  	const APIVersion = "2020-01-01"
   177  	queryParameters := map[string]interface{}{
   178  		"api-version": APIVersion,
   179  	}
   180  
   181  	preparer := autorest.CreatePreparer(
   182  		autorest.AsDelete(),
   183  		autorest.WithBaseURL(client.BaseURI),
   184  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Aad/domainServices/{domainServiceName}/ouContainer/{ouContainerName}", pathParameters),
   185  		autorest.WithQueryParameters(queryParameters))
   186  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   187  }
   188  
   189  // DeleteSender sends the Delete request. The method will close the
   190  // http.Response Body if it receives an error.
   191  func (client OuContainerClient) DeleteSender(req *http.Request) (future OuContainerDeleteFuture, err error) {
   192  	var resp *http.Response
   193  	future.FutureAPI = &azure.Future{}
   194  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   195  	if err != nil {
   196  		return
   197  	}
   198  	var azf azure.Future
   199  	azf, err = azure.NewFutureFromResponse(resp)
   200  	future.FutureAPI = &azf
   201  	future.Result = future.result
   202  	return
   203  }
   204  
   205  // DeleteResponder handles the response to the Delete request. The method always
   206  // closes the http.Response Body.
   207  func (client OuContainerClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
   208  	err = autorest.Respond(
   209  		resp,
   210  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
   211  		autorest.ByClosing())
   212  	result.Response = resp
   213  	return
   214  }
   215  
   216  // Get get OuContainer in DomainService instance.
   217  // Parameters:
   218  // resourceGroupName - the name of the resource group within the user's subscription. The name is case
   219  // insensitive.
   220  // domainServiceName - the name of the domain service.
   221  // ouContainerName - the name of the OuContainer.
   222  func (client OuContainerClient) Get(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string) (result OuContainer, err error) {
   223  	if tracing.IsEnabled() {
   224  		ctx = tracing.StartSpan(ctx, fqdn+"/OuContainerClient.Get")
   225  		defer func() {
   226  			sc := -1
   227  			if result.Response.Response != nil {
   228  				sc = result.Response.Response.StatusCode
   229  			}
   230  			tracing.EndSpan(ctx, sc, err)
   231  		}()
   232  	}
   233  	if err := validation.Validate([]validation.Validation{
   234  		{TargetValue: resourceGroupName,
   235  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   236  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   237  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
   238  		return result, validation.NewError("aad.OuContainerClient", "Get", err.Error())
   239  	}
   240  
   241  	req, err := client.GetPreparer(ctx, resourceGroupName, domainServiceName, ouContainerName)
   242  	if err != nil {
   243  		err = autorest.NewErrorWithError(err, "aad.OuContainerClient", "Get", nil, "Failure preparing request")
   244  		return
   245  	}
   246  
   247  	resp, err := client.GetSender(req)
   248  	if err != nil {
   249  		result.Response = autorest.Response{Response: resp}
   250  		err = autorest.NewErrorWithError(err, "aad.OuContainerClient", "Get", resp, "Failure sending request")
   251  		return
   252  	}
   253  
   254  	result, err = client.GetResponder(resp)
   255  	if err != nil {
   256  		err = autorest.NewErrorWithError(err, "aad.OuContainerClient", "Get", resp, "Failure responding to request")
   257  		return
   258  	}
   259  
   260  	return
   261  }
   262  
   263  // GetPreparer prepares the Get request.
   264  func (client OuContainerClient) GetPreparer(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string) (*http.Request, error) {
   265  	pathParameters := map[string]interface{}{
   266  		"domainServiceName": autorest.Encode("path", domainServiceName),
   267  		"ouContainerName":   autorest.Encode("path", ouContainerName),
   268  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   269  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   270  	}
   271  
   272  	const APIVersion = "2020-01-01"
   273  	queryParameters := map[string]interface{}{
   274  		"api-version": APIVersion,
   275  	}
   276  
   277  	preparer := autorest.CreatePreparer(
   278  		autorest.AsGet(),
   279  		autorest.WithBaseURL(client.BaseURI),
   280  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Aad/domainServices/{domainServiceName}/ouContainer/{ouContainerName}", pathParameters),
   281  		autorest.WithQueryParameters(queryParameters))
   282  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   283  }
   284  
   285  // GetSender sends the Get request. The method will close the
   286  // http.Response Body if it receives an error.
   287  func (client OuContainerClient) GetSender(req *http.Request) (*http.Response, error) {
   288  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   289  }
   290  
   291  // GetResponder handles the response to the Get request. The method always
   292  // closes the http.Response Body.
   293  func (client OuContainerClient) GetResponder(resp *http.Response) (result OuContainer, err error) {
   294  	err = autorest.Respond(
   295  		resp,
   296  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   297  		autorest.ByUnmarshallingJSON(&result),
   298  		autorest.ByClosing())
   299  	result.Response = autorest.Response{Response: resp}
   300  	return
   301  }
   302  
   303  // List the List of OuContainers in DomainService instance.
   304  // Parameters:
   305  // resourceGroupName - the name of the resource group within the user's subscription. The name is case
   306  // insensitive.
   307  // domainServiceName - the name of the domain service.
   308  func (client OuContainerClient) List(ctx context.Context, resourceGroupName string, domainServiceName string) (result OuContainerListResultPage, err error) {
   309  	if tracing.IsEnabled() {
   310  		ctx = tracing.StartSpan(ctx, fqdn+"/OuContainerClient.List")
   311  		defer func() {
   312  			sc := -1
   313  			if result.oclr.Response.Response != nil {
   314  				sc = result.oclr.Response.Response.StatusCode
   315  			}
   316  			tracing.EndSpan(ctx, sc, err)
   317  		}()
   318  	}
   319  	if err := validation.Validate([]validation.Validation{
   320  		{TargetValue: resourceGroupName,
   321  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   322  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   323  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
   324  		return result, validation.NewError("aad.OuContainerClient", "List", err.Error())
   325  	}
   326  
   327  	result.fn = client.listNextResults
   328  	req, err := client.ListPreparer(ctx, resourceGroupName, domainServiceName)
   329  	if err != nil {
   330  		err = autorest.NewErrorWithError(err, "aad.OuContainerClient", "List", nil, "Failure preparing request")
   331  		return
   332  	}
   333  
   334  	resp, err := client.ListSender(req)
   335  	if err != nil {
   336  		result.oclr.Response = autorest.Response{Response: resp}
   337  		err = autorest.NewErrorWithError(err, "aad.OuContainerClient", "List", resp, "Failure sending request")
   338  		return
   339  	}
   340  
   341  	result.oclr, err = client.ListResponder(resp)
   342  	if err != nil {
   343  		err = autorest.NewErrorWithError(err, "aad.OuContainerClient", "List", resp, "Failure responding to request")
   344  		return
   345  	}
   346  	if result.oclr.hasNextLink() && result.oclr.IsEmpty() {
   347  		err = result.NextWithContext(ctx)
   348  		return
   349  	}
   350  
   351  	return
   352  }
   353  
   354  // ListPreparer prepares the List request.
   355  func (client OuContainerClient) ListPreparer(ctx context.Context, resourceGroupName string, domainServiceName string) (*http.Request, error) {
   356  	pathParameters := map[string]interface{}{
   357  		"domainServiceName": autorest.Encode("path", domainServiceName),
   358  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   359  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   360  	}
   361  
   362  	const APIVersion = "2020-01-01"
   363  	queryParameters := map[string]interface{}{
   364  		"api-version": APIVersion,
   365  	}
   366  
   367  	preparer := autorest.CreatePreparer(
   368  		autorest.AsGet(),
   369  		autorest.WithBaseURL(client.BaseURI),
   370  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Aad/domainServices/{domainServiceName}/ouContainer", pathParameters),
   371  		autorest.WithQueryParameters(queryParameters))
   372  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   373  }
   374  
   375  // ListSender sends the List request. The method will close the
   376  // http.Response Body if it receives an error.
   377  func (client OuContainerClient) ListSender(req *http.Request) (*http.Response, error) {
   378  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   379  }
   380  
   381  // ListResponder handles the response to the List request. The method always
   382  // closes the http.Response Body.
   383  func (client OuContainerClient) ListResponder(resp *http.Response) (result OuContainerListResult, err error) {
   384  	err = autorest.Respond(
   385  		resp,
   386  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   387  		autorest.ByUnmarshallingJSON(&result),
   388  		autorest.ByClosing())
   389  	result.Response = autorest.Response{Response: resp}
   390  	return
   391  }
   392  
   393  // listNextResults retrieves the next set of results, if any.
   394  func (client OuContainerClient) listNextResults(ctx context.Context, lastResults OuContainerListResult) (result OuContainerListResult, err error) {
   395  	req, err := lastResults.ouContainerListResultPreparer(ctx)
   396  	if err != nil {
   397  		return result, autorest.NewErrorWithError(err, "aad.OuContainerClient", "listNextResults", nil, "Failure preparing next results request")
   398  	}
   399  	if req == nil {
   400  		return
   401  	}
   402  	resp, err := client.ListSender(req)
   403  	if err != nil {
   404  		result.Response = autorest.Response{Response: resp}
   405  		return result, autorest.NewErrorWithError(err, "aad.OuContainerClient", "listNextResults", resp, "Failure sending next results request")
   406  	}
   407  	result, err = client.ListResponder(resp)
   408  	if err != nil {
   409  		err = autorest.NewErrorWithError(err, "aad.OuContainerClient", "listNextResults", resp, "Failure responding to next results request")
   410  	}
   411  	return
   412  }
   413  
   414  // ListComplete enumerates all values, automatically crossing page boundaries as required.
   415  func (client OuContainerClient) ListComplete(ctx context.Context, resourceGroupName string, domainServiceName string) (result OuContainerListResultIterator, err error) {
   416  	if tracing.IsEnabled() {
   417  		ctx = tracing.StartSpan(ctx, fqdn+"/OuContainerClient.List")
   418  		defer func() {
   419  			sc := -1
   420  			if result.Response().Response.Response != nil {
   421  				sc = result.page.Response().Response.Response.StatusCode
   422  			}
   423  			tracing.EndSpan(ctx, sc, err)
   424  		}()
   425  	}
   426  	result.page, err = client.List(ctx, resourceGroupName, domainServiceName)
   427  	return
   428  }
   429  
   430  // Update the Update OuContainer operation can be used to update the existing OuContainers.
   431  // Parameters:
   432  // resourceGroupName - the name of the resource group within the user's subscription. The name is case
   433  // insensitive.
   434  // domainServiceName - the name of the domain service.
   435  // ouContainerName - the name of the OuContainer.
   436  // containerAccount - container Account Description.
   437  func (client OuContainerClient) Update(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string, containerAccount ContainerAccount) (result OuContainerUpdateFuture, err error) {
   438  	if tracing.IsEnabled() {
   439  		ctx = tracing.StartSpan(ctx, fqdn+"/OuContainerClient.Update")
   440  		defer func() {
   441  			sc := -1
   442  			if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
   443  				sc = result.FutureAPI.Response().StatusCode
   444  			}
   445  			tracing.EndSpan(ctx, sc, err)
   446  		}()
   447  	}
   448  	if err := validation.Validate([]validation.Validation{
   449  		{TargetValue: resourceGroupName,
   450  			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
   451  				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
   452  				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
   453  		return result, validation.NewError("aad.OuContainerClient", "Update", err.Error())
   454  	}
   455  
   456  	req, err := client.UpdatePreparer(ctx, resourceGroupName, domainServiceName, ouContainerName, containerAccount)
   457  	if err != nil {
   458  		err = autorest.NewErrorWithError(err, "aad.OuContainerClient", "Update", nil, "Failure preparing request")
   459  		return
   460  	}
   461  
   462  	result, err = client.UpdateSender(req)
   463  	if err != nil {
   464  		err = autorest.NewErrorWithError(err, "aad.OuContainerClient", "Update", result.Response(), "Failure sending request")
   465  		return
   466  	}
   467  
   468  	return
   469  }
   470  
   471  // UpdatePreparer prepares the Update request.
   472  func (client OuContainerClient) UpdatePreparer(ctx context.Context, resourceGroupName string, domainServiceName string, ouContainerName string, containerAccount ContainerAccount) (*http.Request, error) {
   473  	pathParameters := map[string]interface{}{
   474  		"domainServiceName": autorest.Encode("path", domainServiceName),
   475  		"ouContainerName":   autorest.Encode("path", ouContainerName),
   476  		"resourceGroupName": autorest.Encode("path", resourceGroupName),
   477  		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
   478  	}
   479  
   480  	const APIVersion = "2020-01-01"
   481  	queryParameters := map[string]interface{}{
   482  		"api-version": APIVersion,
   483  	}
   484  
   485  	preparer := autorest.CreatePreparer(
   486  		autorest.AsContentType("application/json; charset=utf-8"),
   487  		autorest.AsPatch(),
   488  		autorest.WithBaseURL(client.BaseURI),
   489  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Aad/domainServices/{domainServiceName}/ouContainer/{ouContainerName}", pathParameters),
   490  		autorest.WithJSON(containerAccount),
   491  		autorest.WithQueryParameters(queryParameters))
   492  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   493  }
   494  
   495  // UpdateSender sends the Update request. The method will close the
   496  // http.Response Body if it receives an error.
   497  func (client OuContainerClient) UpdateSender(req *http.Request) (future OuContainerUpdateFuture, err error) {
   498  	var resp *http.Response
   499  	future.FutureAPI = &azure.Future{}
   500  	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
   501  	if err != nil {
   502  		return
   503  	}
   504  	var azf azure.Future
   505  	azf, err = azure.NewFutureFromResponse(resp)
   506  	future.FutureAPI = &azf
   507  	future.Result = future.result
   508  	return
   509  }
   510  
   511  // UpdateResponder handles the response to the Update request. The method always
   512  // closes the http.Response Body.
   513  func (client OuContainerClient) UpdateResponder(resp *http.Response) (result OuContainer, err error) {
   514  	err = autorest.Respond(
   515  		resp,
   516  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
   517  		autorest.ByUnmarshallingJSON(&result),
   518  		autorest.ByClosing())
   519  	result.Response = autorest.Response{Response: resp}
   520  	return
   521  }
   522  

View as plain text