1package securityinsight
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
9import (
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// BookmarkRelationsClient is the API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider
19type BookmarkRelationsClient struct {
20	BaseClient
21}
22
23// NewBookmarkRelationsClient creates an instance of the BookmarkRelationsClient client.
24func NewBookmarkRelationsClient(subscriptionID string) BookmarkRelationsClient {
25	return NewBookmarkRelationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
26}
27
28// NewBookmarkRelationsClientWithBaseURI creates an instance of the BookmarkRelationsClient client using a custom
29// endpoint.  Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
30// stack).
31func NewBookmarkRelationsClientWithBaseURI(baseURI string, subscriptionID string) BookmarkRelationsClient {
32	return BookmarkRelationsClient{NewWithBaseURI(baseURI, subscriptionID)}
33}
34
35// CreateOrUpdateRelation creates the bookmark relation.
36// Parameters:
37// resourceGroupName - the name of the resource group within the user's subscription. The name is case
38// insensitive.
39// operationalInsightsResourceProvider - the namespace of workspaces resource provider-
40// Microsoft.OperationalInsights.
41// workspaceName - the name of the workspace.
42// bookmarkID - bookmark ID
43// relationName - relation Name
44// relation - the relation model
45func (client BookmarkRelationsClient) CreateOrUpdateRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string, relation Relation) (result Relation, err error) {
46	if tracing.IsEnabled() {
47		ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationsClient.CreateOrUpdateRelation")
48		defer func() {
49			sc := -1
50			if result.Response.Response != nil {
51				sc = result.Response.Response.StatusCode
52			}
53			tracing.EndSpan(ctx, sc, err)
54		}()
55	}
56	if err := validation.Validate([]validation.Validation{
57		{TargetValue: client.SubscriptionID,
58			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}},
59		{TargetValue: resourceGroupName,
60			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
61				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
62				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
63		{TargetValue: workspaceName,
64			Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil},
65				{Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
66		{TargetValue: relation,
67			Constraints: []validation.Constraint{{Target: "relation.RelationProperties", Name: validation.Null, Rule: false,
68				Chain: []validation.Constraint{{Target: "relation.RelationProperties.RelatedResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
69		return result, validation.NewError("securityinsight.BookmarkRelationsClient", "CreateOrUpdateRelation", err.Error())
70	}
71
72	req, err := client.CreateOrUpdateRelationPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, bookmarkID, relationName, relation)
73	if err != nil {
74		err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "CreateOrUpdateRelation", nil, "Failure preparing request")
75		return
76	}
77
78	resp, err := client.CreateOrUpdateRelationSender(req)
79	if err != nil {
80		result.Response = autorest.Response{Response: resp}
81		err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "CreateOrUpdateRelation", resp, "Failure sending request")
82		return
83	}
84
85	result, err = client.CreateOrUpdateRelationResponder(resp)
86	if err != nil {
87		err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "CreateOrUpdateRelation", resp, "Failure responding to request")
88		return
89	}
90
91	return
92}
93
94// CreateOrUpdateRelationPreparer prepares the CreateOrUpdateRelation request.
95func (client BookmarkRelationsClient) CreateOrUpdateRelationPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string, relation Relation) (*http.Request, error) {
96	pathParameters := map[string]interface{}{
97		"bookmarkId":                          autorest.Encode("path", bookmarkID),
98		"operationalInsightsResourceProvider": autorest.Encode("path", operationalInsightsResourceProvider),
99		"relationName":                        autorest.Encode("path", relationName),
100		"resourceGroupName":                   autorest.Encode("path", resourceGroupName),
101		"subscriptionId":                      autorest.Encode("path", client.SubscriptionID),
102		"workspaceName":                       autorest.Encode("path", workspaceName),
103	}
104
105	const APIVersion = "2019-01-01-preview"
106	queryParameters := map[string]interface{}{
107		"api-version": APIVersion,
108	}
109
110	preparer := autorest.CreatePreparer(
111		autorest.AsContentType("application/json; charset=utf-8"),
112		autorest.AsPut(),
113		autorest.WithBaseURL(client.BaseURI),
114		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}", pathParameters),
115		autorest.WithJSON(relation),
116		autorest.WithQueryParameters(queryParameters))
117	return preparer.Prepare((&http.Request{}).WithContext(ctx))
118}
119
120// CreateOrUpdateRelationSender sends the CreateOrUpdateRelation request. The method will close the
121// http.Response Body if it receives an error.
122func (client BookmarkRelationsClient) CreateOrUpdateRelationSender(req *http.Request) (*http.Response, error) {
123	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
124}
125
126// CreateOrUpdateRelationResponder handles the response to the CreateOrUpdateRelation request. The method always
127// closes the http.Response Body.
128func (client BookmarkRelationsClient) CreateOrUpdateRelationResponder(resp *http.Response) (result Relation, err error) {
129	err = autorest.Respond(
130		resp,
131		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
132		autorest.ByUnmarshallingJSON(&result),
133		autorest.ByClosing())
134	result.Response = autorest.Response{Response: resp}
135	return
136}
137
138// DeleteRelation delete the bookmark relation.
139// Parameters:
140// resourceGroupName - the name of the resource group within the user's subscription. The name is case
141// insensitive.
142// operationalInsightsResourceProvider - the namespace of workspaces resource provider-
143// Microsoft.OperationalInsights.
144// workspaceName - the name of the workspace.
145// bookmarkID - bookmark ID
146// relationName - relation Name
147func (client BookmarkRelationsClient) DeleteRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string) (result autorest.Response, err error) {
148	if tracing.IsEnabled() {
149		ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationsClient.DeleteRelation")
150		defer func() {
151			sc := -1
152			if result.Response != nil {
153				sc = result.Response.StatusCode
154			}
155			tracing.EndSpan(ctx, sc, err)
156		}()
157	}
158	if err := validation.Validate([]validation.Validation{
159		{TargetValue: client.SubscriptionID,
160			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}},
161		{TargetValue: resourceGroupName,
162			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
163				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
164				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
165		{TargetValue: workspaceName,
166			Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil},
167				{Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
168		return result, validation.NewError("securityinsight.BookmarkRelationsClient", "DeleteRelation", err.Error())
169	}
170
171	req, err := client.DeleteRelationPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, bookmarkID, relationName)
172	if err != nil {
173		err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "DeleteRelation", nil, "Failure preparing request")
174		return
175	}
176
177	resp, err := client.DeleteRelationSender(req)
178	if err != nil {
179		result.Response = resp
180		err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "DeleteRelation", resp, "Failure sending request")
181		return
182	}
183
184	result, err = client.DeleteRelationResponder(resp)
185	if err != nil {
186		err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "DeleteRelation", resp, "Failure responding to request")
187		return
188	}
189
190	return
191}
192
193// DeleteRelationPreparer prepares the DeleteRelation request.
194func (client BookmarkRelationsClient) DeleteRelationPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string) (*http.Request, error) {
195	pathParameters := map[string]interface{}{
196		"bookmarkId":                          autorest.Encode("path", bookmarkID),
197		"operationalInsightsResourceProvider": autorest.Encode("path", operationalInsightsResourceProvider),
198		"relationName":                        autorest.Encode("path", relationName),
199		"resourceGroupName":                   autorest.Encode("path", resourceGroupName),
200		"subscriptionId":                      autorest.Encode("path", client.SubscriptionID),
201		"workspaceName":                       autorest.Encode("path", workspaceName),
202	}
203
204	const APIVersion = "2019-01-01-preview"
205	queryParameters := map[string]interface{}{
206		"api-version": APIVersion,
207	}
208
209	preparer := autorest.CreatePreparer(
210		autorest.AsDelete(),
211		autorest.WithBaseURL(client.BaseURI),
212		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}", pathParameters),
213		autorest.WithQueryParameters(queryParameters))
214	return preparer.Prepare((&http.Request{}).WithContext(ctx))
215}
216
217// DeleteRelationSender sends the DeleteRelation request. The method will close the
218// http.Response Body if it receives an error.
219func (client BookmarkRelationsClient) DeleteRelationSender(req *http.Request) (*http.Response, error) {
220	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
221}
222
223// DeleteRelationResponder handles the response to the DeleteRelation request. The method always
224// closes the http.Response Body.
225func (client BookmarkRelationsClient) DeleteRelationResponder(resp *http.Response) (result autorest.Response, err error) {
226	err = autorest.Respond(
227		resp,
228		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
229		autorest.ByClosing())
230	result.Response = resp
231	return
232}
233
234// GetRelation gets a bookmark relation.
235// Parameters:
236// resourceGroupName - the name of the resource group within the user's subscription. The name is case
237// insensitive.
238// operationalInsightsResourceProvider - the namespace of workspaces resource provider-
239// Microsoft.OperationalInsights.
240// workspaceName - the name of the workspace.
241// bookmarkID - bookmark ID
242// relationName - relation Name
243func (client BookmarkRelationsClient) GetRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string) (result Relation, err error) {
244	if tracing.IsEnabled() {
245		ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationsClient.GetRelation")
246		defer func() {
247			sc := -1
248			if result.Response.Response != nil {
249				sc = result.Response.Response.StatusCode
250			}
251			tracing.EndSpan(ctx, sc, err)
252		}()
253	}
254	if err := validation.Validate([]validation.Validation{
255		{TargetValue: client.SubscriptionID,
256			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}},
257		{TargetValue: resourceGroupName,
258			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
259				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
260				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
261		{TargetValue: workspaceName,
262			Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil},
263				{Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
264		return result, validation.NewError("securityinsight.BookmarkRelationsClient", "GetRelation", err.Error())
265	}
266
267	req, err := client.GetRelationPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, bookmarkID, relationName)
268	if err != nil {
269		err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "GetRelation", nil, "Failure preparing request")
270		return
271	}
272
273	resp, err := client.GetRelationSender(req)
274	if err != nil {
275		result.Response = autorest.Response{Response: resp}
276		err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "GetRelation", resp, "Failure sending request")
277		return
278	}
279
280	result, err = client.GetRelationResponder(resp)
281	if err != nil {
282		err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "GetRelation", resp, "Failure responding to request")
283		return
284	}
285
286	return
287}
288
289// GetRelationPreparer prepares the GetRelation request.
290func (client BookmarkRelationsClient) GetRelationPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string) (*http.Request, error) {
291	pathParameters := map[string]interface{}{
292		"bookmarkId":                          autorest.Encode("path", bookmarkID),
293		"operationalInsightsResourceProvider": autorest.Encode("path", operationalInsightsResourceProvider),
294		"relationName":                        autorest.Encode("path", relationName),
295		"resourceGroupName":                   autorest.Encode("path", resourceGroupName),
296		"subscriptionId":                      autorest.Encode("path", client.SubscriptionID),
297		"workspaceName":                       autorest.Encode("path", workspaceName),
298	}
299
300	const APIVersion = "2019-01-01-preview"
301	queryParameters := map[string]interface{}{
302		"api-version": APIVersion,
303	}
304
305	preparer := autorest.CreatePreparer(
306		autorest.AsGet(),
307		autorest.WithBaseURL(client.BaseURI),
308		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}", pathParameters),
309		autorest.WithQueryParameters(queryParameters))
310	return preparer.Prepare((&http.Request{}).WithContext(ctx))
311}
312
313// GetRelationSender sends the GetRelation request. The method will close the
314// http.Response Body if it receives an error.
315func (client BookmarkRelationsClient) GetRelationSender(req *http.Request) (*http.Response, error) {
316	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
317}
318
319// GetRelationResponder handles the response to the GetRelation request. The method always
320// closes the http.Response Body.
321func (client BookmarkRelationsClient) GetRelationResponder(resp *http.Response) (result Relation, err error) {
322	err = autorest.Respond(
323		resp,
324		azure.WithErrorUnlessStatusCode(http.StatusOK),
325		autorest.ByUnmarshallingJSON(&result),
326		autorest.ByClosing())
327	result.Response = autorest.Response{Response: resp}
328	return
329}
330
331// List gets all bookmark relations.
332// Parameters:
333// resourceGroupName - the name of the resource group within the user's subscription. The name is case
334// insensitive.
335// operationalInsightsResourceProvider - the namespace of workspaces resource provider-
336// Microsoft.OperationalInsights.
337// workspaceName - the name of the workspace.
338// bookmarkID - bookmark ID
339// filter - filters the results, based on a Boolean condition. Optional.
340// orderby - sorts the results. Optional.
341// top - returns only the first n results. Optional.
342// skipToken - skiptoken is only used if a previous operation returned a partial result. If a previous response
343// contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that
344// specifies a starting point to use for subsequent calls. Optional.
345func (client BookmarkRelationsClient) List(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, filter string, orderby string, top *int32, skipToken string) (result RelationListPage, err error) {
346	if tracing.IsEnabled() {
347		ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationsClient.List")
348		defer func() {
349			sc := -1
350			if result.rl.Response.Response != nil {
351				sc = result.rl.Response.Response.StatusCode
352			}
353			tracing.EndSpan(ctx, sc, err)
354		}()
355	}
356	if err := validation.Validate([]validation.Validation{
357		{TargetValue: client.SubscriptionID,
358			Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}},
359		{TargetValue: resourceGroupName,
360			Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
361				{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
362				{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
363		{TargetValue: workspaceName,
364			Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil},
365				{Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
366		return result, validation.NewError("securityinsight.BookmarkRelationsClient", "List", err.Error())
367	}
368
369	result.fn = client.listNextResults
370	req, err := client.ListPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, bookmarkID, filter, orderby, top, skipToken)
371	if err != nil {
372		err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "List", nil, "Failure preparing request")
373		return
374	}
375
376	resp, err := client.ListSender(req)
377	if err != nil {
378		result.rl.Response = autorest.Response{Response: resp}
379		err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "List", resp, "Failure sending request")
380		return
381	}
382
383	result.rl, err = client.ListResponder(resp)
384	if err != nil {
385		err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "List", resp, "Failure responding to request")
386		return
387	}
388	if result.rl.hasNextLink() && result.rl.IsEmpty() {
389		err = result.NextWithContext(ctx)
390		return
391	}
392
393	return
394}
395
396// ListPreparer prepares the List request.
397func (client BookmarkRelationsClient) ListPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, filter string, orderby string, top *int32, skipToken string) (*http.Request, error) {
398	pathParameters := map[string]interface{}{
399		"bookmarkId":                          autorest.Encode("path", bookmarkID),
400		"operationalInsightsResourceProvider": autorest.Encode("path", operationalInsightsResourceProvider),
401		"resourceGroupName":                   autorest.Encode("path", resourceGroupName),
402		"subscriptionId":                      autorest.Encode("path", client.SubscriptionID),
403		"workspaceName":                       autorest.Encode("path", workspaceName),
404	}
405
406	const APIVersion = "2019-01-01-preview"
407	queryParameters := map[string]interface{}{
408		"api-version": APIVersion,
409	}
410	if len(filter) > 0 {
411		queryParameters["$filter"] = autorest.Encode("query", filter)
412	}
413	if len(orderby) > 0 {
414		queryParameters["$orderby"] = autorest.Encode("query", orderby)
415	}
416	if top != nil {
417		queryParameters["$top"] = autorest.Encode("query", *top)
418	}
419	if len(skipToken) > 0 {
420		queryParameters["$skipToken"] = autorest.Encode("query", skipToken)
421	}
422
423	preparer := autorest.CreatePreparer(
424		autorest.AsGet(),
425		autorest.WithBaseURL(client.BaseURI),
426		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations", pathParameters),
427		autorest.WithQueryParameters(queryParameters))
428	return preparer.Prepare((&http.Request{}).WithContext(ctx))
429}
430
431// ListSender sends the List request. The method will close the
432// http.Response Body if it receives an error.
433func (client BookmarkRelationsClient) ListSender(req *http.Request) (*http.Response, error) {
434	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
435}
436
437// ListResponder handles the response to the List request. The method always
438// closes the http.Response Body.
439func (client BookmarkRelationsClient) ListResponder(resp *http.Response) (result RelationList, err error) {
440	err = autorest.Respond(
441		resp,
442		azure.WithErrorUnlessStatusCode(http.StatusOK),
443		autorest.ByUnmarshallingJSON(&result),
444		autorest.ByClosing())
445	result.Response = autorest.Response{Response: resp}
446	return
447}
448
449// listNextResults retrieves the next set of results, if any.
450func (client BookmarkRelationsClient) listNextResults(ctx context.Context, lastResults RelationList) (result RelationList, err error) {
451	req, err := lastResults.relationListPreparer(ctx)
452	if err != nil {
453		return result, autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "listNextResults", nil, "Failure preparing next results request")
454	}
455	if req == nil {
456		return
457	}
458	resp, err := client.ListSender(req)
459	if err != nil {
460		result.Response = autorest.Response{Response: resp}
461		return result, autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "listNextResults", resp, "Failure sending next results request")
462	}
463	result, err = client.ListResponder(resp)
464	if err != nil {
465		err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "listNextResults", resp, "Failure responding to next results request")
466	}
467	return
468}
469
470// ListComplete enumerates all values, automatically crossing page boundaries as required.
471func (client BookmarkRelationsClient) ListComplete(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, filter string, orderby string, top *int32, skipToken string) (result RelationListIterator, err error) {
472	if tracing.IsEnabled() {
473		ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationsClient.List")
474		defer func() {
475			sc := -1
476			if result.Response().Response.Response != nil {
477				sc = result.page.Response().Response.Response.StatusCode
478			}
479			tracing.EndSpan(ctx, sc, err)
480		}()
481	}
482	result.page, err = client.List(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, bookmarkID, filter, orderby, top, skipToken)
483	return
484}
485