billimatic-client 0.10.2 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MTMwYjgwMjgxZDc0OWU3YjdiMjUyNDdmZWUzNDk5NTIyOWI4ZWViZQ==
5
- data.tar.gz: !binary |-
6
- MGY2NDc2NTMyMWRlZjdmM2Q0N2VlYjc3OGYxM2NiMjhlODBmYTVmZQ==
2
+ SHA1:
3
+ metadata.gz: 1297fda9d03ab235fd5eaeb03aee250b918a2b13
4
+ data.tar.gz: c80a98d7e4ab0dcd3181e247b965eed32067149c
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MTg5ZTE0MWJlZTU2YmJmOTkwMDNkZDNiNDk2MzFmMDhlMjA3MjBjMWU1MDM2
10
- MTVjNjFlMTBkY2EwZjAwNGU3ZTNkYjlmMGQ0OTdkYjRjNTJiNTJiZDVlMjdk
11
- YjBjNDE0NmI1NjQyN2U4YTA1OTBhZGY2ZTU1MmQzNzAyZGI1ZmU=
12
- data.tar.gz: !binary |-
13
- ZjU1ZjBiNDY4ZDJlMDBjZTA0ZWM3OTA1MzM0MjlhZDE5M2QyZTI0NTdjZTll
14
- NDIyNWYyN2E1OGE0YWRkZTYxYTVhZjljZjJkMDJkZDk0MjFkMmNiZWIzMjM0
15
- MTJjYzFiZTgxMjAzNDA2MDBhNTQzNzFmODU2MjQ4NjJkNGZmODc=
6
+ metadata.gz: 11df2fc3044d4c44a23d443f0d62de1b04ee891050afb72ce01a574297da741cf972690823686094bf5e47de23bb73d4dcdfbf922a4cb6f3e57c39e0d6a6ea0d
7
+ data.tar.gz: 04f0ad928ef2054e63809751e42c1fc49720f0ef83ac91e38d38aadfc0ea153f49e445cf518df30f615ac7c81d377a2bcd4d56cd0a8cde2b1305fbf11ecc7dce
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- billimatic-client (0.10.2)
4
+ billimatic-client (0.11.0)
5
5
  multi_json (~> 1.11)
6
6
  typhoeus (~> 0.8)
7
7
  virtus (~> 1.0.5)
@@ -25,7 +25,7 @@ GEM
25
25
  diff-lcs (1.2.5)
26
26
  docile (1.1.5)
27
27
  equalizer (0.0.11)
28
- ethon (0.10.1)
28
+ ethon (0.9.0)
29
29
  ffi (>= 1.3.0)
30
30
  ffi (1.9.14)
31
31
  formatador (0.2.5)
data/README.md CHANGED
@@ -54,6 +54,7 @@ client = Billimatic.client("YOUR_TOKEN_HERE")
54
54
  * [Invoices API](https://app.billimatic.com.br/docs/api#!/invoices) as `client.invoices`
55
55
  * [Invoice Rules API](https://app.billimatic.com.br/docs/api#!/invoice_rules) as `client.invoice_rules`
56
56
  * [Companies API](https://app.billimatic.com.br/docs/api#!/companies) as `client.companies`
57
+ * [People API](https://app.billimatic.com.br/docs/api#!/people) as `client.people`
57
58
  * [Service Items API](https://app.billimatic.com.br/docs/api#!/service_items) as `client.service_items`
58
59
 
59
60
  ## Endpoints
@@ -451,6 +452,60 @@ client = Billimatic.client("YOUR_TOKEN_HERE")
451
452
  </tr>
452
453
  </table>
453
454
 
455
+ #### [People](https://app.billimatic.com.br/docs/api#!/people)
456
+
457
+ <table>
458
+ <tr>
459
+ <th>HTTP method</th>
460
+ <th>Endpoint</th>
461
+ <th>Client method</th>
462
+ </tr>
463
+ <tr>
464
+ <td><code>GET</code></td>
465
+ <td>
466
+ <a href="https://app.billimatic.com.br/docs/api#!/people/API_V1_People_search_get_0" target="_blank">
467
+ /api/v1/people/search?cpf=:cpf
468
+ </a>
469
+ </td>
470
+ <td>
471
+ <code>client.people.search(cnpj)</code>
472
+ </td>
473
+ </tr>
474
+ <tr>
475
+ <td><code>POST</code></td>
476
+ <td>
477
+ <a href="https://app.billimatic.com.br/docs/api#!/people/API_V1_People_create_post_1" target="_blank">
478
+ /api/v1/people
479
+ </a>
480
+ </td>
481
+ <td>
482
+ <code>client.people.create(attributes_hash)</code>
483
+ </td>
484
+ </tr>
485
+ <tr>
486
+ <td><code>PATCH</code></td>
487
+ <td>
488
+ <a href="https://app.billimatic.com.br/docs/api#!/people/API_V1_People_update_patch_2" target="_blank">
489
+ /api/v1/people/:id
490
+ </a>
491
+ </td>
492
+ <td>
493
+ <code>client.people.update(id, attributes_hash)</code>
494
+ </td>
495
+ </tr>
496
+ <tr>
497
+ <td><code>DELETE</code></td>
498
+ <td>
499
+ <a href="https://app.billimatic.com.br/docs/api#!/people/API_V1_People_destroy_delete_3" target="_blank">
500
+ /api/v1/people/:id
501
+ </a>
502
+ </td>
503
+ <td>
504
+ <code>client.people.destroy(id)</code>
505
+ </td>
506
+ </tr>
507
+ </table>
508
+
454
509
  #### [Service Items](https://app.billimatic.com.br/docs/api#!/service_items)
455
510
 
456
511
  <table>
data/lib/billimatic.rb CHANGED
@@ -20,6 +20,7 @@ require 'billimatic/entities/plan'
20
20
  require 'billimatic/entities/address_information'
21
21
  require 'billimatic/entities/customer'
22
22
  require 'billimatic/entities/company'
23
+ require 'billimatic/entities/person'
23
24
  require 'billimatic/entities/organization'
24
25
  require 'billimatic/entities/contract'
25
26
  require 'billimatic/entities/invoice'
@@ -30,6 +31,7 @@ require 'billimatic/entities/webhook'
30
31
 
31
32
  require 'billimatic/resources/base'
32
33
  require 'billimatic/resources/company'
34
+ require 'billimatic/resources/person'
33
35
  require 'billimatic/resources/organization'
34
36
  require 'billimatic/resources/contract'
35
37
  require 'billimatic/resources/invoice_rule'
@@ -15,6 +15,10 @@ module Billimatic
15
15
  false
16
16
  end
17
17
 
18
+ def organizations
19
+ Resources::Organization.new(http)
20
+ end
21
+
18
22
  def plans
19
23
  Resources::Plan.new(http)
20
24
  end
@@ -39,8 +43,8 @@ module Billimatic
39
43
  Resources::Company.new(http)
40
44
  end
41
45
 
42
- def organizations
43
- Resources::Organization.new(http)
46
+ def people
47
+ Resources::Person.new(http)
44
48
  end
45
49
 
46
50
  def service_items
@@ -0,0 +1,21 @@
1
+ module Billimatic
2
+ module Entities
3
+ class Person < Base
4
+ attribute :id, Integer
5
+ attribute :account_id, Integer
6
+ attribute :name, String
7
+ attribute :cpf, String
8
+ attribute :email, String
9
+ attribute :zipcode, String
10
+ attribute :address, String
11
+ attribute :number, String
12
+ attribute :complement, String
13
+ attribute :district, String
14
+ attribute :city, String
15
+ attribute :state, String
16
+ attribute :comments, String
17
+ attribute :client_since, Date
18
+ attribute :created_at, DateTime
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,18 @@
1
+ module Billimatic
2
+ module Resources
3
+ class Person < Base
4
+ crud :create, :update, :destroy
5
+
6
+ def initialize(http)
7
+ @collection_name = 'people'
8
+ super http
9
+ end
10
+
11
+ def search(cpf:)
12
+ http.get("#{resource_base_path}/search", params: { cpf: cpf }) do |response|
13
+ respond_with_collection response
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module Billimatic
2
- VERSION = '0.10.2'
2
+ VERSION = '0.11.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: billimatic-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Tassinari de Oliveira
@@ -10,188 +10,188 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2016-12-20 00:00:00.000000000 Z
13
+ date: 2017-01-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: typhoeus
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ~>
19
+ - - "~>"
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0.8'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ~>
26
+ - - "~>"
27
27
  - !ruby/object:Gem::Version
28
28
  version: '0.8'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: multi_json
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ~>
33
+ - - "~>"
34
34
  - !ruby/object:Gem::Version
35
35
  version: '1.11'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ~>
40
+ - - "~>"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '1.11'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: virtus
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ~>
47
+ - - "~>"
48
48
  - !ruby/object:Gem::Version
49
49
  version: 1.0.5
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ~>
54
+ - - "~>"
55
55
  - !ruby/object:Gem::Version
56
56
  version: 1.0.5
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: wisper
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ~>
61
+ - - "~>"
62
62
  - !ruby/object:Gem::Version
63
63
  version: 1.6.1
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - ~>
68
+ - - "~>"
69
69
  - !ruby/object:Gem::Version
70
70
  version: 1.6.1
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: bundler
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - ~>
75
+ - - "~>"
76
76
  - !ruby/object:Gem::Version
77
77
  version: '1.11'
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - ~>
82
+ - - "~>"
83
83
  - !ruby/object:Gem::Version
84
84
  version: '1.11'
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: rake
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - ~>
89
+ - - "~>"
90
90
  - !ruby/object:Gem::Version
91
91
  version: '11.1'
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - ~>
96
+ - - "~>"
97
97
  - !ruby/object:Gem::Version
98
98
  version: '11.1'
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: vcr
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - ~>
103
+ - - "~>"
104
104
  - !ruby/object:Gem::Version
105
105
  version: '3.0'
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - ~>
110
+ - - "~>"
111
111
  - !ruby/object:Gem::Version
112
112
  version: '3.0'
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: pry-byebug
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - ~>
117
+ - - "~>"
118
118
  - !ruby/object:Gem::Version
119
119
  version: '3.3'
120
120
  type: :development
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - ~>
124
+ - - "~>"
125
125
  - !ruby/object:Gem::Version
126
126
  version: '3.3'
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: rspec
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - ~>
131
+ - - "~>"
132
132
  - !ruby/object:Gem::Version
133
133
  version: '3.4'
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - ~>
138
+ - - "~>"
139
139
  - !ruby/object:Gem::Version
140
140
  version: '3.4'
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: codeclimate-test-reporter
143
143
  requirement: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ~>
145
+ - - "~>"
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0.5'
148
148
  type: :development
149
149
  prerelease: false
150
150
  version_requirements: !ruby/object:Gem::Requirement
151
151
  requirements:
152
- - - ~>
152
+ - - "~>"
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0.5'
155
155
  - !ruby/object:Gem::Dependency
156
156
  name: simplecov
157
157
  requirement: !ruby/object:Gem::Requirement
158
158
  requirements:
159
- - - ~>
159
+ - - "~>"
160
160
  - !ruby/object:Gem::Version
161
161
  version: '0.11'
162
162
  type: :development
163
163
  prerelease: false
164
164
  version_requirements: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - ~>
166
+ - - "~>"
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0.11'
169
169
  - !ruby/object:Gem::Dependency
170
170
  name: guard-rspec
171
171
  requirement: !ruby/object:Gem::Requirement
172
172
  requirements:
173
- - - ~>
173
+ - - "~>"
174
174
  - !ruby/object:Gem::Version
175
175
  version: '4.6'
176
176
  type: :development
177
177
  prerelease: false
178
178
  version_requirements: !ruby/object:Gem::Requirement
179
179
  requirements:
180
- - - ~>
180
+ - - "~>"
181
181
  - !ruby/object:Gem::Version
182
182
  version: '4.6'
183
183
  - !ruby/object:Gem::Dependency
184
184
  name: test_notifier
185
185
  requirement: !ruby/object:Gem::Requirement
186
186
  requirements:
187
- - - ~>
187
+ - - "~>"
188
188
  - !ruby/object:Gem::Version
189
189
  version: '2.0'
190
190
  type: :development
191
191
  prerelease: false
192
192
  version_requirements: !ruby/object:Gem::Requirement
193
193
  requirements:
194
- - - ~>
194
+ - - "~>"
195
195
  - !ruby/object:Gem::Version
196
196
  version: '2.0'
197
197
  description: This is the official Ruby client for the Billimatic API. See http://www.billimatic.com.br
@@ -204,11 +204,11 @@ executables: []
204
204
  extensions: []
205
205
  extra_rdoc_files: []
206
206
  files:
207
- - .codeclimate.yml
208
- - .gitignore
209
- - .rspec
210
- - .rubocop.yml
211
- - .travis.yml
207
+ - ".codeclimate.yml"
208
+ - ".gitignore"
209
+ - ".rspec"
210
+ - ".rubocop.yml"
211
+ - ".travis.yml"
212
212
  - Gemfile
213
213
  - Gemfile.lock
214
214
  - Guardfile
@@ -231,6 +231,7 @@ files:
231
231
  - lib/billimatic/entities/invoice_rule.rb
232
232
  - lib/billimatic/entities/organization.rb
233
233
  - lib/billimatic/entities/payment_information.rb
234
+ - lib/billimatic/entities/person.rb
234
235
  - lib/billimatic/entities/plan.rb
235
236
  - lib/billimatic/entities/plan_feature.rb
236
237
  - lib/billimatic/entities/product.rb
@@ -249,6 +250,7 @@ files:
249
250
  - lib/billimatic/resources/invoice.rb
250
251
  - lib/billimatic/resources/invoice_rule.rb
251
252
  - lib/billimatic/resources/organization.rb
253
+ - lib/billimatic/resources/person.rb
252
254
  - lib/billimatic/resources/plan.rb
253
255
  - lib/billimatic/resources/service_item.rb
254
256
  - lib/billimatic/resources/subscription.rb
@@ -267,19 +269,18 @@ require_paths:
267
269
  - lib
268
270
  required_ruby_version: !ruby/object:Gem::Requirement
269
271
  requirements:
270
- - - ! '>='
272
+ - - ">="
271
273
  - !ruby/object:Gem::Version
272
274
  version: '0'
273
275
  required_rubygems_version: !ruby/object:Gem::Requirement
274
276
  requirements:
275
- - - ! '>='
277
+ - - ">="
276
278
  - !ruby/object:Gem::Version
277
279
  version: '0'
278
280
  requirements: []
279
281
  rubyforge_project:
280
- rubygems_version: 2.6.4
282
+ rubygems_version: 2.5.1
281
283
  signing_key:
282
284
  specification_version: 4
283
285
  summary: This is the official Ruby client for the Billimatic API.
284
286
  test_files: []
285
- has_rdoc: