This commit is contained in:
Michael Yanni 2020-05-01 11:02:16 -07:00
Родитель 98e9112086
Коммит dd79772772
68 изменённых файлов: 17360 добавлений и 8375 удалений

Просмотреть файл

@ -1281,17 +1281,20 @@ globalParameters:
in: header
- !<!Parameter> &ref_36
schema: *ref_0
clientDefaultValue: ''
implementation: Client
origin: 'modelerfour:synthesized/host'
required: true
extensions:
x-in: path
x-ms-priority: 2
x-ms-skip-url-encoding: true
x-name: endpoint
x-required: true
x-type: string
language: !<!Languages>
default:
name: $host
description: server parameter
serializedName: $host
name: Endpoint
description: The endpoint of the App Configuration instance to send requests to.
serializedName: endpoint
protocol: !<!Protocols>
http: !<!HttpParameter>
in: uri
@ -1363,7 +1366,7 @@ operationGroups:
http: !<!HttpRequest>
path: /keys
method: get
uri: '{$host}'
uri: '{endpoint}'
signatureParameters:
- *ref_39
- *ref_40
@ -1405,6 +1408,19 @@ operationGroups:
statusCodes:
- default
extensions:
x-ms-examples:
GetKeys:
parameters:
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
responses:
'200':
body:
items:
- name: MaxRequests
- name: RequestTimeout
headers:
Content-Type: application/vnd.microsoft.appconfig.keyset+json
x-ms-pageable:
itemName: items
nextLinkName: '@nextLink'
@ -1468,7 +1484,7 @@ operationGroups:
http: !<!HttpRequest>
path: /keys
method: head
uri: '{$host}'
uri: '{endpoint}'
signatureParameters:
- *ref_45
- *ref_46
@ -1497,6 +1513,16 @@ operationGroups:
http: !<!HttpResponse>
statusCodes:
- default
extensions:
x-ms-examples:
CheckKeys:
parameters:
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
responses:
'200':
headers:
Content-Type: application/vnd.microsoft.appconfig.keyset+json
language: !<!Languages>
default:
name: CheckKeys
@ -1577,7 +1603,7 @@ operationGroups:
http: !<!HttpRequest>
path: /kv
method: get
uri: '{$host}'
uri: '{endpoint}'
signatureParameters:
- *ref_50
- *ref_51
@ -1621,6 +1647,49 @@ operationGroups:
statusCodes:
- default
extensions:
x-ms-examples:
GetKeyValues:
parameters:
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
responses:
'200':
body:
items:
- content_type: null
etag: CTgHR5UrDKNj2nsoGWDOipST9Pv
key: Background
label: Asset1
last_modified: '2019-03-04T17:12:23+00:00'
locked: false
tags: {}
value: blue
- content_type: null
etag: UTSN1zePHbBQ0npbRB6elGRRuH7
key: MaxLogFiles
label: Asset1
last_modified: '2019-03-04T17:12:23+00:00'
locked: false
tags: {}
value: '50'
- content_type: null
etag: 7XpB48ET4VAlB9068ft6fKMyA3m
key: Message
label: null
last_modified: '2019-06-20T16:52:23+00:00'
locked: false
tags: {}
value: Hello World
- content_type: null
etag: fAFm4jkGNB1hsIr4o0S5hnhCCvY
key: 'WebDemo:Settings:BackgroundColor'
label: null
last_modified: '2019-06-20T15:48:01+00:00'
locked: false
tags: {}
value: blue
headers:
Content-Type: application/vnd.microsoft.appconfig.kvset+json
x-ms-pageable:
itemName: items
nextLinkName: '@nextLink'
@ -1707,7 +1776,7 @@ operationGroups:
http: !<!HttpRequest>
path: /kv
method: head
uri: '{$host}'
uri: '{endpoint}'
signatureParameters:
- *ref_57
- *ref_58
@ -1738,6 +1807,16 @@ operationGroups:
http: !<!HttpResponse>
statusCodes:
- default
extensions:
x-ms-examples:
CheckKeyValues:
parameters:
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
responses:
'200':
headers:
Content-Type: application/vnd.microsoft.appconfig.kvset+json
language: !<!Languages>
default:
name: CheckKeyValues
@ -1830,7 +1909,7 @@ operationGroups:
http: !<!HttpRequest>
path: '/kv/{key}'
method: get
uri: '{$host}'
uri: '{endpoint}'
signatureParameters:
- *ref_64
- *ref_65
@ -1880,6 +1959,73 @@ operationGroups:
- application/problem+json
statusCodes:
- default
extensions:
x-ms-examples:
GetKeyValue:
parameters:
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
key: Message
responses:
'200':
body:
content_type: null
etag: 7XpB48ET4VAlB9068ft6fKMyA3m
key: Message
label: null
last_modified: '2019-08-27T16:52:32+00:00'
locked: false
tags: {}
value: Hello World!
headers:
Content-Type: application/vnd.microsoft.appconfig.kv+json
ETag: W/"7XpB48ET4VAlB9068ft6fKMyA3m"
Last-Modified: 'Tue, 27 Aug 2019 16:52:32 GMT'
Sync-Token: zAJw6V16=NjotMSM3ODk3NjM=;sn=789763
GetKeyValue_IfMatch:
parameters:
If-Match: '"L10qpBghN693OaxydgTkLmrBbV5"'
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
key: Message
responses:
'200':
body:
content_type: null
etag: L10qpBghN693OaxydgTkLmrBbV5
key: Message
label: null
last_modified: '2019-08-27T16:52:32+00:00'
locked: false
tags: {}
value: Hello World!
headers:
Content-Type: application/vnd.microsoft.appconfig.kv+json
ETag: W/"L10qpBghN693OaxydgTkLmrBbV5"
Last-Modified: 'Tue, 27 Aug 2019 16:52:32 GMT'
Sync-Token: zAJw6V16=NjotMSM3ODk3NjM=;sn=789763
GetKeyValue_IfNoneMatch:
parameters:
If-None-Match: L10qpBghN693OaxydgTkLmrBbV5
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
key: Message
responses:
'200':
body:
content_type: null
etag: 7XpB48ET4VAlB9068ft6fKMyA3m
key: Message
label: null
last_modified: '2019-08-27T16:52:32+00:00'
locked: false
tags: {}
value: Hello World!
headers:
Content-Type: application/vnd.microsoft.appconfig.kv+json
ETag: W/"7XpB48ET4VAlB9068ft6fKMyA3m"
Last-Modified: 'Tue, 27 Aug 2019 16:52:32 GMT'
Sync-Token: zAJw6V16=NjotMSM3ODk3NjM=;sn=789763
language: !<!Languages>
default:
name: GetKeyValue
@ -1985,7 +2131,7 @@ operationGroups:
- text/json
- application/*+json
- application/json-patch+json
uri: '{$host}'
uri: '{endpoint}'
signatureParameters:
- *ref_75
- *ref_76
@ -2030,6 +2176,51 @@ operationGroups:
- application/problem+json
statusCodes:
- default
extensions:
x-ms-examples:
PutKeyValue:
parameters:
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
key: Message
responses:
'200':
body:
content_type: null
etag: tnIHBkDYQwtdNMLoWtr5aybkKwL
key: Message
label: null
last_modified: '2019-08-27T16:52:32+00:00'
locked: false
tags: {}
value: Hello World!
headers:
Content-Type: application/vnd.microsoft.appconfig.kv+json
ETag: W/"tnIHBkDYQwtdNMLoWtr5aybkKwL"
Last-Modified: 'Tue, 27 Aug 2019 16:52:32 GMT'
Sync-Token: zAJw6V16=NjotMSM3ODk3NjM=;sn=789763
PutKeyValue_IfMatch:
parameters:
If-Match: '"L10qpBghN693OaxydgTkLmrBbV5"'
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
key: Message
responses:
'200':
body:
content_type: null
etag: L10qpBghN693OaxydgTkLmrBbV5
key: Message
label: null
last_modified: '2019-08-27T16:52:32+00:00'
locked: false
tags: {}
value: Hello World!
headers:
Content-Type: application/vnd.microsoft.appconfig.kv+json
ETag: W/"L10qpBghN693OaxydgTkLmrBbV5"
Last-Modified: 'Tue, 27 Aug 2019 16:52:32 GMT'
Sync-Token: zAJw6V16=NjotMSM3ODk3NjM=;sn=789763
language: !<!Languages>
default:
name: PutKeyValue
@ -2088,7 +2279,7 @@ operationGroups:
http: !<!HttpRequest>
path: '/kv/{key}'
method: delete
uri: '{$host}'
uri: '{endpoint}'
signatureParameters:
- *ref_81
- *ref_82
@ -2145,6 +2336,53 @@ operationGroups:
- application/problem+json
statusCodes:
- default
extensions:
x-ms-examples:
DeleteKeyValue:
parameters:
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
key: Message
responses:
'200':
body:
content_type: null
etag: 7XpB48ET4VAlB9068ft6fKMyA3m
key: Message
label: null
last_modified: '2019-08-27T16:52:32+00:00'
locked: false
tags: {}
value: Hello World!
headers:
Content-Type: application/vnd.microsoft.appconfig.kv+json
ETag: W/"7XpB48ET4VAlB9068ft6fKMyA3m"
Last-Modified: 'Tue, 27 Aug 2019 16:52:32 GMT'
Sync-Token: zAJw6V16=NjotMSM3ODk3NjM=;sn=789763
'204': {}
DeleteKeyValue_IfMatch:
parameters:
If-Match: '"L10qpBghN693OaxydgTkLmrBbV5"'
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
key: Message
responses:
'200':
body:
content_type: null
etag: L10qpBghN693OaxydgTkLmrBbV5
key: Message
label: null
last_modified: '2019-08-27T16:52:32+00:00'
locked: false
tags: {}
value: Hello World!
headers:
Content-Type: application/vnd.microsoft.appconfig.kv+json
ETag: W/"L10qpBghN693OaxydgTkLmrBbV5"
Last-Modified: 'Tue, 27 Aug 2019 16:52:32 GMT'
Sync-Token: zAJw6V16=NjotMSM3ODk3NjM=;sn=789763
'204': {}
language: !<!Languages>
default:
name: DeleteKeyValue
@ -2237,7 +2475,7 @@ operationGroups:
http: !<!HttpRequest>
path: '/kv/{key}'
method: head
uri: '{$host}'
uri: '{endpoint}'
signatureParameters:
- *ref_88
- *ref_89
@ -2275,6 +2513,46 @@ operationGroups:
http: !<!HttpResponse>
statusCodes:
- default
extensions:
x-ms-examples:
CheckKeyValue:
parameters:
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
key: Message
responses:
'200':
headers:
Content-Type: application/vnd.microsoft.appconfig.kv+json
ETag: W/"7XpB48ET4VAlB9068ft6fKMyA3m"
Last-Modified: 'Tue, 27 Aug 2019 16:52:32 GMT'
Sync-Token: zAJw6V16=NjotMSM3ODk3NjM=;sn=789763
CheckKeyValue_IfMatch:
parameters:
If-Match: '"L10qpBghN693OaxydgTkLmrBbV5"'
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
key: Message
responses:
'200':
headers:
Content-Type: application/vnd.microsoft.appconfig.kv+json
ETag: W/"L10qpBghN693OaxydgTkLmrBbV5"
Last-Modified: 'Tue, 27 Aug 2019 16:52:32 GMT'
Sync-Token: zAJw6V16=NjotMSM3ODk3NjM=;sn=789763
CheckKeyValue_IfNoneMatch:
parameters:
If-None-Match: L10qpBghN693OaxydgTkLmrBbV5
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
key: Message
responses:
'200':
headers:
Content-Type: application/vnd.microsoft.appconfig.kv+json
ETag: W/"7XpB48ET4VAlB9068ft6fKMyA3m"
Last-Modified: 'Tue, 27 Aug 2019 16:52:32 GMT'
Sync-Token: zAJw6V16=NjotMSM3ODk3NjM=;sn=789763
language: !<!Languages>
default:
name: CheckKeyValue
@ -2344,7 +2622,7 @@ operationGroups:
http: !<!HttpRequest>
path: /labels
method: get
uri: '{$host}'
uri: '{endpoint}'
signatureParameters:
- *ref_98
- *ref_99
@ -2387,6 +2665,22 @@ operationGroups:
statusCodes:
- default
extensions:
x-ms-examples:
GetLabels:
parameters:
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
responses:
'200':
body:
items:
- name: null
- name: Asset1
- name: Asset1/devCi
- name: Asset1/devCi/branch1
- name: WestUs
headers:
Content-Type: application/vnd.microsoft.appconfig.labelset+json
x-ms-pageable:
itemName: items
nextLinkName: '@nextLink'
@ -2462,7 +2756,7 @@ operationGroups:
http: !<!HttpRequest>
path: /labels
method: head
uri: '{$host}'
uri: '{endpoint}'
signatureParameters:
- *ref_105
- *ref_106
@ -2492,6 +2786,16 @@ operationGroups:
http: !<!HttpResponse>
statusCodes:
- default
extensions:
x-ms-examples:
CheckLabels:
parameters:
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
responses:
'200':
headers:
Content-Type: application/vnd.microsoft.appconfig.labelset+json
language: !<!Languages>
default:
name: CheckLabels
@ -2561,7 +2865,7 @@ operationGroups:
http: !<!HttpRequest>
path: '/locks/{key}'
method: put
uri: '{$host}'
uri: '{endpoint}'
signatureParameters:
- *ref_110
- *ref_111
@ -2606,6 +2910,51 @@ operationGroups:
- application/problem+json
statusCodes:
- default
extensions:
x-ms-examples:
PutLock:
parameters:
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
key: Message
responses:
'200':
body:
content_type: null
etag: L10qpBghN693OaxydgTkLmrBbV4
key: Message
label: null
last_modified: '2019-08-27T16:52:32+00:00'
locked: true
tags: {}
value: Hello World!
headers:
Content-Type: application/vnd.microsoft.appconfig.kv+json
ETag: W/"L10qpBghN693OaxydgTkLmrBbV4"
Last-Modified: 'Tue, 27 Aug 2019 16:52:32 GMT'
Sync-Token: zAJw6V16=NjotMSM3ODk3NjM=;sn=789763
PutLock_IfMatch:
parameters:
If-Match: '"L10qpBghN693OaxydgTkLmrBbV5"'
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
key: Message
responses:
'200':
body:
content_type: null
etag: L10qpBghN693OaxydgTkLmrBbV5
key: Message
label: null
last_modified: '2019-08-27T16:52:32+00:00'
locked: true
tags: {}
value: Hello World!
headers:
Content-Type: application/vnd.microsoft.appconfig.kv+json
ETag: W/"L10qpBghN693OaxydgTkLmrBbV5"
Last-Modified: 'Tue, 27 Aug 2019 16:52:32 GMT'
Sync-Token: zAJw6V16=NjotMSM3ODk3NjM=;sn=789763
language: !<!Languages>
default:
name: PutLock
@ -2675,7 +3024,7 @@ operationGroups:
http: !<!HttpRequest>
path: '/locks/{key}'
method: delete
uri: '{$host}'
uri: '{endpoint}'
signatureParameters:
- *ref_116
- *ref_117
@ -2720,6 +3069,51 @@ operationGroups:
- application/problem+json
statusCodes:
- default
extensions:
x-ms-examples:
DeleteLock:
parameters:
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
key: Message
responses:
'200':
body:
content_type: null
etag: 0BGYCoQ6iNdp5NtQ7N8shrobo6s
key: Message
label: null
last_modified: '2019-08-27T16:52:32+00:00'
locked: false
tags: {}
value: Hello World!
headers:
Content-Type: application/vnd.microsoft.appconfig.kv+json
ETag: W/"0BGYCoQ6iNdp5NtQ7N8shrobo6s"
Last-Modified: 'Tue, 27 Aug 2019 16:52:32 GMT'
Sync-Token: zAJw6V16=NjotMSM3ODk3NjM=;sn=789763
DeleteLock_IfMatch:
parameters:
If-Match: '"L10qpBghN693OaxydgTkLmrBbV5"'
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
key: Message
responses:
'200':
body:
content_type: null
etag: L10qpBghN693OaxydgTkLmrBbV5
key: Message
label: null
last_modified: '2019-08-27T16:52:32+00:00'
locked: false
tags: {}
value: Hello World!
headers:
Content-Type: application/vnd.microsoft.appconfig.kv+json
ETag: W/"L10qpBghN693OaxydgTkLmrBbV5"
Last-Modified: 'Tue, 27 Aug 2019 16:52:32 GMT'
Sync-Token: zAJw6V16=NjotMSM3ODk3NjM=;sn=789763
language: !<!Languages>
default:
name: DeleteLock
@ -2800,7 +3194,7 @@ operationGroups:
http: !<!HttpRequest>
path: /revisions
method: get
uri: '{$host}'
uri: '{endpoint}'
signatureParameters:
- *ref_123
- *ref_124
@ -2844,6 +3238,41 @@ operationGroups:
statusCodes:
- default
extensions:
x-ms-examples:
GetRevisions:
parameters:
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
responses:
'200':
body:
items:
- content_type: null
etag: 0BGYCoQ6iNdp5NtQ7N8shrobo6s
key: Message
label: null
last_modified: '2019-08-27T16:52:32+00:00'
locked: false
tags: {}
value: Hello World!
- content_type: null
etag: L10qpBghN693OaxydgTkLmrBbV4
key: Message
label: null
last_modified: '2019-08-27T16:52:20+00:00'
locked: false
tags: {}
value: A new message.
- content_type: null
etag: tnIHBkDYQwtdNMLoWtr5aybkKwL
key: Message
label: null
last_modified: '2019-08-27T16:50:47+00:00'
locked: false
tags: {}
value: Hello World!
headers:
Content-Type: application/vnd.microsoft.appconfig.kvset+json
x-ms-pageable:
itemName: items
nextLinkName: '@nextLink'
@ -2930,7 +3359,7 @@ operationGroups:
http: !<!HttpRequest>
path: /revisions
method: head
uri: '{$host}'
uri: '{endpoint}'
signatureParameters:
- *ref_130
- *ref_131
@ -2961,6 +3390,16 @@ operationGroups:
http: !<!HttpResponse>
statusCodes:
- default
extensions:
x-ms-examples:
CheckRevisions:
parameters:
api-version: '1.0'
endpoint: 'https://{exampleAppConfigurationName}.azconfig.io'
responses:
'200':
headers:
Content-Type: application/vnd.microsoft.appconfig.kvset+json
language: !<!Languages>
default:
name: CheckRevisions

Просмотреть файл

@ -26,9 +26,9 @@ namespace AppConfiguration
{
}
/// <summary> Initializes a new instance of ServiceClient. </summary>
internal ServiceClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "", string syncToken = null, string apiVersion = "1.0")
internal ServiceClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string syncToken = null, string apiVersion = "1.0")
{
RestClient = new ServiceRestClient(clientDiagnostics, pipeline, host, syncToken, apiVersion);
RestClient = new ServiceRestClient(clientDiagnostics, pipeline, endpoint, syncToken, apiVersion);
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}

Просмотреть файл

@ -18,25 +18,25 @@ namespace AppConfiguration
{
internal partial class ServiceRestClient
{
private string host;
private string endpoint;
private string syncToken;
private string apiVersion;
private ClientDiagnostics _clientDiagnostics;
private HttpPipeline _pipeline;
/// <summary> Initializes a new instance of ServiceRestClient. </summary>
public ServiceRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "", string syncToken = null, string apiVersion = "1.0")
public ServiceRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string syncToken = null, string apiVersion = "1.0")
{
if (host == null)
if (endpoint == null)
{
throw new ArgumentNullException(nameof(host));
throw new ArgumentNullException(nameof(endpoint));
}
if (apiVersion == null)
{
throw new ArgumentNullException(nameof(apiVersion));
}
this.host = host;
this.endpoint = endpoint;
this.syncToken = syncToken;
this.apiVersion = apiVersion;
_clientDiagnostics = clientDiagnostics;
@ -49,7 +49,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendPath("/keys", false);
if (name != null)
{
@ -160,7 +160,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Head;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendPath("/keys", false);
if (name != null)
{
@ -247,7 +247,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendPath("/kv", false);
if (key != null)
{
@ -370,7 +370,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Head;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendPath("/kv", false);
if (key != null)
{
@ -469,7 +469,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendPath("/kv/", false);
uri.AppendPath(key, true);
if (label != null)
@ -605,7 +605,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Put;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendPath("/kv/", false);
uri.AppendPath(key, true);
if (label != null)
@ -738,7 +738,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Delete;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendPath("/kv/", false);
uri.AppendPath(key, true);
if (label != null)
@ -860,7 +860,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Head;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendPath("/kv/", false);
uri.AppendPath(key, true);
if (label != null)
@ -972,7 +972,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendPath("/labels", false);
if (name != null)
{
@ -1089,7 +1089,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Head;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendPath("/labels", false);
if (name != null)
{
@ -1182,7 +1182,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Put;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendPath("/locks/", false);
uri.AppendPath(key, true);
if (label != null)
@ -1306,7 +1306,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Delete;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendPath("/locks/", false);
uri.AppendPath(key, true);
if (label != null)
@ -1430,7 +1430,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendPath("/revisions", false);
if (key != null)
{
@ -1553,7 +1553,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Head;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendPath("/revisions", false);
if (key != null)
{
@ -1652,7 +1652,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendRawNextLink(nextLink, false);
request.Uri = uri;
if (syncToken != null)
@ -1766,7 +1766,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendRawNextLink(nextLink, false);
request.Uri = uri;
if (syncToken != null)
@ -1884,7 +1884,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendRawNextLink(nextLink, false);
request.Uri = uri;
if (syncToken != null)
@ -2000,7 +2000,7 @@ namespace AppConfiguration
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendRaw(endpoint, false);
uri.AppendRawNextLink(nextLink, false);
request.Uri = uri;
if (syncToken != null)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,53 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Text.Json;
using Azure.Core;
namespace Azure.AI.FormRecognizer.Models
{
public partial class CopyAuthorizationResult : IUtf8JsonSerializable
{
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
{
writer.WriteStartObject();
writer.WritePropertyName("modelId");
writer.WriteStringValue(ModelId);
writer.WritePropertyName("accessToken");
writer.WriteStringValue(AccessToken);
writer.WritePropertyName("expirationDateTimeTicks");
writer.WriteNumberValue(ExpirationDateTimeTicks);
writer.WriteEndObject();
}
internal static CopyAuthorizationResult DeserializeCopyAuthorizationResult(JsonElement element)
{
string modelId = default;
string accessToken = default;
long expirationDateTimeTicks = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("modelId"))
{
modelId = property.Value.GetString();
continue;
}
if (property.NameEquals("accessToken"))
{
accessToken = property.Value.GetString();
continue;
}
if (property.NameEquals("expirationDateTimeTicks"))
{
expirationDateTimeTicks = property.Value.GetInt64();
continue;
}
}
return new CopyAuthorizationResult(modelId, accessToken, expirationDateTimeTicks);
}
}
}

Просмотреть файл

@ -0,0 +1,42 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
namespace Azure.AI.FormRecognizer.Models
{
/// <summary> Request parameter that contains authorization claims for copy operation. </summary>
public partial class CopyAuthorizationResult
{
/// <summary> Initializes a new instance of CopyAuthorizationResult. </summary>
/// <param name="modelId"> Model identifier. </param>
/// <param name="accessToken"> Token claim used to authorize the request. </param>
/// <param name="expirationDateTimeTicks"> The time when the access token expires. The date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time. </param>
public CopyAuthorizationResult(string modelId, string accessToken, long expirationDateTimeTicks)
{
if (modelId == null)
{
throw new ArgumentNullException(nameof(modelId));
}
if (accessToken == null)
{
throw new ArgumentNullException(nameof(accessToken));
}
ModelId = modelId;
AccessToken = accessToken;
ExpirationDateTimeTicks = expirationDateTimeTicks;
}
/// <summary> Model identifier. </summary>
public string ModelId { get; set; }
/// <summary> Token claim used to authorize the request. </summary>
public string AccessToken { get; set; }
/// <summary> The time when the access token expires. The date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time. </summary>
public long ExpirationDateTimeTicks { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,52 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Text.Json;
using Azure.Core;
namespace Azure.AI.FormRecognizer.Models
{
public partial class CopyOperationResult
{
internal static CopyOperationResult DeserializeCopyOperationResult(JsonElement element)
{
OperationStatus status = default;
DateTimeOffset createdDateTime = default;
DateTimeOffset lastUpdatedDateTime = default;
CopyResult copyResult = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("status"))
{
status = property.Value.GetString().ToOperationStatus();
continue;
}
if (property.NameEquals("createdDateTime"))
{
createdDateTime = property.Value.GetDateTimeOffset("S");
continue;
}
if (property.NameEquals("lastUpdatedDateTime"))
{
lastUpdatedDateTime = property.Value.GetDateTimeOffset("S");
continue;
}
if (property.NameEquals("copyResult"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
copyResult = CopyResult.DeserializeCopyResult(property.Value);
continue;
}
}
return new CopyOperationResult(status, createdDateTime, lastUpdatedDateTime, copyResult);
}
}
}

Просмотреть файл

@ -0,0 +1,48 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
namespace Azure.AI.FormRecognizer.Models
{
/// <summary> Status and result of the queued copy operation. </summary>
public partial class CopyOperationResult
{
/// <summary> Initializes a new instance of CopyOperationResult. </summary>
/// <param name="status"> Operation status. </param>
/// <param name="createdDateTime"> Date and time (UTC) when the copy operation was submitted. </param>
/// <param name="lastUpdatedDateTime"> Date and time (UTC) when the status was last updated. </param>
internal CopyOperationResult(OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime)
{
Status = status;
CreatedDateTime = createdDateTime;
LastUpdatedDateTime = lastUpdatedDateTime;
}
/// <summary> Initializes a new instance of CopyOperationResult. </summary>
/// <param name="status"> Operation status. </param>
/// <param name="createdDateTime"> Date and time (UTC) when the copy operation was submitted. </param>
/// <param name="lastUpdatedDateTime"> Date and time (UTC) when the status was last updated. </param>
/// <param name="copyResult"> Results of the copy operation. </param>
internal CopyOperationResult(OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, CopyResult copyResult)
{
Status = status;
CreatedDateTime = createdDateTime;
LastUpdatedDateTime = lastUpdatedDateTime;
CopyResult = copyResult;
}
/// <summary> Operation status. </summary>
public OperationStatus Status { get; }
/// <summary> Date and time (UTC) when the copy operation was submitted. </summary>
public DateTimeOffset CreatedDateTime { get; }
/// <summary> Date and time (UTC) when the status was last updated. </summary>
public DateTimeOffset LastUpdatedDateTime { get; }
/// <summary> Results of the copy operation. </summary>
public CopyResult CopyResult { get; }
}
}

Просмотреть файл

@ -0,0 +1,27 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Text.Json;
using Azure.Core;
namespace Azure.AI.FormRecognizer.Models
{
public partial class CopyRequest : IUtf8JsonSerializable
{
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
{
writer.WriteStartObject();
writer.WritePropertyName("targetResourceId");
writer.WriteStringValue(TargetResourceId);
writer.WritePropertyName("targetResourceRegion");
writer.WriteStringValue(TargetResourceRegion);
writer.WritePropertyName("copyAuthorization");
writer.WriteObjectValue(CopyAuthorization);
writer.WriteEndObject();
}
}
}

Просмотреть файл

@ -0,0 +1,46 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
namespace Azure.AI.FormRecognizer.Models
{
/// <summary> Request parameter to copy an existing custom model from the source resource to a target resource referenced by the resource ID. </summary>
public partial class CopyRequest
{
/// <summary> Initializes a new instance of CopyRequest. </summary>
/// <param name="targetResourceId"> Azure Resource Id of the target Form Recognizer resource where the model is copied to. </param>
/// <param name="targetResourceRegion"> Location of the target Azure resource. A valid Azure region name supported by Cognitive Services. </param>
/// <param name="copyAuthorization"> Entity that encodes claims to authorize the copy request. </param>
public CopyRequest(string targetResourceId, string targetResourceRegion, CopyAuthorizationResult copyAuthorization)
{
if (targetResourceId == null)
{
throw new ArgumentNullException(nameof(targetResourceId));
}
if (targetResourceRegion == null)
{
throw new ArgumentNullException(nameof(targetResourceRegion));
}
if (copyAuthorization == null)
{
throw new ArgumentNullException(nameof(copyAuthorization));
}
TargetResourceId = targetResourceId;
TargetResourceRegion = targetResourceRegion;
CopyAuthorization = copyAuthorization;
}
/// <summary> Azure Resource Id of the target Form Recognizer resource where the model is copied to. </summary>
public string TargetResourceId { get; }
/// <summary> Location of the target Azure resource. A valid Azure region name supported by Cognitive Services. </summary>
public string TargetResourceRegion { get; }
/// <summary> Entity that encodes claims to authorize the copy request. </summary>
public CopyAuthorizationResult CopyAuthorization { get; }
}
}

Просмотреть файл

@ -0,0 +1,53 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;
namespace Azure.AI.FormRecognizer.Models
{
public partial class CopyResult
{
internal static CopyResult DeserializeCopyResult(JsonElement element)
{
Guid modelId = default;
IReadOnlyList<ErrorInformation> errors = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("modelId"))
{
modelId = property.Value.GetGuid();
continue;
}
if (property.NameEquals("errors"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
List<ErrorInformation> array = new List<ErrorInformation>();
foreach (var item in property.Value.EnumerateArray())
{
if (item.ValueKind == JsonValueKind.Null)
{
array.Add(null);
}
else
{
array.Add(ErrorInformation.DeserializeErrorInformation(item));
}
}
errors = array;
continue;
}
}
return new CopyResult(modelId, errors);
}
}
}

Просмотреть файл

@ -0,0 +1,37 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
namespace Azure.AI.FormRecognizer.Models
{
/// <summary> Custom model copy result. </summary>
public partial class CopyResult
{
/// <summary> Initializes a new instance of CopyResult. </summary>
/// <param name="modelId"> Identifier of the target model. </param>
internal CopyResult(Guid modelId)
{
ModelId = modelId;
}
/// <summary> Initializes a new instance of CopyResult. </summary>
/// <param name="modelId"> Identifier of the target model. </param>
/// <param name="errors"> Errors returned during the copy operation. </param>
internal CopyResult(Guid modelId, IReadOnlyList<ErrorInformation> errors)
{
ModelId = modelId;
Errors = errors;
}
/// <summary> Identifier of the target model. </summary>
public Guid ModelId { get; }
/// <summary> Errors returned during the copy operation. </summary>
public IReadOnlyList<ErrorInformation> Errors { get; }
}
}

Просмотреть файл

@ -19,7 +19,7 @@ namespace Azure.AI.FormRecognizer.Models
FieldValueType type = default;
string valueString = default;
DateTimeOffset? valueDate = default;
string valueTime = default;
TimeSpan? valueTime = default;
string valuePhoneNumber = default;
float? valueNumber = default;
int? valueInteger = default;
@ -61,7 +61,7 @@ namespace Azure.AI.FormRecognizer.Models
{
continue;
}
valueTime = property.Value.GetString();
valueTime = property.Value.GetTimeSpan("T");
continue;
}
if (property.NameEquals("valuePhoneNumber"))

Просмотреть файл

@ -35,7 +35,7 @@ namespace Azure.AI.FormRecognizer.Models
/// <param name="confidence"> Confidence score. </param>
/// <param name="elements"> When includeTextDetails is set to true, a list of references to the text elements constituting this field. </param>
/// <param name="page"> The 1-based page number in the input document. </param>
internal FieldValue(FieldValueType type, string valueString, DateTimeOffset? valueDate, string valueTime, string valuePhoneNumber, float? valueNumber, int? valueInteger, IReadOnlyList<FieldValue> valueArray, IReadOnlyDictionary<string, FieldValue> valueObject, string text, IReadOnlyList<float> boundingBox, float? confidence, IReadOnlyList<string> elements, int? page)
internal FieldValue(FieldValueType type, string valueString, DateTimeOffset? valueDate, TimeSpan? valueTime, string valuePhoneNumber, float? valueNumber, int? valueInteger, IReadOnlyList<FieldValue> valueArray, IReadOnlyDictionary<string, FieldValue> valueObject, string text, IReadOnlyList<float> boundingBox, float? confidence, IReadOnlyList<string> elements, int? page)
{
Type = type;
ValueString = valueString;
@ -60,7 +60,7 @@ namespace Azure.AI.FormRecognizer.Models
/// <summary> Date value. </summary>
public DateTimeOffset? ValueDate { get; }
/// <summary> Time value. </summary>
public string ValueTime { get; }
public TimeSpan? ValueTime { get; }
/// <summary> Phone number value. </summary>
public string ValuePhoneNumber { get; }
/// <summary> Floating point value. </summary>

Просмотреть файл

@ -102,6 +102,38 @@ namespace Azure.AI.FormRecognizer
return RestClient.GetAnalyzeFormResult(modelId, resultId, cancellationToken);
}
/// <summary> Obtain current status and the result of a custom model copy operation. </summary>
/// <param name="modelId"> Model identifier. </param>
/// <param name="resultId"> Copy operation result identifier. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response<CopyOperationResult>> GetCustomModelCopyResultAsync(Guid modelId, Guid resultId, CancellationToken cancellationToken = default)
{
return await RestClient.GetCustomModelCopyResultAsync(modelId, resultId, cancellationToken).ConfigureAwait(false);
}
/// <summary> Obtain current status and the result of a custom model copy operation. </summary>
/// <param name="modelId"> Model identifier. </param>
/// <param name="resultId"> Copy operation result identifier. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response<CopyOperationResult> GetCustomModelCopyResult(Guid modelId, Guid resultId, CancellationToken cancellationToken = default)
{
return RestClient.GetCustomModelCopyResult(modelId, resultId, cancellationToken);
}
/// <summary> Generate authorization to copy a model into the target Form Recognizer resource. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response<CopyAuthorizationResult>> GenerateModelCopyAuthorizationAsync(CancellationToken cancellationToken = default)
{
return await RestClient.GenerateModelCopyAuthorizationAsync(cancellationToken).ConfigureAwait(false);
}
/// <summary> Generate authorization to copy a model into the target Form Recognizer resource. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response<CopyAuthorizationResult> GenerateModelCopyAuthorization(CancellationToken cancellationToken = default)
{
return RestClient.GenerateModelCopyAuthorization(cancellationToken);
}
/// <summary> Track the progress and obtain the result of the analyze receipt operation. </summary>
/// <param name="resultId"> Analyze operation result identifier. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
@ -255,6 +287,53 @@ namespace Azure.AI.FormRecognizer
return CreateAnalyzeWithCustomModel(originalResponse, () => RestClient.CreateAnalyzeWithCustomModelRequest(modelId, includeTextDetails, fileStream));
}
/// <summary> Copy custom model stored in this resource (the source) to user specified target Form Recognizer resource. </summary>
/// <param name="originalResponse"> The original response from starting the operation. </param>
/// <param name="createOriginalHttpMessage"> Creates the HTTP message used for the original request. </param>
internal Operation<Response> CreateCopyCustomModel(Response originalResponse, Func<HttpMessage> createOriginalHttpMessage)
{
if (originalResponse == null)
{
throw new ArgumentNullException(nameof(originalResponse));
}
if (createOriginalHttpMessage == null)
{
throw new ArgumentNullException(nameof(createOriginalHttpMessage));
}
return ArmOperationHelpers.Create(_pipeline, _clientDiagnostics, originalResponse, RequestMethod.Post, "ServiceClient.CopyCustomModel", OperationFinalStateVia.Location, createOriginalHttpMessage);
}
/// <summary> Copy custom model stored in this resource (the source) to user specified target Form Recognizer resource. </summary>
/// <param name="modelId"> Model identifier. </param>
/// <param name="copyRequest"> Copy request parameters. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async ValueTask<Operation<Response>> StartCopyCustomModelAsync(Guid modelId, CopyRequest copyRequest, CancellationToken cancellationToken = default)
{
if (copyRequest == null)
{
throw new ArgumentNullException(nameof(copyRequest));
}
var originalResponse = await RestClient.CopyCustomModelAsync(modelId, copyRequest, cancellationToken).ConfigureAwait(false);
return CreateCopyCustomModel(originalResponse, () => RestClient.CreateCopyCustomModelRequest(modelId, copyRequest));
}
/// <summary> Copy custom model stored in this resource (the source) to user specified target Form Recognizer resource. </summary>
/// <param name="modelId"> Model identifier. </param>
/// <param name="copyRequest"> Copy request parameters. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Operation<Response> StartCopyCustomModel(Guid modelId, CopyRequest copyRequest, CancellationToken cancellationToken = default)
{
if (copyRequest == null)
{
throw new ArgumentNullException(nameof(copyRequest));
}
var originalResponse = RestClient.CopyCustomModel(modelId, copyRequest, cancellationToken);
return CreateCopyCustomModel(originalResponse, () => RestClient.CreateCopyCustomModelRequest(modelId, copyRequest));
}
/// <summary> Extract field text and semantic values from a given receipt document. The input document must be of one of the supported content types - &apos;application/pdf&apos;, &apos;image/jpeg&apos;, &apos;image/png&apos; or &apos;image/tiff&apos;. Alternatively, use &apos;application/json&apos; type to specify the location (Uri or local path) of the document to be analyzed. </summary>
/// <param name="originalResponse"> The original response from starting the operation. </param>
/// <param name="createOriginalHttpMessage"> Creates the HTTP message used for the original request. </param>

Просмотреть файл

@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using Azure;
using Azure.Core;
namespace Azure.AI.FormRecognizer
{
internal class ServiceGenerateModelCopyAuthorizationHeaders
{
private readonly Response _response;
public ServiceGenerateModelCopyAuthorizationHeaders(Response response)
{
_response = response;
}
public string Location => _response.Headers.TryGetValue("Location", out string value) ? value : null;
}
}

Просмотреть файл

@ -544,6 +544,272 @@ namespace Azure.AI.FormRecognizer
}
}
internal HttpMessage CreateCopyCustomModelRequest(Guid modelId, CopyRequest copyRequest)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(endpoint, false);
uri.AppendRaw("/formrecognizer/v2.0-preview", false);
uri.AppendPath("/custom/models/", false);
uri.AppendPath(modelId, true);
uri.AppendPath("/copy", false);
request.Uri = uri;
request.Headers.Add("Content-Type", "application/json");
using var content = new Utf8JsonRequestContent();
content.JsonWriter.WriteObjectValue(copyRequest);
request.Content = content;
return message;
}
/// <summary> Copy custom model stored in this resource (the source) to user specified target Form Recognizer resource. </summary>
/// <param name="modelId"> Model identifier. </param>
/// <param name="copyRequest"> Copy request parameters. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async ValueTask<Response> CopyCustomModelAsync(Guid modelId, CopyRequest copyRequest, CancellationToken cancellationToken = default)
{
if (copyRequest == null)
{
throw new ArgumentNullException(nameof(copyRequest));
}
using var scope = _clientDiagnostics.CreateScope("ServiceClient.CopyCustomModel");
scope.Start();
try
{
using var message = CreateCopyCustomModelRequest(modelId, copyRequest);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
case 202:
return message.Response;
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Copy custom model stored in this resource (the source) to user specified target Form Recognizer resource. </summary>
/// <param name="modelId"> Model identifier. </param>
/// <param name="copyRequest"> Copy request parameters. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response CopyCustomModel(Guid modelId, CopyRequest copyRequest, CancellationToken cancellationToken = default)
{
if (copyRequest == null)
{
throw new ArgumentNullException(nameof(copyRequest));
}
using var scope = _clientDiagnostics.CreateScope("ServiceClient.CopyCustomModel");
scope.Start();
try
{
using var message = CreateCopyCustomModelRequest(modelId, copyRequest);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
case 202:
return message.Response;
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
internal HttpMessage CreateGetCustomModelCopyResultRequest(Guid modelId, Guid resultId)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(endpoint, false);
uri.AppendRaw("/formrecognizer/v2.0-preview", false);
uri.AppendPath("/custom/models/", false);
uri.AppendPath(modelId, true);
uri.AppendPath("/copyResults/", false);
uri.AppendPath(resultId, true);
request.Uri = uri;
return message;
}
/// <summary> Obtain current status and the result of a custom model copy operation. </summary>
/// <param name="modelId"> Model identifier. </param>
/// <param name="resultId"> Copy operation result identifier. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async ValueTask<Response<CopyOperationResult>> GetCustomModelCopyResultAsync(Guid modelId, Guid resultId, CancellationToken cancellationToken = default)
{
using var scope = _clientDiagnostics.CreateScope("ServiceClient.GetCustomModelCopyResult");
scope.Start();
try
{
using var message = CreateGetCustomModelCopyResultRequest(modelId, resultId);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
case 200:
{
CopyOperationResult value = default;
using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
if (document.RootElement.ValueKind == JsonValueKind.Null)
{
value = null;
}
else
{
value = CopyOperationResult.DeserializeCopyOperationResult(document.RootElement);
}
return Response.FromValue(value, message.Response);
}
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Obtain current status and the result of a custom model copy operation. </summary>
/// <param name="modelId"> Model identifier. </param>
/// <param name="resultId"> Copy operation result identifier. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response<CopyOperationResult> GetCustomModelCopyResult(Guid modelId, Guid resultId, CancellationToken cancellationToken = default)
{
using var scope = _clientDiagnostics.CreateScope("ServiceClient.GetCustomModelCopyResult");
scope.Start();
try
{
using var message = CreateGetCustomModelCopyResultRequest(modelId, resultId);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
case 200:
{
CopyOperationResult value = default;
using var document = JsonDocument.Parse(message.Response.ContentStream);
if (document.RootElement.ValueKind == JsonValueKind.Null)
{
value = null;
}
else
{
value = CopyOperationResult.DeserializeCopyOperationResult(document.RootElement);
}
return Response.FromValue(value, message.Response);
}
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
internal HttpMessage CreateGenerateModelCopyAuthorizationRequest()
{
var message = _pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(endpoint, false);
uri.AppendRaw("/formrecognizer/v2.0-preview", false);
uri.AppendPath("/custom/models/copyAuthorization", false);
request.Uri = uri;
return message;
}
/// <summary> Generate authorization to copy a model into the target Form Recognizer resource. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async ValueTask<ResponseWithHeaders<CopyAuthorizationResult, ServiceGenerateModelCopyAuthorizationHeaders>> GenerateModelCopyAuthorizationAsync(CancellationToken cancellationToken = default)
{
using var scope = _clientDiagnostics.CreateScope("ServiceClient.GenerateModelCopyAuthorization");
scope.Start();
try
{
using var message = CreateGenerateModelCopyAuthorizationRequest();
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
var headers = new ServiceGenerateModelCopyAuthorizationHeaders(message.Response);
switch (message.Response.Status)
{
case 201:
{
CopyAuthorizationResult value = default;
using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
if (document.RootElement.ValueKind == JsonValueKind.Null)
{
value = null;
}
else
{
value = CopyAuthorizationResult.DeserializeCopyAuthorizationResult(document.RootElement);
}
return ResponseWithHeaders.FromValue(value, headers, message.Response);
}
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Generate authorization to copy a model into the target Form Recognizer resource. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public ResponseWithHeaders<CopyAuthorizationResult, ServiceGenerateModelCopyAuthorizationHeaders> GenerateModelCopyAuthorization(CancellationToken cancellationToken = default)
{
using var scope = _clientDiagnostics.CreateScope("ServiceClient.GenerateModelCopyAuthorization");
scope.Start();
try
{
using var message = CreateGenerateModelCopyAuthorizationRequest();
_pipeline.Send(message, cancellationToken);
var headers = new ServiceGenerateModelCopyAuthorizationHeaders(message.Response);
switch (message.Response.Status)
{
case 201:
{
CopyAuthorizationResult value = default;
using var document = JsonDocument.Parse(message.Response.ContentStream);
if (document.RootElement.ValueKind == JsonValueKind.Null)
{
value = null;
}
else
{
value = CopyAuthorizationResult.DeserializeCopyAuthorizationResult(document.RootElement);
}
return ResponseWithHeaders.FromValue(value, headers, message.Response);
}
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
internal HttpMessage CreateAnalyzeReceiptAsyncRequest(ContentType contentType, Stream fileStream, bool? includeTextDetails)
{
var message = _pipeline.CreateMessage();

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -6,7 +6,6 @@
#nullable disable
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Azure;
@ -40,48 +39,44 @@ namespace Azure.Management.Storage
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="shareName"> The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
/// <param name="metadata"> A name-value pair to associate with the share as metadata. </param>
/// <param name="shareQuota"> The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. </param>
/// <param name="fileShare"> Properties of the file share to create. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response<FileShare>> CreateAsync(string resourceGroupName, string accountName, string shareName, IDictionary<string, string> metadata = null, int? shareQuota = null, CancellationToken cancellationToken = default)
public virtual async Task<Response<FileShare>> CreateAsync(string resourceGroupName, string accountName, string shareName, FileShare fileShare, CancellationToken cancellationToken = default)
{
return await RestClient.CreateAsync(resourceGroupName, accountName, shareName, metadata, shareQuota, cancellationToken).ConfigureAwait(false);
return await RestClient.CreateAsync(resourceGroupName, accountName, shareName, fileShare, cancellationToken).ConfigureAwait(false);
}
/// <summary> Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="shareName"> The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
/// <param name="metadata"> A name-value pair to associate with the share as metadata. </param>
/// <param name="shareQuota"> The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. </param>
/// <param name="fileShare"> Properties of the file share to create. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response<FileShare> Create(string resourceGroupName, string accountName, string shareName, IDictionary<string, string> metadata = null, int? shareQuota = null, CancellationToken cancellationToken = default)
public virtual Response<FileShare> Create(string resourceGroupName, string accountName, string shareName, FileShare fileShare, CancellationToken cancellationToken = default)
{
return RestClient.Create(resourceGroupName, accountName, shareName, metadata, shareQuota, cancellationToken);
return RestClient.Create(resourceGroupName, accountName, shareName, fileShare, cancellationToken);
}
/// <summary> Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="shareName"> The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
/// <param name="metadata"> A name-value pair to associate with the share as metadata. </param>
/// <param name="shareQuota"> The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. </param>
/// <param name="fileShare"> Properties to update for the file share. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response<FileShare>> UpdateAsync(string resourceGroupName, string accountName, string shareName, IDictionary<string, string> metadata = null, int? shareQuota = null, CancellationToken cancellationToken = default)
public virtual async Task<Response<FileShare>> UpdateAsync(string resourceGroupName, string accountName, string shareName, FileShare fileShare, CancellationToken cancellationToken = default)
{
return await RestClient.UpdateAsync(resourceGroupName, accountName, shareName, metadata, shareQuota, cancellationToken).ConfigureAwait(false);
return await RestClient.UpdateAsync(resourceGroupName, accountName, shareName, fileShare, cancellationToken).ConfigureAwait(false);
}
/// <summary> Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="shareName"> The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
/// <param name="metadata"> A name-value pair to associate with the share as metadata. </param>
/// <param name="shareQuota"> The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. </param>
/// <param name="fileShare"> Properties to update for the file share. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response<FileShare> Update(string resourceGroupName, string accountName, string shareName, IDictionary<string, string> metadata = null, int? shareQuota = null, CancellationToken cancellationToken = default)
public virtual Response<FileShare> Update(string resourceGroupName, string accountName, string shareName, FileShare fileShare, CancellationToken cancellationToken = default)
{
return RestClient.Update(resourceGroupName, accountName, shareName, metadata, shareQuota, cancellationToken);
return RestClient.Update(resourceGroupName, accountName, shareName, fileShare, cancellationToken);
}
/// <summary> Gets properties of a specified share. </summary>
@ -124,6 +119,30 @@ namespace Azure.Management.Storage
return RestClient.Delete(resourceGroupName, accountName, shareName, cancellationToken);
}
/// <summary> Restore a file share within a valid retention days if share soft delete is enabled. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="shareName"> The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
/// <param name="deletedShareName"> Required. Identify the name of the deleted share that will be restored. </param>
/// <param name="deletedShareVersion"> Required. Identify the version of the deleted share that will be restored. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> RestoreAsync(string resourceGroupName, string accountName, string shareName, string deletedShareName, string deletedShareVersion, CancellationToken cancellationToken = default)
{
return await RestClient.RestoreAsync(resourceGroupName, accountName, shareName, deletedShareName, deletedShareVersion, cancellationToken).ConfigureAwait(false);
}
/// <summary> Restore a file share within a valid retention days if share soft delete is enabled. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="shareName"> The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
/// <param name="deletedShareName"> Required. Identify the name of the deleted share that will be restored. </param>
/// <param name="deletedShareVersion"> Required. Identify the version of the deleted share that will be restored. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response Restore(string resourceGroupName, string accountName, string shareName, string deletedShareName, string deletedShareVersion, CancellationToken cancellationToken = default)
{
return RestClient.Restore(resourceGroupName, accountName, shareName, deletedShareName, deletedShareVersion, cancellationToken);
}
/// <summary> Lists all shares. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>

Просмотреть файл

@ -6,7 +6,6 @@
#nullable disable
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
@ -71,6 +70,7 @@ namespace Azure.Management.Storage
{
uri.AppendQuery("$filter", filter, true);
}
uri.AppendQuery("$expand", "deleted", true);
request.Uri = uri;
return message;
}
@ -175,7 +175,7 @@ namespace Azure.Management.Storage
}
}
internal HttpMessage CreateCreateRequest(string resourceGroupName, string accountName, string shareName, IDictionary<string, string> metadata, int? shareQuota)
internal HttpMessage CreateCreateRequest(string resourceGroupName, string accountName, string shareName, FileShare fileShare)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
@ -193,13 +193,8 @@ namespace Azure.Management.Storage
uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Content-Type", "application/json");
var model = new FileShare()
{
Metadata = metadata,
ShareQuota = shareQuota
};
using var content = new Utf8JsonRequestContent();
content.JsonWriter.WriteObjectValue(model);
content.JsonWriter.WriteObjectValue(fileShare);
request.Content = content;
return message;
}
@ -208,10 +203,9 @@ namespace Azure.Management.Storage
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="shareName"> The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
/// <param name="metadata"> A name-value pair to associate with the share as metadata. </param>
/// <param name="shareQuota"> The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. </param>
/// <param name="fileShare"> Properties of the file share to create. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async ValueTask<Response<FileShare>> CreateAsync(string resourceGroupName, string accountName, string shareName, IDictionary<string, string> metadata = null, int? shareQuota = null, CancellationToken cancellationToken = default)
public async ValueTask<Response<FileShare>> CreateAsync(string resourceGroupName, string accountName, string shareName, FileShare fileShare, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@ -225,12 +219,16 @@ namespace Azure.Management.Storage
{
throw new ArgumentNullException(nameof(shareName));
}
if (fileShare == null)
{
throw new ArgumentNullException(nameof(fileShare));
}
using var scope = _clientDiagnostics.CreateScope("FileSharesClient.Create");
scope.Start();
try
{
using var message = CreateCreateRequest(resourceGroupName, accountName, shareName, metadata, shareQuota);
using var message = CreateCreateRequest(resourceGroupName, accountName, shareName, fileShare);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
@ -264,10 +262,9 @@ namespace Azure.Management.Storage
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="shareName"> The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
/// <param name="metadata"> A name-value pair to associate with the share as metadata. </param>
/// <param name="shareQuota"> The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. </param>
/// <param name="fileShare"> Properties of the file share to create. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response<FileShare> Create(string resourceGroupName, string accountName, string shareName, IDictionary<string, string> metadata = null, int? shareQuota = null, CancellationToken cancellationToken = default)
public Response<FileShare> Create(string resourceGroupName, string accountName, string shareName, FileShare fileShare, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@ -281,12 +278,16 @@ namespace Azure.Management.Storage
{
throw new ArgumentNullException(nameof(shareName));
}
if (fileShare == null)
{
throw new ArgumentNullException(nameof(fileShare));
}
using var scope = _clientDiagnostics.CreateScope("FileSharesClient.Create");
scope.Start();
try
{
using var message = CreateCreateRequest(resourceGroupName, accountName, shareName, metadata, shareQuota);
using var message = CreateCreateRequest(resourceGroupName, accountName, shareName, fileShare);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
@ -316,7 +317,7 @@ namespace Azure.Management.Storage
}
}
internal HttpMessage CreateUpdateRequest(string resourceGroupName, string accountName, string shareName, IDictionary<string, string> metadata, int? shareQuota)
internal HttpMessage CreateUpdateRequest(string resourceGroupName, string accountName, string shareName, FileShare fileShare)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
@ -334,13 +335,8 @@ namespace Azure.Management.Storage
uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Content-Type", "application/json");
var model = new FileShare()
{
Metadata = metadata,
ShareQuota = shareQuota
};
using var content = new Utf8JsonRequestContent();
content.JsonWriter.WriteObjectValue(model);
content.JsonWriter.WriteObjectValue(fileShare);
request.Content = content;
return message;
}
@ -349,10 +345,9 @@ namespace Azure.Management.Storage
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="shareName"> The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
/// <param name="metadata"> A name-value pair to associate with the share as metadata. </param>
/// <param name="shareQuota"> The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. </param>
/// <param name="fileShare"> Properties to update for the file share. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async ValueTask<Response<FileShare>> UpdateAsync(string resourceGroupName, string accountName, string shareName, IDictionary<string, string> metadata = null, int? shareQuota = null, CancellationToken cancellationToken = default)
public async ValueTask<Response<FileShare>> UpdateAsync(string resourceGroupName, string accountName, string shareName, FileShare fileShare, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@ -366,12 +361,16 @@ namespace Azure.Management.Storage
{
throw new ArgumentNullException(nameof(shareName));
}
if (fileShare == null)
{
throw new ArgumentNullException(nameof(fileShare));
}
using var scope = _clientDiagnostics.CreateScope("FileSharesClient.Update");
scope.Start();
try
{
using var message = CreateUpdateRequest(resourceGroupName, accountName, shareName, metadata, shareQuota);
using var message = CreateUpdateRequest(resourceGroupName, accountName, shareName, fileShare);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
@ -404,10 +403,9 @@ namespace Azure.Management.Storage
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="shareName"> The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
/// <param name="metadata"> A name-value pair to associate with the share as metadata. </param>
/// <param name="shareQuota"> The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. </param>
/// <param name="fileShare"> Properties to update for the file share. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response<FileShare> Update(string resourceGroupName, string accountName, string shareName, IDictionary<string, string> metadata = null, int? shareQuota = null, CancellationToken cancellationToken = default)
public Response<FileShare> Update(string resourceGroupName, string accountName, string shareName, FileShare fileShare, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
@ -421,12 +419,16 @@ namespace Azure.Management.Storage
{
throw new ArgumentNullException(nameof(shareName));
}
if (fileShare == null)
{
throw new ArgumentNullException(nameof(fileShare));
}
using var scope = _clientDiagnostics.CreateScope("FileSharesClient.Update");
scope.Start();
try
{
using var message = CreateUpdateRequest(resourceGroupName, accountName, shareName, metadata, shareQuota);
using var message = CreateUpdateRequest(resourceGroupName, accountName, shareName, fileShare);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
@ -471,6 +473,7 @@ namespace Azure.Management.Storage
uri.AppendPath("/fileServices/default/shares/", false);
uri.AppendPath(shareName, true);
uri.AppendQuery("api-version", apiVersion, true);
uri.AppendQuery("$expand", "stats", true);
request.Uri = uri;
return message;
}
@ -685,6 +688,134 @@ namespace Azure.Management.Storage
}
}
internal HttpMessage CreateRestoreRequest(string resourceGroupName, string accountName, string shareName, string deletedShareName, string deletedShareVersion)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Post;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendPath("/subscriptions/", false);
uri.AppendPath(subscriptionId, true);
uri.AppendPath("/resourceGroups/", false);
uri.AppendPath(resourceGroupName, true);
uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/fileServices/default/shares/", false);
uri.AppendPath(shareName, true);
uri.AppendPath("/restore", false);
uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Content-Type", "application/json");
var model = new DeletedShare(deletedShareName, deletedShareVersion);
using var content = new Utf8JsonRequestContent();
content.JsonWriter.WriteObjectValue(model);
request.Content = content;
return message;
}
/// <summary> Restore a file share within a valid retention days if share soft delete is enabled. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="shareName"> The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
/// <param name="deletedShareName"> Required. Identify the name of the deleted share that will be restored. </param>
/// <param name="deletedShareVersion"> Required. Identify the version of the deleted share that will be restored. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async ValueTask<Response> RestoreAsync(string resourceGroupName, string accountName, string shareName, string deletedShareName, string deletedShareVersion, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
throw new ArgumentNullException(nameof(resourceGroupName));
}
if (accountName == null)
{
throw new ArgumentNullException(nameof(accountName));
}
if (shareName == null)
{
throw new ArgumentNullException(nameof(shareName));
}
if (deletedShareName == null)
{
throw new ArgumentNullException(nameof(deletedShareName));
}
if (deletedShareVersion == null)
{
throw new ArgumentNullException(nameof(deletedShareVersion));
}
using var scope = _clientDiagnostics.CreateScope("FileSharesClient.Restore");
scope.Start();
try
{
using var message = CreateRestoreRequest(resourceGroupName, accountName, shareName, deletedShareName, deletedShareVersion);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
case 200:
return message.Response;
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Restore a file share within a valid retention days if share soft delete is enabled. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="shareName"> The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
/// <param name="deletedShareName"> Required. Identify the name of the deleted share that will be restored. </param>
/// <param name="deletedShareVersion"> Required. Identify the version of the deleted share that will be restored. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response Restore(string resourceGroupName, string accountName, string shareName, string deletedShareName, string deletedShareVersion, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
throw new ArgumentNullException(nameof(resourceGroupName));
}
if (accountName == null)
{
throw new ArgumentNullException(nameof(accountName));
}
if (shareName == null)
{
throw new ArgumentNullException(nameof(shareName));
}
if (deletedShareName == null)
{
throw new ArgumentNullException(nameof(deletedShareName));
}
if (deletedShareVersion == null)
{
throw new ArgumentNullException(nameof(deletedShareVersion));
}
using var scope = _clientDiagnostics.CreateScope("FileSharesClient.Restore");
scope.Start();
try
{
using var message = CreateRestoreRequest(resourceGroupName, accountName, shareName, deletedShareName, deletedShareVersion);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
case 200:
return message.Response;
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName, string accountName, string maxpagesize, string filter)
{
var message = _pipeline.CreateMessage();

Просмотреть файл

@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Text.Json;
using Azure.Core;
namespace Azure.Management.Storage.Models
{
public partial class DeletedShare : IUtf8JsonSerializable
{
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
{
writer.WriteStartObject();
writer.WritePropertyName("deletedShareName");
writer.WriteStringValue(DeletedShareName);
writer.WritePropertyName("deletedShareVersion");
writer.WriteStringValue(DeletedShareVersion);
writer.WriteEndObject();
}
}
}

Просмотреть файл

@ -0,0 +1,38 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
namespace Azure.Management.Storage.Models
{
/// <summary> The deleted share to be restored. </summary>
public partial class DeletedShare
{
/// <summary> Initializes a new instance of DeletedShare. </summary>
/// <param name="deletedShareName"> Required. Identify the name of the deleted share that will be restored. </param>
/// <param name="deletedShareVersion"> Required. Identify the version of the deleted share that will be restored. </param>
public DeletedShare(string deletedShareName, string deletedShareVersion)
{
if (deletedShareName == null)
{
throw new ArgumentNullException(nameof(deletedShareName));
}
if (deletedShareVersion == null)
{
throw new ArgumentNullException(nameof(deletedShareVersion));
}
DeletedShareName = deletedShareName;
DeletedShareVersion = deletedShareVersion;
}
/// <summary> Required. Identify the name of the deleted share that will be restored. </summary>
public string DeletedShareName { get; }
/// <summary> Required. Identify the version of the deleted share that will be restored. </summary>
public string DeletedShareVersion { get; }
}
}

Просмотреть файл

@ -0,0 +1,50 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.ComponentModel;
namespace Azure.Management.Storage.Models
{
/// <summary> The authentication protocol that is used for the file share. Can only be specified when creating a share. </summary>
public readonly partial struct EnabledProtocols : IEquatable<EnabledProtocols>
{
private readonly string _value;
/// <summary> Determines if two <see cref="EnabledProtocols"/> values are the same. </summary>
public EnabledProtocols(string value)
{
_value = value ?? throw new ArgumentNullException(nameof(value));
}
private const string SMBValue = "SMB";
private const string NFSValue = "NFS";
/// <summary> SMB. </summary>
public static EnabledProtocols SMB { get; } = new EnabledProtocols(SMBValue);
/// <summary> NFS. </summary>
public static EnabledProtocols NFS { get; } = new EnabledProtocols(NFSValue);
/// <summary> Determines if two <see cref="EnabledProtocols"/> values are the same. </summary>
public static bool operator ==(EnabledProtocols left, EnabledProtocols right) => left.Equals(right);
/// <summary> Determines if two <see cref="EnabledProtocols"/> values are not the same. </summary>
public static bool operator !=(EnabledProtocols left, EnabledProtocols right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="EnabledProtocols"/>. </summary>
public static implicit operator EnabledProtocols(string value) => new EnabledProtocols(value);
/// <inheritdoc />
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj) => obj is EnabledProtocols other && Equals(other);
/// <inheritdoc />
public bool Equals(EnabledProtocols other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
/// <inheritdoc />
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => _value?.GetHashCode() ?? 0;
/// <inheritdoc />
public override string ToString() => _value;
}
}

Просмотреть файл

@ -60,6 +60,56 @@ namespace Azure.Management.Storage.Models
writer.WritePropertyName("shareQuota");
writer.WriteNumberValue(ShareQuota.Value);
}
if (EnabledProtocols != null)
{
writer.WritePropertyName("enabledProtocols");
writer.WriteStringValue(EnabledProtocols.Value.ToString());
}
if (RootSquash != null)
{
writer.WritePropertyName("rootSquash");
writer.WriteStringValue(RootSquash.Value.ToString());
}
if (Version != null)
{
writer.WritePropertyName("version");
writer.WriteStringValue(Version);
}
if (Deleted != null)
{
writer.WritePropertyName("deleted");
writer.WriteBooleanValue(Deleted.Value);
}
if (DeletedTime != null)
{
writer.WritePropertyName("deletedTime");
writer.WriteStringValue(DeletedTime.Value, "S");
}
if (RemainingRetentionDays != null)
{
writer.WritePropertyName("remainingRetentionDays");
writer.WriteNumberValue(RemainingRetentionDays.Value);
}
if (AccessTier != null)
{
writer.WritePropertyName("accessTier");
writer.WriteStringValue(AccessTier.Value.ToString());
}
if (AccessTierChangeTime != null)
{
writer.WritePropertyName("accessTierChangeTime");
writer.WriteStringValue(AccessTierChangeTime.Value, "S");
}
if (AccessTierStatus != null)
{
writer.WritePropertyName("accessTierStatus");
writer.WriteStringValue(AccessTierStatus);
}
if (ShareUsageBytes != null)
{
writer.WritePropertyName("shareUsageBytes");
writer.WriteNumberValue(ShareUsageBytes.Value);
}
writer.WriteEndObject();
writer.WriteEndObject();
}
@ -73,6 +123,16 @@ namespace Azure.Management.Storage.Models
DateTimeOffset? lastModifiedTime = default;
IDictionary<string, string> metadata = default;
int? shareQuota = default;
EnabledProtocols? enabledProtocols = default;
RootSquashType? rootSquash = default;
string version = default;
bool? deleted = default;
DateTimeOffset? deletedTime = default;
int? remainingRetentionDays = default;
ShareAccessTier? accessTier = default;
DateTimeOffset? accessTierChangeTime = default;
string accessTierStatus = default;
int? shareUsageBytes = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("etag"))
@ -154,11 +214,101 @@ namespace Azure.Management.Storage.Models
shareQuota = property0.Value.GetInt32();
continue;
}
if (property0.NameEquals("enabledProtocols"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
enabledProtocols = new EnabledProtocols(property0.Value.GetString());
continue;
}
if (property0.NameEquals("rootSquash"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
rootSquash = new RootSquashType(property0.Value.GetString());
continue;
}
if (property0.NameEquals("version"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
version = property0.Value.GetString();
continue;
}
if (property0.NameEquals("deleted"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
deleted = property0.Value.GetBoolean();
continue;
}
if (property0.NameEquals("deletedTime"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
deletedTime = property0.Value.GetDateTimeOffset("S");
continue;
}
if (property0.NameEquals("remainingRetentionDays"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
remainingRetentionDays = property0.Value.GetInt32();
continue;
}
if (property0.NameEquals("accessTier"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
accessTier = new ShareAccessTier(property0.Value.GetString());
continue;
}
if (property0.NameEquals("accessTierChangeTime"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
accessTierChangeTime = property0.Value.GetDateTimeOffset("S");
continue;
}
if (property0.NameEquals("accessTierStatus"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
accessTierStatus = property0.Value.GetString();
continue;
}
if (property0.NameEquals("shareUsageBytes"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
shareUsageBytes = property0.Value.GetInt32();
continue;
}
}
continue;
}
}
return new FileShare(id, name, type, etag, lastModifiedTime, metadata, shareQuota);
return new FileShare(id, name, type, etag, lastModifiedTime, metadata, shareQuota, enabledProtocols, rootSquash, version, deleted, deletedTime, remainingRetentionDays, accessTier, accessTierChangeTime, accessTierStatus, shareUsageBytes);
}
}
}

Просмотреть файл

@ -26,11 +26,31 @@ namespace Azure.Management.Storage.Models
/// <param name="lastModifiedTime"> Returns the date and time the share was last modified. </param>
/// <param name="metadata"> A name-value pair to associate with the share as metadata. </param>
/// <param name="shareQuota"> The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. </param>
internal FileShare(string id, string name, string type, string etag, DateTimeOffset? lastModifiedTime, IDictionary<string, string> metadata, int? shareQuota) : base(id, name, type, etag)
/// <param name="enabledProtocols"> The authentication protocol that is used for the file share. Can only be specified when creating a share. </param>
/// <param name="rootSquash"> The property is for NFS share only. The default is NoRootSquash. </param>
/// <param name="version"> The version of the share. </param>
/// <param name="deleted"> Indicates whether the share was deleted. </param>
/// <param name="deletedTime"> The deleted time if the share was deleted. </param>
/// <param name="remainingRetentionDays"> Remaining retention days for share that was soft deleted. </param>
/// <param name="accessTier"> Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. </param>
/// <param name="accessTierChangeTime"> Indicates the last modification time for share access tier. </param>
/// <param name="accessTierStatus"> Indicates if there is a pending transition for access tier. </param>
/// <param name="shareUsageBytes"> The approximate size of the data stored on the share. Note that this value may not include all recently created or recently resized files. </param>
internal FileShare(string id, string name, string type, string etag, DateTimeOffset? lastModifiedTime, IDictionary<string, string> metadata, int? shareQuota, EnabledProtocols? enabledProtocols, RootSquashType? rootSquash, string version, bool? deleted, DateTimeOffset? deletedTime, int? remainingRetentionDays, ShareAccessTier? accessTier, DateTimeOffset? accessTierChangeTime, string accessTierStatus, int? shareUsageBytes) : base(id, name, type, etag)
{
LastModifiedTime = lastModifiedTime;
Metadata = metadata;
ShareQuota = shareQuota;
EnabledProtocols = enabledProtocols;
RootSquash = rootSquash;
Version = version;
Deleted = deleted;
DeletedTime = deletedTime;
RemainingRetentionDays = remainingRetentionDays;
AccessTier = accessTier;
AccessTierChangeTime = accessTierChangeTime;
AccessTierStatus = accessTierStatus;
ShareUsageBytes = shareUsageBytes;
}
/// <summary> Returns the date and time the share was last modified. </summary>
@ -39,5 +59,25 @@ namespace Azure.Management.Storage.Models
public IDictionary<string, string> Metadata { get; set; }
/// <summary> The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. </summary>
public int? ShareQuota { get; set; }
/// <summary> The authentication protocol that is used for the file share. Can only be specified when creating a share. </summary>
public EnabledProtocols? EnabledProtocols { get; set; }
/// <summary> The property is for NFS share only. The default is NoRootSquash. </summary>
public RootSquashType? RootSquash { get; set; }
/// <summary> The version of the share. </summary>
public string Version { get; }
/// <summary> Indicates whether the share was deleted. </summary>
public bool? Deleted { get; }
/// <summary> The deleted time if the share was deleted. </summary>
public DateTimeOffset? DeletedTime { get; }
/// <summary> Remaining retention days for share that was soft deleted. </summary>
public int? RemainingRetentionDays { get; }
/// <summary> Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. </summary>
public ShareAccessTier? AccessTier { get; set; }
/// <summary> Indicates the last modification time for share access tier. </summary>
public DateTimeOffset? AccessTierChangeTime { get; }
/// <summary> Indicates if there is a pending transition for access tier. </summary>
public string AccessTierStatus { get; }
/// <summary> The approximate size of the data stored on the share. Note that this value may not include all recently created or recently resized files. </summary>
public int? ShareUsageBytes { get; }
}
}

Просмотреть файл

@ -60,6 +60,56 @@ namespace Azure.Management.Storage.Models
writer.WritePropertyName("shareQuota");
writer.WriteNumberValue(ShareQuota.Value);
}
if (EnabledProtocols != null)
{
writer.WritePropertyName("enabledProtocols");
writer.WriteStringValue(EnabledProtocols.Value.ToString());
}
if (RootSquash != null)
{
writer.WritePropertyName("rootSquash");
writer.WriteStringValue(RootSquash.Value.ToString());
}
if (Version != null)
{
writer.WritePropertyName("version");
writer.WriteStringValue(Version);
}
if (Deleted != null)
{
writer.WritePropertyName("deleted");
writer.WriteBooleanValue(Deleted.Value);
}
if (DeletedTime != null)
{
writer.WritePropertyName("deletedTime");
writer.WriteStringValue(DeletedTime.Value, "S");
}
if (RemainingRetentionDays != null)
{
writer.WritePropertyName("remainingRetentionDays");
writer.WriteNumberValue(RemainingRetentionDays.Value);
}
if (AccessTier != null)
{
writer.WritePropertyName("accessTier");
writer.WriteStringValue(AccessTier.Value.ToString());
}
if (AccessTierChangeTime != null)
{
writer.WritePropertyName("accessTierChangeTime");
writer.WriteStringValue(AccessTierChangeTime.Value, "S");
}
if (AccessTierStatus != null)
{
writer.WritePropertyName("accessTierStatus");
writer.WriteStringValue(AccessTierStatus);
}
if (ShareUsageBytes != null)
{
writer.WritePropertyName("shareUsageBytes");
writer.WriteNumberValue(ShareUsageBytes.Value);
}
writer.WriteEndObject();
writer.WriteEndObject();
}
@ -73,6 +123,16 @@ namespace Azure.Management.Storage.Models
DateTimeOffset? lastModifiedTime = default;
IDictionary<string, string> metadata = default;
int? shareQuota = default;
EnabledProtocols? enabledProtocols = default;
RootSquashType? rootSquash = default;
string version = default;
bool? deleted = default;
DateTimeOffset? deletedTime = default;
int? remainingRetentionDays = default;
ShareAccessTier? accessTier = default;
DateTimeOffset? accessTierChangeTime = default;
string accessTierStatus = default;
int? shareUsageBytes = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("etag"))
@ -154,11 +214,101 @@ namespace Azure.Management.Storage.Models
shareQuota = property0.Value.GetInt32();
continue;
}
if (property0.NameEquals("enabledProtocols"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
enabledProtocols = new EnabledProtocols(property0.Value.GetString());
continue;
}
if (property0.NameEquals("rootSquash"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
rootSquash = new RootSquashType(property0.Value.GetString());
continue;
}
if (property0.NameEquals("version"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
version = property0.Value.GetString();
continue;
}
if (property0.NameEquals("deleted"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
deleted = property0.Value.GetBoolean();
continue;
}
if (property0.NameEquals("deletedTime"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
deletedTime = property0.Value.GetDateTimeOffset("S");
continue;
}
if (property0.NameEquals("remainingRetentionDays"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
remainingRetentionDays = property0.Value.GetInt32();
continue;
}
if (property0.NameEquals("accessTier"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
accessTier = new ShareAccessTier(property0.Value.GetString());
continue;
}
if (property0.NameEquals("accessTierChangeTime"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
accessTierChangeTime = property0.Value.GetDateTimeOffset("S");
continue;
}
if (property0.NameEquals("accessTierStatus"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
accessTierStatus = property0.Value.GetString();
continue;
}
if (property0.NameEquals("shareUsageBytes"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
shareUsageBytes = property0.Value.GetInt32();
continue;
}
}
continue;
}
}
return new FileShareItem(id, name, type, etag, lastModifiedTime, metadata, shareQuota);
return new FileShareItem(id, name, type, etag, lastModifiedTime, metadata, shareQuota, enabledProtocols, rootSquash, version, deleted, deletedTime, remainingRetentionDays, accessTier, accessTierChangeTime, accessTierStatus, shareUsageBytes);
}
}
}

Просмотреть файл

@ -26,11 +26,31 @@ namespace Azure.Management.Storage.Models
/// <param name="lastModifiedTime"> Returns the date and time the share was last modified. </param>
/// <param name="metadata"> A name-value pair to associate with the share as metadata. </param>
/// <param name="shareQuota"> The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. </param>
internal FileShareItem(string id, string name, string type, string etag, DateTimeOffset? lastModifiedTime, IDictionary<string, string> metadata, int? shareQuota) : base(id, name, type, etag)
/// <param name="enabledProtocols"> The authentication protocol that is used for the file share. Can only be specified when creating a share. </param>
/// <param name="rootSquash"> The property is for NFS share only. The default is NoRootSquash. </param>
/// <param name="version"> The version of the share. </param>
/// <param name="deleted"> Indicates whether the share was deleted. </param>
/// <param name="deletedTime"> The deleted time if the share was deleted. </param>
/// <param name="remainingRetentionDays"> Remaining retention days for share that was soft deleted. </param>
/// <param name="accessTier"> Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. </param>
/// <param name="accessTierChangeTime"> Indicates the last modification time for share access tier. </param>
/// <param name="accessTierStatus"> Indicates if there is a pending transition for access tier. </param>
/// <param name="shareUsageBytes"> The approximate size of the data stored on the share. Note that this value may not include all recently created or recently resized files. </param>
internal FileShareItem(string id, string name, string type, string etag, DateTimeOffset? lastModifiedTime, IDictionary<string, string> metadata, int? shareQuota, EnabledProtocols? enabledProtocols, RootSquashType? rootSquash, string version, bool? deleted, DateTimeOffset? deletedTime, int? remainingRetentionDays, ShareAccessTier? accessTier, DateTimeOffset? accessTierChangeTime, string accessTierStatus, int? shareUsageBytes) : base(id, name, type, etag)
{
LastModifiedTime = lastModifiedTime;
Metadata = metadata;
ShareQuota = shareQuota;
EnabledProtocols = enabledProtocols;
RootSquash = rootSquash;
Version = version;
Deleted = deleted;
DeletedTime = deletedTime;
RemainingRetentionDays = remainingRetentionDays;
AccessTier = accessTier;
AccessTierChangeTime = accessTierChangeTime;
AccessTierStatus = accessTierStatus;
ShareUsageBytes = shareUsageBytes;
}
/// <summary> Returns the date and time the share was last modified. </summary>
@ -39,5 +59,25 @@ namespace Azure.Management.Storage.Models
public IDictionary<string, string> Metadata { get; set; }
/// <summary> The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. </summary>
public int? ShareQuota { get; set; }
/// <summary> The authentication protocol that is used for the file share. Can only be specified when creating a share. </summary>
public EnabledProtocols? EnabledProtocols { get; set; }
/// <summary> The property is for NFS share only. The default is NoRootSquash. </summary>
public RootSquashType? RootSquash { get; set; }
/// <summary> The version of the share. </summary>
public string Version { get; }
/// <summary> Indicates whether the share was deleted. </summary>
public bool? Deleted { get; }
/// <summary> The deleted time if the share was deleted. </summary>
public DateTimeOffset? DeletedTime { get; }
/// <summary> Remaining retention days for share that was soft deleted. </summary>
public int? RemainingRetentionDays { get; }
/// <summary> Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. </summary>
public ShareAccessTier? AccessTier { get; set; }
/// <summary> Indicates the last modification time for share access tier. </summary>
public DateTimeOffset? AccessTierChangeTime { get; }
/// <summary> Indicates if there is a pending transition for access tier. </summary>
public string AccessTierStatus { get; }
/// <summary> The approximate size of the data stored on the share. Note that this value may not include all recently created or recently resized files. </summary>
public int? ShareUsageBytes { get; }
}
}

Просмотреть файл

@ -33,6 +33,16 @@ namespace Azure.Management.Storage.Models
writer.WriteStringValue(item);
}
writer.WriteEndArray();
if (BlobIndexMatch != null)
{
writer.WritePropertyName("blobIndexMatch");
writer.WriteStartArray();
foreach (var item in BlobIndexMatch)
{
writer.WriteObjectValue(item);
}
writer.WriteEndArray();
}
writer.WriteEndObject();
}
@ -40,6 +50,7 @@ namespace Azure.Management.Storage.Models
{
IList<string> prefixMatch = default;
IList<string> blobTypes = default;
IList<TagFilter> blobIndexMatch = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("prefixMatch"))
@ -80,8 +91,29 @@ namespace Azure.Management.Storage.Models
blobTypes = array;
continue;
}
if (property.NameEquals("blobIndexMatch"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
List<TagFilter> array = new List<TagFilter>();
foreach (var item in property.Value.EnumerateArray())
{
if (item.ValueKind == JsonValueKind.Null)
{
array.Add(null);
}
else
{
array.Add(TagFilter.DeserializeTagFilter(item));
}
}
blobIndexMatch = array;
continue;
}
}
return new ManagementPolicyFilter(prefixMatch, blobTypes);
return new ManagementPolicyFilter(prefixMatch, blobTypes, blobIndexMatch);
}
}
}

Просмотреть файл

@ -29,15 +29,19 @@ namespace Azure.Management.Storage.Models
/// <summary> Initializes a new instance of ManagementPolicyFilter. </summary>
/// <param name="prefixMatch"> An array of strings for prefixes to be match. </param>
/// <param name="blobTypes"> An array of predefined enum values. Only blockBlob is supported. </param>
internal ManagementPolicyFilter(IList<string> prefixMatch, IList<string> blobTypes)
/// <param name="blobIndexMatch"> An array of blob index tag based filters, there can be at most 10 tag filters. </param>
internal ManagementPolicyFilter(IList<string> prefixMatch, IList<string> blobTypes, IList<TagFilter> blobIndexMatch)
{
PrefixMatch = prefixMatch;
BlobTypes = blobTypes;
BlobIndexMatch = blobIndexMatch;
}
/// <summary> An array of strings for prefixes to be match. </summary>
public IList<string> PrefixMatch { get; set; }
/// <summary> An array of predefined enum values. Only blockBlob is supported. </summary>
public IList<string> BlobTypes { get; set; }
/// <summary> An array of blob index tag based filters, there can be at most 10 tag filters. </summary>
public IList<TagFilter> BlobIndexMatch { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,46 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;
namespace Azure.Management.Storage.Models
{
public partial class ObjectReplicationPolicies
{
internal static ObjectReplicationPolicies DeserializeObjectReplicationPolicies(JsonElement element)
{
IReadOnlyList<ObjectReplicationPolicy> value = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("value"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
List<ObjectReplicationPolicy> array = new List<ObjectReplicationPolicy>();
foreach (var item in property.Value.EnumerateArray())
{
if (item.ValueKind == JsonValueKind.Null)
{
array.Add(null);
}
else
{
array.Add(ObjectReplicationPolicy.DeserializeObjectReplicationPolicy(item));
}
}
value = array;
continue;
}
}
return new ObjectReplicationPolicies(value);
}
}
}

Просмотреть файл

@ -0,0 +1,30 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Collections.Generic;
namespace Azure.Management.Storage.Models
{
/// <summary> List storage account object replication policies. </summary>
public partial class ObjectReplicationPolicies
{
/// <summary> Initializes a new instance of ObjectReplicationPolicies. </summary>
internal ObjectReplicationPolicies()
{
}
/// <summary> Initializes a new instance of ObjectReplicationPolicies. </summary>
/// <param name="value"> The replication policy between two storage accounts. </param>
internal ObjectReplicationPolicies(IReadOnlyList<ObjectReplicationPolicy> value)
{
Value = value;
}
/// <summary> The replication policy between two storage accounts. </summary>
public IReadOnlyList<ObjectReplicationPolicy> Value { get; }
}
}

Просмотреть файл

@ -0,0 +1,178 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;
namespace Azure.Management.Storage.Models
{
public partial class ObjectReplicationPolicy : IUtf8JsonSerializable
{
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
{
writer.WriteStartObject();
if (Id != null)
{
writer.WritePropertyName("id");
writer.WriteStringValue(Id);
}
if (Name != null)
{
writer.WritePropertyName("name");
writer.WriteStringValue(Name);
}
if (Type != null)
{
writer.WritePropertyName("type");
writer.WriteStringValue(Type);
}
writer.WritePropertyName("properties");
writer.WriteStartObject();
if (PolicyId != null)
{
writer.WritePropertyName("policyId");
writer.WriteStringValue(PolicyId);
}
if (EnabledTime != null)
{
writer.WritePropertyName("enabledTime");
writer.WriteStringValue(EnabledTime.Value, "S");
}
if (SourceAccount != null)
{
writer.WritePropertyName("sourceAccount");
writer.WriteStringValue(SourceAccount);
}
if (DestinationAccount != null)
{
writer.WritePropertyName("destinationAccount");
writer.WriteStringValue(DestinationAccount);
}
if (Rules != null)
{
writer.WritePropertyName("rules");
writer.WriteStartArray();
foreach (var item in Rules)
{
writer.WriteObjectValue(item);
}
writer.WriteEndArray();
}
writer.WriteEndObject();
writer.WriteEndObject();
}
internal static ObjectReplicationPolicy DeserializeObjectReplicationPolicy(JsonElement element)
{
string id = default;
string name = default;
string type = default;
string policyId = default;
DateTimeOffset? enabledTime = default;
string sourceAccount = default;
string destinationAccount = default;
IList<ObjectReplicationPolicyRule> rules = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("id"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
id = property.Value.GetString();
continue;
}
if (property.NameEquals("name"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
name = property.Value.GetString();
continue;
}
if (property.NameEquals("type"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
type = property.Value.GetString();
continue;
}
if (property.NameEquals("properties"))
{
foreach (var property0 in property.Value.EnumerateObject())
{
if (property0.NameEquals("policyId"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
policyId = property0.Value.GetString();
continue;
}
if (property0.NameEquals("enabledTime"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
enabledTime = property0.Value.GetDateTimeOffset("S");
continue;
}
if (property0.NameEquals("sourceAccount"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
sourceAccount = property0.Value.GetString();
continue;
}
if (property0.NameEquals("destinationAccount"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
destinationAccount = property0.Value.GetString();
continue;
}
if (property0.NameEquals("rules"))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
List<ObjectReplicationPolicyRule> array = new List<ObjectReplicationPolicyRule>();
foreach (var item in property0.Value.EnumerateArray())
{
if (item.ValueKind == JsonValueKind.Null)
{
array.Add(null);
}
else
{
array.Add(ObjectReplicationPolicyRule.DeserializeObjectReplicationPolicyRule(item));
}
}
rules = array;
continue;
}
}
continue;
}
}
return new ObjectReplicationPolicy(id, name, type, policyId, enabledTime, sourceAccount, destinationAccount, rules);
}
}
}

Просмотреть файл

@ -0,0 +1,50 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
namespace Azure.Management.Storage.Models
{
/// <summary> The replication policy between two storage accounts. Multiple rules can be defined in one policy. </summary>
public partial class ObjectReplicationPolicy : Resource
{
/// <summary> Initializes a new instance of ObjectReplicationPolicy. </summary>
public ObjectReplicationPolicy()
{
}
/// <summary> Initializes a new instance of ObjectReplicationPolicy. </summary>
/// <param name="id"> Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. </param>
/// <param name="name"> The name of the resource. </param>
/// <param name="type"> The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. </param>
/// <param name="policyId"> A unique id for object replication policy. </param>
/// <param name="enabledTime"> Indicates when the policy is enabled on the source account. </param>
/// <param name="sourceAccount"> Required. Source account name. </param>
/// <param name="destinationAccount"> Required. Destination account name. </param>
/// <param name="rules"> The storage account object replication rules. </param>
internal ObjectReplicationPolicy(string id, string name, string type, string policyId, DateTimeOffset? enabledTime, string sourceAccount, string destinationAccount, IList<ObjectReplicationPolicyRule> rules) : base(id, name, type)
{
PolicyId = policyId;
EnabledTime = enabledTime;
SourceAccount = sourceAccount;
DestinationAccount = destinationAccount;
Rules = rules;
}
/// <summary> A unique id for object replication policy. </summary>
public string PolicyId { get; }
/// <summary> Indicates when the policy is enabled on the source account. </summary>
public DateTimeOffset? EnabledTime { get; }
/// <summary> Required. Source account name. </summary>
public string SourceAccount { get; set; }
/// <summary> Required. Destination account name. </summary>
public string DestinationAccount { get; set; }
/// <summary> The storage account object replication rules. </summary>
public IList<ObjectReplicationPolicyRule> Rules { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,77 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;
namespace Azure.Management.Storage.Models
{
public partial class ObjectReplicationPolicyFilter : IUtf8JsonSerializable
{
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
{
writer.WriteStartObject();
if (PrefixMatch != null)
{
writer.WritePropertyName("prefixMatch");
writer.WriteStartArray();
foreach (var item in PrefixMatch)
{
writer.WriteStringValue(item);
}
writer.WriteEndArray();
}
if (MinCreationTime != null)
{
writer.WritePropertyName("minCreationTime");
writer.WriteStringValue(MinCreationTime);
}
writer.WriteEndObject();
}
internal static ObjectReplicationPolicyFilter DeserializeObjectReplicationPolicyFilter(JsonElement element)
{
IList<string> prefixMatch = default;
string minCreationTime = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("prefixMatch"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
List<string> array = new List<string>();
foreach (var item in property.Value.EnumerateArray())
{
if (item.ValueKind == JsonValueKind.Null)
{
array.Add(null);
}
else
{
array.Add(item.GetString());
}
}
prefixMatch = array;
continue;
}
if (property.NameEquals("minCreationTime"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
minCreationTime = property.Value.GetString();
continue;
}
}
return new ObjectReplicationPolicyFilter(prefixMatch, minCreationTime);
}
}
}

Просмотреть файл

@ -0,0 +1,34 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Collections.Generic;
namespace Azure.Management.Storage.Models
{
/// <summary> Filters limit replication to a subset of blobs within the storage account. A logical OR is performed on values in the filter. If multiple filters are defined, a logical AND is performed on all filters. </summary>
public partial class ObjectReplicationPolicyFilter
{
/// <summary> Initializes a new instance of ObjectReplicationPolicyFilter. </summary>
public ObjectReplicationPolicyFilter()
{
}
/// <summary> Initializes a new instance of ObjectReplicationPolicyFilter. </summary>
/// <param name="prefixMatch"> Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. </param>
/// <param name="minCreationTime"> Blobs created after the time will be replicated to the destination. It must be in datetime format &apos;yyyy-MM-ddTHH:mm:ssZ&apos;. Example: 2020-02-19T16:05:00Z. </param>
internal ObjectReplicationPolicyFilter(IList<string> prefixMatch, string minCreationTime)
{
PrefixMatch = prefixMatch;
MinCreationTime = minCreationTime;
}
/// <summary> Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. </summary>
public IList<string> PrefixMatch { get; set; }
/// <summary> Blobs created after the time will be replicated to the destination. It must be in datetime format &apos;yyyy-MM-ddTHH:mm:ssZ&apos;. Example: 2020-02-19T16:05:00Z. </summary>
public string MinCreationTime { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,75 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Text.Json;
using Azure.Core;
namespace Azure.Management.Storage.Models
{
public partial class ObjectReplicationPolicyRule : IUtf8JsonSerializable
{
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
{
writer.WriteStartObject();
if (RuleId != null)
{
writer.WritePropertyName("ruleId");
writer.WriteStringValue(RuleId);
}
writer.WritePropertyName("sourceContainer");
writer.WriteStringValue(SourceContainer);
writer.WritePropertyName("destinationContainer");
writer.WriteStringValue(DestinationContainer);
if (Filters != null)
{
writer.WritePropertyName("filters");
writer.WriteObjectValue(Filters);
}
writer.WriteEndObject();
}
internal static ObjectReplicationPolicyRule DeserializeObjectReplicationPolicyRule(JsonElement element)
{
string ruleId = default;
string sourceContainer = default;
string destinationContainer = default;
ObjectReplicationPolicyFilter filters = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("ruleId"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
ruleId = property.Value.GetString();
continue;
}
if (property.NameEquals("sourceContainer"))
{
sourceContainer = property.Value.GetString();
continue;
}
if (property.NameEquals("destinationContainer"))
{
destinationContainer = property.Value.GetString();
continue;
}
if (property.NameEquals("filters"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
filters = ObjectReplicationPolicyFilter.DeserializeObjectReplicationPolicyFilter(property.Value);
continue;
}
}
return new ObjectReplicationPolicyRule(ruleId, sourceContainer, destinationContainer, filters);
}
}
}

Просмотреть файл

@ -0,0 +1,55 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
namespace Azure.Management.Storage.Models
{
/// <summary> The replication policy rule between two containers. </summary>
public partial class ObjectReplicationPolicyRule
{
/// <summary> Initializes a new instance of ObjectReplicationPolicyRule. </summary>
/// <param name="sourceContainer"> Required. Source container name. </param>
/// <param name="destinationContainer"> Required. Destination container name. </param>
public ObjectReplicationPolicyRule(string sourceContainer, string destinationContainer)
{
if (sourceContainer == null)
{
throw new ArgumentNullException(nameof(sourceContainer));
}
if (destinationContainer == null)
{
throw new ArgumentNullException(nameof(destinationContainer));
}
SourceContainer = sourceContainer;
DestinationContainer = destinationContainer;
}
/// <summary> Initializes a new instance of ObjectReplicationPolicyRule. </summary>
/// <param name="ruleId"> Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source account. </param>
/// <param name="sourceContainer"> Required. Source container name. </param>
/// <param name="destinationContainer"> Required. Destination container name. </param>
/// <param name="filters"> Optional. An object that defines the filter set. </param>
internal ObjectReplicationPolicyRule(string ruleId, string sourceContainer, string destinationContainer, ObjectReplicationPolicyFilter filters)
{
RuleId = ruleId;
SourceContainer = sourceContainer;
DestinationContainer = destinationContainer;
Filters = filters;
}
/// <summary> Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source account. </summary>
public string RuleId { get; set; }
/// <summary> Required. Source container name. </summary>
public string SourceContainer { get; set; }
/// <summary> Required. Destination container name. </summary>
public string DestinationContainer { get; set; }
/// <summary> Optional. An object that defines the filter set. </summary>
public ObjectReplicationPolicyFilter Filters { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,53 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.ComponentModel;
namespace Azure.Management.Storage.Models
{
/// <summary> The property is for NFS share only. The default is NoRootSquash. </summary>
public readonly partial struct RootSquashType : IEquatable<RootSquashType>
{
private readonly string _value;
/// <summary> Determines if two <see cref="RootSquashType"/> values are the same. </summary>
public RootSquashType(string value)
{
_value = value ?? throw new ArgumentNullException(nameof(value));
}
private const string NoRootSquashValue = "NoRootSquash";
private const string RootSquashValue = "RootSquash";
private const string AllSquashValue = "AllSquash";
/// <summary> NoRootSquash. </summary>
public static RootSquashType NoRootSquash { get; } = new RootSquashType(NoRootSquashValue);
/// <summary> RootSquash. </summary>
public static RootSquashType RootSquash { get; } = new RootSquashType(RootSquashValue);
/// <summary> AllSquash. </summary>
public static RootSquashType AllSquash { get; } = new RootSquashType(AllSquashValue);
/// <summary> Determines if two <see cref="RootSquashType"/> values are the same. </summary>
public static bool operator ==(RootSquashType left, RootSquashType right) => left.Equals(right);
/// <summary> Determines if two <see cref="RootSquashType"/> values are not the same. </summary>
public static bool operator !=(RootSquashType left, RootSquashType right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="RootSquashType"/>. </summary>
public static implicit operator RootSquashType(string value) => new RootSquashType(value);
/// <inheritdoc />
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj) => obj is RootSquashType other && Equals(other);
/// <inheritdoc />
public bool Equals(RootSquashType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
/// <inheritdoc />
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => _value?.GetHashCode() ?? 0;
/// <inheritdoc />
public override string ToString() => _value;
}
}

Просмотреть файл

@ -0,0 +1,56 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.ComponentModel;
namespace Azure.Management.Storage.Models
{
/// <summary> Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. </summary>
public readonly partial struct ShareAccessTier : IEquatable<ShareAccessTier>
{
private readonly string _value;
/// <summary> Determines if two <see cref="ShareAccessTier"/> values are the same. </summary>
public ShareAccessTier(string value)
{
_value = value ?? throw new ArgumentNullException(nameof(value));
}
private const string TransactionOptimizedValue = "TransactionOptimized";
private const string HotValue = "Hot";
private const string CoolValue = "Cool";
private const string PremiumValue = "Premium";
/// <summary> TransactionOptimized. </summary>
public static ShareAccessTier TransactionOptimized { get; } = new ShareAccessTier(TransactionOptimizedValue);
/// <summary> Hot. </summary>
public static ShareAccessTier Hot { get; } = new ShareAccessTier(HotValue);
/// <summary> Cool. </summary>
public static ShareAccessTier Cool { get; } = new ShareAccessTier(CoolValue);
/// <summary> Premium. </summary>
public static ShareAccessTier Premium { get; } = new ShareAccessTier(PremiumValue);
/// <summary> Determines if two <see cref="ShareAccessTier"/> values are the same. </summary>
public static bool operator ==(ShareAccessTier left, ShareAccessTier right) => left.Equals(right);
/// <summary> Determines if two <see cref="ShareAccessTier"/> values are not the same. </summary>
public static bool operator !=(ShareAccessTier left, ShareAccessTier right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="ShareAccessTier"/>. </summary>
public static implicit operator ShareAccessTier(string value) => new ShareAccessTier(value);
/// <inheritdoc />
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj) => obj is ShareAccessTier other && Equals(other);
/// <inheritdoc />
public bool Equals(ShareAccessTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
/// <inheritdoc />
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => _value?.GetHashCode() ?? 0;
/// <inheritdoc />
public override string ToString() => _value;
}
}

Просмотреть файл

@ -0,0 +1,53 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Text.Json;
using Azure.Core;
namespace Azure.Management.Storage.Models
{
public partial class TagFilter : IUtf8JsonSerializable
{
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
{
writer.WriteStartObject();
writer.WritePropertyName("name");
writer.WriteStringValue(Name);
writer.WritePropertyName("op");
writer.WriteStringValue(Op);
writer.WritePropertyName("value");
writer.WriteStringValue(Value);
writer.WriteEndObject();
}
internal static TagFilter DeserializeTagFilter(JsonElement element)
{
string name = default;
string op = default;
string value = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("name"))
{
name = property.Value.GetString();
continue;
}
if (property.NameEquals("op"))
{
op = property.Value.GetString();
continue;
}
if (property.NameEquals("value"))
{
value = property.Value.GetString();
continue;
}
}
return new TagFilter(name, op, value);
}
}
}

Просмотреть файл

@ -0,0 +1,46 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
namespace Azure.Management.Storage.Models
{
/// <summary> Blob index tag based filtering for blob objects. </summary>
public partial class TagFilter
{
/// <summary> Initializes a new instance of TagFilter. </summary>
/// <param name="name"> This is the filter tag name, it can have 1 - 128 characters. </param>
/// <param name="op"> This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is currently supported. </param>
/// <param name="value"> This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters. </param>
public TagFilter(string name, string op, string value)
{
if (name == null)
{
throw new ArgumentNullException(nameof(name));
}
if (op == null)
{
throw new ArgumentNullException(nameof(op));
}
if (value == null)
{
throw new ArgumentNullException(nameof(value));
}
Name = name;
Op = op;
Value = value;
}
/// <summary> This is the filter tag name, it can have 1 - 128 characters. </summary>
public string Name { get; set; }
/// <summary> This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is currently supported. </summary>
public string Op { get; set; }
/// <summary> This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters. </summary>
public string Value { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,146 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.Management.Storage.Models;
namespace Azure.Management.Storage
{
/// <summary> The ObjectReplicationPolicies service client. </summary>
public partial class ObjectReplicationPoliciesClient
{
private readonly ClientDiagnostics _clientDiagnostics;
private readonly HttpPipeline _pipeline;
internal ObjectReplicationPoliciesRestClient RestClient { get; }
/// <summary> Initializes a new instance of ObjectReplicationPoliciesClient for mocking. </summary>
protected ObjectReplicationPoliciesClient()
{
}
/// <summary> Initializes a new instance of ObjectReplicationPoliciesClient. </summary>
public ObjectReplicationPoliciesClient(string subscriptionId, TokenCredential tokenCredential, StorageManagementClientOptions options = null)
{
options ??= new StorageManagementClientOptions();
_clientDiagnostics = new ClientDiagnostics(options);
_pipeline = ManagementPipelineBuilder.Build(tokenCredential, options);
RestClient = new ObjectReplicationPoliciesRestClient(_clientDiagnostics, _pipeline, subscriptionId: subscriptionId);
}
/// <summary> Get the object replication policy of the storage account by policy ID. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="objectReplicationPolicyId"> The ID of object replication policy or &apos;default&apos; if the policy ID is unknown. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response<ObjectReplicationPolicy>> GetAsync(string resourceGroupName, string accountName, string objectReplicationPolicyId, CancellationToken cancellationToken = default)
{
return await RestClient.GetAsync(resourceGroupName, accountName, objectReplicationPolicyId, cancellationToken).ConfigureAwait(false);
}
/// <summary> Get the object replication policy of the storage account by policy ID. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="objectReplicationPolicyId"> The ID of object replication policy or &apos;default&apos; if the policy ID is unknown. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response<ObjectReplicationPolicy> Get(string resourceGroupName, string accountName, string objectReplicationPolicyId, CancellationToken cancellationToken = default)
{
return RestClient.Get(resourceGroupName, accountName, objectReplicationPolicyId, cancellationToken);
}
/// <summary> Create or update the object replication policy of the storage account. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="objectReplicationPolicyId"> The ID of object replication policy or &apos;default&apos; if the policy ID is unknown. </param>
/// <param name="properties"> The object replication policy set to a storage account. A unique policy ID will be created if absent. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response<ObjectReplicationPolicy>> CreateOrUpdateAsync(string resourceGroupName, string accountName, string objectReplicationPolicyId, ObjectReplicationPolicy properties, CancellationToken cancellationToken = default)
{
return await RestClient.CreateOrUpdateAsync(resourceGroupName, accountName, objectReplicationPolicyId, properties, cancellationToken).ConfigureAwait(false);
}
/// <summary> Create or update the object replication policy of the storage account. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="objectReplicationPolicyId"> The ID of object replication policy or &apos;default&apos; if the policy ID is unknown. </param>
/// <param name="properties"> The object replication policy set to a storage account. A unique policy ID will be created if absent. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response<ObjectReplicationPolicy> CreateOrUpdate(string resourceGroupName, string accountName, string objectReplicationPolicyId, ObjectReplicationPolicy properties, CancellationToken cancellationToken = default)
{
return RestClient.CreateOrUpdate(resourceGroupName, accountName, objectReplicationPolicyId, properties, cancellationToken);
}
/// <summary> Deletes the object replication policy associated with the specified storage account. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="objectReplicationPolicyId"> The ID of object replication policy or &apos;default&apos; if the policy ID is unknown. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> DeleteAsync(string resourceGroupName, string accountName, string objectReplicationPolicyId, CancellationToken cancellationToken = default)
{
return await RestClient.DeleteAsync(resourceGroupName, accountName, objectReplicationPolicyId, cancellationToken).ConfigureAwait(false);
}
/// <summary> Deletes the object replication policy associated with the specified storage account. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="objectReplicationPolicyId"> The ID of object replication policy or &apos;default&apos; if the policy ID is unknown. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response Delete(string resourceGroupName, string accountName, string objectReplicationPolicyId, CancellationToken cancellationToken = default)
{
return RestClient.Delete(resourceGroupName, accountName, objectReplicationPolicyId, cancellationToken);
}
/// <summary> List the object replication policies associated with the storage account. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual AsyncPageable<ObjectReplicationPolicy> ListAsync(string resourceGroupName, string accountName, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
throw new ArgumentNullException(nameof(resourceGroupName));
}
if (accountName == null)
{
throw new ArgumentNullException(nameof(accountName));
}
async Task<Page<ObjectReplicationPolicy>> FirstPageFunc(int? pageSizeHint)
{
var response = await RestClient.ListAsync(resourceGroupName, accountName, cancellationToken).ConfigureAwait(false);
return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
}
return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
}
/// <summary> List the object replication policies associated with the storage account. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Pageable<ObjectReplicationPolicy> List(string resourceGroupName, string accountName, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
throw new ArgumentNullException(nameof(resourceGroupName));
}
if (accountName == null)
{
throw new ArgumentNullException(nameof(accountName));
}
Page<ObjectReplicationPolicy> FirstPageFunc(int? pageSizeHint)
{
var response = RestClient.List(resourceGroupName, accountName, cancellationToken);
return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
}
return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
}
}
}

Просмотреть файл

@ -0,0 +1,535 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.Management.Storage.Models;
namespace Azure.Management.Storage
{
internal partial class ObjectReplicationPoliciesRestClient
{
private string subscriptionId;
private string host;
private string apiVersion;
private ClientDiagnostics _clientDiagnostics;
private HttpPipeline _pipeline;
/// <summary> Initializes a new instance of ObjectReplicationPoliciesRestClient. </summary>
public ObjectReplicationPoliciesRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, string host = "https://management.azure.com", string apiVersion = "2019-06-01")
{
if (subscriptionId == null)
{
throw new ArgumentNullException(nameof(subscriptionId));
}
if (host == null)
{
throw new ArgumentNullException(nameof(host));
}
if (apiVersion == null)
{
throw new ArgumentNullException(nameof(apiVersion));
}
this.subscriptionId = subscriptionId;
this.host = host;
this.apiVersion = apiVersion;
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
internal HttpMessage CreateListRequest(string resourceGroupName, string accountName)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendPath("/subscriptions/", false);
uri.AppendPath(subscriptionId, true);
uri.AppendPath("/resourceGroups/", false);
uri.AppendPath(resourceGroupName, true);
uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/objectReplicationPolicies", false);
uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
return message;
}
/// <summary> List the object replication policies associated with the storage account. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async ValueTask<Response<ObjectReplicationPolicies>> ListAsync(string resourceGroupName, string accountName, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
throw new ArgumentNullException(nameof(resourceGroupName));
}
if (accountName == null)
{
throw new ArgumentNullException(nameof(accountName));
}
using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPoliciesClient.List");
scope.Start();
try
{
using var message = CreateListRequest(resourceGroupName, accountName);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
case 200:
{
ObjectReplicationPolicies value = default;
using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
if (document.RootElement.ValueKind == JsonValueKind.Null)
{
value = null;
}
else
{
value = ObjectReplicationPolicies.DeserializeObjectReplicationPolicies(document.RootElement);
}
return Response.FromValue(value, message.Response);
}
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> List the object replication policies associated with the storage account. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response<ObjectReplicationPolicies> List(string resourceGroupName, string accountName, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
throw new ArgumentNullException(nameof(resourceGroupName));
}
if (accountName == null)
{
throw new ArgumentNullException(nameof(accountName));
}
using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPoliciesClient.List");
scope.Start();
try
{
using var message = CreateListRequest(resourceGroupName, accountName);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
case 200:
{
ObjectReplicationPolicies value = default;
using var document = JsonDocument.Parse(message.Response.ContentStream);
if (document.RootElement.ValueKind == JsonValueKind.Null)
{
value = null;
}
else
{
value = ObjectReplicationPolicies.DeserializeObjectReplicationPolicies(document.RootElement);
}
return Response.FromValue(value, message.Response);
}
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
internal HttpMessage CreateGetRequest(string resourceGroupName, string accountName, string objectReplicationPolicyId)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Get;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendPath("/subscriptions/", false);
uri.AppendPath(subscriptionId, true);
uri.AppendPath("/resourceGroups/", false);
uri.AppendPath(resourceGroupName, true);
uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/objectReplicationPolicies/", false);
uri.AppendPath(objectReplicationPolicyId, true);
uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
return message;
}
/// <summary> Get the object replication policy of the storage account by policy ID. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="objectReplicationPolicyId"> The ID of object replication policy or &apos;default&apos; if the policy ID is unknown. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async ValueTask<Response<ObjectReplicationPolicy>> GetAsync(string resourceGroupName, string accountName, string objectReplicationPolicyId, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
throw new ArgumentNullException(nameof(resourceGroupName));
}
if (accountName == null)
{
throw new ArgumentNullException(nameof(accountName));
}
if (objectReplicationPolicyId == null)
{
throw new ArgumentNullException(nameof(objectReplicationPolicyId));
}
using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPoliciesClient.Get");
scope.Start();
try
{
using var message = CreateGetRequest(resourceGroupName, accountName, objectReplicationPolicyId);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
case 200:
{
ObjectReplicationPolicy value = default;
using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
if (document.RootElement.ValueKind == JsonValueKind.Null)
{
value = null;
}
else
{
value = ObjectReplicationPolicy.DeserializeObjectReplicationPolicy(document.RootElement);
}
return Response.FromValue(value, message.Response);
}
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Get the object replication policy of the storage account by policy ID. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="objectReplicationPolicyId"> The ID of object replication policy or &apos;default&apos; if the policy ID is unknown. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response<ObjectReplicationPolicy> Get(string resourceGroupName, string accountName, string objectReplicationPolicyId, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
throw new ArgumentNullException(nameof(resourceGroupName));
}
if (accountName == null)
{
throw new ArgumentNullException(nameof(accountName));
}
if (objectReplicationPolicyId == null)
{
throw new ArgumentNullException(nameof(objectReplicationPolicyId));
}
using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPoliciesClient.Get");
scope.Start();
try
{
using var message = CreateGetRequest(resourceGroupName, accountName, objectReplicationPolicyId);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
case 200:
{
ObjectReplicationPolicy value = default;
using var document = JsonDocument.Parse(message.Response.ContentStream);
if (document.RootElement.ValueKind == JsonValueKind.Null)
{
value = null;
}
else
{
value = ObjectReplicationPolicy.DeserializeObjectReplicationPolicy(document.RootElement);
}
return Response.FromValue(value, message.Response);
}
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string accountName, string objectReplicationPolicyId, ObjectReplicationPolicy properties)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Put;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendPath("/subscriptions/", false);
uri.AppendPath(subscriptionId, true);
uri.AppendPath("/resourceGroups/", false);
uri.AppendPath(resourceGroupName, true);
uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/objectReplicationPolicies/", false);
uri.AppendPath(objectReplicationPolicyId, true);
uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Content-Type", "application/json");
using var content = new Utf8JsonRequestContent();
content.JsonWriter.WriteObjectValue(properties);
request.Content = content;
return message;
}
/// <summary> Create or update the object replication policy of the storage account. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="objectReplicationPolicyId"> The ID of object replication policy or &apos;default&apos; if the policy ID is unknown. </param>
/// <param name="properties"> The object replication policy set to a storage account. A unique policy ID will be created if absent. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async ValueTask<Response<ObjectReplicationPolicy>> CreateOrUpdateAsync(string resourceGroupName, string accountName, string objectReplicationPolicyId, ObjectReplicationPolicy properties, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
throw new ArgumentNullException(nameof(resourceGroupName));
}
if (accountName == null)
{
throw new ArgumentNullException(nameof(accountName));
}
if (objectReplicationPolicyId == null)
{
throw new ArgumentNullException(nameof(objectReplicationPolicyId));
}
if (properties == null)
{
throw new ArgumentNullException(nameof(properties));
}
using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPoliciesClient.CreateOrUpdate");
scope.Start();
try
{
using var message = CreateCreateOrUpdateRequest(resourceGroupName, accountName, objectReplicationPolicyId, properties);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
case 200:
{
ObjectReplicationPolicy value = default;
using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
if (document.RootElement.ValueKind == JsonValueKind.Null)
{
value = null;
}
else
{
value = ObjectReplicationPolicy.DeserializeObjectReplicationPolicy(document.RootElement);
}
return Response.FromValue(value, message.Response);
}
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Create or update the object replication policy of the storage account. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="objectReplicationPolicyId"> The ID of object replication policy or &apos;default&apos; if the policy ID is unknown. </param>
/// <param name="properties"> The object replication policy set to a storage account. A unique policy ID will be created if absent. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response<ObjectReplicationPolicy> CreateOrUpdate(string resourceGroupName, string accountName, string objectReplicationPolicyId, ObjectReplicationPolicy properties, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
throw new ArgumentNullException(nameof(resourceGroupName));
}
if (accountName == null)
{
throw new ArgumentNullException(nameof(accountName));
}
if (objectReplicationPolicyId == null)
{
throw new ArgumentNullException(nameof(objectReplicationPolicyId));
}
if (properties == null)
{
throw new ArgumentNullException(nameof(properties));
}
using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPoliciesClient.CreateOrUpdate");
scope.Start();
try
{
using var message = CreateCreateOrUpdateRequest(resourceGroupName, accountName, objectReplicationPolicyId, properties);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
case 200:
{
ObjectReplicationPolicy value = default;
using var document = JsonDocument.Parse(message.Response.ContentStream);
if (document.RootElement.ValueKind == JsonValueKind.Null)
{
value = null;
}
else
{
value = ObjectReplicationPolicy.DeserializeObjectReplicationPolicy(document.RootElement);
}
return Response.FromValue(value, message.Response);
}
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
internal HttpMessage CreateDeleteRequest(string resourceGroupName, string accountName, string objectReplicationPolicyId)
{
var message = _pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Delete;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendPath("/subscriptions/", false);
uri.AppendPath(subscriptionId, true);
uri.AppendPath("/resourceGroups/", false);
uri.AppendPath(resourceGroupName, true);
uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/objectReplicationPolicies/", false);
uri.AppendPath(objectReplicationPolicyId, true);
uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
return message;
}
/// <summary> Deletes the object replication policy associated with the specified storage account. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="objectReplicationPolicyId"> The ID of object replication policy or &apos;default&apos; if the policy ID is unknown. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async ValueTask<Response> DeleteAsync(string resourceGroupName, string accountName, string objectReplicationPolicyId, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
throw new ArgumentNullException(nameof(resourceGroupName));
}
if (accountName == null)
{
throw new ArgumentNullException(nameof(accountName));
}
if (objectReplicationPolicyId == null)
{
throw new ArgumentNullException(nameof(objectReplicationPolicyId));
}
using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPoliciesClient.Delete");
scope.Start();
try
{
using var message = CreateDeleteRequest(resourceGroupName, accountName, objectReplicationPolicyId);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
case 200:
case 204:
return message.Response;
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Deletes the object replication policy associated with the specified storage account. </summary>
/// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The name is case insensitive. </param>
/// <param name="accountName"> The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. </param>
/// <param name="objectReplicationPolicyId"> The ID of object replication policy or &apos;default&apos; if the policy ID is unknown. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response Delete(string resourceGroupName, string accountName, string objectReplicationPolicyId, CancellationToken cancellationToken = default)
{
if (resourceGroupName == null)
{
throw new ArgumentNullException(nameof(resourceGroupName));
}
if (accountName == null)
{
throw new ArgumentNullException(nameof(accountName));
}
if (objectReplicationPolicyId == null)
{
throw new ArgumentNullException(nameof(objectReplicationPolicyId));
}
using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPoliciesClient.Delete");
scope.Start();
try
{
using var message = CreateDeleteRequest(resourceGroupName, accountName, objectReplicationPolicyId);
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
case 200:
case 204:
return message.Response;
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
}
}

Просмотреть файл

@ -96,6 +96,12 @@ namespace Azure.Management.Storage
return new PrivateLinkResourcesClient(_subscriptionId, _tokenCredential, _options);
}
/// <summary> Creates a new instance of ObjectReplicationPoliciesClient. </summary>
public ObjectReplicationPoliciesClient GetObjectReplicationPoliciesClient()
{
return new ObjectReplicationPoliciesClient(_subscriptionId, _tokenCredential, _options);
}
/// <summary> Creates a new instance of EncryptionScopesClient. </summary>
public EncryptionScopesClient GetEncryptionScopesClient()
{

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -18,6 +18,7 @@ namespace Azure.Storage.Tables
_response = response;
}
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
public string XMsContinuationNextTableName => _response.Headers.TryGetValue("x-ms-continuation-NextTableName", out string value) ? value : null;
public string XMsContinuationNextPartitionKey => _response.Headers.TryGetValue("x-ms-continuation-NextPartitionKey", out string value) ? value : null;
public string XMsContinuationNextRowKey => _response.Headers.TryGetValue("x-ms-continuation-NextRowKey", out string value) ? value : null;
}
}

Просмотреть файл

@ -18,6 +18,7 @@ namespace Azure.Storage.Tables
_response = response;
}
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
public string XMsContinuationNextTableName => _response.Headers.TryGetValue("x-ms-continuation-NextTableName", out string value) ? value : null;
public string XMsContinuationNextPartitionKey => _response.Headers.TryGetValue("x-ms-continuation-NextPartitionKey", out string value) ? value : null;
public string XMsContinuationNextRowKey => _response.Headers.TryGetValue("x-ms-continuation-NextRowKey", out string value) ? value : null;
}
}

Просмотреть файл

@ -175,7 +175,7 @@ namespace Azure.Storage.Tables
request.Headers.Add("x-ms-client-request-id", requestId);
}
request.Headers.Add("DataServiceVersion", "3.0");
request.Headers.Add("Content-Type", "application/json;odata=fullmetadata");
request.Headers.Add("Content-Type", "application/json;odata=nometadata");
using var content = new Utf8JsonRequestContent();
content.JsonWriter.WriteObjectValue(tableProperties);
request.Content = content;
@ -680,7 +680,7 @@ namespace Azure.Storage.Tables
request.Headers.Add("x-ms-client-request-id", requestId);
}
request.Headers.Add("DataServiceVersion", "3.0");
request.Headers.Add("Content-Type", "application/json;odata=fullmetadata");
request.Headers.Add("Content-Type", "application/json;odata=nometadata");
if (tableEntityProperties != null)
{
using var content = new Utf8JsonRequestContent();
@ -729,7 +729,7 @@ namespace Azure.Storage.Tables
var headers = new TableInternalUpdateEntityHeaders(message.Response);
switch (message.Response.Status)
{
case 200:
case 204:
return ResponseWithHeaders.FromValue(headers, message.Response);
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
@ -775,7 +775,7 @@ namespace Azure.Storage.Tables
var headers = new TableInternalUpdateEntityHeaders(message.Response);
switch (message.Response.Status)
{
case 200:
case 204:
return ResponseWithHeaders.FromValue(headers, message.Response);
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
@ -934,7 +934,7 @@ namespace Azure.Storage.Tables
request.Headers.Add("x-ms-client-request-id", requestId);
}
request.Headers.Add("DataServiceVersion", "3.0");
request.Headers.Add("Content-Type", "application/json;odata=fullmetadata");
request.Headers.Add("Content-Type", "application/json;odata=nometadata");
if (tableEntityProperties != null)
{
using var content = new Utf8JsonRequestContent();

Просмотреть файл

@ -49,7 +49,7 @@ namespace Azure.Storage.Tables
var response = await _tableOperations.RestClient.QueryEntitiesAsync(_table,
queryOptions: new QueryOptions() { Format = _format, Top = limit, Filter = filter, Select = @select},
cancellationToken: cancellationToken);
return Page.FromValues(response.Value.Value, response.Headers.XMsContinuationNextTableName, response.GetRawResponse());
return Page.FromValues(response.Value.Value, response.Headers.XMsContinuationNextPartitionKey, response.GetRawResponse());
},(_, __) => throw new NotImplementedException());
}
}

Просмотреть файл

@ -1,4 +1,7 @@
using System;
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Storage;
@ -6,9 +9,9 @@ using Azure.Storage.Tables;
namespace sample
{
class Program
public class Program
{
static async Task Main(string[] args)
public static async Task Main(string[] args)
{
var serviceClient = new TableServiceClient(
new Uri("https://pakrym0test0storage.table.core.windows.net"),

Разница между файлами не показана из-за своего большого размера Загрузить разницу

1622
samples/CognitiveSearch/CognitiveSearch/CodeModel.yaml сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,67 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Text.Json;
using Azure.Core;
namespace CognitiveSearch.Models
{
public partial class BM25Similarity : IUtf8JsonSerializable
{
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
{
writer.WriteStartObject();
if (K1 != null)
{
writer.WritePropertyName("k1");
writer.WriteNumberValue(K1.Value);
}
if (B != null)
{
writer.WritePropertyName("b");
writer.WriteNumberValue(B.Value);
}
writer.WritePropertyName("@odata.type");
writer.WriteStringValue(OdataType);
writer.WriteEndObject();
}
internal static BM25Similarity DeserializeBM25Similarity(JsonElement element)
{
double? k1 = default;
double? b = default;
string odataType = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("k1"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
k1 = property.Value.GetDouble();
continue;
}
if (property.NameEquals("b"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
b = property.Value.GetDouble();
continue;
}
if (property.NameEquals("@odata.type"))
{
odataType = property.Value.GetString();
continue;
}
}
return new BM25Similarity(odataType, k1, b);
}
}
}

Просмотреть файл

@ -0,0 +1,35 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
namespace CognitiveSearch.Models
{
/// <summary> Ranking function based on the Okapi BM25 similarity algorithm. BM25 is a TF-IDF-like algorithm that includes length normalization (controlled by the &apos;b&apos; parameter) as well as term frequency saturation (controlled by the &apos;k1&apos; parameter). </summary>
public partial class BM25Similarity : Similarity
{
/// <summary> Initializes a new instance of BM25Similarity. </summary>
public BM25Similarity()
{
OdataType = "#Microsoft.Azure.Search.BM25Similarity";
}
/// <summary> Initializes a new instance of BM25Similarity. </summary>
/// <param name="odataType"> . </param>
/// <param name="k1"> This property controls the scaling function between the term frequency of each matching terms and the final relevance score of a document-query pair. By default, a value of 1.2 is used. A value of 0.0 means the score does not scale with an increase in term frequency. </param>
/// <param name="b"> This property controls how the length of a document affects the relevance score. By default, a value of 0.75 is used. A value of 0.0 means no length normalization is applied, while a value of 1.0 means the score is fully normalized by the length of the document. </param>
internal BM25Similarity(string odataType, double? k1, double? b) : base(odataType)
{
K1 = k1;
B = b;
OdataType = odataType ?? "#Microsoft.Azure.Search.BM25Similarity";
}
/// <summary> This property controls the scaling function between the term frequency of each matching terms and the final relevance score of a document-query pair. By default, a value of 1.2 is used. A value of 0.0 means the score does not scale with an increase in term frequency. </summary>
public double? K1 { get; set; }
/// <summary> This property controls how the length of a document affects the relevance score. By default, a value of 0.75 is used. A value of 0.0 means no length normalization is applied, while a value of 1.0 means the score is fully normalized by the length of the document. </summary>
public double? B { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,37 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Text.Json;
using Azure.Core;
namespace CognitiveSearch.Models
{
public partial class ClassicSimilarity : IUtf8JsonSerializable
{
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
{
writer.WriteStartObject();
writer.WritePropertyName("@odata.type");
writer.WriteStringValue(OdataType);
writer.WriteEndObject();
}
internal static ClassicSimilarity DeserializeClassicSimilarity(JsonElement element)
{
string odataType = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("@odata.type"))
{
odataType = property.Value.GetString();
continue;
}
}
return new ClassicSimilarity(odataType);
}
}
}

Просмотреть файл

@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
namespace CognitiveSearch.Models
{
/// <summary> Legacy similarity algorithm which uses the Lucene TFIDFSimilarity implementation of TF-IDF. This variation of TF-IDF introduces static document length normalization as well as coordinating factors that penalize documents that only partially match the searched queries. </summary>
public partial class ClassicSimilarity : Similarity
{
/// <summary> Initializes a new instance of ClassicSimilarity. </summary>
public ClassicSimilarity()
{
OdataType = "#Microsoft.Azure.Search.ClassicSimilarity";
}
/// <summary> Initializes a new instance of ClassicSimilarity. </summary>
/// <param name="odataType"> . </param>
internal ClassicSimilarity(string odataType) : base(odataType)
{
OdataType = odataType ?? "#Microsoft.Azure.Search.ClassicSimilarity";
}
}
}

Просмотреть файл

@ -100,6 +100,11 @@ namespace CognitiveSearch.Models
writer.WritePropertyName("encryptionKey");
writer.WriteObjectValue(EncryptionKey);
}
if (Similarity != null)
{
writer.WritePropertyName("similarity");
writer.WriteObjectValue(Similarity);
}
if (ETag != null)
{
writer.WritePropertyName("@odata.etag");
@ -121,6 +126,7 @@ namespace CognitiveSearch.Models
IList<TokenFilter> tokenFilters = default;
IList<CharFilter> charFilters = default;
EncryptionKey encryptionKey = default;
Similarity similarity = default;
string odataEtag = default;
foreach (var property in element.EnumerateObject())
{
@ -299,6 +305,15 @@ namespace CognitiveSearch.Models
encryptionKey = EncryptionKey.DeserializeEncryptionKey(property.Value);
continue;
}
if (property.NameEquals("similarity"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
similarity = Similarity.DeserializeSimilarity(property.Value);
continue;
}
if (property.NameEquals("@odata.etag"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
@ -309,7 +324,7 @@ namespace CognitiveSearch.Models
continue;
}
}
return new Index(name, fields, scoringProfiles, defaultScoringProfile, corsOptions, suggesters, analyzers, tokenizers, tokenFilters, charFilters, encryptionKey, odataEtag);
return new Index(name, fields, scoringProfiles, defaultScoringProfile, corsOptions, suggesters, analyzers, tokenizers, tokenFilters, charFilters, encryptionKey, similarity, odataEtag);
}
}
}

Просмотреть файл

@ -44,8 +44,9 @@ namespace CognitiveSearch.Models
/// <param name="tokenFilters"> The token filters for the index. </param>
/// <param name="charFilters"> The character filters for the index. </param>
/// <param name="encryptionKey"> A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive Search will ignore attempts to set this property to null. You can change this property as needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. </param>
/// <param name="similarity"> The type of similarity algorithm to be used when scoring and ranking the documents matching a search query. The similarity algorithm can only be defined at index creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used. </param>
/// <param name="eTag"> The ETag of the index. </param>
internal Index(string name, IList<Field> fields, IList<ScoringProfile> scoringProfiles, string defaultScoringProfile, CorsOptions corsOptions, IList<Suggester> suggesters, IList<Analyzer> analyzers, IList<Tokenizer> tokenizers, IList<TokenFilter> tokenFilters, IList<CharFilter> charFilters, EncryptionKey encryptionKey, string eTag)
internal Index(string name, IList<Field> fields, IList<ScoringProfile> scoringProfiles, string defaultScoringProfile, CorsOptions corsOptions, IList<Suggester> suggesters, IList<Analyzer> analyzers, IList<Tokenizer> tokenizers, IList<TokenFilter> tokenFilters, IList<CharFilter> charFilters, EncryptionKey encryptionKey, Similarity similarity, string eTag)
{
Name = name;
Fields = fields;
@ -58,6 +59,7 @@ namespace CognitiveSearch.Models
TokenFilters = tokenFilters;
CharFilters = charFilters;
EncryptionKey = encryptionKey;
Similarity = similarity;
ETag = eTag;
}
@ -83,6 +85,8 @@ namespace CognitiveSearch.Models
public IList<CharFilter> CharFilters { get; set; }
/// <summary> A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive Search will ignore attempts to set this property to null. You can change this property as needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. </summary>
public EncryptionKey EncryptionKey { get; set; }
/// <summary> The type of similarity algorithm to be used when scoring and ranking the documents matching a search query. The similarity algorithm can only be defined at index creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used. </summary>
public Similarity Similarity { get; set; }
/// <summary> The ETag of the index. </summary>
public string ETag { get; set; }
}

Просмотреть файл

@ -0,0 +1,45 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Text.Json;
using Azure.Core;
namespace CognitiveSearch.Models
{
public partial class Similarity : IUtf8JsonSerializable
{
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
{
writer.WriteStartObject();
writer.WritePropertyName("@odata.type");
writer.WriteStringValue(OdataType);
writer.WriteEndObject();
}
internal static Similarity DeserializeSimilarity(JsonElement element)
{
if (element.TryGetProperty("@odata.type", out JsonElement discriminator))
{
switch (discriminator.GetString())
{
case "#Microsoft.Azure.Search.BM25Similarity": return BM25Similarity.DeserializeBM25Similarity(element);
case "#Microsoft.Azure.Search.ClassicSimilarity": return ClassicSimilarity.DeserializeClassicSimilarity(element);
}
}
string odataType = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("@odata.type"))
{
odataType = property.Value.GetString();
continue;
}
}
return new Similarity(odataType);
}
}
}

28
samples/CognitiveSearch/CognitiveSearch/Generated/Models/Similarity.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,28 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
namespace CognitiveSearch.Models
{
/// <summary> Base type for similarity algorithms. Similarity algorithms are used to calculate scores that tie queries to documents. The higher the score, the more relevant the document is to that specific query. Those scores are used to rank the search results. </summary>
public partial class Similarity
{
/// <summary> Initializes a new instance of Similarity. </summary>
public Similarity()
{
OdataType = null;
}
/// <summary> Initializes a new instance of Similarity. </summary>
/// <param name="odataType"> . </param>
internal Similarity(string odataType)
{
OdataType = odataType;
}
internal string OdataType { get; set; }
}
}

3401
samples/SignalR/SignalR/CodeModel.yaml сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

47
samples/SignalR/SignalR/Generated/HealthApiClient.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,47 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core.Pipeline;
namespace SignalR
{
/// <summary> The HealthApi service client. </summary>
public partial class HealthApiClient
{
private readonly ClientDiagnostics _clientDiagnostics;
private readonly HttpPipeline _pipeline;
internal HealthApiRestClient RestClient { get; }
/// <summary> Initializes a new instance of HealthApiClient for mocking. </summary>
protected HealthApiClient()
{
}
/// <summary> Initializes a new instance of HealthApiClient. </summary>
internal HealthApiClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "")
{
RestClient = new HealthApiRestClient(clientDiagnostics, pipeline, host);
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
/// <summary> Get service health status. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> HeadIndexAsync(CancellationToken cancellationToken = default)
{
return await RestClient.HeadIndexAsync(cancellationToken).ConfigureAwait(false);
}
/// <summary> Get service health status. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response HeadIndex(CancellationToken cancellationToken = default)
{
return RestClient.HeadIndex(cancellationToken);
}
}
}

100
samples/SignalR/SignalR/Generated/HealthApiRestClient.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,100 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
namespace SignalR
{
internal partial class HealthApiRestClient
{
private string host;
private ClientDiagnostics _clientDiagnostics;
private HttpPipeline _pipeline;
/// <summary> Initializes a new instance of HealthApiRestClient. </summary>
public HealthApiRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "")
{
if (host == null)
{
throw new ArgumentNullException(nameof(host));
}
this.host = host;
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
internal HttpMessage CreateHeadIndexRequest()
{
var message = _pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Head;
var uri = new RawRequestUriBuilder();
uri.AppendRaw(host, false);
uri.AppendPath("/api/v1/health", false);
request.Uri = uri;
return message;
}
/// <summary> Get service health status. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public async ValueTask<Response> HeadIndexAsync(CancellationToken cancellationToken = default)
{
using var scope = _clientDiagnostics.CreateScope("HealthApiClient.HeadIndex");
scope.Start();
try
{
using var message = CreateHeadIndexRequest();
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
switch (message.Response.Status)
{
case 200:
case 503:
return message.Response;
default:
throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
/// <summary> Get service health status. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public Response HeadIndex(CancellationToken cancellationToken = default)
{
using var scope = _clientDiagnostics.CreateScope("HealthApiClient.HeadIndex");
scope.Start();
try
{
using var message = CreateHeadIndexRequest();
_pipeline.Send(message, cancellationToken);
switch (message.Response.Status)
{
case 200:
case 503:
return message.Response;
default:
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
}
}

344
samples/SignalR/SignalR/Generated/ServiceClient.cs сгенерированный
Просмотреть файл

@ -1,344 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core.Pipeline;
namespace SignalR
{
/// <summary> The Service service client. </summary>
public partial class ServiceClient
{
private readonly ClientDiagnostics _clientDiagnostics;
private readonly HttpPipeline _pipeline;
internal ServiceRestClient RestClient { get; }
/// <summary> Initializes a new instance of ServiceClient for mocking. </summary>
protected ServiceClient()
{
}
/// <summary> Initializes a new instance of ServiceClient. </summary>
internal ServiceClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion, string host = "")
{
RestClient = new ServiceRestClient(clientDiagnostics, pipeline, apiVersion, host);
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
/// <summary> Check the health of the service. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> GetServiceHealthAsync(CancellationToken cancellationToken = default)
{
return await RestClient.GetServiceHealthAsync(cancellationToken).ConfigureAwait(false);
}
/// <summary> Check the health of the service. </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response GetServiceHealth(CancellationToken cancellationToken = default)
{
return RestClient.GetServiceHealth(cancellationToken);
}
/// <summary> Broadcast content inside request body to all the connected connection in the same hub. </summary>
/// <param name="hub"> The hub is the logic isolation for connections. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> SendToHubAsync(string hub, Stream data, CancellationToken cancellationToken = default)
{
return await RestClient.SendToHubAsync(hub, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Broadcast content inside request body to all the connected connection in the same hub. </summary>
/// <param name="hub"> The hub is the logic isolation for connections. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response SendToHub(string hub, Stream data, CancellationToken cancellationToken = default)
{
return RestClient.SendToHub(hub, data, cancellationToken);
}
/// <summary> Broadcast content inside request body to all the connected connection in the same hub. </summary>
/// <param name="hub"> The hub is the logic isolation for connections. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> SendToHubAsync(string hub, string data, CancellationToken cancellationToken = default)
{
return await RestClient.SendToHubAsync(hub, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Broadcast content inside request body to all the connected connection in the same hub. </summary>
/// <param name="hub"> The hub is the logic isolation for connections. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response SendToHub(string hub, string data, CancellationToken cancellationToken = default)
{
return RestClient.SendToHub(hub, data, cancellationToken);
}
/// <summary> Send content inside request body to the specific user. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="id"> The user identity. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> SendToUserAsync(string hub, string id, Stream data, CancellationToken cancellationToken = default)
{
return await RestClient.SendToUserAsync(hub, id, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to the specific user. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="id"> The user identity. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response SendToUser(string hub, string id, Stream data, CancellationToken cancellationToken = default)
{
return RestClient.SendToUser(hub, id, data, cancellationToken);
}
/// <summary> Send content inside request body to the specific user. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="id"> The user identity. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> SendToUserAsync(string hub, string id, string data, CancellationToken cancellationToken = default)
{
return await RestClient.SendToUserAsync(hub, id, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to the specific user. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="id"> The user identity. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response SendToUser(string hub, string id, string data, CancellationToken cancellationToken = default)
{
return RestClient.SendToUser(hub, id, data, cancellationToken);
}
/// <summary> Send content inside request body to the specific connection. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> SendToConnectionAsync(string hub, string connectionId, Stream data, CancellationToken cancellationToken = default)
{
return await RestClient.SendToConnectionAsync(hub, connectionId, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to the specific connection. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response SendToConnection(string hub, string connectionId, Stream data, CancellationToken cancellationToken = default)
{
return RestClient.SendToConnection(hub, connectionId, data, cancellationToken);
}
/// <summary> Send content inside request body to the specific connection. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> SendToConnectionAsync(string hub, string connectionId, string data, CancellationToken cancellationToken = default)
{
return await RestClient.SendToConnectionAsync(hub, connectionId, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to the specific connection. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response SendToConnection(string hub, string connectionId, string data, CancellationToken cancellationToken = default)
{
return RestClient.SendToConnection(hub, connectionId, data, cancellationToken);
}
/// <summary> Close the client connection. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="reason"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> CloseConnectionAsync(string hub, string connectionId, string reason = null, CancellationToken cancellationToken = default)
{
return await RestClient.CloseConnectionAsync(hub, connectionId, reason, cancellationToken).ConfigureAwait(false);
}
/// <summary> Close the client connection. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="reason"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response CloseConnection(string hub, string connectionId, string reason = null, CancellationToken cancellationToken = default)
{
return RestClient.CloseConnection(hub, connectionId, reason, cancellationToken);
}
/// <summary> Send content inside request body to a group of connections. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> SendToGroupAsync(string hub, string group, Stream data, CancellationToken cancellationToken = default)
{
return await RestClient.SendToGroupAsync(hub, group, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to a group of connections. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response SendToGroup(string hub, string group, Stream data, CancellationToken cancellationToken = default)
{
return RestClient.SendToGroup(hub, group, data, cancellationToken);
}
/// <summary> Send content inside request body to a group of connections. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> SendToGroupAsync(string hub, string group, string data, CancellationToken cancellationToken = default)
{
return await RestClient.SendToGroupAsync(hub, group, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to a group of connections. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response SendToGroup(string hub, string group, string data, CancellationToken cancellationToken = default)
{
return RestClient.SendToGroup(hub, group, data, cancellationToken);
}
/// <summary> Check if the user is in the specified group. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="user"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> GetUserInGroupAsync(string hub, string group, string user, CancellationToken cancellationToken = default)
{
return await RestClient.GetUserInGroupAsync(hub, group, user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check if the user is in the specified group. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="user"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response GetUserInGroup(string hub, string group, string user, CancellationToken cancellationToken = default)
{
return RestClient.GetUserInGroup(hub, group, user, cancellationToken);
}
/// <summary> Add the user to the specified group. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="user"> The String to use. </param>
/// <param name="ttl"> Specifies the seconds that the user exists in the group. If not set, the user lives in the group forever. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> AddUserToGroupAsync(string hub, string group, string user, int? ttl = null, CancellationToken cancellationToken = default)
{
return await RestClient.AddUserToGroupAsync(hub, group, user, ttl, cancellationToken).ConfigureAwait(false);
}
/// <summary> Add the user to the specified group. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="user"> The String to use. </param>
/// <param name="ttl"> Specifies the seconds that the user exists in the group. If not set, the user lives in the group forever. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response AddUserToGroup(string hub, string group, string user, int? ttl = null, CancellationToken cancellationToken = default)
{
return RestClient.AddUserToGroup(hub, group, user, ttl, cancellationToken);
}
/// <summary> Remove all the connections belong to the specified user from the group. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="user"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> RemoveUserFromGroupAsync(string hub, string group, string user, CancellationToken cancellationToken = default)
{
return await RestClient.RemoveUserFromGroupAsync(hub, group, user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Remove all the connections belong to the specified user from the group. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="user"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response RemoveUserFromGroup(string hub, string group, string user, CancellationToken cancellationToken = default)
{
return RestClient.RemoveUserFromGroup(hub, group, user, cancellationToken);
}
/// <summary> Add the connection to the group. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> AddConnectionToGroupAsync(string hub, string group, string connectionId, CancellationToken cancellationToken = default)
{
return await RestClient.AddConnectionToGroupAsync(hub, group, connectionId, cancellationToken).ConfigureAwait(false);
}
/// <summary> Add the connection to the group. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response AddConnectionToGroup(string hub, string group, string connectionId, CancellationToken cancellationToken = default)
{
return RestClient.AddConnectionToGroup(hub, group, connectionId, cancellationToken);
}
/// <summary> Remove the connection from the group. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> RemoveConnectionToGroupAsync(string hub, string group, string connectionId, CancellationToken cancellationToken = default)
{
return await RestClient.RemoveConnectionToGroupAsync(hub, group, connectionId, cancellationToken).ConfigureAwait(false);
}
/// <summary> Remove the connection from the group. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response RemoveConnectionToGroup(string hub, string group, string connectionId, CancellationToken cancellationToken = default)
{
return RestClient.RemoveConnectionToGroup(hub, group, connectionId, cancellationToken);
}
/// <summary> Remove the user from all groups. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="user"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> RemoveAllUserGroupsAsync(string hub, string user, CancellationToken cancellationToken = default)
{
return await RestClient.RemoveAllUserGroupsAsync(hub, user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Remove the user from all groups. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="user"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response RemoveAllUserGroups(string hub, string user, CancellationToken cancellationToken = default)
{
return RestClient.RemoveAllUserGroups(hub, user, cancellationToken);
}
}
}

1556
samples/SignalR/SignalR/Generated/ServiceRestClient.cs сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

855
samples/SignalR/SignalR/Generated/WebSocketConnectionApiClient.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,855 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core.Pipeline;
namespace SignalR
{
/// <summary> The WebSocketConnectionApi service client. </summary>
public partial class WebSocketConnectionApiClient
{
private readonly ClientDiagnostics _clientDiagnostics;
private readonly HttpPipeline _pipeline;
internal WebSocketConnectionApiRestClient RestClient { get; }
/// <summary> Initializes a new instance of WebSocketConnectionApiClient for mocking. </summary>
protected WebSocketConnectionApiClient()
{
}
/// <summary> Initializes a new instance of WebSocketConnectionApiClient. </summary>
internal WebSocketConnectionApiClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host = "")
{
RestClient = new WebSocketConnectionApiRestClient(clientDiagnostics, pipeline, host);
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
/// <summary> Broadcast content inside request body to all the connected to endpoint &quot;/ws/client&quot;. </summary>
/// <param name="data"> The binary to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostDefaultHubBroadcastAsync(Stream data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return await RestClient.PostDefaultHubBroadcastAsync(data, excluded, cancellationToken).ConfigureAwait(false);
}
/// <summary> Broadcast content inside request body to all the connected to endpoint &quot;/ws/client&quot;. </summary>
/// <param name="data"> The binary to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostDefaultHubBroadcast(Stream data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return RestClient.PostDefaultHubBroadcast(data, excluded, cancellationToken);
}
/// <summary> Broadcast content inside request body to all the connected to endpoint &quot;/ws/client&quot;. </summary>
/// <param name="data"> The String to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostDefaultHubBroadcastAsync(string data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return await RestClient.PostDefaultHubBroadcastAsync(data, excluded, cancellationToken).ConfigureAwait(false);
}
/// <summary> Broadcast content inside request body to all the connected to endpoint &quot;/ws/client&quot;. </summary>
/// <param name="data"> The String to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostDefaultHubBroadcast(string data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return RestClient.PostDefaultHubBroadcast(data, excluded, cancellationToken);
}
/// <summary> Broadcast content inside request body to all the connected connections in the same hub. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostBroadcastAsync(string hub, Stream data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return await RestClient.PostBroadcastAsync(hub, data, excluded, cancellationToken).ConfigureAwait(false);
}
/// <summary> Broadcast content inside request body to all the connected connections in the same hub. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostBroadcast(string hub, Stream data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return RestClient.PostBroadcast(hub, data, excluded, cancellationToken);
}
/// <summary> Broadcast content inside request body to all the connected connections in the same hub. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="data"> The String to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostBroadcastAsync(string hub, string data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return await RestClient.PostBroadcastAsync(hub, data, excluded, cancellationToken).ConfigureAwait(false);
}
/// <summary> Broadcast content inside request body to all the connected connections in the same hub. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="data"> The String to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostBroadcast(string hub, string data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return RestClient.PostBroadcast(hub, data, excluded, cancellationToken);
}
/// <summary> Send content inside request body to the specific user. </summary>
/// <param name="id"> The user Id. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostSendToDefaultHubUserAsync(string id, Stream data, CancellationToken cancellationToken = default)
{
return await RestClient.PostSendToDefaultHubUserAsync(id, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to the specific user. </summary>
/// <param name="id"> The user Id. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostSendToDefaultHubUser(string id, Stream data, CancellationToken cancellationToken = default)
{
return RestClient.PostSendToDefaultHubUser(id, data, cancellationToken);
}
/// <summary> Send content inside request body to the specific user. </summary>
/// <param name="id"> The user Id. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostSendToDefaultHubUserAsync(string id, string data, CancellationToken cancellationToken = default)
{
return await RestClient.PostSendToDefaultHubUserAsync(id, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to the specific user. </summary>
/// <param name="id"> The user Id. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostSendToDefaultHubUser(string id, string data, CancellationToken cancellationToken = default)
{
return RestClient.PostSendToDefaultHubUser(id, data, cancellationToken);
}
/// <summary> Send content inside request body to the specific user. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="id"> The user Id. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostSendToUserAsync(string hub, string id, Stream data, CancellationToken cancellationToken = default)
{
return await RestClient.PostSendToUserAsync(hub, id, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to the specific user. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="id"> The user Id. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostSendToUser(string hub, string id, Stream data, CancellationToken cancellationToken = default)
{
return RestClient.PostSendToUser(hub, id, data, cancellationToken);
}
/// <summary> Send content inside request body to the specific user. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="id"> The user Id. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostSendToUserAsync(string hub, string id, string data, CancellationToken cancellationToken = default)
{
return await RestClient.PostSendToUserAsync(hub, id, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to the specific user. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="id"> The user Id. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostSendToUser(string hub, string id, string data, CancellationToken cancellationToken = default)
{
return RestClient.PostSendToUser(hub, id, data, cancellationToken);
}
/// <summary> Send content inside request body to the specific connection. </summary>
/// <param name="connectionId"> The connection Id. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostSendToDefaultHubConnectionAsync(string connectionId, Stream data, CancellationToken cancellationToken = default)
{
return await RestClient.PostSendToDefaultHubConnectionAsync(connectionId, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to the specific connection. </summary>
/// <param name="connectionId"> The connection Id. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostSendToDefaultHubConnection(string connectionId, Stream data, CancellationToken cancellationToken = default)
{
return RestClient.PostSendToDefaultHubConnection(connectionId, data, cancellationToken);
}
/// <summary> Send content inside request body to the specific connection. </summary>
/// <param name="connectionId"> The connection Id. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostSendToDefaultHubConnectionAsync(string connectionId, string data, CancellationToken cancellationToken = default)
{
return await RestClient.PostSendToDefaultHubConnectionAsync(connectionId, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to the specific connection. </summary>
/// <param name="connectionId"> The connection Id. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostSendToDefaultHubConnection(string connectionId, string data, CancellationToken cancellationToken = default)
{
return RestClient.PostSendToDefaultHubConnection(connectionId, data, cancellationToken);
}
/// <summary> Check if the connection with the given connectionId exists. </summary>
/// <param name="connectionId"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> GetCheckDefaultHubConnectionExistenceAsync(string connectionId, CancellationToken cancellationToken = default)
{
return await RestClient.GetCheckDefaultHubConnectionExistenceAsync(connectionId, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check if the connection with the given connectionId exists. </summary>
/// <param name="connectionId"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response GetCheckDefaultHubConnectionExistence(string connectionId, CancellationToken cancellationToken = default)
{
return RestClient.GetCheckDefaultHubConnectionExistence(connectionId, cancellationToken);
}
/// <summary> Check if the connection with the given connectionId exists. </summary>
/// <param name="connectionId"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> HeadCheckDefaultHubConnectionExistenceAsync(string connectionId, CancellationToken cancellationToken = default)
{
return await RestClient.HeadCheckDefaultHubConnectionExistenceAsync(connectionId, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check if the connection with the given connectionId exists. </summary>
/// <param name="connectionId"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response HeadCheckDefaultHubConnectionExistence(string connectionId, CancellationToken cancellationToken = default)
{
return RestClient.HeadCheckDefaultHubConnectionExistence(connectionId, cancellationToken);
}
/// <summary> Close the client connection. </summary>
/// <param name="connectionId"> The String to use. </param>
/// <param name="reason"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> DeleteCloseDefaultHubClientConnectionAsync(string connectionId, string reason = null, CancellationToken cancellationToken = default)
{
return await RestClient.DeleteCloseDefaultHubClientConnectionAsync(connectionId, reason, cancellationToken).ConfigureAwait(false);
}
/// <summary> Close the client connection. </summary>
/// <param name="connectionId"> The String to use. </param>
/// <param name="reason"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response DeleteCloseDefaultHubClientConnection(string connectionId, string reason = null, CancellationToken cancellationToken = default)
{
return RestClient.DeleteCloseDefaultHubClientConnection(connectionId, reason, cancellationToken);
}
/// <summary> Send content inside request body to the specific connection. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="connectionId"> The connection Id. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostSendToConnectionAsync(string hub, string connectionId, Stream data, CancellationToken cancellationToken = default)
{
return await RestClient.PostSendToConnectionAsync(hub, connectionId, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to the specific connection. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="connectionId"> The connection Id. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostSendToConnection(string hub, string connectionId, Stream data, CancellationToken cancellationToken = default)
{
return RestClient.PostSendToConnection(hub, connectionId, data, cancellationToken);
}
/// <summary> Send content inside request body to the specific connection. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="connectionId"> The connection Id. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostSendToConnectionAsync(string hub, string connectionId, string data, CancellationToken cancellationToken = default)
{
return await RestClient.PostSendToConnectionAsync(hub, connectionId, data, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to the specific connection. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="connectionId"> The connection Id. </param>
/// <param name="data"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostSendToConnection(string hub, string connectionId, string data, CancellationToken cancellationToken = default)
{
return RestClient.PostSendToConnection(hub, connectionId, data, cancellationToken);
}
/// <summary> Check if the connection with the given connectionId exists. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> GetCheckConnectionExistenceAsync(string hub, string connectionId, CancellationToken cancellationToken = default)
{
return await RestClient.GetCheckConnectionExistenceAsync(hub, connectionId, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check if the connection with the given connectionId exists. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response GetCheckConnectionExistence(string hub, string connectionId, CancellationToken cancellationToken = default)
{
return RestClient.GetCheckConnectionExistence(hub, connectionId, cancellationToken);
}
/// <summary> Check if the connection with the given connectionId exists. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> HeadCheckConnectionExistenceAsync(string hub, string connectionId, CancellationToken cancellationToken = default)
{
return await RestClient.HeadCheckConnectionExistenceAsync(hub, connectionId, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check if the connection with the given connectionId exists. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response HeadCheckConnectionExistence(string hub, string connectionId, CancellationToken cancellationToken = default)
{
return RestClient.HeadCheckConnectionExistence(hub, connectionId, cancellationToken);
}
/// <summary> Close the client connection. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="reason"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> DeleteCloseClientConnectionAsync(string hub, string connectionId, string reason = null, CancellationToken cancellationToken = default)
{
return await RestClient.DeleteCloseClientConnectionAsync(hub, connectionId, reason, cancellationToken).ConfigureAwait(false);
}
/// <summary> Close the client connection. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="connectionId"> The String to use. </param>
/// <param name="reason"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response DeleteCloseClientConnection(string hub, string connectionId, string reason = null, CancellationToken cancellationToken = default)
{
return RestClient.DeleteCloseClientConnection(hub, connectionId, reason, cancellationToken);
}
/// <summary> Send content inside request body to a group of connections. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostDefaultHubGroupBroadcastAsync(string group, Stream data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return await RestClient.PostDefaultHubGroupBroadcastAsync(group, data, excluded, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to a group of connections. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostDefaultHubGroupBroadcast(string group, Stream data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return RestClient.PostDefaultHubGroupBroadcast(group, data, excluded, cancellationToken);
}
/// <summary> Send content inside request body to a group of connections. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="data"> The String to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostDefaultHubGroupBroadcastAsync(string group, string data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return await RestClient.PostDefaultHubGroupBroadcastAsync(group, data, excluded, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to a group of connections. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="data"> The String to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostDefaultHubGroupBroadcast(string group, string data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return RestClient.PostDefaultHubGroupBroadcast(group, data, excluded, cancellationToken);
}
/// <summary> Check if there are any client connections inside the given group. </summary>
/// <param name="group"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> GetCheckDefaultHubGroupExistenceAsync(string group, CancellationToken cancellationToken = default)
{
return await RestClient.GetCheckDefaultHubGroupExistenceAsync(group, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check if there are any client connections inside the given group. </summary>
/// <param name="group"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response GetCheckDefaultHubGroupExistence(string group, CancellationToken cancellationToken = default)
{
return RestClient.GetCheckDefaultHubGroupExistence(group, cancellationToken);
}
/// <summary> Check if there are any client connections inside the given group. </summary>
/// <param name="group"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> HeadCheckDefaultHubGroupExistenceAsync(string group, CancellationToken cancellationToken = default)
{
return await RestClient.HeadCheckDefaultHubGroupExistenceAsync(group, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check if there are any client connections inside the given group. </summary>
/// <param name="group"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response HeadCheckDefaultHubGroupExistence(string group, CancellationToken cancellationToken = default)
{
return RestClient.HeadCheckDefaultHubGroupExistence(group, cancellationToken);
}
/// <summary> Send content inside request body to a group of connections. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostGroupBroadcastAsync(string hub, string group, Stream data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return await RestClient.PostGroupBroadcastAsync(hub, group, data, excluded, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to a group of connections. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="data"> The binary to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostGroupBroadcast(string hub, string group, Stream data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return RestClient.PostGroupBroadcast(hub, group, data, excluded, cancellationToken);
}
/// <summary> Send content inside request body to a group of connections. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="data"> The String to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PostGroupBroadcastAsync(string hub, string group, string data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return await RestClient.PostGroupBroadcastAsync(hub, group, data, excluded, cancellationToken).ConfigureAwait(false);
}
/// <summary> Send content inside request body to a group of connections. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="data"> The String to use. </param>
/// <param name="excluded"> Excluded connection Ids. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PostGroupBroadcast(string hub, string group, string data, IEnumerable<string> excluded = null, CancellationToken cancellationToken = default)
{
return RestClient.PostGroupBroadcast(hub, group, data, excluded, cancellationToken);
}
/// <summary> Check if there are any client connections inside the given group. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> GetCheckGroupExistenceAsync(string hub, string group, CancellationToken cancellationToken = default)
{
return await RestClient.GetCheckGroupExistenceAsync(hub, group, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check if there are any client connections inside the given group. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response GetCheckGroupExistence(string hub, string group, CancellationToken cancellationToken = default)
{
return RestClient.GetCheckGroupExistence(hub, group, cancellationToken);
}
/// <summary> Check if there are any client connections inside the given group. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> HeadCheckGroupExistenceAsync(string hub, string group, CancellationToken cancellationToken = default)
{
return await RestClient.HeadCheckGroupExistenceAsync(hub, group, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check if there are any client connections inside the given group. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="group"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response HeadCheckGroupExistence(string hub, string group, CancellationToken cancellationToken = default)
{
return RestClient.HeadCheckGroupExistence(hub, group, cancellationToken);
}
/// <summary> Check if there are any client connections connected for the given user. </summary>
/// <param name="user"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> GetCheckDefaultHubUserExistenceAsync(string user, CancellationToken cancellationToken = default)
{
return await RestClient.GetCheckDefaultHubUserExistenceAsync(user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check if there are any client connections connected for the given user. </summary>
/// <param name="user"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response GetCheckDefaultHubUserExistence(string user, CancellationToken cancellationToken = default)
{
return RestClient.GetCheckDefaultHubUserExistence(user, cancellationToken);
}
/// <summary> Check if there are any client connections connected for the given user. </summary>
/// <param name="user"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> HeadCheckDefaultHubUserExistenceAsync(string user, CancellationToken cancellationToken = default)
{
return await RestClient.HeadCheckDefaultHubUserExistenceAsync(user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check if there are any client connections connected for the given user. </summary>
/// <param name="user"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response HeadCheckDefaultHubUserExistence(string user, CancellationToken cancellationToken = default)
{
return RestClient.HeadCheckDefaultHubUserExistence(user, cancellationToken);
}
/// <summary> Add a connection to the target group. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="connectionId"> Target connection Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PutAddConnectionToDefaultHubGroupAsync(string group, string connectionId, CancellationToken cancellationToken = default)
{
return await RestClient.PutAddConnectionToDefaultHubGroupAsync(group, connectionId, cancellationToken).ConfigureAwait(false);
}
/// <summary> Add a connection to the target group. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="connectionId"> Target connection Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PutAddConnectionToDefaultHubGroup(string group, string connectionId, CancellationToken cancellationToken = default)
{
return RestClient.PutAddConnectionToDefaultHubGroup(group, connectionId, cancellationToken);
}
/// <summary> Remove a connection from the target group. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="connectionId"> Target connection Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> DeleteRemoveConnectionFromDefaultHubGroupAsync(string group, string connectionId, CancellationToken cancellationToken = default)
{
return await RestClient.DeleteRemoveConnectionFromDefaultHubGroupAsync(group, connectionId, cancellationToken).ConfigureAwait(false);
}
/// <summary> Remove a connection from the target group. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="connectionId"> Target connection Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response DeleteRemoveConnectionFromDefaultHubGroup(string group, string connectionId, CancellationToken cancellationToken = default)
{
return RestClient.DeleteRemoveConnectionFromDefaultHubGroup(group, connectionId, cancellationToken);
}
/// <summary> Check whether a user exists in the target group. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> GetCheckUserExistenceInDefaultHubGroupAsync(string group, string user, CancellationToken cancellationToken = default)
{
return await RestClient.GetCheckUserExistenceInDefaultHubGroupAsync(group, user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check whether a user exists in the target group. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response GetCheckUserExistenceInDefaultHubGroup(string group, string user, CancellationToken cancellationToken = default)
{
return RestClient.GetCheckUserExistenceInDefaultHubGroup(group, user, cancellationToken);
}
/// <summary> Check whether a user exists in the target group. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> HeadCheckUserExistenceInDefaultHubGroupAsync(string group, string user, CancellationToken cancellationToken = default)
{
return await RestClient.HeadCheckUserExistenceInDefaultHubGroupAsync(group, user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check whether a user exists in the target group. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response HeadCheckUserExistenceInDefaultHubGroup(string group, string user, CancellationToken cancellationToken = default)
{
return RestClient.HeadCheckUserExistenceInDefaultHubGroup(group, user, cancellationToken);
}
/// <summary> Add a user to the target group. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="ttl"> Specifies the seconds that the user exists in the group. If not set, the user lives in the group forever. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PutAddUserToDefaultHubGroupAsync(string group, string user, int? ttl = null, CancellationToken cancellationToken = default)
{
return await RestClient.PutAddUserToDefaultHubGroupAsync(group, user, ttl, cancellationToken).ConfigureAwait(false);
}
/// <summary> Add a user to the target group. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="ttl"> Specifies the seconds that the user exists in the group. If not set, the user lives in the group forever. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PutAddUserToDefaultHubGroup(string group, string user, int? ttl = null, CancellationToken cancellationToken = default)
{
return RestClient.PutAddUserToDefaultHubGroup(group, user, ttl, cancellationToken);
}
/// <summary> Remove a user from the target group. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> DeleteRemoveUserFromDefaultHubGroupAsync(string group, string user, CancellationToken cancellationToken = default)
{
return await RestClient.DeleteRemoveUserFromDefaultHubGroupAsync(group, user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Remove a user from the target group. </summary>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response DeleteRemoveUserFromDefaultHubGroup(string group, string user, CancellationToken cancellationToken = default)
{
return RestClient.DeleteRemoveUserFromDefaultHubGroup(group, user, cancellationToken);
}
/// <summary> Remove a user from all groups. </summary>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> DeleteRemoveUserFromAllDefaultHubGroupsAsync(string user, CancellationToken cancellationToken = default)
{
return await RestClient.DeleteRemoveUserFromAllDefaultHubGroupsAsync(user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Remove a user from all groups. </summary>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response DeleteRemoveUserFromAllDefaultHubGroups(string user, CancellationToken cancellationToken = default)
{
return RestClient.DeleteRemoveUserFromAllDefaultHubGroups(user, cancellationToken);
}
/// <summary> Check if there are any client connections connected for the given user. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="user"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> GetCheckUserExistenceAsync(string hub, string user, CancellationToken cancellationToken = default)
{
return await RestClient.GetCheckUserExistenceAsync(hub, user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check if there are any client connections connected for the given user. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="user"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response GetCheckUserExistence(string hub, string user, CancellationToken cancellationToken = default)
{
return RestClient.GetCheckUserExistence(hub, user, cancellationToken);
}
/// <summary> Check if there are any client connections connected for the given user. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="user"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> HeadCheckUserExistenceAsync(string hub, string user, CancellationToken cancellationToken = default)
{
return await RestClient.HeadCheckUserExistenceAsync(hub, user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check if there are any client connections connected for the given user. </summary>
/// <param name="hub"> The String to use. </param>
/// <param name="user"> The String to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response HeadCheckUserExistence(string hub, string user, CancellationToken cancellationToken = default)
{
return RestClient.HeadCheckUserExistence(hub, user, cancellationToken);
}
/// <summary> Add a connection to the target group. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="connectionId"> Target connection Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PutAddConnectionToGroupAsync(string hub, string group, string connectionId, CancellationToken cancellationToken = default)
{
return await RestClient.PutAddConnectionToGroupAsync(hub, group, connectionId, cancellationToken).ConfigureAwait(false);
}
/// <summary> Add a connection to the target group. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="connectionId"> Target connection Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PutAddConnectionToGroup(string hub, string group, string connectionId, CancellationToken cancellationToken = default)
{
return RestClient.PutAddConnectionToGroup(hub, group, connectionId, cancellationToken);
}
/// <summary> Remove a connection from the target group. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="connectionId"> Target connection Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> DeleteRemoveConnectionFromGroupAsync(string hub, string group, string connectionId, CancellationToken cancellationToken = default)
{
return await RestClient.DeleteRemoveConnectionFromGroupAsync(hub, group, connectionId, cancellationToken).ConfigureAwait(false);
}
/// <summary> Remove a connection from the target group. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="connectionId"> Target connection Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response DeleteRemoveConnectionFromGroup(string hub, string group, string connectionId, CancellationToken cancellationToken = default)
{
return RestClient.DeleteRemoveConnectionFromGroup(hub, group, connectionId, cancellationToken);
}
/// <summary> Check whether a user exists in the target group. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> GetCheckUserExistenceInGroupAsync(string hub, string group, string user, CancellationToken cancellationToken = default)
{
return await RestClient.GetCheckUserExistenceInGroupAsync(hub, group, user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check whether a user exists in the target group. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response GetCheckUserExistenceInGroup(string hub, string group, string user, CancellationToken cancellationToken = default)
{
return RestClient.GetCheckUserExistenceInGroup(hub, group, user, cancellationToken);
}
/// <summary> Check whether a user exists in the target group. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> HeadCheckUserExistenceInGroupAsync(string hub, string group, string user, CancellationToken cancellationToken = default)
{
return await RestClient.HeadCheckUserExistenceInGroupAsync(hub, group, user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Check whether a user exists in the target group. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response HeadCheckUserExistenceInGroup(string hub, string group, string user, CancellationToken cancellationToken = default)
{
return RestClient.HeadCheckUserExistenceInGroup(hub, group, user, cancellationToken);
}
/// <summary> Add a user to the target group. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="ttl"> Specifies the seconds that the user exists in the group. If not set, the user lives in the group forever. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> PutAddUserToGroupAsync(string hub, string group, string user, int? ttl = null, CancellationToken cancellationToken = default)
{
return await RestClient.PutAddUserToGroupAsync(hub, group, user, ttl, cancellationToken).ConfigureAwait(false);
}
/// <summary> Add a user to the target group. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="ttl"> Specifies the seconds that the user exists in the group. If not set, the user lives in the group forever. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response PutAddUserToGroup(string hub, string group, string user, int? ttl = null, CancellationToken cancellationToken = default)
{
return RestClient.PutAddUserToGroup(hub, group, user, ttl, cancellationToken);
}
/// <summary> Remove a user from the target group. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> DeleteRemoveUserFromGroupAsync(string hub, string group, string user, CancellationToken cancellationToken = default)
{
return await RestClient.DeleteRemoveUserFromGroupAsync(hub, group, user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Remove a user from the target group. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="group"> Target group name, which length should be greater than 0 and less than 1025. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response DeleteRemoveUserFromGroup(string hub, string group, string user, CancellationToken cancellationToken = default)
{
return RestClient.DeleteRemoveUserFromGroup(hub, group, user, cancellationToken);
}
/// <summary> Remove a user from all groups. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response> DeleteRemoveUserFromAllGroupsAsync(string hub, string user, CancellationToken cancellationToken = default)
{
return await RestClient.DeleteRemoveUserFromAllGroupsAsync(hub, user, cancellationToken).ConfigureAwait(false);
}
/// <summary> Remove a user from all groups. </summary>
/// <param name="hub"> Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. </param>
/// <param name="user"> Target user Id. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response DeleteRemoveUserFromAllGroups(string hub, string user, CancellationToken cancellationToken = default)
{
return RestClient.DeleteRemoveUserFromAllGroups(hub, user, cancellationToken);
}
}
}

4098
samples/SignalR/SignalR/Generated/WebSocketConnectionApiRestClient.cs сгенерированный Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу