whatsapp_sdk 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/whatsapp_sdk/api/api_configuration.rb +1 -1
- data/lib/whatsapp_sdk/api/templates.rb +24 -24
- data/lib/whatsapp_sdk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3afc828e9c913c0aa1988b1ec75dcbd6453f13f67d46f3a25c77ef2558aacf8c
|
4
|
+
data.tar.gz: 64d8ea9e6c36c6d37c8dad014ee1dab10d906df4dcb7777206f6fc7300af44b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c4e910413ddf8366abd12b1aaed78e8a47d69b1cc979f7afaae00fc644ff9f735f6c1f594749de242fc87c70f6c2c7c9ccf6c215c2e85bda40f0f6540fc3a55
|
7
|
+
data.tar.gz: 5a2bac9b5b4f416af7abbfbdf07c91717b517f7c030fcb47c767c4d2863c538e2b03402ff3a0968b7a889b4748f3c5a14d1e4b75f1cbc75f238a1888d5cc78d1
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Unreleased
|
2
2
|
|
3
|
+
# v 0.11.0
|
4
|
+
- Bumped API version to v19. @paulomcnally https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk/pull/116
|
5
|
+
|
3
6
|
# v 0.10.0
|
4
7
|
- Implement Templates API @emersonu, @ignacio-chiazzo [#90](https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk/pull/90)
|
5
8
|
- Using compatible Gem versions instead of fixed dependency versions @nbluis [#108](https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk/pull/108)
|
data/Gemfile.lock
CHANGED
@@ -41,7 +41,7 @@ module WhatsappSdk
|
|
41
41
|
# @param allow_category_change [Boolean] Optional Allow category change.
|
42
42
|
# Set to true to allow us to assign a category based on the template guidelines and the template's contents.
|
43
43
|
# This can prevent your template from being rejected for miscategorization.
|
44
|
-
# @return [
|
44
|
+
# @return [Response] Response object.
|
45
45
|
sig do
|
46
46
|
params(
|
47
47
|
business_id: Integer,
|
@@ -50,7 +50,7 @@ module WhatsappSdk
|
|
50
50
|
language: String,
|
51
51
|
components_json: T.nilable(T::Array[T::Hash[T.untyped, T.untyped]]),
|
52
52
|
allow_category_change: T.nilable(T::Boolean)
|
53
|
-
).returns(
|
53
|
+
).returns(Response)
|
54
54
|
end
|
55
55
|
def create(
|
56
56
|
business_id:, name:, category:, language:, components_json: nil, allow_category_change: nil
|
@@ -78,10 +78,10 @@ module WhatsappSdk
|
|
78
78
|
headers: DEFAULT_HEADERS
|
79
79
|
)
|
80
80
|
|
81
|
-
|
81
|
+
Response.new(
|
82
82
|
response: response,
|
83
|
-
data_class_type:
|
84
|
-
error_class_type:
|
83
|
+
data_class_type: Responses::TemplateDataResponse,
|
84
|
+
error_class_type: Responses::GenericErrorResponse
|
85
85
|
)
|
86
86
|
end
|
87
87
|
|
@@ -89,8 +89,8 @@ module WhatsappSdk
|
|
89
89
|
#
|
90
90
|
# @param business_id [Integer] The business ID.
|
91
91
|
# @param limit [Integer] Optional. Number of templates to return in a single page.
|
92
|
-
# @return [
|
93
|
-
sig { params(business_id: Integer, limit: T.nilable(Integer)).returns(
|
92
|
+
# @return [Response] Response object.
|
93
|
+
sig { params(business_id: Integer, limit: T.nilable(Integer)).returns(Response) }
|
94
94
|
def templates(business_id:, limit: 100)
|
95
95
|
params = {}
|
96
96
|
params["limit"] = limit if limit
|
@@ -101,10 +101,10 @@ module WhatsappSdk
|
|
101
101
|
params: params
|
102
102
|
)
|
103
103
|
|
104
|
-
|
104
|
+
Response.new(
|
105
105
|
response: response,
|
106
|
-
data_class_type:
|
107
|
-
error_class_type:
|
106
|
+
data_class_type: Responses::TemplatesDataResponse,
|
107
|
+
error_class_type: Responses::GenericErrorResponse
|
108
108
|
)
|
109
109
|
end
|
110
110
|
|
@@ -112,8 +112,8 @@ module WhatsappSdk
|
|
112
112
|
# The message template namespace is required to send messages using the message templates.
|
113
113
|
#
|
114
114
|
# @param business_id [Integer] The business ID.
|
115
|
-
# @return [
|
116
|
-
sig { params(business_id: Integer).returns(
|
115
|
+
# @return [Response] Response object.
|
116
|
+
sig { params(business_id: Integer).returns(Response) }
|
117
117
|
def get_message_template_namespace(business_id:)
|
118
118
|
response = send_request(
|
119
119
|
endpoint: business_id.to_s,
|
@@ -121,10 +121,10 @@ module WhatsappSdk
|
|
121
121
|
params: { "fields" => "message_template_namespace" }
|
122
122
|
)
|
123
123
|
|
124
|
-
|
124
|
+
Response.new(
|
125
125
|
response: response,
|
126
|
-
data_class_type:
|
127
|
-
error_class_type:
|
126
|
+
data_class_type: Responses::MessageTemplateNamespaceDataResponse,
|
127
|
+
error_class_type: Responses::GenericErrorResponse
|
128
128
|
)
|
129
129
|
end
|
130
130
|
|
@@ -137,7 +137,7 @@ module WhatsappSdk
|
|
137
137
|
#
|
138
138
|
# @param id [String] Required. The message_template-id.
|
139
139
|
# @param components_json [Json] Components that make up the template..
|
140
|
-
# return [
|
140
|
+
# return [Response] Response object.
|
141
141
|
def update(template_id:, category: nil, components_json: nil)
|
142
142
|
if category && !WhatsappSdk::Resource::Template::Category.try_deserialize(category)
|
143
143
|
raise InvalidCategoryError.new(category: category)
|
@@ -154,10 +154,10 @@ module WhatsappSdk
|
|
154
154
|
headers: { "Content-Type" => "application/json" }
|
155
155
|
)
|
156
156
|
|
157
|
-
|
157
|
+
Response.new(
|
158
158
|
response: response,
|
159
|
-
data_class_type:
|
160
|
-
error_class_type:
|
159
|
+
data_class_type: Responses::SuccessResponse,
|
160
|
+
error_class_type: Responses::GenericErrorResponse
|
161
161
|
)
|
162
162
|
end
|
163
163
|
|
@@ -172,13 +172,13 @@ module WhatsappSdk
|
|
172
172
|
# @param name [String] Required. The template's name.
|
173
173
|
# @param hsm_id [String] Optional. The template's id.
|
174
174
|
#
|
175
|
-
# @return [
|
175
|
+
# @return [Response] Response object.
|
176
176
|
sig do
|
177
177
|
params(
|
178
178
|
business_id: Integer,
|
179
179
|
name: String,
|
180
180
|
hsm_id: T.nilable(String)
|
181
|
-
).returns(
|
181
|
+
).returns(Response)
|
182
182
|
end
|
183
183
|
def delete(business_id:, name:, hsm_id: nil)
|
184
184
|
params = { name: name }
|
@@ -190,10 +190,10 @@ module WhatsappSdk
|
|
190
190
|
params: params
|
191
191
|
)
|
192
192
|
|
193
|
-
|
193
|
+
Response.new(
|
194
194
|
response: response,
|
195
|
-
data_class_type:
|
196
|
-
error_class_type:
|
195
|
+
data_class_type: Responses::SuccessResponse,
|
196
|
+
error_class_type: Responses::GenericErrorResponse
|
197
197
|
)
|
198
198
|
end
|
199
199
|
end
|
data/lib/whatsapp_sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whatsapp_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ignacio-chiazzo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|