Module: ConfigStore::TokenAPIMethods
- Included in:
- API
- Defined in:
- lib/configstore/apis/token_api_methods.rb
Instance Method Summary collapse
- #create_token(token_hash) ⇒ Object
- #delete_token(token_uuid) ⇒ Object
- #get_token(token_uuid) ⇒ Object
- #list_tokens ⇒ Object
- #update_token(token_uuid, token_hash) ⇒ Object
Instance Method Details
#create_token(token_hash) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/configstore/apis/token_api_methods.rb', line 16 def create_token(token_hash) = {body: token_hash.to_json} = .merge(@options) return with_response_handling do self.class.post("/tokens", ) end end |
#delete_token(token_uuid) ⇒ Object
32 33 34 35 36 |
# File 'lib/configstore/apis/token_api_methods.rb', line 32 def delete_token(token_uuid) return with_response_handling do self.class.delete("/tokens/#{token_uuid}", @options) end end |
#get_token(token_uuid) ⇒ Object
10 11 12 13 14 |
# File 'lib/configstore/apis/token_api_methods.rb', line 10 def get_token(token_uuid) return with_response_handling do self.class.get("/tokens/#{token_uuid}", @options) end end |
#list_tokens ⇒ Object
4 5 6 7 8 |
# File 'lib/configstore/apis/token_api_methods.rb', line 4 def list_tokens return with_response_handling do self.class.get("/tokens", @options) end end |
#update_token(token_uuid, token_hash) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/configstore/apis/token_api_methods.rb', line 24 def update_token(token_uuid, token_hash) = {body: token_hash.to_json} = .merge(@options) return with_response_handling do self.class.put("/tokens/#{token_uuid}", ) end end |