Sha256: c5a327b32a68bba07b0beb82972a3174188a526f958ccac60bb7eb7d657ee88b
Contents?: true
Size: 1.75 KB
Versions: 2
Compression:
Stored size: 1.75 KB
Contents
# frozen_string_literal: true module WhatsappSdk module Resource class Template module Status PENDING_DELETION = "PENDING_DELETION" APPROVED = "APPROVED" PENDING = "PENDING" REJECTED = "REJECTED" STATUSES = [PENDING_DELETION, APPROVED, PENDING, REJECTED].freeze def valid?(status) STATUSES.include?(status) end def serialize(status) STATUSES.include?(status) ? status : nil end end module Category AUTHENTICATION = "AUTHENTICATION" MARKETING = "MARKETING" UTILITY = "UTILITY" CATEGORIES = [AUTHENTICATION, MARKETING, UTILITY].freeze def self.valid?(category) CATEGORIES.include?(category) end def self.serialize(category) CATEGORIES.include?(category) ? category : nil end end attr_accessor :id, :status, :category, :language, :name, :components_json def initialize(id:, status:, category:, language: nil, name: nil, components_json: nil) @id = id @status = status @category = category @language = language @name = name @components_json = components_json end def self.from_hash(hash) new( id: hash["id"], status: hash["status"], category: hash["category"], language: hash["language"], name: hash["name"], components_json: hash["components"] ) end def ==(other) id == other.id && status == other.status && category == other.category && language == other.language && name == other.name && components_json == other.components_json end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
whatsapp_sdk-1.0.1 | lib/whatsapp_sdk/resource/template.rb |
whatsapp_sdk-1.0.0 | lib/whatsapp_sdk/resource/template.rb |