-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
MockableConsumptionArmClient.cs
743 lines (691 loc) · 56.3 KB
/
MockableConsumptionArmClient.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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
// 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 Autorest.CSharp.Core;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.ResourceManager;
using Azure.ResourceManager.Consumption;
using Azure.ResourceManager.Consumption.Models;
namespace Azure.ResourceManager.Consumption.Mocking
{
/// <summary> A class to add extension methods to ArmClient. </summary>
public partial class MockableConsumptionArmClient : ArmResource
{
private ClientDiagnostics _usageDetailsClientDiagnostics;
private UsageDetailsRestOperations _usageDetailsRestClient;
private ClientDiagnostics _marketplacesClientDiagnostics;
private MarketplacesRestOperations _marketplacesRestClient;
private ClientDiagnostics _tagsClientDiagnostics;
private TagsRestOperations _tagsRestClient;
private ClientDiagnostics _chargesClientDiagnostics;
private ChargesRestOperations _chargesRestClient;
private ClientDiagnostics _reservationsSummariesClientDiagnostics;
private ReservationsSummariesRestOperations _reservationsSummariesRestClient;
private ClientDiagnostics _reservationsDetailsClientDiagnostics;
private ReservationsDetailsRestOperations _reservationsDetailsRestClient;
private ClientDiagnostics _reservationRecommendationsClientDiagnostics;
private ReservationRecommendationsRestOperations _reservationRecommendationsRestClient;
private ClientDiagnostics _reservationRecommendationDetailsClientDiagnostics;
private ReservationRecommendationDetailsRestOperations _reservationRecommendationDetailsRestClient;
/// <summary> Initializes a new instance of the <see cref="MockableConsumptionArmClient"/> class for mocking. </summary>
protected MockableConsumptionArmClient()
{
}
/// <summary> Initializes a new instance of the <see cref="MockableConsumptionArmClient"/> class. </summary>
/// <param name="client"> The client parameters to use in these operations. </param>
/// <param name="id"> The identifier of the resource that is the target of operations. </param>
internal MockableConsumptionArmClient(ArmClient client, ResourceIdentifier id) : base(client, id)
{
}
internal MockableConsumptionArmClient(ArmClient client) : this(client, ResourceIdentifier.Root)
{
}
private ClientDiagnostics UsageDetailsClientDiagnostics => _usageDetailsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Consumption", ProviderConstants.DefaultProviderNamespace, Diagnostics);
private UsageDetailsRestOperations UsageDetailsRestClient => _usageDetailsRestClient ??= new UsageDetailsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
private ClientDiagnostics MarketplacesClientDiagnostics => _marketplacesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Consumption", ProviderConstants.DefaultProviderNamespace, Diagnostics);
private MarketplacesRestOperations MarketplacesRestClient => _marketplacesRestClient ??= new MarketplacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
private ClientDiagnostics TagsClientDiagnostics => _tagsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Consumption", ProviderConstants.DefaultProviderNamespace, Diagnostics);
private TagsRestOperations TagsRestClient => _tagsRestClient ??= new TagsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
private ClientDiagnostics ChargesClientDiagnostics => _chargesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Consumption", ProviderConstants.DefaultProviderNamespace, Diagnostics);
private ChargesRestOperations ChargesRestClient => _chargesRestClient ??= new ChargesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
private ClientDiagnostics ReservationsSummariesClientDiagnostics => _reservationsSummariesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Consumption", ProviderConstants.DefaultProviderNamespace, Diagnostics);
private ReservationsSummariesRestOperations ReservationsSummariesRestClient => _reservationsSummariesRestClient ??= new ReservationsSummariesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
private ClientDiagnostics ReservationsDetailsClientDiagnostics => _reservationsDetailsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Consumption", ProviderConstants.DefaultProviderNamespace, Diagnostics);
private ReservationsDetailsRestOperations ReservationsDetailsRestClient => _reservationsDetailsRestClient ??= new ReservationsDetailsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
private ClientDiagnostics ReservationRecommendationsClientDiagnostics => _reservationRecommendationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Consumption", ProviderConstants.DefaultProviderNamespace, Diagnostics);
private ReservationRecommendationsRestOperations ReservationRecommendationsRestClient => _reservationRecommendationsRestClient ??= new ReservationRecommendationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
private ClientDiagnostics ReservationRecommendationDetailsClientDiagnostics => _reservationRecommendationDetailsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Consumption", ProviderConstants.DefaultProviderNamespace, Diagnostics);
private ReservationRecommendationDetailsRestOperations ReservationRecommendationDetailsRestClient => _reservationRecommendationDetailsRestClient ??= new ReservationRecommendationDetailsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
private string GetApiVersionOrNull(ResourceType resourceType)
{
TryGetApiVersion(resourceType, out string apiVersion);
return apiVersion;
}
/// <summary> Gets a collection of ConsumptionBudgetResources in the ArmClient. </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <returns> An object representing collection of ConsumptionBudgetResources and their operations over a ConsumptionBudgetResource. </returns>
public virtual ConsumptionBudgetCollection GetConsumptionBudgets(ResourceIdentifier scope)
{
return new ConsumptionBudgetCollection(Client, scope);
}
/// <summary>
/// Gets the budget for the scope by budget name.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Budgets_Get</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="budgetName"> Budget Name. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="budgetName"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="budgetName"/> is an empty string, and was expected to be non-empty. </exception>
[ForwardsClientCalls]
public virtual async Task<Response<ConsumptionBudgetResource>> GetConsumptionBudgetAsync(ResourceIdentifier scope, string budgetName, CancellationToken cancellationToken = default)
{
return await GetConsumptionBudgets(scope).GetAsync(budgetName, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Gets the budget for the scope by budget name.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Budgets_Get</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="budgetName"> Budget Name. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="budgetName"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="budgetName"/> is an empty string, and was expected to be non-empty. </exception>
[ForwardsClientCalls]
public virtual Response<ConsumptionBudgetResource> GetConsumptionBudget(ResourceIdentifier scope, string budgetName, CancellationToken cancellationToken = default)
{
return GetConsumptionBudgets(scope).Get(budgetName, cancellationToken);
}
/// <summary>
/// Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or later.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{scope}/providers/Microsoft.Consumption/usageDetails</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>UsageDetails_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="expand"> May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. </param>
/// <param name="filter"> May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type. </param>
/// <param name="skipToken"> Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. </param>
/// <param name="top"> May be used to limit the number of results to the most recent N usageDetails. </param>
/// <param name="metric"> Allows to select different type of cost/usage records. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/> is null. </exception>
/// <returns> An async collection of <see cref="ConsumptionUsageDetail"/> that may take multiple service requests to iterate over. </returns>
public virtual AsyncPageable<ConsumptionUsageDetail> GetConsumptionUsageDetailsAsync(ResourceIdentifier scope, string expand = null, string filter = null, string skipToken = null, int? top = null, ConsumptionMetricType? metric = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
HttpMessage FirstPageRequest(int? pageSizeHint) => UsageDetailsRestClient.CreateListRequest(scope, expand, filter, skipToken, top, metric);
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsageDetailsRestClient.CreateListNextPageRequest(nextLink, scope, expand, filter, skipToken, top, metric);
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionUsageDetail.DeserializeConsumptionUsageDetail, UsageDetailsClientDiagnostics, Pipeline, "MockableConsumptionArmClient.GetConsumptionUsageDetails", "value", "nextLink", cancellationToken);
}
/// <summary>
/// Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or later.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{scope}/providers/Microsoft.Consumption/usageDetails</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>UsageDetails_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="expand"> May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. </param>
/// <param name="filter"> May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type. </param>
/// <param name="skipToken"> Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. </param>
/// <param name="top"> May be used to limit the number of results to the most recent N usageDetails. </param>
/// <param name="metric"> Allows to select different type of cost/usage records. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/> is null. </exception>
/// <returns> A collection of <see cref="ConsumptionUsageDetail"/> that may take multiple service requests to iterate over. </returns>
public virtual Pageable<ConsumptionUsageDetail> GetConsumptionUsageDetails(ResourceIdentifier scope, string expand = null, string filter = null, string skipToken = null, int? top = null, ConsumptionMetricType? metric = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
HttpMessage FirstPageRequest(int? pageSizeHint) => UsageDetailsRestClient.CreateListRequest(scope, expand, filter, skipToken, top, metric);
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => UsageDetailsRestClient.CreateListNextPageRequest(nextLink, scope, expand, filter, skipToken, top, metric);
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionUsageDetail.DeserializeConsumptionUsageDetail, UsageDetailsClientDiagnostics, Pipeline, "MockableConsumptionArmClient.GetConsumptionUsageDetails", "value", "nextLink", cancellationToken);
}
/// <summary>
/// Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, 2014 or later.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{scope}/providers/Microsoft.Consumption/marketplaces</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Marketplaces_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="filter"> May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. </param>
/// <param name="top"> May be used to limit the number of results to the most recent N marketplaces. </param>
/// <param name="skipToken"> Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/> is null. </exception>
/// <returns> An async collection of <see cref="ConsumptionMarketplace"/> that may take multiple service requests to iterate over. </returns>
public virtual AsyncPageable<ConsumptionMarketplace> GetConsumptionMarketPlacesAsync(ResourceIdentifier scope, string filter = null, int? top = null, string skipToken = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
HttpMessage FirstPageRequest(int? pageSizeHint) => MarketplacesRestClient.CreateListRequest(scope, filter, top, skipToken);
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MarketplacesRestClient.CreateListNextPageRequest(nextLink, scope, filter, top, skipToken);
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionMarketplace.DeserializeConsumptionMarketplace, MarketplacesClientDiagnostics, Pipeline, "MockableConsumptionArmClient.GetConsumptionMarketPlaces", "value", "nextLink", cancellationToken);
}
/// <summary>
/// Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, 2014 or later.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{scope}/providers/Microsoft.Consumption/marketplaces</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Marketplaces_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="filter"> May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. </param>
/// <param name="top"> May be used to limit the number of results to the most recent N marketplaces. </param>
/// <param name="skipToken"> Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/> is null. </exception>
/// <returns> A collection of <see cref="ConsumptionMarketplace"/> that may take multiple service requests to iterate over. </returns>
public virtual Pageable<ConsumptionMarketplace> GetConsumptionMarketPlaces(ResourceIdentifier scope, string filter = null, int? top = null, string skipToken = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
HttpMessage FirstPageRequest(int? pageSizeHint) => MarketplacesRestClient.CreateListRequest(scope, filter, top, skipToken);
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MarketplacesRestClient.CreateListNextPageRequest(nextLink, scope, filter, top, skipToken);
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionMarketplace.DeserializeConsumptionMarketplace, MarketplacesClientDiagnostics, Pipeline, "MockableConsumptionArmClient.GetConsumptionMarketPlaces", "value", "nextLink", cancellationToken);
}
/// <summary>
/// Get all available tag keys for the defined scope
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{scope}/providers/Microsoft.Consumption/tags</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Tags_Get</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/> is null. </exception>
public virtual async Task<Response<ConsumptionTagsResult>> GetConsumptionTagsAsync(ResourceIdentifier scope, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
using var scope0 = TagsClientDiagnostics.CreateScope("MockableConsumptionArmClient.GetConsumptionTags");
scope0.Start();
try
{
var response = await TagsRestClient.GetAsync(scope, cancellationToken).ConfigureAwait(false);
return response;
}
catch (Exception e)
{
scope0.Failed(e);
throw;
}
}
/// <summary>
/// Get all available tag keys for the defined scope
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{scope}/providers/Microsoft.Consumption/tags</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Tags_Get</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/> is null. </exception>
public virtual Response<ConsumptionTagsResult> GetConsumptionTags(ResourceIdentifier scope, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
using var scope0 = TagsClientDiagnostics.CreateScope("MockableConsumptionArmClient.GetConsumptionTags");
scope0.Start();
try
{
var response = TagsRestClient.Get(scope, cancellationToken);
return response;
}
catch (Exception e)
{
scope0.Failed(e);
throw;
}
}
/// <summary>
/// Lists the charges based for the defined scope.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{scope}/providers/Microsoft.Consumption/charges</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Charges_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="startDate"> Start date. </param>
/// <param name="endDate"> End date. </param>
/// <param name="filter"> May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). </param>
/// <param name="apply"> May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/> is null. </exception>
/// <returns> An async collection of <see cref="ConsumptionChargeSummary"/> that may take multiple service requests to iterate over. </returns>
public virtual AsyncPageable<ConsumptionChargeSummary> GetConsumptionChargesAsync(ResourceIdentifier scope, string startDate = null, string endDate = null, string filter = null, string apply = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
HttpMessage FirstPageRequest(int? pageSizeHint) => ChargesRestClient.CreateListRequest(scope, startDate, endDate, filter, apply);
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ConsumptionChargeSummary.DeserializeConsumptionChargeSummary, ChargesClientDiagnostics, Pipeline, "MockableConsumptionArmClient.GetConsumptionCharges", "value", null, cancellationToken);
}
/// <summary>
/// Lists the charges based for the defined scope.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{scope}/providers/Microsoft.Consumption/charges</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Charges_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="startDate"> Start date. </param>
/// <param name="endDate"> End date. </param>
/// <param name="filter"> May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). </param>
/// <param name="apply"> May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by properties/invoiceSectionId. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/> is null. </exception>
/// <returns> A collection of <see cref="ConsumptionChargeSummary"/> that may take multiple service requests to iterate over. </returns>
public virtual Pageable<ConsumptionChargeSummary> GetConsumptionCharges(ResourceIdentifier scope, string startDate = null, string endDate = null, string filter = null, string apply = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
HttpMessage FirstPageRequest(int? pageSizeHint) => ChargesRestClient.CreateListRequest(scope, startDate, endDate, filter, apply);
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ConsumptionChargeSummary.DeserializeConsumptionChargeSummary, ChargesClientDiagnostics, Pipeline, "MockableConsumptionArmClient.GetConsumptionCharges", "value", null, cancellationToken);
}
/// <summary>
/// Lists the reservations summaries for the defined scope daily or monthly grain.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{resourceScope}/providers/Microsoft.Consumption/reservationSummaries</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>ReservationsSummaries_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="options"> A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/> or <paramref name="options"/> is null. </exception>
/// <returns> An async collection of <see cref="ConsumptionReservationSummary"/> that may take multiple service requests to iterate over. </returns>
public virtual AsyncPageable<ConsumptionReservationSummary> GetConsumptionReservationsSummariesAsync(ResourceIdentifier scope, ArmResourceGetConsumptionReservationsSummariesOptions options, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
Argument.AssertNotNull(options, nameof(options));
HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationsSummariesRestClient.CreateListRequest(scope, options.Grain, options.StartDate, options.EndDate, options.Filter, options.ReservationId, options.ReservationOrderId);
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationsSummariesRestClient.CreateListNextPageRequest(nextLink, scope, options.Grain, options.StartDate, options.EndDate, options.Filter, options.ReservationId, options.ReservationOrderId);
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionReservationSummary.DeserializeConsumptionReservationSummary, ReservationsSummariesClientDiagnostics, Pipeline, "MockableConsumptionArmClient.GetConsumptionReservationsSummaries", "value", "nextLink", cancellationToken);
}
/// <summary>
/// Lists the reservations summaries for the defined scope daily or monthly grain.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{resourceScope}/providers/Microsoft.Consumption/reservationSummaries</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>ReservationsSummaries_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="options"> A property bag which contains all the parameters of this method except the LRO qualifier and request context parameter. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/> or <paramref name="options"/> is null. </exception>
/// <returns> A collection of <see cref="ConsumptionReservationSummary"/> that may take multiple service requests to iterate over. </returns>
public virtual Pageable<ConsumptionReservationSummary> GetConsumptionReservationsSummaries(ResourceIdentifier scope, ArmResourceGetConsumptionReservationsSummariesOptions options, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
Argument.AssertNotNull(options, nameof(options));
HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationsSummariesRestClient.CreateListRequest(scope, options.Grain, options.StartDate, options.EndDate, options.Filter, options.ReservationId, options.ReservationOrderId);
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationsSummariesRestClient.CreateListNextPageRequest(nextLink, scope, options.Grain, options.StartDate, options.EndDate, options.Filter, options.ReservationId, options.ReservationOrderId);
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionReservationSummary.DeserializeConsumptionReservationSummary, ReservationsSummariesClientDiagnostics, Pipeline, "MockableConsumptionArmClient.GetConsumptionReservationsSummaries", "value", "nextLink", cancellationToken);
}
/// <summary>
/// Lists the reservations details for the defined scope and provided date range. Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{resourceScope}/providers/Microsoft.Consumption/reservationDetails</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>ReservationsDetails_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="startDate"> Start date. Only applicable when querying with billing profile. </param>
/// <param name="endDate"> End date. Only applicable when querying with billing profile. </param>
/// <param name="filter"> Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile. </param>
/// <param name="reservationId"> Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation. </param>
/// <param name="reservationOrderId"> Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/> is null. </exception>
/// <returns> An async collection of <see cref="ConsumptionReservationDetail"/> that may take multiple service requests to iterate over. </returns>
public virtual AsyncPageable<ConsumptionReservationDetail> GetConsumptionReservationsDetailsAsync(ResourceIdentifier scope, string startDate = null, string endDate = null, string filter = null, string reservationId = null, string reservationOrderId = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationsDetailsRestClient.CreateListRequest(scope, startDate, endDate, filter, reservationId, reservationOrderId);
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationsDetailsRestClient.CreateListNextPageRequest(nextLink, scope, startDate, endDate, filter, reservationId, reservationOrderId);
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionReservationDetail.DeserializeConsumptionReservationDetail, ReservationsDetailsClientDiagnostics, Pipeline, "MockableConsumptionArmClient.GetConsumptionReservationsDetails", "value", "nextLink", cancellationToken);
}
/// <summary>
/// Lists the reservations details for the defined scope and provided date range. Note: ARM has a payload size limit of 12MB, so currently callers get 502 when the response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{resourceScope}/providers/Microsoft.Consumption/reservationDetails</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>ReservationsDetails_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="startDate"> Start date. Only applicable when querying with billing profile. </param>
/// <param name="endDate"> End date. Only applicable when querying with billing profile. </param>
/// <param name="filter"> Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not applicable when querying with billing profile. </param>
/// <param name="reservationId"> Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation. </param>
/// <param name="reservationOrderId"> Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/> is null. </exception>
/// <returns> A collection of <see cref="ConsumptionReservationDetail"/> that may take multiple service requests to iterate over. </returns>
public virtual Pageable<ConsumptionReservationDetail> GetConsumptionReservationsDetails(ResourceIdentifier scope, string startDate = null, string endDate = null, string filter = null, string reservationId = null, string reservationOrderId = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationsDetailsRestClient.CreateListRequest(scope, startDate, endDate, filter, reservationId, reservationOrderId);
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationsDetailsRestClient.CreateListNextPageRequest(nextLink, scope, startDate, endDate, filter, reservationId, reservationOrderId);
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionReservationDetail.DeserializeConsumptionReservationDetail, ReservationsDetailsClientDiagnostics, Pipeline, "MockableConsumptionArmClient.GetConsumptionReservationsDetails", "value", "nextLink", cancellationToken);
}
/// <summary>
/// List of recommendations for purchasing reserved instances.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendations</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>ReservationRecommendations_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="filter"> May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/> is null. </exception>
/// <returns> An async collection of <see cref="ConsumptionReservationRecommendation"/> that may take multiple service requests to iterate over. </returns>
public virtual AsyncPageable<ConsumptionReservationRecommendation> GetConsumptionReservationRecommendationsAsync(ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationRecommendationsRestClient.CreateListRequest(scope, filter);
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationRecommendationsRestClient.CreateListNextPageRequest(nextLink, scope, filter);
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ConsumptionReservationRecommendation.DeserializeConsumptionReservationRecommendation, ReservationRecommendationsClientDiagnostics, Pipeline, "MockableConsumptionArmClient.GetConsumptionReservationRecommendations", "value", "nextLink", cancellationToken);
}
/// <summary>
/// List of recommendations for purchasing reserved instances.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendations</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>ReservationRecommendations_List</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="filter"> May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/> is null. </exception>
/// <returns> A collection of <see cref="ConsumptionReservationRecommendation"/> that may take multiple service requests to iterate over. </returns>
public virtual Pageable<ConsumptionReservationRecommendation> GetConsumptionReservationRecommendations(ResourceIdentifier scope, string filter = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
HttpMessage FirstPageRequest(int? pageSizeHint) => ReservationRecommendationsRestClient.CreateListRequest(scope, filter);
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReservationRecommendationsRestClient.CreateListNextPageRequest(nextLink, scope, filter);
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ConsumptionReservationRecommendation.DeserializeConsumptionReservationRecommendation, ReservationRecommendationsClientDiagnostics, Pipeline, "MockableConsumptionArmClient.GetConsumptionReservationRecommendations", "value", "nextLink", cancellationToken);
}
/// <summary>
/// Details of a reservation recommendation for what-if analysis of reserved instances.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendationDetails</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>ReservationRecommendationDetails_Get</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="reservationScope"> Scope of the reservation. </param>
/// <param name="region"> Used to select the region the recommendation should be generated for. </param>
/// <param name="term"> Specify length of reservation recommendation term. </param>
/// <param name="lookBackPeriod"> Filter the time period on which reservation recommendation results are based. </param>
/// <param name="product"> Filter the products for which reservation recommendation results are generated. Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/>, <paramref name="region"/> or <paramref name="product"/> is null. </exception>
public virtual async Task<Response<ConsumptionReservationRecommendationDetails>> GetConsumptionReservationRecommendationDetailsAsync(ResourceIdentifier scope, ConsumptionReservationRecommendationScope reservationScope, string region, ConsumptionReservationRecommendationTerm term, ConsumptionReservationRecommendationLookBackPeriod lookBackPeriod, string product, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
Argument.AssertNotNull(region, nameof(region));
Argument.AssertNotNull(product, nameof(product));
using var scope0 = ReservationRecommendationDetailsClientDiagnostics.CreateScope("MockableConsumptionArmClient.GetConsumptionReservationRecommendationDetails");
scope0.Start();
try
{
var response = await ReservationRecommendationDetailsRestClient.GetAsync(scope, reservationScope, region, term, lookBackPeriod, product, cancellationToken).ConfigureAwait(false);
return response;
}
catch (Exception e)
{
scope0.Failed(e);
throw;
}
}
/// <summary>
/// Details of a reservation recommendation for what-if analysis of reserved instances.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendationDetails</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>ReservationRecommendationDetails_Get</description>
/// </item>
/// </list>
/// </summary>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <param name="reservationScope"> Scope of the reservation. </param>
/// <param name="region"> Used to select the region the recommendation should be generated for. </param>
/// <param name="term"> Specify length of reservation recommendation term. </param>
/// <param name="lookBackPeriod"> Filter the time period on which reservation recommendation results are based. </param>
/// <param name="product"> Filter the products for which reservation recommendation results are generated. Examples: Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="scope"/>, <paramref name="region"/> or <paramref name="product"/> is null. </exception>
public virtual Response<ConsumptionReservationRecommendationDetails> GetConsumptionReservationRecommendationDetails(ResourceIdentifier scope, ConsumptionReservationRecommendationScope reservationScope, string region, ConsumptionReservationRecommendationTerm term, ConsumptionReservationRecommendationLookBackPeriod lookBackPeriod, string product, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(scope, nameof(scope));
Argument.AssertNotNull(region, nameof(region));
Argument.AssertNotNull(product, nameof(product));
using var scope0 = ReservationRecommendationDetailsClientDiagnostics.CreateScope("MockableConsumptionArmClient.GetConsumptionReservationRecommendationDetails");
scope0.Start();
try
{
var response = ReservationRecommendationDetailsRestClient.Get(scope, reservationScope, region, term, lookBackPeriod, product, cancellationToken);
return response;
}
catch (Exception e)
{
scope0.Failed(e);
throw;
}
}
/// <summary>
/// Gets an object representing a <see cref="ConsumptionBudgetResource"/> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="ConsumptionBudgetResource.CreateResourceIdentifier" /> to create a <see cref="ConsumptionBudgetResource"/> <see cref="ResourceIdentifier"/> from its components.
/// </summary>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="ConsumptionBudgetResource"/> object. </returns>
public virtual ConsumptionBudgetResource GetConsumptionBudgetResource(ResourceIdentifier id)
{
ConsumptionBudgetResource.ValidateResourceId(id);
return new ConsumptionBudgetResource(Client, id);
}
/// <summary>
/// Gets an object representing a <see cref="BillingAccountConsumptionResource"/> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="BillingAccountConsumptionResource.CreateResourceIdentifier" /> to create a <see cref="BillingAccountConsumptionResource"/> <see cref="ResourceIdentifier"/> from its components.
/// </summary>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="BillingAccountConsumptionResource"/> object. </returns>
public virtual BillingAccountConsumptionResource GetBillingAccountConsumptionResource(ResourceIdentifier id)
{
BillingAccountConsumptionResource.ValidateResourceId(id);
return new BillingAccountConsumptionResource(Client, id);
}
/// <summary>
/// Gets an object representing a <see cref="BillingProfileConsumptionResource"/> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="BillingProfileConsumptionResource.CreateResourceIdentifier" /> to create a <see cref="BillingProfileConsumptionResource"/> <see cref="ResourceIdentifier"/> from its components.
/// </summary>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="BillingProfileConsumptionResource"/> object. </returns>
public virtual BillingProfileConsumptionResource GetBillingProfileConsumptionResource(ResourceIdentifier id)
{
BillingProfileConsumptionResource.ValidateResourceId(id);
return new BillingProfileConsumptionResource(Client, id);
}
/// <summary>
/// Gets an object representing a <see cref="TenantBillingPeriodConsumptionResource"/> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="TenantBillingPeriodConsumptionResource.CreateResourceIdentifier" /> to create a <see cref="TenantBillingPeriodConsumptionResource"/> <see cref="ResourceIdentifier"/> from its components.
/// </summary>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="TenantBillingPeriodConsumptionResource"/> object. </returns>
public virtual TenantBillingPeriodConsumptionResource GetTenantBillingPeriodConsumptionResource(ResourceIdentifier id)
{
TenantBillingPeriodConsumptionResource.ValidateResourceId(id);
return new TenantBillingPeriodConsumptionResource(Client, id);
}
/// <summary>
/// Gets an object representing a <see cref="SubscriptionBillingPeriodConsumptionResource"/> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="SubscriptionBillingPeriodConsumptionResource.CreateResourceIdentifier" /> to create a <see cref="SubscriptionBillingPeriodConsumptionResource"/> <see cref="ResourceIdentifier"/> from its components.
/// </summary>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="SubscriptionBillingPeriodConsumptionResource"/> object. </returns>
public virtual SubscriptionBillingPeriodConsumptionResource GetSubscriptionBillingPeriodConsumptionResource(ResourceIdentifier id)
{
SubscriptionBillingPeriodConsumptionResource.ValidateResourceId(id);
return new SubscriptionBillingPeriodConsumptionResource(Client, id);
}
/// <summary>
/// Gets an object representing a <see cref="ManagementGroupBillingPeriodConsumptionResource"/> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="ManagementGroupBillingPeriodConsumptionResource.CreateResourceIdentifier" /> to create a <see cref="ManagementGroupBillingPeriodConsumptionResource"/> <see cref="ResourceIdentifier"/> from its components.
/// </summary>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="ManagementGroupBillingPeriodConsumptionResource"/> object. </returns>
public virtual ManagementGroupBillingPeriodConsumptionResource GetManagementGroupBillingPeriodConsumptionResource(ResourceIdentifier id)
{
ManagementGroupBillingPeriodConsumptionResource.ValidateResourceId(id);
return new ManagementGroupBillingPeriodConsumptionResource(Client, id);
}
/// <summary>
/// Gets an object representing a <see cref="BillingCustomerConsumptionResource"/> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="BillingCustomerConsumptionResource.CreateResourceIdentifier" /> to create a <see cref="BillingCustomerConsumptionResource"/> <see cref="ResourceIdentifier"/> from its components.
/// </summary>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="BillingCustomerConsumptionResource"/> object. </returns>
public virtual BillingCustomerConsumptionResource GetBillingCustomerConsumptionResource(ResourceIdentifier id)
{
BillingCustomerConsumptionResource.ValidateResourceId(id);
return new BillingCustomerConsumptionResource(Client, id);
}
/// <summary>
/// Gets an object representing a <see cref="ReservationConsumptionResource"/> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="ReservationConsumptionResource.CreateResourceIdentifier" /> to create a <see cref="ReservationConsumptionResource"/> <see cref="ResourceIdentifier"/> from its components.
/// </summary>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="ReservationConsumptionResource"/> object. </returns>
public virtual ReservationConsumptionResource GetReservationConsumptionResource(ResourceIdentifier id)
{
ReservationConsumptionResource.ValidateResourceId(id);
return new ReservationConsumptionResource(Client, id);
}
/// <summary>
/// Gets an object representing a <see cref="ReservationOrderConsumptionResource"/> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="ReservationOrderConsumptionResource.CreateResourceIdentifier" /> to create a <see cref="ReservationOrderConsumptionResource"/> <see cref="ResourceIdentifier"/> from its components.
/// </summary>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <returns> Returns a <see cref="ReservationOrderConsumptionResource"/> object. </returns>
public virtual ReservationOrderConsumptionResource GetReservationOrderConsumptionResource(ResourceIdentifier id)
{
ReservationOrderConsumptionResource.ValidateResourceId(id);
return new ReservationOrderConsumptionResource(Client, id);
}
}
}