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.289 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.288 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.287 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.286 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.285 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.284 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.283 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.282 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.281 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.280 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.279 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.278 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.277 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.276 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.275 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.274 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.273 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.272 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.271 lib/files.com/models/action_webhook_failure.rb
files.com-1.0.270 lib/files.com/models/action_webhook_failure.rb