Example #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);
        }
Example #2
0
        /// <summary>
        /// Serializes this instance of <see cref="PlacementDetail" /> 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="PlacementDetail" /> 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 != ClusterIp ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ClusterIp) : null, "cluster_ip", container.Add);
            AddIf(null != ClusterReference ? (Carbon.Json.JsonNode)ClusterReference.ToJson(null) : null, "cluster_reference", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Example #3
0
        /// <summary>
        /// Serializes this instance of <see cref="Task" /> 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="Task" /> 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 != ApiVersion ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ApiVersion) : null, "api_version", container.Add);
            AddIf(null != ClusterReference ? (Carbon.Json.JsonNode)ClusterReference.ToJson(null) : null, "cluster_reference", container.Add);
            AddIf(null != CompletionTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(CompletionTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "completion_time", 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);
            if (null != EntityReferenceList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in EntityReferenceList)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("entity_reference_list", __w);
            }
            AddIf(null != ErrorCode ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ErrorCode) : null, "error_code", container.Add);
            AddIf(null != ErrorDetail ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ErrorDetail) : null, "error_detail", container.Add);
            AddIf(null != LastUpdateTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(LastUpdateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "last_update_time", container.Add);
            AddIf(null != LogicalTimestamp ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((long)LogicalTimestamp) : null, "logical_timestamp", container.Add);
            AddIf(null != OperationType ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(OperationType) : null, "operation_type", container.Add);
            AddIf(null != ParentTaskReference ? (Carbon.Json.JsonNode)ParentTaskReference.ToJson(null) : null, "parent_task_reference", container.Add);
            AddIf(null != PercentageComplete ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((int)PercentageComplete) : null, "percentage_complete", container.Add);
            AddIf(null != ProgressMessage ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ProgressMessage) : null, "progress_message", container.Add);
            AddIf(null != StartTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(StartTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", System.Globalization.CultureInfo.InvariantCulture)) : null, "start_time", container.Add);
            AddIf(null != Status ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Status) : null, "status", container.Add);
            if (null != SubtaskReferenceList)
            {
                var __r = new Carbon.Json.XNodeArray();
                foreach (var __s in SubtaskReferenceList)
                {
                    AddIf(__s?.ToJson(null), __r.Add);
                }
                container.Add("subtask_reference_list", __r);
            }
            AddIf(null != Uuid ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Uuid) : null, "uuid", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Example #4
0
        /// <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);
        }
Example #5
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);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ImageMigrateInput" /> 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="ImageMigrateInput" /> 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 != ClusterReference ? (Carbon.Json.JsonNode)ClusterReference.ToJson(null) : null, "cluster_reference", container.Add);
            if (null != ImageReferenceList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in ImageReferenceList)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("image_reference_list", __w);
            }
            AfterToJson(ref container);
            return(container);
        }