Class: Hook0::Generated::ServiceTokenApi
- Inherits:
-
Object
- Object
- Hook0::Generated::ServiceTokenApi
- Defined in:
- lib/hook0/generated/api.rb
Overview
What the API declares under serviceToken, issued through the transport it is handed.
Instance Method Summary collapse
-
#create(body) ⇒ ServiceToken
Create a new service token.
-
#delete(service_token_id, organization_id) ⇒ void
Delete a service token.
-
#edit(service_token_id, body) ⇒ ServiceToken
Edit a service token.
-
#get(service_token_id, organization_id) ⇒ ServiceToken
Get a service token.
-
#initialize(transport) ⇒ ServiceTokenApi
constructor
A new instance of ServiceTokenApi.
-
#list(organization_id) ⇒ Array<ServiceToken>
List service tokens.
Constructor Details
#initialize(transport) ⇒ ServiceTokenApi
Returns a new instance of ServiceTokenApi.
832 833 834 |
# File 'lib/hook0/generated/api.rb', line 832 def initialize(transport) @transport = transport end |
Instance Method Details
#create(body) ⇒ ServiceToken
Create a new service token
840 841 842 843 844 845 846 847 848 849 850 |
# File 'lib/hook0/generated/api.rb', line 840 def create(body) read_answer( @transport.request( "POST", "/api/v1/service_token/", [], body.to_h ), ServiceToken.method(:from_json) ) end |
#delete(service_token_id, organization_id) ⇒ void
This method returns an undefined value.
Delete a service token
857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 |
# File 'lib/hook0/generated/api.rb', line 857 def delete(service_token_id, organization_id) check_answer( @transport.request( "DELETE", Runtime.path( "/api/v1/service_token/{service_token_id}", "service_token_id" => service_token_id ), Runtime.query( [ ["organization_id", organization_id] ], [] ), nil ) ) end |
#edit(service_token_id, body) ⇒ ServiceToken
Edit a service token
881 882 883 884 885 886 887 888 889 890 891 892 893 894 |
# File 'lib/hook0/generated/api.rb', line 881 def edit(service_token_id, body) read_answer( @transport.request( "PUT", Runtime.path( "/api/v1/service_token/{service_token_id}", "service_token_id" => service_token_id ), [], body.to_h ), ServiceToken.method(:from_json) ) end |
#get(service_token_id, organization_id) ⇒ ServiceToken
Get a service token
901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 |
# File 'lib/hook0/generated/api.rb', line 901 def get(service_token_id, organization_id) read_answer( @transport.request( "GET", Runtime.path( "/api/v1/service_token/{service_token_id}", "service_token_id" => service_token_id ), Runtime.query( [ ["organization_id", organization_id] ], [] ), nil ), ServiceToken.method(:from_json) ) end |
#list(organization_id) ⇒ Array<ServiceToken>
List service tokens
925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 |
# File 'lib/hook0/generated/api.rb', line 925 def list(organization_id) read_answer( @transport.request( "GET", "/api/v1/service_token/", Runtime.query( [ ["organization_id", organization_id] ], [] ), nil ), Runtime.list(ServiceToken.method(:from_json)) ) end |