Code Monkey home page Code Monkey logo

gcp.jl's People

Contributors

juliatagbot avatar rana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gcp.jl's Issues

Getting StackOverflowError when running runBootstrap.jl

I get this error here. Probably I missed something simple:
Steps to reproduce:

  • clone repo
  • activate environment
  • work in test dir
  • include("runbootstrap.jl")

[ Info: ===> sorting:TableDataList refs:2
[ Info: ("try sort", "Model")
ERROR: LoadError: StackOverflowError:
Stacktrace:
[1] topologicalSort(::Main.Bootstrap.Rest.Schema, ::Array{Main.Bootstrap.Rest.Schema,1}) at D:\steph\git\GCP.jl\src\bootstrap.jl:304
[2] topologicalSort(::Main.Bootstrap.Rest.Schema, ::Array{Main.Bootstrap.Rest.Schema,1}) at D:\steph\git\GCP.jl\src\bootstrap.jl:307 (repeats 18603 times)
[3] convert(::Type{Expr}, ::Main.Bootstrap.Rest.Service) at D:\steph\git\GCP.jl\src\bootstrap.jl:807
[4] emitService(::Main.Bootstrap.Rest.Service, ::String) at D:\steph\git\GCP.jl\src\bootstrap.jl:920
[5] emitGcp(::Main.Bootstrap.Rest.Service) at D:\steph\git\GCP.jl\src\bootstrap.jl:331

Building APIs with ProtoBuf definitions

I am experimenting with API generation with .proto definitions like this. Would you be interested in experimenting with these.

https://github.com/googleapis/googleapis.github.io/blob/master/examples/rpc/swift/SETUP.sh

I used ProtoBuf.jl to generate Client Stubs. Julia example below.

using HTTP

include("language_service_pb.jl")


# construct data
doc = Document()
doc._type = Document_Type.PLAIN_TEXT
doc.language = "en"

ent = AnalyzeEntitiesRequest()
ent.document = doc


iob = IOBuffer()
writeproto(iob, ent)
write_proto_bytes = take!(iob)

headers = Dict(
    "X-Goog-Api-Key" => "**********",
    "User-Agent" => "myapp/0.1",
    "Content-Type" => "application/x-protobuf",
)

 # we get the bytes
data_response_bytes = HTTP.request(
    "POST",
    "https://language.googleapis.com/\$rpc/google.cloud.language.v1.LanguageService/AnalyzeEntities",
    headers,
    write_proto_bytes,
).body
entreponse = AnalyzeEntitiesResponse()



# create into IOBuffer from ByteArray
response_buffer = IOBuffer(data_response_bytes)
readproto(IOBuffer(data_response_bytes), entreponse)

"""
entreponse
AnalyzeEntitiesResponse(Entity[Entity("rain", 7, #undef, 0.6791929f0, EntityMention[EntityMention(TextSpan("rain", -1), 2, #undef)], #undef), Entity("plain", 7, #undef, 0.17278467f0, EntityMention[EntityMention(TextSpan("plain", -1), 2, #undef)], #undef), Entity("Spain", 2, #undef, 0.14802246f0, EntityMention[EntityMention(TextSpan("Spain", -1), 1, #undef)], #undef)], "en")
"""

error generating API for sheets

i'm trying to add support for google sheets. i know it exists as it is documented and supported by the discovery service. get these errors though:

julia> Emit.getEmit(:sheets)
ERROR: HTTP.ExceptionRequest.StatusError(404, "GET", "/\$discovery/rest?version=v4", HTTP.Messages.Response:
"""
HTTP/1.1 404 Not Found
Content-Type: text/html; charset=UTF-8
Referrer-Policy: no-referrer
Content-Length: 1576
Date: Sun, 14 Jun 2020 12:08:44 GMT

<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.
⋮
1576-byte body
""")
Stacktrace:
 [1] request(::Type{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer{Union{}}}}}, ::HTTP.URIs.URI, ::Vararg{Any,N} where N; kw::Base.Iterators.Pairs{Symbol,Nothing,Tuple{Symbol},NamedTuple{(:iofunction,),Tuple{Nothing}}}) at /groups/scicompsoft/home/arthurb/.julia/packages/HTTP/BOJmV/src/ExceptionRequest.jl:22
 [2] (::Base.var"#58#60"{Base.var"#58#59#61"{ExponentialBackOff,HTTP.RetryRequest.var"#2#3"{Bool,HTTP.Messages.Request},typeof(HTTP.request)}})(::Type{T} where T, ::Vararg{Any,N} where N; kwargs::Base.Iterators.Pairs{Symbol,Nothing,Tuple{Symbol},NamedTuple{(:iofunction,),Tuple{Nothing}}}) at ./error.jl:288
 [3] #request#1 at /groups/scicompsoft/home/arthurb/.julia/packages/HTTP/BOJmV/src/RetryRequest.jl:44 [inlined]
 [4] request(::Type{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer{Union{}}}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::Array{UInt8,1}; http_version::VersionNumber, target::String, parent::Nothing, iofunction::Nothing, kw::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /groups/scicompsoft/home/arthurb/.julia/packages/HTTP/BOJmV/src/MessageRequest.jl:51
 [5] request at /groups/scicompsoft/home/arthurb/.julia/packages/HTTP/BOJmV/src/MessageRequest.jl:28 [inlined]
 [6] request(::Type{HTTP.BasicAuthRequest.BasicAuthLayer{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer{Union{}}}}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::Array{UInt8,1}; kw::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /groups/scicompsoft/home/arthurb/.julia/packages/HTTP/BOJmV/src/BasicAuthRequest.jl:28
 [7] request at /groups/scicompsoft/home/arthurb/.julia/packages/HTTP/BOJmV/src/BasicAuthRequest.jl:21 [inlined]
 [8] request(::Type{HTTP.RedirectRequest.RedirectLayer{HTTP.BasicAuthRequest.BasicAuthLayer{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer{Union{}}}}}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::Array{UInt8,1}; redirect_limit::Int64, forwardheaders::Bool, kw::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /groups/scicompsoft/home/arthurb/.julia/packages/HTTP/BOJmV/src/RedirectRequest.jl:24
 [9] request(::Type{HTTP.RedirectRequest.RedirectLayer{HTTP.BasicAuthRequest.BasicAuthLayer{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer{Union{}}}}}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::Array{UInt8,1}) at /groups/scicompsoft/home/arthurb/.julia/packages/HTTP/BOJmV/src/RedirectRequest.jl:21
 [10] request(::String, ::String, ::Array{Pair{SubString{String},SubString{String}},1}, ::Array{UInt8,1}; headers::Array{Pair{SubString{String},SubString{String}},1}, body::Array{UInt8,1}, query::Nothing, kw::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /groups/scicompsoft/home/arthurb/.julia/packages/HTTP/BOJmV/src/HTTP.jl:314
 [11] request at /groups/scicompsoft/home/arthurb/.julia/packages/HTTP/BOJmV/src/HTTP.jl:314 [inlined] (repeats 2 times)
 [12] #get#12 at /groups/scicompsoft/home/arthurb/.julia/packages/HTTP/BOJmV/src/HTTP.jl:391 [inlined]
 [13] get at /groups/scicompsoft/home/arthurb/.julia/packages/HTTP/BOJmV/src/HTTP.jl:391 [inlined]
 [14] get(::String; kws::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /groups/scicompsoft/home/arthurb/.julia/packages/GCP/qh4tD/src/bootstrap.jl:266
 [15] get at /groups/scicompsoft/home/arthurb/.julia/packages/GCP/qh4tD/src/bootstrap.jl:266 [inlined]
 [16] getService(::Symbol; kws::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /groups/scicompsoft/home/arthurb/.julia/packages/GCP/qh4tD/src/bootstrap.jl:272
 [17] getService at /groups/scicompsoft/home/arthurb/.julia/packages/GCP/qh4tD/src/bootstrap.jl:270 [inlined]
 [18] getEmit(::Symbol; kws::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /groups/scicompsoft/home/arthurb/.julia/packages/GCP/qh4tD/src/bootstrap.jl:319
 [19] getEmit(::Symbol) at /groups/scicompsoft/home/arthurb/.julia/packages/GCP/qh4tD/src/bootstrap.jl:317
 [20] top-level scope at REPL[2]:2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.