Class: Files::ActionWebhookFailure

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/action_webhook_failure.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ ActionWebhookFailure

Returns a new instance of ActionWebhookFailure.



7
8
9
10
# File 'lib/files.com/models/action_webhook_failure.rb', line 7

def initialize(attributes = {}, options = {})
  @attributes = attributes || {}
  @options = options || {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/files.com/models/action_webhook_failure.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/files.com/models/action_webhook_failure.rb', line 5

def options
  @options
end

Class Method Details

.retry(id, params = {}, options = {}) ⇒ Object

retry Action Webhook Failure



24
25
26
27
28
29
30
31
32
# File 'lib/files.com/models/action_webhook_failure.rb', line 24

def self.retry(id, params = {}, options = {})
  params ||= {}
  params[:id] = id
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)

  response, _options = Api.send_request("/action_webhook_failures/#{params[:id]}/retry", :post, params, options)
  response.data
end

Instance Method Details

#retry(params = {}) ⇒ Object

retry Action Webhook Failure



13
14
15
16
17
18
19
20
21
# File 'lib/files.com/models/action_webhook_failure.rb', line 13

def retry(params = {})
  params ||= {}
  params[:id] = @attributes[:id]
  raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)

  Api.send_request("/action_webhook_failures/#{@attributes[:id]}/retry", :post, params, @options)
end