billimatic-client 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +24 -2
- data/lib/billimatic/entities/invoice_rule.rb +1 -0
- data/lib/billimatic/resources/invoice_rule.rb +14 -6
- data/lib/billimatic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 273c87649ed1394f123501e60a78a809ae701568
|
4
|
+
data.tar.gz: e2a2400590bf74074baaf6a0f1cce5aed6f791e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 120c58c071036a09fccaaf0b8c359e4b569b2025f4b0d363a9520299182b57b08d9ae1aedd6dd0b1e0566615c08afc9405125ae273f1ae33e97725d98d554690
|
7
|
+
data.tar.gz: 437eaeb96aeed33a026ea2d3119711291adf68684f85c0b18b63e40d1a365fe115081b599460b675de430a0012ae6d5607659c3e901cf821f8d1dd087476ded9
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## Next version
|
4
4
|
|
5
|
+
## v0.17.0
|
6
|
+
- Adds InvoiceRule#list and InvoiceRule#destroy endpoints.
|
7
|
+
- Adds `contract_id` field on InvoiceRule entity.
|
8
|
+
|
5
9
|
## v0.16.0
|
6
10
|
- Changes `scheduled_updates` field on InvoiceRule entity, to become a collection of scheduled_update hashes.
|
7
11
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -429,10 +429,21 @@ client = Billimatic.client("YOUR_TOKEN_HERE")
|
|
429
429
|
<th>Endpoint</th>
|
430
430
|
<th>Client method</th>
|
431
431
|
</tr>
|
432
|
+
<tr>
|
433
|
+
<td><code>GET</code></td>
|
434
|
+
<td>
|
435
|
+
<a href="https://app.billimatic.com.br/docs/api#!/invoice_rules/API_V1_InvoiceRules_index_get_0" target="_blank">
|
436
|
+
/api/v1/contracts/:contract_id/invoice_rules
|
437
|
+
</a>
|
438
|
+
</td>
|
439
|
+
<td>
|
440
|
+
<code>client.invoice_rules.list(contract_id: id)</code>
|
441
|
+
</td>
|
442
|
+
</tr>
|
432
443
|
<tr>
|
433
444
|
<td><code>POST</code></td>
|
434
445
|
<td>
|
435
|
-
<a href="https://app.billimatic.com.br/docs/api#!/invoice_rules/
|
446
|
+
<a href="https://app.billimatic.com.br/docs/api#!/invoice_rules/API_V1_InvoiceRules_create_post_1" target="_blank">
|
436
447
|
/api/v1/contracts/:contract_id/invoice_rules
|
437
448
|
</a>
|
438
449
|
</td>
|
@@ -443,7 +454,7 @@ client = Billimatic.client("YOUR_TOKEN_HERE")
|
|
443
454
|
<tr>
|
444
455
|
<td><code>PUT</code></td>
|
445
456
|
<td>
|
446
|
-
<a href="https://app.billimatic.com.br/docs/api#!/invoice_rules/
|
457
|
+
<a href="https://app.billimatic.com.br/docs/api#!/invoice_rules/API_V1_InvoiceRules_update_patch_2" target="_blank">
|
447
458
|
/api/v1/contracts/:contract_id/invoice_rules/:id
|
448
459
|
</a>
|
449
460
|
</td>
|
@@ -451,6 +462,17 @@ client = Billimatic.client("YOUR_TOKEN_HERE")
|
|
451
462
|
<code>client.invoice_rules.update(id, attributes_hash, contract_id: id)</code>
|
452
463
|
</td>
|
453
464
|
</tr>
|
465
|
+
<tr>
|
466
|
+
<td><code>DELETE</code></td>
|
467
|
+
<td>
|
468
|
+
<a href="https://app.billimatic.com.br/docs/api#!/invoice_rules/API_V1_InvoiceRules_destroy_delete_3" target="_blank">
|
469
|
+
/api/v1/contracts/:contract_id/invoice_rules/:id
|
470
|
+
</a>
|
471
|
+
</td>
|
472
|
+
<td>
|
473
|
+
<code>client.invoice_rules.destroy(id, contract_id: id)</code>
|
474
|
+
</td>
|
475
|
+
</tr>
|
454
476
|
</table>
|
455
477
|
|
456
478
|
#### [Companies](https://app.billimatic.com.br/docs/api#!/companies)
|
@@ -1,22 +1,30 @@
|
|
1
1
|
module Billimatic
|
2
2
|
module Resources
|
3
3
|
class InvoiceRule < Base
|
4
|
+
def list(contract_id:)
|
5
|
+
http.get(
|
6
|
+
"/contracts/#{contract_id}#{resource_base_path}"
|
7
|
+
) { |response| respond_with_collection(response) }
|
8
|
+
end
|
9
|
+
|
4
10
|
def create(params, contract_id:)
|
5
11
|
http.post(
|
6
12
|
"/contracts/#{contract_id}#{resource_base_path}",
|
7
13
|
body: { underscored_klass_name.to_sym => params }
|
8
|
-
)
|
9
|
-
respond_with_entity(response)
|
10
|
-
end
|
14
|
+
) { |response| respond_with_entity(response) }
|
11
15
|
end
|
12
16
|
|
13
17
|
def update(id, params, contract_id:)
|
14
18
|
http.put(
|
15
19
|
"/contracts/#{contract_id}#{resource_base_path}/#{id}",
|
16
20
|
body: { underscored_klass_name.to_sym => params }
|
17
|
-
)
|
18
|
-
|
19
|
-
|
21
|
+
) { |response| respond_with_entity(response) }
|
22
|
+
end
|
23
|
+
|
24
|
+
def destroy(id, contract_id:)
|
25
|
+
http.delete(
|
26
|
+
"/contracts/#{contract_id}#{resource_base_path}/#{id}"
|
27
|
+
) { |response| response.code == 204 }
|
20
28
|
end
|
21
29
|
end
|
22
30
|
end
|
data/lib/billimatic/version.rb
CHANGED
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.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Tassinari de Oliveira
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-
|
14
|
+
date: 2018-06-14 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: typhoeus
|