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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa0d6e4b9794168087c75aab57f48d377184850652b7cf7b9ffee57879a38c82
4
- data.tar.gz: 25fc304e0f05d91b00897dc8c30b27040da480b78de38f3ec277119c610cdc7c
3
+ metadata.gz: 3afc828e9c913c0aa1988b1ec75dcbd6453f13f67d46f3a25c77ef2558aacf8c
4
+ data.tar.gz: 64d8ea9e6c36c6d37c8dad014ee1dab10d906df4dcb7777206f6fc7300af44b6
5
5
  SHA512:
6
- metadata.gz: 2105c7f9a2a777dce4e486c3e8a1eef8e65b0888e06bd4f01d11822532e7162a5183c07606e96af4aa8ffdfd0c14a10a52b23cffd4a51f869aa9e8435ce0a210
7
- data.tar.gz: 655c3432bf4088c9a408b297761e18a996beffda0ff72fc3516fb6988bbd024f0239b0b89cbf351ee30972375f6c1f5f181c4b45eeae9c973592e93766f78ae6
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- whatsapp_sdk (0.10.0)
4
+ whatsapp_sdk (0.11.0)
5
5
  faraday (~> 2)
6
6
  faraday-multipart (~> 1)
7
7
  sorbet-runtime (~> 0.5)
@@ -6,7 +6,7 @@ module WhatsappSdk
6
6
  module ApiConfiguration
7
7
  extend T::Sig
8
8
 
9
- API_VERSION = T.let("v16.0", String)
9
+ API_VERSION = T.let("v19.0", String)
10
10
  API_URL = T.let("https://graph.facebook.com/#{API_VERSION}/", String)
11
11
  end
12
12
  end
@@ -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 [WhatsappSdk::Api::Response] Response object.
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(WhatsappSdk::Api::Response)
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
- WhatsappSdk::Api::Response.new(
81
+ Response.new(
82
82
  response: response,
83
- data_class_type: WhatsappSdk::Api::Responses::TemplateDataResponse,
84
- error_class_type: WhatsappSdk::Api::Responses::GenericErrorResponse
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 [WhatsappSdk::Api::Response] Response object.
93
- sig { params(business_id: Integer, limit: T.nilable(Integer)).returns(WhatsappSdk::Api::Response) }
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
- WhatsappSdk::Api::Response.new(
104
+ Response.new(
105
105
  response: response,
106
- data_class_type: WhatsappSdk::Api::Responses::TemplatesDataResponse,
107
- error_class_type: WhatsappSdk::Api::Responses::GenericErrorResponse
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 [WhatsappSdk::Api::Response] Response object.
116
- sig { params(business_id: Integer).returns(WhatsappSdk::Api::Response) }
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
- WhatsappSdk::Api::Response.new(
124
+ Response.new(
125
125
  response: response,
126
- data_class_type: WhatsappSdk::Api::Responses::MessageTemplateNamespaceDataResponse,
127
- error_class_type: WhatsappSdk::Api::Responses::GenericErrorResponse
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 [WhatsappSdk::Api::Response] Response object.
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
- WhatsappSdk::Api::Response.new(
157
+ Response.new(
158
158
  response: response,
159
- data_class_type: WhatsappSdk::Api::Responses::SuccessResponse,
160
- error_class_type: WhatsappSdk::Api::Responses::GenericErrorResponse
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 [WhatsappSdk::Api::Response] Response object.
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(WhatsappSdk::Api::Response)
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
- WhatsappSdk::Api::Response.new(
193
+ Response.new(
194
194
  response: response,
195
- data_class_type: WhatsappSdk::Api::Responses::SuccessResponse,
196
- error_class_type: WhatsappSdk::Api::Responses::GenericErrorResponse
195
+ data_class_type: Responses::SuccessResponse,
196
+ error_class_type: Responses::GenericErrorResponse
197
197
  )
198
198
  end
199
199
  end
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module WhatsappSdk
5
- VERSION = "0.10.0"
5
+ VERSION = "0.11.0"
6
6
  end
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.10.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: 2023-12-04 00:00:00.000000000 Z
11
+ date: 2024-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler