weft-sdk 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +9 -0
- data/docs/APIKeysApi.md +208 -0
- data/docs/AccountApi.md +72 -0
- data/docs/AccountDetails.md +30 -0
- data/docs/Agent.md +38 -0
- data/docs/AgentListResponse.md +20 -0
- data/docs/AgentResponse.md +18 -0
- data/docs/AgentStats.md +30 -0
- data/docs/AgentsApi.md +147 -0
- data/docs/ApiKey.md +28 -0
- data/docs/ApiKeyCreated.md +26 -0
- data/docs/ApiKeyCreatedResponse.md +18 -0
- data/docs/ApiKeyListResponse.md +18 -0
- data/docs/AuthApi.md +385 -0
- data/docs/AuthResponse.md +18 -0
- data/docs/AuthResponseData.md +22 -0
- data/docs/ConfirmRequest.md +18 -0
- data/docs/CreateApiKeyRequest.md +18 -0
- data/docs/DefaultApi.md +67 -0
- data/docs/Error.md +24 -0
- data/docs/ErrorResponse.md +18 -0
- data/docs/MeResponse.md +18 -0
- data/docs/MessageResponse.md +18 -0
- data/docs/MessageResponseData.md +18 -0
- data/docs/Pagination.md +24 -0
- data/docs/PasswordResetRequest.md +18 -0
- data/docs/PasswordUpdateRequest.md +22 -0
- data/docs/Payment.md +44 -0
- data/docs/PaymentListResponse.md +20 -0
- data/docs/PaymentResponse.md +18 -0
- data/docs/PaymentsApi.md +147 -0
- data/docs/ResendConfirmationRequest.md +18 -0
- data/docs/SignInRequest.md +20 -0
- data/docs/SignUpRequest.md +22 -0
- data/docs/User.md +22 -0
- data/lib/weft/facilitator/client.rb +89 -0
- data/lib/weft/facilitator/fee.rb +47 -0
- data/lib/weft/facilitator/middleware.rb +190 -0
- data/lib/weft/generated/api/account_api.rb +77 -0
- data/lib/weft/generated/api/agents_api.rb +148 -0
- data/lib/weft/generated/api/api_keys_api.rb +204 -0
- data/lib/weft/generated/api/auth_api.rb +418 -0
- data/lib/weft/generated/api/default_api.rb +77 -0
- data/lib/weft/generated/api/payments_api.rb +148 -0
- data/lib/weft/generated/api_client.rb +397 -0
- data/lib/weft/generated/api_error.rb +58 -0
- data/lib/weft/generated/api_model_base.rb +88 -0
- data/lib/weft/generated/configuration.rb +317 -0
- data/lib/weft/generated/models/account_details.rb +310 -0
- data/lib/weft/generated/models/agent.rb +417 -0
- data/lib/weft/generated/models/agent_list_response.rb +192 -0
- data/lib/weft/generated/models/agent_response.rb +164 -0
- data/lib/weft/generated/models/agent_stats.rb +201 -0
- data/lib/weft/generated/models/api_key.rb +244 -0
- data/lib/weft/generated/models/api_key_created.rb +252 -0
- data/lib/weft/generated/models/api_key_created_response.rb +164 -0
- data/lib/weft/generated/models/api_key_list_response.rb +166 -0
- data/lib/weft/generated/models/auth_response.rb +164 -0
- data/lib/weft/generated/models/auth_response_data.rb +199 -0
- data/lib/weft/generated/models/confirm_request.rb +164 -0
- data/lib/weft/generated/models/create_api_key_request.rb +148 -0
- data/lib/weft/generated/models/error.rb +208 -0
- data/lib/weft/generated/models/error_response.rb +164 -0
- data/lib/weft/generated/models/me_response.rb +164 -0
- data/lib/weft/generated/models/message_response.rb +164 -0
- data/lib/weft/generated/models/message_response_data.rb +164 -0
- data/lib/weft/generated/models/pagination.rb +242 -0
- data/lib/weft/generated/models/password_reset_request.rb +164 -0
- data/lib/weft/generated/models/password_update_request.rb +216 -0
- data/lib/weft/generated/models/payment.rb +437 -0
- data/lib/weft/generated/models/payment_list_response.rb +192 -0
- data/lib/weft/generated/models/payment_response.rb +164 -0
- data/lib/weft/generated/models/resend_confirmation_request.rb +164 -0
- data/lib/weft/generated/models/sign_in_request.rb +190 -0
- data/lib/weft/generated/models/sign_up_request.rb +216 -0
- data/lib/weft/generated/models/user.rb +199 -0
- data/lib/weft/generated/version.rb +15 -0
- data/lib/weft/generated.rb +4 -0
- data/lib/weft/sdk.rb +10 -0
- metadata +123 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Weft API
|
|
3
|
+
|
|
4
|
+
#API for agent-first payments and discovery.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.2.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Weft
|
|
16
|
+
class AccountApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get current account
|
|
23
|
+
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @return [MeResponse]
|
|
25
|
+
def get_me(opts = {})
|
|
26
|
+
data, _status_code, _headers = get_me_with_http_info(opts)
|
|
27
|
+
data
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Get current account
|
|
31
|
+
# @param [Hash] opts the optional parameters
|
|
32
|
+
# @return [Array<(MeResponse, Integer, Hash)>] MeResponse data, response status code and response headers
|
|
33
|
+
def get_me_with_http_info(opts = {})
|
|
34
|
+
if @api_client.config.debugging
|
|
35
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.get_me ...'
|
|
36
|
+
end
|
|
37
|
+
# resource path
|
|
38
|
+
local_var_path = '/api/v1/me'
|
|
39
|
+
|
|
40
|
+
# query parameters
|
|
41
|
+
query_params = opts[:query_params] || {}
|
|
42
|
+
|
|
43
|
+
# header parameters
|
|
44
|
+
header_params = opts[:header_params] || {}
|
|
45
|
+
# HTTP header 'Accept' (if needed)
|
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
47
|
+
|
|
48
|
+
# form parameters
|
|
49
|
+
form_params = opts[:form_params] || {}
|
|
50
|
+
|
|
51
|
+
# http body (model)
|
|
52
|
+
post_body = opts[:debug_body]
|
|
53
|
+
|
|
54
|
+
# return_type
|
|
55
|
+
return_type = opts[:debug_return_type] || 'MeResponse'
|
|
56
|
+
|
|
57
|
+
# auth_names
|
|
58
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
59
|
+
|
|
60
|
+
new_options = opts.merge(
|
|
61
|
+
:operation => :"AccountApi.get_me",
|
|
62
|
+
:header_params => header_params,
|
|
63
|
+
:query_params => query_params,
|
|
64
|
+
:form_params => form_params,
|
|
65
|
+
:body => post_body,
|
|
66
|
+
:auth_names => auth_names,
|
|
67
|
+
:return_type => return_type
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
71
|
+
if @api_client.config.debugging
|
|
72
|
+
@api_client.config.logger.debug "API called: AccountApi#get_me\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
73
|
+
end
|
|
74
|
+
return data, status_code, headers
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Weft API
|
|
3
|
+
|
|
4
|
+
#API for agent-first payments and discovery.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.2.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Weft
|
|
16
|
+
class AgentsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get agent details
|
|
23
|
+
# @param id [String] Agent ID or slug
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [AgentResponse]
|
|
26
|
+
def get_agent(id, opts = {})
|
|
27
|
+
data, _status_code, _headers = get_agent_with_http_info(id, opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Get agent details
|
|
32
|
+
# @param id [String] Agent ID or slug
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(AgentResponse, Integer, Hash)>] AgentResponse data, response status code and response headers
|
|
35
|
+
def get_agent_with_http_info(id, opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: AgentsApi.get_agent ...'
|
|
38
|
+
end
|
|
39
|
+
# verify the required parameter 'id' is set
|
|
40
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
41
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling AgentsApi.get_agent"
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/api/v1/agents/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
45
|
+
|
|
46
|
+
# query parameters
|
|
47
|
+
query_params = opts[:query_params] || {}
|
|
48
|
+
|
|
49
|
+
# header parameters
|
|
50
|
+
header_params = opts[:header_params] || {}
|
|
51
|
+
# HTTP header 'Accept' (if needed)
|
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
53
|
+
|
|
54
|
+
# form parameters
|
|
55
|
+
form_params = opts[:form_params] || {}
|
|
56
|
+
|
|
57
|
+
# http body (model)
|
|
58
|
+
post_body = opts[:debug_body]
|
|
59
|
+
|
|
60
|
+
# return_type
|
|
61
|
+
return_type = opts[:debug_return_type] || 'AgentResponse'
|
|
62
|
+
|
|
63
|
+
# auth_names
|
|
64
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
65
|
+
|
|
66
|
+
new_options = opts.merge(
|
|
67
|
+
:operation => :"AgentsApi.get_agent",
|
|
68
|
+
:header_params => header_params,
|
|
69
|
+
:query_params => query_params,
|
|
70
|
+
:form_params => form_params,
|
|
71
|
+
:body => post_body,
|
|
72
|
+
:auth_names => auth_names,
|
|
73
|
+
:return_type => return_type
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
77
|
+
if @api_client.config.debugging
|
|
78
|
+
@api_client.config.logger.debug "API called: AgentsApi#get_agent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
79
|
+
end
|
|
80
|
+
return data, status_code, headers
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# List agents
|
|
84
|
+
# @param [Hash] opts the optional parameters
|
|
85
|
+
# @option opts [Integer] :page Page number (default to 1)
|
|
86
|
+
# @option opts [Integer] :per_page Items per page (default to 25)
|
|
87
|
+
# @return [AgentListResponse]
|
|
88
|
+
def list_agents(opts = {})
|
|
89
|
+
data, _status_code, _headers = list_agents_with_http_info(opts)
|
|
90
|
+
data
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# List agents
|
|
94
|
+
# @param [Hash] opts the optional parameters
|
|
95
|
+
# @option opts [Integer] :page Page number (default to 1)
|
|
96
|
+
# @option opts [Integer] :per_page Items per page (default to 25)
|
|
97
|
+
# @return [Array<(AgentListResponse, Integer, Hash)>] AgentListResponse data, response status code and response headers
|
|
98
|
+
def list_agents_with_http_info(opts = {})
|
|
99
|
+
if @api_client.config.debugging
|
|
100
|
+
@api_client.config.logger.debug 'Calling API: AgentsApi.list_agents ...'
|
|
101
|
+
end
|
|
102
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
|
|
103
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling AgentsApi.list_agents, must be smaller than or equal to 100.'
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# resource path
|
|
107
|
+
local_var_path = '/api/v1/agents'
|
|
108
|
+
|
|
109
|
+
# query parameters
|
|
110
|
+
query_params = opts[:query_params] || {}
|
|
111
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
112
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
|
113
|
+
|
|
114
|
+
# header parameters
|
|
115
|
+
header_params = opts[:header_params] || {}
|
|
116
|
+
# HTTP header 'Accept' (if needed)
|
|
117
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
118
|
+
|
|
119
|
+
# form parameters
|
|
120
|
+
form_params = opts[:form_params] || {}
|
|
121
|
+
|
|
122
|
+
# http body (model)
|
|
123
|
+
post_body = opts[:debug_body]
|
|
124
|
+
|
|
125
|
+
# return_type
|
|
126
|
+
return_type = opts[:debug_return_type] || 'AgentListResponse'
|
|
127
|
+
|
|
128
|
+
# auth_names
|
|
129
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
130
|
+
|
|
131
|
+
new_options = opts.merge(
|
|
132
|
+
:operation => :"AgentsApi.list_agents",
|
|
133
|
+
:header_params => header_params,
|
|
134
|
+
:query_params => query_params,
|
|
135
|
+
:form_params => form_params,
|
|
136
|
+
:body => post_body,
|
|
137
|
+
:auth_names => auth_names,
|
|
138
|
+
:return_type => return_type
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
142
|
+
if @api_client.config.debugging
|
|
143
|
+
@api_client.config.logger.debug "API called: AgentsApi#list_agents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
144
|
+
end
|
|
145
|
+
return data, status_code, headers
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
end
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Weft API
|
|
3
|
+
|
|
4
|
+
#API for agent-first payments and discovery.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.2.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Weft
|
|
16
|
+
class APIKeysApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create an API key
|
|
23
|
+
# @param create_api_key_request [CreateApiKeyRequest]
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [ApiKeyCreatedResponse]
|
|
26
|
+
def create_api_key(create_api_key_request, opts = {})
|
|
27
|
+
data, _status_code, _headers = create_api_key_with_http_info(create_api_key_request, opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Create an API key
|
|
32
|
+
# @param create_api_key_request [CreateApiKeyRequest]
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(ApiKeyCreatedResponse, Integer, Hash)>] ApiKeyCreatedResponse data, response status code and response headers
|
|
35
|
+
def create_api_key_with_http_info(create_api_key_request, opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: APIKeysApi.create_api_key ...'
|
|
38
|
+
end
|
|
39
|
+
# verify the required parameter 'create_api_key_request' is set
|
|
40
|
+
if @api_client.config.client_side_validation && create_api_key_request.nil?
|
|
41
|
+
fail ArgumentError, "Missing the required parameter 'create_api_key_request' when calling APIKeysApi.create_api_key"
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/api/v1/api_keys'
|
|
45
|
+
|
|
46
|
+
# query parameters
|
|
47
|
+
query_params = opts[:query_params] || {}
|
|
48
|
+
|
|
49
|
+
# header parameters
|
|
50
|
+
header_params = opts[:header_params] || {}
|
|
51
|
+
# HTTP header 'Accept' (if needed)
|
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
53
|
+
# HTTP header 'Content-Type'
|
|
54
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
55
|
+
if !content_type.nil?
|
|
56
|
+
header_params['Content-Type'] = content_type
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# form parameters
|
|
60
|
+
form_params = opts[:form_params] || {}
|
|
61
|
+
|
|
62
|
+
# http body (model)
|
|
63
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_api_key_request)
|
|
64
|
+
|
|
65
|
+
# return_type
|
|
66
|
+
return_type = opts[:debug_return_type] || 'ApiKeyCreatedResponse'
|
|
67
|
+
|
|
68
|
+
# auth_names
|
|
69
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
70
|
+
|
|
71
|
+
new_options = opts.merge(
|
|
72
|
+
:operation => :"APIKeysApi.create_api_key",
|
|
73
|
+
:header_params => header_params,
|
|
74
|
+
:query_params => query_params,
|
|
75
|
+
:form_params => form_params,
|
|
76
|
+
:body => post_body,
|
|
77
|
+
:auth_names => auth_names,
|
|
78
|
+
:return_type => return_type
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
82
|
+
if @api_client.config.debugging
|
|
83
|
+
@api_client.config.logger.debug "API called: APIKeysApi#create_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
84
|
+
end
|
|
85
|
+
return data, status_code, headers
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# List API keys
|
|
89
|
+
# @param [Hash] opts the optional parameters
|
|
90
|
+
# @return [ApiKeyListResponse]
|
|
91
|
+
def list_api_keys(opts = {})
|
|
92
|
+
data, _status_code, _headers = list_api_keys_with_http_info(opts)
|
|
93
|
+
data
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# List API keys
|
|
97
|
+
# @param [Hash] opts the optional parameters
|
|
98
|
+
# @return [Array<(ApiKeyListResponse, Integer, Hash)>] ApiKeyListResponse data, response status code and response headers
|
|
99
|
+
def list_api_keys_with_http_info(opts = {})
|
|
100
|
+
if @api_client.config.debugging
|
|
101
|
+
@api_client.config.logger.debug 'Calling API: APIKeysApi.list_api_keys ...'
|
|
102
|
+
end
|
|
103
|
+
# resource path
|
|
104
|
+
local_var_path = '/api/v1/api_keys'
|
|
105
|
+
|
|
106
|
+
# query parameters
|
|
107
|
+
query_params = opts[:query_params] || {}
|
|
108
|
+
|
|
109
|
+
# header parameters
|
|
110
|
+
header_params = opts[:header_params] || {}
|
|
111
|
+
# HTTP header 'Accept' (if needed)
|
|
112
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
113
|
+
|
|
114
|
+
# form parameters
|
|
115
|
+
form_params = opts[:form_params] || {}
|
|
116
|
+
|
|
117
|
+
# http body (model)
|
|
118
|
+
post_body = opts[:debug_body]
|
|
119
|
+
|
|
120
|
+
# return_type
|
|
121
|
+
return_type = opts[:debug_return_type] || 'ApiKeyListResponse'
|
|
122
|
+
|
|
123
|
+
# auth_names
|
|
124
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
125
|
+
|
|
126
|
+
new_options = opts.merge(
|
|
127
|
+
:operation => :"APIKeysApi.list_api_keys",
|
|
128
|
+
:header_params => header_params,
|
|
129
|
+
:query_params => query_params,
|
|
130
|
+
:form_params => form_params,
|
|
131
|
+
:body => post_body,
|
|
132
|
+
:auth_names => auth_names,
|
|
133
|
+
:return_type => return_type
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
137
|
+
if @api_client.config.debugging
|
|
138
|
+
@api_client.config.logger.debug "API called: APIKeysApi#list_api_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
139
|
+
end
|
|
140
|
+
return data, status_code, headers
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Revoke an API key
|
|
144
|
+
# @param id [Integer] API key ID
|
|
145
|
+
# @param [Hash] opts the optional parameters
|
|
146
|
+
# @return [MessageResponse]
|
|
147
|
+
def revoke_api_key(id, opts = {})
|
|
148
|
+
data, _status_code, _headers = revoke_api_key_with_http_info(id, opts)
|
|
149
|
+
data
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Revoke an API key
|
|
153
|
+
# @param id [Integer] API key ID
|
|
154
|
+
# @param [Hash] opts the optional parameters
|
|
155
|
+
# @return [Array<(MessageResponse, Integer, Hash)>] MessageResponse data, response status code and response headers
|
|
156
|
+
def revoke_api_key_with_http_info(id, opts = {})
|
|
157
|
+
if @api_client.config.debugging
|
|
158
|
+
@api_client.config.logger.debug 'Calling API: APIKeysApi.revoke_api_key ...'
|
|
159
|
+
end
|
|
160
|
+
# verify the required parameter 'id' is set
|
|
161
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
162
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling APIKeysApi.revoke_api_key"
|
|
163
|
+
end
|
|
164
|
+
# resource path
|
|
165
|
+
local_var_path = '/api/v1/api_keys/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
166
|
+
|
|
167
|
+
# query parameters
|
|
168
|
+
query_params = opts[:query_params] || {}
|
|
169
|
+
|
|
170
|
+
# header parameters
|
|
171
|
+
header_params = opts[:header_params] || {}
|
|
172
|
+
# HTTP header 'Accept' (if needed)
|
|
173
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
174
|
+
|
|
175
|
+
# form parameters
|
|
176
|
+
form_params = opts[:form_params] || {}
|
|
177
|
+
|
|
178
|
+
# http body (model)
|
|
179
|
+
post_body = opts[:debug_body]
|
|
180
|
+
|
|
181
|
+
# return_type
|
|
182
|
+
return_type = opts[:debug_return_type] || 'MessageResponse'
|
|
183
|
+
|
|
184
|
+
# auth_names
|
|
185
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
186
|
+
|
|
187
|
+
new_options = opts.merge(
|
|
188
|
+
:operation => :"APIKeysApi.revoke_api_key",
|
|
189
|
+
:header_params => header_params,
|
|
190
|
+
:query_params => query_params,
|
|
191
|
+
:form_params => form_params,
|
|
192
|
+
:body => post_body,
|
|
193
|
+
:auth_names => auth_names,
|
|
194
|
+
:return_type => return_type
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
198
|
+
if @api_client.config.debugging
|
|
199
|
+
@api_client.config.logger.debug "API called: APIKeysApi#revoke_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
200
|
+
end
|
|
201
|
+
return data, status_code, headers
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
end
|