emites-client 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/README.md +146 -0
  4. data/emites-client.gemspec +2 -2
  5. data/lib/emites.rb +3 -0
  6. data/lib/emites/client.rb +8 -0
  7. data/lib/emites/entities/service.rb +29 -0
  8. data/lib/emites/resources/service.rb +98 -0
  9. data/lib/emites/resources/taker.rb +98 -0
  10. data/lib/emites/version.rb +1 -1
  11. data/spec/emites/client_spec.rb +12 -0
  12. data/spec/emites/entities/services_spec.rb +21 -0
  13. data/spec/emites/resources/service_spec.rb +107 -0
  14. data/spec/emites/resources/taker_spec.rb +117 -0
  15. data/spec/vcr_cassettes/services/create/error.yml +49 -0
  16. data/spec/vcr_cassettes/services/create/success.yml +74 -0
  17. data/spec/vcr_cassettes/services/destroy/error.yml +49 -0
  18. data/spec/vcr_cassettes/services/destroy/success.yml +44 -0
  19. data/spec/vcr_cassettes/services/info/error.yml +49 -0
  20. data/spec/vcr_cassettes/services/info/success.yml +75 -0
  21. data/spec/vcr_cassettes/services/list/success.yml +215 -0
  22. data/spec/vcr_cassettes/services/search/returns_empty.yml +49 -0
  23. data/spec/vcr_cassettes/services/search/success.yml +76 -0
  24. data/spec/vcr_cassettes/takers/create/error.yml +49 -0
  25. data/spec/vcr_cassettes/takers/create/success.yml +58 -0
  26. data/spec/vcr_cassettes/takers/destroy/error.yml +49 -0
  27. data/spec/vcr_cassettes/takers/destroy/success.yml +44 -0
  28. data/spec/vcr_cassettes/takers/info/error.yml +49 -0
  29. data/spec/vcr_cassettes/takers/info/success.yml +57 -0
  30. data/spec/vcr_cassettes/takers/list/success.yml +308 -0
  31. data/spec/vcr_cassettes/takers/search/returns_empty.yml +49 -0
  32. data/spec/vcr_cassettes/takers/search/success.yml +58 -0
  33. metadata +49 -2
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://sandbox.emites.com.br/api/v1/takers?cnpj=1775
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Emites Ruby Client v0.0.2
12
+ Accept:
13
+ - application/json
14
+ Content-Type:
15
+ - application/json
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Allow:
22
+ - GET, POST, HEAD, OPTIONS
23
+ Content-Encoding:
24
+ - gzip
25
+ Content-Type:
26
+ - application/json
27
+ Date:
28
+ - Fri, 28 Aug 2015 13:13:38 GMT
29
+ Server:
30
+ - nginx/1.6.2
31
+ User-Agent:
32
+ - emites-sandbox-v1
33
+ Vary:
34
+ - Accept-Encoding
35
+ - Cookie
36
+ X-Frame-Options:
37
+ - SAMEORIGIN
38
+ Content-Length:
39
+ - '69'
40
+ Connection:
41
+ - keep-alive
42
+ body:
43
+ encoding: UTF-8
44
+ string: '{"count": 0, "next": null, "previous": null, "collection": []}'
45
+ http_version: '1.1'
46
+ adapter_metadata:
47
+ effective_url: https://sandbox.emites.com.br/api/v1/takers?cnpj=1775
48
+ recorded_at: Fri, 28 Aug 2015 13:13:38 GMT
49
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://sandbox.emites.com.br/api/v1/takers?cnpj=01001001000113
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Emites Ruby Client v0.0.2
12
+ Accept:
13
+ - application/json
14
+ Content-Type:
15
+ - application/json
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Allow:
22
+ - GET, POST, HEAD, OPTIONS
23
+ Content-Encoding:
24
+ - gzip
25
+ Content-Type:
26
+ - application/json
27
+ Date:
28
+ - Fri, 28 Aug 2015 13:12:45 GMT
29
+ Server:
30
+ - nginx/1.6.2
31
+ User-Agent:
32
+ - emites-sandbox-v1
33
+ Vary:
34
+ - Accept-Encoding
35
+ - Cookie
36
+ X-Frame-Options:
37
+ - SAMEORIGIN
38
+ Content-Length:
39
+ - '365'
40
+ Connection:
41
+ - keep-alive
42
+ body:
43
+ encoding: UTF-8
44
+ string: '{"count": 1, "next": null, "previous": null, "collection": [{"_links":
45
+ [{"href": "https://sandbox.emites.com.br/api/v1/takers/135", "method": "GET",
46
+ "rel": "self"}, {"href": "https://sandbox.emites.com.br/api/v1/takers/135",
47
+ "method": "PUT", "rel": "update"}, {"href": "https://sandbox.emites.com.br/api/v1/takers/135",
48
+ "method": "PATCH", "rel": "partial_update"}, {"href": "https://sandbox.emites.com.br/api/v1/takers/135",
49
+ "method": "DELETE", "rel": "destroy"}], "address": null, "contact": null,
50
+ "id": 135, "account_id": 4, "is_complete": true, "cpf": null, "cnpj": "01001001000113",
51
+ "city_inscription": "3304557", "state_inscription": null, "social_reason":
52
+ "My Fake, Inc", "fancy_name": "My Fake", "substitute_state_inscription": null,
53
+ "special_situation": null, "foreign_taker": false, "person_type": null}]}'
54
+ http_version: '1.1'
55
+ adapter_metadata:
56
+ effective_url: https://sandbox.emites.com.br/api/v1/takers?cnpj=01001001000113
57
+ recorded_at: Fri, 28 Aug 2015 13:12:45 GMT
58
+ recorded_with: VCR 2.9.3
metadata CHANGED
@@ -1,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emites-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Thimóteo
8
+ - Marcos Tagomori
8
9
  - Rodrigo Tassinari
9
10
  - Vagner Zampieri
10
11
  - Wanderson Policarpo
11
12
  autorequire:
12
13
  bindir: bin
13
14
  cert_chain: []
14
- date: 2015-08-18 00:00:00.000000000 Z
15
+ date: 2015-08-31 00:00:00.000000000 Z
15
16
  dependencies:
16
17
  - !ruby/object:Gem::Dependency
17
18
  name: typhoeus
@@ -213,6 +214,7 @@ description: Official Ruby client for the Emites API. Emites is a system for cre
213
214
  "notas fiscais eletrônicas" (NFe / NFSe) in Brazil.
214
215
  email:
215
216
  - leandro.thimoteo@myfreecomm.com.br
217
+ - marcos.tagomori@myfreecomm.com.br
216
218
  - rodrigo.tassinari@myfreecomm.com.br
217
219
  - vagner.zampieri@myfreecomm.com.br
218
220
  - wanderson.policarpo@myfreecomm.com.br
@@ -239,6 +241,7 @@ files:
239
241
  - lib/emites/entities/nfse_status_transition.rb
240
242
  - lib/emites/entities/nfse_values.rb
241
243
  - lib/emites/entities/rps.rb
244
+ - lib/emites/entities/service.rb
242
245
  - lib/emites/entities/taker.rb
243
246
  - lib/emites/entities/taker_address.rb
244
247
  - lib/emites/entities/taker_contact.rb
@@ -250,6 +253,8 @@ files:
250
253
  - lib/emites/resources/emitter.rb
251
254
  - lib/emites/resources/hooks.rb
252
255
  - lib/emites/resources/nfse.rb
256
+ - lib/emites/resources/service.rb
257
+ - lib/emites/resources/taker.rb
253
258
  - lib/emites/resources/webhook.rb
254
259
  - lib/emites/response.rb
255
260
  - lib/emites/version.rb
@@ -263,6 +268,7 @@ files:
263
268
  - spec/emites/entities/nfse_status_transition_spec.rb
264
269
  - spec/emites/entities/nfse_values_spec.rb
265
270
  - spec/emites/entities/rps_spec.rb
271
+ - spec/emites/entities/services_spec.rb
266
272
  - spec/emites/entities/taker_address_spec.rb
267
273
  - spec/emites/entities/taker_contact_spec.rb
268
274
  - spec/emites/entities/taker_spec.rb
@@ -272,6 +278,8 @@ files:
272
278
  - spec/emites/resources/base_spec.rb
273
279
  - spec/emites/resources/emitter_spec.rb
274
280
  - spec/emites/resources/nfse_spec.rb
281
+ - spec/emites/resources/service_spec.rb
282
+ - spec/emites/resources/taker_spec.rb
275
283
  - spec/emites/resources/webhook_spec.rb
276
284
  - spec/emites_spec.rb
277
285
  - spec/fixtures/certificate.pfx
@@ -304,6 +312,24 @@ files:
304
312
  - spec/vcr_cassettes/nfse/status/success.yml
305
313
  - spec/vcr_cassettes/nfse/update/success.yml
306
314
  - spec/vcr_cassettes/nfse/xml/success.yml
315
+ - spec/vcr_cassettes/services/create/error.yml
316
+ - spec/vcr_cassettes/services/create/success.yml
317
+ - spec/vcr_cassettes/services/destroy/error.yml
318
+ - spec/vcr_cassettes/services/destroy/success.yml
319
+ - spec/vcr_cassettes/services/info/error.yml
320
+ - spec/vcr_cassettes/services/info/success.yml
321
+ - spec/vcr_cassettes/services/list/success.yml
322
+ - spec/vcr_cassettes/services/search/returns_empty.yml
323
+ - spec/vcr_cassettes/services/search/success.yml
324
+ - spec/vcr_cassettes/takers/create/error.yml
325
+ - spec/vcr_cassettes/takers/create/success.yml
326
+ - spec/vcr_cassettes/takers/destroy/error.yml
327
+ - spec/vcr_cassettes/takers/destroy/success.yml
328
+ - spec/vcr_cassettes/takers/info/error.yml
329
+ - spec/vcr_cassettes/takers/info/success.yml
330
+ - spec/vcr_cassettes/takers/list/success.yml
331
+ - spec/vcr_cassettes/takers/search/returns_empty.yml
332
+ - spec/vcr_cassettes/takers/search/success.yml
307
333
  - spec/vcr_cassettes/webhooks/create/success.yml
308
334
  - spec/vcr_cassettes/webhooks/destroy/success.yml
309
335
  - spec/vcr_cassettes/webhooks/list/success.yml
@@ -343,6 +369,7 @@ test_files:
343
369
  - spec/emites/entities/nfse_status_transition_spec.rb
344
370
  - spec/emites/entities/nfse_values_spec.rb
345
371
  - spec/emites/entities/rps_spec.rb
372
+ - spec/emites/entities/services_spec.rb
346
373
  - spec/emites/entities/taker_address_spec.rb
347
374
  - spec/emites/entities/taker_contact_spec.rb
348
375
  - spec/emites/entities/taker_spec.rb
@@ -352,6 +379,8 @@ test_files:
352
379
  - spec/emites/resources/base_spec.rb
353
380
  - spec/emites/resources/emitter_spec.rb
354
381
  - spec/emites/resources/nfse_spec.rb
382
+ - spec/emites/resources/service_spec.rb
383
+ - spec/emites/resources/taker_spec.rb
355
384
  - spec/emites/resources/webhook_spec.rb
356
385
  - spec/emites_spec.rb
357
386
  - spec/fixtures/certificate.pfx
@@ -384,6 +413,24 @@ test_files:
384
413
  - spec/vcr_cassettes/nfse/status/success.yml
385
414
  - spec/vcr_cassettes/nfse/update/success.yml
386
415
  - spec/vcr_cassettes/nfse/xml/success.yml
416
+ - spec/vcr_cassettes/services/create/error.yml
417
+ - spec/vcr_cassettes/services/create/success.yml
418
+ - spec/vcr_cassettes/services/destroy/error.yml
419
+ - spec/vcr_cassettes/services/destroy/success.yml
420
+ - spec/vcr_cassettes/services/info/error.yml
421
+ - spec/vcr_cassettes/services/info/success.yml
422
+ - spec/vcr_cassettes/services/list/success.yml
423
+ - spec/vcr_cassettes/services/search/returns_empty.yml
424
+ - spec/vcr_cassettes/services/search/success.yml
425
+ - spec/vcr_cassettes/takers/create/error.yml
426
+ - spec/vcr_cassettes/takers/create/success.yml
427
+ - spec/vcr_cassettes/takers/destroy/error.yml
428
+ - spec/vcr_cassettes/takers/destroy/success.yml
429
+ - spec/vcr_cassettes/takers/info/error.yml
430
+ - spec/vcr_cassettes/takers/info/success.yml
431
+ - spec/vcr_cassettes/takers/list/success.yml
432
+ - spec/vcr_cassettes/takers/search/returns_empty.yml
433
+ - spec/vcr_cassettes/takers/search/success.yml
387
434
  - spec/vcr_cassettes/webhooks/create/success.yml
388
435
  - spec/vcr_cassettes/webhooks/destroy/success.yml
389
436
  - spec/vcr_cassettes/webhooks/list/success.yml