Class: MessageMediaWebhooks::UpdateWebhookRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/message_media_webhooks/models/update_webhook_request.rb

Overview

UpdateWebhookRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(url = nil, method = nil, encoding = nil, events = nil, template = nil) ⇒ UpdateWebhookRequest

Returns a new instance of UpdateWebhookRequest.



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

def initialize(url = nil,
               method = nil,
               encoding = nil,
               events = nil,
               template = nil)
  @url = url
  @method = method
  @encoding = encoding
  @events = events
  @template = template
end

Instance Attribute Details

#encodingString

TODO: Write general description for this method

Returns:



15
16
17
# File 'lib/message_media_webhooks/models/update_webhook_request.rb', line 15

def encoding
  @encoding
end

#eventsList of String

TODO: Write general description for this method

Returns:



19
20
21
# File 'lib/message_media_webhooks/models/update_webhook_request.rb', line 19

def events
  @events
end

#methodString

TODO: Write general description for this method

Returns:



11
12
13
# File 'lib/message_media_webhooks/models/update_webhook_request.rb', line 11

def method
  @method
end

#templateString

TODO: Write general description for this method

Returns:



23
24
25
# File 'lib/message_media_webhooks/models/update_webhook_request.rb', line 23

def template
  @template
end

#urlString

TODO: Write general description for this method

Returns:



7
8
9
# File 'lib/message_media_webhooks/models/update_webhook_request.rb', line 7

def url
  @url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/message_media_webhooks/models/update_webhook_request.rb', line 49

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  url = hash['url']
  method = hash['method']
  encoding = hash['encoding']
  events = hash['events']
  template = hash['template']

  # Create object from extracted values.
  UpdateWebhookRequest.new(url,
                           method,
                           encoding,
                           events,
                           template)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
33
34
# File 'lib/message_media_webhooks/models/update_webhook_request.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['url'] = 'url'
  @_hash['method'] = 'method'
  @_hash['encoding'] = 'encoding'
  @_hash['events'] = 'events'
  @_hash['template'] = 'template'
  @_hash
end