Class: Sendgrid::Web::Credentials
- Defined in:
- lib/sendgrid/web/credentials.rb
Instance Method Summary collapse
-
#add(username: nil, password: nil, permissions: nil) ⇒ Sendgrid::Web::Response
This API call allows user to add a new set of credentials to their account.
-
#delete(username: nil) ⇒ Sendgrid::Web::Response
Remove an individuals credentials.
-
#edit(username: nil, password: nil, permissions: nil) ⇒ Sendgrid::Web::Response
Update/edit a users credentials and permissions.
-
#get(username: nil) ⇒ Sendgrid::Web::Response
Retrieve a list of all credentials, or permissions for a specific credential.
Methods inherited from Client
base_uri, config, #config, configure
Instance Method Details
#add(username: nil, password: nil, permissions: nil) ⇒ Sendgrid::Web::Response
Note:
Requires username
and password
.
This API call allows user to add a new set of credentials to their account.
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/sendgrid/web/credentials.rb', line 35 def add(username: nil, password: nil, permissions: nil) raise ArgumentError.new('Missing required `username` option') if username.nil? raise ArgumentError.new('Missing required `password` option') if password.nil? res = connection.post( '/api/credentials/add.json', default_params( username: username, password: password, permissions: )) craft_response(res) end |
#delete(username: nil) ⇒ Sendgrid::Web::Response
Note:
username
is required.
Remove an individuals credentials.
71 72 73 74 75 76 77 78 |
# File 'lib/sendgrid/web/credentials.rb', line 71 def delete(username: nil) raise ArgumentError.new('Missing required `username` option') if username.nil? res = connection.post( '/api/credentials/delete.json', default_params( username: username)) craft_response(res) end |
#edit(username: nil, password: nil, permissions: nil) ⇒ Sendgrid::Web::Response
Note:
Only username
is required.
Update/edit a users credentials and permissions.
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/sendgrid/web/credentials.rb', line 55 def edit(username: nil, password: nil, permissions: nil) raise ArgumentError.new('Missing required `username` option') if username.nil? res = connection.post( '/api/credentials/edit.json', default_params( username: username, password: password, permissions: )) craft_response(res) end |
#get(username: nil) ⇒ Sendgrid::Web::Response
Note:
All parameters are optional
Retrieve a list of all credentials, or permissions for a specific credential.
10 11 12 13 14 15 |
# File 'lib/sendgrid/web/credentials.rb', line 10 def get(username: nil) res = connection.post( '/api/credentials/get.json', default_params(username: username)) craft_response(res) end |