Esempio n. 1
0
 public GameRule(GameRule rule)
 {
     type          = rule.type;
     conditionType = rule.conditionType;
     value         = 0;
     completeType  = RuleCompleteType.None;
 }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(Name))
     {
         writer.WritePropertyName("name");
         writer.WriteStringValue(Name);
     }
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     writer.WritePropertyName("ruleConditionType");
     writer.WriteStringValue(RuleConditionType.ToString());
     writer.WriteEndObject();
 }
Esempio n. 3
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (IpProtocols != null)
     {
         writer.WritePropertyName("ipProtocols");
         writer.WriteStartArray();
         foreach (var item in IpProtocols)
         {
             writer.WriteStringValue(item.ToString());
         }
         writer.WriteEndArray();
     }
     if (SourceAddresses != null)
     {
         writer.WritePropertyName("sourceAddresses");
         writer.WriteStartArray();
         foreach (var item in SourceAddresses)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (DestinationAddresses != null)
     {
         writer.WritePropertyName("destinationAddresses");
         writer.WriteStartArray();
         foreach (var item in DestinationAddresses)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (DestinationPorts != null)
     {
         writer.WritePropertyName("destinationPorts");
         writer.WriteStartArray();
         foreach (var item in DestinationPorts)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (SourceIpGroups != null)
     {
         writer.WritePropertyName("sourceIpGroups");
         writer.WriteStartArray();
         foreach (var item in SourceIpGroups)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (DestinationIpGroups != null)
     {
         writer.WritePropertyName("destinationIpGroups");
         writer.WriteStartArray();
         foreach (var item in DestinationIpGroups)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Name != null)
     {
         writer.WritePropertyName("name");
         writer.WriteStringValue(Name);
     }
     if (Description != null)
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     writer.WritePropertyName("ruleConditionType");
     writer.WriteStringValue(RuleConditionType.ToString());
     writer.WriteEndObject();
 }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (SourceAddresses != null)
     {
         writer.WritePropertyName("sourceAddresses");
         writer.WriteStartArray();
         foreach (var item in SourceAddresses)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (DestinationAddresses != null)
     {
         writer.WritePropertyName("destinationAddresses");
         writer.WriteStartArray();
         foreach (var item in DestinationAddresses)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Protocols != null)
     {
         writer.WritePropertyName("protocols");
         writer.WriteStartArray();
         foreach (var item in Protocols)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (TargetUrls != null)
     {
         writer.WritePropertyName("targetUrls");
         writer.WriteStartArray();
         foreach (var item in TargetUrls)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (TargetFqdns != null)
     {
         writer.WritePropertyName("targetFqdns");
         writer.WriteStartArray();
         foreach (var item in TargetFqdns)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (FqdnTags != null)
     {
         writer.WritePropertyName("fqdnTags");
         writer.WriteStartArray();
         foreach (var item in FqdnTags)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (SourceIpGroups != null)
     {
         writer.WritePropertyName("sourceIpGroups");
         writer.WriteStartArray();
         foreach (var item in SourceIpGroups)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Name != null)
     {
         writer.WritePropertyName("name");
         writer.WriteStringValue(Name);
     }
     if (Description != null)
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     writer.WritePropertyName("ruleConditionType");
     writer.WriteStringValue(RuleConditionType.ToString());
     writer.WriteEndObject();
 }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsCollectionDefined(IpProtocols))
     {
         writer.WritePropertyName("ipProtocols");
         writer.WriteStartArray();
         foreach (var item in IpProtocols)
         {
             writer.WriteStringValue(item.ToString());
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(SourceAddresses))
     {
         writer.WritePropertyName("sourceAddresses");
         writer.WriteStartArray();
         foreach (var item in SourceAddresses)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(DestinationAddresses))
     {
         writer.WritePropertyName("destinationAddresses");
         writer.WriteStartArray();
         foreach (var item in DestinationAddresses)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(DestinationPorts))
     {
         writer.WritePropertyName("destinationPorts");
         writer.WriteStartArray();
         foreach (var item in DestinationPorts)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(SourceIpGroups))
     {
         writer.WritePropertyName("sourceIpGroups");
         writer.WriteStartArray();
         foreach (var item in SourceIpGroups)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsDefined(TerminateTLS))
     {
         writer.WritePropertyName("terminateTLS");
         writer.WriteBooleanValue(TerminateTLS.Value);
     }
     if (Optional.IsDefined(Name))
     {
         writer.WritePropertyName("name");
         writer.WriteStringValue(Name);
     }
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     writer.WritePropertyName("ruleConditionType");
     writer.WriteStringValue(RuleConditionType.ToString());
     writer.WriteEndObject();
 }