Example #1
0
        /// <summary>
        /// Serializes this instance of <see cref="DhcpOptions" /> 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="DhcpOptions" /> 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 != BootFileName ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(BootFileName) : null, "boot_file_name", container.Add);
            AddIf(null != DomainName ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(DomainName) : null, "domain_name", container.Add);
            if (null != DomainNameServerList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in DomainNameServerList)
                {
                    AddIf(null != __x ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(__x) : null, __w.Add);
                }
                container.Add("domain_name_server_list", __w);
            }
            if (null != DomainSearchList)
            {
                var __r = new Carbon.Json.XNodeArray();
                foreach (var __s in DomainSearchList)
                {
                    AddIf(null != __s ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(__s) : null, __r.Add);
                }
                container.Add("domain_search_list", __r);
            }
            AddIf(null != TftpServerName ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(TftpServerName) : null, "tftp_server_name", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="NetworkSecurityRuleResourcesAppRule" /> 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="NetworkSecurityRuleResourcesAppRule" /> 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 != Action ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Action) : null, "action", container.Add);
            if (null != InboundAllowList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in InboundAllowList)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("inbound_allow_list", __w);
            }
            if (null != OutboundAllowList)
            {
                var __r = new Carbon.Json.XNodeArray();
                foreach (var __s in OutboundAllowList)
                {
                    AddIf(__s?.ToJson(null), __r.Add);
                }
                container.Add("outbound_allow_list", __r);
            }
            AddIf(null != TargetGroup ? (Carbon.Json.JsonNode)TargetGroup.ToJson(null) : null, "target_group", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Example #3
0
        /// <summary>
        /// Serializes this instance of <see cref="VmResources" /> 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="VmResources" /> 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 != BootConfig ? (Carbon.Json.JsonNode)BootConfig.ToJson(null) : null, "boot_config", container.Add);
            if (null != DiskList)
            {
                var __x = new Carbon.Json.XNodeArray();
                foreach (var __y in DiskList)
                {
                    AddIf(__y?.ToJson(null), __x.Add);
                }
                container.Add("disk_list", __x);
            }
            if (null != GpuList)
            {
                var __s = new Carbon.Json.XNodeArray();
                foreach (var __t in GpuList)
                {
                    AddIf(__t?.ToJson(null), __s.Add);
                }
                container.Add("gpu_list", __s);
            }
            AddIf(null != GuestCustomization ? (Carbon.Json.JsonNode)GuestCustomization.ToJson(null) : null, "guest_customization", container.Add);
            AddIf(null != GuestOsId ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(GuestOsId) : null, "guest_os_id", container.Add);
            AddIf(null != GuestTools ? (Carbon.Json.JsonNode)GuestTools.ToJson(null) : null, "guest_tools", container.Add);
            AddIf(null != HardwareClockTimezone ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(HardwareClockTimezone) : null, "hardware_clock_timezone", container.Add);
            AddIf(null != MemorySizeMib ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((int)MemorySizeMib) : null, "memory_size_mib", container.Add);
            if (null != NicList)
            {
                var __n = new Carbon.Json.XNodeArray();
                foreach (var __o in NicList)
                {
                    AddIf(__o?.ToJson(null), __n.Add);
                }
                container.Add("nic_list", __n);
            }
            AddIf(null != NumSockets ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((int)NumSockets) : null, "num_sockets", container.Add);
            AddIf(null != NumVcpusPerSocket ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((int)NumVcpusPerSocket) : null, "num_vcpus_per_socket", container.Add);
            AddIf(null != ParentReference ? (Carbon.Json.JsonNode)ParentReference.ToJson(null) : null, "parent_reference", container.Add);
            AddIf(null != PowerState ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(PowerState) : null, "power_state", container.Add);
            AddIf(null != PowerStateMechanism ? (Carbon.Json.JsonNode)PowerStateMechanism.ToJson(null) : null, "power_state_mechanism", container.Add);
            AddIf(null != VgaConsoleEnabled ? (Carbon.Json.JsonNode) new Carbon.Json.JsonBoolean((bool)VgaConsoleEnabled) : null, "vga_console_enabled", container.Add);
            AddIf(null != VnumaConfig ? (Carbon.Json.JsonNode)VnumaConfig.ToJson(null) : null, "vnuma_config", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ClusterConfigSpec" /> 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="ClusterConfigSpec" /> 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);
            }
            if (null != AuthorizedPublicKeyList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in AuthorizedPublicKeyList)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("authorized_public_key_list", __w);
            }
            AddIf(null != CertificationSigningInfo ? (Carbon.Json.JsonNode)CertificationSigningInfo.ToJson(null) : null, "certification_signing_info", container.Add);
            AddIf(null != ClientAuth ? (Carbon.Json.JsonNode)ClientAuth.ToJson(null) : null, "client_auth", container.Add);
            if (null != EnabledFeatureList)
            {
                var __r = new Carbon.Json.XNodeArray();
                foreach (var __s in EnabledFeatureList)
                {
                    AddIf(null != __s ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(__s) : null, __r.Add);
                }
                container.Add("enabled_feature_list", __r);
            }
            AddIf(null != EncryptionStatus ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(EncryptionStatus) : null, "encryption_status", container.Add);
            AddIf(null != ExternalConfigurations ? (Carbon.Json.JsonNode)ExternalConfigurations.ToJson(null) : null, "external_configurations", container.Add);
            AddIf(null != GpuDriverVersion ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(GpuDriverVersion) : null, "gpu_driver_version", container.Add);
            AddIf(null != OperationMode ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(OperationMode) : null, "operation_mode", container.Add);
            AddIf(null != RedundancyFactor ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((int)RedundancyFactor) : null, "redundancy_factor", container.Add);
            if (null != SoftwareMap)
            {
                foreach (var __n in SoftwareMap)
                {
                    AddIf(__n.Value?.ToJson(null), (__m) => container.Add(__n.Key, __m));
                }
            }
            AddIf(null != SupportedInformationVerbosity ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(SupportedInformationVerbosity) : null, "supported_information_verbosity", container.Add);
            AddIf(null != Timezone ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Timezone) : null, "timezone", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Example #5
0
        /// <summary>
        /// Serializes this instance of <see cref="SubnetStatus" /> 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="SubnetStatus" /> 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 != Code ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((int)Code) : null, "code", container.Add);
            AddIf(null != Kind ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Kind) : null, "kind", 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 != State ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(State) : null, "state", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Example #6
0
        /// <summary>
        /// Serializes this instance of <see cref="CitrixConnectorConfigDetailsSpec" /> 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="CitrixConnectorConfigDetailsSpec" /> 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);
            }
            if (null != CitrixVmReferenceList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in CitrixVmReferenceList)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("citrix_vm_reference_list", __w);
            }
            AddIf(null != ClientId ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ClientId) : null, "client_id", container.Add);
            AddIf(null != ClientSecret ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ClientSecret) : null, "client_secret", container.Add);
            AddIf(null != CustomerId ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(CustomerId) : null, "customer_id", container.Add);
            AddIf(null != ResourceLocation ? (Carbon.Json.JsonNode)ResourceLocation.ToJson(null) : null, "resource_location", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Example #7
0
        /// <summary>
        /// Serializes this instance of <see cref="ImageResourcesDefStatus" /> 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="ImageResourcesDefStatus" /> 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 != Architecture ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Architecture) : null, "architecture", container.Add);
            AddIf(null != Checksum ? (Carbon.Json.JsonNode)Checksum.ToJson(null) : null, "checksum", container.Add);
            AddIf(null != ImageType ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ImageType) : null, "image_type", container.Add);
            if (null != RetrievalUriList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in RetrievalUriList)
                {
                    AddIf(null != __x ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(__x) : null, __w.Add);
                }
                container.Add("retrieval_uri_list", __w);
            }
            AddIf(null != SizeBytes ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((int)SizeBytes) : null, "size_bytes", container.Add);
            AddIf(null != SourceUri ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(SourceUri) : null, "source_uri", container.Add);
            AddIf(null != Version ? (Carbon.Json.JsonNode)Version.ToJson(null) : null, "version", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Example #8
0
        /// <summary>
        /// Serializes this instance of <see cref="PlacementSpec" /> 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="PlacementSpec" /> 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);
            }
            if (null != EntitySpecList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in EntitySpecList)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("entity_spec_list", __w);
            }
            AddIf(null != ProbableClusterReference ? (Carbon.Json.JsonNode)ProbableClusterReference.ToJson(null) : null, "probable_cluster_reference", container.Add);
            AddIf(null != TenantUuid ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(TenantUuid) : null, "tenant_uuid", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ClusterNetworkEntity" /> 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="ClusterNetworkEntity" /> 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 != Address ? (Carbon.Json.JsonNode)Address.ToJson(null) : null, "address", container.Add);
            AddIf(null != Credentials ? (Carbon.Json.JsonNode)Credentials.ToJson(null) : null, "credentials", container.Add);
            if (null != ProxyTypeList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in ProxyTypeList)
                {
                    AddIf(null != __x ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(__x) : null, __w.Add);
                }
                container.Add("proxy_type_list", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ClusterManagementServer" /> 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="ClusterManagementServer" /> 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 != Type ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Type) : null, "type", container.Add);
            AddIf(null != DrsEnabled ? (Carbon.Json.JsonNode) new Carbon.Json.JsonBoolean((bool)DrsEnabled) : null, "drs_enabled", container.Add);
            AddIf(null != Ip ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Ip) : null, "ip", container.Add);
            if (null != StatusList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in StatusList)
                {
                    AddIf(null != __x ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(__x) : null, __w.Add);
                }
                container.Add("status_list", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="CategoryQueryResponseResultsItemType" /> 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."/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="CategoryQueryResponseResultsItemType" /> 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);
            }
            if (null != EntityAnyReferenceList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in EntityAnyReferenceList)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("entity_any_reference_list", __w);
            }
            AddIf(null != FilteredEntityCount ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((long)FilteredEntityCount) : null, "filtered_entity_count", container.Add);
            AddIf(null != Kind ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Kind) : null, "kind", container.Add);
            AddIf(null != TotalEntityCount ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((long)TotalEntityCount) : null, "total_entity_count", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="NutanixGuestToolsSpec" /> 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="NutanixGuestToolsSpec" /> 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);
            }
            if (null != EnabledCapabilityList)
            {
                var __x = new Carbon.Json.XNodeArray();
                foreach (var __y in EnabledCapabilityList)
                {
                    AddIf(null != __y ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(__y) : null, __x.Add);
                }
                container.Add("enabled_capability_list", __x);
            }
            AddIf(null != IsoMountState ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(IsoMountState) : null, "iso_mount_state", container.Add);
            AddIf(null != State ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(State) : null, "state", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="MulticlusterConfigSpecResources" /> 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="MulticlusterConfigSpecResources" /> 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 != ExecutionPlan ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ExecutionPlan) : null, "execution_plan", container.Add);
            if (null != SpecList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in SpecList)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("spec_list", __w);
            }
            AddIf(null != UpgradeSchedule ? (Carbon.Json.JsonNode)UpgradeSchedule.ToJson(null) : null, "upgrade_schedule", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Example #14
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);
        }
        /// <summary>
        /// Serializes this instance of <see cref="CategoryKeyListResponse" /> 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."/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="CategoryKeyListResponse" /> 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);
            if (null != Entities)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in Entities)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("entities", __w);
            }
            AddIf(null != Metadata ? (Carbon.Json.JsonNode)Metadata.ToJson(null) : null, "metadata", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Example #16
0
        /// <summary>
        /// Serializes this instance of <see cref="IpConfig" /> 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="IpConfig" /> 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 != DefaultGatewayIp ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(DefaultGatewayIp) : null, "default_gateway_ip", container.Add);
            AddIf(null != DhcpOptions ? (Carbon.Json.JsonNode)DhcpOptions.ToJson(null) : null, "dhcp_options", container.Add);
            AddIf(null != DhcpServerAddress ? (Carbon.Json.JsonNode)DhcpServerAddress.ToJson(null) : null, "dhcp_server_address", container.Add);
            if (null != PoolList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in PoolList)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("pool_list", __w);
            }
            AddIf(null != PrefixLength ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((int)PrefixLength) : null, "prefix_length", container.Add);
            AddIf(null != SubnetIp ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(SubnetIp) : null, "subnet_ip", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Example #17
0
        /// <summary>
        /// Serializes this instance of <see cref="CategoryFilter" /> 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."/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="CategoryFilter" /> 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 != Type ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Type) : null, "type", container.Add);
            if (null != KindList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in KindList)
                {
                    AddIf(null != __x ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(__x) : null, __w.Add);
                }
                container.Add("kind_list", __w);
            }
            if (null != Params)
            {
                foreach (var __s in Params)
                {
                    AddIf(null != __s.Value ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(__s.Value) : null, (__r) => container.Add(__s.Key, __r));
                }
            }
            AfterToJson(ref container);
            return(container);
        }
Example #18
0
        /// <summary>
        /// Serializes this instance of <see cref="EntitySpec" /> 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="EntitySpec" /> 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);
            }
            if (null != CategoryList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in CategoryList)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("category_list", __w);
            }
            AddIf(null != VmReference ? (Carbon.Json.JsonNode)VmReference.ToJson(null) : null, "vm_reference", container.Add);
            AddIf(null != VmSpec ? (Carbon.Json.JsonNode)VmSpec.ToJson(null) : null, "vm_spec", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ClusterDefStatusResources" /> 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="ClusterDefStatusResources" /> 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 != Analysis ? (Carbon.Json.JsonNode)Analysis.ToJson(null) : null, "analysis", container.Add);
            AddIf(null != Config ? (Carbon.Json.JsonNode)Config.ToJson(null) : null, "config", container.Add);
            AddIf(null != Network ? (Carbon.Json.JsonNode)Network.ToJson(null) : null, "network", container.Add);
            AddIf(null != Nodes ? (Carbon.Json.JsonNode)Nodes.ToJson(null) : null, "nodes", container.Add);
            if (null != RuntimeStatusList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in RuntimeStatusList)
                {
                    AddIf(null != __x ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(__x) : null, __w.Add);
                }
                container.Add("runtime_status_list", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
Example #20
0
        /// <summary>
        /// Serializes this instance of <see cref="CloudCredentialsDefStatus" /> 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="CloudCredentialsDefStatus" /> 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((Carbon.Json.JsonNode) new Carbon.Json.JsonNumber(Id), "id", 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);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ProceduralErrorResponse" /> 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="ProceduralErrorResponse" /> 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);
            }
            if (serializationMode.HasFlag(Microsoft.Rest.ClientRuntime.SerializationMode.IncludeReadOnly))
            {
                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);
                }
            }
            AfterToJson(ref container);
            return(container);
        }
Example #22
0
        /// <summary>
        /// Serializes this instance of <see cref="NetworkRule" /> 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="NetworkRule" /> 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 != ExpirationTime ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(ExpirationTime) : null, "expiration_time", container.Add);
            AddIf(null != Filter ? (Carbon.Json.JsonNode)Filter.ToJson(null) : null, "filter", container.Add);
            if (null != IcmpTypeCodeList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in IcmpTypeCodeList)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("icmp_type_code_list", __w);
            }
            AddIf(null != IpSubnet ? (Carbon.Json.JsonNode)IpSubnet.ToJson(null) : null, "ip_subnet", container.Add);
            AddIf(null != NetworkFunctionChainReference ? (Carbon.Json.JsonNode)NetworkFunctionChainReference.ToJson(null) : null, "network_function_chain_reference", container.Add);
            AddIf(null != PeerSpecificationType ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(PeerSpecificationType) : null, "peer_specification_type", container.Add);
            AddIf(null != Protocol ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(Protocol) : null, "protocol", container.Add);
            if (null != TcpPortRangeList)
            {
                var __r = new Carbon.Json.XNodeArray();
                foreach (var __s in TcpPortRangeList)
                {
                    AddIf(__s?.ToJson(null), __r.Add);
                }
                container.Add("tcp_port_range_list", __r);
            }
            if (null != UdpPortRangeList)
            {
                var __m = new Carbon.Json.XNodeArray();
                foreach (var __n in UdpPortRangeList)
                {
                    AddIf(__n?.ToJson(null), __m.Add);
                }
                container.Add("udp_port_range_list", __m);
            }
            AfterToJson(ref container);
            return(container);
        }
Example #23
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);
        }
        /// <summary>
        /// Serializes this instance of <see cref="UserStatusResource" /> 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="UserStatusResource" /> 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);
            }
            if (null != AccessControlPolicyReferenceList)
            {
                var __x = new Carbon.Json.XNodeArray();
                foreach (var __y in AccessControlPolicyReferenceList)
                {
                    AddIf(__y?.ToJson(null), __x.Add);
                }
                container.Add("access_control_policy_reference_list", __x);
            }
            AddIf(null != DirectoryServiceUser ? (Carbon.Json.JsonNode)DirectoryServiceUser.ToJson(null) : null, "directory_service_user", container.Add);
            AddIf(null != DisplayName ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(DisplayName) : null, "display_name", container.Add);
            if (null != ProjectsReferenceList)
            {
                var __s = new Carbon.Json.XNodeArray();
                foreach (var __t in ProjectsReferenceList)
                {
                    AddIf(__t?.ToJson(null), __s.Add);
                }
                container.Add("projects_reference_list", __s);
            }
            AddIf(null != ResourceUsageSummary ? (Carbon.Json.JsonNode)ResourceUsageSummary.ToJson(null) : null, "resource_usage_summary", container.Add);
            AddIf(null != UserType ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(UserType) : null, "user_type", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Example #25
0
        /// <summary>
        /// Serializes this instance of <see cref="CertificateSpecUploadInput" /> 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="CertificateSpecUploadInput" /> 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);
            }
            if (null != SpecList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in SpecList)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("spec_list", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
Example #26
0
        /// <summary>
        /// Serializes this instance of <see cref="CsrsSpec" /> 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="CsrsSpec" /> 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);
            }
            if (null != NodeUuidList)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in NodeUuidList)
                {
                    AddIf(null != __x ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(__x) : null, __w.Add);
                }
                container.Add("node_uuid_list", __w);
            }
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ResourceDomainResourcesStatus" /> 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="ResourceDomainResourcesStatus" /> 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);
            }
            if (null != Resources)
            {
                var __x = new Carbon.Json.XNodeArray();
                foreach (var __y in Resources)
                {
                    AddIf(__y?.ToJson(null), __x.Add);
                }
                container.Add("resources", __x);
            }
            AfterToJson(ref container);
            return(container);
        }
Example #28
0
        /// <summary>
        /// Serializes this instance of <see cref="TaskPollResponse" /> 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="TaskPollResponse" /> 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);
            }
            if (null != Entities)
            {
                var __w = new Carbon.Json.XNodeArray();
                foreach (var __x in Entities)
                {
                    AddIf(__x?.ToJson(null), __w.Add);
                }
                container.Add("entities", __w);
            }
            AddIf(null != HasPollTimedOut ? (Carbon.Json.JsonNode) new Carbon.Json.JsonBoolean((bool)HasPollTimedOut) : null, "has_poll_timed_out", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Example #29
0
        /// <summary>
        /// Serializes this instance of <see cref="VmBootConfig" /> 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="VmBootConfig" /> 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 != BootDevice ? (Carbon.Json.JsonNode)BootDevice.ToJson(null) : null, "boot_device", container.Add);
            if (null != BootDeviceOrderList)
            {
                var __x = new Carbon.Json.XNodeArray();
                foreach (var __y in BootDeviceOrderList)
                {
                    AddIf(null != __y ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(__y) : null, __x.Add);
                }
                container.Add("boot_device_order_list", __x);
            }
            AfterToJson(ref container);
            return(container);
        }
Example #30
0
        /// <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);
        }