Sha256: ffef0d7ba9195a5272642e939da2b2b83f877710c94306daa191a81319e616a2

Contents?: true

Size: 1.26 KB

Versions: 108

Compression:

Stored size: 1.26 KB

Contents

# frozen_string_literal: true

module Files
  class ActionWebhookFailure
    attr_reader :options, :attributes

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

    # retry Action Webhook Failure
    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

    # retry Action Webhook Failure
    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
  end
end

Version data entries

108 entries across 108 versions & 1 rubygems

Version Path
files.com-1.0.229 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.228 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.227 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.226 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.225 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.224 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.223 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.222 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.221 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.220 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.219 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.218 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.217 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.216 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.215 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.214 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.213 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.212 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.211 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.210 lib/files.com/models/action_webhook_failure.rb