Class: Whatsapp::MessageTemplates::Response::Summary
- Inherits:
-
Object
- Object
- Whatsapp::MessageTemplates::Response::Summary
- Defined in:
- lib/ruby/whatsapp/message_templates/response/summary.rb
Overview
The summary block of a template list.
Worth reading rather than ignoring: message_template_count against
message_template_limit is the only way to see how close a WABA is to its
template cap — 250 for an unverified business portfolio, up to 6,000 for a
verified one with an approved display name. Hitting it turns every subsequent
create into an error.
Source: https://developers.facebook.com/docs/graph-api/reference/whats-app-business-account/message_templates/
Instance Attribute Summary collapse
- #are_translations_complete ⇒ Boolean?
-
#message_template_count ⇒ Integer?
Templates currently on the account.
-
#message_template_limit ⇒ Integer?
The account's cap.
- #total_count ⇒ Integer?
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(total_count: nil, message_template_count: nil, message_template_limit: nil, are_translations_complete: nil) ⇒ Summary
constructor
A new instance of Summary.
-
#remaining ⇒ Integer?
How many more templates the account can hold.
Constructor Details
#initialize(total_count: nil, message_template_count: nil, message_template_limit: nil, are_translations_complete: nil) ⇒ Summary
Returns a new instance of Summary.
35 36 37 38 39 40 41 |
# File 'lib/ruby/whatsapp/message_templates/response/summary.rb', line 35 def initialize(total_count: nil, message_template_count: nil, message_template_limit: nil, are_translations_complete: nil) @total_count = total_count @message_template_count = @message_template_limit = @are_translations_complete = are_translations_complete end |
Instance Attribute Details
#are_translations_complete ⇒ Boolean?
29 30 31 |
# File 'lib/ruby/whatsapp/message_templates/response/summary.rb', line 29 def are_translations_complete @are_translations_complete end |
#message_template_count ⇒ Integer?
Returns Templates currently on the account.
21 22 23 |
# File 'lib/ruby/whatsapp/message_templates/response/summary.rb', line 21 def @message_template_count end |
#message_template_limit ⇒ Integer?
Returns The account's cap.
25 26 27 |
# File 'lib/ruby/whatsapp/message_templates/response/summary.rb', line 25 def @message_template_limit end |
#total_count ⇒ Integer?
17 18 19 |
# File 'lib/ruby/whatsapp/message_templates/response/summary.rb', line 17 def total_count @total_count end |
Class Method Details
.deserialize(data) ⇒ Summary
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/ruby/whatsapp/message_templates/response/summary.rb', line 46 def deserialize(data) data ||= {} new( total_count: data["total_count"], message_template_count: data["message_template_count"], message_template_limit: data["message_template_limit"], are_translations_complete: data["are_translations_complete"] ) end |
Instance Method Details
#remaining ⇒ Integer?
How many more templates the account can hold.
60 61 62 63 64 |
# File 'lib/ruby/whatsapp/message_templates/response/summary.rb', line 60 def remaining return if .nil? || .nil? - end |