Class: WhatsAppCloudApi::RetrieveMediaURLResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/whats_app_cloud_api/models/retrieve_media_url_response.rb

Overview

RetrieveMediaURLResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(messaging_product = nil, url = nil, mime_type = nil, sha256 = nil, file_size = nil, id = nil) ⇒ RetrieveMediaURLResponse

Returns a new instance of RetrieveMediaURLResponse.



58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/whats_app_cloud_api/models/retrieve_media_url_response.rb', line 58

def initialize(messaging_product = nil,
               url = nil,
               mime_type = nil,
               sha256 = nil,
               file_size = nil,
               id = nil)
  @messaging_product = messaging_product unless messaging_product == SKIP
  @url = url unless url == SKIP
  @mime_type = mime_type unless mime_type == SKIP
  @sha256 = sha256 unless sha256 == SKIP
  @file_size = file_size unless file_size == SKIP
  @id = id unless id == SKIP
end

Instance Attribute Details

#file_sizeString

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/whats_app_cloud_api/models/retrieve_media_url_response.rb', line 30

def file_size
  @file_size
end

#idString

TODO: Write general description for this method

Returns:

  • (String)


34
35
36
# File 'lib/whats_app_cloud_api/models/retrieve_media_url_response.rb', line 34

def id
  @id
end

#messaging_productString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/whats_app_cloud_api/models/retrieve_media_url_response.rb', line 14

def messaging_product
  @messaging_product
end

#mime_typeString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/whats_app_cloud_api/models/retrieve_media_url_response.rb', line 22

def mime_type
  @mime_type
end

#sha256String

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/whats_app_cloud_api/models/retrieve_media_url_response.rb', line 26

def sha256
  @sha256
end

#urlString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/whats_app_cloud_api/models/retrieve_media_url_response.rb', line 18

def url
  @url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/whats_app_cloud_api/models/retrieve_media_url_response.rb', line 73

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  messaging_product =
    hash.key?('messaging_product') ? hash['messaging_product'] : SKIP
  url = hash.key?('url') ? hash['url'] : SKIP
  mime_type = hash.key?('mime_type') ? hash['mime_type'] : SKIP
  sha256 = hash.key?('sha256') ? hash['sha256'] : SKIP
  file_size = hash.key?('file_size') ? hash['file_size'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP

  # Create object from extracted values.
  RetrieveMediaURLResponse.new(messaging_product,
                               url,
                               mime_type,
                               sha256,
                               file_size,
                               id)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/whats_app_cloud_api/models/retrieve_media_url_response.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['messaging_product'] = 'messaging_product'
  @_hash['url'] = 'url'
  @_hash['mime_type'] = 'mime_type'
  @_hash['sha256'] = 'sha256'
  @_hash['file_size'] = 'file_size'
  @_hash['id'] = 'id'
  @_hash
end

Instance Method Details

#nullablesObject

An array for nullable fields



54
55
56
# File 'lib/whats_app_cloud_api/models/retrieve_media_url_response.rb', line 54

def nullables
  []
end

#optionalsObject

An array for optional fields



49
50
51
# File 'lib/whats_app_cloud_api/models/retrieve_media_url_response.rb', line 49

def optionals
  []
end