void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(ManagedBy))
     {
         writer.WritePropertyName("managedBy");
         writer.WriteStringValue(ManagedBy);
     }
     if (Optional.IsCollectionDefined(ManagedByExtended))
     {
         writer.WritePropertyName("managedByExtended");
         writer.WriteStartArray();
         foreach (var item in ManagedByExtended)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     writer.WritePropertyName("properties");
     writer.WriteStartObject();
     writer.WritePropertyName("aclMode");
     writer.WriteStringValue(AclMode.ToString());
     if (Optional.IsDefined(TargetIqn))
     {
         writer.WritePropertyName("targetIqn");
         writer.WriteStringValue(TargetIqn);
     }
     if (Optional.IsCollectionDefined(StaticAcls))
     {
         writer.WritePropertyName("staticAcls");
         writer.WriteStartArray();
         foreach (var item in StaticAcls)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(Luns))
     {
         writer.WritePropertyName("luns");
         writer.WriteStartArray();
         foreach (var item in Luns)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     writer.WriteEndObject();
     writer.WriteEndObject();
 }
Beispiel #2
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("properties");
     writer.WriteStartObject();
     writer.WritePropertyName("aclMode");
     writer.WriteStringValue(AclMode.ToString());
     if (Optional.IsCollectionDefined(StaticAcls))
     {
         writer.WritePropertyName("staticAcls");
         writer.WriteStartArray();
         foreach (var item in StaticAcls)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(Luns))
     {
         writer.WritePropertyName("luns");
         writer.WriteStartArray();
         foreach (var item in Luns)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     writer.WritePropertyName("targetIqn");
     writer.WriteStringValue(TargetIqn);
     writer.WritePropertyName("status");
     writer.WriteStringValue(Status.ToString());
     if (Optional.IsCollectionDefined(Endpoints))
     {
         writer.WritePropertyName("endpoints");
         writer.WriteStartArray();
         foreach (var item in Endpoints)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsDefined(Port))
     {
         writer.WritePropertyName("port");
         writer.WriteNumberValue(Port.Value);
     }
     writer.WriteEndObject();
     writer.WriteEndObject();
 }