...

Source file src/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/links/resourcelinks.go

Documentation: github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/links

     1  package links
     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  // ResourceLinksClient is the azure resources can be linked together to form logical relationships. You can establish
    19  // links between resources belonging to different resource groups. However, all the linked resources must belong to the
    20  // same subscription. Each resource can be linked to 50 other resources. If any of the linked resources are deleted or
    21  // moved, the link owner must clean up the remaining link.
    22  type ResourceLinksClient struct {
    23  	BaseClient
    24  }
    25  
    26  // NewResourceLinksClient creates an instance of the ResourceLinksClient client.
    27  func NewResourceLinksClient(subscriptionID string) ResourceLinksClient {
    28  	return NewResourceLinksClientWithBaseURI(DefaultBaseURI, subscriptionID)
    29  }
    30  
    31  // NewResourceLinksClientWithBaseURI creates an instance of the ResourceLinksClient client using a custom endpoint.
    32  // Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
    33  func NewResourceLinksClientWithBaseURI(baseURI string, subscriptionID string) ResourceLinksClient {
    34  	return ResourceLinksClient{NewWithBaseURI(baseURI, subscriptionID)}
    35  }
    36  
    37  // CreateOrUpdate creates or updates a resource link between the specified resources.
    38  // Parameters:
    39  // linkID - the fully qualified ID of the resource link. Use the format,
    40  // /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/{provider-namespace}/{resource-type}/{resource-name}/Microsoft.Resources/links/{link-name}.
    41  // For example,
    42  // /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink
    43  // parameters - parameters for creating or updating a resource link.
    44  func (client ResourceLinksClient) CreateOrUpdate(ctx context.Context, linkID string, parameters ResourceLink) (result ResourceLink, err error) {
    45  	if tracing.IsEnabled() {
    46  		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceLinksClient.CreateOrUpdate")
    47  		defer func() {
    48  			sc := -1
    49  			if result.Response.Response != nil {
    50  				sc = result.Response.Response.StatusCode
    51  			}
    52  			tracing.EndSpan(ctx, sc, err)
    53  		}()
    54  	}
    55  	if err := validation.Validate([]validation.Validation{
    56  		{TargetValue: parameters,
    57  			Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false,
    58  				Chain: []validation.Constraint{{Target: "parameters.Properties.TargetID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
    59  		return result, validation.NewError("links.ResourceLinksClient", "CreateOrUpdate", err.Error())
    60  	}
    61  
    62  	req, err := client.CreateOrUpdatePreparer(ctx, linkID, parameters)
    63  	if err != nil {
    64  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "CreateOrUpdate", nil, "Failure preparing request")
    65  		return
    66  	}
    67  
    68  	resp, err := client.CreateOrUpdateSender(req)
    69  	if err != nil {
    70  		result.Response = autorest.Response{Response: resp}
    71  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "CreateOrUpdate", resp, "Failure sending request")
    72  		return
    73  	}
    74  
    75  	result, err = client.CreateOrUpdateResponder(resp)
    76  	if err != nil {
    77  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "CreateOrUpdate", resp, "Failure responding to request")
    78  		return
    79  	}
    80  
    81  	return
    82  }
    83  
    84  // CreateOrUpdatePreparer prepares the CreateOrUpdate request.
    85  func (client ResourceLinksClient) CreateOrUpdatePreparer(ctx context.Context, linkID string, parameters ResourceLink) (*http.Request, error) {
    86  	pathParameters := map[string]interface{}{
    87  		"linkId": linkID,
    88  	}
    89  
    90  	const APIVersion = "2016-09-01"
    91  	queryParameters := map[string]interface{}{
    92  		"api-version": APIVersion,
    93  	}
    94  
    95  	parameters.ID = nil
    96  	parameters.Name = nil
    97  	parameters.Type = ""
    98  	preparer := autorest.CreatePreparer(
    99  		autorest.AsContentType("application/json; charset=utf-8"),
   100  		autorest.AsPut(),
   101  		autorest.WithBaseURL(client.BaseURI),
   102  		autorest.WithPathParameters("/{linkId}", pathParameters),
   103  		autorest.WithJSON(parameters),
   104  		autorest.WithQueryParameters(queryParameters))
   105  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   106  }
   107  
   108  // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
   109  // http.Response Body if it receives an error.
   110  func (client ResourceLinksClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
   111  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   112  }
   113  
   114  // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
   115  // closes the http.Response Body.
   116  func (client ResourceLinksClient) CreateOrUpdateResponder(resp *http.Response) (result ResourceLink, err error) {
   117  	err = autorest.Respond(
   118  		resp,
   119  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
   120  		autorest.ByUnmarshallingJSON(&result),
   121  		autorest.ByClosing())
   122  	result.Response = autorest.Response{Response: resp}
   123  	return
   124  }
   125  
   126  // Delete deletes a resource link with the specified ID.
   127  // Parameters:
   128  // linkID - the fully qualified ID of the resource link. Use the format,
   129  // /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/{provider-namespace}/{resource-type}/{resource-name}/Microsoft.Resources/links/{link-name}.
   130  // For example,
   131  // /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink
   132  func (client ResourceLinksClient) Delete(ctx context.Context, linkID string) (result autorest.Response, err error) {
   133  	if tracing.IsEnabled() {
   134  		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceLinksClient.Delete")
   135  		defer func() {
   136  			sc := -1
   137  			if result.Response != nil {
   138  				sc = result.Response.StatusCode
   139  			}
   140  			tracing.EndSpan(ctx, sc, err)
   141  		}()
   142  	}
   143  	req, err := client.DeletePreparer(ctx, linkID)
   144  	if err != nil {
   145  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "Delete", nil, "Failure preparing request")
   146  		return
   147  	}
   148  
   149  	resp, err := client.DeleteSender(req)
   150  	if err != nil {
   151  		result.Response = resp
   152  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "Delete", resp, "Failure sending request")
   153  		return
   154  	}
   155  
   156  	result, err = client.DeleteResponder(resp)
   157  	if err != nil {
   158  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "Delete", resp, "Failure responding to request")
   159  		return
   160  	}
   161  
   162  	return
   163  }
   164  
   165  // DeletePreparer prepares the Delete request.
   166  func (client ResourceLinksClient) DeletePreparer(ctx context.Context, linkID string) (*http.Request, error) {
   167  	pathParameters := map[string]interface{}{
   168  		"linkId": linkID,
   169  	}
   170  
   171  	const APIVersion = "2016-09-01"
   172  	queryParameters := map[string]interface{}{
   173  		"api-version": APIVersion,
   174  	}
   175  
   176  	preparer := autorest.CreatePreparer(
   177  		autorest.AsDelete(),
   178  		autorest.WithBaseURL(client.BaseURI),
   179  		autorest.WithPathParameters("/{linkId}", pathParameters),
   180  		autorest.WithQueryParameters(queryParameters))
   181  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   182  }
   183  
   184  // DeleteSender sends the Delete request. The method will close the
   185  // http.Response Body if it receives an error.
   186  func (client ResourceLinksClient) DeleteSender(req *http.Request) (*http.Response, error) {
   187  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   188  }
   189  
   190  // DeleteResponder handles the response to the Delete request. The method always
   191  // closes the http.Response Body.
   192  func (client ResourceLinksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
   193  	err = autorest.Respond(
   194  		resp,
   195  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
   196  		autorest.ByClosing())
   197  	result.Response = resp
   198  	return
   199  }
   200  
   201  // Get gets a resource link with the specified ID.
   202  // Parameters:
   203  // linkID - the fully qualified Id of the resource link. For example,
   204  // /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup/Microsoft.Web/sites/mySite/Microsoft.Resources/links/myLink
   205  func (client ResourceLinksClient) Get(ctx context.Context, linkID string) (result ResourceLink, err error) {
   206  	if tracing.IsEnabled() {
   207  		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceLinksClient.Get")
   208  		defer func() {
   209  			sc := -1
   210  			if result.Response.Response != nil {
   211  				sc = result.Response.Response.StatusCode
   212  			}
   213  			tracing.EndSpan(ctx, sc, err)
   214  		}()
   215  	}
   216  	req, err := client.GetPreparer(ctx, linkID)
   217  	if err != nil {
   218  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "Get", nil, "Failure preparing request")
   219  		return
   220  	}
   221  
   222  	resp, err := client.GetSender(req)
   223  	if err != nil {
   224  		result.Response = autorest.Response{Response: resp}
   225  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "Get", resp, "Failure sending request")
   226  		return
   227  	}
   228  
   229  	result, err = client.GetResponder(resp)
   230  	if err != nil {
   231  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "Get", resp, "Failure responding to request")
   232  		return
   233  	}
   234  
   235  	return
   236  }
   237  
   238  // GetPreparer prepares the Get request.
   239  func (client ResourceLinksClient) GetPreparer(ctx context.Context, linkID string) (*http.Request, error) {
   240  	pathParameters := map[string]interface{}{
   241  		"linkId": linkID,
   242  	}
   243  
   244  	const APIVersion = "2016-09-01"
   245  	queryParameters := map[string]interface{}{
   246  		"api-version": APIVersion,
   247  	}
   248  
   249  	preparer := autorest.CreatePreparer(
   250  		autorest.AsGet(),
   251  		autorest.WithBaseURL(client.BaseURI),
   252  		autorest.WithPathParameters("/{linkId}", pathParameters),
   253  		autorest.WithQueryParameters(queryParameters))
   254  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   255  }
   256  
   257  // GetSender sends the Get request. The method will close the
   258  // http.Response Body if it receives an error.
   259  func (client ResourceLinksClient) GetSender(req *http.Request) (*http.Response, error) {
   260  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   261  }
   262  
   263  // GetResponder handles the response to the Get request. The method always
   264  // closes the http.Response Body.
   265  func (client ResourceLinksClient) GetResponder(resp *http.Response) (result ResourceLink, err error) {
   266  	err = autorest.Respond(
   267  		resp,
   268  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   269  		autorest.ByUnmarshallingJSON(&result),
   270  		autorest.ByClosing())
   271  	result.Response = autorest.Response{Response: resp}
   272  	return
   273  }
   274  
   275  // ListAtSourceScope gets a list of resource links at and below the specified source scope.
   276  // Parameters:
   277  // scope - the fully qualified ID of the scope for getting the resource links. For example, to list resource
   278  // links at and under a resource group, set the scope to
   279  // /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup.
   280  // filter - the filter to apply when getting resource links. To get links only at the specified scope (not
   281  // below the scope), use Filter.atScope().
   282  func (client ResourceLinksClient) ListAtSourceScope(ctx context.Context, scope string, filter Filter) (result ResourceLinkResultPage, err error) {
   283  	if tracing.IsEnabled() {
   284  		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceLinksClient.ListAtSourceScope")
   285  		defer func() {
   286  			sc := -1
   287  			if result.rlr.Response.Response != nil {
   288  				sc = result.rlr.Response.Response.StatusCode
   289  			}
   290  			tracing.EndSpan(ctx, sc, err)
   291  		}()
   292  	}
   293  	result.fn = client.listAtSourceScopeNextResults
   294  	req, err := client.ListAtSourceScopePreparer(ctx, scope, filter)
   295  	if err != nil {
   296  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "ListAtSourceScope", nil, "Failure preparing request")
   297  		return
   298  	}
   299  
   300  	resp, err := client.ListAtSourceScopeSender(req)
   301  	if err != nil {
   302  		result.rlr.Response = autorest.Response{Response: resp}
   303  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "ListAtSourceScope", resp, "Failure sending request")
   304  		return
   305  	}
   306  
   307  	result.rlr, err = client.ListAtSourceScopeResponder(resp)
   308  	if err != nil {
   309  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "ListAtSourceScope", resp, "Failure responding to request")
   310  		return
   311  	}
   312  	if result.rlr.hasNextLink() && result.rlr.IsEmpty() {
   313  		err = result.NextWithContext(ctx)
   314  		return
   315  	}
   316  
   317  	return
   318  }
   319  
   320  // ListAtSourceScopePreparer prepares the ListAtSourceScope request.
   321  func (client ResourceLinksClient) ListAtSourceScopePreparer(ctx context.Context, scope string, filter Filter) (*http.Request, error) {
   322  	pathParameters := map[string]interface{}{
   323  		"scope": scope,
   324  	}
   325  
   326  	const APIVersion = "2016-09-01"
   327  	queryParameters := map[string]interface{}{
   328  		"api-version": APIVersion,
   329  	}
   330  	if len(string(filter)) > 0 {
   331  		queryParameters["$filter"] = autorest.Encode("query", filter)
   332  	}
   333  
   334  	preparer := autorest.CreatePreparer(
   335  		autorest.AsGet(),
   336  		autorest.WithBaseURL(client.BaseURI),
   337  		autorest.WithPathParameters("/{scope}/providers/Microsoft.Resources/links", pathParameters),
   338  		autorest.WithQueryParameters(queryParameters))
   339  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   340  }
   341  
   342  // ListAtSourceScopeSender sends the ListAtSourceScope request. The method will close the
   343  // http.Response Body if it receives an error.
   344  func (client ResourceLinksClient) ListAtSourceScopeSender(req *http.Request) (*http.Response, error) {
   345  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   346  }
   347  
   348  // ListAtSourceScopeResponder handles the response to the ListAtSourceScope request. The method always
   349  // closes the http.Response Body.
   350  func (client ResourceLinksClient) ListAtSourceScopeResponder(resp *http.Response) (result ResourceLinkResult, err error) {
   351  	err = autorest.Respond(
   352  		resp,
   353  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   354  		autorest.ByUnmarshallingJSON(&result),
   355  		autorest.ByClosing())
   356  	result.Response = autorest.Response{Response: resp}
   357  	return
   358  }
   359  
   360  // listAtSourceScopeNextResults retrieves the next set of results, if any.
   361  func (client ResourceLinksClient) listAtSourceScopeNextResults(ctx context.Context, lastResults ResourceLinkResult) (result ResourceLinkResult, err error) {
   362  	req, err := lastResults.resourceLinkResultPreparer(ctx)
   363  	if err != nil {
   364  		return result, autorest.NewErrorWithError(err, "links.ResourceLinksClient", "listAtSourceScopeNextResults", nil, "Failure preparing next results request")
   365  	}
   366  	if req == nil {
   367  		return
   368  	}
   369  	resp, err := client.ListAtSourceScopeSender(req)
   370  	if err != nil {
   371  		result.Response = autorest.Response{Response: resp}
   372  		return result, autorest.NewErrorWithError(err, "links.ResourceLinksClient", "listAtSourceScopeNextResults", resp, "Failure sending next results request")
   373  	}
   374  	result, err = client.ListAtSourceScopeResponder(resp)
   375  	if err != nil {
   376  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "listAtSourceScopeNextResults", resp, "Failure responding to next results request")
   377  	}
   378  	return
   379  }
   380  
   381  // ListAtSourceScopeComplete enumerates all values, automatically crossing page boundaries as required.
   382  func (client ResourceLinksClient) ListAtSourceScopeComplete(ctx context.Context, scope string, filter Filter) (result ResourceLinkResultIterator, err error) {
   383  	if tracing.IsEnabled() {
   384  		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceLinksClient.ListAtSourceScope")
   385  		defer func() {
   386  			sc := -1
   387  			if result.Response().Response.Response != nil {
   388  				sc = result.page.Response().Response.Response.StatusCode
   389  			}
   390  			tracing.EndSpan(ctx, sc, err)
   391  		}()
   392  	}
   393  	result.page, err = client.ListAtSourceScope(ctx, scope, filter)
   394  	return
   395  }
   396  
   397  // ListAtSubscription gets all the linked resources for the subscription.
   398  // Parameters:
   399  // filter - the filter to apply on the list resource links operation. The supported filter for list resource
   400  // links is targetId. For example, $filter=targetId eq {value}
   401  func (client ResourceLinksClient) ListAtSubscription(ctx context.Context, filter string) (result ResourceLinkResultPage, err error) {
   402  	if tracing.IsEnabled() {
   403  		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceLinksClient.ListAtSubscription")
   404  		defer func() {
   405  			sc := -1
   406  			if result.rlr.Response.Response != nil {
   407  				sc = result.rlr.Response.Response.StatusCode
   408  			}
   409  			tracing.EndSpan(ctx, sc, err)
   410  		}()
   411  	}
   412  	result.fn = client.listAtSubscriptionNextResults
   413  	req, err := client.ListAtSubscriptionPreparer(ctx, filter)
   414  	if err != nil {
   415  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "ListAtSubscription", nil, "Failure preparing request")
   416  		return
   417  	}
   418  
   419  	resp, err := client.ListAtSubscriptionSender(req)
   420  	if err != nil {
   421  		result.rlr.Response = autorest.Response{Response: resp}
   422  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "ListAtSubscription", resp, "Failure sending request")
   423  		return
   424  	}
   425  
   426  	result.rlr, err = client.ListAtSubscriptionResponder(resp)
   427  	if err != nil {
   428  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "ListAtSubscription", resp, "Failure responding to request")
   429  		return
   430  	}
   431  	if result.rlr.hasNextLink() && result.rlr.IsEmpty() {
   432  		err = result.NextWithContext(ctx)
   433  		return
   434  	}
   435  
   436  	return
   437  }
   438  
   439  // ListAtSubscriptionPreparer prepares the ListAtSubscription request.
   440  func (client ResourceLinksClient) ListAtSubscriptionPreparer(ctx context.Context, filter string) (*http.Request, error) {
   441  	pathParameters := map[string]interface{}{
   442  		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
   443  	}
   444  
   445  	const APIVersion = "2016-09-01"
   446  	queryParameters := map[string]interface{}{
   447  		"api-version": APIVersion,
   448  	}
   449  	if len(filter) > 0 {
   450  		queryParameters["$filter"] = autorest.Encode("query", filter)
   451  	}
   452  
   453  	preparer := autorest.CreatePreparer(
   454  		autorest.AsGet(),
   455  		autorest.WithBaseURL(client.BaseURI),
   456  		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/links", pathParameters),
   457  		autorest.WithQueryParameters(queryParameters))
   458  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   459  }
   460  
   461  // ListAtSubscriptionSender sends the ListAtSubscription request. The method will close the
   462  // http.Response Body if it receives an error.
   463  func (client ResourceLinksClient) ListAtSubscriptionSender(req *http.Request) (*http.Response, error) {
   464  	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
   465  }
   466  
   467  // ListAtSubscriptionResponder handles the response to the ListAtSubscription request. The method always
   468  // closes the http.Response Body.
   469  func (client ResourceLinksClient) ListAtSubscriptionResponder(resp *http.Response) (result ResourceLinkResult, err error) {
   470  	err = autorest.Respond(
   471  		resp,
   472  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   473  		autorest.ByUnmarshallingJSON(&result),
   474  		autorest.ByClosing())
   475  	result.Response = autorest.Response{Response: resp}
   476  	return
   477  }
   478  
   479  // listAtSubscriptionNextResults retrieves the next set of results, if any.
   480  func (client ResourceLinksClient) listAtSubscriptionNextResults(ctx context.Context, lastResults ResourceLinkResult) (result ResourceLinkResult, err error) {
   481  	req, err := lastResults.resourceLinkResultPreparer(ctx)
   482  	if err != nil {
   483  		return result, autorest.NewErrorWithError(err, "links.ResourceLinksClient", "listAtSubscriptionNextResults", nil, "Failure preparing next results request")
   484  	}
   485  	if req == nil {
   486  		return
   487  	}
   488  	resp, err := client.ListAtSubscriptionSender(req)
   489  	if err != nil {
   490  		result.Response = autorest.Response{Response: resp}
   491  		return result, autorest.NewErrorWithError(err, "links.ResourceLinksClient", "listAtSubscriptionNextResults", resp, "Failure sending next results request")
   492  	}
   493  	result, err = client.ListAtSubscriptionResponder(resp)
   494  	if err != nil {
   495  		err = autorest.NewErrorWithError(err, "links.ResourceLinksClient", "listAtSubscriptionNextResults", resp, "Failure responding to next results request")
   496  	}
   497  	return
   498  }
   499  
   500  // ListAtSubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
   501  func (client ResourceLinksClient) ListAtSubscriptionComplete(ctx context.Context, filter string) (result ResourceLinkResultIterator, err error) {
   502  	if tracing.IsEnabled() {
   503  		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceLinksClient.ListAtSubscription")
   504  		defer func() {
   505  			sc := -1
   506  			if result.Response().Response.Response != nil {
   507  				sc = result.page.Response().Response.Response.StatusCode
   508  			}
   509  			tracing.EndSpan(ctx, sc, err)
   510  		}()
   511  	}
   512  	result.page, err = client.ListAtSubscription(ctx, filter)
   513  	return
   514  }
   515  

View as plain text