コード例 #1
0
        /// <summary>
        /// Serializes this instance of <see cref="SubnetDefStatus" /> into a <see cref="Carbon.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Carbon.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Rest.ClientRuntime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SubnetDefStatus" /> as a <see cref="Carbon.Json.JsonNode" />.
        /// </returns>
        public Carbon.Json.JsonNode ToJson(Carbon.Json.JsonObject container, Microsoft.Rest.ClientRuntime.SerializationMode serializationMode)
        {
            container = container ?? new Carbon.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != Name ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Name) : null, "name", container.Add);
            AddIf(null != Description ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Description) : null, "description", container.Add);
            AddIf(null != AvailabilityZoneReference ? (Carbon.Json.JsonNode)AvailabilityZoneReference.ToJson(null) : null, "availability_zone_reference", container.Add);
            AddIf(null != ClusterReference ? (Carbon.Json.JsonNode)ClusterReference.ToJson(null) : null, "cluster_reference", container.Add);
            if (null != MessageList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in MessageList)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("message_list", __w);
            }
            AddIf(null != Resources ? (Carbon.Json.JsonNode)Resources.ToJson(null) : null, "resources", container.Add);
            AddIf(null != State ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(State) : null, "state", container.Add);
            AfterToJson(ref container);
            return(container);
        }
コード例 #2
0
ファイル: Subnet.json.cs プロジェクト: gmlp/PowerShell
        /// <summary>
        /// Serializes this instance of <see cref="Subnet" /> into a <see cref="Carbon.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Carbon.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Rest.ClientRuntime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="Subnet" /> as a <see cref="Carbon.Json.JsonNode" />.
        /// </returns>
        public Carbon.Json.JsonNode ToJson(Carbon.Json.JsonObject container, Microsoft.Rest.ClientRuntime.SerializationMode serializationMode)
        {
            container = container ?? new Carbon.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != Name ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Name) : null, "name", container.Add);
            AddIf(null != Description ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Description) : null, "description", container.Add);
            AddIf(null != AvailabilityZoneReference ? (Carbon.Json.JsonNode)AvailabilityZoneReference.ToJson(null) : null, "availability_zone_reference", container.Add);
            AddIf(null != ClusterReference ? (Carbon.Json.JsonNode)ClusterReference.ToJson(null) : null, "cluster_reference", container.Add);
            AddIf(null != Resources ? (Carbon.Json.JsonNode)Resources.ToJson(null) : null, "resources", container.Add);
            AfterToJson(ref container);
            return(container);
        }
コード例 #3
0
        /// <summary>
        /// Serializes this instance of <see cref="VmRecoveryPoint" /> into a <see cref="Carbon.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Carbon.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Rest.ClientRuntime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="VmRecoveryPoint" /> as a <see cref="Carbon.Json.JsonNode" />.
        /// </returns>
        public Carbon.Json.JsonNode ToJson(Carbon.Json.JsonObject container, Microsoft.Rest.ClientRuntime.SerializationMode serializationMode)
        {
            container = container ?? new Carbon.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != Name ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Name) : null, "name", container.Add);
            AddIf(null != AvailabilityZoneReference ? (Carbon.Json.JsonNode)AvailabilityZoneReference.ToJson(null) : null, "availability_zone_reference", container.Add);
            AddIf(null != ClusterReference ? (Carbon.Json.JsonNode)ClusterReference.ToJson(null) : null, "cluster_reference", container.Add);
            AddIf(null != CreationTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(CreationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "creation_time", container.Add);
            AddIf(null != ExpirationTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ExpirationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "expiration_time", container.Add);
            AddIf(null != RecoveryPointType ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(RecoveryPointType) : null, "recovery_point_type", container.Add);
            AddIf(null != Resources ? (Carbon.Json.JsonNode)Resources.ToJson(null) : null, "resources", container.Add);
            AfterToJson(ref container);
            return(container);
        }