bzapper 0.9.2 → 0.9.3
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/templates.rb +39 -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: 2de73e1893deff0a3dd72bce246825e27d6c7683be57a01f4c9a3c81d55d28ed
|
|
4
|
+
data.tar.gz: a661bd96fe3819a7c35b63a89e9d3dc2773568d29aa93f9dbdff20f9208c1153
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 88041c2ced6cfb00307dbf710e6e86ba9a6dd4a9f0db5bcc66f0a44446993d12fce5f8e45f6f1e6c15408ef820d14a739b648ec0d524ddfc6353e0e67e2c3c91
|
|
7
|
+
data.tar.gz: 4053e5387e460a5bf50944304e14d9b18a8315ef2db4e1690782d9f95d3e0a8f52813b74b60ee9ee4256e933ac086eb744c3feec262f39256dece3b83e540dc3
|
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.9.
|
|
13
|
+
gem install bzapper -v 0.9.3
|
|
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.9.
|
|
19
|
+
gem "bzapper", "0.9.3"
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Hello world
|
|
@@ -143,6 +143,45 @@ module Bzapper
|
|
|
143
143
|
timeout: timeout)
|
|
144
144
|
end
|
|
145
145
|
|
|
146
|
+
# Get the verification-code template and whether Meta allows Authentication templates. `GET
|
|
147
|
+
# /templates/otp`
|
|
148
|
+
#
|
|
149
|
+
# The template that carries the code of POST /messages/otp when the 24-hour window is closed
|
|
150
|
+
# (null = the first approved Authentication template is used), plus the account's eligibility
|
|
151
|
+
# for the Authentication category: Meta requires the business to be verified and the number to
|
|
152
|
+
# reach the 2,000-a-day sending limit. Each criterion comes with its current state, so the
|
|
153
|
+
# customer knows what is missing.
|
|
154
|
+
#
|
|
155
|
+
# @param timeout [Numeric, nil] segundos por tentativa (padrão: o do cliente).
|
|
156
|
+
# @return [Hash, Array, nil] o JSON da resposta, inteiro (nil em 204).
|
|
157
|
+
# @raise [Bzapper::Error] resposta fora de 2xx ou falha de rede.
|
|
158
|
+
def get_otp_template(timeout: nil)
|
|
159
|
+
request("GET", "/templates/otp", timeout: timeout)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Choose the template that carries the verification code outside the window. `PUT
|
|
163
|
+
# /templates/otp`
|
|
164
|
+
#
|
|
165
|
+
# Must be an APPROVED template of the Authentication category — Meta accepts codes in no other
|
|
166
|
+
# category. An empty `template_id` clears the choice (the first approved Authentication template
|
|
167
|
+
# is used again).
|
|
168
|
+
#
|
|
169
|
+
# @param template_id [String, nil] (corpo) Empty clears the choice.
|
|
170
|
+
# @param idempotency_key [String, nil] chave de idempotência (senão a SDK gera uma).
|
|
171
|
+
# @param timeout [Numeric, nil] segundos por tentativa (padrão: o do cliente).
|
|
172
|
+
# @return [Hash, Array, nil] o JSON da resposta, inteiro (nil em 204).
|
|
173
|
+
# @raise [Bzapper::Error] resposta fora de 2xx ou falha de rede.
|
|
174
|
+
def set_otp_template(template_id: UNSET, idempotency_key: nil, timeout: nil)
|
|
175
|
+
payload = compact(
|
|
176
|
+
"template_id" => template_id
|
|
177
|
+
)
|
|
178
|
+
request("PUT",
|
|
179
|
+
"/templates/otp",
|
|
180
|
+
body: payload,
|
|
181
|
+
idempotency_key: idempotency_key,
|
|
182
|
+
timeout: timeout)
|
|
183
|
+
end
|
|
184
|
+
|
|
146
185
|
# Upload the header sample of a template (multipart, JPEG/PNG/MP4/PDF up to 10 MB). `POST
|
|
147
186
|
# /templates/media`
|
|
148
187
|
#
|
data/lib/bzapper/version.rb
CHANGED