Class: CloudWaba::Models::Media::Response

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Helpers, T::Sig
Defined in:
lib/cloud_waba/models/media/response.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(hash:) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/cloud_waba/models/media/response.rb', line 27

def self.parse(hash:)
  id = hash["id"]
  url = hash["url"]
  mime_type = hash["mime_type"]
  sha256 = hash["sha256"]
  file_size = hash["file_size"]

  self.new(
    messaging_product: ::CloudWaba::Models::Enums::MessagingProduct::WhatsApp,
    url: url,
    mime_type: mime_type,
    sha256: sha256,
    file_size: file_size,
    id: id,
  )
end

Instance Method Details

#messaging_productObject

"messaging_product": "whatsapp",
"url": "<URL>",
"mime_type": "<MIME_TYPE>",
"sha256": "<HASH>",
"file_size": "<FILE_SIZE>",
"id": "<MEDIA_ID>"



19
# File 'lib/cloud_waba/models/media/response.rb', line 19

prop :messaging_product, ::CloudWaba::Models::Enums::MessagingProduct