コード例 #1
0
        internal static SapCentralServerInstanceData DeserializeSapCentralServerInstanceData(JsonElement element)
        {
            IDictionary <string, string> tags = default;
            AzureLocation                                      location   = default;
            ResourceIdentifier                                 id         = default;
            string                                             name       = default;
            ResourceType                                       type       = default;
            SystemData                                         systemData = default;
            Optional <string>                                  instanceNo = default;
            Optional <ResourceIdentifier>                      subnet     = default;
            Optional <MessageServerProperties>                 messageServerProperties            = default;
            Optional <EnqueueServerProperties>                 enqueueServerProperties            = default;
            Optional <GatewayServerProperties>                 gatewayServerProperties            = default;
            Optional <EnqueueReplicationServerProperties>      enqueueReplicationServerProperties = default;
            Optional <string>                                  kernelVersion     = default;
            Optional <string>                                  kernelPatch       = default;
            Optional <IReadOnlyList <CentralServerVmDetails> > vmDetails         = default;
            Optional <SapVirtualInstanceStatus>                status            = default;
            Optional <SapHealthState>                          health            = default;
            Optional <SapVirtualInstanceProvisioningState>     provisioningState = default;
            Optional <SapVirtualInstanceError>                 errors            = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = new AzureLocation(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = new ResourceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("instanceNo"))
                        {
                            instanceNo = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("subnet"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            subnet = new ResourceIdentifier(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("messageServerProperties"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            messageServerProperties = MessageServerProperties.DeserializeMessageServerProperties(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("enqueueServerProperties"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            enqueueServerProperties = EnqueueServerProperties.DeserializeEnqueueServerProperties(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("gatewayServerProperties"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            gatewayServerProperties = GatewayServerProperties.DeserializeGatewayServerProperties(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("enqueueReplicationServerProperties"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            enqueueReplicationServerProperties = EnqueueReplicationServerProperties.DeserializeEnqueueReplicationServerProperties(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("kernelVersion"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                kernelVersion = null;
                                continue;
                            }
                            kernelVersion = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("kernelPatch"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                kernelPatch = null;
                                continue;
                            }
                            kernelPatch = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("vmDetails"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <CentralServerVmDetails> array = new List <CentralServerVmDetails>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(CentralServerVmDetails.DeserializeCentralServerVmDetails(item));
                            }
                            vmDetails = array;
                            continue;
                        }
                        if (property0.NameEquals("status"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            status = new SapVirtualInstanceStatus(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("health"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            health = new SapHealthState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new SapVirtualInstanceProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("errors"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            errors = SapVirtualInstanceError.DeserializeSapVirtualInstanceError(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new SapCentralServerInstanceData(id, name, type, systemData, tags, location, instanceNo.Value, subnet.Value, messageServerProperties.Value, enqueueServerProperties.Value, gatewayServerProperties.Value, enqueueReplicationServerProperties.Value, kernelVersion.Value, kernelPatch.Value, Optional.ToList(vmDetails), Optional.ToNullable(status), Optional.ToNullable(health), Optional.ToNullable(provisioningState), errors.Value));
        }
コード例 #2
0
        internal static SapVirtualInstanceData DeserializeSapVirtualInstanceData(JsonElement element)
        {
            Optional <UserAssignedServiceIdentity> identity = default;
            IDictionary <string, string>           tags     = default;
            AzureLocation      location      = default;
            ResourceIdentifier id            = default;
            string             name          = default;
            ResourceType       type          = default;
            SystemData         systemData    = default;
            SapEnvironmentType environment   = default;
            SapProductType     sapProduct    = default;
            SapConfiguration   configuration = default;
            Optional <ManagedRGConfiguration>              managedResourceGroupConfiguration = default;
            Optional <SapVirtualInstanceStatus>            status            = default;
            Optional <SapHealthState>                      health            = default;
            Optional <SapVirtualInstanceState>             state             = default;
            Optional <SapVirtualInstanceProvisioningState> provisioningState = default;
            Optional <SapVirtualInstanceError>             errors            = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    identity = UserAssignedServiceIdentity.DeserializeUserAssignedServiceIdentity(property.Value);
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = new AzureLocation(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = new ResourceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("environment"))
                        {
                            environment = new SapEnvironmentType(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("sapProduct"))
                        {
                            sapProduct = new SapProductType(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("configuration"))
                        {
                            configuration = SapConfiguration.DeserializeSapConfiguration(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("managedResourceGroupConfiguration"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            managedResourceGroupConfiguration = ManagedRGConfiguration.DeserializeManagedRGConfiguration(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("status"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            status = new SapVirtualInstanceStatus(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("health"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            health = new SapHealthState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("state"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            state = new SapVirtualInstanceState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new SapVirtualInstanceProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("errors"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            errors = SapVirtualInstanceError.DeserializeSapVirtualInstanceError(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new SapVirtualInstanceData(id, name, type, systemData, tags, location, identity.Value, environment, sapProduct, configuration, managedResourceGroupConfiguration.Value, Optional.ToNullable(status), Optional.ToNullable(health), Optional.ToNullable(state), Optional.ToNullable(provisioningState), errors.Value));
        }
コード例 #3
0
        internal static SapApplicationServerInstanceData DeserializeSapApplicationServerInstanceData(JsonElement element)
        {
            IDictionary <string, string> tags = default;
            AzureLocation                                  location          = default;
            ResourceIdentifier                             id                = default;
            string                                         name              = default;
            ResourceType                                   type              = default;
            SystemData                                     systemData        = default;
            Optional <string>                              instanceNo        = default;
            Optional <ResourceIdentifier>                  subnet            = default;
            Optional <string>                              hostname          = default;
            Optional <string>                              kernelVersion     = default;
            Optional <string>                              kernelPatch       = default;
            Optional <string>                              ipAddress         = default;
            Optional <long?>                               gatewayPort       = default;
            Optional <long?>                               icmHttpPort       = default;
            Optional <long?>                               icmHttpsPort      = default;
            Optional <ResourceIdentifier>                  virtualMachineId  = default;
            Optional <SapVirtualInstanceStatus>            status            = default;
            Optional <SapHealthState>                      health            = default;
            Optional <SapVirtualInstanceProvisioningState> provisioningState = default;
            Optional <SapVirtualInstanceError>             errors            = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = new AzureLocation(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = new ResourceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("instanceNo"))
                        {
                            instanceNo = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("subnet"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            subnet = new ResourceIdentifier(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("hostname"))
                        {
                            hostname = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("kernelVersion"))
                        {
                            kernelVersion = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("kernelPatch"))
                        {
                            kernelPatch = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("ipAddress"))
                        {
                            ipAddress = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("gatewayPort"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                gatewayPort = null;
                                continue;
                            }
                            gatewayPort = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("icmHttpPort"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                icmHttpPort = null;
                                continue;
                            }
                            icmHttpPort = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("icmHttpsPort"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                icmHttpsPort = null;
                                continue;
                            }
                            icmHttpsPort = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("virtualMachineId"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            virtualMachineId = new ResourceIdentifier(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("status"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            status = new SapVirtualInstanceStatus(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("health"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            health = new SapHealthState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new SapVirtualInstanceProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("errors"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            errors = SapVirtualInstanceError.DeserializeSapVirtualInstanceError(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new SapApplicationServerInstanceData(id, name, type, systemData, tags, location, instanceNo.Value, subnet.Value, hostname.Value, kernelVersion.Value, kernelPatch.Value, ipAddress.Value, Optional.ToNullable(gatewayPort), Optional.ToNullable(icmHttpPort), Optional.ToNullable(icmHttpsPort), virtualMachineId.Value, Optional.ToNullable(status), Optional.ToNullable(health), Optional.ToNullable(provisioningState), errors.Value));
        }