Пример #1
0
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        public XElement ToXML()

        => new XElement(OCPPNS.OCPPv1_6_CP + "getDiagnosticsRequest",

                        new XElement(OCPPNS.OCPPv1_6_CP + "retrieveDate", RetrieveDate.ToIso8601()),
                        new XElement(OCPPNS.OCPPv1_6_CP + "location", Location),

                        Retries.HasValue
                       ? new XElement(OCPPNS.OCPPv1_6_CP + "retries", Retries.Value)
                       : null,

                        RetryInterval.HasValue
                       ? new XElement(OCPPNS.OCPPv1_6_CP + "retryInterval", (UInt64)RetryInterval.Value.TotalSeconds)
                       : null

                        );
Пример #2
0
        /// <summary>
        /// Return a JSON representation of this object.
        /// </summary>
        /// <param name="CustomUpdateFirmwareRequestSerializer">A delegate to serialize custom start transaction requests.</param>
        public JObject ToJSON(CustomJObjectSerializerDelegate <UpdateFirmwareRequest> CustomUpdateFirmwareRequestSerializer = null)
        {
            var JSON = JSONObject.Create(

                new JProperty("retrieveDate", RetrieveDate.ToIso8601()),
                new JProperty("location", Location),

                Retries.HasValue
                               ? new JProperty("retries", Retries.Value)
                               : null,

                RetryInterval.HasValue
                               ? new JProperty("retryInterval", (UInt64)RetryInterval.Value.TotalSeconds)
                               : null

                );

            return(CustomUpdateFirmwareRequestSerializer != null
                       ? CustomUpdateFirmwareRequestSerializer(this, JSON)
                       : JSON);
        }