Class: Unit::Webhook::ListWebhookParams

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/webhook/list_webhook_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(limit = WEBHOOK_LIMIT, offset = WEBHOOK_OFFSET, since = nil, until_ = nil, from_id = nil, told = nil) ⇒ ListWebhookParams

Returns a new instance of ListWebhookParams.

Parameters:

  • limit (Integer) (defaults to: WEBHOOK_LIMIT)
  • offset (Integer) (defaults to: WEBHOOK_OFFSET)
  • since (String) (defaults to: nil)
    • optional

  • until_ (String) (defaults to: nil)
    • optional

  • from_id (Integer) (defaults to: nil)
    • optional

  • told (Integer) (defaults to: nil)
    • optional



16
17
18
19
20
21
22
23
24
# File 'lib/unit/models/webhook/list_webhook_params.rb', line 16

def initialize(limit = WEBHOOK_LIMIT, offset = WEBHOOK_OFFSET, since = nil,
               until_ = nil, from_id = nil, told = nil)
  @limit = limit
  @offset = offset
  @since = since
  @until_ = until_
  @from_id = from_id
  @told = told
end

Instance Attribute Details

#from_idObject

Returns the value of attribute from_id.



8
9
10
# File 'lib/unit/models/webhook/list_webhook_params.rb', line 8

def from_id
  @from_id
end

#limitObject

Returns the value of attribute limit.



8
9
10
# File 'lib/unit/models/webhook/list_webhook_params.rb', line 8

def limit
  @limit
end

#offsetObject

Returns the value of attribute offset.



8
9
10
# File 'lib/unit/models/webhook/list_webhook_params.rb', line 8

def offset
  @offset
end

#sinceObject

Returns the value of attribute since.



8
9
10
# File 'lib/unit/models/webhook/list_webhook_params.rb', line 8

def since
  @since
end

#toldObject

Returns the value of attribute told.



8
9
10
# File 'lib/unit/models/webhook/list_webhook_params.rb', line 8

def told
  @told
end

#until_Object

Returns the value of attribute until_.



8
9
10
# File 'lib/unit/models/webhook/list_webhook_params.rb', line 8

def until_
  @until_
end

Instance Method Details

#to_hashObject



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/unit/models/webhook/list_webhook_params.rb', line 26

def to_hash
  payload = {
    "page[limit]": limit,
    "page[offset]": offset,
    "filter[since]": since,
    "filter[until]": until_,
    "filter[fromId]": from_id,
    "filter[told]": told
  }
  payload.compact!
end