コード例 #1
0
 internal GalleryData(ResourceIdentifier id, string name, ResourceType type, IDictionary <string, string> tags, AzureLocation location, string description, GalleryIdentifier identifier, GalleryPropertiesProvisioningState?provisioningState, SharingProfile sharingProfile) : base(id, name, type, tags, location)
 {
     Description       = description;
     Identifier        = identifier;
     ProvisioningState = provisioningState;
     SharingProfile    = sharingProfile;
 }
コード例 #2
0
 internal GalleryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, string description, GalleryIdentifier identifier, GalleryPropertiesProvisioningState?provisioningState, SharingProfile sharingProfile, SoftDeletePolicy softDeletePolicy) : base(id, name, resourceType, systemData, tags, location)
 {
     Description       = description;
     Identifier        = identifier;
     ProvisioningState = provisioningState;
     SharingProfile    = sharingProfile;
     SoftDeletePolicy  = softDeletePolicy;
 }
コード例 #3
0
        internal static GalleryData DeserializeGalleryData(JsonElement element)
        {
            IDictionary <string, string> tags        = default;
            AzureLocation                location    = default;
            ResourceIdentifier           id          = default;
            string                       name        = default;
            ResourceType                 type        = default;
            Optional <string>            description = default;
            Optional <GalleryIdentifier> identifier  = default;
            Optional <GalleryPropertiesProvisioningState> provisioningState = default;
            Optional <SharingProfile>   sharingProfile   = default;
            Optional <SoftDeletePolicy> softDeletePolicy = 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 = 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 = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("description"))
                        {
                            description = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("identifier"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            identifier = GalleryIdentifier.DeserializeGalleryIdentifier(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new GalleryPropertiesProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("sharingProfile"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            sharingProfile = SharingProfile.DeserializeSharingProfile(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("softDeletePolicy"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            softDeletePolicy = SoftDeletePolicy.DeserializeSoftDeletePolicy(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new GalleryData(id, name, type, tags, location, description.Value, identifier.Value, Optional.ToNullable(provisioningState), sharingProfile.Value, softDeletePolicy.Value));
        }