Class: DataSift::AccountIdentityToken
- Inherits:
-
ApiResource
- Object
- ApiResource
- DataSift::AccountIdentityToken
- Defined in:
- lib/account_identity_token.rb
Overview
Class for accessing DataSift’s Account API Identity Tokens
Constant Summary
Constants inherited from ApiResource
DataSift::ApiResource::TLSv1, DataSift::ApiResource::TLSv1_2
Constants included from DataSift
APPLICATION_JSON, DELETE, DETECT_DEAD_SOCKETS, GET, HEAD, IS_WINDOWS, KNOWN_SOCKETS, SOCKET_DETECTOR_TIMEOUT, VERSION, X_ANALYSIS_TASKS_QUEUED, X_ANALYSIS_TASKS_QUEUE_LIMIT, X_INSIGHT_TASKS_QUEUED, X_INSIGHT_TASKS_QUEUE_LIMIT, X_RATELIMIT_COST, X_RATELIMIT_LIMIT, X_RATELIMIT_REMAINING, X_TASKS_QUEUED, X_TASKS_QUEUE_LIMIT
Instance Method Summary collapse
-
#create(identity_id = '', service = '', token = '') ⇒ Object
Creates a new Identity Token.
-
#delete(identity_id = '', service = '') ⇒ Object
Deletes a specific Token by Identity and Service.
-
#get(identity_id = '', service = '') ⇒ Object
Get a Token for a given Identity and Service.
-
#list(identity_id = '', per_page = '', page = '') ⇒ Object
Returns a list of Tokens for a given Identity.
-
#update(identity_id = '', service = '', token = '') ⇒ Object
Updates a specific Token by Identity ID and Service.
Methods inherited from ApiResource
Methods included from DataSift
Constructor Details
This class inherits a constructor from DataSift::ApiResource
Instance Method Details
#create(identity_id = '', service = '', token = '') ⇒ Object
Creates a new Identity Token
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/account_identity_token.rb', line 13 def create(identity_id = '', service = '', token = '') fail BadParametersError, 'identity_id is required' if identity_id.empty? fail BadParametersError, 'service is required' if service.empty? fail BadParametersError, 'token is required' if token.empty? params = { service: service, token: token } DataSift.request(:POST, "account/identity/#{identity_id}/token", @config, params) end |
#delete(identity_id = '', service = '') ⇒ Object
Deletes a specific Token by Identity and Service
79 80 81 82 83 84 |
# File 'lib/account_identity_token.rb', line 79 def delete(identity_id = '', service = '') fail BadParametersError, 'identity_id is required' if identity_id.empty? fail BadParametersError, 'service is required' if service.empty? DataSift.request(:DELETE, "account/identity/#{identity_id}/token/#{service}", @config) end |
#get(identity_id = '', service = '') ⇒ Object
Get a Token for a given Identity and Service
31 32 33 34 35 36 |
# File 'lib/account_identity_token.rb', line 31 def get(identity_id = '', service = '') fail BadParametersError, 'identity_id is required' if identity_id.empty? fail BadParametersError, 'service is required' if service.empty? DataSift.request(:GET, "account/identity/#{identity_id}/token/#{service}", @config) end |
#list(identity_id = '', per_page = '', page = '') ⇒ Object
Returns a list of Tokens for a given Identity
45 46 47 48 49 50 51 52 |
# File 'lib/account_identity_token.rb', line 45 def list(identity_id = '', per_page = '', page = '') params = { identity_id: identity_id } requires params params.merge!(per_page: per_page) unless per_page.empty? params.merge!(page: page) unless page.empty? DataSift.request(:GET, "account/identity/#{identity_id}/token", @config, params) end |
#update(identity_id = '', service = '', token = '') ⇒ Object
Updates a specific Token by Identity ID and Service
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/account_identity_token.rb', line 62 def update(identity_id = '', service = '', token = '') fail BadParametersError, 'identity_id is required' if identity_id.empty? fail BadParametersError, 'service is required' if service.empty? fail BadParametersError, 'token is required' if token.empty? params = { token: token } DataSift.request(:PUT, "account/identity/#{identity_id}/token/#{service}", @config, params) end |