From 8a74ec759f145ad26eaf52e653ad1be7a75a2d48 Mon Sep 17 00:00:00 2001 From: Sam O'Connor Date: Fri, 10 Nov 2017 14:01:16 +1100 Subject: [PATCH] fix for https://github.com/JuliaCloud/AWSSDK.jl/issues/5 --- src/AWSAPI.jl | 15 ++++++++++++--- src/HTML2MD.jl | 2 +- src/Services.jl | 18 ++++++++++++++++++ 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/AWSAPI.jl b/src/AWSAPI.jl index 5973430..88b0fce 100644 --- a/src/AWSAPI.jl +++ b/src/AWSAPI.jl @@ -52,7 +52,17 @@ is_rest_service(service) = ismatch(r"^rest", service["metadata"]["protocol"]) function member_name(service, name, info) - name = get(info, "locationName", name) + if haskey(info, "locationName") + name = info["locationName"] + else + shape = service["shapes"][info["shape"]] + if get(shape, "flattened", false) + if shape["type"] == "list" + name = shape["member"]["shape"] + name = get(shape["member"], "locationName", name) + end + end + end if service["metadata"]["signingName"] == "ec2" name = string(uppercase(name[1]), name[2:end]) @@ -69,7 +79,6 @@ function service_args(service, name) m = filter((n, i) -> (n in get(shape, "required", [])), shape["members"]) - args = join(["$(member_name(service, name, info))=" for (name, info) in m], ", ") if length(m) < length(shape["members"]) @@ -243,7 +252,7 @@ function service_operation(service, operation, info) # Example: $(eg["title"]) - $(eg["description"]) + $(get(eg,"description", "")) """ if haskey(eg, "input") diff --git a/src/HTML2MD.jl b/src/HTML2MD.jl index 845d177..fd9ea44 100644 --- a/src/HTML2MD.jl +++ b/src/HTML2MD.jl @@ -27,7 +27,7 @@ function start_node_server() @assert server_process == nothing if !isdir(joinpath(@__DIR__, "node_modules")) - run(`$(npm_cmd()) install to-markdown`, dir=@__DIR__) + run(setenv(`$(npm_cmd()) install to-markdown`, dir=@__DIR__)) end server_process = spawn(`$(nodejs_cmd()) -e """ diff --git a/src/Services.jl b/src/Services.jl index 8605ceb..5ecf3fe 100644 --- a/src/Services.jl +++ b/src/Services.jl @@ -1323,6 +1323,24 @@ polly(verb, resource, args=[]) = polly(a...; b...) = polly(a..., b) +function pricing(aws::AWSConfig, operation, args=[]) + + AWSCore.service_json( + aws; + service = "pricing", + version = "2017-10-15", + endpoint = "api.pricing", + json_version = "1.1", + target = "AWSPriceListService", + operation = operation, + args = args) +end + +pricing(operation, args=[]) = + pricing(default_aws_config(), operation, args) + +pricing(a...; b...) = pricing(a..., b) + function rds(aws::AWSConfig, operation, args=[]) AWSCore.service_query(