/
DataLakeStoreExtensions.cs
85 lines (80 loc) · 5.44 KB
/
DataLakeStoreExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Text;
using Azure.ResourceManager.DataLakeStore.Models;
using Azure.ResourceManager.Resources;
using System.Threading;
namespace Azure.ResourceManager.DataLakeStore
{
public static partial class DataLakeStoreExtensions
{
/// <summary>
/// Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/accounts</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Accounts_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="subscriptionResource"> The <see cref="SubscriptionResource" /> instance the method will execute against. </param>
/// <param name="filter"> OData filter. Optional. </param>
/// <param name="top"> The number of items to return. Optional. </param>
/// <param name="skip"> The number of items to skip over before returning elements. Optional. </param>
/// <param name="select"> OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. </param>
/// <param name="orderBy"> OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. </param>
/// <param name="count"> The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <returns> An async collection of <see cref="DataLakeStoreAccountBasicData" /> that may take multiple service requests to iterate over. </returns>
public static AsyncPageable<DataLakeStoreAccountBasicData> GetAccountsAsync(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, int? skip = null, string select = null, string orderBy = null, bool? count = null, CancellationToken cancellationToken = default)
{
SubscriptionResourceGetAccountsOptions options = new SubscriptionResourceGetAccountsOptions();
options.Filter = filter;
options.Top = top;
options.Skip = skip;
options.Select = select;
options.OrderBy = orderBy;
options.Count = count;
return subscriptionResource.GetAccountsAsync(options, cancellationToken);
}
/// <summary>
/// Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/accounts</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Accounts_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="subscriptionResource"> The <see cref="SubscriptionResource" /> instance the method will execute against. </param>
/// <param name="filter"> OData filter. Optional. </param>
/// <param name="top"> The number of items to return. Optional. </param>
/// <param name="skip"> The number of items to skip over before returning elements. Optional. </param>
/// <param name="select"> OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. </param>
/// <param name="orderBy"> OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. </param>
/// <param name="count"> The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <returns> A collection of <see cref="DataLakeStoreAccountBasicData" /> that may take multiple service requests to iterate over. </returns>
public static Pageable<DataLakeStoreAccountBasicData> GetAccounts(this SubscriptionResource subscriptionResource, string filter = null, int? top = null, int? skip = null, string select = null, string orderBy = null, bool? count = null, CancellationToken cancellationToken = default)
{
SubscriptionResourceGetAccountsOptions options = new SubscriptionResourceGetAccountsOptions();
options.Filter = filter;
options.Top = top;
options.Skip = skip;
options.Select = select;
options.OrderBy = orderBy;
options.Count = count;
return subscriptionResource.GetAccounts(options, cancellationToken);
}
}
}