class Sendgrid::Web::FilterCommands

Public Instance Methods

activate_app(name: nil) click to toggle source

Activate an app.

@param name [String] The app in which to activate. @return [Sendgrid::Web::Response] The Sendgrid response. @note name is required.

# File lib/sendgrid/web/filter_commands.rb, line 20
def activate_app(name: nil)
  raise ArgumentError.new('Missing required `name` option') if name.nil?
  res = connection.post(
    '/api/filter.activate.json',
    default_params(name: name))
  craft_response(res)
end
deactivate_app(name: nil) click to toggle source

Deactivate an app.

@param name [String] The app in which to deactivate. @return [Sendgrid::Web::Response] The Sendgrid response. @note name is required.

# File lib/sendgrid/web/filter_commands.rb, line 33
def deactivate_app(name: nil)
  raise ArgumentError.new('Missing required `name` option') if name.nil?
  res = connection.post(
    '/api/filter.deactivate.json',
    default_params(name: name))
  craft_response(res)
end
get_available() click to toggle source

List all of the available apps.

@return [Sendgrid::Web::Response] The Sendgrid response. @note The name entry is used in all the other API calls to

identify the app.
# File lib/sendgrid/web/filter_commands.rb, line 8
def get_available
  res = connection.post(
    '/api/filter.getavailable.json',
    default_params)
  craft_response(res)
end
get_settings(name: nil) click to toggle source

Retrieve the settings of an app.

@param name [String] The app in which to retrieve. @return [Sendgrid::Web::Response] The Sendgrid response. @note name is required.

# File lib/sendgrid/web/filter_commands.rb, line 59
def get_settings(name: nil)
  raise ArgumentError.new('Missing required `name` option') if name.nil?
  res = connection.post(
    '/api/filter.getsettings.json',
    default_params(name: name))
  craft_response(res)
end
setup_app(options = {}) click to toggle source

Update an apps settings.

@param name [String] The app in which to update. @return [Sendgrid::Web::Response] The Sendgrid response. @note Other options are dependant on the app in question.

# File lib/sendgrid/web/filter_commands.rb, line 46
def setup_app(options = {})
  raise ArgumentError.new('Missing required `name` option') if options[:name].nil?
  res = connection.post(
    '/api/filter.setup.json',
    default_params(options))
  craft_response(res)
end