| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System.Text.Json; |
| | 9 | | using Azure.Core; |
| | 10 | |
|
| | 11 | | namespace Azure.Iot.Hub.Service.Models |
| | 12 | | { |
| | 13 | | public partial class ExportImportDevice : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 536 | 17 | | writer.WriteStartObject(); |
| 536 | 18 | | if (Optional.IsDefined(Id)) |
| | 19 | | { |
| 536 | 20 | | writer.WritePropertyName("id"); |
| 536 | 21 | | writer.WriteStringValue(Id); |
| | 22 | | } |
| 536 | 23 | | if (Optional.IsDefined(ModuleId)) |
| | 24 | | { |
| 200 | 25 | | writer.WritePropertyName("moduleId"); |
| 200 | 26 | | writer.WriteStringValue(ModuleId); |
| | 27 | | } |
| 536 | 28 | | if (Optional.IsDefined(ETag)) |
| | 29 | | { |
| 16 | 30 | | writer.WritePropertyName("eTag"); |
| 16 | 31 | | writer.WriteStringValue(ETag); |
| | 32 | | } |
| 536 | 33 | | if (Optional.IsDefined(ImportMode)) |
| | 34 | | { |
| 536 | 35 | | writer.WritePropertyName("importMode"); |
| 536 | 36 | | writer.WriteStringValue(ImportMode.Value.ToString()); |
| | 37 | | } |
| 536 | 38 | | if (Optional.IsDefined(Status)) |
| | 39 | | { |
| 168 | 40 | | writer.WritePropertyName("status"); |
| 168 | 41 | | writer.WriteStringValue(Status.Value.ToString()); |
| | 42 | | } |
| 536 | 43 | | if (Optional.IsDefined(StatusReason)) |
| | 44 | | { |
| 0 | 45 | | writer.WritePropertyName("statusReason"); |
| 0 | 46 | | writer.WriteStringValue(StatusReason); |
| | 47 | | } |
| 536 | 48 | | if (Optional.IsDefined(Authentication)) |
| | 49 | | { |
| 48 | 50 | | writer.WritePropertyName("authentication"); |
| 48 | 51 | | writer.WriteObjectValue(Authentication); |
| | 52 | | } |
| 536 | 53 | | if (Optional.IsDefined(TwinETag)) |
| | 54 | | { |
| 0 | 55 | | writer.WritePropertyName("twinETag"); |
| 0 | 56 | | writer.WriteStringValue(TwinETag); |
| | 57 | | } |
| 536 | 58 | | if (Optional.IsCollectionDefined(Tags)) |
| | 59 | | { |
| 0 | 60 | | writer.WritePropertyName("tags"); |
| 0 | 61 | | writer.WriteStartObject(); |
| 0 | 62 | | foreach (var item in Tags) |
| | 63 | | { |
| 0 | 64 | | writer.WritePropertyName(item.Key); |
| 0 | 65 | | writer.WriteObjectValue(item.Value); |
| | 66 | | } |
| 0 | 67 | | writer.WriteEndObject(); |
| | 68 | | } |
| 536 | 69 | | if (Optional.IsDefined(Properties)) |
| | 70 | | { |
| 80 | 71 | | writer.WritePropertyName("properties"); |
| 80 | 72 | | writer.WriteObjectValue(Properties); |
| | 73 | | } |
| 536 | 74 | | if (Optional.IsDefined(Capabilities)) |
| | 75 | | { |
| 8 | 76 | | writer.WritePropertyName("capabilities"); |
| 8 | 77 | | writer.WriteObjectValue(Capabilities); |
| | 78 | | } |
| 536 | 79 | | if (Optional.IsDefined(DeviceScope)) |
| | 80 | | { |
| 0 | 81 | | writer.WritePropertyName("deviceScope"); |
| 0 | 82 | | writer.WriteStringValue(DeviceScope); |
| | 83 | | } |
| 536 | 84 | | if (Optional.IsCollectionDefined(ParentScopes)) |
| | 85 | | { |
| 0 | 86 | | writer.WritePropertyName("parentScopes"); |
| 0 | 87 | | writer.WriteStartArray(); |
| 0 | 88 | | foreach (var item in ParentScopes) |
| | 89 | | { |
| 0 | 90 | | writer.WriteStringValue(item); |
| | 91 | | } |
| 0 | 92 | | writer.WriteEndArray(); |
| | 93 | | } |
| 536 | 94 | | writer.WriteEndObject(); |
| 536 | 95 | | } |
| | 96 | | } |
| | 97 | | } |