bzapper 0.12.0 → 0.14.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/README.md +2 -2
- data/lib/bzapper/resources/campaigns.rb +22 -0
- data/lib/bzapper/resources/official.rb +15 -0
- data/lib/bzapper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 44067da186178cfce4bd82f70f3057a2e61ce61ab38db61d538f970a66304036
|
|
4
|
+
data.tar.gz: 0bcdb27ae8f2184bfc4aea8125e9f6bcff86b8487e9e3398bc0a5bc52137cead
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ec2e9f839e328e17a4977c05d06517d9f8d8e1aae992d42fb778de06740c18a774f1c7dfb9e8d6984260fb394ef803af93730c1a4f85368c97e7b9bb641fc073
|
|
7
|
+
data.tar.gz: 165dab6da31497cf3fc7dbdea0f94b86f78a8e82de2378d32e8b19ea400ad5c9c35e3f6a8385c89893e405b610926e2562fe05df8469b2e787095c18e26333b3
|
data/README.md
CHANGED
|
@@ -10,13 +10,13 @@ Zero dependências de runtime (só biblioteca padrão: `net/http`, `json`, `open
|
|
|
10
10
|
## Instalação
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
gem install bzapper -v 0.
|
|
13
|
+
gem install bzapper -v 0.14.0
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Ou no `Gemfile` — **fixe a versão exata** (cada release declara se muda a superfície pública):
|
|
17
17
|
|
|
18
18
|
```ruby
|
|
19
|
-
gem "bzapper", "0.
|
|
19
|
+
gem "bzapper", "0.14.0"
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Hello world
|
|
@@ -68,6 +68,28 @@ module Bzapper
|
|
|
68
68
|
request("GET", "/campaigns/estimate", query: query, timeout: timeout)
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
+
# What Meta will charge for a template campaign (official rail). `GET /campaigns/meta-cost`
|
|
72
|
+
#
|
|
73
|
+
# From the template category (the one Meta bills, which follows reclassification) and Meta's
|
|
74
|
+
# Brazil rate card: the cost of `recipients` messages — charged by Meta on the customer's card;
|
|
75
|
+
# bZapper charges only the subscription — and how many days the number's daily new-contact limit
|
|
76
|
+
# requires.
|
|
77
|
+
#
|
|
78
|
+
# @param recipients [Integer] (query)
|
|
79
|
+
# @param template [String] (query)
|
|
80
|
+
# @param language [String, nil] (query)
|
|
81
|
+
# @param timeout [Numeric, nil] segundos por tentativa (padrão: o do cliente).
|
|
82
|
+
# @return [Hash, Array, nil] o JSON da resposta, inteiro (nil em 204).
|
|
83
|
+
# @raise [Bzapper::Error] resposta fora de 2xx ou falha de rede.
|
|
84
|
+
def estimate_campaign_meta_cost(recipients:, template:, language: nil, timeout: nil)
|
|
85
|
+
query = {
|
|
86
|
+
"recipients" => recipients,
|
|
87
|
+
"template" => template,
|
|
88
|
+
"language" => language
|
|
89
|
+
}
|
|
90
|
+
request("GET", "/campaigns/meta-cost", query: query, timeout: timeout)
|
|
91
|
+
end
|
|
92
|
+
|
|
71
93
|
# Per-number campaign eligibility (connection and age). `GET /campaigns/eligibility`
|
|
72
94
|
#
|
|
73
95
|
# Same engine the dispatcher uses: which numbers can send campaigns now, the account's campaign
|
|
@@ -314,6 +314,21 @@ module Bzapper
|
|
|
314
314
|
timeout: timeout)
|
|
315
315
|
end
|
|
316
316
|
|
|
317
|
+
# Quality and messaging-limit history of one number. `GET /official/numbers/{id}/health`
|
|
318
|
+
#
|
|
319
|
+
# Every change of quality rating and messaging limit (from Meta's webhook or a live check),
|
|
320
|
+
# newest first — what explains why the limit dropped or when quality worsened. Repeated states
|
|
321
|
+
# are not history and are not recorded.
|
|
322
|
+
#
|
|
323
|
+
# @param id [String] parâmetro de caminho
|
|
324
|
+
# @param timeout [Numeric, nil] segundos por tentativa (padrão: o do cliente).
|
|
325
|
+
# @return [Hash, Array, nil] o JSON da resposta, inteiro (nil em 204).
|
|
326
|
+
# @raise [Bzapper::Error] resposta fora de 2xx ou falha de rede.
|
|
327
|
+
# @raise [ArgumentError] parâmetro de caminho vazio, "." ou "..".
|
|
328
|
+
def get_official_number_health(id, timeout: nil)
|
|
329
|
+
request("GET", "/official/numbers/#{segment(id, "id")}/health", timeout: timeout)
|
|
330
|
+
end
|
|
331
|
+
|
|
317
332
|
# Disconnect one number. `DELETE /official/numbers/{id}`
|
|
318
333
|
#
|
|
319
334
|
# The conversation history stays: the mirror instance is archived, not deleted. Removing the
|
data/lib/bzapper/version.rb
CHANGED