void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("osType"); writer.WriteStringValue(OsType.ToSerialString()); writer.WritePropertyName("osState"); writer.WriteStringValue(OsState.ToSerialString()); if (Snapshot != null) { writer.WritePropertyName("snapshot"); writer.WriteObjectValue(Snapshot); } if (ManagedDisk != null) { writer.WritePropertyName("managedDisk"); writer.WriteObjectValue(ManagedDisk); } if (BlobUri != null) { writer.WritePropertyName("blobUri"); writer.WriteStringValue(BlobUri); } if (Caching != null) { writer.WritePropertyName("caching"); writer.WriteStringValue(Caching.Value.ToSerialString()); } if (DiskSizeGB != null) { writer.WritePropertyName("diskSizeGB"); writer.WriteNumberValue(DiskSizeGB.Value); } if (StorageAccountType != null) { writer.WritePropertyName("storageAccountType"); writer.WriteStringValue(StorageAccountType.Value.ToString()); } if (DiskEncryptionSet != null) { writer.WritePropertyName("diskEncryptionSet"); writer.WriteObjectValue(DiskEncryptionSet); } writer.WriteEndObject(); }
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("osType"); writer.WriteStringValue(OsType.ToSerialString()); writer.WritePropertyName("osState"); writer.WriteStringValue(OsState.ToSerialString()); if (Optional.IsDefined(Snapshot)) { writer.WritePropertyName("snapshot"); JsonSerializer.Serialize(writer, Snapshot); } if (Optional.IsDefined(ManagedDisk)) { writer.WritePropertyName("managedDisk"); JsonSerializer.Serialize(writer, ManagedDisk); } if (Optional.IsDefined(BlobUri)) { writer.WritePropertyName("blobUri"); writer.WriteStringValue(BlobUri); } if (Optional.IsDefined(Caching)) { writer.WritePropertyName("caching"); writer.WriteStringValue(Caching.Value.ToSerialString()); } if (Optional.IsDefined(DiskSizeGB)) { writer.WritePropertyName("diskSizeGB"); writer.WriteNumberValue(DiskSizeGB.Value); } if (Optional.IsDefined(StorageAccountType)) { writer.WritePropertyName("storageAccountType"); writer.WriteStringValue(StorageAccountType.Value.ToString()); } if (Optional.IsDefined(DiskEncryptionSet)) { writer.WritePropertyName("diskEncryptionSet"); JsonSerializer.Serialize(writer, DiskEncryptionSet); } writer.WriteEndObject(); }