Example #1
0
        public GremlinGraphCreateUpdateOptions(Location location, GremlinGraphResource resource) : base(location)
        {
            if (resource == null)
            {
                throw new ArgumentNullException(nameof(resource));
            }

            Resource = resource;
        }
        public GremlinGraphCreateUpdateParameters(GremlinGraphResource resource, CreateUpdateOptions options)
        {
            if (resource == null)
            {
                throw new ArgumentNullException(nameof(resource));
            }
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            Resource = resource;
            Options  = options;
        }
Example #3
0
 internal GremlinGraphCreateUpdateOptions(ResourceIdentifier id, string name, ResourceType type, IDictionary <string, string> tags, Location location, GremlinGraphResource resource, CreateUpdateOptions options) : base(id, name, type, tags, location)
 {
     Resource = resource;
     Options  = options;
 }
Example #4
0
        internal static GremlinGraphCreateUpdateOptions DeserializeGremlinGraphCreateUpdateOptions(JsonElement element)
        {
            IDictionary <string, string> tags       = default;
            Location                       location = default;
            ResourceIdentifier             id       = default;
            string                         name     = default;
            ResourceType                   type     = default;
            GremlinGraphResource           resource = default;
            Optional <CreateUpdateOptions> options  = 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("resource"))
                        {
                            resource = GremlinGraphResource.DeserializeGremlinGraphResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("options"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            options = CreateUpdateOptions.DeserializeCreateUpdateOptions(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new GremlinGraphCreateUpdateOptions(id, name, type, tags, location, resource, options.Value));
        }
 internal GremlinGraphCreateUpdateData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, GremlinGraphResource resource, CreateUpdateOptions options) : base(id, name, resourceType, systemData, tags, location)
 {
     Resource = resource;
     Options  = options;
 }
 internal GremlinGraphCreateUpdateParameters(string id, string name, string type, string location, IDictionary <string, string> tags, GremlinGraphResource resource, CreateUpdateOptions options) : base(id, name, type, location, tags)
 {
     Resource = resource;
     Options  = options;
 }
Example #7
0
        internal static GremlinGraphCreateUpdateParameters DeserializeGremlinGraphCreateUpdateParameters(JsonElement element)
        {
            Optional <string> id       = default;
            Optional <string> name     = default;
            Optional <string> type     = default;
            Optional <string> location = default;
            Optional <IDictionary <string, string> > tags = default;
            GremlinGraphResource resource = default;
            CreateUpdateOptions  options  = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = 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("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    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("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("resource"))
                        {
                            resource = GremlinGraphResource.DeserializeGremlinGraphResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("options"))
                        {
                            options = CreateUpdateOptions.DeserializeCreateUpdateOptions(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new GremlinGraphCreateUpdateParameters(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), resource, options));
        }