void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(ManagedBy))
     {
         writer.WritePropertyName("managedBy");
         writer.WriteStringValue(ManagedBy);
     }
     if (Optional.IsDefined(Sku))
     {
         writer.WritePropertyName("sku");
         writer.WriteObjectValue(Sku);
     }
     if (Optional.IsDefined(Identity))
     {
         writer.WritePropertyName("identity");
         writer.WriteObjectValue(Identity);
     }
     if (Optional.IsDefined(Location))
     {
         writer.WritePropertyName("location");
         writer.WriteStringValue(Location);
     }
     if (Optional.IsCollectionDefined(Tags))
     {
         writer.WritePropertyName("tags");
         writer.WriteStartObject();
         foreach (var item in Tags)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     writer.WritePropertyName("properties");
     writer.WriteStartObject();
     writer.WritePropertyName("lockLevel");
     writer.WriteStringValue(LockLevel.ToSerialString());
     if (Optional.IsDefined(DisplayName))
     {
         writer.WritePropertyName("displayName");
         writer.WriteStringValue(DisplayName);
     }
     if (Optional.IsDefined(IsEnabled))
     {
         writer.WritePropertyName("isEnabled");
         writer.WriteStringValue(IsEnabled);
     }
     writer.WritePropertyName("authorizations");
     writer.WriteStartArray();
     foreach (var item in Authorizations)
     {
         writer.WriteObjectValue(item);
     }
     writer.WriteEndArray();
     if (Optional.IsCollectionDefined(Artifacts))
     {
         writer.WritePropertyName("artifacts");
         writer.WriteStartArray();
         foreach (var item in Artifacts)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsDefined(PackageFileUri))
     {
         writer.WritePropertyName("packageFileUri");
         writer.WriteStringValue(PackageFileUri);
     }
     if (Optional.IsDefined(MainTemplate))
     {
         writer.WritePropertyName("mainTemplate");
         writer.WriteObjectValue(MainTemplate);
     }
     if (Optional.IsDefined(CreateUiDefinition))
     {
         writer.WritePropertyName("createUiDefinition");
         writer.WriteObjectValue(CreateUiDefinition);
     }
     writer.WriteEndObject();
     writer.WriteEndObject();
 }
예제 #2
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (ManagedBy != null)
     {
         writer.WritePropertyName("managedBy");
         writer.WriteStringValue(ManagedBy);
     }
     if (Sku != null)
     {
         writer.WritePropertyName("sku");
         writer.WriteObjectValue(Sku);
     }
     if (Identity != null)
     {
         writer.WritePropertyName("identity");
         writer.WriteObjectValue(Identity);
     }
     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);
     }
     if (Location != null)
     {
         writer.WritePropertyName("location");
         writer.WriteStringValue(Location);
     }
     if (Tags != null)
     {
         writer.WritePropertyName("tags");
         writer.WriteStartObject();
         foreach (var item in Tags)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     writer.WritePropertyName("properties");
     writer.WriteStartObject();
     writer.WritePropertyName("lockLevel");
     writer.WriteStringValue(LockLevel.ToSerialString());
     if (DisplayName != null)
     {
         writer.WritePropertyName("displayName");
         writer.WriteStringValue(DisplayName);
     }
     if (IsEnabled != null)
     {
         writer.WritePropertyName("isEnabled");
         writer.WriteStringValue(IsEnabled);
     }
     writer.WritePropertyName("authorizations");
     writer.WriteStartArray();
     foreach (var item in Authorizations)
     {
         writer.WriteObjectValue(item);
     }
     writer.WriteEndArray();
     if (Artifacts != null)
     {
         writer.WritePropertyName("artifacts");
         writer.WriteStartArray();
         foreach (var item in Artifacts)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Description != null)
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (PackageFileUri != null)
     {
         writer.WritePropertyName("packageFileUri");
         writer.WriteStringValue(PackageFileUri);
     }
     if (MainTemplate != null)
     {
         writer.WritePropertyName("mainTemplate");
         writer.WriteObjectValue(MainTemplate);
     }
     if (CreateUiDefinition != null)
     {
         writer.WritePropertyName("createUiDefinition");
         writer.WriteObjectValue(CreateUiDefinition);
     }
     writer.WriteEndObject();
     writer.WriteEndObject();
 }