-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
ReceivedSharesClient.cs
676 lines (632 loc) · 43.6 KB
/
ReceivedSharesClient.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
namespace Azure.Analytics.Purview.Sharing
{
// Data plane generated client.
/// <summary> The ReceivedShares service client. </summary>
public partial class ReceivedSharesClient
{
private static readonly string[] AuthorizationScopes = new string[] { "https://purview.azure.net/.default" };
private readonly TokenCredential _tokenCredential;
private readonly HttpPipeline _pipeline;
private readonly Uri _endpoint;
private readonly string _apiVersion;
/// <summary> The ClientDiagnostics is used to provide tracing support for the client library. </summary>
internal ClientDiagnostics ClientDiagnostics { get; }
/// <summary> The HTTP pipeline for sending and receiving REST requests and responses. </summary>
public virtual HttpPipeline Pipeline => _pipeline;
/// <summary> Initializes a new instance of ReceivedSharesClient for mocking. </summary>
protected ReceivedSharesClient()
{
}
/// <summary> Initializes a new instance of ReceivedSharesClient. </summary>
/// <param name="endpoint"> The sharing endpoint of your purview account. Example: https://{accountName}.purview.azure.com/share. </param>
/// <param name="credential"> A credential used to authenticate to an Azure Service. </param>
/// <exception cref="ArgumentNullException"> <paramref name="endpoint"/> or <paramref name="credential"/> is null. </exception>
public ReceivedSharesClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new PurviewShareClientOptions())
{
}
/// <summary> Initializes a new instance of ReceivedSharesClient. </summary>
/// <param name="endpoint"> The sharing endpoint of your purview account. Example: https://{accountName}.purview.azure.com/share. </param>
/// <param name="credential"> A credential used to authenticate to an Azure Service. </param>
/// <param name="options"> The options for configuring the client. </param>
/// <exception cref="ArgumentNullException"> <paramref name="endpoint"/> or <paramref name="credential"/> is null. </exception>
public ReceivedSharesClient(Uri endpoint, TokenCredential credential, PurviewShareClientOptions options)
{
Argument.AssertNotNull(endpoint, nameof(endpoint));
Argument.AssertNotNull(credential, nameof(credential));
options ??= new PurviewShareClientOptions();
ClientDiagnostics = new ClientDiagnostics(options, true);
_tokenCredential = credential;
_pipeline = HttpPipelineBuilder.Build(options, Array.Empty<HttpPipelinePolicy>(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier());
_endpoint = endpoint;
_apiVersion = options.Version;
}
/// <summary>
/// [Protocol Method] Get a received share by unique id.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="receivedShareId"> Id of the received share. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="ArgumentNullException"> <paramref name="receivedShareId"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="receivedShareId"/> is an empty string, and was expected to be non-empty. </exception>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The response returned from the service. </returns>
/// <include file="Docs/ReceivedSharesClient.xml" path="doc/members/member[@name='GetReceivedShareAsync(string,RequestContext)']/*" />
public virtual async Task<Response> GetReceivedShareAsync(string receivedShareId, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(receivedShareId, nameof(receivedShareId));
using var scope = ClientDiagnostics.CreateScope("ReceivedSharesClient.GetReceivedShare");
scope.Start();
try
{
using HttpMessage message = CreateGetReceivedShareRequest(receivedShareId, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary>
/// [Protocol Method] Get a received share by unique id.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="receivedShareId"> Id of the received share. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="ArgumentNullException"> <paramref name="receivedShareId"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="receivedShareId"/> is an empty string, and was expected to be non-empty. </exception>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The response returned from the service. </returns>
/// <include file="Docs/ReceivedSharesClient.xml" path="doc/members/member[@name='GetReceivedShare(string,RequestContext)']/*" />
public virtual Response GetReceivedShare(string receivedShareId, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(receivedShareId, nameof(receivedShareId));
using var scope = ClientDiagnostics.CreateScope("ReceivedSharesClient.GetReceivedShare");
scope.Start();
try
{
using HttpMessage message = CreateGetReceivedShareRequest(receivedShareId, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary>
/// [Protocol Method] Activates the tenant and email combination using the activation code received.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="content"> The content to send as the body of the request. </param>
/// <param name="repeatabilityRequestId"> If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="ArgumentNullException"> <paramref name="content"/> is null. </exception>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The response returned from the service. </returns>
/// <include file="Docs/ReceivedSharesClient.xml" path="doc/members/member[@name='ActivateTenantEmailRegistrationAsync(RequestContent,string,RequestContext)']/*" />
public virtual async Task<Response> ActivateTenantEmailRegistrationAsync(RequestContent content, string repeatabilityRequestId = null, RequestContext context = null)
{
Argument.AssertNotNull(content, nameof(content));
using var scope = ClientDiagnostics.CreateScope("ReceivedSharesClient.ActivateTenantEmailRegistration");
scope.Start();
try
{
using HttpMessage message = CreateActivateTenantEmailRegistrationRequest(content, repeatabilityRequestId, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary>
/// [Protocol Method] Activates the tenant and email combination using the activation code received.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="content"> The content to send as the body of the request. </param>
/// <param name="repeatabilityRequestId"> If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="ArgumentNullException"> <paramref name="content"/> is null. </exception>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The response returned from the service. </returns>
/// <include file="Docs/ReceivedSharesClient.xml" path="doc/members/member[@name='ActivateTenantEmailRegistration(RequestContent,string,RequestContext)']/*" />
public virtual Response ActivateTenantEmailRegistration(RequestContent content, string repeatabilityRequestId = null, RequestContext context = null)
{
Argument.AssertNotNull(content, nameof(content));
using var scope = ClientDiagnostics.CreateScope("ReceivedSharesClient.ActivateTenantEmailRegistration");
scope.Start();
try
{
using HttpMessage message = CreateActivateTenantEmailRegistrationRequest(content, repeatabilityRequestId, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary>
/// [Protocol Method] Registers the tenant and email combination for activation.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="repeatabilityRequestId"> If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The response returned from the service. </returns>
/// <include file="Docs/ReceivedSharesClient.xml" path="doc/members/member[@name='RegisterTenantEmailRegistrationAsync(string,RequestContext)']/*" />
public virtual async Task<Response> RegisterTenantEmailRegistrationAsync(string repeatabilityRequestId = null, RequestContext context = null)
{
using var scope = ClientDiagnostics.CreateScope("ReceivedSharesClient.RegisterTenantEmailRegistration");
scope.Start();
try
{
using HttpMessage message = CreateRegisterTenantEmailRegistrationRequest(repeatabilityRequestId, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary>
/// [Protocol Method] Registers the tenant and email combination for activation.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="repeatabilityRequestId"> If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The response returned from the service. </returns>
/// <include file="Docs/ReceivedSharesClient.xml" path="doc/members/member[@name='RegisterTenantEmailRegistration(string,RequestContext)']/*" />
public virtual Response RegisterTenantEmailRegistration(string repeatabilityRequestId = null, RequestContext context = null)
{
using var scope = ClientDiagnostics.CreateScope("ReceivedSharesClient.RegisterTenantEmailRegistration");
scope.Start();
try
{
using HttpMessage message = CreateRegisterTenantEmailRegistrationRequest(repeatabilityRequestId, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary>
/// [Protocol Method] Get a list of attached received shares.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="referenceName"> A name that references a data store. </param>
/// <param name="filter"> Filters the results using OData syntax. </param>
/// <param name="orderby"> Sorts the results using OData syntax. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="ArgumentNullException"> <paramref name="referenceName"/> is null. </exception>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The <see cref="AsyncPageable{T}"/> from the service containing a list of <see cref="BinaryData"/> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
/// <include file="Docs/ReceivedSharesClient.xml" path="doc/members/member[@name='GetAllAttachedReceivedSharesAsync(string,string,string,RequestContext)']/*" />
public virtual AsyncPageable<BinaryData> GetAllAttachedReceivedSharesAsync(string referenceName, string filter = null, string orderby = null, RequestContext context = null)
{
Argument.AssertNotNull(referenceName, nameof(referenceName));
HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAllAttachedReceivedSharesRequest(referenceName, filter, orderby, context);
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAllAttachedReceivedSharesNextPageRequest(nextLink, referenceName, filter, orderby, context);
return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ReceivedSharesClient.GetAllAttachedReceivedShares", "value", "nextLink", context);
}
/// <summary>
/// [Protocol Method] Get a list of attached received shares.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="referenceName"> A name that references a data store. </param>
/// <param name="filter"> Filters the results using OData syntax. </param>
/// <param name="orderby"> Sorts the results using OData syntax. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="ArgumentNullException"> <paramref name="referenceName"/> is null. </exception>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The <see cref="Pageable{T}"/> from the service containing a list of <see cref="BinaryData"/> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
/// <include file="Docs/ReceivedSharesClient.xml" path="doc/members/member[@name='GetAllAttachedReceivedShares(string,string,string,RequestContext)']/*" />
public virtual Pageable<BinaryData> GetAllAttachedReceivedShares(string referenceName, string filter = null, string orderby = null, RequestContext context = null)
{
Argument.AssertNotNull(referenceName, nameof(referenceName));
HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAllAttachedReceivedSharesRequest(referenceName, filter, orderby, context);
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAllAttachedReceivedSharesNextPageRequest(nextLink, referenceName, filter, orderby, context);
return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ReceivedSharesClient.GetAllAttachedReceivedShares", "value", "nextLink", context);
}
/// <summary>
/// [Protocol Method] Get a list of detached received shares.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="filter"> Filters the results using OData syntax. </param>
/// <param name="orderby"> Sorts the results using OData syntax. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The <see cref="AsyncPageable{T}"/> from the service containing a list of <see cref="BinaryData"/> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
/// <include file="Docs/ReceivedSharesClient.xml" path="doc/members/member[@name='GetAllDetachedReceivedSharesAsync(string,string,RequestContext)']/*" />
public virtual AsyncPageable<BinaryData> GetAllDetachedReceivedSharesAsync(string filter = null, string orderby = null, RequestContext context = null)
{
HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAllDetachedReceivedSharesRequest(filter, orderby, context);
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAllDetachedReceivedSharesNextPageRequest(nextLink, filter, orderby, context);
return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ReceivedSharesClient.GetAllDetachedReceivedShares", "value", "nextLink", context);
}
/// <summary>
/// [Protocol Method] Get a list of detached received shares.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="filter"> Filters the results using OData syntax. </param>
/// <param name="orderby"> Sorts the results using OData syntax. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The <see cref="Pageable{T}"/> from the service containing a list of <see cref="BinaryData"/> objects. Details of the body schema for each item in the collection are in the Remarks section below. </returns>
/// <include file="Docs/ReceivedSharesClient.xml" path="doc/members/member[@name='GetAllDetachedReceivedShares(string,string,RequestContext)']/*" />
public virtual Pageable<BinaryData> GetAllDetachedReceivedShares(string filter = null, string orderby = null, RequestContext context = null)
{
HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAllDetachedReceivedSharesRequest(filter, orderby, context);
HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAllDetachedReceivedSharesNextPageRequest(nextLink, filter, orderby, context);
return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "ReceivedSharesClient.GetAllDetachedReceivedShares", "value", "nextLink", context);
}
/// <summary>
/// [Protocol Method] Create or replace a received share.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
/// <param name="receivedShareId"> Id of the received share. </param>
/// <param name="content"> The content to send as the body of the request. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="ArgumentNullException"> <paramref name="receivedShareId"/> or <paramref name="content"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="receivedShareId"/> is an empty string, and was expected to be non-empty. </exception>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The <see cref="Operation"/> representing an asynchronous operation on the service. </returns>
/// <include file="Docs/ReceivedSharesClient.xml" path="doc/members/member[@name='CreateOrReplaceReceivedShareAsync(WaitUntil,string,RequestContent,RequestContext)']/*" />
public virtual async Task<Operation<BinaryData>> CreateOrReplaceReceivedShareAsync(WaitUntil waitUntil, string receivedShareId, RequestContent content, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(receivedShareId, nameof(receivedShareId));
Argument.AssertNotNull(content, nameof(content));
using var scope = ClientDiagnostics.CreateScope("ReceivedSharesClient.CreateOrReplaceReceivedShare");
scope.Start();
try
{
using HttpMessage message = CreateCreateOrReplaceReceivedShareRequest(receivedShareId, content, context);
return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ReceivedSharesClient.CreateOrReplaceReceivedShare", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false);
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary>
/// [Protocol Method] Create or replace a received share.
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
/// <param name="receivedShareId"> Id of the received share. </param>
/// <param name="content"> The content to send as the body of the request. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="ArgumentNullException"> <paramref name="receivedShareId"/> or <paramref name="content"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="receivedShareId"/> is an empty string, and was expected to be non-empty. </exception>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The <see cref="Operation"/> representing an asynchronous operation on the service. </returns>
/// <include file="Docs/ReceivedSharesClient.xml" path="doc/members/member[@name='CreateOrReplaceReceivedShare(WaitUntil,string,RequestContent,RequestContext)']/*" />
public virtual Operation<BinaryData> CreateOrReplaceReceivedShare(WaitUntil waitUntil, string receivedShareId, RequestContent content, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(receivedShareId, nameof(receivedShareId));
Argument.AssertNotNull(content, nameof(content));
using var scope = ClientDiagnostics.CreateScope("ReceivedSharesClient.CreateOrReplaceReceivedShare");
scope.Start();
try
{
using HttpMessage message = CreateCreateOrReplaceReceivedShareRequest(receivedShareId, content, context);
return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ReceivedSharesClient.CreateOrReplaceReceivedShare", OperationFinalStateVia.Location, context, waitUntil);
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary>
/// [Protocol Method] Deletes a received share
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
/// <param name="receivedShareId"> Id of the received share. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="ArgumentNullException"> <paramref name="receivedShareId"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="receivedShareId"/> is an empty string, and was expected to be non-empty. </exception>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The <see cref="Operation"/> representing an asynchronous operation on the service. </returns>
/// <include file="Docs/ReceivedSharesClient.xml" path="doc/members/member[@name='DeleteReceivedShareAsync(WaitUntil,string,RequestContext)']/*" />
public virtual async Task<Operation<BinaryData>> DeleteReceivedShareAsync(WaitUntil waitUntil, string receivedShareId, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(receivedShareId, nameof(receivedShareId));
using var scope = ClientDiagnostics.CreateScope("ReceivedSharesClient.DeleteReceivedShare");
scope.Start();
try
{
using HttpMessage message = CreateDeleteReceivedShareRequest(receivedShareId, context);
return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ReceivedSharesClient.DeleteReceivedShare", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false);
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary>
/// [Protocol Method] Deletes a received share
/// <list type="bullet">
/// <item>
/// <description>
/// This <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md">protocol method</see> allows explicit creation of the request and processing of the response for advanced scenarios.
/// </description>
/// </item>
/// </list>
/// </summary>
/// <param name="waitUntil"> <see cref="WaitUntil.Completed"/> if the method should wait to return until the long-running operation has completed on the service; <see cref="WaitUntil.Started"/> if it should return after starting the operation. For more information on long-running operations, please see <see href="https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/LongRunningOperations.md"> Azure.Core Long-Running Operation samples</see>. </param>
/// <param name="receivedShareId"> Id of the received share. </param>
/// <param name="context"> The request context, which can override default behaviors of the client pipeline on a per-call basis. </param>
/// <exception cref="ArgumentNullException"> <paramref name="receivedShareId"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="receivedShareId"/> is an empty string, and was expected to be non-empty. </exception>
/// <exception cref="RequestFailedException"> Service returned a non-success status code. </exception>
/// <returns> The <see cref="Operation"/> representing an asynchronous operation on the service. </returns>
/// <include file="Docs/ReceivedSharesClient.xml" path="doc/members/member[@name='DeleteReceivedShare(WaitUntil,string,RequestContext)']/*" />
public virtual Operation<BinaryData> DeleteReceivedShare(WaitUntil waitUntil, string receivedShareId, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(receivedShareId, nameof(receivedShareId));
using var scope = ClientDiagnostics.CreateScope("ReceivedSharesClient.DeleteReceivedShare");
scope.Start();
try
{
using HttpMessage message = CreateDeleteReceivedShareRequest(receivedShareId, context);
return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ReceivedSharesClient.DeleteReceivedShare", OperationFinalStateVia.Location, context, waitUntil);
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
internal HttpMessage CreateGetReceivedShareRequest(string receivedShareId, RequestContext context)
{
var message = _pipeline.CreateMessage(context, ResponseClassifier200);
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.Reset(_endpoint);
uri.AppendPath("/receivedShares/", false);
uri.AppendPath(receivedShareId, true);
uri.AppendQuery("api-version", _apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
}
internal HttpMessage CreateCreateOrReplaceReceivedShareRequest(string receivedShareId, RequestContent content, RequestContext context)
{
var message = _pipeline.CreateMessage(context, ResponseClassifier200201);
var request = message.Request;
request.Method = RequestMethod.Put;
var uri = new RawRequestUriBuilder();
uri.Reset(_endpoint);
uri.AppendPath("/receivedShares/", false);
uri.AppendPath(receivedShareId, true);
uri.AppendQuery("api-version", _apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Content-Type", "application/json");
request.Content = content;
return message;
}
internal HttpMessage CreateDeleteReceivedShareRequest(string receivedShareId, RequestContext context)
{
var message = _pipeline.CreateMessage(context, ResponseClassifier202);
var request = message.Request;
request.Method = RequestMethod.Delete;
var uri = new RawRequestUriBuilder();
uri.Reset(_endpoint);
uri.AppendPath("/receivedShares/", false);
uri.AppendPath(receivedShareId, true);
uri.AppendQuery("api-version", _apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
}
internal HttpMessage CreateGetAllAttachedReceivedSharesRequest(string referenceName, string filter, string orderby, RequestContext context)
{
var message = _pipeline.CreateMessage(context, ResponseClassifier200);
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.Reset(_endpoint);
uri.AppendPath("/receivedShares/attached", false);
uri.AppendQuery("referenceName", referenceName, true);
uri.AppendQuery("api-version", _apiVersion, true);
if (filter != null)
{
uri.AppendQuery("filter", filter, true);
}
if (orderby != null)
{
uri.AppendQuery("orderby", orderby, true);
}
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
}
internal HttpMessage CreateGetAllDetachedReceivedSharesRequest(string filter, string orderby, RequestContext context)
{
var message = _pipeline.CreateMessage(context, ResponseClassifier200);
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.Reset(_endpoint);
uri.AppendPath("/receivedShares/detached", false);
uri.AppendQuery("api-version", _apiVersion, true);
if (filter != null)
{
uri.AppendQuery("filter", filter, true);
}
if (orderby != null)
{
uri.AppendQuery("orderby", orderby, true);
}
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
}
internal HttpMessage CreateActivateTenantEmailRegistrationRequest(RequestContent content, string repeatabilityRequestId, RequestContext context)
{
var message = _pipeline.CreateMessage(context, ResponseClassifier200);
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
uri.Reset(_endpoint);
uri.AppendPath("/emails:activate", false);
uri.AppendQuery("api-version", _apiVersion, true);
request.Uri = uri;
if (repeatabilityRequestId != null)
{
request.Headers.Add("repeatability-request-id", repeatabilityRequestId);
}
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Content-Type", "application/json");
request.Content = content;
return message;
}
internal HttpMessage CreateRegisterTenantEmailRegistrationRequest(string repeatabilityRequestId, RequestContext context)
{
var message = _pipeline.CreateMessage(context, ResponseClassifier200);
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
uri.Reset(_endpoint);
uri.AppendPath("/emails:register", false);
uri.AppendQuery("api-version", _apiVersion, true);
request.Uri = uri;
if (repeatabilityRequestId != null)
{
request.Headers.Add("repeatability-request-id", repeatabilityRequestId);
}
request.Headers.Add("Accept", "application/json");
return message;
}
internal HttpMessage CreateGetAllAttachedReceivedSharesNextPageRequest(string nextLink, string referenceName, string filter, string orderby, RequestContext context)
{
var message = _pipeline.CreateMessage(context, ResponseClassifier200);
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.Reset(_endpoint);
uri.AppendRawNextLink(nextLink, false);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
}
internal HttpMessage CreateGetAllDetachedReceivedSharesNextPageRequest(string nextLink, string filter, string orderby, RequestContext context)
{
var message = _pipeline.CreateMessage(context, ResponseClassifier200);
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.Reset(_endpoint);
uri.AppendRawNextLink(nextLink, false);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
}
private static ResponseClassifier _responseClassifier200;
private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 });
private static ResponseClassifier _responseClassifier200201;
private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 });
private static ResponseClassifier _responseClassifier202;
private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 });
}
}