-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
HybridDataExtensions.cs
270 lines (253 loc) · 15.1 KB
/
HybridDataExtensions.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.ResourceManager;
using Azure.ResourceManager.Resources;
namespace Azure.ResourceManager.HybridData
{
/// <summary> A class to add extension methods to Azure.ResourceManager.HybridData. </summary>
public static partial class HybridDataExtensions
{
private static SubscriptionResourceExtensionClient GetExtensionClient(SubscriptionResource subscriptionResource)
{
return subscriptionResource.GetCachedClient((client) =>
{
return new SubscriptionResourceExtensionClient(client, subscriptionResource.Id);
}
);
}
/// <summary>
/// Lists all the data manager resources available under the subscription.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/subscriptions/{subscriptionId}/providers/Microsoft.HybridData/dataManagers</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>DataManagers_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="subscriptionResource"> The <see cref="SubscriptionResource" /> instance the method will execute against. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <returns> An async collection of <see cref="HybridDataManagerResource" /> that may take multiple service requests to iterate over. </returns>
public static AsyncPageable<HybridDataManagerResource> GetHybridDataManagersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default)
{
return GetExtensionClient(subscriptionResource).GetHybridDataManagersAsync(cancellationToken);
}
/// <summary>
/// Lists all the data manager resources available under the subscription.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/subscriptions/{subscriptionId}/providers/Microsoft.HybridData/dataManagers</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>DataManagers_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="subscriptionResource"> The <see cref="SubscriptionResource" /> instance the method will execute against. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <returns> A collection of <see cref="HybridDataManagerResource" /> that may take multiple service requests to iterate over. </returns>
public static Pageable<HybridDataManagerResource> GetHybridDataManagers(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default)
{
return GetExtensionClient(subscriptionResource).GetHybridDataManagers(cancellationToken);
}
private static ResourceGroupResourceExtensionClient GetExtensionClient(ResourceGroupResource resourceGroupResource)
{
return resourceGroupResource.GetCachedClient((client) =>
{
return new ResourceGroupResourceExtensionClient(client, resourceGroupResource.Id);
}
);
}
/// <summary> Gets a collection of HybridDataManagerResources in the ResourceGroupResource. </summary>
/// <param name="resourceGroupResource"> The <see cref="ResourceGroupResource" /> instance the method will execute against. </param>
/// <returns> An object representing collection of HybridDataManagerResources and their operations over a HybridDataManagerResource. </returns>
public static HybridDataManagerCollection GetHybridDataManagers(this ResourceGroupResource resourceGroupResource)
{
return GetExtensionClient(resourceGroupResource).GetHybridDataManagers();
}
/// <summary>
/// Gets information about the specified data manager resource.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>DataManagers_Get</description>
/// </item>
/// </list>
/// </summary>
/// <param name="resourceGroupResource"> The <see cref="ResourceGroupResource" /> instance the method will execute against. </param>
/// <param name="dataManagerName"> The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentException"> <paramref name="dataManagerName"/> is an empty string, and was expected to be non-empty. </exception>
/// <exception cref="ArgumentNullException"> <paramref name="dataManagerName"/> is null. </exception>
[ForwardsClientCalls]
public static async Task<Response<HybridDataManagerResource>> GetHybridDataManagerAsync(this ResourceGroupResource resourceGroupResource, string dataManagerName, CancellationToken cancellationToken = default)
{
return await resourceGroupResource.GetHybridDataManagers().GetAsync(dataManagerName, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Gets information about the specified data manager resource.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>DataManagers_Get</description>
/// </item>
/// </list>
/// </summary>
/// <param name="resourceGroupResource"> The <see cref="ResourceGroupResource" /> instance the method will execute against. </param>
/// <param name="dataManagerName"> The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentException"> <paramref name="dataManagerName"/> is an empty string, and was expected to be non-empty. </exception>
/// <exception cref="ArgumentNullException"> <paramref name="dataManagerName"/> is null. </exception>
[ForwardsClientCalls]
public static Response<HybridDataManagerResource> GetHybridDataManager(this ResourceGroupResource resourceGroupResource, string dataManagerName, CancellationToken cancellationToken = default)
{
return resourceGroupResource.GetHybridDataManagers().Get(dataManagerName, cancellationToken);
}
#region HybridDataManagerResource
/// <summary>
/// Gets an object representing a <see cref="HybridDataManagerResource" /> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="HybridDataManagerResource.CreateResourceIdentifier" /> to create a <see cref="HybridDataManagerResource" /> <see cref="ResourceIdentifier" /> from its components.
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="HybridDataManagerResource" /> object. </returns>
public static HybridDataManagerResource GetHybridDataManagerResource(this ArmClient client, ResourceIdentifier id)
{
return client.GetResourceClient(() =>
{
HybridDataManagerResource.ValidateResourceId(id);
return new HybridDataManagerResource(client, id);
}
);
}
#endregion
#region HybridDataServiceResource
/// <summary>
/// Gets an object representing a <see cref="HybridDataServiceResource" /> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="HybridDataServiceResource.CreateResourceIdentifier" /> to create a <see cref="HybridDataServiceResource" /> <see cref="ResourceIdentifier" /> from its components.
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="HybridDataServiceResource" /> object. </returns>
public static HybridDataServiceResource GetHybridDataServiceResource(this ArmClient client, ResourceIdentifier id)
{
return client.GetResourceClient(() =>
{
HybridDataServiceResource.ValidateResourceId(id);
return new HybridDataServiceResource(client, id);
}
);
}
#endregion
#region HybridDataJobDefinitionResource
/// <summary>
/// Gets an object representing a <see cref="HybridDataJobDefinitionResource" /> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="HybridDataJobDefinitionResource.CreateResourceIdentifier" /> to create a <see cref="HybridDataJobDefinitionResource" /> <see cref="ResourceIdentifier" /> from its components.
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="HybridDataJobDefinitionResource" /> object. </returns>
public static HybridDataJobDefinitionResource GetHybridDataJobDefinitionResource(this ArmClient client, ResourceIdentifier id)
{
return client.GetResourceClient(() =>
{
HybridDataJobDefinitionResource.ValidateResourceId(id);
return new HybridDataJobDefinitionResource(client, id);
}
);
}
#endregion
#region HybridDataJobResource
/// <summary>
/// Gets an object representing a <see cref="HybridDataJobResource" /> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="HybridDataJobResource.CreateResourceIdentifier" /> to create a <see cref="HybridDataJobResource" /> <see cref="ResourceIdentifier" /> from its components.
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="HybridDataJobResource" /> object. </returns>
public static HybridDataJobResource GetHybridDataJobResource(this ArmClient client, ResourceIdentifier id)
{
return client.GetResourceClient(() =>
{
HybridDataJobResource.ValidateResourceId(id);
return new HybridDataJobResource(client, id);
}
);
}
#endregion
#region HybridDataStoreResource
/// <summary>
/// Gets an object representing a <see cref="HybridDataStoreResource" /> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="HybridDataStoreResource.CreateResourceIdentifier" /> to create a <see cref="HybridDataStoreResource" /> <see cref="ResourceIdentifier" /> from its components.
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="HybridDataStoreResource" /> object. </returns>
public static HybridDataStoreResource GetHybridDataStoreResource(this ArmClient client, ResourceIdentifier id)
{
return client.GetResourceClient(() =>
{
HybridDataStoreResource.ValidateResourceId(id);
return new HybridDataStoreResource(client, id);
}
);
}
#endregion
#region HybridDataStoreTypeResource
/// <summary>
/// Gets an object representing a <see cref="HybridDataStoreTypeResource" /> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="HybridDataStoreTypeResource.CreateResourceIdentifier" /> to create a <see cref="HybridDataStoreTypeResource" /> <see cref="ResourceIdentifier" /> from its components.
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="HybridDataStoreTypeResource" /> object. </returns>
public static HybridDataStoreTypeResource GetHybridDataStoreTypeResource(this ArmClient client, ResourceIdentifier id)
{
return client.GetResourceClient(() =>
{
HybridDataStoreTypeResource.ValidateResourceId(id);
return new HybridDataStoreTypeResource(client, id);
}
);
}
#endregion
#region HybridDataPublicKeyResource
/// <summary>
/// Gets an object representing a <see cref="HybridDataPublicKeyResource" /> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="HybridDataPublicKeyResource.CreateResourceIdentifier" /> to create a <see cref="HybridDataPublicKeyResource" /> <see cref="ResourceIdentifier" /> from its components.
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="HybridDataPublicKeyResource" /> object. </returns>
public static HybridDataPublicKeyResource GetHybridDataPublicKeyResource(this ArmClient client, ResourceIdentifier id)
{
return client.GetResourceClient(() =>
{
HybridDataPublicKeyResource.ValidateResourceId(id);
return new HybridDataPublicKeyResource(client, id);
}
);
}
#endregion
}
}