From 2b62da51aaf81d8b9f8cd2b56a20ec32487cae56 Mon Sep 17 00:00:00 2001 From: Andrew Newdigate Date: Mon, 24 Apr 2017 22:38:26 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20Feature:=20Added=20grpc-gateway?= =?UTF-8?q?=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _support/generate-from-proto | 8 +- _support/install-protoc | 8 +- commit.proto | 8 +- diff.proto | 8 +- go/commit.pb.go | 34 +-- go/commit.pb.gw.go | 110 +++++++++ go/diff.pb.go | 48 ++-- go/diff.pb.gw.go | 118 ++++++++++ go/notifications.pb.go | 24 +- go/notifications.pb.gw.go | 110 +++++++++ go/ref.pb.go | 98 ++++---- go/ref.pb.gw.go | 314 ++++++++++++++++++++++++++ go/shared.pb.go | 26 ++- go/smarthttp.pb.go | 48 ++-- go/smarthttp.pb.gw.go | 339 ++++++++++++++++++++++++++++ go/ssh.pb.go | 43 ++-- go/ssh.pb.gw.go | 233 +++++++++++++++++++ notifications.proto | 8 +- ref.proto | 40 +++- ruby/lib/gitaly/commit_pb.rb | 1 + ruby/lib/gitaly/diff_pb.rb | 1 + ruby/lib/gitaly/notifications_pb.rb | 1 + ruby/lib/gitaly/ref_pb.rb | 1 + ruby/lib/gitaly/shared_pb.rb | 1 + ruby/lib/gitaly/smarthttp_pb.rb | 1 + ruby/lib/gitaly/ssh_pb.rb | 1 + shared.proto | 2 + smarthttp.proto | 29 ++- ssh.proto | 15 +- swagger/commit.swagger.json | 84 +++++++ swagger/diff.swagger.json | 116 ++++++++++ swagger/notifications.swagger.json | 72 ++++++ swagger/ref.swagger.json | 321 ++++++++++++++++++++++++++ swagger/shared.swagger.json | 19 ++ swagger/smarthttp.swagger.json | 214 ++++++++++++++++++ swagger/ssh.swagger.json | 170 ++++++++++++++ 36 files changed, 2513 insertions(+), 161 deletions(-) create mode 100644 go/commit.pb.gw.go create mode 100644 go/diff.pb.gw.go create mode 100644 go/notifications.pb.gw.go create mode 100644 go/ref.pb.gw.go create mode 100644 go/smarthttp.pb.gw.go create mode 100644 go/ssh.pb.gw.go create mode 100644 swagger/commit.swagger.json create mode 100644 swagger/diff.swagger.json create mode 100644 swagger/notifications.swagger.json create mode 100644 swagger/ref.swagger.json create mode 100644 swagger/shared.swagger.json create mode 100644 swagger/smarthttp.swagger.json create mode 100644 swagger/ssh.swagger.json diff --git a/_support/generate-from-proto b/_support/generate-from-proto index 39c2acf9..a03f5493 100755 --- a/_support/generate-from-proto +++ b/_support/generate-from-proto @@ -5,13 +5,14 @@ require 'fileutils' require_relative 'run.rb' +GO_PATH = ENV['GOPATH'] PROTO_INCLUDE = '.' PROTO_FILES = Dir['*.proto'].sort RUBY_PREFIX = 'ruby/lib' RUBY_VERSION_FILE = 'gitaly/version.rb' ENV['PATH'] = [ - File.join(ENV['GOPATH'], 'bin'), + File.join(GO_PATH, 'bin'), File.join(Dir.pwd, '_support/protoc/bin'), File.join(Dir.pwd, '_support/bin'), ENV['PATH'], @@ -19,11 +20,12 @@ ENV['PATH'] = [ def main FileUtils.rm(Dir['go/**/*.pb.go']) - run!(%W[protoc -I #{PROTO_INCLUDE}] + PROTO_FILES + %w[--go_out=plugins=grpc:go]) + FileUtils.rm(Dir['swagger/**']) + run!(%W[protoc -I#{GO_PATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis -I #{PROTO_INCLUDE}] + PROTO_FILES + %w[--go_out=plugins=grpc:go --grpc-gateway_out=go --swagger_out=logtostderr=true:swagger]) FileUtils.rm(Dir[File.join(RUBY_PREFIX, '**/*_pb.rb')]) ruby_lib_gitaly = File.join(RUBY_PREFIX, 'gitaly') - run!(%W[grpc_tools_ruby_protoc -I #{PROTO_INCLUDE} --ruby_out=#{ruby_lib_gitaly} --grpc_out=#{ruby_lib_gitaly}] + PROTO_FILES) + run!(%W[grpc_tools_ruby_protoc -I#{GO_PATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis -I #{PROTO_INCLUDE} --ruby_out=#{ruby_lib_gitaly} --grpc_out=#{ruby_lib_gitaly}] + PROTO_FILES) write_ruby_requires end diff --git a/_support/install-protoc b/_support/install-protoc index 3ed01e4d..bfe19ce1 100755 --- a/_support/install-protoc +++ b/_support/install-protoc @@ -29,10 +29,16 @@ def main run!(%W[unzip #{File.expand_path(File.basename(PROTOC_DOWNLOAD[current_platform]['url']))}], PROTOC_DIR) # Go-specific libraries - %w[proto protoc-gen-go].each do |pkg| + %w[proto protoc-gen-go ].each do |pkg| run!(%W[go get -u github.com/golang/protobuf/#{pkg}]) end + # grpc-gateway-specific libraries + %w[protoc-gen-grpc-gateway protoc-gen-swagger].each do |pkg| + run!(%W[go get -u github.com/grpc-ecosystem/grpc-gateway/#{pkg}]) + end + + run!(%w[bundle install --binstubs], '_support') end diff --git a/commit.proto b/commit.proto index f4516779..6a1b830f 100644 --- a/commit.proto +++ b/commit.proto @@ -3,9 +3,15 @@ syntax = "proto3"; package gitaly; import "shared.proto"; +import "google/api/annotations.proto"; service Commit { - rpc CommitIsAncestor(CommitIsAncestorRequest) returns (CommitIsAncestorResponse) {} + rpc CommitIsAncestor(CommitIsAncestorRequest) returns (CommitIsAncestorResponse) { + option (google.api.http) = { + post: "/v1/commit/commit_is_ancestor" + body: "*" + }; + } } message CommitIsAncestorRequest { diff --git a/diff.proto b/diff.proto index db0fd03c..27b0e496 100644 --- a/diff.proto +++ b/diff.proto @@ -3,10 +3,16 @@ syntax = "proto3"; package gitaly; import "shared.proto"; +import "google/api/annotations.proto"; service Diff { // Returns stream of CommitDiffResponse: 1 per changed file - rpc CommitDiff(CommitDiffRequest) returns (stream CommitDiffResponse) {}; + rpc CommitDiff(CommitDiffRequest) returns (stream CommitDiffResponse) { + option (google.api.http) = { + post: "/v1/diff/commit_diff" + body: "*" + }; + }; } message CommitDiffRequest { diff --git a/go/commit.pb.go b/go/commit.pb.go index 9d984bee..649d8b92 100644 --- a/go/commit.pb.go +++ b/go/commit.pb.go @@ -51,6 +51,7 @@ package gitaly import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" import ( context "golang.org/x/net/context" @@ -196,19 +197,22 @@ var _Commit_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("commit.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 213 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x50, 0xbf, 0x4e, 0x84, 0x30, - 0x18, 0xb7, 0x1a, 0x11, 0x3f, 0x18, 0xcc, 0x17, 0x13, 0x91, 0x05, 0xc2, 0xc4, 0x44, 0x0c, 0x3e, - 0x81, 0x71, 0x62, 0xed, 0xe2, 0x68, 0x2a, 0x6d, 0xa4, 0x09, 0x50, 0x6c, 0x8b, 0x09, 0x8f, 0x70, - 0x6f, 0x7d, 0xb9, 0xf6, 0xb8, 0x5c, 0xee, 0xc2, 0xf8, 0xfb, 0xdb, 0x5f, 0x3f, 0x88, 0x5b, 0x35, - 0x0c, 0xd2, 0x56, 0x93, 0x56, 0x56, 0x61, 0xf0, 0x2b, 0x2d, 0xeb, 0x97, 0x34, 0x36, 0x1d, 0xd3, - 0x82, 0x7b, 0xb6, 0xd8, 0x11, 0x78, 0xf9, 0x74, 0xb6, 0xc6, 0x7c, 0x8c, 0xad, 0x30, 0x56, 0x69, - 0x2a, 0xfe, 0x66, 0x61, 0x2c, 0xd6, 0x00, 0x5a, 0x4c, 0xca, 0x48, 0xab, 0xf4, 0x92, 0x90, 0x9c, - 0x94, 0x51, 0x8d, 0x95, 0xaf, 0xa9, 0xe8, 0x49, 0xa1, 0x67, 0x2e, 0xcc, 0x20, 0x62, 0xc7, 0x9a, - 0x6f, 0xc9, 0x93, 0xdb, 0x9c, 0x94, 0x8f, 0x14, 0x56, 0xaa, 0xe1, 0xf8, 0x0a, 0x61, 0xdb, 0xc9, - 0x9e, 0x1f, 0xd4, 0x3b, 0xa7, 0x3e, 0x38, 0xdc, 0xf0, 0xe2, 0x0d, 0x92, 0xeb, 0x29, 0x66, 0x52, - 0xa3, 0x11, 0xf8, 0x0c, 0xf7, 0xff, 0xac, 0x9f, 0x85, 0x9b, 0x11, 0x52, 0x0f, 0x6a, 0x06, 0x81, - 0x4f, 0xe0, 0x17, 0x3c, 0x5d, 0x66, 0x31, 0x5b, 0xb7, 0x6e, 0x7c, 0x30, 0xcd, 0xb7, 0x0d, 0xfe, - 0xd9, 0xe2, 0xe6, 0x27, 0x70, 0x77, 0x7a, 0xdf, 0x07, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x48, 0xb7, - 0xcb, 0x4d, 0x01, 0x00, 0x00, + // 266 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x90, 0xcf, 0x4a, 0xc3, 0x40, + 0x10, 0xc6, 0xd9, 0x8a, 0xb1, 0x4e, 0x7b, 0x90, 0x45, 0x30, 0x06, 0xa5, 0x21, 0xa7, 0xe0, 0x21, + 0xd1, 0x78, 0xf3, 0x26, 0x9e, 0x72, 0xdd, 0x17, 0x08, 0x6b, 0x76, 0x49, 0x17, 0xd2, 0x9d, 0xb8, + 0xbb, 0x2d, 0xf4, 0x24, 0x78, 0xeb, 0xd9, 0x47, 0xf3, 0x15, 0x7c, 0x10, 0x71, 0xb7, 0x11, 0x51, + 0x7a, 0x1a, 0x66, 0x7e, 0xf3, 0xe7, 0x9b, 0x0f, 0xe6, 0x2d, 0xae, 0x56, 0xca, 0x15, 0x83, 0x41, + 0x87, 0x34, 0xea, 0x94, 0xe3, 0xfd, 0x36, 0x99, 0xdb, 0x25, 0x37, 0x52, 0x84, 0x6a, 0x72, 0xd5, + 0x21, 0x76, 0xbd, 0x2c, 0xf9, 0xa0, 0x4a, 0xae, 0x35, 0x3a, 0xee, 0x14, 0x6a, 0x1b, 0x68, 0xb6, + 0x23, 0x70, 0xf1, 0xe4, 0x97, 0xd4, 0xf6, 0x51, 0xb7, 0xd2, 0x3a, 0x34, 0x4c, 0xbe, 0xac, 0xa5, + 0x75, 0xb4, 0x02, 0x30, 0x72, 0x40, 0xab, 0x1c, 0x9a, 0x6d, 0x4c, 0x52, 0x92, 0xcf, 0x2a, 0x5a, + 0x84, 0x23, 0x05, 0xfb, 0x21, 0xec, 0x57, 0x17, 0x5d, 0xc0, 0x8c, 0xef, 0xd7, 0x34, 0x4a, 0xc4, + 0x93, 0x94, 0xe4, 0xa7, 0x0c, 0xc6, 0x52, 0x2d, 0xe8, 0x25, 0x4c, 0xdb, 0xa5, 0xea, 0xc5, 0x37, + 0x3d, 0xf2, 0xf4, 0xc4, 0xe7, 0xb5, 0xc8, 0x6e, 0x21, 0xfe, 0x2f, 0xc5, 0x0e, 0xa8, 0xad, 0xa4, + 0xe7, 0x70, 0xbc, 0xe1, 0xfd, 0x5a, 0x7a, 0x19, 0x53, 0x16, 0x92, 0x6a, 0x47, 0x20, 0x0a, 0x23, + 0xf4, 0x15, 0xce, 0xfe, 0x0e, 0xd3, 0xc5, 0x28, 0xf6, 0xc0, 0x87, 0x49, 0x7a, 0xb8, 0x21, 0xdc, + 0xcd, 0xf2, 0xb7, 0x8f, 0xcf, 0xf7, 0x49, 0x96, 0x5d, 0x97, 0x9b, 0xbb, 0x32, 0xb8, 0xbd, 0x0f, + 0x8d, 0xb2, 0xcd, 0xf8, 0xd7, 0x03, 0xb9, 0x79, 0x8e, 0xbc, 0xa1, 0xf7, 0x5f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x6a, 0x67, 0x35, 0xe9, 0x94, 0x01, 0x00, 0x00, } diff --git a/go/commit.pb.gw.go b/go/commit.pb.gw.go new file mode 100644 index 00000000..28dc06a0 --- /dev/null +++ b/go/commit.pb.gw.go @@ -0,0 +1,110 @@ +// Code generated by protoc-gen-grpc-gateway +// source: commit.proto +// DO NOT EDIT! + +/* +Package gitaly is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package gitaly + +import ( + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" +) + +var _ codes.Code +var _ io.Reader +var _ = runtime.String +var _ = utilities.NewDoubleArray + +func request_Commit_CommitIsAncestor_0(ctx context.Context, marshaler runtime.Marshaler, client CommitClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CommitIsAncestorRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CommitIsAncestor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +// RegisterCommitHandlerFromEndpoint is same as RegisterCommitHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterCommitHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterCommitHandler(ctx, mux, conn) +} + +// RegisterCommitHandler registers the http handlers for service Commit to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterCommitHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + client := NewCommitClient(conn) + + mux.Handle("POST", pattern_Commit_CommitIsAncestor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + } + resp, md, err := request_Commit_CommitIsAncestor_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Commit_CommitIsAncestor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Commit_CommitIsAncestor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "commit", "commit_is_ancestor"}, "")) +) + +var ( + forward_Commit_CommitIsAncestor_0 = runtime.ForwardResponseMessage +) diff --git a/go/diff.pb.go b/go/diff.pb.go index f2b0c7c9..db345f07 100644 --- a/go/diff.pb.go +++ b/go/diff.pb.go @@ -7,6 +7,7 @@ package gitaly import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" import ( context "golang.org/x/net/context" @@ -233,26 +234,29 @@ var _Diff_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("diff.proto", fileDescriptor1) } var fileDescriptor1 = []byte{ - // 328 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xdd, 0x4a, 0xf3, 0x30, - 0x18, 0xc7, 0xdf, 0xec, 0xa3, 0xeb, 0x9e, 0xb7, 0x2a, 0x46, 0xd0, 0x6e, 0x22, 0x94, 0x21, 0xd2, - 0xa3, 0x21, 0xf3, 0x12, 0x26, 0xc8, 0x0e, 0x44, 0xc9, 0x0d, 0x94, 0x6c, 0x49, 0xd7, 0x60, 0xdb, - 0xa7, 0xa6, 0x19, 0x65, 0x17, 0xe2, 0x25, 0x7a, 0x1f, 0xd2, 0xc4, 0xcd, 0x82, 0x1e, 0xe6, 0xf7, - 0xfb, 0x27, 0x79, 0x3e, 0x00, 0x84, 0x4a, 0xd3, 0x79, 0xa5, 0xd1, 0x20, 0xf5, 0xb6, 0xca, 0xf0, - 0x7c, 0x3f, 0x0d, 0xea, 0x8c, 0x6b, 0x29, 0x1c, 0x9d, 0x7d, 0x10, 0x38, 0x5f, 0x62, 0x51, 0x28, - 0xf3, 0xa8, 0xd2, 0x94, 0xc9, 0xf7, 0x9d, 0xac, 0x0d, 0x5d, 0x00, 0x68, 0x59, 0x61, 0xad, 0x0c, - 0xea, 0x7d, 0x48, 0x22, 0x12, 0xff, 0x5f, 0xd0, 0xb9, 0x7b, 0x60, 0xce, 0x8e, 0x86, 0x75, 0x52, - 0xf4, 0x16, 0x4e, 0x73, 0x99, 0x9a, 0x64, 0x63, 0x5f, 0x4b, 0x94, 0x08, 0x7b, 0x11, 0x89, 0xc7, - 0x2c, 0x68, 0xa9, 0xfb, 0x62, 0x25, 0xe8, 0x1d, 0x9c, 0x69, 0xb5, 0xcd, 0xba, 0xb1, 0xbe, 0x8d, - 0x9d, 0x58, 0x7c, 0xc8, 0xcd, 0x3e, 0x09, 0xd0, 0x6e, 0x5d, 0x75, 0x85, 0x65, 0x2d, 0xe9, 0x35, - 0x8c, 0x53, 0x8d, 0x45, 0x52, 0x71, 0x93, 0xd9, 0xba, 0x02, 0xe6, 0xb7, 0xe0, 0x95, 0x9b, 0x8c, - 0x5e, 0xc1, 0xc8, 0xa0, 0x53, 0x3d, 0xab, 0x3c, 0x83, 0x07, 0x61, 0x6f, 0x1d, 0x3f, 0xf3, 0xda, - 0xe3, 0x4a, 0xd0, 0x0b, 0x18, 0x1a, 0x6c, 0xf1, 0xc0, 0xe2, 0x81, 0xc1, 0x95, 0xa0, 0x13, 0xf0, - 0x31, 0x17, 0x49, 0x81, 0x42, 0x86, 0xc3, 0x88, 0xc4, 0x43, 0x36, 0xc2, 0x5c, 0x3c, 0xa3, 0x90, - 0xad, 0x2a, 0x65, 0xe3, 0x94, 0xe7, 0x54, 0x29, 0x1b, 0xab, 0x2e, 0xc1, 0x5b, 0xab, 0x92, 0xeb, - 0x7d, 0x38, 0x8a, 0x48, 0xec, 0xb3, 0xef, 0x13, 0xbd, 0x01, 0xd0, 0xbc, 0x49, 0x36, 0xd9, 0xae, - 0x7c, 0xab, 0x43, 0x3f, 0xea, 0xc7, 0x01, 0x1b, 0x6b, 0xde, 0x2c, 0x2d, 0x58, 0xbc, 0xc0, 0xa0, - 0x6d, 0x90, 0x3e, 0x01, 0xfc, 0xb4, 0x4b, 0x27, 0x87, 0x59, 0xff, 0x5a, 0xcd, 0x74, 0xfa, 0x97, - 0x72, 0xd3, 0x99, 0xfd, 0xbb, 0x27, 0x6b, 0xcf, 0xee, 0xf5, 0xe1, 0x2b, 0x00, 0x00, 0xff, 0xff, - 0xca, 0xe9, 0x71, 0x86, 0xfb, 0x01, 0x00, 0x00, + // 376 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x92, 0x4f, 0x8e, 0xd3, 0x30, + 0x14, 0xc6, 0xe5, 0x4e, 0x9b, 0xb6, 0x8f, 0x00, 0xc2, 0x20, 0x48, 0x03, 0x88, 0x28, 0x42, 0x28, + 0x62, 0xd1, 0x40, 0xd9, 0xb1, 0x1d, 0x36, 0x5d, 0x20, 0x21, 0x5f, 0x20, 0xf2, 0x8c, 0x9d, 0xc4, + 0x22, 0xf1, 0x0b, 0x8e, 0x87, 0xa8, 0x5b, 0xae, 0x80, 0x38, 0x19, 0x57, 0x80, 0x7b, 0x20, 0xdb, + 0xd3, 0x52, 0x09, 0x76, 0x79, 0xdf, 0xef, 0xcb, 0xfb, 0x6b, 0x00, 0xa1, 0xea, 0x7a, 0x3b, 0x18, + 0xb4, 0x48, 0xa3, 0x46, 0x59, 0xde, 0x1d, 0xd2, 0x78, 0x6c, 0xb9, 0x91, 0x22, 0xa8, 0xe9, 0xb3, + 0x06, 0xb1, 0xe9, 0x64, 0xc9, 0x07, 0x55, 0x72, 0xad, 0xd1, 0x72, 0xab, 0x50, 0x8f, 0x81, 0xe6, + 0x3f, 0x08, 0x3c, 0xb8, 0xc4, 0xbe, 0x57, 0xf6, 0x83, 0xaa, 0x6b, 0x26, 0xbf, 0xdc, 0xc8, 0xd1, + 0xd2, 0x1d, 0x80, 0x91, 0x03, 0x8e, 0xca, 0xa2, 0x39, 0x24, 0x24, 0x23, 0xc5, 0x9d, 0x1d, 0xdd, + 0x86, 0xf4, 0x5b, 0x76, 0x22, 0xec, 0xcc, 0x45, 0x5f, 0xc2, 0xbd, 0x4e, 0xd6, 0xb6, 0xba, 0xf6, + 0xd9, 0x2a, 0x25, 0x92, 0x59, 0x46, 0x8a, 0x35, 0x8b, 0x9d, 0x1a, 0x4a, 0xec, 0x05, 0x7d, 0x05, + 0xf7, 0x8d, 0x6a, 0xda, 0x73, 0xdb, 0x85, 0xb7, 0xdd, 0xf5, 0xf2, 0xd1, 0x97, 0xff, 0x26, 0x40, + 0xcf, 0xfb, 0x1a, 0x07, 0xd4, 0xa3, 0xa4, 0x4f, 0x61, 0x5d, 0x1b, 0xec, 0xab, 0x81, 0xdb, 0xd6, + 0xf7, 0x15, 0xb3, 0x95, 0x13, 0x3e, 0x71, 0xdb, 0xd2, 0x27, 0xb0, 0xb4, 0x18, 0xd0, 0xcc, 0xa3, + 0xc8, 0xe2, 0x11, 0xf8, 0xbf, 0x4e, 0xc5, 0x22, 0x17, 0xee, 0x05, 0x7d, 0x08, 0x0b, 0x8b, 0x4e, + 0x9e, 0x7b, 0x79, 0x6e, 0x71, 0x2f, 0xe8, 0x06, 0x56, 0xd8, 0x89, 0xaa, 0x47, 0x21, 0x93, 0x45, + 0x46, 0x8a, 0x05, 0x5b, 0x62, 0x27, 0x3e, 0xa2, 0x90, 0x0e, 0x69, 0x39, 0x05, 0x14, 0x05, 0xa4, + 0xe5, 0xe4, 0xd1, 0x63, 0x88, 0xae, 0x94, 0xe6, 0xe6, 0x90, 0x2c, 0x33, 0x52, 0xac, 0xd8, 0x6d, + 0x44, 0x9f, 0x03, 0x18, 0x3e, 0x55, 0xd7, 0xed, 0x8d, 0xfe, 0x3c, 0x26, 0xab, 0xec, 0xa2, 0x88, + 0xd9, 0xda, 0xf0, 0xe9, 0xd2, 0x0b, 0x3b, 0x0d, 0x73, 0x37, 0x20, 0xad, 0x01, 0xfe, 0x8e, 0x4b, + 0x37, 0xc7, 0x5d, 0xff, 0x73, 0x9a, 0x34, 0xfd, 0x1f, 0x0a, 0xdb, 0xc9, 0x5f, 0x7c, 0xfb, 0xf9, + 0xeb, 0xfb, 0x6c, 0x93, 0x3f, 0x2a, 0xbf, 0xbe, 0x2d, 0xdd, 0xc3, 0x28, 0x6f, 0xb7, 0xec, 0xbe, + 0xdf, 0x93, 0xd7, 0x6f, 0xc8, 0x55, 0xe4, 0xcf, 0xfe, 0xee, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xae, 0xb5, 0x83, 0x87, 0x38, 0x02, 0x00, 0x00, } diff --git a/go/diff.pb.gw.go b/go/diff.pb.gw.go new file mode 100644 index 00000000..2972165b --- /dev/null +++ b/go/diff.pb.gw.go @@ -0,0 +1,118 @@ +// Code generated by protoc-gen-grpc-gateway +// source: diff.proto +// DO NOT EDIT! + +/* +Package gitaly is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package gitaly + +import ( + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" +) + +var _ codes.Code +var _ io.Reader +var _ = runtime.String +var _ = utilities.NewDoubleArray + +func request_Diff_CommitDiff_0(ctx context.Context, marshaler runtime.Marshaler, client DiffClient, req *http.Request, pathParams map[string]string) (Diff_CommitDiffClient, runtime.ServerMetadata, error) { + var protoReq CommitDiffRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.CommitDiff(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +// RegisterDiffHandlerFromEndpoint is same as RegisterDiffHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterDiffHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterDiffHandler(ctx, mux, conn) +} + +// RegisterDiffHandler registers the http handlers for service Diff to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterDiffHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + client := NewDiffClient(conn) + + mux.Handle("POST", pattern_Diff_CommitDiff_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + } + resp, md, err := request_Diff_CommitDiff_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Diff_CommitDiff_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Diff_CommitDiff_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "diff", "commit_diff"}, "")) +) + +var ( + forward_Diff_CommitDiff_0 = runtime.ForwardResponseStream +) diff --git a/go/notifications.pb.go b/go/notifications.pb.go index 7ecc1b45..a010836e 100644 --- a/go/notifications.pb.go +++ b/go/notifications.pb.go @@ -7,6 +7,7 @@ package gitaly import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" import ( context "golang.org/x/net/context" @@ -122,16 +123,19 @@ var _Notifications_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("notifications.proto", fileDescriptor2) } var fileDescriptor2 = []byte{ - // 163 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xce, 0xcb, 0x2f, 0xc9, + // 211 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x12, 0xce, 0xcb, 0x2f, 0xc9, 0x4c, 0xcb, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4b, 0xcf, 0x2c, 0x49, 0xcc, 0xa9, 0x94, 0xe2, 0x29, 0xce, 0x48, 0x2c, 0x4a, 0x4d, 0x81, - 0x88, 0x2a, 0x79, 0x70, 0x09, 0x05, 0xe4, 0x17, 0x97, 0x04, 0xa5, 0x26, 0xa7, 0x66, 0x96, 0xa5, - 0x06, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x08, 0x19, 0x71, 0x71, 0x15, 0xa5, 0x16, 0xe4, 0x17, - 0x67, 0x96, 0xe4, 0x17, 0x55, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0x09, 0xe9, 0x41, 0x0c, - 0xd0, 0x0b, 0x82, 0xcb, 0x04, 0x21, 0xa9, 0x52, 0x12, 0xe5, 0x12, 0x46, 0x31, 0xa9, 0xb8, 0x20, - 0x3f, 0xaf, 0x38, 0xd5, 0x28, 0x92, 0x8b, 0xd7, 0x0f, 0xd9, 0x35, 0x42, 0x1e, 0x5c, 0xdc, 0x48, - 0xea, 0x84, 0xa4, 0x60, 0xc6, 0x62, 0x3a, 0x43, 0x4a, 0x1a, 0xab, 0x1c, 0xc4, 0x60, 0x25, 0x86, - 0x24, 0x36, 0xb0, 0x17, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf2, 0x5e, 0x1f, 0x64, 0xef, - 0x00, 0x00, 0x00, + 0x88, 0x4a, 0xc9, 0xa4, 0xe7, 0xe7, 0xa7, 0xe7, 0xa4, 0xea, 0x27, 0x16, 0x64, 0xea, 0x27, 0xe6, + 0xe5, 0xe5, 0x97, 0x20, 0xeb, 0x51, 0xf2, 0xe0, 0x12, 0x0a, 0xc8, 0x2f, 0x2e, 0x09, 0x4a, 0x4d, + 0x4e, 0xcd, 0x2c, 0x4b, 0x0d, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0x32, 0xe2, 0xe2, 0x2a, + 0x4a, 0x2d, 0xc8, 0x2f, 0xce, 0x2c, 0xc9, 0x2f, 0xaa, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, + 0x12, 0xd2, 0x83, 0x18, 0xaf, 0x17, 0x04, 0x97, 0x09, 0x42, 0x52, 0xa5, 0x24, 0xca, 0x25, 0x8c, + 0x62, 0x52, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x51, 0x23, 0x23, 0x17, 0xaf, 0x1f, 0xb2, 0x63, + 0x85, 0x0a, 0xb8, 0xb8, 0x91, 0x14, 0x0a, 0x49, 0xc1, 0xcc, 0xc5, 0x74, 0x87, 0x94, 0x34, 0x56, + 0x39, 0x88, 0xc9, 0x4a, 0x1a, 0x4d, 0x97, 0x9f, 0x4c, 0x66, 0x52, 0x52, 0x92, 0xd5, 0x2f, 0x33, + 0xd4, 0x47, 0x0e, 0x0f, 0xfd, 0x82, 0xfc, 0xe2, 0x92, 0xf8, 0x22, 0x88, 0x72, 0x2b, 0x46, 0xad, + 0x24, 0x36, 0xb0, 0x5f, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf5, 0xb1, 0x23, 0x15, 0x36, + 0x01, 0x00, 0x00, } diff --git a/go/notifications.pb.gw.go b/go/notifications.pb.gw.go new file mode 100644 index 00000000..87caf475 --- /dev/null +++ b/go/notifications.pb.gw.go @@ -0,0 +1,110 @@ +// Code generated by protoc-gen-grpc-gateway +// source: notifications.proto +// DO NOT EDIT! + +/* +Package gitaly is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package gitaly + +import ( + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" +) + +var _ codes.Code +var _ io.Reader +var _ = runtime.String +var _ = utilities.NewDoubleArray + +func request_Notifications_PostReceive_0(ctx context.Context, marshaler runtime.Marshaler, client NotificationsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PostReceiveRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.PostReceive(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +// RegisterNotificationsHandlerFromEndpoint is same as RegisterNotificationsHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterNotificationsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterNotificationsHandler(ctx, mux, conn) +} + +// RegisterNotificationsHandler registers the http handlers for service Notifications to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterNotificationsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + client := NewNotificationsClient(conn) + + mux.Handle("POST", pattern_Notifications_PostReceive_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + } + resp, md, err := request_Notifications_PostReceive_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Notifications_PostReceive_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Notifications_PostReceive_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "notification", "post_receive"}, "")) +) + +var ( + forward_Notifications_PostReceive_0 = runtime.ForwardResponseMessage +) diff --git a/go/ref.pb.go b/go/ref.pb.go index 41165c0a..5a4e93d9 100644 --- a/go/ref.pb.go +++ b/go/ref.pb.go @@ -7,7 +7,8 @@ package gitaly import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import google_protobuf "github.com/golang/protobuf/ptypes/timestamp" +import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" +import _ "google.golang.org/genproto/googleapis/api/annotations" import ( context "golang.org/x/net/context" @@ -281,9 +282,9 @@ func (m *FindLocalBranchResponse) GetCommitCommitter() *FindLocalBranchCommitAut } type FindLocalBranchCommitAuthor struct { - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Email []byte `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` - Date *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=date" json:"date,omitempty"` + Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Email []byte `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` + Date *google_protobuf1.Timestamp `protobuf:"bytes,3,opt,name=date" json:"date,omitempty"` } func (m *FindLocalBranchCommitAuthor) Reset() { *m = FindLocalBranchCommitAuthor{} } @@ -305,7 +306,7 @@ func (m *FindLocalBranchCommitAuthor) GetEmail() []byte { return nil } -func (m *FindLocalBranchCommitAuthor) GetDate() *google_protobuf.Timestamp { +func (m *FindLocalBranchCommitAuthor) GetDate() *google_protobuf1.Timestamp { if m != nil { return m.Date } @@ -621,44 +622,51 @@ var _Ref_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("ref.proto", fileDescriptor3) } var fileDescriptor3 = []byte{ - // 615 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x51, 0x73, 0xd2, 0x4c, - 0x14, 0x6d, 0x0a, 0xe5, 0x6b, 0x2f, 0xf9, 0x5a, 0x5c, 0x6b, 0x8d, 0x41, 0x85, 0x46, 0x3b, 0xe2, - 0x4b, 0x70, 0xd2, 0xf1, 0xc9, 0x17, 0x29, 0xe0, 0xd4, 0x99, 0x8a, 0xce, 0x82, 0x8e, 0x0f, 0xce, - 0x30, 0x0b, 0x6c, 0x20, 0x4e, 0xc2, 0x62, 0xb2, 0x8c, 0xf2, 0xe0, 0x2f, 0xf0, 0x87, 0xf9, 0xe6, - 0x6f, 0x72, 0xd8, 0x4d, 0x68, 0xa0, 0x49, 0xea, 0x0c, 0x4f, 0xe1, 0xde, 0x3d, 0xe7, 0xde, 0xbb, - 0xf7, 0xb0, 0x07, 0x0e, 0x7c, 0x6a, 0x9b, 0x33, 0x9f, 0x71, 0x86, 0x0a, 0x63, 0x87, 0x13, 0x77, - 0xa1, 0xab, 0xc1, 0x84, 0xf8, 0x74, 0x24, 0xb3, 0x7a, 0x65, 0xcc, 0xd8, 0xd8, 0xa5, 0x75, 0x11, - 0x0d, 0xe6, 0x76, 0x9d, 0x3b, 0x1e, 0x0d, 0x38, 0xf1, 0x66, 0x12, 0x60, 0x60, 0x78, 0xf8, 0xc6, - 0x99, 0x8e, 0x5a, 0xd4, 0x26, 0x73, 0x97, 0x5f, 0xf8, 0x64, 0x3a, 0x9c, 0x74, 0x88, 0x47, 0x31, - 0xfd, 0x36, 0xa7, 0x01, 0x47, 0x16, 0x80, 0x4f, 0x67, 0x2c, 0x70, 0x38, 0xf3, 0x17, 0x9a, 0x52, - 0x55, 0x6a, 0x45, 0x0b, 0x99, 0xb2, 0x97, 0x89, 0x57, 0x27, 0x38, 0x86, 0x32, 0xce, 0xe1, 0x51, - 0x4a, 0xcd, 0x60, 0xc6, 0xa6, 0x01, 0x45, 0x08, 0xf2, 0x53, 0xe2, 0x51, 0x51, 0x4e, 0xc5, 0xe2, - 0xb7, 0xf1, 0x1e, 0x1e, 0x2c, 0x49, 0x0d, 0xd7, 0xbd, 0x26, 0x04, 0xdb, 0x4c, 0x61, 0x81, 0x9e, - 0x54, 0x30, 0x1c, 0xe1, 0x18, 0xf6, 0x96, 0x6d, 0x03, 0x4d, 0xa9, 0xe6, 0x6a, 0x2a, 0x96, 0x81, - 0x71, 0x05, 0x27, 0x21, 0xa7, 0x47, 0xc6, 0x5b, 0x4f, 0x50, 0x87, 0xfb, 0x37, 0xaa, 0x65, 0xb6, - 0xff, 0x09, 0x68, 0x49, 0xc0, 0xd4, 0xde, 0x52, 0x02, 0x54, 0x86, 0x83, 0x21, 0xf3, 0x3c, 0x87, - 0xf7, 0x9d, 0x91, 0xb6, 0x5b, 0x55, 0x6a, 0x07, 0x78, 0x5f, 0x26, 0xde, 0x8e, 0xd0, 0x09, 0x14, - 0x66, 0x3e, 0xb5, 0x9d, 0x1f, 0x5a, 0x4e, 0x08, 0x10, 0x46, 0xc6, 0x73, 0xb8, 0xbb, 0xd6, 0x3e, - 0x43, 0xad, 0xdf, 0x0a, 0x68, 0x4b, 0xec, 0x15, 0x1b, 0x92, 0x70, 0xbf, 0x5b, 0xed, 0x0a, 0xbd, - 0x86, 0xff, 0x02, 0xe6, 0xf3, 0xfe, 0x60, 0x21, 0xc6, 0x3d, 0xb4, 0x9e, 0x45, 0x84, 0xb4, 0x36, - 0x66, 0x97, 0xf9, 0xfc, 0x62, 0x81, 0x0b, 0x81, 0xf8, 0x1a, 0x2f, 0xa1, 0x20, 0x33, 0x68, 0x1f, - 0xf2, 0x9d, 0xc6, 0xbb, 0x76, 0x69, 0x07, 0x1d, 0x41, 0xf1, 0xe3, 0x87, 0x56, 0xa3, 0xd7, 0x6e, - 0xf5, 0x1b, 0xdd, 0x66, 0x49, 0x41, 0x25, 0x50, 0xa3, 0x44, 0xab, 0xdd, 0x6d, 0x96, 0x76, 0x8d, - 0xcf, 0xf2, 0x7f, 0xb7, 0xd1, 0x21, 0xbc, 0xfa, 0x2b, 0xd8, 0x1f, 0x84, 0x39, 0xa1, 0x54, 0xd1, - 0xaa, 0xa4, 0x8c, 0x15, 0x51, 0xf0, 0x8a, 0x60, 0xfc, 0xda, 0x95, 0xfa, 0x27, 0xa0, 0x92, 0x76, - 0x9a, 0xad, 0xd9, 0x19, 0x1c, 0x86, 0x87, 0xc1, 0x7c, 0xf0, 0x95, 0x0e, 0x79, 0xa8, 0xdd, 0xff, - 0x32, 0xdb, 0x95, 0x49, 0x74, 0x09, 0x61, 0xa2, 0x4f, 0xe6, 0x7c, 0xc2, 0x7c, 0x2d, 0x2f, 0xb6, - 0xff, 0x24, 0x65, 0xea, 0xa6, 0xc0, 0x36, 0x04, 0x14, 0xab, 0xc3, 0x58, 0x84, 0x3a, 0x50, 0x0a, - 0x2b, 0xc9, 0x0f, 0xa7, 0xbe, 0xb6, 0xf7, 0xef, 0xc5, 0x8e, 0x24, 0xab, 0x19, 0x71, 0x8d, 0xef, - 0x50, 0xce, 0xc0, 0x27, 0x2e, 0xe4, 0x18, 0xf6, 0xa8, 0x47, 0x1c, 0x57, 0x2c, 0x43, 0xc5, 0x32, - 0x40, 0x26, 0xe4, 0x47, 0x84, 0x53, 0x71, 0xff, 0xa2, 0xa5, 0x9b, 0xd2, 0xe1, 0xcc, 0xc8, 0xe1, - 0xcc, 0x5e, 0xe4, 0x70, 0x58, 0xe0, 0xac, 0x3f, 0x39, 0xc8, 0x61, 0x6a, 0x23, 0x1b, 0xee, 0x25, - 0xba, 0x12, 0x7a, 0x1a, 0xbf, 0x4f, 0x9a, 0x11, 0xea, 0x67, 0xb7, 0xa0, 0xa4, 0xb0, 0xc6, 0x0e, - 0xea, 0xcb, 0x47, 0xbc, 0xee, 0x3b, 0xe8, 0x34, 0x4e, 0x4f, 0x34, 0x39, 0xdd, 0xc8, 0x82, 0x44, - 0xe5, 0x5f, 0x28, 0xe8, 0x13, 0x1c, 0x6d, 0xd8, 0x0a, 0x7a, 0xbc, 0x41, 0xdd, 0x70, 0x2f, 0xbd, - 0x92, 0x7a, 0x1e, 0xab, 0x7b, 0x09, 0xc5, 0xd8, 0xf3, 0x47, 0x7a, 0x9c, 0xb3, 0x6e, 0x49, 0x7a, - 0x39, 0xf1, 0x6c, 0xb5, 0x82, 0x2f, 0x70, 0xe7, 0xc6, 0x9b, 0x42, 0xd5, 0xdb, 0x1e, 0xb4, 0x7e, - 0x9a, 0x81, 0xb8, 0x9e, 0x73, 0x50, 0x10, 0x52, 0x9f, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x2c, - 0xc7, 0x33, 0x9b, 0xfd, 0x06, 0x00, 0x00, + // 725 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x54, 0x51, 0x6f, 0x12, 0x4b, + 0x14, 0xbe, 0x4b, 0x81, 0xdb, 0x1e, 0xb8, 0x2d, 0x77, 0x6e, 0xdb, 0x8b, 0x4b, 0x2b, 0x74, 0x14, + 0xc5, 0x9a, 0x2c, 0x4a, 0xe3, 0x4b, 0x7d, 0x91, 0x42, 0x8d, 0x26, 0xb5, 0x9a, 0xa1, 0x26, 0xbe, + 0x6d, 0x06, 0x98, 0x85, 0x35, 0xcb, 0x0e, 0xee, 0x0e, 0x2a, 0x31, 0xbe, 0xf4, 0xc5, 0x07, 0x1f, + 0x8c, 0xf1, 0x47, 0xf9, 0x03, 0xfc, 0x0b, 0xfe, 0x10, 0xc3, 0xcc, 0x50, 0x17, 0x0a, 0xd4, 0x84, + 0x27, 0x98, 0x33, 0xdf, 0x39, 0xdf, 0x77, 0xce, 0x99, 0xfd, 0x60, 0x2d, 0x60, 0x8e, 0xd5, 0x0f, + 0xb8, 0xe0, 0x28, 0xd9, 0x71, 0x05, 0xf5, 0x86, 0x66, 0x3a, 0xec, 0xd2, 0x80, 0xb5, 0x55, 0xd4, + 0xcc, 0x77, 0x38, 0xef, 0x78, 0xac, 0x2c, 0x4f, 0xcd, 0x81, 0x53, 0x16, 0x6e, 0x8f, 0x85, 0x82, + 0xf6, 0xfa, 0x1a, 0xb0, 0xa3, 0x01, 0xb4, 0xef, 0x96, 0xa9, 0xef, 0x73, 0x41, 0x85, 0xcb, 0xfd, + 0x50, 0xdd, 0x62, 0x02, 0x3b, 0x8f, 0x5d, 0xbf, 0x5d, 0x67, 0x0e, 0x1d, 0x78, 0xe2, 0x28, 0xa0, + 0x7e, 0xab, 0x7b, 0x4a, 0x7b, 0x8c, 0xb0, 0x37, 0x03, 0x16, 0x0a, 0x54, 0x01, 0x08, 0x58, 0x9f, + 0x87, 0xae, 0xe0, 0xc1, 0x30, 0x6b, 0x14, 0x8c, 0x52, 0xaa, 0x82, 0x2c, 0xa5, 0xc4, 0x22, 0x17, + 0x37, 0x24, 0x82, 0xc2, 0x07, 0xb0, 0x3b, 0xa7, 0x66, 0xd8, 0xe7, 0x7e, 0xc8, 0x10, 0x82, 0xb8, + 0x4f, 0x7b, 0x4c, 0x96, 0x4b, 0x13, 0xf9, 0x1f, 0x3f, 0x87, 0x6b, 0xa3, 0xa4, 0xaa, 0xe7, 0xfd, + 0x4e, 0x08, 0x97, 0x51, 0x51, 0x01, 0x73, 0x56, 0x41, 0x2d, 0x61, 0x13, 0x12, 0x23, 0xda, 0x30, + 0x6b, 0x14, 0x56, 0x4a, 0x69, 0xa2, 0x0e, 0xf8, 0x04, 0xb6, 0x75, 0xce, 0x19, 0xed, 0x2c, 0xad, + 0xa0, 0x0c, 0xff, 0x5f, 0xaa, 0xb6, 0x90, 0xfe, 0x23, 0xa0, 0x51, 0x02, 0x61, 0xce, 0x92, 0x2b, + 0x40, 0x39, 0x58, 0x6b, 0xf1, 0x5e, 0xcf, 0x15, 0xb6, 0xdb, 0xce, 0xc6, 0x0a, 0x46, 0x69, 0x8d, + 0xac, 0xaa, 0xc0, 0xd3, 0x36, 0xda, 0x86, 0x64, 0x3f, 0x60, 0x8e, 0xfb, 0x3e, 0xbb, 0x22, 0x17, + 0xa0, 0x4f, 0xf8, 0x0e, 0xfc, 0x37, 0x41, 0xbf, 0x60, 0x5b, 0xdf, 0x0d, 0xc8, 0x8e, 0xb0, 0x27, + 0xbc, 0x45, 0xf5, 0x7c, 0x97, 0x9a, 0x15, 0x7a, 0x04, 0x7f, 0x87, 0x3c, 0x10, 0x76, 0x73, 0x28, + 0xe5, 0xae, 0x57, 0x6e, 0x8f, 0x13, 0xe6, 0xd1, 0x58, 0x0d, 0x1e, 0x88, 0xa3, 0x21, 0x49, 0x86, + 0xf2, 0x17, 0x3f, 0x80, 0xa4, 0x8a, 0xa0, 0x55, 0x88, 0x9f, 0x56, 0x9f, 0x1d, 0x67, 0xfe, 0x42, + 0x1b, 0x90, 0x7a, 0xf9, 0xa2, 0x5e, 0x3d, 0x3b, 0xae, 0xdb, 0xd5, 0x46, 0x2d, 0x63, 0xa0, 0x0c, + 0xa4, 0xc7, 0x81, 0xfa, 0x71, 0xa3, 0x96, 0x89, 0xe1, 0x57, 0xea, 0xdd, 0x4d, 0x31, 0xe8, 0xd6, + 0x1f, 0xc2, 0x6a, 0x53, 0xc7, 0xe4, 0xa6, 0x52, 0x95, 0xfc, 0x1c, 0x59, 0xe3, 0x14, 0x72, 0x91, + 0x80, 0x3f, 0xc7, 0xd4, 0xfe, 0x67, 0xa0, 0x66, 0xcd, 0x74, 0xf1, 0xce, 0x8a, 0xb0, 0xae, 0x2f, + 0xc3, 0x41, 0xf3, 0x35, 0x6b, 0x09, 0xbd, 0xbb, 0x7f, 0x54, 0xb4, 0xa1, 0x82, 0xe8, 0x09, 0xe8, + 0x80, 0x4d, 0x07, 0xa2, 0xcb, 0x83, 0x6c, 0x5c, 0x4e, 0xff, 0xc6, 0x1c, 0xd5, 0x35, 0x89, 0xad, + 0x4a, 0x28, 0x49, 0xb7, 0x22, 0x27, 0x74, 0x0a, 0x19, 0x5d, 0x49, 0xfd, 0x08, 0x16, 0x64, 0x13, + 0x7f, 0x5e, 0x6c, 0x43, 0x65, 0xd5, 0xc6, 0xb9, 0xf8, 0x1d, 0xe4, 0x16, 0xe0, 0x67, 0x0e, 0x64, + 0x13, 0x12, 0xac, 0x47, 0x5d, 0x4f, 0x0e, 0x23, 0x4d, 0xd4, 0x01, 0x59, 0x10, 0x6f, 0x53, 0xc1, + 0x64, 0xff, 0xa9, 0x8a, 0x69, 0x29, 0x7b, 0xb3, 0xc6, 0xfe, 0x67, 0x9d, 0x8d, 0xfd, 0x8f, 0x48, + 0x5c, 0xe5, 0x4b, 0x02, 0x56, 0x08, 0x73, 0xd0, 0x57, 0x03, 0xb6, 0x66, 0xda, 0x12, 0xba, 0x19, + 0x6d, 0x68, 0x9e, 0x13, 0x9a, 0xc5, 0x2b, 0x50, 0x6a, 0xb3, 0xf8, 0xee, 0xf9, 0x8f, 0x9f, 0xdf, + 0x62, 0x45, 0x5c, 0x28, 0xbf, 0xbd, 0x5f, 0x0e, 0x98, 0x53, 0x76, 0x5c, 0xbf, 0x6d, 0xb7, 0x15, + 0xde, 0x56, 0x8f, 0xc3, 0x1e, 0xb5, 0x77, 0x68, 0xec, 0xa3, 0x4f, 0x86, 0xfa, 0xe2, 0x27, 0x4d, + 0x0a, 0xed, 0x45, 0xa9, 0x66, 0x3a, 0xa2, 0x89, 0x17, 0x41, 0xb4, 0x94, 0x92, 0x94, 0x82, 0xf1, + 0xee, 0x84, 0x14, 0xea, 0x79, 0x51, 0x19, 0xe1, 0xa1, 0xb1, 0x7f, 0xcf, 0x40, 0x1f, 0x60, 0x63, + 0xca, 0xab, 0xd0, 0xf5, 0x29, 0x8a, 0x29, 0x4b, 0x34, 0xf3, 0x73, 0xef, 0x35, 0x7f, 0x51, 0xf2, + 0xe7, 0xb1, 0x79, 0x89, 0x5f, 0xd0, 0x4e, 0x94, 0xbc, 0x0b, 0xa9, 0x88, 0xf1, 0x20, 0x33, 0x5a, + 0x78, 0xd2, 0x0c, 0xcd, 0xdc, 0xcc, 0x3b, 0x4d, 0x58, 0x90, 0x84, 0x26, 0xde, 0x9a, 0x20, 0x0c, + 0x98, 0x73, 0x31, 0xf0, 0x73, 0x03, 0xfe, 0xbd, 0xf4, 0xb9, 0xa3, 0xc2, 0x55, 0x5e, 0x63, 0xee, + 0x2d, 0x40, 0x68, 0xf2, 0x5b, 0x92, 0xbc, 0x80, 0x73, 0x13, 0xe4, 0xde, 0x08, 0x6b, 0x8f, 0x3d, + 0x41, 0xb6, 0xdb, 0x4c, 0xca, 0xb7, 0x7a, 0xf0, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xca, 0x95, 0x18, + 0x40, 0xdc, 0x07, 0x00, 0x00, } diff --git a/go/ref.pb.gw.go b/go/ref.pb.gw.go new file mode 100644 index 00000000..65f6e7b6 --- /dev/null +++ b/go/ref.pb.gw.go @@ -0,0 +1,314 @@ +// Code generated by protoc-gen-grpc-gateway +// source: ref.proto +// DO NOT EDIT! + +/* +Package gitaly is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package gitaly + +import ( + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" +) + +var _ codes.Code +var _ io.Reader +var _ = runtime.String +var _ = utilities.NewDoubleArray + +func request_Ref_FindDefaultBranchName_0(ctx context.Context, marshaler runtime.Marshaler, client RefClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq FindDefaultBranchNameRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.FindDefaultBranchName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_Ref_FindAllBranchNames_0(ctx context.Context, marshaler runtime.Marshaler, client RefClient, req *http.Request, pathParams map[string]string) (Ref_FindAllBranchNamesClient, runtime.ServerMetadata, error) { + var protoReq FindAllBranchNamesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.FindAllBranchNames(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +func request_Ref_FindAllTagNames_0(ctx context.Context, marshaler runtime.Marshaler, client RefClient, req *http.Request, pathParams map[string]string) (Ref_FindAllTagNamesClient, runtime.ServerMetadata, error) { + var protoReq FindAllTagNamesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.FindAllTagNames(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +func request_Ref_FindRefName_0(ctx context.Context, marshaler runtime.Marshaler, client RefClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq FindRefNameRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.FindRefName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_Ref_FindLocalBranches_0(ctx context.Context, marshaler runtime.Marshaler, client RefClient, req *http.Request, pathParams map[string]string) (Ref_FindLocalBranchesClient, runtime.ServerMetadata, error) { + var protoReq FindLocalBranchesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.FindLocalBranches(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +// RegisterRefHandlerFromEndpoint is same as RegisterRefHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterRefHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterRefHandler(ctx, mux, conn) +} + +// RegisterRefHandler registers the http handlers for service Ref to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterRefHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + client := NewRefClient(conn) + + mux.Handle("POST", pattern_Ref_FindDefaultBranchName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + } + resp, md, err := request_Ref_FindDefaultBranchName_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Ref_FindDefaultBranchName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Ref_FindAllBranchNames_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + } + resp, md, err := request_Ref_FindAllBranchNames_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Ref_FindAllBranchNames_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Ref_FindAllTagNames_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + } + resp, md, err := request_Ref_FindAllTagNames_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Ref_FindAllTagNames_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Ref_FindRefName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + } + resp, md, err := request_Ref_FindRefName_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Ref_FindRefName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Ref_FindLocalBranches_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + } + resp, md, err := request_Ref_FindLocalBranches_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Ref_FindLocalBranches_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Ref_FindDefaultBranchName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "ref", "find_default_branch_name"}, "")) + + pattern_Ref_FindAllBranchNames_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "ref", "find_all_branch_names"}, "")) + + pattern_Ref_FindAllTagNames_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "ref", "find_all_tag_names"}, "")) + + pattern_Ref_FindRefName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "ref", "find_ref_name"}, "")) + + pattern_Ref_FindLocalBranches_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "ref", "find_local_branches"}, "")) +) + +var ( + forward_Ref_FindDefaultBranchName_0 = runtime.ForwardResponseMessage + + forward_Ref_FindAllBranchNames_0 = runtime.ForwardResponseStream + + forward_Ref_FindAllTagNames_0 = runtime.ForwardResponseStream + + forward_Ref_FindRefName_0 = runtime.ForwardResponseMessage + + forward_Ref_FindLocalBranches_0 = runtime.ForwardResponseStream +) diff --git a/go/shared.pb.go b/go/shared.pb.go index 48c65648..dcfb14e1 100644 --- a/go/shared.pb.go +++ b/go/shared.pb.go @@ -7,6 +7,7 @@ package gitaly import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -69,16 +70,17 @@ func init() { func init() { proto.RegisterFile("shared.proto", fileDescriptor4) } var fileDescriptor4 = []byte{ - // 161 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x8e, 0xb1, 0xca, 0xc2, 0x40, - 0x10, 0x84, 0xc9, 0xff, 0x9b, 0x80, 0x6b, 0x6c, 0x16, 0x8b, 0x94, 0x1a, 0x1b, 0x2b, 0x1b, 0x9f, - 0xc1, 0x56, 0xe4, 0x7c, 0x80, 0xb0, 0xe2, 0x92, 0x3b, 0xb8, 0x78, 0xc7, 0xdd, 0x26, 0x98, 0xb7, - 0x17, 0x56, 0xed, 0x76, 0xbf, 0x99, 0x61, 0x06, 0xea, 0x6c, 0x29, 0xf1, 0xe3, 0x18, 0x53, 0x90, - 0x80, 0x55, 0xef, 0x84, 0xfc, 0xdc, 0x5a, 0x00, 0xc3, 0x31, 0x64, 0x27, 0x21, 0xcd, 0x88, 0xb0, - 0x88, 0x24, 0xb6, 0x29, 0xb6, 0xc5, 0x61, 0x69, 0xf4, 0xc6, 0x1d, 0xd4, 0x59, 0x42, 0xa2, 0x9e, - 0xbb, 0x27, 0x0d, 0xdc, 0xfc, 0xa9, 0xb6, 0xfa, 0xb2, 0x0b, 0x0d, 0x8c, 0x7b, 0x58, 0x27, 0xf6, - 0x24, 0x6e, 0xe2, 0x4e, 0xf3, 0xff, 0xea, 0xa9, 0x7f, 0xf0, 0x4a, 0x62, 0xdb, 0x16, 0xe0, 0xfc, - 0x72, 0x72, 0x13, 0x92, 0x31, 0xe3, 0x06, 0xca, 0x89, 0xfc, 0xc8, 0x5a, 0x55, 0x9a, 0xcf, 0x73, - 0xaf, 0x74, 0xdc, 0xe9, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xbd, 0xf7, 0x56, 0x73, 0xac, 0x00, 0x00, - 0x00, + // 182 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x34, 0x8e, 0xc1, 0x6a, 0xc3, 0x30, + 0x0c, 0x86, 0xc9, 0xb6, 0x04, 0xa6, 0x65, 0x17, 0xb3, 0x43, 0x18, 0x3b, 0xac, 0xe9, 0xa5, 0xa7, + 0xe6, 0xd0, 0x67, 0xe8, 0xb5, 0x94, 0xf4, 0x01, 0x82, 0x4a, 0x85, 0x6d, 0x70, 0x2c, 0x63, 0x2b, + 0xa1, 0x79, 0xfb, 0x82, 0xd3, 0xde, 0xa4, 0x4f, 0x9f, 0xf8, 0x7f, 0xa8, 0x93, 0xc1, 0x48, 0xb7, + 0x7d, 0x88, 0x2c, 0xac, 0x2a, 0x6d, 0x05, 0xdd, 0xf2, 0xfb, 0xa7, 0x99, 0xb5, 0xa3, 0x0e, 0x83, + 0xed, 0xd0, 0x7b, 0x16, 0x14, 0xcb, 0x3e, 0xad, 0x56, 0x6b, 0x00, 0x7a, 0x0a, 0x9c, 0xac, 0x70, + 0x5c, 0x94, 0x82, 0x8f, 0x80, 0x62, 0x9a, 0xe2, 0xbf, 0xd8, 0x7d, 0xf6, 0x79, 0x56, 0x1b, 0xa8, + 0x93, 0x70, 0x44, 0x4d, 0x83, 0xc7, 0x91, 0x9a, 0xb7, 0x7c, 0xfb, 0x7a, 0xb2, 0x13, 0x8e, 0xa4, + 0xb6, 0xf0, 0x1d, 0xc9, 0xa1, 0xd8, 0x99, 0x86, 0xfc, 0xff, 0x9e, 0x9d, 0xfa, 0x05, 0xcf, 0x28, + 0xa6, 0x6d, 0x01, 0x8e, 0x77, 0x2b, 0x17, 0x41, 0x99, 0x92, 0xfa, 0x81, 0x72, 0x46, 0x37, 0x51, + 0x8e, 0x2a, 0xfb, 0x75, 0xb9, 0x56, 0xb9, 0xd4, 0xe1, 0x11, 0x00, 0x00, 0xff, 0xff, 0xe6, 0x50, + 0xbe, 0xdf, 0xca, 0x00, 0x00, 0x00, } diff --git a/go/smarthttp.pb.go b/go/smarthttp.pb.go index 494118d6..296f5811 100644 --- a/go/smarthttp.pb.go +++ b/go/smarthttp.pb.go @@ -7,6 +7,7 @@ package gitaly import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" import ( context "golang.org/x/net/context" @@ -455,24 +456,31 @@ var _SmartHTTP_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("smarthttp.proto", fileDescriptor5) } var fileDescriptor5 = []byte{ - // 304 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x4d, 0x4b, 0xc3, 0x40, - 0x14, 0x74, 0x6b, 0x2d, 0xf4, 0x59, 0xac, 0xbc, 0xa2, 0x0d, 0x01, 0xb5, 0xe4, 0x20, 0x39, 0x68, - 0x28, 0xf1, 0x37, 0x08, 0x16, 0x3d, 0x84, 0xb5, 0x05, 0x6f, 0x65, 0x6d, 0xb6, 0x69, 0x30, 0x76, - 0xe3, 0xee, 0x56, 0xe8, 0x2f, 0xf5, 0xef, 0x88, 0x09, 0xf9, 0x68, 0x62, 0x3c, 0x28, 0xde, 0xc2, - 0x9b, 0xf7, 0x66, 0x26, 0x33, 0x2c, 0xf4, 0xd5, 0x2b, 0x93, 0x7a, 0xa5, 0x75, 0xec, 0xc4, 0x52, - 0x68, 0x81, 0x9d, 0x20, 0xd4, 0x2c, 0xda, 0x9a, 0x3d, 0xb5, 0x62, 0x92, 0xfb, 0xe9, 0xd4, 0xba, - 0x85, 0xfe, 0x64, 0xbd, 0x14, 0x94, 0x2f, 0x15, 0xe5, 0x6f, 0x1b, 0xae, 0x34, 0xba, 0x00, 0x92, - 0xc7, 0x42, 0x85, 0x5a, 0xc8, 0xad, 0x41, 0x46, 0xc4, 0x3e, 0x74, 0xd1, 0x49, 0xaf, 0x1d, 0x9a, - 0x23, 0xb4, 0xb4, 0x65, 0x5d, 0xc2, 0x71, 0x41, 0xa3, 0x62, 0xb1, 0x56, 0x1c, 0x11, 0xda, 0x3e, - 0xd3, 0x2c, 0x61, 0xe8, 0xd1, 0xe4, 0xdb, 0x9a, 0xc3, 0x89, 0x27, 0x94, 0x9e, 0xc5, 0x91, 0x60, - 0xbe, 0xc7, 0x16, 0x2f, 0x7f, 0x10, 0xcd, 0x05, 0x5a, 0x25, 0x81, 0x2b, 0x38, 0xad, 0x0a, 0xfc, - 0x60, 0x67, 0x93, 0x6e, 0x53, 0xbe, 0xe0, 0xe1, 0x3b, 0xff, 0x07, 0x3f, 0x38, 0x80, 0x83, 0x20, - 0x9a, 0x87, 0xbe, 0xb1, 0x3f, 0x22, 0x76, 0x97, 0xb6, 0x83, 0x68, 0xe2, 0x5b, 0xd7, 0x30, 0xac, - 0xc9, 0x36, 0xbb, 0x74, 0x3f, 0x5a, 0xd0, 0x7d, 0xfc, 0x6a, 0xf3, 0x6e, 0x3a, 0xf5, 0xf0, 0x1e, - 0x30, 0x8b, 0xba, 0xf8, 0x4b, 0x1c, 0x66, 0xde, 0x2a, 0x6d, 0x9a, 0x46, 0x1d, 0x48, 0xa5, 0xac, - 0xbd, 0x31, 0xc1, 0x07, 0x18, 0x14, 0xf3, 0xdc, 0xcd, 0x6f, 0xd9, 0x66, 0x70, 0xb4, 0x1b, 0x3e, - 0x9e, 0x65, 0xfb, 0xdf, 0xb6, 0x6e, 0x9e, 0x37, 0xc1, 0x19, 0xa9, 0x4d, 0xc6, 0x04, 0x9f, 0xa0, - 0x5f, 0x89, 0x0b, 0x77, 0x0e, 0xeb, 0xf5, 0x99, 0x17, 0x8d, 0x78, 0x99, 0xf9, 0xb9, 0x93, 0x3c, - 0x82, 0x9b, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x16, 0x3e, 0x9b, 0xd1, 0x2d, 0x03, 0x00, 0x00, + // 405 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x93, 0x4f, 0x6b, 0xe2, 0x40, + 0x18, 0xc6, 0x19, 0xd7, 0x15, 0x7c, 0x57, 0xd6, 0x65, 0x64, 0x57, 0x09, 0xbb, 0xab, 0x0c, 0xba, + 0xb8, 0xee, 0xd6, 0x58, 0x7b, 0xeb, 0xbd, 0x50, 0x6f, 0x92, 0xda, 0x73, 0x98, 0x9a, 0x49, 0x0c, + 0xa6, 0x99, 0x69, 0x66, 0x14, 0x2c, 0x85, 0x42, 0x7b, 0xed, 0xad, 0x1f, 0xad, 0x5f, 0xa1, 0x1f, + 0xa4, 0x38, 0xf1, 0x6f, 0x34, 0x3d, 0xb4, 0xf4, 0x26, 0x3e, 0xc3, 0xf3, 0xfb, 0xcd, 0xbc, 0x6f, + 0xa0, 0x28, 0x2f, 0x69, 0xa4, 0x46, 0x4a, 0x89, 0xb6, 0x88, 0xb8, 0xe2, 0x38, 0xe7, 0xf9, 0x8a, + 0x06, 0x33, 0xa3, 0x20, 0x47, 0x34, 0x62, 0x4e, 0xfc, 0xaf, 0xf1, 0xd3, 0xe3, 0xdc, 0x0b, 0x98, + 0x49, 0x85, 0x6f, 0xd2, 0x30, 0xe4, 0x8a, 0x2a, 0x9f, 0x87, 0x32, 0x4e, 0xc9, 0x09, 0x14, 0x7b, + 0xa1, 0xcb, 0x2d, 0xe6, 0x4a, 0x8b, 0x5d, 0x4d, 0x98, 0x54, 0xb8, 0x0b, 0x10, 0x31, 0xc1, 0xa5, + 0xaf, 0x78, 0x34, 0xab, 0xa0, 0x1a, 0x6a, 0x7e, 0xe9, 0xe2, 0x76, 0xdc, 0xdd, 0xb6, 0x56, 0x89, + 0xb5, 0x71, 0x8a, 0xfc, 0x81, 0x6f, 0xeb, 0x1a, 0x29, 0x78, 0x28, 0x19, 0xc6, 0x90, 0x75, 0xa8, + 0xa2, 0xba, 0xa1, 0x60, 0xe9, 0xdf, 0xc4, 0x86, 0xef, 0x7d, 0x2e, 0xd5, 0xb9, 0x08, 0x38, 0x75, + 0xfa, 0x74, 0x38, 0x7e, 0x07, 0x74, 0x05, 0xc8, 0x6c, 0x00, 0xfe, 0xc3, 0x8f, 0x24, 0xe0, 0x15, + 0x9d, 0x49, 0x7c, 0xda, 0x62, 0x43, 0xe6, 0x4f, 0xd9, 0x07, 0xf8, 0xe0, 0x12, 0x7c, 0xf6, 0x02, + 0xdb, 0x77, 0x2a, 0x9f, 0x6a, 0xa8, 0x99, 0xb7, 0xb2, 0x5e, 0xd0, 0x73, 0xc8, 0x01, 0x94, 0x77, + 0xb0, 0xe9, 0x96, 0xdd, 0x87, 0x2c, 0xe4, 0xcf, 0xe6, 0xb3, 0x3e, 0x1d, 0x0c, 0xfa, 0xf8, 0x1a, + 0xf0, 0xf2, 0xa9, 0xd7, 0xb7, 0xc4, 0xe5, 0xa5, 0x5b, 0x62, 0x9a, 0x46, 0x65, 0x37, 0x88, 0x51, + 0xc4, 0xbc, 0x7b, 0x7a, 0x7e, 0xcc, 0xfc, 0x25, 0x75, 0x73, 0x7a, 0x68, 0xea, 0x5d, 0xb2, 0xe7, + 0xcb, 0x64, 0xfa, 0xa1, 0xcb, 0xed, 0x88, 0xb9, 0xd2, 0x9e, 0xe8, 0x7e, 0x5b, 0xd0, 0xe1, 0xf8, + 0x18, 0xb5, 0x3a, 0x08, 0xdf, 0x40, 0x69, 0x5d, 0xb3, 0x92, 0x7f, 0x0b, 0xbc, 0xa3, 0xe1, 0x2d, + 0xd2, 0x48, 0x85, 0x47, 0x31, 0x60, 0x83, 0x7e, 0x0b, 0x5f, 0xb7, 0x67, 0x8b, 0x7f, 0x2d, 0xfb, + 0xf7, 0x2e, 0x95, 0xf1, 0x3b, 0x2d, 0x5e, 0x48, 0xb4, 0xb4, 0x44, 0x9d, 0x54, 0x13, 0x12, 0x82, + 0x4b, 0x95, 0xb8, 0x7c, 0x13, 0x75, 0x10, 0xbe, 0x47, 0x50, 0x4c, 0x0c, 0x0e, 0x6f, 0x31, 0x76, + 0x17, 0xc9, 0xa8, 0xa6, 0xe6, 0x0b, 0x89, 0x7f, 0x5a, 0xa2, 0x41, 0x6a, 0xfb, 0x24, 0x12, 0x8f, + 0x30, 0xb7, 0xb8, 0xc8, 0xe9, 0x2f, 0xf7, 0xe8, 0x25, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x0a, 0xb2, + 0x90, 0x00, 0x04, 0x00, 0x00, } diff --git a/go/smarthttp.pb.gw.go b/go/smarthttp.pb.gw.go new file mode 100644 index 00000000..f63ba068 --- /dev/null +++ b/go/smarthttp.pb.gw.go @@ -0,0 +1,339 @@ +// Code generated by protoc-gen-grpc-gateway +// source: smarthttp.proto +// DO NOT EDIT! + +/* +Package gitaly is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package gitaly + +import ( + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" +) + +var _ codes.Code +var _ io.Reader +var _ = runtime.String +var _ = utilities.NewDoubleArray + +func request_SmartHTTP_InfoRefsUploadPack_0(ctx context.Context, marshaler runtime.Marshaler, client SmartHTTPClient, req *http.Request, pathParams map[string]string) (SmartHTTP_InfoRefsUploadPackClient, runtime.ServerMetadata, error) { + var protoReq InfoRefsRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.InfoRefsUploadPack(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +func request_SmartHTTP_InfoRefsReceivePack_0(ctx context.Context, marshaler runtime.Marshaler, client SmartHTTPClient, req *http.Request, pathParams map[string]string) (SmartHTTP_InfoRefsReceivePackClient, runtime.ServerMetadata, error) { + var protoReq InfoRefsRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + return nil, metadata, grpc.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.InfoRefsReceivePack(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +func request_SmartHTTP_PostUploadPack_0(ctx context.Context, marshaler runtime.Marshaler, client SmartHTTPClient, req *http.Request, pathParams map[string]string) (SmartHTTP_PostUploadPackClient, runtime.ServerMetadata, error) { + var metadata runtime.ServerMetadata + stream, err := client.PostUploadPack(ctx) + if err != nil { + grpclog.Printf("Failed to start streaming: %v", err) + return nil, metadata, err + } + dec := marshaler.NewDecoder(req.Body) + handleSend := func() error { + var protoReq PostUploadPackRequest + err = dec.Decode(&protoReq) + if err == io.EOF { + return err + } + if err != nil { + grpclog.Printf("Failed to decode request: %v", err) + return err + } + if err = stream.Send(&protoReq); err != nil { + grpclog.Printf("Failed to send request: %v", err) + return err + } + return nil + } + if err := handleSend(); err != nil { + if cerr := stream.CloseSend(); cerr != nil { + grpclog.Printf("Failed to terminate client stream: %v", cerr) + } + if err == io.EOF { + return stream, metadata, nil + } + return nil, metadata, err + } + go func() { + for { + if err := handleSend(); err != nil { + break + } + } + if err := stream.CloseSend(); err != nil { + grpclog.Printf("Failed to terminate client stream: %v", err) + } + }() + header, err := stream.Header() + if err != nil { + grpclog.Printf("Failed to get header from client: %v", err) + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil +} + +func request_SmartHTTP_PostReceivePack_0(ctx context.Context, marshaler runtime.Marshaler, client SmartHTTPClient, req *http.Request, pathParams map[string]string) (SmartHTTP_PostReceivePackClient, runtime.ServerMetadata, error) { + var metadata runtime.ServerMetadata + stream, err := client.PostReceivePack(ctx) + if err != nil { + grpclog.Printf("Failed to start streaming: %v", err) + return nil, metadata, err + } + dec := marshaler.NewDecoder(req.Body) + handleSend := func() error { + var protoReq PostReceivePackRequest + err = dec.Decode(&protoReq) + if err == io.EOF { + return err + } + if err != nil { + grpclog.Printf("Failed to decode request: %v", err) + return err + } + if err = stream.Send(&protoReq); err != nil { + grpclog.Printf("Failed to send request: %v", err) + return err + } + return nil + } + if err := handleSend(); err != nil { + if cerr := stream.CloseSend(); cerr != nil { + grpclog.Printf("Failed to terminate client stream: %v", cerr) + } + if err == io.EOF { + return stream, metadata, nil + } + return nil, metadata, err + } + go func() { + for { + if err := handleSend(); err != nil { + break + } + } + if err := stream.CloseSend(); err != nil { + grpclog.Printf("Failed to terminate client stream: %v", err) + } + }() + header, err := stream.Header() + if err != nil { + grpclog.Printf("Failed to get header from client: %v", err) + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil +} + +// RegisterSmartHTTPHandlerFromEndpoint is same as RegisterSmartHTTPHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterSmartHTTPHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterSmartHTTPHandler(ctx, mux, conn) +} + +// RegisterSmartHTTPHandler registers the http handlers for service SmartHTTP to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterSmartHTTPHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + client := NewSmartHTTPClient(conn) + + mux.Handle("POST", pattern_SmartHTTP_InfoRefsUploadPack_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + } + resp, md, err := request_SmartHTTP_InfoRefsUploadPack_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmartHTTP_InfoRefsUploadPack_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_SmartHTTP_InfoRefsReceivePack_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + } + resp, md, err := request_SmartHTTP_InfoRefsReceivePack_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmartHTTP_InfoRefsReceivePack_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_SmartHTTP_PostUploadPack_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + } + resp, md, err := request_SmartHTTP_PostUploadPack_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmartHTTP_PostUploadPack_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_SmartHTTP_PostReceivePack_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + } + resp, md, err := request_SmartHTTP_PostReceivePack_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SmartHTTP_PostReceivePack_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_SmartHTTP_InfoRefsUploadPack_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "smart_http", "info_refs_upload_pack"}, "")) + + pattern_SmartHTTP_InfoRefsReceivePack_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "smart_http", "info_refs_receive_pack"}, "")) + + pattern_SmartHTTP_PostUploadPack_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "smart_http", "post_upload_pack"}, "")) + + pattern_SmartHTTP_PostReceivePack_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "smart_http", "post_receive_pack"}, "")) +) + +var ( + forward_SmartHTTP_InfoRefsUploadPack_0 = runtime.ForwardResponseStream + + forward_SmartHTTP_InfoRefsReceivePack_0 = runtime.ForwardResponseStream + + forward_SmartHTTP_PostUploadPack_0 = runtime.ForwardResponseStream + + forward_SmartHTTP_PostReceivePack_0 = runtime.ForwardResponseStream +) diff --git a/go/ssh.pb.go b/go/ssh.pb.go index 842b88e5..57a351e1 100644 --- a/go/ssh.pb.go +++ b/go/ssh.pb.go @@ -7,6 +7,7 @@ package gitaly import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" import ( context "golang.org/x/net/context" @@ -334,23 +335,27 @@ var _SSH_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("ssh.proto", fileDescriptor6) } var fileDescriptor6 = []byte{ - // 284 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x52, 0xcd, 0x4a, 0xc3, 0x40, - 0x10, 0x76, 0xad, 0x0d, 0x74, 0x1a, 0x3d, 0xac, 0xb5, 0x84, 0xa0, 0x52, 0x72, 0xca, 0x29, 0x48, - 0xfa, 0x0c, 0x42, 0xbd, 0xc9, 0x86, 0x9e, 0x6b, 0xec, 0x2e, 0xe9, 0x62, 0xe8, 0xc6, 0x9d, 0x49, - 0x69, 0x41, 0xdf, 0xc9, 0x47, 0x14, 0x92, 0x58, 0x92, 0x6a, 0x8f, 0xf6, 0xb6, 0x33, 0xdf, 0xce, - 0xf7, 0x33, 0xbb, 0x30, 0x40, 0x5c, 0x45, 0x85, 0x35, 0x64, 0xb8, 0x93, 0x69, 0x4a, 0xf3, 0x9d, - 0xef, 0xe2, 0x2a, 0xb5, 0x4a, 0xd6, 0xdd, 0xe0, 0x05, 0x46, 0x49, 0x32, 0x9b, 0x17, 0xb9, 0x49, - 0xe5, 0x73, 0xba, 0x7c, 0x13, 0xea, 0xbd, 0x54, 0x48, 0x3c, 0x06, 0xb0, 0xaa, 0x30, 0xa8, 0xc9, - 0xd8, 0x9d, 0xc7, 0x26, 0x2c, 0x1c, 0xc6, 0x3c, 0xaa, 0x29, 0x22, 0xb1, 0x47, 0x44, 0xeb, 0x16, - 0x1f, 0x41, 0x1f, 0x49, 0xea, 0xb5, 0x77, 0x3e, 0x61, 0xa1, 0x2b, 0xea, 0x22, 0xf8, 0x80, 0x9b, - 0x03, 0x05, 0x2c, 0xcc, 0x1a, 0x15, 0x1f, 0x83, 0x83, 0x24, 0x4d, 0x49, 0x15, 0xbd, 0x2b, 0x9a, - 0xaa, 0xe9, 0x2b, 0x6b, 0x1b, 0x9e, 0xa6, 0xe2, 0x53, 0x18, 0xaa, 0xad, 0xa6, 0x05, 0x52, 0x4a, - 0x25, 0x7a, 0xbd, 0xae, 0xa7, 0xc7, 0xad, 0xa6, 0xa4, 0x42, 0x04, 0xa8, 0xfd, 0x39, 0xd8, 0x54, - 0xea, 0x42, 0x2d, 0x95, 0xde, 0xa8, 0x7f, 0x09, 0xc8, 0xaf, 0xa1, 0x9f, 0xe5, 0x0b, 0x2d, 0x2b, - 0x47, 0x03, 0x71, 0x91, 0xe5, 0x4f, 0x32, 0xf8, 0x84, 0xf1, 0xa1, 0xee, 0x09, 0x63, 0xc7, 0x5f, - 0x0c, 0x7a, 0x49, 0x32, 0xe3, 0x02, 0x2e, 0x3b, 0xcb, 0xe7, 0xb7, 0x3f, 0x83, 0x7f, 0xbd, 0xba, - 0x7f, 0x77, 0x04, 0xad, 0xad, 0x07, 0x67, 0x21, 0x7b, 0x60, 0x7c, 0x0e, 0x57, 0xdd, 0x68, 0xbc, - 0x3d, 0xf6, 0x7b, 0xd5, 0xfe, 0xfd, 0x31, 0xb8, 0x4d, 0xfb, 0xea, 0x54, 0x1f, 0x72, 0xfa, 0x1d, - 0x00, 0x00, 0xff, 0xff, 0x71, 0xde, 0xae, 0x4f, 0xb3, 0x02, 0x00, 0x00, + // 352 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x92, 0x41, 0x4f, 0xea, 0x40, + 0x10, 0xc7, 0x53, 0x78, 0x90, 0x30, 0xf0, 0xde, 0x61, 0x1f, 0x8f, 0xd7, 0x34, 0x60, 0xc8, 0x7a, + 0x21, 0x1e, 0xa8, 0xc2, 0xcd, 0xbb, 0x09, 0xde, 0xcc, 0x36, 0x9e, 0xeb, 0x4a, 0x37, 0x65, 0x43, + 0xd3, 0xad, 0x9d, 0x29, 0x81, 0x44, 0x2f, 0x7e, 0x05, 0x3f, 0x9a, 0x5f, 0xc1, 0xaf, 0xe0, 0xdd, + 0xd8, 0x56, 0x52, 0x50, 0x8e, 0x7a, 0x68, 0xd2, 0x99, 0xff, 0xec, 0xfc, 0xe6, 0xbf, 0xb3, 0xd0, + 0x42, 0x5c, 0x8c, 0x93, 0xd4, 0x90, 0x61, 0xcd, 0x50, 0x93, 0x8c, 0x36, 0x4e, 0x07, 0x17, 0x32, + 0x55, 0x41, 0x91, 0x75, 0xfa, 0xa1, 0x31, 0x61, 0xa4, 0x5c, 0x99, 0x68, 0x57, 0xc6, 0xb1, 0x21, + 0x49, 0xda, 0xc4, 0x58, 0xa8, 0xfc, 0x06, 0xba, 0x9e, 0x37, 0xbb, 0x4e, 0x22, 0x23, 0x83, 0x2b, + 0x39, 0x5f, 0x0a, 0x75, 0x97, 0x29, 0x24, 0x36, 0x01, 0x48, 0x55, 0x62, 0x50, 0x93, 0x49, 0x37, + 0xb6, 0x35, 0xb4, 0x46, 0xed, 0x09, 0x1b, 0x17, 0x80, 0xb1, 0xd8, 0x2a, 0xa2, 0x52, 0xc5, 0xba, + 0xd0, 0x40, 0x0a, 0x74, 0x6c, 0xd7, 0x86, 0xd6, 0xa8, 0x23, 0x8a, 0x80, 0xdf, 0xc3, 0xbf, 0x3d, + 0x02, 0x26, 0x26, 0x46, 0xc5, 0x7a, 0xd0, 0x44, 0x0a, 0x4c, 0x46, 0x79, 0xfb, 0x8e, 0x28, 0xa3, + 0x32, 0xaf, 0xd2, 0xb4, 0xec, 0x53, 0x46, 0x6c, 0x0a, 0x6d, 0xb5, 0xd6, 0xe4, 0x23, 0x49, 0xca, + 0xd0, 0xae, 0xef, 0xce, 0x74, 0xb1, 0xd6, 0xe4, 0xe5, 0x8a, 0x00, 0xb5, 0xfd, 0xe7, 0xab, 0x9c, + 0x2e, 0xd4, 0x5c, 0xe9, 0x95, 0xfa, 0x16, 0x83, 0xec, 0x2f, 0x34, 0xc2, 0xc8, 0xd7, 0x41, 0x3e, + 0x51, 0x4b, 0xfc, 0x0a, 0xa3, 0xcb, 0x80, 0x3f, 0x40, 0x6f, 0x9f, 0xfb, 0x83, 0xb6, 0x27, 0xaf, + 0x16, 0xd4, 0x3d, 0x6f, 0xc6, 0x08, 0x7e, 0xef, 0x5c, 0x3e, 0xeb, 0x7f, 0x1c, 0xfc, 0x6a, 0xeb, + 0xce, 0xe0, 0x80, 0x5a, 0x8c, 0xce, 0xf9, 0xe3, 0xf3, 0xcb, 0x53, 0xad, 0xcf, 0xff, 0xbb, 0xab, + 0x33, 0x17, 0x71, 0xf1, 0xfe, 0xf9, 0x59, 0x5e, 0xe7, 0x27, 0x72, 0xbe, 0x3c, 0xb7, 0x4e, 0x46, + 0xd6, 0xa9, 0xc5, 0xd6, 0xf0, 0x67, 0xd7, 0x3c, 0xab, 0x36, 0xfe, 0xbc, 0x0c, 0xe7, 0xe8, 0x90, + 0x5c, 0x82, 0x8f, 0x73, 0xf0, 0x80, 0xdb, 0x55, 0x70, 0x5a, 0x14, 0x56, 0xc9, 0xb7, 0xcd, 0xfc, + 0x55, 0x4f, 0xdf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x37, 0x5d, 0xa8, 0xd4, 0x16, 0x03, 0x00, 0x00, } diff --git a/go/ssh.pb.gw.go b/go/ssh.pb.gw.go new file mode 100644 index 00000000..3e7d27f2 --- /dev/null +++ b/go/ssh.pb.gw.go @@ -0,0 +1,233 @@ +// Code generated by protoc-gen-grpc-gateway +// source: ssh.proto +// DO NOT EDIT! + +/* +Package gitaly is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package gitaly + +import ( + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" +) + +var _ codes.Code +var _ io.Reader +var _ = runtime.String +var _ = utilities.NewDoubleArray + +func request_SSH_SSHUploadPack_0(ctx context.Context, marshaler runtime.Marshaler, client SSHClient, req *http.Request, pathParams map[string]string) (SSH_SSHUploadPackClient, runtime.ServerMetadata, error) { + var metadata runtime.ServerMetadata + stream, err := client.SSHUploadPack(ctx) + if err != nil { + grpclog.Printf("Failed to start streaming: %v", err) + return nil, metadata, err + } + dec := marshaler.NewDecoder(req.Body) + handleSend := func() error { + var protoReq SSHUploadPackRequest + err = dec.Decode(&protoReq) + if err == io.EOF { + return err + } + if err != nil { + grpclog.Printf("Failed to decode request: %v", err) + return err + } + if err = stream.Send(&protoReq); err != nil { + grpclog.Printf("Failed to send request: %v", err) + return err + } + return nil + } + if err := handleSend(); err != nil { + if cerr := stream.CloseSend(); cerr != nil { + grpclog.Printf("Failed to terminate client stream: %v", cerr) + } + if err == io.EOF { + return stream, metadata, nil + } + return nil, metadata, err + } + go func() { + for { + if err := handleSend(); err != nil { + break + } + } + if err := stream.CloseSend(); err != nil { + grpclog.Printf("Failed to terminate client stream: %v", err) + } + }() + header, err := stream.Header() + if err != nil { + grpclog.Printf("Failed to get header from client: %v", err) + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil +} + +func request_SSH_SSHReceivePack_0(ctx context.Context, marshaler runtime.Marshaler, client SSHClient, req *http.Request, pathParams map[string]string) (SSH_SSHReceivePackClient, runtime.ServerMetadata, error) { + var metadata runtime.ServerMetadata + stream, err := client.SSHReceivePack(ctx) + if err != nil { + grpclog.Printf("Failed to start streaming: %v", err) + return nil, metadata, err + } + dec := marshaler.NewDecoder(req.Body) + handleSend := func() error { + var protoReq SSHReceivePackRequest + err = dec.Decode(&protoReq) + if err == io.EOF { + return err + } + if err != nil { + grpclog.Printf("Failed to decode request: %v", err) + return err + } + if err = stream.Send(&protoReq); err != nil { + grpclog.Printf("Failed to send request: %v", err) + return err + } + return nil + } + if err := handleSend(); err != nil { + if cerr := stream.CloseSend(); cerr != nil { + grpclog.Printf("Failed to terminate client stream: %v", cerr) + } + if err == io.EOF { + return stream, metadata, nil + } + return nil, metadata, err + } + go func() { + for { + if err := handleSend(); err != nil { + break + } + } + if err := stream.CloseSend(); err != nil { + grpclog.Printf("Failed to terminate client stream: %v", err) + } + }() + header, err := stream.Header() + if err != nil { + grpclog.Printf("Failed to get header from client: %v", err) + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil +} + +// RegisterSSHHandlerFromEndpoint is same as RegisterSSHHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterSSHHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterSSHHandler(ctx, mux, conn) +} + +// RegisterSSHHandler registers the http handlers for service SSH to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterSSHHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + client := NewSSHClient(conn) + + mux.Handle("POST", pattern_SSH_SSHUploadPack_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + } + resp, md, err := request_SSH_SSHUploadPack_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SSH_SSHUploadPack_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_SSH_SSHReceivePack_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + } + resp, md, err := request_SSH_SSHReceivePack_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SSH_SSHReceivePack_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_SSH_SSHUploadPack_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "ssh", "ssh_upload_pack"}, "")) + + pattern_SSH_SSHReceivePack_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "ssh", "ssh_receive_pack"}, "")) +) + +var ( + forward_SSH_SSHUploadPack_0 = runtime.ForwardResponseStream + + forward_SSH_SSHReceivePack_0 = runtime.ForwardResponseStream +) diff --git a/notifications.proto b/notifications.proto index cdc59eef..94b707b8 100644 --- a/notifications.proto +++ b/notifications.proto @@ -3,9 +3,15 @@ syntax = "proto3"; package gitaly; import "shared.proto"; +import "google/api/annotations.proto"; service Notifications { - rpc PostReceive(PostReceiveRequest) returns (PostReceiveResponse) {} + rpc PostReceive(PostReceiveRequest) returns (PostReceiveResponse) { + option (google.api.http) = { + post: "/v1/notification/post_receive" + body: "*" + }; + } } message PostReceiveRequest { diff --git a/ref.proto b/ref.proto index d8cc63fc..e8e6fec7 100644 --- a/ref.proto +++ b/ref.proto @@ -4,15 +4,45 @@ package gitaly; import "shared.proto"; import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; service Ref { - rpc FindDefaultBranchName(FindDefaultBranchNameRequest) returns (FindDefaultBranchNameResponse) {} - rpc FindAllBranchNames(FindAllBranchNamesRequest) returns (stream FindAllBranchNamesResponse) {} - rpc FindAllTagNames(FindAllTagNamesRequest) returns (stream FindAllTagNamesResponse) {} + rpc FindDefaultBranchName(FindDefaultBranchNameRequest) returns (FindDefaultBranchNameResponse) { + option (google.api.http) = { + post: "/v1/ref/find_default_branch_name" + body: "*" + }; + } + + rpc FindAllBranchNames(FindAllBranchNamesRequest) returns (stream FindAllBranchNamesResponse) { + option (google.api.http) = { + post: "/v1/ref/find_all_branch_names" + body: "*" + }; + } + + rpc FindAllTagNames(FindAllTagNamesRequest) returns (stream FindAllTagNamesResponse) { + option (google.api.http) = { + post: "/v1/ref/find_all_tag_names" + body: "*" + }; + } + // Find a Ref matching the given constraints. Response may be empty. - rpc FindRefName(FindRefNameRequest) returns (FindRefNameResponse) {} + rpc FindRefName(FindRefNameRequest) returns (FindRefNameResponse) { + option (google.api.http) = { + post: "/v1/ref/find_ref_name" + body: "*" + }; + } + // Return a stream so we can divide the response in chunks of branches - rpc FindLocalBranches(FindLocalBranchesRequest) returns (stream FindLocalBranchesResponse) {} + rpc FindLocalBranches(FindLocalBranchesRequest) returns (stream FindLocalBranchesResponse) { + option (google.api.http) = { + post: "/v1/ref/find_local_branches" + body: "*" + }; + } } message FindDefaultBranchNameRequest { diff --git a/ruby/lib/gitaly/commit_pb.rb b/ruby/lib/gitaly/commit_pb.rb index b69e185d..8577fa69 100644 --- a/ruby/lib/gitaly/commit_pb.rb +++ b/ruby/lib/gitaly/commit_pb.rb @@ -4,6 +4,7 @@ require 'google/protobuf' require 'shared_pb' +require 'google/api/annotations_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_message "gitaly.CommitIsAncestorRequest" do optional :repository, :message, 1, "gitaly.Repository" diff --git a/ruby/lib/gitaly/diff_pb.rb b/ruby/lib/gitaly/diff_pb.rb index b12e9cb0..63080e23 100644 --- a/ruby/lib/gitaly/diff_pb.rb +++ b/ruby/lib/gitaly/diff_pb.rb @@ -4,6 +4,7 @@ require 'google/protobuf' require 'shared_pb' +require 'google/api/annotations_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_message "gitaly.CommitDiffRequest" do optional :repository, :message, 1, "gitaly.Repository" diff --git a/ruby/lib/gitaly/notifications_pb.rb b/ruby/lib/gitaly/notifications_pb.rb index 8e210ca1..314f5b95 100644 --- a/ruby/lib/gitaly/notifications_pb.rb +++ b/ruby/lib/gitaly/notifications_pb.rb @@ -4,6 +4,7 @@ require 'google/protobuf' require 'shared_pb' +require 'google/api/annotations_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_message "gitaly.PostReceiveRequest" do optional :repository, :message, 1, "gitaly.Repository" diff --git a/ruby/lib/gitaly/ref_pb.rb b/ruby/lib/gitaly/ref_pb.rb index 2f1fb5ed..fa3f6e1f 100644 --- a/ruby/lib/gitaly/ref_pb.rb +++ b/ruby/lib/gitaly/ref_pb.rb @@ -5,6 +5,7 @@ require 'google/protobuf' require 'shared_pb' require 'google/protobuf/timestamp_pb' +require 'google/api/annotations_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_message "gitaly.FindDefaultBranchNameRequest" do optional :repository, :message, 1, "gitaly.Repository" diff --git a/ruby/lib/gitaly/shared_pb.rb b/ruby/lib/gitaly/shared_pb.rb index 340b7e9e..4c7d8f5b 100644 --- a/ruby/lib/gitaly/shared_pb.rb +++ b/ruby/lib/gitaly/shared_pb.rb @@ -3,6 +3,7 @@ require 'google/protobuf' +require 'google/api/annotations_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_message "gitaly.Repository" do optional :path, :string, 1 diff --git a/ruby/lib/gitaly/smarthttp_pb.rb b/ruby/lib/gitaly/smarthttp_pb.rb index 7e0e2128..ceca40c9 100644 --- a/ruby/lib/gitaly/smarthttp_pb.rb +++ b/ruby/lib/gitaly/smarthttp_pb.rb @@ -4,6 +4,7 @@ require 'google/protobuf' require 'shared_pb' +require 'google/api/annotations_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_message "gitaly.InfoRefsRequest" do optional :repository, :message, 1, "gitaly.Repository" diff --git a/ruby/lib/gitaly/ssh_pb.rb b/ruby/lib/gitaly/ssh_pb.rb index 4bc51c66..89ba1061 100644 --- a/ruby/lib/gitaly/ssh_pb.rb +++ b/ruby/lib/gitaly/ssh_pb.rb @@ -4,6 +4,7 @@ require 'google/protobuf' require 'shared_pb' +require 'google/api/annotations_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_message "gitaly.SSHUploadPackRequest" do optional :repository, :message, 1, "gitaly.Repository" diff --git a/shared.proto b/shared.proto index db811f35..73a2864d 100644 --- a/shared.proto +++ b/shared.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package gitaly; +import "google/api/annotations.proto"; + message Repository { string path = 1; string storage_name = 2; diff --git a/smarthttp.proto b/smarthttp.proto index dc7ac1c0..eeb835bd 100644 --- a/smarthttp.proto +++ b/smarthttp.proto @@ -3,19 +3,40 @@ syntax = "proto3"; package gitaly; import "shared.proto"; +import "google/api/annotations.proto"; service SmartHTTP { // The response body for GET /info/refs?service=git-upload-pack - rpc InfoRefsUploadPack(InfoRefsRequest) returns (stream InfoRefsResponse) {} + rpc InfoRefsUploadPack(InfoRefsRequest) returns (stream InfoRefsResponse) { + option (google.api.http) = { + post: "/v1/smart_http/info_refs_upload_pack" + body: "*" + }; + } // The response body for GET /info/refs?service=git-receive-pack - rpc InfoRefsReceivePack(InfoRefsRequest) returns (stream InfoRefsResponse) {} + rpc InfoRefsReceivePack(InfoRefsRequest) returns (stream InfoRefsResponse) { + option (google.api.http) = { + post: "/v1/smart_http/info_refs_receive_pack" + body: "*" + }; + } // Request and response body for POST /upload-pack - rpc PostUploadPack(stream PostUploadPackRequest) returns (stream PostUploadPackResponse) {} + rpc PostUploadPack(stream PostUploadPackRequest) returns (stream PostUploadPackResponse) { + option (google.api.http) = { + post: "/v1/smart_http/post_upload_pack" + body: "*" + }; + } // Request and response body for POST /receive-pack - rpc PostReceivePack(stream PostReceivePackRequest) returns (stream PostReceivePackResponse) {} + rpc PostReceivePack(stream PostReceivePackRequest) returns (stream PostReceivePackResponse) { + option (google.api.http) = { + post: "/v1/smart_http/post_receive_pack" + body: "*" + }; + } } message InfoRefsRequest { diff --git a/ssh.proto b/ssh.proto index e1ec2803..cbdbf961 100644 --- a/ssh.proto +++ b/ssh.proto @@ -3,13 +3,24 @@ syntax = "proto3"; package gitaly; import "shared.proto"; +import "google/api/annotations.proto"; service SSH { // To forward 'git upload-pack' to Gitaly for SSH sessions - rpc SSHUploadPack(stream SSHUploadPackRequest) returns (stream SSHUploadPackResponse) {} + rpc SSHUploadPack(stream SSHUploadPackRequest) returns (stream SSHUploadPackResponse) { + option (google.api.http) = { + post: "/v1/ssh/ssh_upload_pack" + body: "*" + }; + } // To forward 'git receive-pack' to Gitaly for SSH sessions - rpc SSHReceivePack(stream SSHReceivePackRequest) returns (stream SSHReceivePackResponse) {} + rpc SSHReceivePack(stream SSHReceivePackRequest) returns (stream SSHReceivePackResponse) { + option (google.api.http) = { + post: "/v1/ssh/ssh_receive_pack" + body: "*" + }; + } } message SSHUploadPackRequest { diff --git a/swagger/commit.swagger.json b/swagger/commit.swagger.json new file mode 100644 index 00000000..4c53ade0 --- /dev/null +++ b/swagger/commit.swagger.json @@ -0,0 +1,84 @@ +{ + "swagger": "2.0", + "info": { + "title": "commit.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/commit/commit_is_ancestor": { + "post": { + "operationId": "CommitIsAncestor", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/gitalyCommitIsAncestorResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyCommitIsAncestorRequest" + } + } + ], + "tags": [ + "Commit" + ] + } + } + }, + "definitions": { + "gitalyCommitIsAncestorRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + }, + "ancestor_id": { + "type": "string" + }, + "child_id": { + "type": "string" + } + } + }, + "gitalyCommitIsAncestorResponse": { + "type": "object", + "properties": { + "value": { + "type": "boolean", + "format": "boolean" + } + } + }, + "gitalyRepository": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "storage_name": { + "type": "string" + }, + "relative_path": { + "type": "string" + } + } + } + } +} diff --git a/swagger/diff.swagger.json b/swagger/diff.swagger.json new file mode 100644 index 00000000..44db2ad6 --- /dev/null +++ b/swagger/diff.swagger.json @@ -0,0 +1,116 @@ +{ + "swagger": "2.0", + "info": { + "title": "diff.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/diff/commit_diff": { + "post": { + "summary": "Returns stream of CommitDiffResponse: 1 per changed file", + "operationId": "CommitDiff", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyCommitDiffResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyCommitDiffRequest" + } + } + ], + "tags": [ + "Diff" + ] + } + } + }, + "definitions": { + "gitalyCommitDiffRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + }, + "left_commit_id": { + "type": "string" + }, + "right_commit_id": { + "type": "string" + } + } + }, + "gitalyCommitDiffResponse": { + "type": "object", + "properties": { + "from_path": { + "type": "string", + "format": "byte" + }, + "to_path": { + "type": "string", + "format": "byte" + }, + "from_id": { + "type": "string", + "title": "Blob ID as returned via `git diff --full-index`" + }, + "to_id": { + "type": "string" + }, + "old_mode": { + "type": "integer", + "format": "int32" + }, + "new_mode": { + "type": "integer", + "format": "int32" + }, + "binary": { + "type": "boolean", + "format": "boolean" + }, + "raw_chunks": { + "type": "array", + "items": { + "type": "string", + "format": "byte" + } + } + }, + "description": "A CommitDiffResponse corresponds to a single changed file in a commit." + }, + "gitalyRepository": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "storage_name": { + "type": "string" + }, + "relative_path": { + "type": "string" + } + } + } + } +} diff --git a/swagger/notifications.swagger.json b/swagger/notifications.swagger.json new file mode 100644 index 00000000..4fe576b4 --- /dev/null +++ b/swagger/notifications.swagger.json @@ -0,0 +1,72 @@ +{ + "swagger": "2.0", + "info": { + "title": "notifications.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/notification/post_receive": { + "post": { + "operationId": "PostReceive", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/gitalyPostReceiveResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyPostReceiveRequest" + } + } + ], + "tags": [ + "Notifications" + ] + } + } + }, + "definitions": { + "gitalyPostReceiveRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + } + } + }, + "gitalyPostReceiveResponse": { + "type": "object" + }, + "gitalyRepository": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "storage_name": { + "type": "string" + }, + "relative_path": { + "type": "string" + } + } + } + } +} diff --git a/swagger/ref.swagger.json b/swagger/ref.swagger.json new file mode 100644 index 00000000..0b4aab3d --- /dev/null +++ b/swagger/ref.swagger.json @@ -0,0 +1,321 @@ +{ + "swagger": "2.0", + "info": { + "title": "ref.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/ref/find_all_branch_names": { + "post": { + "operationId": "FindAllBranchNames", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyFindAllBranchNamesResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyFindAllBranchNamesRequest" + } + } + ], + "tags": [ + "Ref" + ] + } + }, + "/v1/ref/find_all_tag_names": { + "post": { + "operationId": "FindAllTagNames", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyFindAllTagNamesResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyFindAllTagNamesRequest" + } + } + ], + "tags": [ + "Ref" + ] + } + }, + "/v1/ref/find_default_branch_name": { + "post": { + "operationId": "FindDefaultBranchName", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/gitalyFindDefaultBranchNameResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyFindDefaultBranchNameRequest" + } + } + ], + "tags": [ + "Ref" + ] + } + }, + "/v1/ref/find_local_branches": { + "post": { + "summary": "Return a stream so we can divide the response in chunks of branches", + "operationId": "FindLocalBranches", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyFindLocalBranchesResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyFindLocalBranchesRequest" + } + } + ], + "tags": [ + "Ref" + ] + } + }, + "/v1/ref/find_ref_name": { + "post": { + "summary": "Find a Ref matching the given constraints. Response may be empty.", + "operationId": "FindRefName", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/gitalyFindRefNameResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyFindRefNameRequest" + } + } + ], + "tags": [ + "Ref" + ] + } + } + }, + "definitions": { + "FindLocalBranchesRequestSortBy": { + "type": "string", + "enum": [ + "NAME", + "UPDATED_ASC", + "UPDATED_DESC" + ], + "default": "NAME" + }, + "gitalyFindAllBranchNamesRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + } + } + }, + "gitalyFindAllBranchNamesResponse": { + "type": "object", + "properties": { + "names": { + "type": "array", + "items": { + "type": "string", + "format": "byte" + } + } + } + }, + "gitalyFindAllTagNamesRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + } + } + }, + "gitalyFindAllTagNamesResponse": { + "type": "object", + "properties": { + "names": { + "type": "array", + "items": { + "type": "string", + "format": "byte" + } + } + } + }, + "gitalyFindDefaultBranchNameRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + } + } + }, + "gitalyFindDefaultBranchNameResponse": { + "type": "object", + "properties": { + "name": { + "type": "string", + "format": "byte" + } + } + }, + "gitalyFindLocalBranchCommitAuthor": { + "type": "object", + "properties": { + "name": { + "type": "string", + "format": "byte" + }, + "email": { + "type": "string", + "format": "byte" + }, + "date": { + "type": "string", + "format": "date-time" + } + } + }, + "gitalyFindLocalBranchResponse": { + "type": "object", + "properties": { + "name": { + "type": "string", + "format": "byte" + }, + "commit_id": { + "type": "string" + }, + "commit_subject": { + "type": "string", + "format": "byte" + }, + "commit_author": { + "$ref": "#/definitions/gitalyFindLocalBranchCommitAuthor" + }, + "commit_committer": { + "$ref": "#/definitions/gitalyFindLocalBranchCommitAuthor" + } + } + }, + "gitalyFindLocalBranchesRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + }, + "sort_by": { + "$ref": "#/definitions/FindLocalBranchesRequestSortBy" + } + } + }, + "gitalyFindLocalBranchesResponse": { + "type": "object", + "properties": { + "branches": { + "type": "array", + "items": { + "$ref": "#/definitions/gitalyFindLocalBranchResponse" + } + } + } + }, + "gitalyFindRefNameRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + }, + "commit_id": { + "type": "string", + "title": "Require that the resulting ref contains this commit as an ancestor" + }, + "prefix": { + "type": "string", + "format": "byte", + "description": "Example prefix: \"refs/heads/\". Type bytes because that is the type of ref names." + } + } + }, + "gitalyFindRefNameResponse": { + "type": "object", + "properties": { + "name": { + "type": "string", + "format": "byte", + "description": "Example name: \"refs/heads/master\". Cannot assume UTF8, so the type is bytes." + } + } + }, + "gitalyRepository": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "storage_name": { + "type": "string" + }, + "relative_path": { + "type": "string" + } + } + } + } +} diff --git a/swagger/shared.swagger.json b/swagger/shared.swagger.json new file mode 100644 index 00000000..e9f4cad3 --- /dev/null +++ b/swagger/shared.swagger.json @@ -0,0 +1,19 @@ +{ + "swagger": "2.0", + "info": { + "title": "shared.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": {} +} diff --git a/swagger/smarthttp.swagger.json b/swagger/smarthttp.swagger.json new file mode 100644 index 00000000..e6a8cdb8 --- /dev/null +++ b/swagger/smarthttp.swagger.json @@ -0,0 +1,214 @@ +{ + "swagger": "2.0", + "info": { + "title": "smarthttp.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/smart_http/info_refs_receive_pack": { + "post": { + "summary": "The response body for GET /info/refs?service=git-receive-pack", + "operationId": "InfoRefsReceivePack", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyInfoRefsResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyInfoRefsRequest" + } + } + ], + "tags": [ + "SmartHTTP" + ] + } + }, + "/v1/smart_http/info_refs_upload_pack": { + "post": { + "summary": "The response body for GET /info/refs?service=git-upload-pack", + "operationId": "InfoRefsUploadPack", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyInfoRefsResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyInfoRefsRequest" + } + } + ], + "tags": [ + "SmartHTTP" + ] + } + }, + "/v1/smart_http/post_receive_pack": { + "post": { + "summary": "Request and response body for POST /receive-pack", + "operationId": "PostReceivePack", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyPostReceivePackResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "(streaming inputs)", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyPostReceivePackRequest" + } + } + ], + "tags": [ + "SmartHTTP" + ] + } + }, + "/v1/smart_http/post_upload_pack": { + "post": { + "summary": "Request and response body for POST /upload-pack", + "operationId": "PostUploadPack", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyPostUploadPackResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "(streaming inputs)", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyPostUploadPackRequest" + } + } + ], + "tags": [ + "SmartHTTP" + ] + } + } + }, + "definitions": { + "gitalyInfoRefsRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + } + } + }, + "gitalyInfoRefsResponse": { + "type": "object", + "properties": { + "data": { + "type": "string", + "format": "byte" + } + } + }, + "gitalyPostReceivePackRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository", + "title": "repository should only be present in the first message of the stream" + }, + "data": { + "type": "string", + "format": "byte", + "title": "Raw data to be copied to stdin of 'git receive-pack'" + }, + "gl_id": { + "type": "string", + "description": "gl_id becomes env variable GL_ID, used by the Git {pre,post}-receive\nhooks. Should only be present in the first message of the stream." + } + } + }, + "gitalyPostReceivePackResponse": { + "type": "object", + "properties": { + "data": { + "type": "string", + "format": "byte", + "title": "Raw data from stdout of 'git receive-pack'" + } + } + }, + "gitalyPostUploadPackRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository", + "title": "repository should only be present in the first message of the stream" + }, + "data": { + "type": "string", + "format": "byte", + "title": "Raw data to be copied to stdin of 'git upload-pack'" + } + } + }, + "gitalyPostUploadPackResponse": { + "type": "object", + "properties": { + "data": { + "type": "string", + "format": "byte", + "title": "Raw data from stdout of 'git upload-pack'" + } + } + }, + "gitalyRepository": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "storage_name": { + "type": "string" + }, + "relative_path": { + "type": "string" + } + } + } + } +} diff --git a/swagger/ssh.swagger.json b/swagger/ssh.swagger.json new file mode 100644 index 00000000..52f8d7cc --- /dev/null +++ b/swagger/ssh.swagger.json @@ -0,0 +1,170 @@ +{ + "swagger": "2.0", + "info": { + "title": "ssh.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/ssh/ssh_receive_pack": { + "post": { + "summary": "To forward 'git receive-pack' to Gitaly for SSH sessions", + "operationId": "SSHReceivePack", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalySSHReceivePackResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "(streaming inputs)", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalySSHReceivePackRequest" + } + } + ], + "tags": [ + "SSH" + ] + } + }, + "/v1/ssh/ssh_upload_pack": { + "post": { + "summary": "To forward 'git upload-pack' to Gitaly for SSH sessions", + "operationId": "SSHUploadPack", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalySSHUploadPackResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "(streaming inputs)", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalySSHUploadPackRequest" + } + } + ], + "tags": [ + "SSH" + ] + } + } + }, + "definitions": { + "gitalyExitStatus": { + "type": "object", + "properties": { + "value": { + "type": "integer", + "format": "int32" + } + } + }, + "gitalyRepository": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "storage_name": { + "type": "string" + }, + "relative_path": { + "type": "string" + } + } + }, + "gitalySSHReceivePackRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository", + "description": "'repository' must be present in the first message." + }, + "stdin": { + "type": "string", + "format": "byte", + "title": "A chunk of raw data to be copied to 'git upload-pack' standard input" + }, + "gl_id": { + "type": "string", + "title": "Contents of GL_ID environment variable for 'git receive-pack'" + } + } + }, + "gitalySSHReceivePackResponse": { + "type": "object", + "properties": { + "stdout": { + "type": "string", + "format": "byte", + "title": "A chunk of raw data from 'git receive-pack' standard output" + }, + "stderr": { + "type": "string", + "format": "byte", + "title": "A chunk of raw data from 'git receive-pack' standard error" + }, + "exit_status": { + "$ref": "#/definitions/gitalyExitStatus", + "description": "This field may be nil. This is intentional: only when the remote\ncommand has finished can we return its exit status." + } + } + }, + "gitalySSHUploadPackRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository", + "description": "'repository' must be present in the first message." + }, + "stdin": { + "type": "string", + "format": "byte", + "title": "A chunk of raw data to be copied to 'git upload-pack' standard input" + } + } + }, + "gitalySSHUploadPackResponse": { + "type": "object", + "properties": { + "stdout": { + "type": "string", + "format": "byte", + "title": "A chunk of raw data from 'git upload-pack' standard output" + }, + "stderr": { + "type": "string", + "format": "byte", + "title": "A chunk of raw data from 'git upload-pack' standard error" + }, + "exit_status": { + "$ref": "#/definitions/gitalyExitStatus", + "description": "This field may be nil. This is intentional: only when the remote\ncommand has finished can we return its exit status." + } + } + } + } +} -- GitLab From 505b15aa0899a987f569717f578c8687c06789b2 Mon Sep 17 00:00:00 2001 From: Andrew Newdigate Date: Tue, 25 Apr 2017 13:18:50 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=A8=20Feature:=20now=20generating=20a?= =?UTF-8?q?=20full=20API=20client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _support/generate-from-proto | 12 +- _support/merge-swagger-definitions | 15 + {go => gateway}/commit.pb.gw.go | 0 {go => gateway}/diff.pb.gw.go | 0 {go => gateway}/notifications.pb.gw.go | 0 {go => gateway}/ref.pb.gw.go | 0 {go => gateway}/smarthttp.pb.gw.go | 0 {go => gateway}/ssh.pb.gw.go | 0 ruby_swagger/.gitignore | 39 + ruby_swagger/.rspec | 2 + ruby_swagger/.swagger-codegen-ignore | 23 + ruby_swagger/Gemfile | 7 + ruby_swagger/README.md | 131 +++ ruby_swagger/Rakefile | 8 + ruby_swagger/docs/CommitApi.md | 53 ++ ruby_swagger/docs/DiffApi.md | 54 ++ .../docs/FindLocalBranchesRequestSortBy.md | 7 + ruby_swagger/docs/GitalyCommitDiffRequest.md | 10 + ruby_swagger/docs/GitalyCommitDiffResponse.md | 15 + .../docs/GitalyCommitIsAncestorRequest.md | 10 + .../docs/GitalyCommitIsAncestorResponse.md | 8 + ruby_swagger/docs/GitalyExitStatus.md | 8 + .../docs/GitalyFindAllBranchNamesRequest.md | 8 + .../docs/GitalyFindAllBranchNamesResponse.md | 8 + .../docs/GitalyFindAllTagNamesRequest.md | 8 + .../docs/GitalyFindAllTagNamesResponse.md | 8 + .../GitalyFindDefaultBranchNameRequest.md | 8 + .../GitalyFindDefaultBranchNameResponse.md | 8 + .../docs/GitalyFindLocalBranchCommitAuthor.md | 10 + .../docs/GitalyFindLocalBranchResponse.md | 12 + .../docs/GitalyFindLocalBranchesRequest.md | 9 + .../docs/GitalyFindLocalBranchesResponse.md | 8 + ruby_swagger/docs/GitalyFindRefNameRequest.md | 10 + .../docs/GitalyFindRefNameResponse.md | 8 + ruby_swagger/docs/GitalyInfoRefsRequest.md | 8 + ruby_swagger/docs/GitalyInfoRefsResponse.md | 8 + .../docs/GitalyPostReceivePackRequest.md | 10 + .../docs/GitalyPostReceivePackResponse.md | 8 + ruby_swagger/docs/GitalyPostReceiveRequest.md | 8 + .../docs/GitalyPostReceiveResponse.md | 7 + .../docs/GitalyPostUploadPackRequest.md | 9 + .../docs/GitalyPostUploadPackResponse.md | 8 + ruby_swagger/docs/GitalyRepository.md | 10 + .../docs/GitalySSHReceivePackRequest.md | 10 + .../docs/GitalySSHReceivePackResponse.md | 10 + .../docs/GitalySSHUploadPackRequest.md | 9 + .../docs/GitalySSHUploadPackResponse.md | 10 + ruby_swagger/docs/NotificationsApi.md | 53 ++ ruby_swagger/docs/RefApi.md | 235 +++++ ruby_swagger/docs/SSHApi.md | 100 +++ ruby_swagger/docs/SmartHTTPApi.md | 192 +++++ ruby_swagger/git_push.sh | 55 ++ ruby_swagger/lib/swagger_client.rb | 75 ++ .../lib/swagger_client/api/commit_api.rb | 75 ++ .../lib/swagger_client/api/diff_api.rb | 75 ++ .../swagger_client/api/notifications_api.rb | 75 ++ .../lib/swagger_client/api/ref_api.rb | 287 +++++++ .../lib/swagger_client/api/smart_http_api.rb | 234 +++++ .../lib/swagger_client/api/ssh_api.rb | 128 +++ ruby_swagger/lib/swagger_client/api_client.rb | 375 ++++++++ ruby_swagger/lib/swagger_client/api_error.rb | 37 + .../lib/swagger_client/configuration.rb | 195 +++++ .../find_local_branches_request_sort_by.rb | 22 + .../models/gitaly_commit_diff_request.rb | 205 +++++ .../models/gitaly_commit_diff_response.rb | 252 ++++++ .../gitaly_commit_is_ancestor_request.rb | 205 +++++ .../gitaly_commit_is_ancestor_response.rb | 187 ++++ .../models/gitaly_exit_status.rb | 187 ++++ .../gitaly_find_all_branch_names_request.rb | 187 ++++ .../gitaly_find_all_branch_names_response.rb | 189 +++++ .../gitaly_find_all_tag_names_request.rb | 187 ++++ .../gitaly_find_all_tag_names_response.rb | 189 +++++ ...gitaly_find_default_branch_name_request.rb | 187 ++++ ...italy_find_default_branch_name_response.rb | 187 ++++ .../gitaly_find_local_branch_commit_author.rb | 205 +++++ .../gitaly_find_local_branch_response.rb | 223 +++++ .../gitaly_find_local_branches_request.rb | 196 +++++ .../gitaly_find_local_branches_response.rb | 189 +++++ .../models/gitaly_find_ref_name_request.rb | 206 +++++ .../models/gitaly_find_ref_name_response.rb | 188 ++++ .../models/gitaly_info_refs_request.rb | 187 ++++ .../models/gitaly_info_refs_response.rb | 187 ++++ .../gitaly_post_receive_pack_request.rb | 206 +++++ .../gitaly_post_receive_pack_response.rb | 187 ++++ .../models/gitaly_post_receive_request.rb | 187 ++++ .../models/gitaly_post_receive_response.rb | 178 ++++ .../models/gitaly_post_upload_pack_request.rb | 196 +++++ .../gitaly_post_upload_pack_response.rb | 187 ++++ .../models/gitaly_repository.rb | 205 +++++ .../models/gitaly_ssh_receive_pack_request.rb | 206 +++++ .../gitaly_ssh_receive_pack_response.rb | 206 +++++ .../models/gitaly_ssh_upload_pack_request.rb | 197 +++++ .../models/gitaly_ssh_upload_pack_response.rb | 206 +++++ ruby_swagger/lib/swagger_client/version.rb | 14 + ruby_swagger/spec/api/commit_api_spec.rb | 46 + ruby_swagger/spec/api/diff_api_spec.rb | 46 + .../spec/api/notifications_api_spec.rb | 46 + ruby_swagger/spec/api/ref_api_spec.rb | 94 ++ ruby_swagger/spec/api/smart_http_api_spec.rb | 82 ++ ruby_swagger/spec/api/ssh_api_spec.rb | 58 ++ ruby_swagger/spec/api_client_spec.rb | 225 +++++ ruby_swagger/spec/configuration_spec.rb | 41 + ...ind_local_branches_request_sort_by_spec.rb | 35 + .../models/gitaly_commit_diff_request_spec.rb | 53 ++ .../gitaly_commit_diff_response_spec.rb | 83 ++ .../gitaly_commit_is_ancestor_request_spec.rb | 53 ++ ...gitaly_commit_is_ancestor_response_spec.rb | 41 + .../spec/models/gitaly_exit_status_spec.rb | 41 + ...taly_find_all_branch_names_request_spec.rb | 41 + ...aly_find_all_branch_names_response_spec.rb | 41 + .../gitaly_find_all_tag_names_request_spec.rb | 41 + ...gitaly_find_all_tag_names_response_spec.rb | 41 + ...y_find_default_branch_name_request_spec.rb | 41 + ..._find_default_branch_name_response_spec.rb | 41 + ...ly_find_local_branch_commit_author_spec.rb | 53 ++ .../gitaly_find_local_branch_response_spec.rb | 65 ++ ...gitaly_find_local_branches_request_spec.rb | 47 + ...italy_find_local_branches_response_spec.rb | 41 + .../gitaly_find_ref_name_request_spec.rb | 53 ++ .../gitaly_find_ref_name_response_spec.rb | 41 + .../models/gitaly_info_refs_request_spec.rb | 41 + .../models/gitaly_info_refs_response_spec.rb | 41 + .../gitaly_post_receive_pack_request_spec.rb | 53 ++ .../gitaly_post_receive_pack_response_spec.rb | 41 + .../gitaly_post_receive_request_spec.rb | 41 + .../gitaly_post_receive_response_spec.rb | 35 + .../gitaly_post_upload_pack_request_spec.rb | 47 + .../gitaly_post_upload_pack_response_spec.rb | 41 + .../spec/models/gitaly_repository_spec.rb | 53 ++ .../gitaly_ssh_receive_pack_request_spec.rb | 53 ++ .../gitaly_ssh_receive_pack_response_spec.rb | 53 ++ .../gitaly_ssh_upload_pack_request_spec.rb | 47 + .../gitaly_ssh_upload_pack_response_spec.rb | 53 ++ ruby_swagger/spec/spec_helper.rb | 110 +++ ruby_swagger/swagger_client.gemspec | 45 + swagger/main.json | 802 ++++++++++++++++++ 136 files changed, 11798 insertions(+), 1 deletion(-) create mode 100755 _support/merge-swagger-definitions rename {go => gateway}/commit.pb.gw.go (100%) rename {go => gateway}/diff.pb.gw.go (100%) rename {go => gateway}/notifications.pb.gw.go (100%) rename {go => gateway}/ref.pb.gw.go (100%) rename {go => gateway}/smarthttp.pb.gw.go (100%) rename {go => gateway}/ssh.pb.gw.go (100%) create mode 100644 ruby_swagger/.gitignore create mode 100644 ruby_swagger/.rspec create mode 100644 ruby_swagger/.swagger-codegen-ignore create mode 100644 ruby_swagger/Gemfile create mode 100644 ruby_swagger/README.md create mode 100644 ruby_swagger/Rakefile create mode 100644 ruby_swagger/docs/CommitApi.md create mode 100644 ruby_swagger/docs/DiffApi.md create mode 100644 ruby_swagger/docs/FindLocalBranchesRequestSortBy.md create mode 100644 ruby_swagger/docs/GitalyCommitDiffRequest.md create mode 100644 ruby_swagger/docs/GitalyCommitDiffResponse.md create mode 100644 ruby_swagger/docs/GitalyCommitIsAncestorRequest.md create mode 100644 ruby_swagger/docs/GitalyCommitIsAncestorResponse.md create mode 100644 ruby_swagger/docs/GitalyExitStatus.md create mode 100644 ruby_swagger/docs/GitalyFindAllBranchNamesRequest.md create mode 100644 ruby_swagger/docs/GitalyFindAllBranchNamesResponse.md create mode 100644 ruby_swagger/docs/GitalyFindAllTagNamesRequest.md create mode 100644 ruby_swagger/docs/GitalyFindAllTagNamesResponse.md create mode 100644 ruby_swagger/docs/GitalyFindDefaultBranchNameRequest.md create mode 100644 ruby_swagger/docs/GitalyFindDefaultBranchNameResponse.md create mode 100644 ruby_swagger/docs/GitalyFindLocalBranchCommitAuthor.md create mode 100644 ruby_swagger/docs/GitalyFindLocalBranchResponse.md create mode 100644 ruby_swagger/docs/GitalyFindLocalBranchesRequest.md create mode 100644 ruby_swagger/docs/GitalyFindLocalBranchesResponse.md create mode 100644 ruby_swagger/docs/GitalyFindRefNameRequest.md create mode 100644 ruby_swagger/docs/GitalyFindRefNameResponse.md create mode 100644 ruby_swagger/docs/GitalyInfoRefsRequest.md create mode 100644 ruby_swagger/docs/GitalyInfoRefsResponse.md create mode 100644 ruby_swagger/docs/GitalyPostReceivePackRequest.md create mode 100644 ruby_swagger/docs/GitalyPostReceivePackResponse.md create mode 100644 ruby_swagger/docs/GitalyPostReceiveRequest.md create mode 100644 ruby_swagger/docs/GitalyPostReceiveResponse.md create mode 100644 ruby_swagger/docs/GitalyPostUploadPackRequest.md create mode 100644 ruby_swagger/docs/GitalyPostUploadPackResponse.md create mode 100644 ruby_swagger/docs/GitalyRepository.md create mode 100644 ruby_swagger/docs/GitalySSHReceivePackRequest.md create mode 100644 ruby_swagger/docs/GitalySSHReceivePackResponse.md create mode 100644 ruby_swagger/docs/GitalySSHUploadPackRequest.md create mode 100644 ruby_swagger/docs/GitalySSHUploadPackResponse.md create mode 100644 ruby_swagger/docs/NotificationsApi.md create mode 100644 ruby_swagger/docs/RefApi.md create mode 100644 ruby_swagger/docs/SSHApi.md create mode 100644 ruby_swagger/docs/SmartHTTPApi.md create mode 100644 ruby_swagger/git_push.sh create mode 100644 ruby_swagger/lib/swagger_client.rb create mode 100644 ruby_swagger/lib/swagger_client/api/commit_api.rb create mode 100644 ruby_swagger/lib/swagger_client/api/diff_api.rb create mode 100644 ruby_swagger/lib/swagger_client/api/notifications_api.rb create mode 100644 ruby_swagger/lib/swagger_client/api/ref_api.rb create mode 100644 ruby_swagger/lib/swagger_client/api/smart_http_api.rb create mode 100644 ruby_swagger/lib/swagger_client/api/ssh_api.rb create mode 100644 ruby_swagger/lib/swagger_client/api_client.rb create mode 100644 ruby_swagger/lib/swagger_client/api_error.rb create mode 100644 ruby_swagger/lib/swagger_client/configuration.rb create mode 100644 ruby_swagger/lib/swagger_client/models/find_local_branches_request_sort_by.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_commit_diff_request.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_commit_diff_response.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_commit_is_ancestor_request.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_commit_is_ancestor_response.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_exit_status.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_find_all_branch_names_request.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_find_all_branch_names_response.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_find_all_tag_names_request.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_find_all_tag_names_response.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_find_default_branch_name_request.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_find_default_branch_name_response.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_find_local_branch_commit_author.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_find_local_branch_response.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_find_local_branches_request.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_find_local_branches_response.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_find_ref_name_request.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_find_ref_name_response.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_info_refs_request.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_info_refs_response.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_post_receive_pack_request.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_post_receive_pack_response.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_post_receive_request.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_post_receive_response.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_post_upload_pack_request.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_post_upload_pack_response.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_repository.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_ssh_receive_pack_request.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_ssh_receive_pack_response.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_ssh_upload_pack_request.rb create mode 100644 ruby_swagger/lib/swagger_client/models/gitaly_ssh_upload_pack_response.rb create mode 100644 ruby_swagger/lib/swagger_client/version.rb create mode 100644 ruby_swagger/spec/api/commit_api_spec.rb create mode 100644 ruby_swagger/spec/api/diff_api_spec.rb create mode 100644 ruby_swagger/spec/api/notifications_api_spec.rb create mode 100644 ruby_swagger/spec/api/ref_api_spec.rb create mode 100644 ruby_swagger/spec/api/smart_http_api_spec.rb create mode 100644 ruby_swagger/spec/api/ssh_api_spec.rb create mode 100644 ruby_swagger/spec/api_client_spec.rb create mode 100644 ruby_swagger/spec/configuration_spec.rb create mode 100644 ruby_swagger/spec/models/find_local_branches_request_sort_by_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_commit_diff_request_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_commit_diff_response_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_commit_is_ancestor_request_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_commit_is_ancestor_response_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_exit_status_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_find_all_branch_names_request_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_find_all_branch_names_response_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_find_all_tag_names_request_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_find_all_tag_names_response_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_find_default_branch_name_request_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_find_default_branch_name_response_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_find_local_branch_commit_author_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_find_local_branch_response_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_find_local_branches_request_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_find_local_branches_response_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_find_ref_name_request_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_find_ref_name_response_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_info_refs_request_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_info_refs_response_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_post_receive_pack_request_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_post_receive_pack_response_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_post_receive_request_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_post_receive_response_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_post_upload_pack_request_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_post_upload_pack_response_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_repository_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_ssh_receive_pack_request_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_ssh_receive_pack_response_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_ssh_upload_pack_request_spec.rb create mode 100644 ruby_swagger/spec/models/gitaly_ssh_upload_pack_response_spec.rb create mode 100644 ruby_swagger/spec/spec_helper.rb create mode 100644 ruby_swagger/swagger_client.gemspec create mode 100644 swagger/main.json diff --git a/_support/generate-from-proto b/_support/generate-from-proto index a03f5493..6f40b51c 100755 --- a/_support/generate-from-proto +++ b/_support/generate-from-proto @@ -20,8 +20,18 @@ ENV['PATH'] = [ def main FileUtils.rm(Dir['go/**/*.pb.go']) + FileUtils.rm(Dir['gateway/**/*.pb.gw.go']) FileUtils.rm(Dir['swagger/**']) - run!(%W[protoc -I#{GO_PATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis -I #{PROTO_INCLUDE}] + PROTO_FILES + %w[--go_out=plugins=grpc:go --grpc-gateway_out=go --swagger_out=logtostderr=true:swagger]) + run!(%W[protoc -I#{GO_PATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis -I #{PROTO_INCLUDE}] + PROTO_FILES + %w[--go_out=plugins=grpc:go --grpc-gateway_out=gateway --swagger_out=logtostderr=true:swagger]) + + # Merge the swagger definitions into a single file + run!(%W[#{__dir__}/merge-swagger-definitions]) + + # Generate a swagger client + FileUtils.rm(Dir['ruby_swagger/**/*.rb']) + run!(%W[swagger-codegen generate -i swagger/main.json -l ruby -o ruby_swagger/]) + + FileUtils.rm(Dir[File.join(RUBY_PREFIX, '**/*_pb.rb')]) ruby_lib_gitaly = File.join(RUBY_PREFIX, 'gitaly') diff --git a/_support/merge-swagger-definitions b/_support/merge-swagger-definitions new file mode 100755 index 00000000..550d030f --- /dev/null +++ b/_support/merge-swagger-definitions @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -euo pipefail +IFS=$'\n\t' + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +cd "${DIR}/../swagger" + +echo "{}" > main.json + +for i in *.swagger.json; do + jq -s '.[0] * .[1]' $i main.json > main.json.tmp + mv main.json.tmp main.json +done diff --git a/go/commit.pb.gw.go b/gateway/commit.pb.gw.go similarity index 100% rename from go/commit.pb.gw.go rename to gateway/commit.pb.gw.go diff --git a/go/diff.pb.gw.go b/gateway/diff.pb.gw.go similarity index 100% rename from go/diff.pb.gw.go rename to gateway/diff.pb.gw.go diff --git a/go/notifications.pb.gw.go b/gateway/notifications.pb.gw.go similarity index 100% rename from go/notifications.pb.gw.go rename to gateway/notifications.pb.gw.go diff --git a/go/ref.pb.gw.go b/gateway/ref.pb.gw.go similarity index 100% rename from go/ref.pb.gw.go rename to gateway/ref.pb.gw.go diff --git a/go/smarthttp.pb.gw.go b/gateway/smarthttp.pb.gw.go similarity index 100% rename from go/smarthttp.pb.gw.go rename to gateway/smarthttp.pb.gw.go diff --git a/go/ssh.pb.gw.go b/gateway/ssh.pb.gw.go similarity index 100% rename from go/ssh.pb.gw.go rename to gateway/ssh.pb.gw.go diff --git a/ruby_swagger/.gitignore b/ruby_swagger/.gitignore new file mode 100644 index 00000000..4b91271a --- /dev/null +++ b/ruby_swagger/.gitignore @@ -0,0 +1,39 @@ +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# + +*.gem +*.rbc +/.config +/coverage/ +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +## Specific to RubyMotion: +.dat* +.repl_history +build/ + +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ + +## Environment normalization: +/.bundle/ +/vendor/bundle +/lib/bundler/man/ + +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock +# .ruby-version +# .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc diff --git a/ruby_swagger/.rspec b/ruby_swagger/.rspec new file mode 100644 index 00000000..83e16f80 --- /dev/null +++ b/ruby_swagger/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/ruby_swagger/.swagger-codegen-ignore b/ruby_swagger/.swagger-codegen-ignore new file mode 100644 index 00000000..c5fa491b --- /dev/null +++ b/ruby_swagger/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/ruby_swagger/Gemfile b/ruby_swagger/Gemfile new file mode 100644 index 00000000..d255a3ab --- /dev/null +++ b/ruby_swagger/Gemfile @@ -0,0 +1,7 @@ +source 'https://rubygems.org' + +gemspec + +group :development, :test do + gem 'rake', '~> 12.0.0' +end diff --git a/ruby_swagger/README.md b/ruby_swagger/README.md new file mode 100644 index 00000000..fbfb9e6c --- /dev/null +++ b/ruby_swagger/README.md @@ -0,0 +1,131 @@ +# swagger_client + +SwaggerClient - the Ruby gem for the commit.proto + +No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: version not set +- Package version: 1.0.0 +- Build package: io.swagger.codegen.languages.RubyClientCodegen + +## Installation + +### Build a gem + +To build the Ruby code into a gem: + +```shell +gem build swagger_client.gemspec +``` + +Then either install the gem locally: + +```shell +gem install ./swagger_client-1.0.0.gem +``` +(for development, run `gem install --dev ./swagger_client-1.0.0.gem` to install the development dependencies) + +or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). + +Finally add this to the Gemfile: + + gem 'swagger_client', '~> 1.0.0' + +### Install from Git + +If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: + + gem 'swagger_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' + +### Include the Ruby code directly + +Include the Ruby code directly using `-I` as follows: + +```shell +ruby -Ilib script.rb +``` + +## Getting Started + +Please follow the [installation](#installation) procedure and then run the following code: +```ruby +# Load the gem +require 'swagger_client' + +api_instance = SwaggerClient::CommitApi.new + +body = SwaggerClient::GitalyCommitIsAncestorRequest.new # GitalyCommitIsAncestorRequest | + + +begin + result = api_instance.commit_is_ancestor(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling CommitApi->commit_is_ancestor: #{e}" +end + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*SwaggerClient::CommitApi* | [**commit_is_ancestor**](docs/CommitApi.md#commit_is_ancestor) | **POST** /v1/commit/commit_is_ancestor | +*SwaggerClient::DiffApi* | [**commit_diff**](docs/DiffApi.md#commit_diff) | **POST** /v1/diff/commit_diff | Returns stream of CommitDiffResponse: 1 per changed file +*SwaggerClient::NotificationsApi* | [**post_receive**](docs/NotificationsApi.md#post_receive) | **POST** /v1/notification/post_receive | +*SwaggerClient::RefApi* | [**find_all_branch_names**](docs/RefApi.md#find_all_branch_names) | **POST** /v1/ref/find_all_branch_names | +*SwaggerClient::RefApi* | [**find_all_tag_names**](docs/RefApi.md#find_all_tag_names) | **POST** /v1/ref/find_all_tag_names | +*SwaggerClient::RefApi* | [**find_default_branch_name**](docs/RefApi.md#find_default_branch_name) | **POST** /v1/ref/find_default_branch_name | +*SwaggerClient::RefApi* | [**find_local_branches**](docs/RefApi.md#find_local_branches) | **POST** /v1/ref/find_local_branches | Return a stream so we can divide the response in chunks of branches +*SwaggerClient::RefApi* | [**find_ref_name**](docs/RefApi.md#find_ref_name) | **POST** /v1/ref/find_ref_name | Find a Ref matching the given constraints. Response may be empty. +*SwaggerClient::SSHApi* | [**s_sh_receive_pack**](docs/SSHApi.md#s_sh_receive_pack) | **POST** /v1/ssh/ssh_receive_pack | To forward 'git receive-pack' to Gitaly for SSH sessions +*SwaggerClient::SSHApi* | [**s_sh_upload_pack**](docs/SSHApi.md#s_sh_upload_pack) | **POST** /v1/ssh/ssh_upload_pack | To forward 'git upload-pack' to Gitaly for SSH sessions +*SwaggerClient::SmartHTTPApi* | [**info_refs_receive_pack**](docs/SmartHTTPApi.md#info_refs_receive_pack) | **POST** /v1/smart_http/info_refs_receive_pack | The response body for GET /info/refs?service=git-receive-pack +*SwaggerClient::SmartHTTPApi* | [**info_refs_upload_pack**](docs/SmartHTTPApi.md#info_refs_upload_pack) | **POST** /v1/smart_http/info_refs_upload_pack | The response body for GET /info/refs?service=git-upload-pack +*SwaggerClient::SmartHTTPApi* | [**post_receive_pack**](docs/SmartHTTPApi.md#post_receive_pack) | **POST** /v1/smart_http/post_receive_pack | Request and response body for POST /receive-pack +*SwaggerClient::SmartHTTPApi* | [**post_upload_pack**](docs/SmartHTTPApi.md#post_upload_pack) | **POST** /v1/smart_http/post_upload_pack | Request and response body for POST /upload-pack + + +## Documentation for Models + + - [SwaggerClient::FindLocalBranchesRequestSortBy](docs/FindLocalBranchesRequestSortBy.md) + - [SwaggerClient::GitalyCommitDiffRequest](docs/GitalyCommitDiffRequest.md) + - [SwaggerClient::GitalyCommitDiffResponse](docs/GitalyCommitDiffResponse.md) + - [SwaggerClient::GitalyCommitIsAncestorRequest](docs/GitalyCommitIsAncestorRequest.md) + - [SwaggerClient::GitalyCommitIsAncestorResponse](docs/GitalyCommitIsAncestorResponse.md) + - [SwaggerClient::GitalyExitStatus](docs/GitalyExitStatus.md) + - [SwaggerClient::GitalyFindAllBranchNamesRequest](docs/GitalyFindAllBranchNamesRequest.md) + - [SwaggerClient::GitalyFindAllBranchNamesResponse](docs/GitalyFindAllBranchNamesResponse.md) + - [SwaggerClient::GitalyFindAllTagNamesRequest](docs/GitalyFindAllTagNamesRequest.md) + - [SwaggerClient::GitalyFindAllTagNamesResponse](docs/GitalyFindAllTagNamesResponse.md) + - [SwaggerClient::GitalyFindDefaultBranchNameRequest](docs/GitalyFindDefaultBranchNameRequest.md) + - [SwaggerClient::GitalyFindDefaultBranchNameResponse](docs/GitalyFindDefaultBranchNameResponse.md) + - [SwaggerClient::GitalyFindLocalBranchCommitAuthor](docs/GitalyFindLocalBranchCommitAuthor.md) + - [SwaggerClient::GitalyFindLocalBranchResponse](docs/GitalyFindLocalBranchResponse.md) + - [SwaggerClient::GitalyFindLocalBranchesRequest](docs/GitalyFindLocalBranchesRequest.md) + - [SwaggerClient::GitalyFindLocalBranchesResponse](docs/GitalyFindLocalBranchesResponse.md) + - [SwaggerClient::GitalyFindRefNameRequest](docs/GitalyFindRefNameRequest.md) + - [SwaggerClient::GitalyFindRefNameResponse](docs/GitalyFindRefNameResponse.md) + - [SwaggerClient::GitalyInfoRefsRequest](docs/GitalyInfoRefsRequest.md) + - [SwaggerClient::GitalyInfoRefsResponse](docs/GitalyInfoRefsResponse.md) + - [SwaggerClient::GitalyPostReceivePackRequest](docs/GitalyPostReceivePackRequest.md) + - [SwaggerClient::GitalyPostReceivePackResponse](docs/GitalyPostReceivePackResponse.md) + - [SwaggerClient::GitalyPostReceiveRequest](docs/GitalyPostReceiveRequest.md) + - [SwaggerClient::GitalyPostReceiveResponse](docs/GitalyPostReceiveResponse.md) + - [SwaggerClient::GitalyPostUploadPackRequest](docs/GitalyPostUploadPackRequest.md) + - [SwaggerClient::GitalyPostUploadPackResponse](docs/GitalyPostUploadPackResponse.md) + - [SwaggerClient::GitalyRepository](docs/GitalyRepository.md) + - [SwaggerClient::GitalySSHReceivePackRequest](docs/GitalySSHReceivePackRequest.md) + - [SwaggerClient::GitalySSHReceivePackResponse](docs/GitalySSHReceivePackResponse.md) + - [SwaggerClient::GitalySSHUploadPackRequest](docs/GitalySSHUploadPackRequest.md) + - [SwaggerClient::GitalySSHUploadPackResponse](docs/GitalySSHUploadPackResponse.md) + + +## Documentation for Authorization + + All endpoints do not require authorization. + diff --git a/ruby_swagger/Rakefile b/ruby_swagger/Rakefile new file mode 100644 index 00000000..d52c3e31 --- /dev/null +++ b/ruby_swagger/Rakefile @@ -0,0 +1,8 @@ +begin + require 'rspec/core/rake_task' + + RSpec::Core::RakeTask.new(:spec) + task default: :spec +rescue LoadError + # no rspec available +end diff --git a/ruby_swagger/docs/CommitApi.md b/ruby_swagger/docs/CommitApi.md new file mode 100644 index 00000000..13cb15cd --- /dev/null +++ b/ruby_swagger/docs/CommitApi.md @@ -0,0 +1,53 @@ +# SwaggerClient::CommitApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**commit_is_ancestor**](CommitApi.md#commit_is_ancestor) | **POST** /v1/commit/commit_is_ancestor | + + +# **commit_is_ancestor** +> GitalyCommitIsAncestorResponse commit_is_ancestor(body) + + + +### Example +```ruby +# load the gem +require 'swagger_client' + +api_instance = SwaggerClient::CommitApi.new + +body = SwaggerClient::GitalyCommitIsAncestorRequest.new # GitalyCommitIsAncestorRequest | + + +begin + result = api_instance.commit_is_ancestor(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling CommitApi->commit_is_ancestor: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**GitalyCommitIsAncestorRequest**](GitalyCommitIsAncestorRequest.md)| | + +### Return type + +[**GitalyCommitIsAncestorResponse**](GitalyCommitIsAncestorResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/ruby_swagger/docs/DiffApi.md b/ruby_swagger/docs/DiffApi.md new file mode 100644 index 00000000..e00906c1 --- /dev/null +++ b/ruby_swagger/docs/DiffApi.md @@ -0,0 +1,54 @@ +# SwaggerClient::DiffApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**commit_diff**](DiffApi.md#commit_diff) | **POST** /v1/diff/commit_diff | Returns stream of CommitDiffResponse: 1 per changed file + + +# **commit_diff** +> GitalyCommitDiffResponse commit_diff(body) + +Returns stream of CommitDiffResponse: 1 per changed file + +### Example +```ruby +# load the gem +require 'swagger_client' + +api_instance = SwaggerClient::DiffApi.new + +body = SwaggerClient::GitalyCommitDiffRequest.new # GitalyCommitDiffRequest | + + +begin + #Returns stream of CommitDiffResponse: 1 per changed file + result = api_instance.commit_diff(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling DiffApi->commit_diff: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**GitalyCommitDiffRequest**](GitalyCommitDiffRequest.md)| | + +### Return type + +[**GitalyCommitDiffResponse**](GitalyCommitDiffResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/ruby_swagger/docs/FindLocalBranchesRequestSortBy.md b/ruby_swagger/docs/FindLocalBranchesRequestSortBy.md new file mode 100644 index 00000000..dd314c6c --- /dev/null +++ b/ruby_swagger/docs/FindLocalBranchesRequestSortBy.md @@ -0,0 +1,7 @@ +# SwaggerClient::FindLocalBranchesRequestSortBy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/ruby_swagger/docs/GitalyCommitDiffRequest.md b/ruby_swagger/docs/GitalyCommitDiffRequest.md new file mode 100644 index 00000000..7c0f4caf --- /dev/null +++ b/ruby_swagger/docs/GitalyCommitDiffRequest.md @@ -0,0 +1,10 @@ +# SwaggerClient::GitalyCommitDiffRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repository** | [**GitalyRepository**](GitalyRepository.md) | | [optional] +**left_commit_id** | **String** | | [optional] +**right_commit_id** | **String** | | [optional] + + diff --git a/ruby_swagger/docs/GitalyCommitDiffResponse.md b/ruby_swagger/docs/GitalyCommitDiffResponse.md new file mode 100644 index 00000000..8a82b61a --- /dev/null +++ b/ruby_swagger/docs/GitalyCommitDiffResponse.md @@ -0,0 +1,15 @@ +# SwaggerClient::GitalyCommitDiffResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**from_path** | **String** | | [optional] +**to_path** | **String** | | [optional] +**from_id** | **String** | | [optional] +**to_id** | **String** | | [optional] +**old_mode** | **Integer** | | [optional] +**new_mode** | **Integer** | | [optional] +**binary** | **BOOLEAN** | | [optional] +**raw_chunks** | **Array<String>** | | [optional] + + diff --git a/ruby_swagger/docs/GitalyCommitIsAncestorRequest.md b/ruby_swagger/docs/GitalyCommitIsAncestorRequest.md new file mode 100644 index 00000000..c3c00c14 --- /dev/null +++ b/ruby_swagger/docs/GitalyCommitIsAncestorRequest.md @@ -0,0 +1,10 @@ +# SwaggerClient::GitalyCommitIsAncestorRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repository** | [**GitalyRepository**](GitalyRepository.md) | | [optional] +**ancestor_id** | **String** | | [optional] +**child_id** | **String** | | [optional] + + diff --git a/ruby_swagger/docs/GitalyCommitIsAncestorResponse.md b/ruby_swagger/docs/GitalyCommitIsAncestorResponse.md new file mode 100644 index 00000000..f332230d --- /dev/null +++ b/ruby_swagger/docs/GitalyCommitIsAncestorResponse.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyCommitIsAncestorResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **BOOLEAN** | | [optional] + + diff --git a/ruby_swagger/docs/GitalyExitStatus.md b/ruby_swagger/docs/GitalyExitStatus.md new file mode 100644 index 00000000..96ef7a11 --- /dev/null +++ b/ruby_swagger/docs/GitalyExitStatus.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyExitStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **Integer** | | [optional] + + diff --git a/ruby_swagger/docs/GitalyFindAllBranchNamesRequest.md b/ruby_swagger/docs/GitalyFindAllBranchNamesRequest.md new file mode 100644 index 00000000..b59a42d9 --- /dev/null +++ b/ruby_swagger/docs/GitalyFindAllBranchNamesRequest.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyFindAllBranchNamesRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repository** | [**GitalyRepository**](GitalyRepository.md) | | [optional] + + diff --git a/ruby_swagger/docs/GitalyFindAllBranchNamesResponse.md b/ruby_swagger/docs/GitalyFindAllBranchNamesResponse.md new file mode 100644 index 00000000..bdd6ecba --- /dev/null +++ b/ruby_swagger/docs/GitalyFindAllBranchNamesResponse.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyFindAllBranchNamesResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**names** | **Array<String>** | | [optional] + + diff --git a/ruby_swagger/docs/GitalyFindAllTagNamesRequest.md b/ruby_swagger/docs/GitalyFindAllTagNamesRequest.md new file mode 100644 index 00000000..07ef7b11 --- /dev/null +++ b/ruby_swagger/docs/GitalyFindAllTagNamesRequest.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyFindAllTagNamesRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repository** | [**GitalyRepository**](GitalyRepository.md) | | [optional] + + diff --git a/ruby_swagger/docs/GitalyFindAllTagNamesResponse.md b/ruby_swagger/docs/GitalyFindAllTagNamesResponse.md new file mode 100644 index 00000000..5f4f1600 --- /dev/null +++ b/ruby_swagger/docs/GitalyFindAllTagNamesResponse.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyFindAllTagNamesResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**names** | **Array<String>** | | [optional] + + diff --git a/ruby_swagger/docs/GitalyFindDefaultBranchNameRequest.md b/ruby_swagger/docs/GitalyFindDefaultBranchNameRequest.md new file mode 100644 index 00000000..4e9191ed --- /dev/null +++ b/ruby_swagger/docs/GitalyFindDefaultBranchNameRequest.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyFindDefaultBranchNameRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repository** | [**GitalyRepository**](GitalyRepository.md) | | [optional] + + diff --git a/ruby_swagger/docs/GitalyFindDefaultBranchNameResponse.md b/ruby_swagger/docs/GitalyFindDefaultBranchNameResponse.md new file mode 100644 index 00000000..36669039 --- /dev/null +++ b/ruby_swagger/docs/GitalyFindDefaultBranchNameResponse.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyFindDefaultBranchNameResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + diff --git a/ruby_swagger/docs/GitalyFindLocalBranchCommitAuthor.md b/ruby_swagger/docs/GitalyFindLocalBranchCommitAuthor.md new file mode 100644 index 00000000..0ab34dfa --- /dev/null +++ b/ruby_swagger/docs/GitalyFindLocalBranchCommitAuthor.md @@ -0,0 +1,10 @@ +# SwaggerClient::GitalyFindLocalBranchCommitAuthor + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**email** | **String** | | [optional] +**date** | **DateTime** | | [optional] + + diff --git a/ruby_swagger/docs/GitalyFindLocalBranchResponse.md b/ruby_swagger/docs/GitalyFindLocalBranchResponse.md new file mode 100644 index 00000000..1e03e1cc --- /dev/null +++ b/ruby_swagger/docs/GitalyFindLocalBranchResponse.md @@ -0,0 +1,12 @@ +# SwaggerClient::GitalyFindLocalBranchResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**commit_id** | **String** | | [optional] +**commit_subject** | **String** | | [optional] +**commit_author** | [**GitalyFindLocalBranchCommitAuthor**](GitalyFindLocalBranchCommitAuthor.md) | | [optional] +**commit_committer** | [**GitalyFindLocalBranchCommitAuthor**](GitalyFindLocalBranchCommitAuthor.md) | | [optional] + + diff --git a/ruby_swagger/docs/GitalyFindLocalBranchesRequest.md b/ruby_swagger/docs/GitalyFindLocalBranchesRequest.md new file mode 100644 index 00000000..17c419c9 --- /dev/null +++ b/ruby_swagger/docs/GitalyFindLocalBranchesRequest.md @@ -0,0 +1,9 @@ +# SwaggerClient::GitalyFindLocalBranchesRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repository** | [**GitalyRepository**](GitalyRepository.md) | | [optional] +**sort_by** | [**FindLocalBranchesRequestSortBy**](FindLocalBranchesRequestSortBy.md) | | [optional] + + diff --git a/ruby_swagger/docs/GitalyFindLocalBranchesResponse.md b/ruby_swagger/docs/GitalyFindLocalBranchesResponse.md new file mode 100644 index 00000000..806a2d72 --- /dev/null +++ b/ruby_swagger/docs/GitalyFindLocalBranchesResponse.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyFindLocalBranchesResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branches** | [**Array<GitalyFindLocalBranchResponse>**](GitalyFindLocalBranchResponse.md) | | [optional] + + diff --git a/ruby_swagger/docs/GitalyFindRefNameRequest.md b/ruby_swagger/docs/GitalyFindRefNameRequest.md new file mode 100644 index 00000000..97a3030d --- /dev/null +++ b/ruby_swagger/docs/GitalyFindRefNameRequest.md @@ -0,0 +1,10 @@ +# SwaggerClient::GitalyFindRefNameRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repository** | [**GitalyRepository**](GitalyRepository.md) | | [optional] +**commit_id** | **String** | | [optional] +**prefix** | **String** | Example prefix: \"refs/heads/\". Type bytes because that is the type of ref names. | [optional] + + diff --git a/ruby_swagger/docs/GitalyFindRefNameResponse.md b/ruby_swagger/docs/GitalyFindRefNameResponse.md new file mode 100644 index 00000000..e0fd82c1 --- /dev/null +++ b/ruby_swagger/docs/GitalyFindRefNameResponse.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyFindRefNameResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Example name: \"refs/heads/master\". Cannot assume UTF8, so the type is bytes. | [optional] + + diff --git a/ruby_swagger/docs/GitalyInfoRefsRequest.md b/ruby_swagger/docs/GitalyInfoRefsRequest.md new file mode 100644 index 00000000..6b25956c --- /dev/null +++ b/ruby_swagger/docs/GitalyInfoRefsRequest.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyInfoRefsRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repository** | [**GitalyRepository**](GitalyRepository.md) | | [optional] + + diff --git a/ruby_swagger/docs/GitalyInfoRefsResponse.md b/ruby_swagger/docs/GitalyInfoRefsResponse.md new file mode 100644 index 00000000..9eaf4123 --- /dev/null +++ b/ruby_swagger/docs/GitalyInfoRefsResponse.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyInfoRefsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **String** | | [optional] + + diff --git a/ruby_swagger/docs/GitalyPostReceivePackRequest.md b/ruby_swagger/docs/GitalyPostReceivePackRequest.md new file mode 100644 index 00000000..96b5cb26 --- /dev/null +++ b/ruby_swagger/docs/GitalyPostReceivePackRequest.md @@ -0,0 +1,10 @@ +# SwaggerClient::GitalyPostReceivePackRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repository** | [**GitalyRepository**](GitalyRepository.md) | | [optional] +**data** | **String** | | [optional] +**gl_id** | **String** | gl_id becomes env variable GL_ID, used by the Git {pre,post}-receive hooks. Should only be present in the first message of the stream. | [optional] + + diff --git a/ruby_swagger/docs/GitalyPostReceivePackResponse.md b/ruby_swagger/docs/GitalyPostReceivePackResponse.md new file mode 100644 index 00000000..fbc8d1b7 --- /dev/null +++ b/ruby_swagger/docs/GitalyPostReceivePackResponse.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyPostReceivePackResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **String** | | [optional] + + diff --git a/ruby_swagger/docs/GitalyPostReceiveRequest.md b/ruby_swagger/docs/GitalyPostReceiveRequest.md new file mode 100644 index 00000000..77fb604f --- /dev/null +++ b/ruby_swagger/docs/GitalyPostReceiveRequest.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyPostReceiveRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repository** | [**GitalyRepository**](GitalyRepository.md) | | [optional] + + diff --git a/ruby_swagger/docs/GitalyPostReceiveResponse.md b/ruby_swagger/docs/GitalyPostReceiveResponse.md new file mode 100644 index 00000000..c58c9ae7 --- /dev/null +++ b/ruby_swagger/docs/GitalyPostReceiveResponse.md @@ -0,0 +1,7 @@ +# SwaggerClient::GitalyPostReceiveResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/ruby_swagger/docs/GitalyPostUploadPackRequest.md b/ruby_swagger/docs/GitalyPostUploadPackRequest.md new file mode 100644 index 00000000..72216308 --- /dev/null +++ b/ruby_swagger/docs/GitalyPostUploadPackRequest.md @@ -0,0 +1,9 @@ +# SwaggerClient::GitalyPostUploadPackRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repository** | [**GitalyRepository**](GitalyRepository.md) | | [optional] +**data** | **String** | | [optional] + + diff --git a/ruby_swagger/docs/GitalyPostUploadPackResponse.md b/ruby_swagger/docs/GitalyPostUploadPackResponse.md new file mode 100644 index 00000000..cba0c0b6 --- /dev/null +++ b/ruby_swagger/docs/GitalyPostUploadPackResponse.md @@ -0,0 +1,8 @@ +# SwaggerClient::GitalyPostUploadPackResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **String** | | [optional] + + diff --git a/ruby_swagger/docs/GitalyRepository.md b/ruby_swagger/docs/GitalyRepository.md new file mode 100644 index 00000000..3f63e38f --- /dev/null +++ b/ruby_swagger/docs/GitalyRepository.md @@ -0,0 +1,10 @@ +# SwaggerClient::GitalyRepository + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**path** | **String** | | [optional] +**storage_name** | **String** | | [optional] +**relative_path** | **String** | | [optional] + + diff --git a/ruby_swagger/docs/GitalySSHReceivePackRequest.md b/ruby_swagger/docs/GitalySSHReceivePackRequest.md new file mode 100644 index 00000000..00e2f880 --- /dev/null +++ b/ruby_swagger/docs/GitalySSHReceivePackRequest.md @@ -0,0 +1,10 @@ +# SwaggerClient::GitalySSHReceivePackRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repository** | [**GitalyRepository**](GitalyRepository.md) | 'repository' must be present in the first message. | [optional] +**stdin** | **String** | | [optional] +**gl_id** | **String** | | [optional] + + diff --git a/ruby_swagger/docs/GitalySSHReceivePackResponse.md b/ruby_swagger/docs/GitalySSHReceivePackResponse.md new file mode 100644 index 00000000..50c531a0 --- /dev/null +++ b/ruby_swagger/docs/GitalySSHReceivePackResponse.md @@ -0,0 +1,10 @@ +# SwaggerClient::GitalySSHReceivePackResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stdout** | **String** | | [optional] +**stderr** | **String** | | [optional] +**exit_status** | [**GitalyExitStatus**](GitalyExitStatus.md) | This field may be nil. This is intentional: only when the remote command has finished can we return its exit status. | [optional] + + diff --git a/ruby_swagger/docs/GitalySSHUploadPackRequest.md b/ruby_swagger/docs/GitalySSHUploadPackRequest.md new file mode 100644 index 00000000..63577a2b --- /dev/null +++ b/ruby_swagger/docs/GitalySSHUploadPackRequest.md @@ -0,0 +1,9 @@ +# SwaggerClient::GitalySSHUploadPackRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repository** | [**GitalyRepository**](GitalyRepository.md) | 'repository' must be present in the first message. | [optional] +**stdin** | **String** | | [optional] + + diff --git a/ruby_swagger/docs/GitalySSHUploadPackResponse.md b/ruby_swagger/docs/GitalySSHUploadPackResponse.md new file mode 100644 index 00000000..71fa01dc --- /dev/null +++ b/ruby_swagger/docs/GitalySSHUploadPackResponse.md @@ -0,0 +1,10 @@ +# SwaggerClient::GitalySSHUploadPackResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stdout** | **String** | | [optional] +**stderr** | **String** | | [optional] +**exit_status** | [**GitalyExitStatus**](GitalyExitStatus.md) | This field may be nil. This is intentional: only when the remote command has finished can we return its exit status. | [optional] + + diff --git a/ruby_swagger/docs/NotificationsApi.md b/ruby_swagger/docs/NotificationsApi.md new file mode 100644 index 00000000..e927c661 --- /dev/null +++ b/ruby_swagger/docs/NotificationsApi.md @@ -0,0 +1,53 @@ +# SwaggerClient::NotificationsApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_receive**](NotificationsApi.md#post_receive) | **POST** /v1/notification/post_receive | + + +# **post_receive** +> GitalyPostReceiveResponse post_receive(body) + + + +### Example +```ruby +# load the gem +require 'swagger_client' + +api_instance = SwaggerClient::NotificationsApi.new + +body = SwaggerClient::GitalyPostReceiveRequest.new # GitalyPostReceiveRequest | + + +begin + result = api_instance.post_receive(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling NotificationsApi->post_receive: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**GitalyPostReceiveRequest**](GitalyPostReceiveRequest.md)| | + +### Return type + +[**GitalyPostReceiveResponse**](GitalyPostReceiveResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/ruby_swagger/docs/RefApi.md b/ruby_swagger/docs/RefApi.md new file mode 100644 index 00000000..14cbbf22 --- /dev/null +++ b/ruby_swagger/docs/RefApi.md @@ -0,0 +1,235 @@ +# SwaggerClient::RefApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**find_all_branch_names**](RefApi.md#find_all_branch_names) | **POST** /v1/ref/find_all_branch_names | +[**find_all_tag_names**](RefApi.md#find_all_tag_names) | **POST** /v1/ref/find_all_tag_names | +[**find_default_branch_name**](RefApi.md#find_default_branch_name) | **POST** /v1/ref/find_default_branch_name | +[**find_local_branches**](RefApi.md#find_local_branches) | **POST** /v1/ref/find_local_branches | Return a stream so we can divide the response in chunks of branches +[**find_ref_name**](RefApi.md#find_ref_name) | **POST** /v1/ref/find_ref_name | Find a Ref matching the given constraints. Response may be empty. + + +# **find_all_branch_names** +> GitalyFindAllBranchNamesResponse find_all_branch_names(body) + + + +### Example +```ruby +# load the gem +require 'swagger_client' + +api_instance = SwaggerClient::RefApi.new + +body = SwaggerClient::GitalyFindAllBranchNamesRequest.new # GitalyFindAllBranchNamesRequest | + + +begin + result = api_instance.find_all_branch_names(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling RefApi->find_all_branch_names: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**GitalyFindAllBranchNamesRequest**](GitalyFindAllBranchNamesRequest.md)| | + +### Return type + +[**GitalyFindAllBranchNamesResponse**](GitalyFindAllBranchNamesResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **find_all_tag_names** +> GitalyFindAllTagNamesResponse find_all_tag_names(body) + + + +### Example +```ruby +# load the gem +require 'swagger_client' + +api_instance = SwaggerClient::RefApi.new + +body = SwaggerClient::GitalyFindAllTagNamesRequest.new # GitalyFindAllTagNamesRequest | + + +begin + result = api_instance.find_all_tag_names(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling RefApi->find_all_tag_names: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**GitalyFindAllTagNamesRequest**](GitalyFindAllTagNamesRequest.md)| | + +### Return type + +[**GitalyFindAllTagNamesResponse**](GitalyFindAllTagNamesResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **find_default_branch_name** +> GitalyFindDefaultBranchNameResponse find_default_branch_name(body) + + + +### Example +```ruby +# load the gem +require 'swagger_client' + +api_instance = SwaggerClient::RefApi.new + +body = SwaggerClient::GitalyFindDefaultBranchNameRequest.new # GitalyFindDefaultBranchNameRequest | + + +begin + result = api_instance.find_default_branch_name(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling RefApi->find_default_branch_name: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**GitalyFindDefaultBranchNameRequest**](GitalyFindDefaultBranchNameRequest.md)| | + +### Return type + +[**GitalyFindDefaultBranchNameResponse**](GitalyFindDefaultBranchNameResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **find_local_branches** +> GitalyFindLocalBranchesResponse find_local_branches(body) + +Return a stream so we can divide the response in chunks of branches + +### Example +```ruby +# load the gem +require 'swagger_client' + +api_instance = SwaggerClient::RefApi.new + +body = SwaggerClient::GitalyFindLocalBranchesRequest.new # GitalyFindLocalBranchesRequest | + + +begin + #Return a stream so we can divide the response in chunks of branches + result = api_instance.find_local_branches(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling RefApi->find_local_branches: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**GitalyFindLocalBranchesRequest**](GitalyFindLocalBranchesRequest.md)| | + +### Return type + +[**GitalyFindLocalBranchesResponse**](GitalyFindLocalBranchesResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **find_ref_name** +> GitalyFindRefNameResponse find_ref_name(body) + +Find a Ref matching the given constraints. Response may be empty. + +### Example +```ruby +# load the gem +require 'swagger_client' + +api_instance = SwaggerClient::RefApi.new + +body = SwaggerClient::GitalyFindRefNameRequest.new # GitalyFindRefNameRequest | + + +begin + #Find a Ref matching the given constraints. Response may be empty. + result = api_instance.find_ref_name(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling RefApi->find_ref_name: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**GitalyFindRefNameRequest**](GitalyFindRefNameRequest.md)| | + +### Return type + +[**GitalyFindRefNameResponse**](GitalyFindRefNameResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/ruby_swagger/docs/SSHApi.md b/ruby_swagger/docs/SSHApi.md new file mode 100644 index 00000000..5dcce34a --- /dev/null +++ b/ruby_swagger/docs/SSHApi.md @@ -0,0 +1,100 @@ +# SwaggerClient::SSHApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**s_sh_receive_pack**](SSHApi.md#s_sh_receive_pack) | **POST** /v1/ssh/ssh_receive_pack | To forward 'git receive-pack' to Gitaly for SSH sessions +[**s_sh_upload_pack**](SSHApi.md#s_sh_upload_pack) | **POST** /v1/ssh/ssh_upload_pack | To forward 'git upload-pack' to Gitaly for SSH sessions + + +# **s_sh_receive_pack** +> GitalySSHReceivePackResponse s_sh_receive_pack(body) + +To forward 'git receive-pack' to Gitaly for SSH sessions + +### Example +```ruby +# load the gem +require 'swagger_client' + +api_instance = SwaggerClient::SSHApi.new + +body = SwaggerClient::GitalySSHReceivePackRequest.new # GitalySSHReceivePackRequest | (streaming inputs) + + +begin + #To forward 'git receive-pack' to Gitaly for SSH sessions + result = api_instance.s_sh_receive_pack(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling SSHApi->s_sh_receive_pack: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**GitalySSHReceivePackRequest**](GitalySSHReceivePackRequest.md)| (streaming inputs) | + +### Return type + +[**GitalySSHReceivePackResponse**](GitalySSHReceivePackResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **s_sh_upload_pack** +> GitalySSHUploadPackResponse s_sh_upload_pack(body) + +To forward 'git upload-pack' to Gitaly for SSH sessions + +### Example +```ruby +# load the gem +require 'swagger_client' + +api_instance = SwaggerClient::SSHApi.new + +body = SwaggerClient::GitalySSHUploadPackRequest.new # GitalySSHUploadPackRequest | (streaming inputs) + + +begin + #To forward 'git upload-pack' to Gitaly for SSH sessions + result = api_instance.s_sh_upload_pack(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling SSHApi->s_sh_upload_pack: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**GitalySSHUploadPackRequest**](GitalySSHUploadPackRequest.md)| (streaming inputs) | + +### Return type + +[**GitalySSHUploadPackResponse**](GitalySSHUploadPackResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/ruby_swagger/docs/SmartHTTPApi.md b/ruby_swagger/docs/SmartHTTPApi.md new file mode 100644 index 00000000..b9adba06 --- /dev/null +++ b/ruby_swagger/docs/SmartHTTPApi.md @@ -0,0 +1,192 @@ +# SwaggerClient::SmartHTTPApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**info_refs_receive_pack**](SmartHTTPApi.md#info_refs_receive_pack) | **POST** /v1/smart_http/info_refs_receive_pack | The response body for GET /info/refs?service=git-receive-pack +[**info_refs_upload_pack**](SmartHTTPApi.md#info_refs_upload_pack) | **POST** /v1/smart_http/info_refs_upload_pack | The response body for GET /info/refs?service=git-upload-pack +[**post_receive_pack**](SmartHTTPApi.md#post_receive_pack) | **POST** /v1/smart_http/post_receive_pack | Request and response body for POST /receive-pack +[**post_upload_pack**](SmartHTTPApi.md#post_upload_pack) | **POST** /v1/smart_http/post_upload_pack | Request and response body for POST /upload-pack + + +# **info_refs_receive_pack** +> GitalyInfoRefsResponse info_refs_receive_pack(body) + +The response body for GET /info/refs?service=git-receive-pack + +### Example +```ruby +# load the gem +require 'swagger_client' + +api_instance = SwaggerClient::SmartHTTPApi.new + +body = SwaggerClient::GitalyInfoRefsRequest.new # GitalyInfoRefsRequest | + + +begin + #The response body for GET /info/refs?service=git-receive-pack + result = api_instance.info_refs_receive_pack(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling SmartHTTPApi->info_refs_receive_pack: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**GitalyInfoRefsRequest**](GitalyInfoRefsRequest.md)| | + +### Return type + +[**GitalyInfoRefsResponse**](GitalyInfoRefsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **info_refs_upload_pack** +> GitalyInfoRefsResponse info_refs_upload_pack(body) + +The response body for GET /info/refs?service=git-upload-pack + +### Example +```ruby +# load the gem +require 'swagger_client' + +api_instance = SwaggerClient::SmartHTTPApi.new + +body = SwaggerClient::GitalyInfoRefsRequest.new # GitalyInfoRefsRequest | + + +begin + #The response body for GET /info/refs?service=git-upload-pack + result = api_instance.info_refs_upload_pack(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling SmartHTTPApi->info_refs_upload_pack: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**GitalyInfoRefsRequest**](GitalyInfoRefsRequest.md)| | + +### Return type + +[**GitalyInfoRefsResponse**](GitalyInfoRefsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **post_receive_pack** +> GitalyPostReceivePackResponse post_receive_pack(body) + +Request and response body for POST /receive-pack + +### Example +```ruby +# load the gem +require 'swagger_client' + +api_instance = SwaggerClient::SmartHTTPApi.new + +body = SwaggerClient::GitalyPostReceivePackRequest.new # GitalyPostReceivePackRequest | (streaming inputs) + + +begin + #Request and response body for POST /receive-pack + result = api_instance.post_receive_pack(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling SmartHTTPApi->post_receive_pack: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**GitalyPostReceivePackRequest**](GitalyPostReceivePackRequest.md)| (streaming inputs) | + +### Return type + +[**GitalyPostReceivePackResponse**](GitalyPostReceivePackResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **post_upload_pack** +> GitalyPostUploadPackResponse post_upload_pack(body) + +Request and response body for POST /upload-pack + +### Example +```ruby +# load the gem +require 'swagger_client' + +api_instance = SwaggerClient::SmartHTTPApi.new + +body = SwaggerClient::GitalyPostUploadPackRequest.new # GitalyPostUploadPackRequest | (streaming inputs) + + +begin + #Request and response body for POST /upload-pack + result = api_instance.post_upload_pack(body) + p result +rescue SwaggerClient::ApiError => e + puts "Exception when calling SmartHTTPApi->post_upload_pack: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**GitalyPostUploadPackRequest**](GitalyPostUploadPackRequest.md)| (streaming inputs) | + +### Return type + +[**GitalyPostUploadPackResponse**](GitalyPostUploadPackResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/ruby_swagger/git_push.sh b/ruby_swagger/git_push.sh new file mode 100644 index 00000000..7cb1edb1 --- /dev/null +++ b/ruby_swagger/git_push.sh @@ -0,0 +1,55 @@ +#!/bin/sh +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/ruby_swagger/lib/swagger_client.rb b/ruby_swagger/lib/swagger_client.rb new file mode 100644 index 00000000..58ab40da --- /dev/null +++ b/ruby_swagger/lib/swagger_client.rb @@ -0,0 +1,75 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +# Common files +require 'swagger_client/api_client' +require 'swagger_client/api_error' +require 'swagger_client/version' +require 'swagger_client/configuration' + +# Models +require 'swagger_client/models/find_local_branches_request_sort_by' +require 'swagger_client/models/gitaly_commit_diff_request' +require 'swagger_client/models/gitaly_commit_diff_response' +require 'swagger_client/models/gitaly_commit_is_ancestor_request' +require 'swagger_client/models/gitaly_commit_is_ancestor_response' +require 'swagger_client/models/gitaly_exit_status' +require 'swagger_client/models/gitaly_find_all_branch_names_request' +require 'swagger_client/models/gitaly_find_all_branch_names_response' +require 'swagger_client/models/gitaly_find_all_tag_names_request' +require 'swagger_client/models/gitaly_find_all_tag_names_response' +require 'swagger_client/models/gitaly_find_default_branch_name_request' +require 'swagger_client/models/gitaly_find_default_branch_name_response' +require 'swagger_client/models/gitaly_find_local_branch_commit_author' +require 'swagger_client/models/gitaly_find_local_branch_response' +require 'swagger_client/models/gitaly_find_local_branches_request' +require 'swagger_client/models/gitaly_find_local_branches_response' +require 'swagger_client/models/gitaly_find_ref_name_request' +require 'swagger_client/models/gitaly_find_ref_name_response' +require 'swagger_client/models/gitaly_info_refs_request' +require 'swagger_client/models/gitaly_info_refs_response' +require 'swagger_client/models/gitaly_post_receive_pack_request' +require 'swagger_client/models/gitaly_post_receive_pack_response' +require 'swagger_client/models/gitaly_post_receive_request' +require 'swagger_client/models/gitaly_post_receive_response' +require 'swagger_client/models/gitaly_post_upload_pack_request' +require 'swagger_client/models/gitaly_post_upload_pack_response' +require 'swagger_client/models/gitaly_repository' +require 'swagger_client/models/gitaly_ssh_receive_pack_request' +require 'swagger_client/models/gitaly_ssh_receive_pack_response' +require 'swagger_client/models/gitaly_ssh_upload_pack_request' +require 'swagger_client/models/gitaly_ssh_upload_pack_response' + +# APIs +require 'swagger_client/api/commit_api' +require 'swagger_client/api/diff_api' +require 'swagger_client/api/notifications_api' +require 'swagger_client/api/ref_api' +require 'swagger_client/api/ssh_api' +require 'swagger_client/api/smart_http_api' + +module SwaggerClient + class << self + # Customize default settings for the SDK using block. + # SwaggerClient.configure do |config| + # config.username = "xxx" + # config.password = "xxx" + # end + # If no block given, return the default Configuration object. + def configure + if block_given? + yield(Configuration.default) + else + Configuration.default + end + end + end +end diff --git a/ruby_swagger/lib/swagger_client/api/commit_api.rb b/ruby_swagger/lib/swagger_client/api/commit_api.rb new file mode 100644 index 00000000..83149f91 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/api/commit_api.rb @@ -0,0 +1,75 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require "uri" + +module SwaggerClient + class CommitApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyCommitIsAncestorResponse] + def commit_is_ancestor(body, opts = {}) + data, _status_code, _headers = commit_is_ancestor_with_http_info(body, opts) + return data + end + + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GitalyCommitIsAncestorResponse, Fixnum, Hash)>] GitalyCommitIsAncestorResponse data, response status code and response headers + def commit_is_ancestor_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: CommitApi.commit_is_ancestor ..." + end + # verify the required parameter 'body' is set + fail ArgumentError, "Missing the required parameter 'body' when calling CommitApi.commit_is_ancestor" if body.nil? + # resource path + local_var_path = "/v1/commit/commit_is_ancestor".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GitalyCommitIsAncestorResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CommitApi#commit_is_ancestor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/ruby_swagger/lib/swagger_client/api/diff_api.rb b/ruby_swagger/lib/swagger_client/api/diff_api.rb new file mode 100644 index 00000000..9795c3f0 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/api/diff_api.rb @@ -0,0 +1,75 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require "uri" + +module SwaggerClient + class DiffApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + + # Returns stream of CommitDiffResponse: 1 per changed file + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyCommitDiffResponse] + def commit_diff(body, opts = {}) + data, _status_code, _headers = commit_diff_with_http_info(body, opts) + return data + end + + # Returns stream of CommitDiffResponse: 1 per changed file + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GitalyCommitDiffResponse, Fixnum, Hash)>] GitalyCommitDiffResponse data, response status code and response headers + def commit_diff_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: DiffApi.commit_diff ..." + end + # verify the required parameter 'body' is set + fail ArgumentError, "Missing the required parameter 'body' when calling DiffApi.commit_diff" if body.nil? + # resource path + local_var_path = "/v1/diff/commit_diff".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GitalyCommitDiffResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DiffApi#commit_diff\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/ruby_swagger/lib/swagger_client/api/notifications_api.rb b/ruby_swagger/lib/swagger_client/api/notifications_api.rb new file mode 100644 index 00000000..c5601401 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/api/notifications_api.rb @@ -0,0 +1,75 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require "uri" + +module SwaggerClient + class NotificationsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyPostReceiveResponse] + def post_receive(body, opts = {}) + data, _status_code, _headers = post_receive_with_http_info(body, opts) + return data + end + + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GitalyPostReceiveResponse, Fixnum, Hash)>] GitalyPostReceiveResponse data, response status code and response headers + def post_receive_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: NotificationsApi.post_receive ..." + end + # verify the required parameter 'body' is set + fail ArgumentError, "Missing the required parameter 'body' when calling NotificationsApi.post_receive" if body.nil? + # resource path + local_var_path = "/v1/notification/post_receive".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GitalyPostReceiveResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: NotificationsApi#post_receive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/ruby_swagger/lib/swagger_client/api/ref_api.rb b/ruby_swagger/lib/swagger_client/api/ref_api.rb new file mode 100644 index 00000000..927cfccc --- /dev/null +++ b/ruby_swagger/lib/swagger_client/api/ref_api.rb @@ -0,0 +1,287 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require "uri" + +module SwaggerClient + class RefApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyFindAllBranchNamesResponse] + def find_all_branch_names(body, opts = {}) + data, _status_code, _headers = find_all_branch_names_with_http_info(body, opts) + return data + end + + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GitalyFindAllBranchNamesResponse, Fixnum, Hash)>] GitalyFindAllBranchNamesResponse data, response status code and response headers + def find_all_branch_names_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: RefApi.find_all_branch_names ..." + end + # verify the required parameter 'body' is set + fail ArgumentError, "Missing the required parameter 'body' when calling RefApi.find_all_branch_names" if body.nil? + # resource path + local_var_path = "/v1/ref/find_all_branch_names".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GitalyFindAllBranchNamesResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RefApi#find_all_branch_names\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyFindAllTagNamesResponse] + def find_all_tag_names(body, opts = {}) + data, _status_code, _headers = find_all_tag_names_with_http_info(body, opts) + return data + end + + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GitalyFindAllTagNamesResponse, Fixnum, Hash)>] GitalyFindAllTagNamesResponse data, response status code and response headers + def find_all_tag_names_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: RefApi.find_all_tag_names ..." + end + # verify the required parameter 'body' is set + fail ArgumentError, "Missing the required parameter 'body' when calling RefApi.find_all_tag_names" if body.nil? + # resource path + local_var_path = "/v1/ref/find_all_tag_names".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GitalyFindAllTagNamesResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RefApi#find_all_tag_names\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyFindDefaultBranchNameResponse] + def find_default_branch_name(body, opts = {}) + data, _status_code, _headers = find_default_branch_name_with_http_info(body, opts) + return data + end + + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GitalyFindDefaultBranchNameResponse, Fixnum, Hash)>] GitalyFindDefaultBranchNameResponse data, response status code and response headers + def find_default_branch_name_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: RefApi.find_default_branch_name ..." + end + # verify the required parameter 'body' is set + fail ArgumentError, "Missing the required parameter 'body' when calling RefApi.find_default_branch_name" if body.nil? + # resource path + local_var_path = "/v1/ref/find_default_branch_name".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GitalyFindDefaultBranchNameResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RefApi#find_default_branch_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Return a stream so we can divide the response in chunks of branches + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyFindLocalBranchesResponse] + def find_local_branches(body, opts = {}) + data, _status_code, _headers = find_local_branches_with_http_info(body, opts) + return data + end + + # Return a stream so we can divide the response in chunks of branches + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GitalyFindLocalBranchesResponse, Fixnum, Hash)>] GitalyFindLocalBranchesResponse data, response status code and response headers + def find_local_branches_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: RefApi.find_local_branches ..." + end + # verify the required parameter 'body' is set + fail ArgumentError, "Missing the required parameter 'body' when calling RefApi.find_local_branches" if body.nil? + # resource path + local_var_path = "/v1/ref/find_local_branches".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GitalyFindLocalBranchesResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RefApi#find_local_branches\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Find a Ref matching the given constraints. Response may be empty. + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyFindRefNameResponse] + def find_ref_name(body, opts = {}) + data, _status_code, _headers = find_ref_name_with_http_info(body, opts) + return data + end + + # Find a Ref matching the given constraints. Response may be empty. + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GitalyFindRefNameResponse, Fixnum, Hash)>] GitalyFindRefNameResponse data, response status code and response headers + def find_ref_name_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: RefApi.find_ref_name ..." + end + # verify the required parameter 'body' is set + fail ArgumentError, "Missing the required parameter 'body' when calling RefApi.find_ref_name" if body.nil? + # resource path + local_var_path = "/v1/ref/find_ref_name".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GitalyFindRefNameResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RefApi#find_ref_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/ruby_swagger/lib/swagger_client/api/smart_http_api.rb b/ruby_swagger/lib/swagger_client/api/smart_http_api.rb new file mode 100644 index 00000000..dba73ca2 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/api/smart_http_api.rb @@ -0,0 +1,234 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require "uri" + +module SwaggerClient + class SmartHTTPApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + + # The response body for GET /info/refs?service=git-receive-pack + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyInfoRefsResponse] + def info_refs_receive_pack(body, opts = {}) + data, _status_code, _headers = info_refs_receive_pack_with_http_info(body, opts) + return data + end + + # The response body for GET /info/refs?service=git-receive-pack + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GitalyInfoRefsResponse, Fixnum, Hash)>] GitalyInfoRefsResponse data, response status code and response headers + def info_refs_receive_pack_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: SmartHTTPApi.info_refs_receive_pack ..." + end + # verify the required parameter 'body' is set + fail ArgumentError, "Missing the required parameter 'body' when calling SmartHTTPApi.info_refs_receive_pack" if body.nil? + # resource path + local_var_path = "/v1/smart_http/info_refs_receive_pack".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GitalyInfoRefsResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SmartHTTPApi#info_refs_receive_pack\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # The response body for GET /info/refs?service=git-upload-pack + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyInfoRefsResponse] + def info_refs_upload_pack(body, opts = {}) + data, _status_code, _headers = info_refs_upload_pack_with_http_info(body, opts) + return data + end + + # The response body for GET /info/refs?service=git-upload-pack + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(GitalyInfoRefsResponse, Fixnum, Hash)>] GitalyInfoRefsResponse data, response status code and response headers + def info_refs_upload_pack_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: SmartHTTPApi.info_refs_upload_pack ..." + end + # verify the required parameter 'body' is set + fail ArgumentError, "Missing the required parameter 'body' when calling SmartHTTPApi.info_refs_upload_pack" if body.nil? + # resource path + local_var_path = "/v1/smart_http/info_refs_upload_pack".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GitalyInfoRefsResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SmartHTTPApi#info_refs_upload_pack\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Request and response body for POST /receive-pack + # + # @param body (streaming inputs) + # @param [Hash] opts the optional parameters + # @return [GitalyPostReceivePackResponse] + def post_receive_pack(body, opts = {}) + data, _status_code, _headers = post_receive_pack_with_http_info(body, opts) + return data + end + + # Request and response body for POST /receive-pack + # + # @param body (streaming inputs) + # @param [Hash] opts the optional parameters + # @return [Array<(GitalyPostReceivePackResponse, Fixnum, Hash)>] GitalyPostReceivePackResponse data, response status code and response headers + def post_receive_pack_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: SmartHTTPApi.post_receive_pack ..." + end + # verify the required parameter 'body' is set + fail ArgumentError, "Missing the required parameter 'body' when calling SmartHTTPApi.post_receive_pack" if body.nil? + # resource path + local_var_path = "/v1/smart_http/post_receive_pack".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GitalyPostReceivePackResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SmartHTTPApi#post_receive_pack\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Request and response body for POST /upload-pack + # + # @param body (streaming inputs) + # @param [Hash] opts the optional parameters + # @return [GitalyPostUploadPackResponse] + def post_upload_pack(body, opts = {}) + data, _status_code, _headers = post_upload_pack_with_http_info(body, opts) + return data + end + + # Request and response body for POST /upload-pack + # + # @param body (streaming inputs) + # @param [Hash] opts the optional parameters + # @return [Array<(GitalyPostUploadPackResponse, Fixnum, Hash)>] GitalyPostUploadPackResponse data, response status code and response headers + def post_upload_pack_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: SmartHTTPApi.post_upload_pack ..." + end + # verify the required parameter 'body' is set + fail ArgumentError, "Missing the required parameter 'body' when calling SmartHTTPApi.post_upload_pack" if body.nil? + # resource path + local_var_path = "/v1/smart_http/post_upload_pack".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GitalyPostUploadPackResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SmartHTTPApi#post_upload_pack\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/ruby_swagger/lib/swagger_client/api/ssh_api.rb b/ruby_swagger/lib/swagger_client/api/ssh_api.rb new file mode 100644 index 00000000..e407b28f --- /dev/null +++ b/ruby_swagger/lib/swagger_client/api/ssh_api.rb @@ -0,0 +1,128 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require "uri" + +module SwaggerClient + class SSHApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + + # To forward 'git receive-pack' to Gitaly for SSH sessions + # + # @param body (streaming inputs) + # @param [Hash] opts the optional parameters + # @return [GitalySSHReceivePackResponse] + def s_sh_receive_pack(body, opts = {}) + data, _status_code, _headers = s_sh_receive_pack_with_http_info(body, opts) + return data + end + + # To forward 'git receive-pack' to Gitaly for SSH sessions + # + # @param body (streaming inputs) + # @param [Hash] opts the optional parameters + # @return [Array<(GitalySSHReceivePackResponse, Fixnum, Hash)>] GitalySSHReceivePackResponse data, response status code and response headers + def s_sh_receive_pack_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: SSHApi.s_sh_receive_pack ..." + end + # verify the required parameter 'body' is set + fail ArgumentError, "Missing the required parameter 'body' when calling SSHApi.s_sh_receive_pack" if body.nil? + # resource path + local_var_path = "/v1/ssh/ssh_receive_pack".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GitalySSHReceivePackResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SSHApi#s_sh_receive_pack\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # To forward 'git upload-pack' to Gitaly for SSH sessions + # + # @param body (streaming inputs) + # @param [Hash] opts the optional parameters + # @return [GitalySSHUploadPackResponse] + def s_sh_upload_pack(body, opts = {}) + data, _status_code, _headers = s_sh_upload_pack_with_http_info(body, opts) + return data + end + + # To forward 'git upload-pack' to Gitaly for SSH sessions + # + # @param body (streaming inputs) + # @param [Hash] opts the optional parameters + # @return [Array<(GitalySSHUploadPackResponse, Fixnum, Hash)>] GitalySSHUploadPackResponse data, response status code and response headers + def s_sh_upload_pack_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: SSHApi.s_sh_upload_pack ..." + end + # verify the required parameter 'body' is set + fail ArgumentError, "Missing the required parameter 'body' when calling SSHApi.s_sh_upload_pack" if body.nil? + # resource path + local_var_path = "/v1/ssh/ssh_upload_pack".sub('{format}','json') + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'GitalySSHUploadPackResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SSHApi#s_sh_upload_pack\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/ruby_swagger/lib/swagger_client/api_client.rb b/ruby_swagger/lib/swagger_client/api_client.rb new file mode 100644 index 00000000..c43862e4 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/api_client.rb @@ -0,0 +1,375 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' +require 'json' +require 'logger' +require 'tempfile' +require 'typhoeus' +require 'uri' + +module SwaggerClient + class ApiClient + # The Configuration object holding settings to be used in the API client. + attr_accessor :config + + # Defines the headers to be used in HTTP requests of all API calls by default. + # + # @return [Hash] + attr_accessor :default_headers + + # Initializes the ApiClient + # @option config [Configuration] Configuration for initializing the object, default to Configuration.default + def initialize(config = Configuration.default) + @config = config + @user_agent = "Swagger-Codegen/#{VERSION}/ruby" + @default_headers = { + 'Content-Type' => "application/json", + 'User-Agent' => @user_agent + } + end + + def self.default + @@default ||= ApiClient.new + end + + # Call an API with given options. + # + # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements: + # the data deserialized from response body (could be nil), response status code and response headers. + def call_api(http_method, path, opts = {}) + request = build_request(http_method, path, opts) + response = request.run + + if @config.debugging + @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + end + + unless response.success? + if response.timed_out? + fail ApiError.new('Connection timed out') + elsif response.code == 0 + # Errors from libcurl will be made visible here + fail ApiError.new(:code => 0, + :message => response.return_message) + else + fail ApiError.new(:code => response.code, + :response_headers => response.headers, + :response_body => response.body), + response.status_message + end + end + + if opts[:return_type] + data = deserialize(response, opts[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Builds the HTTP request + # + # @param [String] http_method HTTP method/verb (e.g. POST) + # @param [String] path URL path (e.g. /account/new) + # @option opts [Hash] :header_params Header parameters + # @option opts [Hash] :query_params Query parameters + # @option opts [Hash] :form_params Query parameters + # @option opts [Object] :body HTTP body (JSON/XML) + # @return [Typhoeus::Request] A Typhoeus Request + def build_request(http_method, path, opts = {}) + url = build_request_url(path) + http_method = http_method.to_sym.downcase + + header_params = @default_headers.merge(opts[:header_params] || {}) + query_params = opts[:query_params] || {} + form_params = opts[:form_params] || {} + + + # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) + _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 + + req_opts = { + :method => http_method, + :headers => header_params, + :params => query_params, + :params_encoding => @config.params_encoding, + :timeout => @config.timeout, + :ssl_verifypeer => @config.verify_ssl, + :ssl_verifyhost => _verify_ssl_host, + :sslcert => @config.cert_file, + :sslkey => @config.key_file, + :verbose => @config.debugging + } + + # set custom cert, if provided + req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert + + if [:post, :patch, :put, :delete].include?(http_method) + req_body = build_request_body(header_params, form_params, opts[:body]) + req_opts.update :body => req_body + if @config.debugging + @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" + end + end + + Typhoeus::Request.new(url, req_opts) + end + + # Check if the given MIME is a JSON MIME. + # JSON MIME examples: + # application/json + # application/json; charset=UTF8 + # APPLICATION/JSON + # */* + # @param [String] mime MIME + # @return [Boolean] True if the MIME is application/json + def json_mime?(mime) + (mime == "*/*") || !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil? + end + + # Deserialize the response to the given return type. + # + # @param [Response] response HTTP response + # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]" + def deserialize(response, return_type) + body = response.body + return nil if body.nil? || body.empty? + + # return response body directly for String return type + return body if return_type == 'String' + + # handle file downloading - save response body into a tmp file and return the File instance + return download_file(response) if return_type == 'File' + + # ensuring a default content type + content_type = response.headers['Content-Type'] || 'application/json' + + fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) + + begin + data = JSON.parse("[#{body}]", :symbolize_names => true)[0] + rescue JSON::ParserError => e + if %w(String Date DateTime).include?(return_type) + data = body + else + raise e + end + end + + convert_to_type data, return_type + end + + # Convert data to the given return type. + # @param [Object] data Data to be converted + # @param [String] return_type Return type + # @return [Mixed] Data in a particular type + def convert_to_type(data, return_type) + return nil if data.nil? + case return_type + when 'String' + data.to_s + when 'Integer' + data.to_i + when 'Float' + data.to_f + when 'BOOLEAN' + data == true + when 'DateTime' + # parse date time (expecting ISO 8601 format) + DateTime.parse data + when 'Date' + # parse date time (expecting ISO 8601 format) + Date.parse data + when 'Object' + # generic object (usually a Hash), return directly + data + when /\AArray<(.+)>\z/ + # e.g. Array + sub_type = $1 + data.map {|item| convert_to_type(item, sub_type) } + when /\AHash\\z/ + # e.g. Hash + sub_type = $1 + {}.tap do |hash| + data.each {|k, v| hash[k] = convert_to_type(v, sub_type) } + end + else + # models, e.g. Pet + SwaggerClient.const_get(return_type).new.tap do |model| + model.build_from_hash data + end + end + end + + # Save response body into a file in (the defined) temporary folder, using the filename + # from the "Content-Disposition" header if provided, otherwise a random filename. + # + # @see Configuration#temp_folder_path + # @return [Tempfile] the file downloaded + def download_file(response) + content_disposition = response.headers['Content-Disposition'] + if content_disposition and content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) + else + prefix = 'download-' + end + prefix = prefix + '-' unless prefix.end_with?('-') + + tempfile = nil + encoding = response.body.encoding + Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) do |file| + file.write(response.body) + tempfile = file + end + @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + tempfile + end + + # Sanitize filename by removing path. + # e.g. ../../sun.gif becomes sun.gif + # + # @param [String] filename the filename to be sanitized + # @return [String] the sanitized filename + def sanitize_filename(filename) + filename.gsub(/.*[\/\\]/, '') + end + + def build_request_url(path) + # Add leading and trailing slashes to path + path = "/#{path}".gsub(/\/+/, '/') + URI.encode(@config.base_url + path) + end + + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || + header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when File, Array, nil + # let typhoeus handle File, Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + + # Update hearder and query params based on authentication settings. + # + # @param [Hash] header_params Header parameters + # @param [Hash] query_params Query parameters + # @param [String] auth_names Authentication scheme name + def update_params_for_auth!(header_params, query_params, auth_names) + Array(auth_names).each do |auth_name| + auth_setting = @config.auth_settings[auth_name] + next unless auth_setting + case auth_setting[:in] + when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] + when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] + else fail ArgumentError, 'Authentication token must be in `query` of `header`' + end + end + end + + # Sets user agent in HTTP header + # + # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) + def user_agent=(user_agent) + @user_agent = user_agent + @default_headers['User-Agent'] = @user_agent + end + + # Return Accept header based on an array of accepts provided. + # @param [Array] accepts array for Accept + # @return [String] the Accept header (e.g. application/json) + def select_header_accept(accepts) + return nil if accepts.nil? || accepts.empty? + # use JSON when present, otherwise use all of the provided + json_accept = accepts.find { |s| json_mime?(s) } + return json_accept || accepts.join(',') + end + + # Return Content-Type header based on an array of content types provided. + # @param [Array] content_types array for Content-Type + # @return [String] the Content-Type header (e.g. application/json) + def select_header_content_type(content_types) + # use application/json by default + return 'application/json' if content_types.nil? || content_types.empty? + # use JSON when present, otherwise use the first one + json_content_type = content_types.find { |s| json_mime?(s) } + return json_content_type || content_types.first + end + + # Convert object (array, hash, object, etc) to JSON string. + # @param [Object] model object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_http_body(model) + return model if model.nil? || model.is_a?(String) + local_body = nil + if model.is_a?(Array) + local_body = model.map{|m| object_to_hash(m) } + else + local_body = object_to_hash(model) + end + local_body.to_json + end + + # Convert object(non-array) to hash. + # @param [Object] obj object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_hash(obj) + if obj.respond_to?(:to_hash) + obj.to_hash + else + obj + end + end + + # Build parameter value according to the given collection format. + # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi + def build_collection_param(param, collection_format) + case collection_format + when :csv + param.join(',') + when :ssv + param.join(' ') + when :tsv + param.join("\t") + when :pipes + param.join('|') + when :multi + # return the array directly as typhoeus will handle it as expected + param + else + fail "unknown collection format: #{collection_format.inspect}" + end + end + end +end diff --git a/ruby_swagger/lib/swagger_client/api_error.rb b/ruby_swagger/lib/swagger_client/api_error.rb new file mode 100644 index 00000000..0fc24b1c --- /dev/null +++ b/ruby_swagger/lib/swagger_client/api_error.rb @@ -0,0 +1,37 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +module SwaggerClient + class ApiError < StandardError + attr_reader :code, :response_headers, :response_body + + # Usage examples: + # ApiError.new + # ApiError.new("message") + # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") + # ApiError.new(:code => 404, :message => "Not Found") + def initialize(arg = nil) + if arg.is_a? Hash + if arg.key?(:message) || arg.key?('message') + super(arg[:message] || arg['message']) + else + super arg + end + + arg.each do |k, v| + instance_variable_set "@#{k}", v + end + else + super arg + end + end + end +end diff --git a/ruby_swagger/lib/swagger_client/configuration.rb b/ruby_swagger/lib/swagger_client/configuration.rb new file mode 100644 index 00000000..62c298e0 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/configuration.rb @@ -0,0 +1,195 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'uri' + +module SwaggerClient + class Configuration + # Defines url scheme + attr_accessor :scheme + + # Defines url host + attr_accessor :host + + # Defines url base path + attr_accessor :base_path + + # Defines API keys used with API Key authentications. + # + # @return [Hash] key: parameter name, value: parameter value (API key) + # + # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) + # config.api_key['api_key'] = 'xxx' + attr_accessor :api_key + + # Defines API key prefixes used with API Key authentications. + # + # @return [Hash] key: parameter name, value: API key prefix + # + # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) + # config.api_key_prefix['api_key'] = 'Token' + attr_accessor :api_key_prefix + + # Defines the username used with HTTP basic authentication. + # + # @return [String] + attr_accessor :username + + # Defines the password used with HTTP basic authentication. + # + # @return [String] + attr_accessor :password + + # Defines the access token (Bearer) used with OAuth2. + attr_accessor :access_token + + # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response + # details will be logged with `logger.debug` (see the `logger` attribute). + # Default to false. + # + # @return [true, false] + attr_accessor :debugging + + # Defines the logger used for debugging. + # Default to `Rails.logger` (when in Rails) or logging to STDOUT. + # + # @return [#debug] + attr_accessor :logger + + # Defines the temporary folder to store downloaded files + # (for API endpoints that have file response). + # Default to use `Tempfile`. + # + # @return [String] + attr_accessor :temp_folder_path + + # The time limit for HTTP request in seconds. + # Default to 0 (never times out). + attr_accessor :timeout + + ### TLS/SSL setting + # Set this to false to skip verifying SSL certificate when calling API from https server. + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :verify_ssl + + ### TLS/SSL setting + # Set this to false to skip verifying SSL host name + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :verify_ssl_host + + ### TLS/SSL setting + # Set this to customize the certificate file to verify the peer. + # + # @return [String] the path to the certificate file + # + # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: + # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 + attr_accessor :ssl_ca_cert + + ### TLS/SSL setting + # Client certificate file (for client certificate) + attr_accessor :cert_file + + ### TLS/SSL setting + # Client private key file (for client certificate) + attr_accessor :key_file + + # Set this to customize parameters encoding of array parameter with multi collectionFormat. + # Default to nil. + # + # @see The params_encoding option of Ethon. Related source code: + # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 + attr_accessor :params_encoding + + attr_accessor :inject_format + + attr_accessor :force_ending_format + + def initialize + @scheme = 'http' + @host = '' + @base_path = '' + @api_key = {} + @api_key_prefix = {} + @timeout = 0 + @verify_ssl = true + @verify_ssl_host = true + @params_encoding = nil + @cert_file = nil + @key_file = nil + @debugging = false + @inject_format = false + @force_ending_format = false + @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) + + yield(self) if block_given? + end + + # The default Configuration object. + def self.default + @@default ||= Configuration.new + end + + def configure + yield(self) if block_given? + end + + def scheme=(scheme) + # remove :// from scheme + @scheme = scheme.sub(/:\/\//, '') + end + + def host=(host) + # remove http(s):// and anything after a slash + @host = host.sub(/https?:\/\//, '').split('/').first + end + + def base_path=(base_path) + # Add leading and trailing slashes to base_path + @base_path = "/#{base_path}".gsub(/\/+/, '/') + @base_path = "" if @base_path == "/" + end + + def base_url + url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') + URI.encode(url) + end + + # Gets API key (with prefix if set). + # @param [String] param_name the parameter name of API key auth + def api_key_with_prefix(param_name) + if @api_key_prefix[param_name] + "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" + else + @api_key[param_name] + end + end + + # Gets Basic Auth token string + def basic_auth_token + 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") + end + + # Returns Auth Settings hash for api client. + def auth_settings + { + } + end + end +end diff --git a/ruby_swagger/lib/swagger_client/models/find_local_branches_request_sort_by.rb b/ruby_swagger/lib/swagger_client/models/find_local_branches_request_sort_by.rb new file mode 100644 index 00000000..15d51f02 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/find_local_branches_request_sort_by.rb @@ -0,0 +1,22 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + class FindLocalBranchesRequestSortBy + + NAME = "NAME".freeze + UPDATED_ASC = "UPDATED_ASC".freeze + UPDATED_DESC = "UPDATED_DESC".freeze + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_commit_diff_request.rb b/ruby_swagger/lib/swagger_client/models/gitaly_commit_diff_request.rb new file mode 100644 index 00000000..1daf57f5 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_commit_diff_request.rb @@ -0,0 +1,205 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyCommitDiffRequest + attr_accessor :repository + + attr_accessor :left_commit_id + + attr_accessor :right_commit_id + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repository' => :'repository', + :'left_commit_id' => :'left_commit_id', + :'right_commit_id' => :'right_commit_id' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'repository' => :'GitalyRepository', + :'left_commit_id' => :'String', + :'right_commit_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'repository') + self.repository = attributes[:'repository'] + end + + if attributes.has_key?(:'left_commit_id') + self.left_commit_id = attributes[:'left_commit_id'] + end + + if attributes.has_key?(:'right_commit_id') + self.right_commit_id = attributes[:'right_commit_id'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repository == o.repository && + left_commit_id == o.left_commit_id && + right_commit_id == o.right_commit_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [repository, left_commit_id, right_commit_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_commit_diff_response.rb b/ruby_swagger/lib/swagger_client/models/gitaly_commit_diff_response.rb new file mode 100644 index 00000000..302b6c19 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_commit_diff_response.rb @@ -0,0 +1,252 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + # A CommitDiffResponse corresponds to a single changed file in a commit. + class GitalyCommitDiffResponse + attr_accessor :from_path + + attr_accessor :to_path + + attr_accessor :from_id + + attr_accessor :to_id + + attr_accessor :old_mode + + attr_accessor :new_mode + + attr_accessor :binary + + attr_accessor :raw_chunks + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'from_path' => :'from_path', + :'to_path' => :'to_path', + :'from_id' => :'from_id', + :'to_id' => :'to_id', + :'old_mode' => :'old_mode', + :'new_mode' => :'new_mode', + :'binary' => :'binary', + :'raw_chunks' => :'raw_chunks' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'from_path' => :'String', + :'to_path' => :'String', + :'from_id' => :'String', + :'to_id' => :'String', + :'old_mode' => :'Integer', + :'new_mode' => :'Integer', + :'binary' => :'BOOLEAN', + :'raw_chunks' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'from_path') + self.from_path = attributes[:'from_path'] + end + + if attributes.has_key?(:'to_path') + self.to_path = attributes[:'to_path'] + end + + if attributes.has_key?(:'from_id') + self.from_id = attributes[:'from_id'] + end + + if attributes.has_key?(:'to_id') + self.to_id = attributes[:'to_id'] + end + + if attributes.has_key?(:'old_mode') + self.old_mode = attributes[:'old_mode'] + end + + if attributes.has_key?(:'new_mode') + self.new_mode = attributes[:'new_mode'] + end + + if attributes.has_key?(:'binary') + self.binary = attributes[:'binary'] + end + + if attributes.has_key?(:'raw_chunks') + if (value = attributes[:'raw_chunks']).is_a?(Array) + self.raw_chunks = value + end + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + from_path == o.from_path && + to_path == o.to_path && + from_id == o.from_id && + to_id == o.to_id && + old_mode == o.old_mode && + new_mode == o.new_mode && + binary == o.binary && + raw_chunks == o.raw_chunks + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [from_path, to_path, from_id, to_id, old_mode, new_mode, binary, raw_chunks].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_commit_is_ancestor_request.rb b/ruby_swagger/lib/swagger_client/models/gitaly_commit_is_ancestor_request.rb new file mode 100644 index 00000000..0e29fcde --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_commit_is_ancestor_request.rb @@ -0,0 +1,205 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyCommitIsAncestorRequest + attr_accessor :repository + + attr_accessor :ancestor_id + + attr_accessor :child_id + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repository' => :'repository', + :'ancestor_id' => :'ancestor_id', + :'child_id' => :'child_id' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'repository' => :'GitalyRepository', + :'ancestor_id' => :'String', + :'child_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'repository') + self.repository = attributes[:'repository'] + end + + if attributes.has_key?(:'ancestor_id') + self.ancestor_id = attributes[:'ancestor_id'] + end + + if attributes.has_key?(:'child_id') + self.child_id = attributes[:'child_id'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repository == o.repository && + ancestor_id == o.ancestor_id && + child_id == o.child_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [repository, ancestor_id, child_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_commit_is_ancestor_response.rb b/ruby_swagger/lib/swagger_client/models/gitaly_commit_is_ancestor_response.rb new file mode 100644 index 00000000..596da39b --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_commit_is_ancestor_response.rb @@ -0,0 +1,187 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyCommitIsAncestorResponse + attr_accessor :value + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'value' => :'value' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'value' => :'BOOLEAN' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'value') + self.value = attributes[:'value'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_exit_status.rb b/ruby_swagger/lib/swagger_client/models/gitaly_exit_status.rb new file mode 100644 index 00000000..146e58fc --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_exit_status.rb @@ -0,0 +1,187 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyExitStatus + attr_accessor :value + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'value' => :'value' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'value' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'value') + self.value = attributes[:'value'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_find_all_branch_names_request.rb b/ruby_swagger/lib/swagger_client/models/gitaly_find_all_branch_names_request.rb new file mode 100644 index 00000000..c52574a8 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_find_all_branch_names_request.rb @@ -0,0 +1,187 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyFindAllBranchNamesRequest + attr_accessor :repository + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repository' => :'repository' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'repository' => :'GitalyRepository' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'repository') + self.repository = attributes[:'repository'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repository == o.repository + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [repository].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_find_all_branch_names_response.rb b/ruby_swagger/lib/swagger_client/models/gitaly_find_all_branch_names_response.rb new file mode 100644 index 00000000..8f84bbb2 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_find_all_branch_names_response.rb @@ -0,0 +1,189 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyFindAllBranchNamesResponse + attr_accessor :names + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'names' => :'names' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'names' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'names') + if (value = attributes[:'names']).is_a?(Array) + self.names = value + end + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + names == o.names + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [names].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_find_all_tag_names_request.rb b/ruby_swagger/lib/swagger_client/models/gitaly_find_all_tag_names_request.rb new file mode 100644 index 00000000..058ea761 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_find_all_tag_names_request.rb @@ -0,0 +1,187 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyFindAllTagNamesRequest + attr_accessor :repository + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repository' => :'repository' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'repository' => :'GitalyRepository' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'repository') + self.repository = attributes[:'repository'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repository == o.repository + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [repository].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_find_all_tag_names_response.rb b/ruby_swagger/lib/swagger_client/models/gitaly_find_all_tag_names_response.rb new file mode 100644 index 00000000..a327881d --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_find_all_tag_names_response.rb @@ -0,0 +1,189 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyFindAllTagNamesResponse + attr_accessor :names + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'names' => :'names' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'names' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'names') + if (value = attributes[:'names']).is_a?(Array) + self.names = value + end + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + names == o.names + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [names].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_find_default_branch_name_request.rb b/ruby_swagger/lib/swagger_client/models/gitaly_find_default_branch_name_request.rb new file mode 100644 index 00000000..f028a7dd --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_find_default_branch_name_request.rb @@ -0,0 +1,187 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyFindDefaultBranchNameRequest + attr_accessor :repository + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repository' => :'repository' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'repository' => :'GitalyRepository' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'repository') + self.repository = attributes[:'repository'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repository == o.repository + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [repository].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_find_default_branch_name_response.rb b/ruby_swagger/lib/swagger_client/models/gitaly_find_default_branch_name_response.rb new file mode 100644 index 00000000..7a5a7d6b --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_find_default_branch_name_response.rb @@ -0,0 +1,187 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyFindDefaultBranchNameResponse + attr_accessor :name + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_find_local_branch_commit_author.rb b/ruby_swagger/lib/swagger_client/models/gitaly_find_local_branch_commit_author.rb new file mode 100644 index 00000000..c506c52b --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_find_local_branch_commit_author.rb @@ -0,0 +1,205 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyFindLocalBranchCommitAuthor + attr_accessor :name + + attr_accessor :email + + attr_accessor :date + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'email' => :'email', + :'date' => :'date' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'name' => :'String', + :'email' => :'String', + :'date' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.has_key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.has_key?(:'date') + self.date = attributes[:'date'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + email == o.email && + date == o.date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [name, email, date].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_find_local_branch_response.rb b/ruby_swagger/lib/swagger_client/models/gitaly_find_local_branch_response.rb new file mode 100644 index 00000000..0b9a67e7 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_find_local_branch_response.rb @@ -0,0 +1,223 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyFindLocalBranchResponse + attr_accessor :name + + attr_accessor :commit_id + + attr_accessor :commit_subject + + attr_accessor :commit_author + + attr_accessor :commit_committer + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'commit_id' => :'commit_id', + :'commit_subject' => :'commit_subject', + :'commit_author' => :'commit_author', + :'commit_committer' => :'commit_committer' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'name' => :'String', + :'commit_id' => :'String', + :'commit_subject' => :'String', + :'commit_author' => :'GitalyFindLocalBranchCommitAuthor', + :'commit_committer' => :'GitalyFindLocalBranchCommitAuthor' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.has_key?(:'commit_id') + self.commit_id = attributes[:'commit_id'] + end + + if attributes.has_key?(:'commit_subject') + self.commit_subject = attributes[:'commit_subject'] + end + + if attributes.has_key?(:'commit_author') + self.commit_author = attributes[:'commit_author'] + end + + if attributes.has_key?(:'commit_committer') + self.commit_committer = attributes[:'commit_committer'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + commit_id == o.commit_id && + commit_subject == o.commit_subject && + commit_author == o.commit_author && + commit_committer == o.commit_committer + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [name, commit_id, commit_subject, commit_author, commit_committer].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_find_local_branches_request.rb b/ruby_swagger/lib/swagger_client/models/gitaly_find_local_branches_request.rb new file mode 100644 index 00000000..76504005 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_find_local_branches_request.rb @@ -0,0 +1,196 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyFindLocalBranchesRequest + attr_accessor :repository + + attr_accessor :sort_by + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repository' => :'repository', + :'sort_by' => :'sort_by' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'repository' => :'GitalyRepository', + :'sort_by' => :'FindLocalBranchesRequestSortBy' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'repository') + self.repository = attributes[:'repository'] + end + + if attributes.has_key?(:'sort_by') + self.sort_by = attributes[:'sort_by'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repository == o.repository && + sort_by == o.sort_by + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [repository, sort_by].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_find_local_branches_response.rb b/ruby_swagger/lib/swagger_client/models/gitaly_find_local_branches_response.rb new file mode 100644 index 00000000..6742f6e2 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_find_local_branches_response.rb @@ -0,0 +1,189 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyFindLocalBranchesResponse + attr_accessor :branches + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'branches' => :'branches' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'branches' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'branches') + if (value = attributes[:'branches']).is_a?(Array) + self.branches = value + end + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + branches == o.branches + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [branches].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_find_ref_name_request.rb b/ruby_swagger/lib/swagger_client/models/gitaly_find_ref_name_request.rb new file mode 100644 index 00000000..f7e1c10d --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_find_ref_name_request.rb @@ -0,0 +1,206 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyFindRefNameRequest + attr_accessor :repository + + attr_accessor :commit_id + + # Example prefix: \"refs/heads/\". Type bytes because that is the type of ref names. + attr_accessor :prefix + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repository' => :'repository', + :'commit_id' => :'commit_id', + :'prefix' => :'prefix' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'repository' => :'GitalyRepository', + :'commit_id' => :'String', + :'prefix' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'repository') + self.repository = attributes[:'repository'] + end + + if attributes.has_key?(:'commit_id') + self.commit_id = attributes[:'commit_id'] + end + + if attributes.has_key?(:'prefix') + self.prefix = attributes[:'prefix'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repository == o.repository && + commit_id == o.commit_id && + prefix == o.prefix + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [repository, commit_id, prefix].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_find_ref_name_response.rb b/ruby_swagger/lib/swagger_client/models/gitaly_find_ref_name_response.rb new file mode 100644 index 00000000..83a848ca --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_find_ref_name_response.rb @@ -0,0 +1,188 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyFindRefNameResponse + # Example name: \"refs/heads/master\". Cannot assume UTF8, so the type is bytes. + attr_accessor :name + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_info_refs_request.rb b/ruby_swagger/lib/swagger_client/models/gitaly_info_refs_request.rb new file mode 100644 index 00000000..0d1d2e03 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_info_refs_request.rb @@ -0,0 +1,187 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyInfoRefsRequest + attr_accessor :repository + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repository' => :'repository' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'repository' => :'GitalyRepository' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'repository') + self.repository = attributes[:'repository'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repository == o.repository + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [repository].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_info_refs_response.rb b/ruby_swagger/lib/swagger_client/models/gitaly_info_refs_response.rb new file mode 100644 index 00000000..6fc39897 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_info_refs_response.rb @@ -0,0 +1,187 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyInfoRefsResponse + attr_accessor :data + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'data' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'data') + self.data = attributes[:'data'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_post_receive_pack_request.rb b/ruby_swagger/lib/swagger_client/models/gitaly_post_receive_pack_request.rb new file mode 100644 index 00000000..1214a749 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_post_receive_pack_request.rb @@ -0,0 +1,206 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyPostReceivePackRequest + attr_accessor :repository + + attr_accessor :data + + # gl_id becomes env variable GL_ID, used by the Git {pre,post}-receive hooks. Should only be present in the first message of the stream. + attr_accessor :gl_id + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repository' => :'repository', + :'data' => :'data', + :'gl_id' => :'gl_id' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'repository' => :'GitalyRepository', + :'data' => :'String', + :'gl_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'repository') + self.repository = attributes[:'repository'] + end + + if attributes.has_key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.has_key?(:'gl_id') + self.gl_id = attributes[:'gl_id'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repository == o.repository && + data == o.data && + gl_id == o.gl_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [repository, data, gl_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_post_receive_pack_response.rb b/ruby_swagger/lib/swagger_client/models/gitaly_post_receive_pack_response.rb new file mode 100644 index 00000000..298c3f52 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_post_receive_pack_response.rb @@ -0,0 +1,187 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyPostReceivePackResponse + attr_accessor :data + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'data' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'data') + self.data = attributes[:'data'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_post_receive_request.rb b/ruby_swagger/lib/swagger_client/models/gitaly_post_receive_request.rb new file mode 100644 index 00000000..02157b8d --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_post_receive_request.rb @@ -0,0 +1,187 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyPostReceiveRequest + attr_accessor :repository + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repository' => :'repository' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'repository' => :'GitalyRepository' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'repository') + self.repository = attributes[:'repository'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repository == o.repository + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [repository].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_post_receive_response.rb b/ruby_swagger/lib/swagger_client/models/gitaly_post_receive_response.rb new file mode 100644 index 00000000..71c49f48 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_post_receive_response.rb @@ -0,0 +1,178 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyPostReceiveResponse + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Attribute type mapping. + def self.swagger_types + { + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_post_upload_pack_request.rb b/ruby_swagger/lib/swagger_client/models/gitaly_post_upload_pack_request.rb new file mode 100644 index 00000000..d09618e2 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_post_upload_pack_request.rb @@ -0,0 +1,196 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyPostUploadPackRequest + attr_accessor :repository + + attr_accessor :data + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repository' => :'repository', + :'data' => :'data' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'repository' => :'GitalyRepository', + :'data' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'repository') + self.repository = attributes[:'repository'] + end + + if attributes.has_key?(:'data') + self.data = attributes[:'data'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repository == o.repository && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [repository, data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_post_upload_pack_response.rb b/ruby_swagger/lib/swagger_client/models/gitaly_post_upload_pack_response.rb new file mode 100644 index 00000000..8d472ab4 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_post_upload_pack_response.rb @@ -0,0 +1,187 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyPostUploadPackResponse + attr_accessor :data + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'data' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'data') + self.data = attributes[:'data'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_repository.rb b/ruby_swagger/lib/swagger_client/models/gitaly_repository.rb new file mode 100644 index 00000000..eb700ee6 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_repository.rb @@ -0,0 +1,205 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalyRepository + attr_accessor :path + + attr_accessor :storage_name + + attr_accessor :relative_path + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'path' => :'path', + :'storage_name' => :'storage_name', + :'relative_path' => :'relative_path' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'path' => :'String', + :'storage_name' => :'String', + :'relative_path' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'path') + self.path = attributes[:'path'] + end + + if attributes.has_key?(:'storage_name') + self.storage_name = attributes[:'storage_name'] + end + + if attributes.has_key?(:'relative_path') + self.relative_path = attributes[:'relative_path'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + path == o.path && + storage_name == o.storage_name && + relative_path == o.relative_path + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [path, storage_name, relative_path].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_ssh_receive_pack_request.rb b/ruby_swagger/lib/swagger_client/models/gitaly_ssh_receive_pack_request.rb new file mode 100644 index 00000000..126830ac --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_ssh_receive_pack_request.rb @@ -0,0 +1,206 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalySSHReceivePackRequest + # 'repository' must be present in the first message. + attr_accessor :repository + + attr_accessor :stdin + + attr_accessor :gl_id + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repository' => :'repository', + :'stdin' => :'stdin', + :'gl_id' => :'gl_id' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'repository' => :'GitalyRepository', + :'stdin' => :'String', + :'gl_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'repository') + self.repository = attributes[:'repository'] + end + + if attributes.has_key?(:'stdin') + self.stdin = attributes[:'stdin'] + end + + if attributes.has_key?(:'gl_id') + self.gl_id = attributes[:'gl_id'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repository == o.repository && + stdin == o.stdin && + gl_id == o.gl_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [repository, stdin, gl_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_ssh_receive_pack_response.rb b/ruby_swagger/lib/swagger_client/models/gitaly_ssh_receive_pack_response.rb new file mode 100644 index 00000000..2e476a10 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_ssh_receive_pack_response.rb @@ -0,0 +1,206 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalySSHReceivePackResponse + attr_accessor :stdout + + attr_accessor :stderr + + # This field may be nil. This is intentional: only when the remote command has finished can we return its exit status. + attr_accessor :exit_status + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'stdout' => :'stdout', + :'stderr' => :'stderr', + :'exit_status' => :'exit_status' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'stdout' => :'String', + :'stderr' => :'String', + :'exit_status' => :'GitalyExitStatus' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'stdout') + self.stdout = attributes[:'stdout'] + end + + if attributes.has_key?(:'stderr') + self.stderr = attributes[:'stderr'] + end + + if attributes.has_key?(:'exit_status') + self.exit_status = attributes[:'exit_status'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + stdout == o.stdout && + stderr == o.stderr && + exit_status == o.exit_status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [stdout, stderr, exit_status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_ssh_upload_pack_request.rb b/ruby_swagger/lib/swagger_client/models/gitaly_ssh_upload_pack_request.rb new file mode 100644 index 00000000..94a16e15 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_ssh_upload_pack_request.rb @@ -0,0 +1,197 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalySSHUploadPackRequest + # 'repository' must be present in the first message. + attr_accessor :repository + + attr_accessor :stdin + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repository' => :'repository', + :'stdin' => :'stdin' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'repository' => :'GitalyRepository', + :'stdin' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'repository') + self.repository = attributes[:'repository'] + end + + if attributes.has_key?(:'stdin') + self.stdin = attributes[:'stdin'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repository == o.repository && + stdin == o.stdin + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [repository, stdin].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/models/gitaly_ssh_upload_pack_response.rb b/ruby_swagger/lib/swagger_client/models/gitaly_ssh_upload_pack_response.rb new file mode 100644 index 00000000..66ed6e09 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/models/gitaly_ssh_upload_pack_response.rb @@ -0,0 +1,206 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module SwaggerClient + + class GitalySSHUploadPackResponse + attr_accessor :stdout + + attr_accessor :stderr + + # This field may be nil. This is intentional: only when the remote command has finished can we return its exit status. + attr_accessor :exit_status + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'stdout' => :'stdout', + :'stderr' => :'stderr', + :'exit_status' => :'exit_status' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'stdout' => :'String', + :'stderr' => :'String', + :'exit_status' => :'GitalyExitStatus' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} + + if attributes.has_key?(:'stdout') + self.stdout = attributes[:'stdout'] + end + + if attributes.has_key?(:'stderr') + self.stderr = attributes[:'stderr'] + end + + if attributes.has_key?(:'exit_status') + self.exit_status = attributes[:'exit_status'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + stdout == o.stdout && + stderr == o.stderr && + exit_status == o.exit_status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [stdout, stderr, exit_status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = SwaggerClient.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map{ |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/ruby_swagger/lib/swagger_client/version.rb b/ruby_swagger/lib/swagger_client/version.rb new file mode 100644 index 00000000..d2efcf25 --- /dev/null +++ b/ruby_swagger/lib/swagger_client/version.rb @@ -0,0 +1,14 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +module SwaggerClient + VERSION = "1.0.0" +end diff --git a/ruby_swagger/spec/api/commit_api_spec.rb b/ruby_swagger/spec/api/commit_api_spec.rb new file mode 100644 index 00000000..b5fad634 --- /dev/null +++ b/ruby_swagger/spec/api/commit_api_spec.rb @@ -0,0 +1,46 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for SwaggerClient::CommitApi +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'CommitApi' do + before do + # run before each test + @instance = SwaggerClient::CommitApi.new + end + + after do + # run after each test + end + + describe 'test an instance of CommitApi' do + it 'should create an instact of CommitApi' do + expect(@instance).to be_instance_of(SwaggerClient::CommitApi) + end + end + + # unit tests for commit_is_ancestor + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyCommitIsAncestorResponse] + describe 'commit_is_ancestor test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/ruby_swagger/spec/api/diff_api_spec.rb b/ruby_swagger/spec/api/diff_api_spec.rb new file mode 100644 index 00000000..6b1f8d13 --- /dev/null +++ b/ruby_swagger/spec/api/diff_api_spec.rb @@ -0,0 +1,46 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for SwaggerClient::DiffApi +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'DiffApi' do + before do + # run before each test + @instance = SwaggerClient::DiffApi.new + end + + after do + # run after each test + end + + describe 'test an instance of DiffApi' do + it 'should create an instact of DiffApi' do + expect(@instance).to be_instance_of(SwaggerClient::DiffApi) + end + end + + # unit tests for commit_diff + # Returns stream of CommitDiffResponse: 1 per changed file + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyCommitDiffResponse] + describe 'commit_diff test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/ruby_swagger/spec/api/notifications_api_spec.rb b/ruby_swagger/spec/api/notifications_api_spec.rb new file mode 100644 index 00000000..d8dc4e94 --- /dev/null +++ b/ruby_swagger/spec/api/notifications_api_spec.rb @@ -0,0 +1,46 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for SwaggerClient::NotificationsApi +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'NotificationsApi' do + before do + # run before each test + @instance = SwaggerClient::NotificationsApi.new + end + + after do + # run after each test + end + + describe 'test an instance of NotificationsApi' do + it 'should create an instact of NotificationsApi' do + expect(@instance).to be_instance_of(SwaggerClient::NotificationsApi) + end + end + + # unit tests for post_receive + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyPostReceiveResponse] + describe 'post_receive test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/ruby_swagger/spec/api/ref_api_spec.rb b/ruby_swagger/spec/api/ref_api_spec.rb new file mode 100644 index 00000000..83280794 --- /dev/null +++ b/ruby_swagger/spec/api/ref_api_spec.rb @@ -0,0 +1,94 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for SwaggerClient::RefApi +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'RefApi' do + before do + # run before each test + @instance = SwaggerClient::RefApi.new + end + + after do + # run after each test + end + + describe 'test an instance of RefApi' do + it 'should create an instact of RefApi' do + expect(@instance).to be_instance_of(SwaggerClient::RefApi) + end + end + + # unit tests for find_all_branch_names + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyFindAllBranchNamesResponse] + describe 'find_all_branch_names test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for find_all_tag_names + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyFindAllTagNamesResponse] + describe 'find_all_tag_names test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for find_default_branch_name + # + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyFindDefaultBranchNameResponse] + describe 'find_default_branch_name test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for find_local_branches + # Return a stream so we can divide the response in chunks of branches + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyFindLocalBranchesResponse] + describe 'find_local_branches test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for find_ref_name + # Find a Ref matching the given constraints. Response may be empty. + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyFindRefNameResponse] + describe 'find_ref_name test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/ruby_swagger/spec/api/smart_http_api_spec.rb b/ruby_swagger/spec/api/smart_http_api_spec.rb new file mode 100644 index 00000000..8b3b0c29 --- /dev/null +++ b/ruby_swagger/spec/api/smart_http_api_spec.rb @@ -0,0 +1,82 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for SwaggerClient::SmartHTTPApi +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'SmartHTTPApi' do + before do + # run before each test + @instance = SwaggerClient::SmartHTTPApi.new + end + + after do + # run after each test + end + + describe 'test an instance of SmartHTTPApi' do + it 'should create an instact of SmartHTTPApi' do + expect(@instance).to be_instance_of(SwaggerClient::SmartHTTPApi) + end + end + + # unit tests for info_refs_receive_pack + # The response body for GET /info/refs?service=git-receive-pack + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyInfoRefsResponse] + describe 'info_refs_receive_pack test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for info_refs_upload_pack + # The response body for GET /info/refs?service=git-upload-pack + # + # @param body + # @param [Hash] opts the optional parameters + # @return [GitalyInfoRefsResponse] + describe 'info_refs_upload_pack test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for post_receive_pack + # Request and response body for POST /receive-pack + # + # @param body (streaming inputs) + # @param [Hash] opts the optional parameters + # @return [GitalyPostReceivePackResponse] + describe 'post_receive_pack test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for post_upload_pack + # Request and response body for POST /upload-pack + # + # @param body (streaming inputs) + # @param [Hash] opts the optional parameters + # @return [GitalyPostUploadPackResponse] + describe 'post_upload_pack test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/ruby_swagger/spec/api/ssh_api_spec.rb b/ruby_swagger/spec/api/ssh_api_spec.rb new file mode 100644 index 00000000..3f3784be --- /dev/null +++ b/ruby_swagger/spec/api/ssh_api_spec.rb @@ -0,0 +1,58 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for SwaggerClient::SSHApi +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'SSHApi' do + before do + # run before each test + @instance = SwaggerClient::SSHApi.new + end + + after do + # run after each test + end + + describe 'test an instance of SSHApi' do + it 'should create an instact of SSHApi' do + expect(@instance).to be_instance_of(SwaggerClient::SSHApi) + end + end + + # unit tests for s_sh_receive_pack + # To forward 'git receive-pack' to Gitaly for SSH sessions + # + # @param body (streaming inputs) + # @param [Hash] opts the optional parameters + # @return [GitalySSHReceivePackResponse] + describe 's_sh_receive_pack test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for s_sh_upload_pack + # To forward 'git upload-pack' to Gitaly for SSH sessions + # + # @param body (streaming inputs) + # @param [Hash] opts the optional parameters + # @return [GitalySSHUploadPackResponse] + describe 's_sh_upload_pack test' do + it "should work" do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/ruby_swagger/spec/api_client_spec.rb b/ruby_swagger/spec/api_client_spec.rb new file mode 100644 index 00000000..3d072b20 --- /dev/null +++ b/ruby_swagger/spec/api_client_spec.rb @@ -0,0 +1,225 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' + +describe SwaggerClient::ApiClient do + context 'initialization' do + context 'URL stuff' do + context 'host' do + it 'removes http from host' do + SwaggerClient.configure { |c| c.host = 'http://example.com' } + expect(SwaggerClient::Configuration.default.host).to eq('example.com') + end + + it 'removes https from host' do + SwaggerClient.configure { |c| c.host = 'https://wookiee.com' } + expect(SwaggerClient::ApiClient.default.config.host).to eq('wookiee.com') + end + + it 'removes trailing path from host' do + SwaggerClient.configure { |c| c.host = 'hobo.com/v4' } + expect(SwaggerClient::Configuration.default.host).to eq('hobo.com') + end + end + + context 'base_path' do + it "prepends a slash to base_path" do + SwaggerClient.configure { |c| c.base_path = 'v4/dog' } + expect(SwaggerClient::Configuration.default.base_path).to eq('/v4/dog') + end + + it "doesn't prepend a slash if one is already there" do + SwaggerClient.configure { |c| c.base_path = '/v4/dog' } + expect(SwaggerClient::Configuration.default.base_path).to eq('/v4/dog') + end + + it "ends up as a blank string if nil" do + SwaggerClient.configure { |c| c.base_path = nil } + expect(SwaggerClient::Configuration.default.base_path).to eq('') + end + end + end + end + + describe "params_encoding in #build_request" do + let(:config) { SwaggerClient::Configuration.new } + let(:api_client) { SwaggerClient::ApiClient.new(config) } + + it "defaults to nil" do + expect(SwaggerClient::Configuration.default.params_encoding).to eq(nil) + expect(config.params_encoding).to eq(nil) + + request = api_client.build_request(:get, '/test') + expect(request.options[:params_encoding]).to eq(nil) + end + + it "can be customized" do + config.params_encoding = :multi + request = api_client.build_request(:get, '/test') + expect(request.options[:params_encoding]).to eq(:multi) + end + end + + describe "timeout in #build_request" do + let(:config) { SwaggerClient::Configuration.new } + let(:api_client) { SwaggerClient::ApiClient.new(config) } + + it "defaults to 0" do + expect(SwaggerClient::Configuration.default.timeout).to eq(0) + expect(config.timeout).to eq(0) + + request = api_client.build_request(:get, '/test') + expect(request.options[:timeout]).to eq(0) + end + + it "can be customized" do + config.timeout = 100 + request = api_client.build_request(:get, '/test') + expect(request.options[:timeout]).to eq(100) + end + end + + describe "#deserialize" do + it "handles Array" do + api_client = SwaggerClient::ApiClient.new + headers = {'Content-Type' => 'application/json'} + response = double('response', headers: headers, body: '[12, 34]') + data = api_client.deserialize(response, 'Array') + expect(data).to be_instance_of(Array) + expect(data).to eq([12, 34]) + end + + it "handles Array>" do + api_client = SwaggerClient::ApiClient.new + headers = {'Content-Type' => 'application/json'} + response = double('response', headers: headers, body: '[[12, 34], [56]]') + data = api_client.deserialize(response, 'Array>') + expect(data).to be_instance_of(Array) + expect(data).to eq([[12, 34], [56]]) + end + + it "handles Hash" do + api_client = SwaggerClient::ApiClient.new + headers = {'Content-Type' => 'application/json'} + response = double('response', headers: headers, body: '{"message": "Hello"}') + data = api_client.deserialize(response, 'Hash') + expect(data).to be_instance_of(Hash) + expect(data).to eq({:message => 'Hello'}) + end + end + + describe "#object_to_hash" do + it "ignores nils and includes empty arrays" do + # uncomment below to test object_to_hash for model + #api_client = SwaggerClient::ApiClient.new + #_model = SwaggerClient::ModelName.new + # update the model attribute below + #_model.id = 1 + # update the expected value (hash) below + #expected = {id: 1, name: '', tags: []} + #expect(api_client.object_to_hash(_model)).to eq(expected) + end + end + + describe "#build_collection_param" do + let(:param) { ['aa', 'bb', 'cc'] } + let(:api_client) { SwaggerClient::ApiClient.new } + + it "works for csv" do + expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc') + end + + it "works for ssv" do + expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc') + end + + it "works for tsv" do + expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc") + end + + it "works for pipes" do + expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc') + end + + it "works for multi" do + expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc']) + end + + it "fails for invalid collection format" do + expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID') + end + end + + describe "#json_mime?" do + let(:api_client) { SwaggerClient::ApiClient.new } + + it "works" do + expect(api_client.json_mime?(nil)).to eq false + expect(api_client.json_mime?('')).to eq false + + expect(api_client.json_mime?('application/json')).to eq true + expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true + expect(api_client.json_mime?('APPLICATION/JSON')).to eq true + + expect(api_client.json_mime?('application/xml')).to eq false + expect(api_client.json_mime?('text/plain')).to eq false + expect(api_client.json_mime?('application/jsonp')).to eq false + end + end + + describe "#select_header_accept" do + let(:api_client) { SwaggerClient::ApiClient.new } + + it "works" do + expect(api_client.select_header_accept(nil)).to be_nil + expect(api_client.select_header_accept([])).to be_nil + + expect(api_client.select_header_accept(['application/json'])).to eq('application/json') + expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') + expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') + + expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml') + expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml') + end + end + + describe "#select_header_content_type" do + let(:api_client) { SwaggerClient::ApiClient.new } + + it "works" do + expect(api_client.select_header_content_type(nil)).to eq('application/json') + expect(api_client.select_header_content_type([])).to eq('application/json') + + expect(api_client.select_header_content_type(['application/json'])).to eq('application/json') + expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') + expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') + expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml') + expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain') + end + end + + describe "#sanitize_filename" do + let(:api_client) { SwaggerClient::ApiClient.new } + + it "works" do + expect(api_client.sanitize_filename('sun')).to eq('sun') + expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif') + end + end +end diff --git a/ruby_swagger/spec/configuration_spec.rb b/ruby_swagger/spec/configuration_spec.rb new file mode 100644 index 00000000..de54c11d --- /dev/null +++ b/ruby_swagger/spec/configuration_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' + +describe SwaggerClient::Configuration do + let(:config) { SwaggerClient::Configuration.default } + + before(:each) do + # uncomment below to setup host and base_path + #require 'URI' + #uri = URI.parse("http://localhost") + #SwaggerClient.configure do |c| + # c.host = uri.host + # c.base_path = uri.path + #end + end + + describe '#base_url' do + it 'should have the default value' do + # uncomment below to test default value of the base path + #expect(config.base_url).to eq("http://localhost") + end + + it 'should remove trailing slashes' do + [nil, '', '/', '//'].each do |base_path| + config.base_path = base_path + # uncomment below to test trailing slashes + #expect(config.base_url).to eq("http://localhost") + end + end + end +end diff --git a/ruby_swagger/spec/models/find_local_branches_request_sort_by_spec.rb b/ruby_swagger/spec/models/find_local_branches_request_sort_by_spec.rb new file mode 100644 index 00000000..4ac28130 --- /dev/null +++ b/ruby_swagger/spec/models/find_local_branches_request_sort_by_spec.rb @@ -0,0 +1,35 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::FindLocalBranchesRequestSortBy +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'FindLocalBranchesRequestSortBy' do + before do + # run before each test + @instance = SwaggerClient::FindLocalBranchesRequestSortBy.new + end + + after do + # run after each test + end + + describe 'test an instance of FindLocalBranchesRequestSortBy' do + it 'should create an instact of FindLocalBranchesRequestSortBy' do + expect(@instance).to be_instance_of(SwaggerClient::FindLocalBranchesRequestSortBy) + end + end +end + diff --git a/ruby_swagger/spec/models/gitaly_commit_diff_request_spec.rb b/ruby_swagger/spec/models/gitaly_commit_diff_request_spec.rb new file mode 100644 index 00000000..cfa41508 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_commit_diff_request_spec.rb @@ -0,0 +1,53 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyCommitDiffRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyCommitDiffRequest' do + before do + # run before each test + @instance = SwaggerClient::GitalyCommitDiffRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyCommitDiffRequest' do + it 'should create an instact of GitalyCommitDiffRequest' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyCommitDiffRequest) + end + end + describe 'test attribute "repository"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "left_commit_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "right_commit_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_commit_diff_response_spec.rb b/ruby_swagger/spec/models/gitaly_commit_diff_response_spec.rb new file mode 100644 index 00000000..ef1c8d7a --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_commit_diff_response_spec.rb @@ -0,0 +1,83 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyCommitDiffResponse +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyCommitDiffResponse' do + before do + # run before each test + @instance = SwaggerClient::GitalyCommitDiffResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyCommitDiffResponse' do + it 'should create an instact of GitalyCommitDiffResponse' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyCommitDiffResponse) + end + end + describe 'test attribute "from_path"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to_path"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "from_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "old_mode"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "new_mode"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "binary"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "raw_chunks"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_commit_is_ancestor_request_spec.rb b/ruby_swagger/spec/models/gitaly_commit_is_ancestor_request_spec.rb new file mode 100644 index 00000000..92c2f06c --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_commit_is_ancestor_request_spec.rb @@ -0,0 +1,53 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyCommitIsAncestorRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyCommitIsAncestorRequest' do + before do + # run before each test + @instance = SwaggerClient::GitalyCommitIsAncestorRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyCommitIsAncestorRequest' do + it 'should create an instact of GitalyCommitIsAncestorRequest' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyCommitIsAncestorRequest) + end + end + describe 'test attribute "repository"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "ancestor_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "child_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_commit_is_ancestor_response_spec.rb b/ruby_swagger/spec/models/gitaly_commit_is_ancestor_response_spec.rb new file mode 100644 index 00000000..b467f6bc --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_commit_is_ancestor_response_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyCommitIsAncestorResponse +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyCommitIsAncestorResponse' do + before do + # run before each test + @instance = SwaggerClient::GitalyCommitIsAncestorResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyCommitIsAncestorResponse' do + it 'should create an instact of GitalyCommitIsAncestorResponse' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyCommitIsAncestorResponse) + end + end + describe 'test attribute "value"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_exit_status_spec.rb b/ruby_swagger/spec/models/gitaly_exit_status_spec.rb new file mode 100644 index 00000000..6e0e9f37 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_exit_status_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyExitStatus +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyExitStatus' do + before do + # run before each test + @instance = SwaggerClient::GitalyExitStatus.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyExitStatus' do + it 'should create an instact of GitalyExitStatus' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyExitStatus) + end + end + describe 'test attribute "value"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_find_all_branch_names_request_spec.rb b/ruby_swagger/spec/models/gitaly_find_all_branch_names_request_spec.rb new file mode 100644 index 00000000..a2da5263 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_find_all_branch_names_request_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyFindAllBranchNamesRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyFindAllBranchNamesRequest' do + before do + # run before each test + @instance = SwaggerClient::GitalyFindAllBranchNamesRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyFindAllBranchNamesRequest' do + it 'should create an instact of GitalyFindAllBranchNamesRequest' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyFindAllBranchNamesRequest) + end + end + describe 'test attribute "repository"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_find_all_branch_names_response_spec.rb b/ruby_swagger/spec/models/gitaly_find_all_branch_names_response_spec.rb new file mode 100644 index 00000000..c2c2f47d --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_find_all_branch_names_response_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyFindAllBranchNamesResponse +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyFindAllBranchNamesResponse' do + before do + # run before each test + @instance = SwaggerClient::GitalyFindAllBranchNamesResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyFindAllBranchNamesResponse' do + it 'should create an instact of GitalyFindAllBranchNamesResponse' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyFindAllBranchNamesResponse) + end + end + describe 'test attribute "names"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_find_all_tag_names_request_spec.rb b/ruby_swagger/spec/models/gitaly_find_all_tag_names_request_spec.rb new file mode 100644 index 00000000..55f31983 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_find_all_tag_names_request_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyFindAllTagNamesRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyFindAllTagNamesRequest' do + before do + # run before each test + @instance = SwaggerClient::GitalyFindAllTagNamesRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyFindAllTagNamesRequest' do + it 'should create an instact of GitalyFindAllTagNamesRequest' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyFindAllTagNamesRequest) + end + end + describe 'test attribute "repository"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_find_all_tag_names_response_spec.rb b/ruby_swagger/spec/models/gitaly_find_all_tag_names_response_spec.rb new file mode 100644 index 00000000..a99843a4 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_find_all_tag_names_response_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyFindAllTagNamesResponse +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyFindAllTagNamesResponse' do + before do + # run before each test + @instance = SwaggerClient::GitalyFindAllTagNamesResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyFindAllTagNamesResponse' do + it 'should create an instact of GitalyFindAllTagNamesResponse' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyFindAllTagNamesResponse) + end + end + describe 'test attribute "names"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_find_default_branch_name_request_spec.rb b/ruby_swagger/spec/models/gitaly_find_default_branch_name_request_spec.rb new file mode 100644 index 00000000..fe34db39 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_find_default_branch_name_request_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyFindDefaultBranchNameRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyFindDefaultBranchNameRequest' do + before do + # run before each test + @instance = SwaggerClient::GitalyFindDefaultBranchNameRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyFindDefaultBranchNameRequest' do + it 'should create an instact of GitalyFindDefaultBranchNameRequest' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyFindDefaultBranchNameRequest) + end + end + describe 'test attribute "repository"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_find_default_branch_name_response_spec.rb b/ruby_swagger/spec/models/gitaly_find_default_branch_name_response_spec.rb new file mode 100644 index 00000000..3affeb61 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_find_default_branch_name_response_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyFindDefaultBranchNameResponse +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyFindDefaultBranchNameResponse' do + before do + # run before each test + @instance = SwaggerClient::GitalyFindDefaultBranchNameResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyFindDefaultBranchNameResponse' do + it 'should create an instact of GitalyFindDefaultBranchNameResponse' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyFindDefaultBranchNameResponse) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_find_local_branch_commit_author_spec.rb b/ruby_swagger/spec/models/gitaly_find_local_branch_commit_author_spec.rb new file mode 100644 index 00000000..8470f734 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_find_local_branch_commit_author_spec.rb @@ -0,0 +1,53 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyFindLocalBranchCommitAuthor +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyFindLocalBranchCommitAuthor' do + before do + # run before each test + @instance = SwaggerClient::GitalyFindLocalBranchCommitAuthor.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyFindLocalBranchCommitAuthor' do + it 'should create an instact of GitalyFindLocalBranchCommitAuthor' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyFindLocalBranchCommitAuthor) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "email"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_find_local_branch_response_spec.rb b/ruby_swagger/spec/models/gitaly_find_local_branch_response_spec.rb new file mode 100644 index 00000000..61bb80cf --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_find_local_branch_response_spec.rb @@ -0,0 +1,65 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyFindLocalBranchResponse +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyFindLocalBranchResponse' do + before do + # run before each test + @instance = SwaggerClient::GitalyFindLocalBranchResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyFindLocalBranchResponse' do + it 'should create an instact of GitalyFindLocalBranchResponse' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyFindLocalBranchResponse) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "commit_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "commit_subject"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "commit_author"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "commit_committer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_find_local_branches_request_spec.rb b/ruby_swagger/spec/models/gitaly_find_local_branches_request_spec.rb new file mode 100644 index 00000000..b2d09a02 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_find_local_branches_request_spec.rb @@ -0,0 +1,47 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyFindLocalBranchesRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyFindLocalBranchesRequest' do + before do + # run before each test + @instance = SwaggerClient::GitalyFindLocalBranchesRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyFindLocalBranchesRequest' do + it 'should create an instact of GitalyFindLocalBranchesRequest' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyFindLocalBranchesRequest) + end + end + describe 'test attribute "repository"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sort_by"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_find_local_branches_response_spec.rb b/ruby_swagger/spec/models/gitaly_find_local_branches_response_spec.rb new file mode 100644 index 00000000..3cfaa3df --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_find_local_branches_response_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyFindLocalBranchesResponse +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyFindLocalBranchesResponse' do + before do + # run before each test + @instance = SwaggerClient::GitalyFindLocalBranchesResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyFindLocalBranchesResponse' do + it 'should create an instact of GitalyFindLocalBranchesResponse' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyFindLocalBranchesResponse) + end + end + describe 'test attribute "branches"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_find_ref_name_request_spec.rb b/ruby_swagger/spec/models/gitaly_find_ref_name_request_spec.rb new file mode 100644 index 00000000..d7fcc6fa --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_find_ref_name_request_spec.rb @@ -0,0 +1,53 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyFindRefNameRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyFindRefNameRequest' do + before do + # run before each test + @instance = SwaggerClient::GitalyFindRefNameRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyFindRefNameRequest' do + it 'should create an instact of GitalyFindRefNameRequest' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyFindRefNameRequest) + end + end + describe 'test attribute "repository"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "commit_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prefix"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_find_ref_name_response_spec.rb b/ruby_swagger/spec/models/gitaly_find_ref_name_response_spec.rb new file mode 100644 index 00000000..54dab3b8 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_find_ref_name_response_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyFindRefNameResponse +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyFindRefNameResponse' do + before do + # run before each test + @instance = SwaggerClient::GitalyFindRefNameResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyFindRefNameResponse' do + it 'should create an instact of GitalyFindRefNameResponse' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyFindRefNameResponse) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_info_refs_request_spec.rb b/ruby_swagger/spec/models/gitaly_info_refs_request_spec.rb new file mode 100644 index 00000000..ce345a64 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_info_refs_request_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyInfoRefsRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyInfoRefsRequest' do + before do + # run before each test + @instance = SwaggerClient::GitalyInfoRefsRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyInfoRefsRequest' do + it 'should create an instact of GitalyInfoRefsRequest' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyInfoRefsRequest) + end + end + describe 'test attribute "repository"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_info_refs_response_spec.rb b/ruby_swagger/spec/models/gitaly_info_refs_response_spec.rb new file mode 100644 index 00000000..5fd0b11f --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_info_refs_response_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyInfoRefsResponse +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyInfoRefsResponse' do + before do + # run before each test + @instance = SwaggerClient::GitalyInfoRefsResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyInfoRefsResponse' do + it 'should create an instact of GitalyInfoRefsResponse' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyInfoRefsResponse) + end + end + describe 'test attribute "data"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_post_receive_pack_request_spec.rb b/ruby_swagger/spec/models/gitaly_post_receive_pack_request_spec.rb new file mode 100644 index 00000000..881ce8cc --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_post_receive_pack_request_spec.rb @@ -0,0 +1,53 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyPostReceivePackRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyPostReceivePackRequest' do + before do + # run before each test + @instance = SwaggerClient::GitalyPostReceivePackRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyPostReceivePackRequest' do + it 'should create an instact of GitalyPostReceivePackRequest' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyPostReceivePackRequest) + end + end + describe 'test attribute "repository"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "data"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "gl_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_post_receive_pack_response_spec.rb b/ruby_swagger/spec/models/gitaly_post_receive_pack_response_spec.rb new file mode 100644 index 00000000..da6dd642 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_post_receive_pack_response_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyPostReceivePackResponse +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyPostReceivePackResponse' do + before do + # run before each test + @instance = SwaggerClient::GitalyPostReceivePackResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyPostReceivePackResponse' do + it 'should create an instact of GitalyPostReceivePackResponse' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyPostReceivePackResponse) + end + end + describe 'test attribute "data"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_post_receive_request_spec.rb b/ruby_swagger/spec/models/gitaly_post_receive_request_spec.rb new file mode 100644 index 00000000..a096ffa9 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_post_receive_request_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyPostReceiveRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyPostReceiveRequest' do + before do + # run before each test + @instance = SwaggerClient::GitalyPostReceiveRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyPostReceiveRequest' do + it 'should create an instact of GitalyPostReceiveRequest' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyPostReceiveRequest) + end + end + describe 'test attribute "repository"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_post_receive_response_spec.rb b/ruby_swagger/spec/models/gitaly_post_receive_response_spec.rb new file mode 100644 index 00000000..e9aad213 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_post_receive_response_spec.rb @@ -0,0 +1,35 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyPostReceiveResponse +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyPostReceiveResponse' do + before do + # run before each test + @instance = SwaggerClient::GitalyPostReceiveResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyPostReceiveResponse' do + it 'should create an instact of GitalyPostReceiveResponse' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyPostReceiveResponse) + end + end +end + diff --git a/ruby_swagger/spec/models/gitaly_post_upload_pack_request_spec.rb b/ruby_swagger/spec/models/gitaly_post_upload_pack_request_spec.rb new file mode 100644 index 00000000..d69b5045 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_post_upload_pack_request_spec.rb @@ -0,0 +1,47 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyPostUploadPackRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyPostUploadPackRequest' do + before do + # run before each test + @instance = SwaggerClient::GitalyPostUploadPackRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyPostUploadPackRequest' do + it 'should create an instact of GitalyPostUploadPackRequest' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyPostUploadPackRequest) + end + end + describe 'test attribute "repository"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "data"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_post_upload_pack_response_spec.rb b/ruby_swagger/spec/models/gitaly_post_upload_pack_response_spec.rb new file mode 100644 index 00000000..5dcbd7e5 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_post_upload_pack_response_spec.rb @@ -0,0 +1,41 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyPostUploadPackResponse +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyPostUploadPackResponse' do + before do + # run before each test + @instance = SwaggerClient::GitalyPostUploadPackResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyPostUploadPackResponse' do + it 'should create an instact of GitalyPostUploadPackResponse' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyPostUploadPackResponse) + end + end + describe 'test attribute "data"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_repository_spec.rb b/ruby_swagger/spec/models/gitaly_repository_spec.rb new file mode 100644 index 00000000..e37b5284 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_repository_spec.rb @@ -0,0 +1,53 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalyRepository +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalyRepository' do + before do + # run before each test + @instance = SwaggerClient::GitalyRepository.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalyRepository' do + it 'should create an instact of GitalyRepository' do + expect(@instance).to be_instance_of(SwaggerClient::GitalyRepository) + end + end + describe 'test attribute "path"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "storage_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "relative_path"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_ssh_receive_pack_request_spec.rb b/ruby_swagger/spec/models/gitaly_ssh_receive_pack_request_spec.rb new file mode 100644 index 00000000..d8ab7418 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_ssh_receive_pack_request_spec.rb @@ -0,0 +1,53 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalySSHReceivePackRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalySSHReceivePackRequest' do + before do + # run before each test + @instance = SwaggerClient::GitalySSHReceivePackRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalySSHReceivePackRequest' do + it 'should create an instact of GitalySSHReceivePackRequest' do + expect(@instance).to be_instance_of(SwaggerClient::GitalySSHReceivePackRequest) + end + end + describe 'test attribute "repository"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "stdin"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "gl_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_ssh_receive_pack_response_spec.rb b/ruby_swagger/spec/models/gitaly_ssh_receive_pack_response_spec.rb new file mode 100644 index 00000000..8adec843 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_ssh_receive_pack_response_spec.rb @@ -0,0 +1,53 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalySSHReceivePackResponse +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalySSHReceivePackResponse' do + before do + # run before each test + @instance = SwaggerClient::GitalySSHReceivePackResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalySSHReceivePackResponse' do + it 'should create an instact of GitalySSHReceivePackResponse' do + expect(@instance).to be_instance_of(SwaggerClient::GitalySSHReceivePackResponse) + end + end + describe 'test attribute "stdout"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "stderr"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "exit_status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_ssh_upload_pack_request_spec.rb b/ruby_swagger/spec/models/gitaly_ssh_upload_pack_request_spec.rb new file mode 100644 index 00000000..3ad9dc87 --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_ssh_upload_pack_request_spec.rb @@ -0,0 +1,47 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalySSHUploadPackRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalySSHUploadPackRequest' do + before do + # run before each test + @instance = SwaggerClient::GitalySSHUploadPackRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalySSHUploadPackRequest' do + it 'should create an instact of GitalySSHUploadPackRequest' do + expect(@instance).to be_instance_of(SwaggerClient::GitalySSHUploadPackRequest) + end + end + describe 'test attribute "repository"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "stdin"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/models/gitaly_ssh_upload_pack_response_spec.rb b/ruby_swagger/spec/models/gitaly_ssh_upload_pack_response_spec.rb new file mode 100644 index 00000000..cc6f733c --- /dev/null +++ b/ruby_swagger/spec/models/gitaly_ssh_upload_pack_response_spec.rb @@ -0,0 +1,53 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SwaggerClient::GitalySSHUploadPackResponse +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'GitalySSHUploadPackResponse' do + before do + # run before each test + @instance = SwaggerClient::GitalySSHUploadPackResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of GitalySSHUploadPackResponse' do + it 'should create an instact of GitalySSHUploadPackResponse' do + expect(@instance).to be_instance_of(SwaggerClient::GitalySSHUploadPackResponse) + end + end + describe 'test attribute "stdout"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "stderr"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "exit_status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/ruby_swagger/spec/spec_helper.rb b/ruby_swagger/spec/spec_helper.rb new file mode 100644 index 00000000..081d419a --- /dev/null +++ b/ruby_swagger/spec/spec_helper.rb @@ -0,0 +1,110 @@ +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +# load the gem +require 'swagger_client' + +# The following was generated by the `rspec --init` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # These two settings work together to allow you to limit a spec run + # to individual examples or groups you care about by tagging them with + # `:focus` metadata. When nothing is tagged with `:focus`, all examples + # get run. + config.filter_run :focus + config.run_all_when_everything_filtered = true + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + config.disable_monkey_patching! + + # This setting enables warnings. It's recommended, but in some cases may + # be too noisy due to issues in dependencies. + config.warnings = true + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end diff --git a/ruby_swagger/swagger_client.gemspec b/ruby_swagger/swagger_client.gemspec new file mode 100644 index 00000000..631cc8ce --- /dev/null +++ b/ruby_swagger/swagger_client.gemspec @@ -0,0 +1,45 @@ +# -*- encoding: utf-8 -*- +# +=begin +#commit.proto + +#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: version not set + +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +$:.push File.expand_path("../lib", __FILE__) +require "swagger_client/version" + +Gem::Specification.new do |s| + s.name = "swagger_client" + s.version = SwaggerClient::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["Swagger-Codegen"] + s.email = [""] + s.homepage = "https://github.com/swagger-api/swagger-codegen" + s.summary = "commit.proto Ruby Gem" + s.description = "No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)" + # TODO uncommnet and update below with a proper license + #s.license = "Apache 2.0" + s.required_ruby_version = ">= 1.9" + + s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' + s.add_runtime_dependency 'json', '~> 1.8', '>= 1.8.3' + + s.add_development_dependency 'rspec', '~> 3.4', '>= 3.4.0' + s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' + s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' + s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' + s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2' + s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' + s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.11' + + s.files = `find *`.split("\n").uniq.sort.select{|f| !f.empty? } + s.test_files = `find spec/*`.split("\n") + s.executables = [] + s.require_paths = ["lib"] +end diff --git a/swagger/main.json b/swagger/main.json new file mode 100644 index 00000000..065acbf6 --- /dev/null +++ b/swagger/main.json @@ -0,0 +1,802 @@ +{ + "swagger": "2.0", + "info": { + "title": "commit.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/ssh/ssh_receive_pack": { + "post": { + "summary": "To forward 'git receive-pack' to Gitaly for SSH sessions", + "operationId": "SSHReceivePack", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalySSHReceivePackResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "(streaming inputs)", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalySSHReceivePackRequest" + } + } + ], + "tags": [ + "SSH" + ] + } + }, + "/v1/ssh/ssh_upload_pack": { + "post": { + "summary": "To forward 'git upload-pack' to Gitaly for SSH sessions", + "operationId": "SSHUploadPack", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalySSHUploadPackResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "(streaming inputs)", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalySSHUploadPackRequest" + } + } + ], + "tags": [ + "SSH" + ] + } + }, + "/v1/smart_http/info_refs_receive_pack": { + "post": { + "summary": "The response body for GET /info/refs?service=git-receive-pack", + "operationId": "InfoRefsReceivePack", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyInfoRefsResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyInfoRefsRequest" + } + } + ], + "tags": [ + "SmartHTTP" + ] + } + }, + "/v1/smart_http/info_refs_upload_pack": { + "post": { + "summary": "The response body for GET /info/refs?service=git-upload-pack", + "operationId": "InfoRefsUploadPack", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyInfoRefsResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyInfoRefsRequest" + } + } + ], + "tags": [ + "SmartHTTP" + ] + } + }, + "/v1/smart_http/post_receive_pack": { + "post": { + "summary": "Request and response body for POST /receive-pack", + "operationId": "PostReceivePack", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyPostReceivePackResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "(streaming inputs)", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyPostReceivePackRequest" + } + } + ], + "tags": [ + "SmartHTTP" + ] + } + }, + "/v1/smart_http/post_upload_pack": { + "post": { + "summary": "Request and response body for POST /upload-pack", + "operationId": "PostUploadPack", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyPostUploadPackResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "description": "(streaming inputs)", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyPostUploadPackRequest" + } + } + ], + "tags": [ + "SmartHTTP" + ] + } + }, + "/v1/ref/find_all_branch_names": { + "post": { + "operationId": "FindAllBranchNames", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyFindAllBranchNamesResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyFindAllBranchNamesRequest" + } + } + ], + "tags": [ + "Ref" + ] + } + }, + "/v1/ref/find_all_tag_names": { + "post": { + "operationId": "FindAllTagNames", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyFindAllTagNamesResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyFindAllTagNamesRequest" + } + } + ], + "tags": [ + "Ref" + ] + } + }, + "/v1/ref/find_default_branch_name": { + "post": { + "operationId": "FindDefaultBranchName", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/gitalyFindDefaultBranchNameResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyFindDefaultBranchNameRequest" + } + } + ], + "tags": [ + "Ref" + ] + } + }, + "/v1/ref/find_local_branches": { + "post": { + "summary": "Return a stream so we can divide the response in chunks of branches", + "operationId": "FindLocalBranches", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyFindLocalBranchesResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyFindLocalBranchesRequest" + } + } + ], + "tags": [ + "Ref" + ] + } + }, + "/v1/ref/find_ref_name": { + "post": { + "summary": "Find a Ref matching the given constraints. Response may be empty.", + "operationId": "FindRefName", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/gitalyFindRefNameResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyFindRefNameRequest" + } + } + ], + "tags": [ + "Ref" + ] + } + }, + "/v1/notification/post_receive": { + "post": { + "operationId": "PostReceive", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/gitalyPostReceiveResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyPostReceiveRequest" + } + } + ], + "tags": [ + "Notifications" + ] + } + }, + "/v1/diff/commit_diff": { + "post": { + "summary": "Returns stream of CommitDiffResponse: 1 per changed file", + "operationId": "CommitDiff", + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/gitalyCommitDiffResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyCommitDiffRequest" + } + } + ], + "tags": [ + "Diff" + ] + } + }, + "/v1/commit/commit_is_ancestor": { + "post": { + "operationId": "CommitIsAncestor", + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/gitalyCommitIsAncestorResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/gitalyCommitIsAncestorRequest" + } + } + ], + "tags": [ + "Commit" + ] + } + } + }, + "definitions": { + "gitalyExitStatus": { + "type": "object", + "properties": { + "value": { + "type": "integer", + "format": "int32" + } + } + }, + "gitalyRepository": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "storage_name": { + "type": "string" + }, + "relative_path": { + "type": "string" + } + } + }, + "gitalySSHReceivePackRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository", + "description": "'repository' must be present in the first message." + }, + "stdin": { + "type": "string", + "format": "byte", + "title": "A chunk of raw data to be copied to 'git upload-pack' standard input" + }, + "gl_id": { + "type": "string", + "title": "Contents of GL_ID environment variable for 'git receive-pack'" + } + } + }, + "gitalySSHReceivePackResponse": { + "type": "object", + "properties": { + "stdout": { + "type": "string", + "format": "byte", + "title": "A chunk of raw data from 'git receive-pack' standard output" + }, + "stderr": { + "type": "string", + "format": "byte", + "title": "A chunk of raw data from 'git receive-pack' standard error" + }, + "exit_status": { + "$ref": "#/definitions/gitalyExitStatus", + "description": "This field may be nil. This is intentional: only when the remote\ncommand has finished can we return its exit status." + } + } + }, + "gitalySSHUploadPackRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository", + "description": "'repository' must be present in the first message." + }, + "stdin": { + "type": "string", + "format": "byte", + "title": "A chunk of raw data to be copied to 'git upload-pack' standard input" + } + } + }, + "gitalySSHUploadPackResponse": { + "type": "object", + "properties": { + "stdout": { + "type": "string", + "format": "byte", + "title": "A chunk of raw data from 'git upload-pack' standard output" + }, + "stderr": { + "type": "string", + "format": "byte", + "title": "A chunk of raw data from 'git upload-pack' standard error" + }, + "exit_status": { + "$ref": "#/definitions/gitalyExitStatus", + "description": "This field may be nil. This is intentional: only when the remote\ncommand has finished can we return its exit status." + } + } + }, + "gitalyInfoRefsRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + } + } + }, + "gitalyInfoRefsResponse": { + "type": "object", + "properties": { + "data": { + "type": "string", + "format": "byte" + } + } + }, + "gitalyPostReceivePackRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository", + "title": "repository should only be present in the first message of the stream" + }, + "data": { + "type": "string", + "format": "byte", + "title": "Raw data to be copied to stdin of 'git receive-pack'" + }, + "gl_id": { + "type": "string", + "description": "gl_id becomes env variable GL_ID, used by the Git {pre,post}-receive\nhooks. Should only be present in the first message of the stream." + } + } + }, + "gitalyPostReceivePackResponse": { + "type": "object", + "properties": { + "data": { + "type": "string", + "format": "byte", + "title": "Raw data from stdout of 'git receive-pack'" + } + } + }, + "gitalyPostUploadPackRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository", + "title": "repository should only be present in the first message of the stream" + }, + "data": { + "type": "string", + "format": "byte", + "title": "Raw data to be copied to stdin of 'git upload-pack'" + } + } + }, + "gitalyPostUploadPackResponse": { + "type": "object", + "properties": { + "data": { + "type": "string", + "format": "byte", + "title": "Raw data from stdout of 'git upload-pack'" + } + } + }, + "FindLocalBranchesRequestSortBy": { + "type": "string", + "enum": [ + "NAME", + "UPDATED_ASC", + "UPDATED_DESC" + ], + "default": "NAME" + }, + "gitalyFindAllBranchNamesRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + } + } + }, + "gitalyFindAllBranchNamesResponse": { + "type": "object", + "properties": { + "names": { + "type": "array", + "items": { + "type": "string", + "format": "byte" + } + } + } + }, + "gitalyFindAllTagNamesRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + } + } + }, + "gitalyFindAllTagNamesResponse": { + "type": "object", + "properties": { + "names": { + "type": "array", + "items": { + "type": "string", + "format": "byte" + } + } + } + }, + "gitalyFindDefaultBranchNameRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + } + } + }, + "gitalyFindDefaultBranchNameResponse": { + "type": "object", + "properties": { + "name": { + "type": "string", + "format": "byte" + } + } + }, + "gitalyFindLocalBranchCommitAuthor": { + "type": "object", + "properties": { + "name": { + "type": "string", + "format": "byte" + }, + "email": { + "type": "string", + "format": "byte" + }, + "date": { + "type": "string", + "format": "date-time" + } + } + }, + "gitalyFindLocalBranchResponse": { + "type": "object", + "properties": { + "name": { + "type": "string", + "format": "byte" + }, + "commit_id": { + "type": "string" + }, + "commit_subject": { + "type": "string", + "format": "byte" + }, + "commit_author": { + "$ref": "#/definitions/gitalyFindLocalBranchCommitAuthor" + }, + "commit_committer": { + "$ref": "#/definitions/gitalyFindLocalBranchCommitAuthor" + } + } + }, + "gitalyFindLocalBranchesRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + }, + "sort_by": { + "$ref": "#/definitions/FindLocalBranchesRequestSortBy" + } + } + }, + "gitalyFindLocalBranchesResponse": { + "type": "object", + "properties": { + "branches": { + "type": "array", + "items": { + "$ref": "#/definitions/gitalyFindLocalBranchResponse" + } + } + } + }, + "gitalyFindRefNameRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + }, + "commit_id": { + "type": "string", + "title": "Require that the resulting ref contains this commit as an ancestor" + }, + "prefix": { + "type": "string", + "format": "byte", + "description": "Example prefix: \"refs/heads/\". Type bytes because that is the type of ref names." + } + } + }, + "gitalyFindRefNameResponse": { + "type": "object", + "properties": { + "name": { + "type": "string", + "format": "byte", + "description": "Example name: \"refs/heads/master\". Cannot assume UTF8, so the type is bytes." + } + } + }, + "gitalyPostReceiveRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + } + } + }, + "gitalyPostReceiveResponse": { + "type": "object" + }, + "gitalyCommitDiffRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + }, + "left_commit_id": { + "type": "string" + }, + "right_commit_id": { + "type": "string" + } + } + }, + "gitalyCommitDiffResponse": { + "type": "object", + "properties": { + "from_path": { + "type": "string", + "format": "byte" + }, + "to_path": { + "type": "string", + "format": "byte" + }, + "from_id": { + "type": "string", + "title": "Blob ID as returned via `git diff --full-index`" + }, + "to_id": { + "type": "string" + }, + "old_mode": { + "type": "integer", + "format": "int32" + }, + "new_mode": { + "type": "integer", + "format": "int32" + }, + "binary": { + "type": "boolean", + "format": "boolean" + }, + "raw_chunks": { + "type": "array", + "items": { + "type": "string", + "format": "byte" + } + } + }, + "description": "A CommitDiffResponse corresponds to a single changed file in a commit." + }, + "gitalyCommitIsAncestorRequest": { + "type": "object", + "properties": { + "repository": { + "$ref": "#/definitions/gitalyRepository" + }, + "ancestor_id": { + "type": "string" + }, + "child_id": { + "type": "string" + } + } + }, + "gitalyCommitIsAncestorResponse": { + "type": "object", + "properties": { + "value": { + "type": "boolean", + "format": "boolean" + } + } + } + } +} -- GitLab