Skip to content

Commit 8f192cc

Browse files
Add implementation for Devices APIs (#12611)
1 parent 644069d commit 8f192cc

File tree

8 files changed

+721
-134
lines changed

8 files changed

+721
-134
lines changed

sdk/iot/Azure.Iot.Hub.Service/src/API Design.md

Lines changed: 209 additions & 0 deletions
Large diffs are not rendered by default.

sdk/iot/Azure.Iot.Hub.Service/src/DevicesClient.cs

Lines changed: 486 additions & 4 deletions
Large diffs are not rendered by default.

sdk/iot/Azure.Iot.Hub.Service/src/Generated/Models/BulkRegistryOperationResult.Serialization.cs

Lines changed: 0 additions & 78 deletions
This file was deleted.

sdk/iot/Azure.Iot.Hub.Service/src/Generated/Models/BulkRegistryOperationResult.cs

Lines changed: 0 additions & 38 deletions
This file was deleted.

sdk/iot/Azure.Iot.Hub.Service/src/Generated/RegistryManagerRestClient.cs

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/iot/Azure.Iot.Hub.Service/src/IfMatchPrecondition.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ namespace Azure.Iot.Hub.Service
88
/// </summary>
99
public enum IfMatchPrecondition
1010
{
11+
/// <summary>
12+
/// Perform this operation regardless of if the provided resource matches the service's representation
13+
/// of the object. This will cause the HTTP request to be sent with no ifMatch header. The service will never respond with a 412 error code with this setting.
14+
/// </summary>
15+
Unconditional,
16+
1117
/// <summary>
1218
/// Perform this operation as long as the provided resource exists in the service. This will cause the HTTP request to be sent with an ifMatch header with value "*". For create or update
1319
/// operations, if the resource does not exist, then the service will not execute the operation and will respond to the request with a 412 error code. For delete operations, if the resource

sdk/iot/Azure.Iot.Hub.Service/src/IfMatchPreconditionExtensions.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@ internal static class IfMatchPreconditionExtensions
1818
/// <returns>The ifMatch header value.</returns>
1919
internal static string GetIfMatchHeaderValue(IfMatchPrecondition precondition, string ETag)
2020
{
21-
return precondition switch
21+
if (precondition == IfMatchPrecondition.IfMatch)
2222
{
23-
IfMatchPrecondition.IfMatch => $"\"{ETag}\"",
24-
IfMatchPrecondition.UnconditionalIfMatch => "*",
25-
_ => null,
26-
};
23+
return ETag;
24+
}
25+
else if (precondition == IfMatchPrecondition.UnconditionalIfMatch)
26+
{
27+
return "*";
28+
}
29+
else //precondition == IfMatchPrecondition.Unconditional
30+
{
31+
return null;
32+
}
2733
}
2834
}
2935
}

sdk/iot/Azure.Iot.Hub.Service/src/swagger/iothubservice_modified.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,13 @@
309309
"200": {
310310
"description": "OK",
311311
"schema": {
312-
"$ref": "#/definitions/BulkRegistryOperationResult"
312+
"$ref": "#/definitions/BulkRegistryOperationResponse"
313313
}
314314
},
315315
"400": {
316316
"description": "BadRequest",
317317
"schema": {
318-
"$ref": "#/definitions/BulkRegistryOperationResult"
318+
"$ref": "#/definitions/BulkRegistryOperationResponse"
319319
}
320320
}
321321
}
@@ -2215,7 +2215,7 @@
22152215
}
22162216
}
22172217
},
2218-
"BulkRegistryOperationResult": {
2218+
"BulkRegistryOperationResponse": {
22192219
"description": "Encapsulates the result of a bulk registry operation.",
22202220
"type": "object",
22212221
"properties": {

0 commit comments

Comments
 (0)