Ejemplo n.º 1
0
 internal ProductDetails(DisplayInfo displayInfo, HierarchyInformation hierarchyInformation, int?count, DoubleEncryptionStatus?productDoubleEncryptionStatus, IReadOnlyList <DeviceDetails> deviceDetails)
 {
     DisplayInfo          = displayInfo;
     HierarchyInformation = hierarchyInformation;
     Count = count;
     ProductDoubleEncryptionStatus = productDoubleEncryptionStatus;
     DeviceDetails = deviceDetails;
 }
        public ConfigurationFilters(HierarchyInformation hierarchyInformation)
        {
            if (hierarchyInformation == null)
            {
                throw new ArgumentNullException(nameof(hierarchyInformation));
            }

            HierarchyInformation = hierarchyInformation;
            FilterableProperty   = new ChangeTrackingList <FilterableProperty>();
        }
Ejemplo n.º 3
0
        public ProductDetails(HierarchyInformation hierarchyInformation)
        {
            if (hierarchyInformation == null)
            {
                throw new ArgumentNullException(nameof(hierarchyInformation));
            }

            HierarchyInformation = hierarchyInformation;
            DeviceDetails        = new ChangeTrackingList <DeviceDetails>();
        }
Ejemplo n.º 4
0
 internal EdgeOrderProduct(string displayName, ProductDescription description, IReadOnlyList <ImageInformation> imageInformation, CostInformation costInformation, AvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, IReadOnlyList <FilterableProperty> filterableProperties, IReadOnlyList <ProductConfiguration> configurations)
 {
     DisplayName             = displayName;
     Description             = description;
     ImageInformation        = imageInformation;
     CostInformation         = costInformation;
     AvailabilityInformation = availabilityInformation;
     HierarchyInformation    = hierarchyInformation;
     FilterableProperties    = filterableProperties;
     Configurations          = configurations;
 }
Ejemplo n.º 5
0
 internal ProductLine(string displayName, ProductDescription description, IReadOnlyList <ImageInformation> imageInformation, CostInformation costInformation, AvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, IReadOnlyList <FilterableProperty> filterableProperties, IReadOnlyList <EdgeOrderProduct> products)
 {
     DisplayName             = displayName;
     Description             = description;
     ImageInformation        = imageInformation;
     CostInformation         = costInformation;
     AvailabilityInformation = availabilityInformation;
     HierarchyInformation    = hierarchyInformation;
     FilterableProperties    = filterableProperties;
     Products = products;
 }
Ejemplo n.º 6
0
 internal ProductFamily(string displayName, ProductDescription description, IReadOnlyList <ImageInformation> imageInformation, CostInformation costInformation, AvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, IReadOnlyList <FilterableProperty> filterableProperties, IReadOnlyList <ProductLine> productLines, IReadOnlyList <ResourceProviderDetails> resourceProviderDetails)
 {
     DisplayName             = displayName;
     Description             = description;
     ImageInformation        = imageInformation;
     CostInformation         = costInformation;
     AvailabilityInformation = availabilityInformation;
     HierarchyInformation    = hierarchyInformation;
     FilterableProperties    = filterableProperties;
     ProductLines            = productLines;
     ResourceProviderDetails = resourceProviderDetails;
 }
 internal ProductConfiguration(string displayName, ProductDescription description, IReadOnlyList <ImageInformation> imageInformation, CostInformation costInformation, AvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, IReadOnlyList <FilterableProperty> filterableProperties, IReadOnlyList <ProductSpecification> specifications, ProductDimensions dimensions)
 {
     DisplayName             = displayName;
     Description             = description;
     ImageInformation        = imageInformation;
     CostInformation         = costInformation;
     AvailabilityInformation = availabilityInformation;
     HierarchyInformation    = hierarchyInformation;
     FilterableProperties    = filterableProperties;
     Specifications          = specifications;
     Dimensions = dimensions;
 }
        internal static ProductConfiguration DeserializeProductConfiguration(JsonElement element)
        {
            Optional <string>             displayName = default;
            Optional <ProductDescription> description = default;
            Optional <IReadOnlyList <ImageInformation> > imageInformation            = default;
            Optional <CostInformation>                       costInformation         = default;
            Optional <AvailabilityInformation>               availabilityInformation = default;
            Optional <HierarchyInformation>                  hierarchyInformation    = default;
            Optional <IReadOnlyList <FilterableProperty> >   filterableProperties    = default;
            Optional <IReadOnlyList <ProductSpecification> > specifications          = default;
            Optional <ProductDimensions>                     dimensions = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("displayName"))
                        {
                            displayName = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("description"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            description = ProductDescription.DeserializeProductDescription(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("imageInformation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <ImageInformation> array = new List <ImageInformation>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(Models.ImageInformation.DeserializeImageInformation(item));
                            }
                            imageInformation = array;
                            continue;
                        }
                        if (property0.NameEquals("costInformation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            costInformation = CostInformation.DeserializeCostInformation(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("availabilityInformation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            availabilityInformation = AvailabilityInformation.DeserializeAvailabilityInformation(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("hierarchyInformation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            hierarchyInformation = HierarchyInformation.DeserializeHierarchyInformation(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("filterableProperties"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <FilterableProperty> array = new List <FilterableProperty>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(FilterableProperty.DeserializeFilterableProperty(item));
                            }
                            filterableProperties = array;
                            continue;
                        }
                        if (property0.NameEquals("specifications"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <ProductSpecification> array = new List <ProductSpecification>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ProductSpecification.DeserializeProductSpecification(item));
                            }
                            specifications = array;
                            continue;
                        }
                        if (property0.NameEquals("dimensions"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            dimensions = ProductDimensions.DeserializeProductDimensions(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ProductConfiguration(displayName.Value, description.Value, Optional.ToList(imageInformation), costInformation.Value, availabilityInformation.Value, hierarchyInformation.Value, Optional.ToList(filterableProperties), Optional.ToList(specifications), dimensions.Value));
        }
Ejemplo n.º 9
0
        internal static ProductFamiliesMetadataDetails DeserializeProductFamiliesMetadataDetails(JsonElement element)
        {
            Optional <string>             displayName = default;
            Optional <ProductDescription> description = default;
            Optional <IReadOnlyList <ImageInformation> > imageInformation               = default;
            Optional <CostInformation>                          costInformation         = default;
            Optional <AvailabilityInformation>                  availabilityInformation = default;
            Optional <HierarchyInformation>                     hierarchyInformation    = default;
            Optional <IReadOnlyList <FilterableProperty> >      filterableProperties    = default;
            Optional <IReadOnlyList <ProductLine> >             productLines            = default;
            Optional <IReadOnlyList <ResourceProviderDetails> > resourceProviderDetails = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("displayName"))
                        {
                            displayName = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("description"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            description = ProductDescription.DeserializeProductDescription(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("imageInformation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <ImageInformation> array = new List <ImageInformation>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(Models.ImageInformation.DeserializeImageInformation(item));
                            }
                            imageInformation = array;
                            continue;
                        }
                        if (property0.NameEquals("costInformation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            costInformation = CostInformation.DeserializeCostInformation(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("availabilityInformation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            availabilityInformation = AvailabilityInformation.DeserializeAvailabilityInformation(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("hierarchyInformation"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            hierarchyInformation = HierarchyInformation.DeserializeHierarchyInformation(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("filterableProperties"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <FilterableProperty> array = new List <FilterableProperty>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(FilterableProperty.DeserializeFilterableProperty(item));
                            }
                            filterableProperties = array;
                            continue;
                        }
                        if (property0.NameEquals("productLines"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <ProductLine> array = new List <ProductLine>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ProductLine.DeserializeProductLine(item));
                            }
                            productLines = array;
                            continue;
                        }
                        if (property0.NameEquals("resourceProviderDetails"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <ResourceProviderDetails> array = new List <ResourceProviderDetails>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(Models.ResourceProviderDetails.DeserializeResourceProviderDetails(item));
                            }
                            resourceProviderDetails = array;
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ProductFamiliesMetadataDetails(displayName.Value, description.Value, Optional.ToList(imageInformation), costInformation.Value, availabilityInformation.Value, hierarchyInformation.Value, Optional.ToList(filterableProperties), Optional.ToList(productLines), Optional.ToList(resourceProviderDetails)));
        }
Ejemplo n.º 10
0
        internal static ProductDetails DeserializeProductDetails(JsonElement element)
        {
            Optional <DisplayInfo>                    displayInfo          = default;
            HierarchyInformation                      hierarchyInformation = default;
            Optional <int>                            count = default;
            Optional <DoubleEncryptionStatus>         productDoubleEncryptionStatus = default;
            Optional <IReadOnlyList <DeviceDetails> > deviceDetails = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("displayInfo"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    displayInfo = DisplayInfo.DeserializeDisplayInfo(property.Value);
                    continue;
                }
                if (property.NameEquals("hierarchyInformation"))
                {
                    hierarchyInformation = HierarchyInformation.DeserializeHierarchyInformation(property.Value);
                    continue;
                }
                if (property.NameEquals("count"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    count = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("productDoubleEncryptionStatus"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    productDoubleEncryptionStatus = new DoubleEncryptionStatus(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("deviceDetails"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <DeviceDetails> array = new List <DeviceDetails>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(Models.DeviceDetails.DeserializeDeviceDetails(item));
                    }
                    deviceDetails = array;
                    continue;
                }
            }
            return(new ProductDetails(displayInfo.Value, hierarchyInformation, Optional.ToNullable(count), Optional.ToNullable(productDoubleEncryptionStatus), Optional.ToList(deviceDetails)));
        }