bzapper 0.12.0 → 0.13.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/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: 13d0b6718949379d3a764faaf77d13171e968757442090fa66f87ad93ecf5363
|
|
4
|
+
data.tar.gz: c66b3dc08012d3d925303f62dbb79c934a46a5a16f8fc33de9d7514c2c7332f5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '09dff9e7a1caa6906746089c3b33e228280cb8662e74042e6c73e2ff6cb7fe4077321f03fd2100fba844696ea13b3d3828ffdfef2ebf0f20888e6f0fb6a8c4a1'
|
|
7
|
+
data.tar.gz: c20b0d40090ea71d6da210790c7d0eeb654f5ab700f1022a98efef66f1b280c790b6b05778b695c0427ca6b60400b90590b6e0924edda6e879fea29a17e6b4e8
|
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.13.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.13.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
|
data/lib/bzapper/version.rb
CHANGED