Esempio n. 1
0
        public static string AuditEntityModified(EntityEntry objectStateEntry, Utf8JsonWriter writer = null)
        {
            writer?.WritePropertyName("Values");
            writer?.WriteStartArray();
            var values = new List <AuditUpdate>();

            foreach (var prop in objectStateEntry.OriginalValues.Properties)
            {
                string originalValue = null;
                if (objectStateEntry.OriginalValues[prop] != null)
                {
                    originalValue = objectStateEntry.OriginalValues[prop].ToString();
                }
                string currentValue = null;
                if (objectStateEntry.CurrentValues[prop] != null)
                {
                    currentValue = objectStateEntry.CurrentValues[prop].ToString();
                }

                if (originalValue != currentValue) //Only create a log if the value changes
                {
                    values.Add(new AuditUpdate
                    {
                        PropertyName = prop.Name,
                        OldValue     = originalValue,
                        NewValue     = currentValue,
                    });
                    writer?.WriteStartObject();
                    writer?.WritePropertyName("PropertyName");
                    writer?.WriteStringValue(prop.Name);

                    writer?.WritePropertyName("OldValue");
                    writer?.WriteStringValue(originalValue);

                    writer?.WritePropertyName("NewValue");
                    writer?.WriteStringValue(currentValue);
                    writer?.WriteEndObject();
                }
            }
            writer?.WriteEndArray();

            return(JsonSerializer.Serialize(values));
        }
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }

            ((Fhir.R4.Models.BackboneElement) this).SerializeJson(writer, options, false);

            if (Target != null)
            {
                writer.WritePropertyName("target");
                Target.SerializeJson(writer, options);
            }

            if (Type != null)
            {
                writer.WritePropertyName("type");
                Type.SerializeJson(writer, options);
            }

            if (Interaction != null)
            {
                writer.WritePropertyName("interaction");
                Interaction.SerializeJson(writer, options);
            }

            if (Organism != null)
            {
                writer.WritePropertyName("organism");
                Organism.SerializeJson(writer, options);
            }

            if (OrganismType != null)
            {
                writer.WritePropertyName("organismType");
                OrganismType.SerializeJson(writer, options);
            }

            if (AmountQuantity != null)
            {
                writer.WritePropertyName("amountQuantity");
                AmountQuantity.SerializeJson(writer, options);
            }

            if (AmountRange != null)
            {
                writer.WritePropertyName("amountRange");
                AmountRange.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(AmountString))
            {
                writer.WriteString("amountString", (string)AmountString !);
            }

            if (_AmountString != null)
            {
                writer.WritePropertyName("_amountString");
                _AmountString.SerializeJson(writer, options);
            }

            if (AmountType != null)
            {
                writer.WritePropertyName("amountType");
                AmountType.SerializeJson(writer, options);
            }

            if ((Source != null) && (Source.Count != 0))
            {
                writer.WritePropertyName("source");
                writer.WriteStartArray();

                foreach (Reference valSource in Source)
                {
                    valSource.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("dataSourceParameter");
     writer.WriteObjectValue(DataSourceParameter);
     writer.WritePropertyName("dataSourceType");
     writer.WriteStringValue(DataSourceType.ToString());
     writer.WritePropertyName("dataFeedName");
     writer.WriteStringValue(DataFeedName);
     if (Optional.IsDefined(DataFeedDescription))
     {
         writer.WritePropertyName("dataFeedDescription");
         writer.WriteStringValue(DataFeedDescription);
     }
     writer.WritePropertyName("granularityName");
     writer.WriteStringValue(GranularityName.ToString());
     if (Optional.IsDefined(GranularityAmount))
     {
         if (GranularityAmount != null)
         {
             writer.WritePropertyName("granularityAmount");
             writer.WriteNumberValue(GranularityAmount.Value);
         }
         else
         {
             writer.WriteNull("granularityAmount");
         }
     }
     writer.WritePropertyName("metrics");
     writer.WriteStartArray();
     foreach (var item in Metrics)
     {
         writer.WriteObjectValue(item);
     }
     writer.WriteEndArray();
     if (Optional.IsCollectionDefined(Dimension))
     {
         writer.WritePropertyName("dimension");
         writer.WriteStartArray();
         foreach (var item in Dimension)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsDefined(TimestampColumn))
     {
         writer.WritePropertyName("timestampColumn");
         writer.WriteStringValue(TimestampColumn);
     }
     writer.WritePropertyName("dataStartFrom");
     writer.WriteStringValue(DataStartFrom, "O");
     if (Optional.IsDefined(StartOffsetInSeconds))
     {
         writer.WritePropertyName("startOffsetInSeconds");
         writer.WriteNumberValue(StartOffsetInSeconds.Value);
     }
     if (Optional.IsDefined(MaxConcurrency))
     {
         writer.WritePropertyName("maxConcurrency");
         writer.WriteNumberValue(MaxConcurrency.Value);
     }
     if (Optional.IsDefined(MinRetryIntervalInSeconds))
     {
         writer.WritePropertyName("minRetryIntervalInSeconds");
         writer.WriteNumberValue(MinRetryIntervalInSeconds.Value);
     }
     if (Optional.IsDefined(StopRetryAfterInSeconds))
     {
         writer.WritePropertyName("stopRetryAfterInSeconds");
         writer.WriteNumberValue(StopRetryAfterInSeconds.Value);
     }
     if (Optional.IsDefined(NeedRollup))
     {
         writer.WritePropertyName("needRollup");
         writer.WriteStringValue(NeedRollup.Value.ToString());
     }
     if (Optional.IsDefined(RollUpMethod))
     {
         writer.WritePropertyName("rollUpMethod");
         writer.WriteStringValue(RollUpMethod.Value.ToString());
     }
     if (Optional.IsCollectionDefined(RollUpColumns))
     {
         writer.WritePropertyName("rollUpColumns");
         writer.WriteStartArray();
         foreach (var item in RollUpColumns)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsDefined(AllUpIdentification))
     {
         writer.WritePropertyName("allUpIdentification");
         writer.WriteStringValue(AllUpIdentification);
     }
     if (Optional.IsDefined(FillMissingPointType))
     {
         writer.WritePropertyName("fillMissingPointType");
         writer.WriteStringValue(FillMissingPointType.Value.ToString());
     }
     if (Optional.IsDefined(FillMissingPointValue))
     {
         writer.WritePropertyName("fillMissingPointValue");
         writer.WriteNumberValue(FillMissingPointValue.Value);
     }
     if (Optional.IsDefined(ViewMode))
     {
         writer.WritePropertyName("viewMode");
         writer.WriteStringValue(ViewMode.Value.ToString());
     }
     if (Optional.IsCollectionDefined(Admins))
     {
         writer.WritePropertyName("admins");
         writer.WriteStartArray();
         foreach (var item in Admins)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(Viewers))
     {
         writer.WritePropertyName("viewers");
         writer.WriteStartArray();
         foreach (var item in Viewers)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsDefined(ActionLinkTemplate))
     {
         writer.WritePropertyName("actionLinkTemplate");
         writer.WriteStringValue(ActionLinkTemplate);
     }
     writer.WriteEndObject();
 }
Esempio n. 4
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("type");
     writer.WriteStringValue(Type);
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsDefined(Structure))
     {
         writer.WritePropertyName("structure");
         writer.WriteObjectValue(Structure);
     }
     if (Optional.IsDefined(Schema))
     {
         writer.WritePropertyName("schema");
         writer.WriteObjectValue(Schema);
     }
     writer.WritePropertyName("linkedServiceName");
     writer.WriteObjectValue(LinkedServiceName);
     if (Optional.IsCollectionDefined(Parameters))
     {
         writer.WritePropertyName("parameters");
         writer.WriteStartObject();
         foreach (var item in Parameters)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteObjectValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsCollectionDefined(Annotations))
     {
         writer.WritePropertyName("annotations");
         writer.WriteStartArray();
         foreach (var item in Annotations)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsDefined(Folder))
     {
         writer.WritePropertyName("folder");
         writer.WriteObjectValue(Folder);
     }
     writer.WritePropertyName("typeProperties");
     writer.WriteStartObject();
     if (Optional.IsDefined(TableName))
     {
         writer.WritePropertyName("tableName");
         writer.WriteObjectValue(TableName);
     }
     if (Optional.IsDefined(SchemaTypePropertiesSchema))
     {
         writer.WritePropertyName("schema");
         writer.WriteObjectValue(SchemaTypePropertiesSchema);
     }
     if (Optional.IsDefined(Table))
     {
         writer.WritePropertyName("table");
         writer.WriteObjectValue(Table);
     }
     writer.WriteEndObject();
     foreach (var item in AdditionalProperties)
     {
         writer.WritePropertyName(item.Key);
         writer.WriteObjectValue(item.Value);
     }
     writer.WriteEndObject();
 }
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }

            if (!string.IsNullOrEmpty(ResourceType))
            {
                writer.WriteString("resourceType", (string)ResourceType !);
            }


            ((Fhir.R4.Models.DomainResource) this).SerializeJson(writer, options, false);

            if ((Identifier != null) && (Identifier.Count != 0))
            {
                writer.WritePropertyName("identifier");
                writer.WriteStartArray();

                foreach (Identifier valIdentifier in Identifier)
                {
                    valIdentifier.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (Active != null)
            {
                writer.WriteBoolean("active", (bool)Active !);
            }

            if (Period != null)
            {
                writer.WritePropertyName("period");
                Period.SerializeJson(writer, options);
            }

            if (Organization != null)
            {
                writer.WritePropertyName("organization");
                Organization.SerializeJson(writer, options);
            }

            if (ParticipatingOrganization != null)
            {
                writer.WritePropertyName("participatingOrganization");
                ParticipatingOrganization.SerializeJson(writer, options);
            }

            if ((Network != null) && (Network.Count != 0))
            {
                writer.WritePropertyName("network");
                writer.WriteStartArray();

                foreach (Reference valNetwork in Network)
                {
                    valNetwork.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((Code != null) && (Code.Count != 0))
            {
                writer.WritePropertyName("code");
                writer.WriteStartArray();

                foreach (CodeableConcept valCode in Code)
                {
                    valCode.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((Specialty != null) && (Specialty.Count != 0))
            {
                writer.WritePropertyName("specialty");
                writer.WriteStartArray();

                foreach (CodeableConcept valSpecialty in Specialty)
                {
                    valSpecialty.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((Location != null) && (Location.Count != 0))
            {
                writer.WritePropertyName("location");
                writer.WriteStartArray();

                foreach (Reference valLocation in Location)
                {
                    valLocation.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((HealthcareService != null) && (HealthcareService.Count != 0))
            {
                writer.WritePropertyName("healthcareService");
                writer.WriteStartArray();

                foreach (Reference valHealthcareService in HealthcareService)
                {
                    valHealthcareService.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((Telecom != null) && (Telecom.Count != 0))
            {
                writer.WritePropertyName("telecom");
                writer.WriteStartArray();

                foreach (ContactPoint valTelecom in Telecom)
                {
                    valTelecom.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((Endpoint != null) && (Endpoint.Count != 0))
            {
                writer.WritePropertyName("endpoint");
                writer.WriteStartArray();

                foreach (Reference valEndpoint in Endpoint)
                {
                    valEndpoint.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("type");
     writer.WriteStringValue(Type);
     if (Optional.IsDefined(ConnectVia))
     {
         writer.WritePropertyName("connectVia");
         writer.WriteObjectValue(ConnectVia);
     }
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsCollectionDefined(Parameters))
     {
         writer.WritePropertyName("parameters");
         writer.WriteStartObject();
         foreach (var item in Parameters)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteObjectValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsCollectionDefined(Annotations))
     {
         writer.WritePropertyName("annotations");
         writer.WriteStartArray();
         foreach (var item in Annotations)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     writer.WritePropertyName("typeProperties");
     writer.WriteStartObject();
     writer.WritePropertyName("url");
     writer.WriteObjectValue(Url);
     if (Optional.IsDefined(AccountKey))
     {
         writer.WritePropertyName("accountKey");
         writer.WriteObjectValue(AccountKey);
     }
     if (Optional.IsDefined(ServicePrincipalId))
     {
         writer.WritePropertyName("servicePrincipalId");
         writer.WriteObjectValue(ServicePrincipalId);
     }
     if (Optional.IsDefined(ServicePrincipalKey))
     {
         writer.WritePropertyName("servicePrincipalKey");
         writer.WriteObjectValue(ServicePrincipalKey);
     }
     if (Optional.IsDefined(Tenant))
     {
         writer.WritePropertyName("tenant");
         writer.WriteObjectValue(Tenant);
     }
     if (Optional.IsDefined(AzureCloudType))
     {
         writer.WritePropertyName("azureCloudType");
         writer.WriteObjectValue(AzureCloudType);
     }
     if (Optional.IsDefined(ServicePrincipalCredentialType))
     {
         writer.WritePropertyName("servicePrincipalCredentialType");
         writer.WriteObjectValue(ServicePrincipalCredentialType);
     }
     if (Optional.IsDefined(ServicePrincipalCredential))
     {
         writer.WritePropertyName("servicePrincipalCredential");
         writer.WriteObjectValue(ServicePrincipalCredential);
     }
     if (Optional.IsDefined(EncryptedCredential))
     {
         writer.WritePropertyName("encryptedCredential");
         writer.WriteObjectValue(EncryptedCredential);
     }
     writer.WriteEndObject();
     foreach (var item in AdditionalProperties)
     {
         writer.WritePropertyName(item.Key);
         writer.WriteObjectValue(item.Value);
     }
     writer.WriteEndObject();
 }
        private static void WriteValue(Utf8JsonWriter writer, object value, JsonSerializerOptions options)
        {
            switch (value)
            {
            case null:
            {
                writer.WriteNullValue();
                break;
            }

            case string s:
            {
                writer.WriteStringValue(s);
                break;
            }

            case bool b:
            {
                writer.WriteBooleanValue(b);
                break;
            }

            case int i:
            {
                writer.WriteNumberValue(i);
                break;
            }

            case long l:
            {
                writer.WriteNumberValue(l);
                break;
            }

            case float f:
            {
                writer.WriteNumberValue(f);
                break;
            }

            case double d:
            {
                writer.WriteNumberValue(d);
                break;
            }

            case decimal dm:
            {
                writer.WriteNumberValue(dm);
                break;
            }

            case uint ui:
            {
                writer.WriteNumberValue(ui);
                break;
            }

            case ulong ul:
            {
                writer.WriteNumberValue(ul);
                break;
            }

            case Dictionary <string, object> dictionary:
            {
                writer.WriteStartObject();

                foreach (var kvp in dictionary)
                {
                    WriteProperty(writer, kvp.Key, kvp.Value, options);
                }

                writer.WriteEndObject();

                break;
            }

            case List <object> list:
            {
                writer.WriteStartArray();

                foreach (object item in list)
                {
                    WriteValue(writer, item, options);
                }

                writer.WriteEndArray();

                break;
            }

            default:
            {
                // Need to avoid this call by all means! The question remains open - why this API so expensive?
                JsonSerializer.Serialize(writer, value, options);
                break;
            }
            }
        }
Esempio n. 8
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("type");
     writer.WriteStringValue(Type);
     if (ConnectVia != null)
     {
         writer.WritePropertyName("connectVia");
         writer.WriteObjectValue(ConnectVia);
     }
     if (Description != null)
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Parameters != null)
     {
         writer.WritePropertyName("parameters");
         writer.WriteStartObject();
         foreach (var item in Parameters)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteObjectValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Annotations != null)
     {
         writer.WritePropertyName("annotations");
         writer.WriteStartArray();
         foreach (var item in Annotations)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     writer.WritePropertyName("typeProperties");
     writer.WriteStartObject();
     writer.WritePropertyName("connectionString");
     writer.WriteObjectValue(ConnectionString);
     if (AuthenticationType != null)
     {
         writer.WritePropertyName("authenticationType");
         writer.WriteObjectValue(AuthenticationType);
     }
     if (Credential != null)
     {
         writer.WritePropertyName("credential");
         writer.WriteObjectValue(Credential);
     }
     if (UserName != null)
     {
         writer.WritePropertyName("userName");
         writer.WriteObjectValue(UserName);
     }
     if (Password != null)
     {
         writer.WritePropertyName("password");
         writer.WriteObjectValue(Password);
     }
     if (EncryptedCredential != null)
     {
         writer.WritePropertyName("encryptedCredential");
         writer.WriteObjectValue(EncryptedCredential);
     }
     writer.WriteEndObject();
     foreach (var item in AdditionalProperties)
     {
         writer.WritePropertyName(item.Key);
         writer.WriteObjectValue(item.Value);
     }
     writer.WriteEndObject();
 }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     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(Protocols))
     {
         writer.WritePropertyName("protocols");
         writer.WriteStartArray();
         foreach (var item in Protocols)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(TargetUrls))
     {
         writer.WritePropertyName("targetUrls");
         writer.WriteStartArray();
         foreach (var item in TargetUrls)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(TargetFqdns))
     {
         writer.WritePropertyName("targetFqdns");
         writer.WriteStartArray();
         foreach (var item in TargetFqdns)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(FqdnTags))
     {
         writer.WritePropertyName("fqdnTags");
         writer.WriteStartArray();
         foreach (var item in FqdnTags)
         {
             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(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. 10
0
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }

            if (!string.IsNullOrEmpty(ResourceType))
            {
                writer.WriteString("resourceType", (string)ResourceType !);
            }


            ((Fhir.R4.Models.DomainResource) this).SerializeJson(writer, options, false);

            if ((Identifier != null) && (Identifier.Count != 0))
            {
                writer.WritePropertyName("identifier");
                writer.WriteStartArray();

                foreach (Identifier valIdentifier in Identifier)
                {
                    valIdentifier.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (AccessionIdentifier != null)
            {
                writer.WritePropertyName("accessionIdentifier");
                AccessionIdentifier.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(Status))
            {
                writer.WriteString("status", (string)Status !);
            }

            if (_Status != null)
            {
                writer.WritePropertyName("_status");
                _Status.SerializeJson(writer, options);
            }

            if (Type != null)
            {
                writer.WritePropertyName("type");
                Type.SerializeJson(writer, options);
            }

            if (Subject != null)
            {
                writer.WritePropertyName("subject");
                Subject.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(ReceivedTime))
            {
                writer.WriteString("receivedTime", (string)ReceivedTime !);
            }

            if (_ReceivedTime != null)
            {
                writer.WritePropertyName("_receivedTime");
                _ReceivedTime.SerializeJson(writer, options);
            }

            if ((Parent != null) && (Parent.Count != 0))
            {
                writer.WritePropertyName("parent");
                writer.WriteStartArray();

                foreach (Reference valParent in Parent)
                {
                    valParent.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((Request != null) && (Request.Count != 0))
            {
                writer.WritePropertyName("request");
                writer.WriteStartArray();

                foreach (Reference valRequest in Request)
                {
                    valRequest.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (Collection != null)
            {
                writer.WritePropertyName("collection");
                Collection.SerializeJson(writer, options);
            }

            if ((Processing != null) && (Processing.Count != 0))
            {
                writer.WritePropertyName("processing");
                writer.WriteStartArray();

                foreach (SpecimenProcessing valProcessing in Processing)
                {
                    valProcessing.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((Container != null) && (Container.Count != 0))
            {
                writer.WritePropertyName("container");
                writer.WriteStartArray();

                foreach (SpecimenContainer valContainer in Container)
                {
                    valContainer.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((Condition != null) && (Condition.Count != 0))
            {
                writer.WritePropertyName("condition");
                writer.WriteStartArray();

                foreach (CodeableConcept valCondition in Condition)
                {
                    valCondition.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((Note != null) && (Note.Count != 0))
            {
                writer.WritePropertyName("note");
                writer.WriteStartArray();

                foreach (Annotation valNote in Note)
                {
                    valNote.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Esempio n. 11
0
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }

            ((Fhir.R4.Models.BackboneElement) this).SerializeJson(writer, options, false);

            if ((Identifier != null) && (Identifier.Count != 0))
            {
                writer.WritePropertyName("identifier");
                writer.WriteStartArray();

                foreach (Identifier valIdentifier in Identifier)
                {
                    valIdentifier.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (!string.IsNullOrEmpty(Description))
            {
                writer.WriteString("description", (string)Description !);
            }

            if (_Description != null)
            {
                writer.WritePropertyName("_description");
                _Description.SerializeJson(writer, options);
            }

            if (Type != null)
            {
                writer.WritePropertyName("type");
                Type.SerializeJson(writer, options);
            }

            if (Capacity != null)
            {
                writer.WritePropertyName("capacity");
                Capacity.SerializeJson(writer, options);
            }

            if (SpecimenQuantity != null)
            {
                writer.WritePropertyName("specimenQuantity");
                SpecimenQuantity.SerializeJson(writer, options);
            }

            if (AdditiveCodeableConcept != null)
            {
                writer.WritePropertyName("additiveCodeableConcept");
                AdditiveCodeableConcept.SerializeJson(writer, options);
            }

            if (AdditiveReference != null)
            {
                writer.WritePropertyName("additiveReference");
                AdditiveReference.SerializeJson(writer, options);
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }

            ((Fhir.R4.Models.BackboneElement) this).SerializeJson(writer, options, false);

            if (!string.IsNullOrEmpty(Description))
            {
                writer.WriteString("description", (string)Description !);
            }

            if (_Description != null)
            {
                writer.WritePropertyName("_description");
                _Description.SerializeJson(writer, options);
            }

            if (Procedure != null)
            {
                writer.WritePropertyName("procedure");
                Procedure.SerializeJson(writer, options);
            }

            if ((Additive != null) && (Additive.Count != 0))
            {
                writer.WritePropertyName("additive");
                writer.WriteStartArray();

                foreach (Reference valAdditive in Additive)
                {
                    valAdditive.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (!string.IsNullOrEmpty(TimeDateTime))
            {
                writer.WriteString("timeDateTime", (string)TimeDateTime !);
            }

            if (_TimeDateTime != null)
            {
                writer.WritePropertyName("_timeDateTime");
                _TimeDateTime.SerializeJson(writer, options);
            }

            if (TimePeriod != null)
            {
                writer.WritePropertyName("timePeriod");
                TimePeriod.SerializeJson(writer, options);
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Esempio n. 13
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x8602 value = new JT808_0x8602();

            value.SettingAreaProperty = reader.ReadByte();
            writer.WriteNumber($"[{ value.SettingAreaProperty.ReadNumber()}]设置属性", value.SettingAreaProperty);
            value.AreaCount = reader.ReadByte();
            writer.WriteNumber($"[{ value.AreaCount.ReadNumber()}]区域总数", value.AreaCount);
            writer.WriteStartArray("区域项");
            for (var i = 0; i < value.AreaCount; i++)
            {
                writer.WriteStartObject();
                JT808RectangleAreaProperty areaProperty = new JT808RectangleAreaProperty();
                areaProperty.AreaId = reader.ReadUInt32();
                writer.WriteNumber($"[{areaProperty.AreaId.ReadNumber()}]区域ID", areaProperty.AreaId);
                areaProperty.AreaProperty = reader.ReadUInt16();
                ReadOnlySpan <char> areaPropertyBits = Convert.ToString(areaProperty.AreaProperty, 2).PadLeft(16, '0').AsSpan();
                writer.WriteStartObject($"区域属性对象[{areaPropertyBits.ToString()}]");
                if (reader.Version == JT808Version.JTT2019)
                {
                    writer.WriteString($"[bit15]{areaPropertyBits[15]}", areaPropertyBits[15] == '0' ? "进区域不采集GNSS详细定位数据" : "进区域采集GNSS详细定位数据");
                    writer.WriteString($"[bit14]{areaPropertyBits[14]}", areaPropertyBits[14] == '0' ? "进区域开启通信模块" : "进区域关闭通信模块");
                    writer.WriteString("[bit9~bit13]保留", areaPropertyBits.Slice(9, 5));
                    writer.WriteString($"[bit8]{areaPropertyBits[8]}", areaPropertyBits[8] == '0' ? "允许开门" : "禁止开门");
                    writer.WriteString($"[bit7]{areaPropertyBits[7]}", areaPropertyBits[7] == '0' ? "东经" : "西经");
                    writer.WriteString($"[bit6]{areaPropertyBits[6]}", areaPropertyBits[6] == '0' ? "北纬" : "南纬");
                    writer.WriteString($"[bit5]出区域是否报警给平台-{areaPropertyBits[5]}", areaPropertyBits[5] == '0' ? "否" : "是");
                    writer.WriteString($"[bit4]出区域是否报警给平驾驶员-{areaPropertyBits[4]}", areaPropertyBits[4] == '0' ? "否" : "是");
                    writer.WriteString($"[bit3]进区域是否报警给平台-{areaPropertyBits[3]}", areaPropertyBits[3] == '0' ? "否" : "是");
                    writer.WriteString($"[bit2]进区域是否报警给驾驶员-{areaPropertyBits[2]}", areaPropertyBits[2] == '0' ? "否" : "是");
                    writer.WriteString($"[bit1]是否启用最高速度、超速持续时间和夜间最高速度的判断规则-{areaPropertyBits[1]}", areaPropertyBits[1] == '0' ? "否" : "是");
                    writer.WriteString($"[bit0]是否启用起始时间与结束时间的判断规则-{areaPropertyBits[0]}", areaPropertyBits[0] == '0' ? "否" : "是");
                }
                else
                {
                    writer.WriteString($"[bit15]{areaPropertyBits[15]}", areaPropertyBits[15] == '0' ? "进区域不采集GNSS详细定位数据" : "进区域采集GNSS详细定位数据");
                    writer.WriteString($"[bit14]{areaPropertyBits[14]}", areaPropertyBits[14] == '0' ? "进区域开启通信模块" : "进区域关闭通信模块");
                    writer.WriteString("[bit9~bit13]保留", areaPropertyBits.Slice(9, 5));
                    writer.WriteString($"[bit8]{areaPropertyBits[8]}", areaPropertyBits[8] == '0' ? "允许开门" : "禁止开门");
                    writer.WriteString($"[bit7]{areaPropertyBits[7]}", areaPropertyBits[7] == '0' ? "东经" : "西经");
                    writer.WriteString($"[bit6]{areaPropertyBits[6]}", areaPropertyBits[6] == '0' ? "北纬" : "南纬");
                    writer.WriteString($"[bit5]{areaPropertyBits[5]}", areaPropertyBits[5] == '1' ? "出区域报警给平台" : "无");
                    writer.WriteString($"[bit4]{areaPropertyBits[4]}", areaPropertyBits[4] == '1' ? "出区域报警给驾驶员" : "无");
                    writer.WriteString($"[bit3]{areaPropertyBits[3]}", areaPropertyBits[3] == '1' ? "进区域报警给平台" : "无");
                    writer.WriteString($"[bit2]{areaPropertyBits[2]}", areaPropertyBits[2] == '1' ? "进区域报警给驾驶员" : "无");
                    writer.WriteString($"[bit1]{areaPropertyBits[1]}", areaPropertyBits[1] == '1' ? "限速" : "无");
                    writer.WriteString($"[bit0]{areaPropertyBits[0]}", areaPropertyBits[0] == '1' ? "根据时间" : "无");
                }
                writer.WriteEndObject();

                writer.WriteNumber($"[{areaProperty.AreaProperty.ReadNumber()}]区域属性", areaProperty.AreaProperty);
                areaProperty.UpLeftPointLat = reader.ReadUInt32();
                writer.WriteNumber($"[{areaProperty.UpLeftPointLat.ReadNumber()}]左上点纬度", areaProperty.UpLeftPointLat);
                areaProperty.UpLeftPointLng = reader.ReadUInt32();
                writer.WriteNumber($"[{areaProperty.UpLeftPointLng.ReadNumber()}]左上点经度", areaProperty.UpLeftPointLng);
                areaProperty.LowRightPointLat = reader.ReadUInt32();
                writer.WriteNumber($"[{areaProperty.LowRightPointLat.ReadNumber()}]右下点纬度", areaProperty.LowRightPointLat);
                areaProperty.LowRightPointLng = reader.ReadUInt32();
                writer.WriteNumber($"[{areaProperty.LowRightPointLng.ReadNumber()}]右下点经度", areaProperty.LowRightPointLng);
                ReadOnlySpan <char> areaProperty16Bit = Convert.ToString(areaProperty.AreaProperty, 2).PadLeft(16, '0').AsSpan();
                bool bit0Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 1).ToString().Equals("0");
                if (!bit0Flag)
                {
                    areaProperty.StartTime = reader.ReadDateTime6();
                    writer.WriteString($"[{ areaProperty.StartTime.Value.ToString("yyMMddHHmmss")}]起始时间", areaProperty.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss"));
                    areaProperty.EndTime = reader.ReadDateTime6();
                    writer.WriteString($"[{ areaProperty.EndTime.Value.ToString("yyMMddHHmmss")}]起始时间", areaProperty.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss"));
                }
                bool bit1Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 2, 1).ToString().Equals("0");
                if (!bit1Flag)
                {
                    areaProperty.HighestSpeed = reader.ReadUInt16();
                    writer.WriteNumber($"[{areaProperty.HighestSpeed.Value.ReadNumber()}]最高速度", areaProperty.HighestSpeed.Value);
                    areaProperty.OverspeedDuration = reader.ReadByte();
                    writer.WriteNumber($"[{areaProperty.OverspeedDuration.Value.ReadNumber()}]超速持续时间", areaProperty.OverspeedDuration.Value);
                    if (reader.Version == JT808Version.JTT2019)
                    {
                        areaProperty.NightMaximumSpeed = reader.ReadUInt16();
                        writer.WriteNumber($"[{areaProperty.NightMaximumSpeed.ReadNumber()}]夜间最高速度", areaProperty.NightMaximumSpeed);
                    }
                }
                if (reader.Version == JT808Version.JTT2019)
                {
                    areaProperty.NameLength = reader.ReadUInt16();
                    writer.WriteNumber($"[{areaProperty.NameLength.ReadNumber()}]夜间最高速度", areaProperty.NameLength);
                    var areaNameBuffer = reader.ReadVirtualArray(areaProperty.NameLength);
                    areaProperty.AreaName = reader.ReadString(areaProperty.NameLength);
                    writer.WriteString($"[{ areaNameBuffer.ToArray().ToHexString()}]区域名称", areaProperty.AreaName);
                }
                writer.WriteEndObject();
            }
            writer.WriteEndArray();
        }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(Id))
     {
         writer.WritePropertyName("id");
         writer.WriteStringValue(Id);
     }
     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();
     if (Optional.IsDefined(Subnet))
     {
         writer.WritePropertyName("subnet");
         writer.WriteObjectValue(Subnet);
     }
     if (Optional.IsCollectionDefined(PrivateLinkServiceConnections))
     {
         writer.WritePropertyName("privateLinkServiceConnections");
         writer.WriteStartArray();
         foreach (var item in PrivateLinkServiceConnections)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(ManualPrivateLinkServiceConnections))
     {
         writer.WritePropertyName("manualPrivateLinkServiceConnections");
         writer.WriteStartArray();
         foreach (var item in ManualPrivateLinkServiceConnections)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(CustomDnsConfigs))
     {
         writer.WritePropertyName("customDnsConfigs");
         writer.WriteStartArray();
         foreach (var item in CustomDnsConfigs)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     writer.WriteEndObject();
     writer.WriteEndObject();
 }
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }

            if (!string.IsNullOrEmpty(ResourceType))
            {
                writer.WriteString("resourceType", (string)ResourceType !);
            }


            ((Fhir.R4.Models.DomainResource) this).SerializeJson(writer, options, false);

            if (!string.IsNullOrEmpty(Comment))
            {
                writer.WriteString("comment", (string)Comment !);
            }

            if (_Comment != null)
            {
                writer.WritePropertyName("_comment");
                _Comment.SerializeJson(writer, options);
            }

            if ((Gene != null) && (Gene.Count != 0))
            {
                writer.WritePropertyName("gene");
                writer.WriteStartArray();

                foreach (SubstanceReferenceInformationGene valGene in Gene)
                {
                    valGene.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((GeneElement != null) && (GeneElement.Count != 0))
            {
                writer.WritePropertyName("geneElement");
                writer.WriteStartArray();

                foreach (SubstanceReferenceInformationGeneElement valGeneElement in GeneElement)
                {
                    valGeneElement.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((Classification != null) && (Classification.Count != 0))
            {
                writer.WritePropertyName("classification");
                writer.WriteStartArray();

                foreach (SubstanceReferenceInformationClassification valClassification in Classification)
                {
                    valClassification.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((Target != null) && (Target.Count != 0))
            {
                writer.WritePropertyName("target");
                writer.WriteStartArray();

                foreach (SubstanceReferenceInformationTarget valTarget in Target)
                {
                    valTarget.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Esempio n. 16
0
 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);
     }
     if (Optional.IsDefined(Protocol))
     {
         writer.WritePropertyName("protocol");
         writer.WriteStringValue(Protocol.Value.ToString());
     }
     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.IsCollectionDefined(DestinationIpGroups))
     {
         writer.WritePropertyName("destinationIpGroups");
         writer.WriteStartArray();
         foreach (var item in DestinationIpGroups)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     writer.WriteEndObject();
 }
Esempio n. 17
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(LinkedServiceName))
     {
         writer.WritePropertyName("linkedServiceName");
         writer.WriteObjectValue(LinkedServiceName);
     }
     if (Optional.IsDefined(Policy))
     {
         writer.WritePropertyName("policy");
         writer.WriteObjectValue(Policy);
     }
     writer.WritePropertyName("name");
     writer.WriteStringValue(Name);
     writer.WritePropertyName("type");
     writer.WriteStringValue(Type);
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsCollectionDefined(DependsOn))
     {
         writer.WritePropertyName("dependsOn");
         writer.WriteStartArray();
         foreach (var item in DependsOn)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(UserProperties))
     {
         writer.WritePropertyName("userProperties");
         writer.WriteStartArray();
         foreach (var item in UserProperties)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     writer.WritePropertyName("typeProperties");
     writer.WriteStartObject();
     if (Optional.IsDefined(Recursive))
     {
         writer.WritePropertyName("recursive");
         writer.WriteObjectValue(Recursive);
     }
     if (Optional.IsDefined(MaxConcurrentConnections))
     {
         writer.WritePropertyName("maxConcurrentConnections");
         writer.WriteNumberValue(MaxConcurrentConnections.Value);
     }
     if (Optional.IsDefined(EnableLogging))
     {
         writer.WritePropertyName("enableLogging");
         writer.WriteObjectValue(EnableLogging);
     }
     if (Optional.IsDefined(LogStorageSettings))
     {
         writer.WritePropertyName("logStorageSettings");
         writer.WriteObjectValue(LogStorageSettings);
     }
     writer.WritePropertyName("dataset");
     writer.WriteObjectValue(Dataset);
     writer.WriteEndObject();
     foreach (var item in AdditionalProperties)
     {
         writer.WritePropertyName(item.Key);
         writer.WriteObjectValue(item.Value);
     }
     writer.WriteEndObject();
 }
Esempio n. 18
0
        public static void WriteObjectValue(this Utf8JsonWriter writer, object value)
        {
            switch (value)
            {
            case null:
                writer.WriteNullValue();
                break;

            case IUtf8JsonSerializable serializable:
                writer.WriteObjectValue(serializable);
                break;

            case byte[] bytes:
                writer.WriteStringValue(Convert.ToBase64String(bytes));
                break;

            case int i:
                writer.WriteNumberValue(i);
                break;

            case decimal d:
                writer.WriteNumberValue(d);
                break;

            case double d:
                writer.WriteNumberValue(d);
                break;

            case float f:
                writer.WriteNumberValue(f);
                break;

            case long l:
                writer.WriteNumberValue(l);
                break;

            case string s:
                writer.WriteStringValue(s);
                break;

            case bool b:
                writer.WriteBooleanValue(b);
                break;

            case Guid g:
                writer.WriteStringValue(g);
                break;

            case DateTimeOffset dateTimeOffset:
                writer.WriteStringValue(dateTimeOffset, "O");
                break;

            case DateTime dateTime:
                writer.WriteStringValue(dateTime, "O");
                break;

            case IEnumerable <KeyValuePair <string, object> > enumerable:
                writer.WriteStartObject();
                foreach (KeyValuePair <string, object> pair in enumerable)
                {
                    writer.WritePropertyName(pair.Key);
                    writer.WriteObjectValue(pair.Value);
                }
                writer.WriteEndObject();
                break;

            case IEnumerable <object> objectEnumerable:
                writer.WriteStartArray();
                foreach (object item in objectEnumerable)
                {
                    writer.WriteObjectValue(item);
                }
                writer.WriteEndArray();
                break;

            default:
                throw new NotSupportedException("Not supported type " + value.GetType());
            }
        }
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }
            if (!string.IsNullOrEmpty(ResourceType))
            {
                writer.WriteString("resourceType", (string)ResourceType !);
            }


            ((fhirCsR4.Models.DomainResource) this).SerializeJson(writer, options, false);

            if ((Identifier != null) && (Identifier.Count != 0))
            {
                writer.WritePropertyName("identifier");
                writer.WriteStartArray();

                foreach (Identifier valIdentifier in Identifier)
                {
                    valIdentifier.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (!string.IsNullOrEmpty(Status))
            {
                writer.WriteString("status", (string)Status !);
            }

            if (_Status != null)
            {
                writer.WritePropertyName("_status");
                _Status.SerializeJson(writer, options);
            }

            if (Period != null)
            {
                writer.WritePropertyName("period");
                Period.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(Created))
            {
                writer.WriteString("created", (string)Created !);
            }

            if (_Created != null)
            {
                writer.WritePropertyName("_created");
                _Created.SerializeJson(writer, options);
            }

            if (PaymentIssuer != null)
            {
                writer.WritePropertyName("paymentIssuer");
                PaymentIssuer.SerializeJson(writer, options);
            }

            if (Request != null)
            {
                writer.WritePropertyName("request");
                Request.SerializeJson(writer, options);
            }

            if (Requestor != null)
            {
                writer.WritePropertyName("requestor");
                Requestor.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(Outcome))
            {
                writer.WriteString("outcome", (string)Outcome !);
            }

            if (_Outcome != null)
            {
                writer.WritePropertyName("_outcome");
                _Outcome.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(Disposition))
            {
                writer.WriteString("disposition", (string)Disposition !);
            }

            if (_Disposition != null)
            {
                writer.WritePropertyName("_disposition");
                _Disposition.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(PaymentDate))
            {
                writer.WriteString("paymentDate", (string)PaymentDate !);
            }

            if (_PaymentDate != null)
            {
                writer.WritePropertyName("_paymentDate");
                _PaymentDate.SerializeJson(writer, options);
            }

            if (PaymentAmount != null)
            {
                writer.WritePropertyName("paymentAmount");
                PaymentAmount.SerializeJson(writer, options);
            }

            if (PaymentIdentifier != null)
            {
                writer.WritePropertyName("paymentIdentifier");
                PaymentIdentifier.SerializeJson(writer, options);
            }

            if ((Detail != null) && (Detail.Count != 0))
            {
                writer.WritePropertyName("detail");
                writer.WriteStartArray();

                foreach (PaymentReconciliationDetail valDetail in Detail)
                {
                    valDetail.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (FormCode != null)
            {
                writer.WritePropertyName("formCode");
                FormCode.SerializeJson(writer, options);
            }

            if ((ProcessNote != null) && (ProcessNote.Count != 0))
            {
                writer.WritePropertyName("processNote");
                writer.WriteStartArray();

                foreach (PaymentReconciliationProcessNote valProcessNote in ProcessNote)
                {
                    valProcessNote.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("type");
     writer.WriteStringValue(Type);
     if (ConnectVia != null)
     {
         writer.WritePropertyName("connectVia");
         writer.WriteObjectValue(ConnectVia);
     }
     if (Description != null)
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Parameters != null)
     {
         writer.WritePropertyName("parameters");
         writer.WriteStartObject();
         foreach (var item in Parameters)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteObjectValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Annotations != null)
     {
         writer.WritePropertyName("annotations");
         writer.WriteStartArray();
         foreach (var item in Annotations)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     writer.WritePropertyName("typeProperties");
     writer.WriteStartObject();
     writer.WritePropertyName("accountName");
     writer.WriteObjectValue(AccountName);
     if (AccessKey != null)
     {
         writer.WritePropertyName("accessKey");
         writer.WriteObjectValue(AccessKey);
     }
     writer.WritePropertyName("batchUri");
     writer.WriteObjectValue(BatchUri);
     writer.WritePropertyName("poolName");
     writer.WriteObjectValue(PoolName);
     writer.WritePropertyName("linkedServiceName");
     writer.WriteObjectValue(LinkedServiceName);
     if (EncryptedCredential != null)
     {
         writer.WritePropertyName("encryptedCredential");
         writer.WriteObjectValue(EncryptedCredential);
     }
     writer.WriteEndObject();
     foreach (var item in AdditionalProperties)
     {
         writer.WritePropertyName(item.Key);
         writer.WriteObjectValue(item.Value);
     }
     writer.WriteEndObject();
 }
Esempio n. 21
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Plan != null)
     {
         writer.WritePropertyName("plan");
         writer.WriteObjectValue(Plan);
     }
     if (Resources != null)
     {
         writer.WritePropertyName("resources");
         writer.WriteStartArray();
         foreach (var item in Resources)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Identity != null)
     {
         writer.WritePropertyName("identity");
         writer.WriteObjectValue(Identity);
     }
     if (Zones != null)
     {
         writer.WritePropertyName("zones");
         writer.WriteStartArray();
         foreach (var item in Zones)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     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);
     }
     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();
     if (HardwareProfile != null)
     {
         writer.WritePropertyName("hardwareProfile");
         writer.WriteObjectValue(HardwareProfile);
     }
     if (StorageProfile != null)
     {
         writer.WritePropertyName("storageProfile");
         writer.WriteObjectValue(StorageProfile);
     }
     if (AdditionalCapabilities != null)
     {
         writer.WritePropertyName("additionalCapabilities");
         writer.WriteObjectValue(AdditionalCapabilities);
     }
     if (OsProfile != null)
     {
         writer.WritePropertyName("osProfile");
         writer.WriteObjectValue(OsProfile);
     }
     if (NetworkProfile != null)
     {
         writer.WritePropertyName("networkProfile");
         writer.WriteObjectValue(NetworkProfile);
     }
     if (DiagnosticsProfile != null)
     {
         writer.WritePropertyName("diagnosticsProfile");
         writer.WriteObjectValue(DiagnosticsProfile);
     }
     if (AvailabilitySet != null)
     {
         writer.WritePropertyName("availabilitySet");
         writer.WriteObjectValue(AvailabilitySet);
     }
     if (VirtualMachineScaleSet != null)
     {
         writer.WritePropertyName("virtualMachineScaleSet");
         writer.WriteObjectValue(VirtualMachineScaleSet);
     }
     if (ProximityPlacementGroup != null)
     {
         writer.WritePropertyName("proximityPlacementGroup");
         writer.WriteObjectValue(ProximityPlacementGroup);
     }
     if (Priority != null)
     {
         writer.WritePropertyName("priority");
         writer.WriteStringValue(Priority.Value.ToString());
     }
     if (EvictionPolicy != null)
     {
         writer.WritePropertyName("evictionPolicy");
         writer.WriteStringValue(EvictionPolicy.Value.ToString());
     }
     if (BillingProfile != null)
     {
         writer.WritePropertyName("billingProfile");
         writer.WriteObjectValue(BillingProfile);
     }
     if (Host != null)
     {
         writer.WritePropertyName("host");
         writer.WriteObjectValue(Host);
     }
     if (ProvisioningState != null)
     {
         writer.WritePropertyName("provisioningState");
         writer.WriteStringValue(ProvisioningState);
     }
     if (InstanceView != null)
     {
         writer.WritePropertyName("instanceView");
         writer.WriteObjectValue(InstanceView);
     }
     if (LicenseType != null)
     {
         writer.WritePropertyName("licenseType");
         writer.WriteStringValue(LicenseType);
     }
     if (VmId != null)
     {
         writer.WritePropertyName("vmId");
         writer.WriteStringValue(VmId);
     }
     writer.WriteEndObject();
     writer.WriteEndObject();
 }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(Name))
     {
         writer.WritePropertyName("name");
         writer.WriteStringValue(Name);
     }
     writer.WritePropertyName("file");
     writer.WriteStringValue(File);
     if (Optional.IsDefined(ClassName))
     {
         writer.WritePropertyName("className");
         writer.WriteStringValue(ClassName);
     }
     if (Optional.IsDefined(Conf))
     {
         writer.WritePropertyName("conf");
         writer.WriteObjectValue(Conf);
     }
     if (Optional.IsCollectionDefined(Args))
     {
         writer.WritePropertyName("args");
         writer.WriteStartArray();
         foreach (var item in Args)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(Jars))
     {
         writer.WritePropertyName("jars");
         writer.WriteStartArray();
         foreach (var item in Jars)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(Files))
     {
         writer.WritePropertyName("files");
         writer.WriteStartArray();
         foreach (var item in Files)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(Archives))
     {
         writer.WritePropertyName("archives");
         writer.WriteStartArray();
         foreach (var item in Archives)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     writer.WritePropertyName("driverMemory");
     writer.WriteStringValue(DriverMemory);
     writer.WritePropertyName("driverCores");
     writer.WriteNumberValue(DriverCores);
     writer.WritePropertyName("executorMemory");
     writer.WriteStringValue(ExecutorMemory);
     writer.WritePropertyName("executorCores");
     writer.WriteNumberValue(ExecutorCores);
     writer.WritePropertyName("numExecutors");
     writer.WriteNumberValue(NumExecutors);
     foreach (var item in AdditionalProperties)
     {
         writer.WritePropertyName(item.Key);
         writer.WriteObjectValue(item.Value);
     }
     writer.WriteEndObject();
 }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(LinkedServiceName))
     {
         writer.WritePropertyName("linkedServiceName");
         writer.WriteObjectValue(LinkedServiceName);
     }
     if (Optional.IsDefined(Policy))
     {
         writer.WritePropertyName("policy");
         writer.WriteObjectValue(Policy);
     }
     writer.WritePropertyName("name");
     writer.WriteStringValue(Name);
     writer.WritePropertyName("type");
     writer.WriteStringValue(Type);
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsCollectionDefined(DependsOn))
     {
         writer.WritePropertyName("dependsOn");
         writer.WriteStartArray();
         foreach (var item in DependsOn)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(UserProperties))
     {
         writer.WritePropertyName("userProperties");
         writer.WriteStartArray();
         foreach (var item in UserProperties)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     writer.WritePropertyName("typeProperties");
     writer.WriteStartObject();
     if (Optional.IsDefined(Dataflow))
     {
         writer.WritePropertyName("dataflow");
         writer.WriteObjectValue(Dataflow);
     }
     if (Optional.IsDefined(Staging))
     {
         writer.WritePropertyName("staging");
         writer.WriteObjectValue(Staging);
     }
     if (Optional.IsDefined(IntegrationRuntime))
     {
         writer.WritePropertyName("integrationRuntime");
         writer.WriteObjectValue(IntegrationRuntime);
     }
     if (Optional.IsDefined(Compute))
     {
         writer.WritePropertyName("compute");
         writer.WriteObjectValue(Compute);
     }
     if (Optional.IsDefined(TraceLevel))
     {
         writer.WritePropertyName("traceLevel");
         writer.WriteObjectValue(TraceLevel);
     }
     if (Optional.IsDefined(ContinueOnError))
     {
         writer.WritePropertyName("continueOnError");
         writer.WriteObjectValue(ContinueOnError);
     }
     if (Optional.IsDefined(RunConcurrently))
     {
         writer.WritePropertyName("runConcurrently");
         writer.WriteObjectValue(RunConcurrently);
     }
     writer.WriteEndObject();
     foreach (var item in AdditionalProperties)
     {
         writer.WritePropertyName(item.Key);
         writer.WriteObjectValue(item.Value);
     }
     writer.WriteEndObject();
 }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (AllowGuestsSignIn != null)
     {
         writer.WritePropertyName("allowGuestsSignIn");
         writer.WriteBooleanValue(AllowGuestsSignIn.Value);
     }
     if (AllowPassthroughUsers != null)
     {
         writer.WritePropertyName("allowPassthroughUsers");
         writer.WriteBooleanValue(AllowPassthroughUsers.Value);
     }
     if (AppLogoUrl != null)
     {
         writer.WritePropertyName("appLogoUrl");
         writer.WriteStringValue(AppLogoUrl);
     }
     if (AppRoles != null)
     {
         writer.WritePropertyName("appRoles");
         writer.WriteStartArray();
         foreach (var item in AppRoles)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (AppPermissions != null)
     {
         writer.WritePropertyName("appPermissions");
         writer.WriteStartArray();
         foreach (var item in AppPermissions)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (AvailableToOtherTenants != null)
     {
         writer.WritePropertyName("availableToOtherTenants");
         writer.WriteBooleanValue(AvailableToOtherTenants.Value);
     }
     if (ErrorUrl != null)
     {
         writer.WritePropertyName("errorUrl");
         writer.WriteStringValue(ErrorUrl);
     }
     if (GroupMembershipClaims != null)
     {
         writer.WritePropertyName("groupMembershipClaims");
         writer.WriteStringValue(GroupMembershipClaims.Value.ToString());
     }
     if (Homepage != null)
     {
         writer.WritePropertyName("homepage");
         writer.WriteStringValue(Homepage);
     }
     if (InformationalUrls != null)
     {
         writer.WritePropertyName("informationalUrls");
         writer.WriteObjectValue(InformationalUrls);
     }
     if (IsDeviceOnlyAuthSupported != null)
     {
         writer.WritePropertyName("isDeviceOnlyAuthSupported");
         writer.WriteBooleanValue(IsDeviceOnlyAuthSupported.Value);
     }
     if (KeyCredentials != null)
     {
         writer.WritePropertyName("keyCredentials");
         writer.WriteStartArray();
         foreach (var item in KeyCredentials)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (KnownClientApplications != null)
     {
         writer.WritePropertyName("knownClientApplications");
         writer.WriteStartArray();
         foreach (var item in KnownClientApplications)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (LogoutUrl != null)
     {
         writer.WritePropertyName("logoutUrl");
         writer.WriteStringValue(LogoutUrl);
     }
     if (Oauth2AllowImplicitFlow != null)
     {
         writer.WritePropertyName("oauth2AllowImplicitFlow");
         writer.WriteBooleanValue(Oauth2AllowImplicitFlow.Value);
     }
     if (Oauth2AllowUrlPathMatching != null)
     {
         writer.WritePropertyName("oauth2AllowUrlPathMatching");
         writer.WriteBooleanValue(Oauth2AllowUrlPathMatching.Value);
     }
     if (Oauth2Permissions != null)
     {
         writer.WritePropertyName("oauth2Permissions");
         writer.WriteStartArray();
         foreach (var item in Oauth2Permissions)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Oauth2RequirePostResponse != null)
     {
         writer.WritePropertyName("oauth2RequirePostResponse");
         writer.WriteBooleanValue(Oauth2RequirePostResponse.Value);
     }
     if (OrgRestrictions != null)
     {
         writer.WritePropertyName("orgRestrictions");
         writer.WriteStartArray();
         foreach (var item in OrgRestrictions)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (OptionalClaims != null)
     {
         writer.WritePropertyName("optionalClaims");
         writer.WriteObjectValue(OptionalClaims);
     }
     if (PasswordCredentials != null)
     {
         writer.WritePropertyName("passwordCredentials");
         writer.WriteStartArray();
         foreach (var item in PasswordCredentials)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (PreAuthorizedApplications != null)
     {
         writer.WritePropertyName("preAuthorizedApplications");
         writer.WriteStartArray();
         foreach (var item in PreAuthorizedApplications)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (PublicClient != null)
     {
         writer.WritePropertyName("publicClient");
         writer.WriteBooleanValue(PublicClient.Value);
     }
     if (PublisherDomain != null)
     {
         writer.WritePropertyName("publisherDomain");
         writer.WriteStringValue(PublisherDomain);
     }
     if (ReplyUrls != null)
     {
         writer.WritePropertyName("replyUrls");
         writer.WriteStartArray();
         foreach (var item in ReplyUrls)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (RequiredResourceAccess != null)
     {
         writer.WritePropertyName("requiredResourceAccess");
         writer.WriteStartArray();
         foreach (var item in RequiredResourceAccess)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (SamlMetadataUrl != null)
     {
         writer.WritePropertyName("samlMetadataUrl");
         writer.WriteStringValue(SamlMetadataUrl);
     }
     if (SignInAudience != null)
     {
         writer.WritePropertyName("signInAudience");
         writer.WriteStringValue(SignInAudience);
     }
     if (WwwHomepage != null)
     {
         writer.WritePropertyName("wwwHomepage");
         writer.WriteStringValue(WwwHomepage);
     }
     writer.WriteEndObject();
 }
Esempio n. 25
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsCollectionDefined(Zones))
     {
         writer.WritePropertyName("zones");
         writer.WriteStartArray();
         foreach (var item in Zones)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsDefined(Id))
     {
         writer.WritePropertyName("id");
         writer.WriteStringValue(Id);
     }
     if (Optional.IsDefined(Location))
     {
         writer.WritePropertyName("location");
         writer.WriteStringValue(Location.Value);
     }
     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();
     if (Optional.IsCollectionDefined(ApplicationRuleCollections))
     {
         writer.WritePropertyName("applicationRuleCollections");
         writer.WriteStartArray();
         foreach (var item in ApplicationRuleCollections)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(NatRuleCollections))
     {
         writer.WritePropertyName("natRuleCollections");
         writer.WriteStartArray();
         foreach (var item in NatRuleCollections)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(NetworkRuleCollections))
     {
         writer.WritePropertyName("networkRuleCollections");
         writer.WriteStartArray();
         foreach (var item in NetworkRuleCollections)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(IPConfigurations))
     {
         writer.WritePropertyName("ipConfigurations");
         writer.WriteStartArray();
         foreach (var item in IPConfigurations)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsDefined(ManagementIPConfiguration))
     {
         writer.WritePropertyName("managementIpConfiguration");
         writer.WriteObjectValue(ManagementIPConfiguration);
     }
     if (Optional.IsDefined(ThreatIntelMode))
     {
         writer.WritePropertyName("threatIntelMode");
         writer.WriteStringValue(ThreatIntelMode.Value.ToString());
     }
     if (Optional.IsDefined(VirtualHub))
     {
         writer.WritePropertyName("virtualHub");
         JsonSerializer.Serialize(writer, VirtualHub);
     }
     if (Optional.IsDefined(FirewallPolicy))
     {
         writer.WritePropertyName("firewallPolicy");
         JsonSerializer.Serialize(writer, FirewallPolicy);
     }
     if (Optional.IsDefined(HubIPAddresses))
     {
         writer.WritePropertyName("hubIPAddresses");
         writer.WriteObjectValue(HubIPAddresses);
     }
     if (Optional.IsDefined(Sku))
     {
         writer.WritePropertyName("sku");
         writer.WriteObjectValue(Sku);
     }
     if (Optional.IsCollectionDefined(AdditionalProperties))
     {
         writer.WritePropertyName("additionalProperties");
         writer.WriteStartObject();
         foreach (var item in AdditionalProperties)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteStringValue(item.Value);
         }
         writer.WriteEndObject();
     }
     writer.WriteEndObject();
     writer.WriteEndObject();
 }
Esempio n. 26
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(Name))
     {
         writer.WritePropertyName("name");
         writer.WriteStringValue(Name);
     }
     if (Optional.IsCollectionDefined(DaysOfWeek))
     {
         writer.WritePropertyName("daysOfWeek");
         writer.WriteStartArray();
         foreach (var item in DaysOfWeek)
         {
             writer.WriteStringValue(item.ToString());
         }
         writer.WriteEndArray();
     }
     if (Optional.IsDefined(RampUpStartTime))
     {
         writer.WritePropertyName("rampUpStartTime");
         writer.WriteStringValue(RampUpStartTime.Value, "O");
     }
     if (Optional.IsDefined(RampUpLoadBalancingAlgorithm))
     {
         writer.WritePropertyName("rampUpLoadBalancingAlgorithm");
         writer.WriteStringValue(RampUpLoadBalancingAlgorithm.Value.ToString());
     }
     if (Optional.IsDefined(RampUpMinimumHostsPct))
     {
         writer.WritePropertyName("rampUpMinimumHostsPct");
         writer.WriteNumberValue(RampUpMinimumHostsPct.Value);
     }
     if (Optional.IsDefined(RampUpCapacityThresholdPct))
     {
         writer.WritePropertyName("rampUpCapacityThresholdPct");
         writer.WriteNumberValue(RampUpCapacityThresholdPct.Value);
     }
     if (Optional.IsDefined(PeakStartTime))
     {
         writer.WritePropertyName("peakStartTime");
         writer.WriteStringValue(PeakStartTime.Value, "O");
     }
     if (Optional.IsDefined(PeakLoadBalancingAlgorithm))
     {
         writer.WritePropertyName("peakLoadBalancingAlgorithm");
         writer.WriteStringValue(PeakLoadBalancingAlgorithm.Value.ToString());
     }
     if (Optional.IsDefined(RampDownStartTime))
     {
         writer.WritePropertyName("rampDownStartTime");
         writer.WriteStringValue(RampDownStartTime.Value, "O");
     }
     if (Optional.IsDefined(RampDownLoadBalancingAlgorithm))
     {
         writer.WritePropertyName("rampDownLoadBalancingAlgorithm");
         writer.WriteStringValue(RampDownLoadBalancingAlgorithm.Value.ToString());
     }
     if (Optional.IsDefined(RampDownMinimumHostsPct))
     {
         writer.WritePropertyName("rampDownMinimumHostsPct");
         writer.WriteNumberValue(RampDownMinimumHostsPct.Value);
     }
     if (Optional.IsDefined(RampDownCapacityThresholdPct))
     {
         writer.WritePropertyName("rampDownCapacityThresholdPct");
         writer.WriteNumberValue(RampDownCapacityThresholdPct.Value);
     }
     if (Optional.IsDefined(RampDownForceLogoffUsers))
     {
         writer.WritePropertyName("rampDownForceLogoffUsers");
         writer.WriteBooleanValue(RampDownForceLogoffUsers.Value);
     }
     if (Optional.IsDefined(RampDownStopHostsWhen))
     {
         writer.WritePropertyName("rampDownStopHostsWhen");
         writer.WriteStringValue(RampDownStopHostsWhen.Value.ToString());
     }
     if (Optional.IsDefined(RampDownWaitTimeMinutes))
     {
         writer.WritePropertyName("rampDownWaitTimeMinutes");
         writer.WriteNumberValue(RampDownWaitTimeMinutes.Value);
     }
     if (Optional.IsDefined(RampDownNotificationMessage))
     {
         writer.WritePropertyName("rampDownNotificationMessage");
         writer.WriteStringValue(RampDownNotificationMessage);
     }
     if (Optional.IsDefined(OffPeakStartTime))
     {
         writer.WritePropertyName("offPeakStartTime");
         writer.WriteStringValue(OffPeakStartTime.Value, "O");
     }
     if (Optional.IsDefined(OffPeakLoadBalancingAlgorithm))
     {
         writer.WritePropertyName("offPeakLoadBalancingAlgorithm");
         writer.WriteStringValue(OffPeakLoadBalancingAlgorithm.Value.ToString());
     }
     writer.WriteEndObject();
 }
Esempio n. 27
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     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);
     }
     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();
     if (ProvisioningState != null)
     {
         writer.WritePropertyName("provisioningState");
         writer.WriteStringValue(ProvisioningState);
     }
     if (OrchestratorProfile != null)
     {
         writer.WritePropertyName("orchestratorProfile");
         writer.WriteObjectValue(OrchestratorProfile);
     }
     if (CustomProfile != null)
     {
         writer.WritePropertyName("customProfile");
         writer.WriteObjectValue(CustomProfile);
     }
     if (ServicePrincipalProfile != null)
     {
         writer.WritePropertyName("servicePrincipalProfile");
         writer.WriteObjectValue(ServicePrincipalProfile);
     }
     if (MasterProfile != null)
     {
         writer.WritePropertyName("masterProfile");
         writer.WriteObjectValue(MasterProfile);
     }
     if (AgentPoolProfiles != null)
     {
         writer.WritePropertyName("agentPoolProfiles");
         writer.WriteStartArray();
         foreach (var item in AgentPoolProfiles)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (WindowsProfile != null)
     {
         writer.WritePropertyName("windowsProfile");
         writer.WriteObjectValue(WindowsProfile);
     }
     if (LinuxProfile != null)
     {
         writer.WritePropertyName("linuxProfile");
         writer.WriteObjectValue(LinuxProfile);
     }
     if (DiagnosticsProfile != null)
     {
         writer.WritePropertyName("diagnosticsProfile");
         writer.WriteObjectValue(DiagnosticsProfile);
     }
     writer.WriteEndObject();
     writer.WriteEndObject();
 }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("type");
     writer.WriteStringValue(Type);
     if (Optional.IsDefined(ConnectVia))
     {
         writer.WritePropertyName("connectVia");
         writer.WriteObjectValue(ConnectVia);
     }
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsCollectionDefined(Parameters))
     {
         writer.WritePropertyName("parameters");
         writer.WriteStartObject();
         foreach (var item in Parameters)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteObjectValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Optional.IsCollectionDefined(Annotations))
     {
         writer.WritePropertyName("annotations");
         writer.WriteStartArray();
         foreach (var item in Annotations)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     writer.WritePropertyName("typeProperties");
     writer.WriteStartObject();
     writer.WritePropertyName("project");
     writer.WriteObjectValue(Project);
     if (Optional.IsDefined(AdditionalProjects))
     {
         writer.WritePropertyName("additionalProjects");
         writer.WriteObjectValue(AdditionalProjects);
     }
     if (Optional.IsDefined(RequestGoogleDriveScope))
     {
         writer.WritePropertyName("requestGoogleDriveScope");
         writer.WriteObjectValue(RequestGoogleDriveScope);
     }
     writer.WritePropertyName("authenticationType");
     writer.WriteStringValue(AuthenticationType.ToString());
     if (Optional.IsDefined(RefreshToken))
     {
         writer.WritePropertyName("refreshToken");
         writer.WriteObjectValue(RefreshToken);
     }
     if (Optional.IsDefined(ClientId))
     {
         writer.WritePropertyName("clientId");
         writer.WriteObjectValue(ClientId);
     }
     if (Optional.IsDefined(ClientSecret))
     {
         writer.WritePropertyName("clientSecret");
         writer.WriteObjectValue(ClientSecret);
     }
     if (Optional.IsDefined(Email))
     {
         writer.WritePropertyName("email");
         writer.WriteObjectValue(Email);
     }
     if (Optional.IsDefined(KeyFilePath))
     {
         writer.WritePropertyName("keyFilePath");
         writer.WriteObjectValue(KeyFilePath);
     }
     if (Optional.IsDefined(TrustedCertPath))
     {
         writer.WritePropertyName("trustedCertPath");
         writer.WriteObjectValue(TrustedCertPath);
     }
     if (Optional.IsDefined(UseSystemTrustStore))
     {
         writer.WritePropertyName("useSystemTrustStore");
         writer.WriteObjectValue(UseSystemTrustStore);
     }
     if (Optional.IsDefined(EncryptedCredential))
     {
         writer.WritePropertyName("encryptedCredential");
         writer.WriteObjectValue(EncryptedCredential);
     }
     writer.WriteEndObject();
     foreach (var item in AdditionalProperties)
     {
         writer.WritePropertyName(item.Key);
         writer.WriteObjectValue(item.Value);
     }
     writer.WriteEndObject();
 }
Esempio n. 29
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     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();
     if (Optional.IsDefined(Description))
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Optional.IsDefined(FriendlyName))
     {
         writer.WritePropertyName("friendlyName");
         writer.WriteStringValue(FriendlyName);
     }
     if (Optional.IsDefined(TimeZone))
     {
         writer.WritePropertyName("timeZone");
         writer.WriteStringValue(TimeZone);
     }
     if (Optional.IsDefined(HostPoolType))
     {
         writer.WritePropertyName("hostPoolType");
         writer.WriteStringValue(HostPoolType.Value.ToString());
     }
     if (Optional.IsDefined(ExclusionTag))
     {
         writer.WritePropertyName("exclusionTag");
         writer.WriteStringValue(ExclusionTag);
     }
     if (Optional.IsCollectionDefined(Schedules))
     {
         writer.WritePropertyName("schedules");
         writer.WriteStartArray();
         foreach (var item in Schedules)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(HostPoolReferences))
     {
         writer.WritePropertyName("hostPoolReferences");
         writer.WriteStartArray();
         foreach (var item in HostPoolReferences)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     writer.WriteEndObject();
     writer.WriteEndObject();
 }
Esempio n. 30
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("type");
     writer.WriteStringValue(Type);
     if (Description != null)
     {
         writer.WritePropertyName("description");
         writer.WriteStringValue(Description);
     }
     if (Structure != null)
     {
         writer.WritePropertyName("structure");
         writer.WriteObjectValue(Structure);
     }
     if (Schema != null)
     {
         writer.WritePropertyName("schema");
         writer.WriteObjectValue(Schema);
     }
     writer.WritePropertyName("linkedServiceName");
     writer.WriteObjectValue(LinkedServiceName);
     if (Parameters != null)
     {
         writer.WritePropertyName("parameters");
         writer.WriteStartObject();
         foreach (var item in Parameters)
         {
             writer.WritePropertyName(item.Key);
             writer.WriteObjectValue(item.Value);
         }
         writer.WriteEndObject();
     }
     if (Annotations != null)
     {
         writer.WritePropertyName("annotations");
         writer.WriteStartArray();
         foreach (var item in Annotations)
         {
             writer.WriteObjectValue(item);
         }
         writer.WriteEndArray();
     }
     if (Folder != null)
     {
         writer.WritePropertyName("folder");
         writer.WriteObjectValue(Folder);
     }
     writer.WritePropertyName("typeProperties");
     writer.WriteStartObject();
     if (ObjectApiName != null)
     {
         writer.WritePropertyName("objectApiName");
         writer.WriteObjectValue(ObjectApiName);
     }
     writer.WriteEndObject();
     foreach (var item in AdditionalProperties)
     {
         writer.WritePropertyName(item.Key);
         writer.WriteObjectValue(item.Value);
     }
     writer.WriteEndObject();
 }