Class: Sendgrid::Web::FilterCommands
- Defined in:
- lib/sendgrid/web/filter_commands.rb
Instance Method Summary collapse
-
#activate_app(name: nil) ⇒ Sendgrid::Web::Response
Activate an app.
-
#deactivate_app(name: nil) ⇒ Sendgrid::Web::Response
Deactivate an app.
-
#get_available ⇒ Sendgrid::Web::Response
List all of the available apps.
-
#get_settings(name: nil) ⇒ Sendgrid::Web::Response
Retrieve the settings of an app.
-
#setup_app(options = {}) ⇒ Sendgrid::Web::Response
Update an apps settings.
Methods inherited from Client
base_uri, config, #config, configure
Instance Method Details
#activate_app(name: nil) ⇒ Sendgrid::Web::Response
Note:
name
is required.
Activate an app.
20 21 22 23 24 25 26 |
# 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) ⇒ Sendgrid::Web::Response
Note:
name
is required.
Deactivate an app.
33 34 35 36 37 38 39 |
# 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 ⇒ Sendgrid::Web::Response
Note:
The name entry is used in all the other API calls to identify the app.
List all of the available apps.
8 9 10 11 12 13 |
# 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) ⇒ Sendgrid::Web::Response
Note:
name
is required.
Retrieve the settings of an app.
59 60 61 62 63 64 65 |
# 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 = {}) ⇒ Sendgrid::Web::Response
Note:
Other options are dependant on the app in question.
Update an apps settings.
46 47 48 49 50 51 52 |
# File 'lib/sendgrid/web/filter_commands.rb', line 46 def setup_app( = {}) raise ArgumentError.new('Missing required `name` option') if [:name].nil? res = connection.post( '/api/filter.setup.json', default_params()) craft_response(res) end |