radar-api 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: c46440edbefb015c555f89ce94dc47bc935e39f17bb970c8a4d100f45308371d
4
- data.tar.gz: 43c82a1c5486631a7ac9f396512f82d156e1b118b01d9ba1fcfc63453ebfc9d7
2
+ SHA1:
3
+ metadata.gz: e34bfc0f84962d238bbde3c64398c409b336f351
4
+ data.tar.gz: d25b723a8d6d354ba574da226387706a5a604fbe
5
5
  SHA512:
6
- metadata.gz: aa23f07ea1a461cba09833f7a9bc33db90849047a984abd810bc17c96330d2e39031c99f39a377ababb02b34812823fb7398e159a206675bbbc862fc6ac4cacf
7
- data.tar.gz: bbd8e9d0fd0b86a866ad92676dc4fc9352cb9e66a7fd901ac85d0f9552a8fdbb64b13b72cf2706544547847fc683bb1c41fc2602f8352a9f4d728ee84934493a
6
+ metadata.gz: be6a900209e757a6eb73de1c59aff2b3ee0fdcca0067687fd6f8bd9d7901d62a551cfa306dfd64994a6bfff8e24d753253eaaffd546a8f96dda9d78f75f83c90
7
+ data.tar.gz: 359faca230256d85af90688bb05f9fbd1b75c5225f04cb9116c9a404a8718c121c724329a46a2c5bc3d347434fc15dc8b84475467fd909dce0b724f820f332fb
@@ -13,6 +13,23 @@ module Radar
13
13
  class Client
14
14
  include ::Thrift::Client
15
15
 
16
+ def authenticate(username, password, user)
17
+ send_authenticate(username, password, user)
18
+ return recv_authenticate()
19
+ end
20
+
21
+ def send_authenticate(username, password, user)
22
+ send_message('authenticate', Authenticate_args, :username => username, :password => password, :user => user)
23
+ end
24
+
25
+ def recv_authenticate()
26
+ result = receive_message(Authenticate_result)
27
+ return result.success unless result.success.nil?
28
+ raise result.auth_error unless result.auth_error.nil?
29
+ raise result.system_unavailable unless result.system_unavailable.nil?
30
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'authenticate failed: unknown result')
31
+ end
32
+
16
33
  def fetch(username, password, user, last_transaction_date)
17
34
  send_fetch(username, password, user, last_transaction_date)
18
35
  recv_fetch()
@@ -34,6 +51,19 @@ module Radar
34
51
  class Processor
35
52
  include ::Thrift::Processor
36
53
 
54
+ def process_authenticate(seqid, iprot, oprot)
55
+ args = read_args(iprot, Authenticate_args)
56
+ result = Authenticate_result.new()
57
+ begin
58
+ result.success = @handler.authenticate(args.username, args.password, args.user)
59
+ rescue ::Radar::Api::AuthenticationError => auth_error
60
+ result.auth_error = auth_error
61
+ rescue ::Radar::Api::SystemUnavailableError => system_unavailable
62
+ result.system_unavailable = system_unavailable
63
+ end
64
+ write_result(result, oprot, 'authenticate', seqid)
65
+ end
66
+
37
67
  def process_fetch(seqid, iprot, oprot)
38
68
  args = read_args(iprot, Fetch_args)
39
69
  result = Fetch_result.new()
@@ -51,6 +81,46 @@ module Radar
51
81
 
52
82
  # HELPER FUNCTIONS AND STRUCTURES
53
83
 
84
+ class Authenticate_args
85
+ include ::Thrift::Struct, ::Thrift::Struct_Union
86
+ USERNAME = 1
87
+ PASSWORD = 2
88
+ USER = 3
89
+
90
+ FIELDS = {
91
+ USERNAME => {:type => ::Thrift::Types::STRING, :name => 'username'},
92
+ PASSWORD => {:type => ::Thrift::Types::STRING, :name => 'password'},
93
+ USER => {:type => ::Thrift::Types::STRING, :name => 'user'}
94
+ }
95
+
96
+ def struct_fields; FIELDS; end
97
+
98
+ def validate
99
+ end
100
+
101
+ ::Thrift::Struct.generate_accessors self
102
+ end
103
+
104
+ class Authenticate_result
105
+ include ::Thrift::Struct, ::Thrift::Struct_Union
106
+ SUCCESS = 0
107
+ AUTH_ERROR = 1
108
+ SYSTEM_UNAVAILABLE = 2
109
+
110
+ FIELDS = {
111
+ SUCCESS => {:type => ::Thrift::Types::BOOL, :name => 'success'},
112
+ AUTH_ERROR => {:type => ::Thrift::Types::STRUCT, :name => 'auth_error', :class => ::Radar::Api::AuthenticationError},
113
+ SYSTEM_UNAVAILABLE => {:type => ::Thrift::Types::STRUCT, :name => 'system_unavailable', :class => ::Radar::Api::SystemUnavailableError}
114
+ }
115
+
116
+ def struct_fields; FIELDS; end
117
+
118
+ def validate
119
+ end
120
+
121
+ ::Thrift::Struct.generate_accessors self
122
+ end
123
+
54
124
  class Fetch_args
55
125
  include ::Thrift::Struct, ::Thrift::Struct_Union
56
126
  USERNAME = 1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radar-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Aizim Kelmanson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-06 00:00:00.000000000 Z
11
+ date: 2019-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -113,7 +113,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
115
  requirements: []
116
- rubygems_version: 3.0.4
116
+ rubyforge_project:
117
+ rubygems_version: 2.6.14.4
117
118
  signing_key:
118
119
  specification_version: 4
119
120
  summary: Radar API