cybersource_rest_client 0.0.87 → 0.0.88
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 +4 -4
- data/lib/cybersource_rest_client/api/acp_checkout_api.rb +553 -0
- data/lib/cybersource_rest_client/api/agent_registration_api.rb +721 -0
- data/lib/cybersource_rest_client/api/bank_account_validation_api.rb +0 -1
- data/lib/cybersource_rest_client/api/enrollment_api.rb +104 -0
- data/lib/cybersource_rest_client/api/{merchant_capabilities_api.rb → merchant_registration_api.rb} +47 -391
- data/lib/cybersource_rest_client/api/payment_events_api.rb +197 -0
- data/lib/cybersource_rest_client/api/product_feed_api.rb +365 -0
- data/lib/cybersource_rest_client/api/purchase_intent_api.rb +278 -0
- data/lib/cybersource_rest_client/api/ucp_checkout_api.rb +453 -0
- data/lib/cybersource_rest_client/models/activate_merchant_key_response200.rb +1 -1
- data/lib/cybersource_rest_client/models/add_agent_key_response201.rb +11 -11
- data/lib/cybersource_rest_client/models/agent_registration_response201.rb +13 -15
- data/lib/cybersource_rest_client/models/agent_registration_response201_keys.rb +8 -8
- data/lib/cybersource_rest_client/models/agent_request.rb +9 -11
- data/lib/cybersource_rest_client/models/agent_update.rb +7 -9
- data/lib/cybersource_rest_client/models/auth_reversal_request.rb +1 -1
- data/lib/cybersource_rest_client/models/boarding_payouts_configurations.rb +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_200_19_google_merchant_products.rb → boarding_payouts_configurations_acquirer.rb} +33 -76
- data/lib/cybersource_rest_client/models/{inline_response_200_19_errors.rb → boarding_payouts_configurations_merchant_descriptor.rb} +25 -33
- data/lib/cybersource_rest_client/models/boarding_payouts_configurations_processors.rb +581 -0
- data/lib/cybersource_rest_client/models/capture_payment_request.rb +1 -1
- data/lib/cybersource_rest_client/models/create_order_request.rb +11 -1
- data/lib/cybersource_rest_client/models/create_payment_request.rb +14 -1
- data/lib/cybersource_rest_client/models/create_session_req.rb +14 -1
- data/lib/cybersource_rest_client/models/create_session_request.rb +14 -1
- data/lib/cybersource_rest_client/models/iccv1agents_keys.rb +4 -4
- data/lib/cybersource_rest_client/models/iccv1merchants_api_integrations.rb +2 -2
- data/lib/cybersource_rest_client/models/iccv1merchants_encryption_key.rb +6 -6
- data/lib/cybersource_rest_client/models/iccv1merchants_protocol_interactions.rb +1 -1
- data/lib/cybersource_rest_client/models/iccv1merchants_web_integrations.rb +2 -2
- data/lib/cybersource_rest_client/models/inline_response_200_17.rb +55 -0
- data/lib/cybersource_rest_client/models/inline_response_200_18.rb +40 -0
- data/lib/cybersource_rest_client/models/inline_response_200_19.rb +30 -107
- data/lib/cybersource_rest_client/models/inline_response_200_19_processing.rb +213 -0
- data/lib/cybersource_rest_client/models/inline_response_200_19_syndication.rb +224 -0
- data/lib/cybersource_rest_client/models/inline_response_200_20_products.rb +80 -682
- data/lib/cybersource_rest_client/models/inline_response_201_12.rb +40 -0
- data/lib/cybersource_rest_client/models/inline_response_201_12_fulfillment_options.rb +30 -0
- data/lib/cybersource_rest_client/models/inline_response_201_12_totals.rb +15 -0
- data/lib/cybersource_rest_client/models/inline_response_201_6_setups_risk.rb +15 -5
- data/lib/cybersource_rest_client/models/inline_response_201_6_setups_value_added_services.rb +15 -5
- data/lib/cybersource_rest_client/models/{deactivate_merchant_key_response200.rb → inline_response_202_1.rb} +11 -16
- data/lib/cybersource_rest_client/models/key_request.rb +4 -4
- data/lib/cybersource_rest_client/models/key_request_1.rb +5 -5
- data/lib/cybersource_rest_client/models/key_update.rb +5 -5
- data/lib/cybersource_rest_client/models/key_update_1.rb +5 -5
- data/lib/cybersource_rest_client/models/list_agent_keys_response200.rb +2 -2
- data/lib/cybersource_rest_client/models/merchant_registration_response201.rb +10 -10
- data/lib/cybersource_rest_client/models/merchant_registration_response201_api_integrations.rb +225 -0
- data/lib/cybersource_rest_client/models/merchant_registration_response201_keys.rb +1 -1
- data/lib/cybersource_rest_client/models/merchant_registration_response201_web_integrations.rb +225 -0
- data/lib/cybersource_rest_client/models/merchant_request.rb +7 -7
- data/lib/cybersource_rest_client/models/merchant_update.rb +7 -7
- data/lib/cybersource_rest_client/models/mit_reversal_request.rb +1 -1
- data/lib/cybersource_rest_client/models/mit_void_request.rb +15 -5
- data/lib/cybersource_rest_client/models/payments_configuration_setup.rb +11 -1
- data/lib/cybersource_rest_client/models/payments_products.rb +11 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response.rb +12 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1.rb +12 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_order_information.rb +44 -1
- data/lib/cybersource_rest_client/models/{pts_v2_payouts_post201_response_merchant_information_merchant_descriptor.rb → pts_v2_payments_post201_response_1_order_information_merchant_descriptor.rb} +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_1_processor_information.rb +18 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_installment_information.rb +101 -5
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_order_information_ship_to.rb +12 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_point_of_sale_information.rb +22 -5
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +22 -5
- data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_processor_information.rb +22 -5
- data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response.rb +1 -1
- data/lib/cybersource_rest_client/models/{ptsv2paymentsidreversals_point_of_sale_information.rb → pts_v2_payments_reversals_post201_response_point_of_sale_information.rb} +2 -2
- data/lib/cybersource_rest_client/models/{ptsv2paymentsidreversals_point_of_sale_information_emv.rb → pts_v2_payments_reversals_post201_response_point_of_sale_information_emv.rb} +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response_processor_information.rb +22 -5
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_merchant_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2intents_buyer_information.rb +196 -0
- data/lib/cybersource_rest_client/models/ptsv2intents_merchant_information_merchant_descriptor.rb +18 -1
- data/lib/cybersource_rest_client/models/ptsv2intents_order_information_bill_to.rb +154 -1
- data/lib/cybersource_rest_client/models/ptsv2intents_order_information_line_items.rb +16 -5
- data/lib/cybersource_rest_client/models/ptsv2intentsid_merchant_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2intentsid_merchant_information_merchant_descriptor.rb +207 -0
- data/lib/cybersource_rest_client/models/{ptsv2paymentsidcaptures_point_of_sale_information.rb → ptsv2payments_buyer.rb} +55 -31
- data/lib/cybersource_rest_client/models/{inline_response_200_19_google_merchant.rb → ptsv2payments_order_history.rb} +42 -41
- data/lib/cybersource_rest_client/models/ptsv2payments_ship_to.rb +281 -0
- data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_point_of_sale_information.rb +1 -1
- data/lib/cybersource_rest_client/models/{ptsv2paymentsidcaptures_point_of_sale_information_emv.rb → ptsv2paymentsidrefunds_point_of_sale_information_emv.rb} +1 -1
- data/lib/cybersource_rest_client/models/risk_products.rb +15 -5
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_point_of_sale_information.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_point_of_sale_information.rb +1 -1
- data/lib/cybersource_rest_client/models/unifiedrisk_acquirer_merchant_account_security_amount.rb +3 -3
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_merchant_descriptor_expected_annual_sales.rb +3 -3
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_merchant_descriptor_expected_average_ticket_size.rb +3 -3
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_merchant_descriptor_expected_monthly_sales.rb +3 -3
- data/lib/cybersource_rest_client/models/unifiedrisk_merchant_merchant_descriptor_limit_value.rb +3 -3
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_bank_account_balance_before.rb +2 -2
- data/lib/cybersource_rest_client/models/unifiedrisk_payment_bank_account_credit_limit.rb +3 -3
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction_additional_fees.rb +2 -2
- data/lib/cybersource_rest_client/models/unifiedrisk_transaction_amount.rb +3 -3
- data/lib/cybersource_rest_client/models/value_added_services_products.rb +15 -5
- data/lib/cybersource_rest_client/models/void_capture_request.rb +15 -5
- data/lib/cybersource_rest_client/models/void_credit_request.rb +15 -5
- data/lib/cybersource_rest_client/models/void_payment_request.rb +15 -5
- data/lib/cybersource_rest_client/models/void_refund_request.rb +15 -5
- data/lib/cybersource_rest_client.rb +25 -11
- metadata +27 -13
- data/lib/cybersource_rest_client/api/agent_capabilities_api.rb +0 -2279
|
@@ -0,0 +1,721 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#CyberSource Merged Spec
|
|
3
|
+
|
|
4
|
+
#All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.38
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'uri'
|
|
13
|
+
require 'AuthenticationSDK/util/MLEUtility'
|
|
14
|
+
module CyberSource
|
|
15
|
+
class AgentRegistrationApi
|
|
16
|
+
attr_accessor :api_client
|
|
17
|
+
|
|
18
|
+
def initialize(api_client = ApiClient.default, config)
|
|
19
|
+
@api_client = api_client
|
|
20
|
+
@api_client.set_configuration(config)
|
|
21
|
+
end
|
|
22
|
+
# Activate a key
|
|
23
|
+
# **Activate a Key**<br>Activates a deactivated public key, making it available for signature verification.<br><br> Returns **404** if the agent or key is not found, **403** if the agent is deactivated.
|
|
24
|
+
#
|
|
25
|
+
# @param agent_id Unique agent identifier
|
|
26
|
+
# @param key_id Unique key identifier
|
|
27
|
+
# @param [Hash] opts the optional parameters
|
|
28
|
+
# @return [AddAgentKeyResponse201]
|
|
29
|
+
#
|
|
30
|
+
def activate_agent_key(agent_id, key_id, opts = {})
|
|
31
|
+
data, status_code, headers = activate_agent_key_with_http_info(agent_id, key_id, opts)
|
|
32
|
+
return data, status_code, headers
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Activate a key
|
|
36
|
+
# **Activate a Key**<br>Activates a deactivated public key, making it available for signature verification.<br><br> Returns **404** if the agent or key is not found, **403** if the agent is deactivated.
|
|
37
|
+
# @param agent_id Unique agent identifier
|
|
38
|
+
# @param key_id Unique key identifier
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [Array<(AddAgentKeyResponse201, Fixnum, Hash)>] AddAgentKeyResponse201 data, response status code and response headers
|
|
41
|
+
def activate_agent_key_with_http_info(agent_id, key_id, opts = {})
|
|
42
|
+
|
|
43
|
+
if @api_client.config.debugging
|
|
44
|
+
begin
|
|
45
|
+
raise
|
|
46
|
+
@api_client.config.logger.debug 'Calling API: AgentRegistrationApi.activate_agent_key ...'
|
|
47
|
+
rescue
|
|
48
|
+
puts 'Cannot write to log'
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
# verify the required parameter 'agent_id' is set
|
|
52
|
+
if @api_client.config.client_side_validation && agent_id.nil?
|
|
53
|
+
fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentRegistrationApi.activate_agent_key"
|
|
54
|
+
end
|
|
55
|
+
# verify the required parameter 'key_id' is set
|
|
56
|
+
if @api_client.config.client_side_validation && key_id.nil?
|
|
57
|
+
fail ArgumentError, "Missing the required parameter 'key_id' when calling AgentRegistrationApi.activate_agent_key"
|
|
58
|
+
end
|
|
59
|
+
# resource path
|
|
60
|
+
local_var_path = 'icc/v1/agents/{agentId}/keys/{keyId}/activate'.sub('{' + 'agentId' + '}', agent_id.to_s).sub('{' + 'keyId' + '}', key_id.to_s)
|
|
61
|
+
|
|
62
|
+
# query parameters
|
|
63
|
+
query_params = {}
|
|
64
|
+
|
|
65
|
+
# header parameters
|
|
66
|
+
header_params = {}
|
|
67
|
+
# HTTP header 'Accept' (if needed)
|
|
68
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
|
|
69
|
+
# HTTP header 'Content-Type'
|
|
70
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
|
71
|
+
|
|
72
|
+
# form parameters
|
|
73
|
+
form_params = {}
|
|
74
|
+
|
|
75
|
+
# http body (model)
|
|
76
|
+
if 'POST' == 'POST'
|
|
77
|
+
post_body = '{}'
|
|
78
|
+
else
|
|
79
|
+
post_body = nil
|
|
80
|
+
end
|
|
81
|
+
inbound_mle_status = "mandatory"
|
|
82
|
+
if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["activate_agent_key","activate_agent_key_with_http_info"])
|
|
83
|
+
begin
|
|
84
|
+
post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
|
|
85
|
+
rescue
|
|
86
|
+
raise
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["activate_agent_key","activate_agent_key_with_http_info"])
|
|
91
|
+
|
|
92
|
+
auth_names = []
|
|
93
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
94
|
+
:header_params => header_params,
|
|
95
|
+
:query_params => query_params,
|
|
96
|
+
:form_params => form_params,
|
|
97
|
+
:body => post_body,
|
|
98
|
+
:auth_names => auth_names,
|
|
99
|
+
:return_type => 'AddAgentKeyResponse201',
|
|
100
|
+
:isResponseMLEForApi => is_response_mle_for_api)
|
|
101
|
+
if @api_client.config.debugging
|
|
102
|
+
begin
|
|
103
|
+
raise
|
|
104
|
+
@api_client.config.logger.debug "API called: AgentRegistrationApi#activate_agent_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
105
|
+
rescue
|
|
106
|
+
puts 'Cannot write to log'
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
return data, status_code, headers
|
|
110
|
+
end
|
|
111
|
+
# Add a key to an agent
|
|
112
|
+
# **Add a Key to an Agent**<br>Uploads a new public key for the specified agent. The key is created in ***deactivated*** state and must be explicitly activated via `POST /agents/{agentId}/keys/{keyId}/activate` before it can be used.<br><br> Returns **404** if the agent is not found, **403** if the agent is deactivated.
|
|
113
|
+
#
|
|
114
|
+
# @param agent_id Unique agent identifier
|
|
115
|
+
# @param key_request Key creation request
|
|
116
|
+
# @param [Hash] opts the optional parameters
|
|
117
|
+
# @return [AddAgentKeyResponse201]
|
|
118
|
+
#
|
|
119
|
+
def add_agent_key(agent_id, key_request, opts = {})
|
|
120
|
+
data, status_code, headers = add_agent_key_with_http_info(agent_id, key_request, opts)
|
|
121
|
+
return data, status_code, headers
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Add a key to an agent
|
|
125
|
+
# **Add a Key to an Agent**<br>Uploads a new public key for the specified agent. The key is created in ***deactivated*** state and must be explicitly activated via `POST /agents/{agentId}/keys/{keyId}/activate` before it can be used.<br><br> Returns **404** if the agent is not found, **403** if the agent is deactivated.
|
|
126
|
+
# @param agent_id Unique agent identifier
|
|
127
|
+
# @param key_request Key creation request
|
|
128
|
+
# @param [Hash] opts the optional parameters
|
|
129
|
+
# @return [Array<(AddAgentKeyResponse201, Fixnum, Hash)>] AddAgentKeyResponse201 data, response status code and response headers
|
|
130
|
+
def add_agent_key_with_http_info(agent_id, key_request, opts = {})
|
|
131
|
+
|
|
132
|
+
if @api_client.config.debugging
|
|
133
|
+
begin
|
|
134
|
+
raise
|
|
135
|
+
@api_client.config.logger.debug 'Calling API: AgentRegistrationApi.add_agent_key ...'
|
|
136
|
+
rescue
|
|
137
|
+
puts 'Cannot write to log'
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
# verify the required parameter 'agent_id' is set
|
|
141
|
+
if @api_client.config.client_side_validation && agent_id.nil?
|
|
142
|
+
fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentRegistrationApi.add_agent_key"
|
|
143
|
+
end
|
|
144
|
+
# verify the required parameter 'key_request' is set
|
|
145
|
+
if @api_client.config.client_side_validation && key_request.nil?
|
|
146
|
+
fail ArgumentError, "Missing the required parameter 'key_request' when calling AgentRegistrationApi.add_agent_key"
|
|
147
|
+
end
|
|
148
|
+
# resource path
|
|
149
|
+
local_var_path = 'icc/v1/agents/{agentId}/keys'.sub('{' + 'agentId' + '}', agent_id.to_s)
|
|
150
|
+
|
|
151
|
+
# query parameters
|
|
152
|
+
query_params = {}
|
|
153
|
+
|
|
154
|
+
# header parameters
|
|
155
|
+
header_params = {}
|
|
156
|
+
# HTTP header 'Accept' (if needed)
|
|
157
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
|
|
158
|
+
# HTTP header 'Content-Type'
|
|
159
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
|
160
|
+
|
|
161
|
+
# form parameters
|
|
162
|
+
form_params = {}
|
|
163
|
+
|
|
164
|
+
# http body (model)
|
|
165
|
+
post_body = @api_client.object_to_http_body(key_request)
|
|
166
|
+
sdk_tracker = SdkTracker.new
|
|
167
|
+
post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'KeyRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
|
|
168
|
+
inbound_mle_status = "mandatory"
|
|
169
|
+
if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["add_agent_key","add_agent_key_with_http_info"])
|
|
170
|
+
begin
|
|
171
|
+
post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
|
|
172
|
+
rescue
|
|
173
|
+
raise
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["add_agent_key","add_agent_key_with_http_info"])
|
|
178
|
+
|
|
179
|
+
auth_names = []
|
|
180
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
181
|
+
:header_params => header_params,
|
|
182
|
+
:query_params => query_params,
|
|
183
|
+
:form_params => form_params,
|
|
184
|
+
:body => post_body,
|
|
185
|
+
:auth_names => auth_names,
|
|
186
|
+
:return_type => 'AddAgentKeyResponse201',
|
|
187
|
+
:isResponseMLEForApi => is_response_mle_for_api)
|
|
188
|
+
if @api_client.config.debugging
|
|
189
|
+
begin
|
|
190
|
+
raise
|
|
191
|
+
@api_client.config.logger.debug "API called: AgentRegistrationApi#add_agent_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
192
|
+
rescue
|
|
193
|
+
puts 'Cannot write to log'
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
return data, status_code, headers
|
|
197
|
+
end
|
|
198
|
+
# Get an agent
|
|
199
|
+
# **Get an Agent**<br>Retrieves a single agent by its unique identifier, including all associated public keys.<br><br> Returns **404** if the agent is not found.
|
|
200
|
+
#
|
|
201
|
+
# @param agent_id Unique agent identifier
|
|
202
|
+
# @param [Hash] opts the optional parameters
|
|
203
|
+
# @return [AgentRegistrationResponse201]
|
|
204
|
+
#
|
|
205
|
+
def get_agent(agent_id, opts = {})
|
|
206
|
+
data, status_code, headers = get_agent_with_http_info(agent_id, opts)
|
|
207
|
+
return data, status_code, headers
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Get an agent
|
|
211
|
+
# **Get an Agent**<br>Retrieves a single agent by its unique identifier, including all associated public keys.<br><br> Returns **404** if the agent is not found.
|
|
212
|
+
# @param agent_id Unique agent identifier
|
|
213
|
+
# @param [Hash] opts the optional parameters
|
|
214
|
+
# @return [Array<(AgentRegistrationResponse201, Fixnum, Hash)>] AgentRegistrationResponse201 data, response status code and response headers
|
|
215
|
+
def get_agent_with_http_info(agent_id, opts = {})
|
|
216
|
+
|
|
217
|
+
if @api_client.config.debugging
|
|
218
|
+
begin
|
|
219
|
+
raise
|
|
220
|
+
@api_client.config.logger.debug 'Calling API: AgentRegistrationApi.get_agent ...'
|
|
221
|
+
rescue
|
|
222
|
+
puts 'Cannot write to log'
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
# verify the required parameter 'agent_id' is set
|
|
226
|
+
if @api_client.config.client_side_validation && agent_id.nil?
|
|
227
|
+
fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentRegistrationApi.get_agent"
|
|
228
|
+
end
|
|
229
|
+
# resource path
|
|
230
|
+
local_var_path = 'icc/v1/agents/{agentId}'.sub('{' + 'agentId' + '}', agent_id.to_s)
|
|
231
|
+
|
|
232
|
+
# query parameters
|
|
233
|
+
query_params = {}
|
|
234
|
+
|
|
235
|
+
# header parameters
|
|
236
|
+
header_params = {}
|
|
237
|
+
# HTTP header 'Accept' (if needed)
|
|
238
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
|
|
239
|
+
# HTTP header 'Content-Type'
|
|
240
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
|
241
|
+
|
|
242
|
+
# form parameters
|
|
243
|
+
form_params = {}
|
|
244
|
+
|
|
245
|
+
# http body (model)
|
|
246
|
+
if 'GET' == 'POST'
|
|
247
|
+
post_body = '{}'
|
|
248
|
+
else
|
|
249
|
+
post_body = nil
|
|
250
|
+
end
|
|
251
|
+
inbound_mle_status = "false"
|
|
252
|
+
if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["get_agent","get_agent_with_http_info"])
|
|
253
|
+
begin
|
|
254
|
+
post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
|
|
255
|
+
rescue
|
|
256
|
+
raise
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["get_agent","get_agent_with_http_info"])
|
|
261
|
+
|
|
262
|
+
auth_names = []
|
|
263
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
264
|
+
:header_params => header_params,
|
|
265
|
+
:query_params => query_params,
|
|
266
|
+
:form_params => form_params,
|
|
267
|
+
:body => post_body,
|
|
268
|
+
:auth_names => auth_names,
|
|
269
|
+
:return_type => 'AgentRegistrationResponse201',
|
|
270
|
+
:isResponseMLEForApi => is_response_mle_for_api)
|
|
271
|
+
if @api_client.config.debugging
|
|
272
|
+
begin
|
|
273
|
+
raise
|
|
274
|
+
@api_client.config.logger.debug "API called: AgentRegistrationApi#get_agent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
275
|
+
rescue
|
|
276
|
+
puts 'Cannot write to log'
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
return data, status_code, headers
|
|
280
|
+
end
|
|
281
|
+
# Get a key by agent and key ID
|
|
282
|
+
# **Get a Key**<br>Retrieves a specific public key by agent ID and key ID.<br><br> Returns **404** if the agent or key is not found.
|
|
283
|
+
#
|
|
284
|
+
# @param agent_id Unique agent identifier
|
|
285
|
+
# @param key_id Unique key identifier
|
|
286
|
+
# @param [Hash] opts the optional parameters
|
|
287
|
+
# @return [AddAgentKeyResponse201]
|
|
288
|
+
#
|
|
289
|
+
def get_agent_key(agent_id, key_id, opts = {})
|
|
290
|
+
data, status_code, headers = get_agent_key_with_http_info(agent_id, key_id, opts)
|
|
291
|
+
return data, status_code, headers
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# Get a key by agent and key ID
|
|
295
|
+
# **Get a Key**<br>Retrieves a specific public key by agent ID and key ID.<br><br> Returns **404** if the agent or key is not found.
|
|
296
|
+
# @param agent_id Unique agent identifier
|
|
297
|
+
# @param key_id Unique key identifier
|
|
298
|
+
# @param [Hash] opts the optional parameters
|
|
299
|
+
# @return [Array<(AddAgentKeyResponse201, Fixnum, Hash)>] AddAgentKeyResponse201 data, response status code and response headers
|
|
300
|
+
def get_agent_key_with_http_info(agent_id, key_id, opts = {})
|
|
301
|
+
|
|
302
|
+
if @api_client.config.debugging
|
|
303
|
+
begin
|
|
304
|
+
raise
|
|
305
|
+
@api_client.config.logger.debug 'Calling API: AgentRegistrationApi.get_agent_key ...'
|
|
306
|
+
rescue
|
|
307
|
+
puts 'Cannot write to log'
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
# verify the required parameter 'agent_id' is set
|
|
311
|
+
if @api_client.config.client_side_validation && agent_id.nil?
|
|
312
|
+
fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentRegistrationApi.get_agent_key"
|
|
313
|
+
end
|
|
314
|
+
# verify the required parameter 'key_id' is set
|
|
315
|
+
if @api_client.config.client_side_validation && key_id.nil?
|
|
316
|
+
fail ArgumentError, "Missing the required parameter 'key_id' when calling AgentRegistrationApi.get_agent_key"
|
|
317
|
+
end
|
|
318
|
+
# resource path
|
|
319
|
+
local_var_path = 'icc/v1/agents/{agentId}/keys/{keyId}'.sub('{' + 'agentId' + '}', agent_id.to_s).sub('{' + 'keyId' + '}', key_id.to_s)
|
|
320
|
+
|
|
321
|
+
# query parameters
|
|
322
|
+
query_params = {}
|
|
323
|
+
|
|
324
|
+
# header parameters
|
|
325
|
+
header_params = {}
|
|
326
|
+
# HTTP header 'Accept' (if needed)
|
|
327
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
|
|
328
|
+
# HTTP header 'Content-Type'
|
|
329
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
|
330
|
+
|
|
331
|
+
# form parameters
|
|
332
|
+
form_params = {}
|
|
333
|
+
|
|
334
|
+
# http body (model)
|
|
335
|
+
if 'GET' == 'POST'
|
|
336
|
+
post_body = '{}'
|
|
337
|
+
else
|
|
338
|
+
post_body = nil
|
|
339
|
+
end
|
|
340
|
+
inbound_mle_status = "false"
|
|
341
|
+
if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["get_agent_key","get_agent_key_with_http_info"])
|
|
342
|
+
begin
|
|
343
|
+
post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
|
|
344
|
+
rescue
|
|
345
|
+
raise
|
|
346
|
+
end
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["get_agent_key","get_agent_key_with_http_info"])
|
|
350
|
+
|
|
351
|
+
auth_names = []
|
|
352
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
353
|
+
:header_params => header_params,
|
|
354
|
+
:query_params => query_params,
|
|
355
|
+
:form_params => form_params,
|
|
356
|
+
:body => post_body,
|
|
357
|
+
:auth_names => auth_names,
|
|
358
|
+
:return_type => 'AddAgentKeyResponse201',
|
|
359
|
+
:isResponseMLEForApi => is_response_mle_for_api)
|
|
360
|
+
if @api_client.config.debugging
|
|
361
|
+
begin
|
|
362
|
+
raise
|
|
363
|
+
@api_client.config.logger.debug "API called: AgentRegistrationApi#get_agent_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
364
|
+
rescue
|
|
365
|
+
puts 'Cannot write to log'
|
|
366
|
+
end
|
|
367
|
+
end
|
|
368
|
+
return data, status_code, headers
|
|
369
|
+
end
|
|
370
|
+
# List keys for an agent
|
|
371
|
+
# **List Keys for an Agent**<br>Returns a paginated list of all public keys associated with the specified agent.<br><br> Returns **404** if the agent is not found.
|
|
372
|
+
#
|
|
373
|
+
# @param agent_id Unique agent identifier
|
|
374
|
+
# @param [Hash] opts the optional parameters
|
|
375
|
+
# @option opts [Integer] :page Page number (1-indexed) (default to 1)
|
|
376
|
+
# @option opts [Integer] :page_size Items per page (max 100) (default to 30)
|
|
377
|
+
# @return [ListAgentKeysResponse200]
|
|
378
|
+
#
|
|
379
|
+
def list_agent_keys(agent_id, opts = {})
|
|
380
|
+
data, status_code, headers = list_agent_keys_with_http_info(agent_id, opts)
|
|
381
|
+
return data, status_code, headers
|
|
382
|
+
end
|
|
383
|
+
|
|
384
|
+
# List keys for an agent
|
|
385
|
+
# **List Keys for an Agent**<br>Returns a paginated list of all public keys associated with the specified agent.<br><br> Returns **404** if the agent is not found.
|
|
386
|
+
# @param agent_id Unique agent identifier
|
|
387
|
+
# @param [Hash] opts the optional parameters
|
|
388
|
+
# @option opts [Integer] :page Page number (1-indexed)
|
|
389
|
+
# @option opts [Integer] :page_size Items per page (max 100)
|
|
390
|
+
# @return [Array<(ListAgentKeysResponse200, Fixnum, Hash)>] ListAgentKeysResponse200 data, response status code and response headers
|
|
391
|
+
def list_agent_keys_with_http_info(agent_id, opts = {})
|
|
392
|
+
|
|
393
|
+
if @api_client.config.debugging
|
|
394
|
+
begin
|
|
395
|
+
raise
|
|
396
|
+
@api_client.config.logger.debug 'Calling API: AgentRegistrationApi.list_agent_keys ...'
|
|
397
|
+
rescue
|
|
398
|
+
puts 'Cannot write to log'
|
|
399
|
+
end
|
|
400
|
+
end
|
|
401
|
+
# verify the required parameter 'agent_id' is set
|
|
402
|
+
if @api_client.config.client_side_validation && agent_id.nil?
|
|
403
|
+
fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentRegistrationApi.list_agent_keys"
|
|
404
|
+
end
|
|
405
|
+
# resource path
|
|
406
|
+
local_var_path = 'icc/v1/agents/{agentId}/keys'.sub('{' + 'agentId' + '}', agent_id.to_s)
|
|
407
|
+
|
|
408
|
+
# query parameters
|
|
409
|
+
query_params = {}
|
|
410
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
411
|
+
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
412
|
+
|
|
413
|
+
# header parameters
|
|
414
|
+
header_params = {}
|
|
415
|
+
# HTTP header 'Accept' (if needed)
|
|
416
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
|
|
417
|
+
# HTTP header 'Content-Type'
|
|
418
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
|
419
|
+
|
|
420
|
+
# form parameters
|
|
421
|
+
form_params = {}
|
|
422
|
+
|
|
423
|
+
# http body (model)
|
|
424
|
+
if 'GET' == 'POST'
|
|
425
|
+
post_body = '{}'
|
|
426
|
+
else
|
|
427
|
+
post_body = nil
|
|
428
|
+
end
|
|
429
|
+
inbound_mle_status = "false"
|
|
430
|
+
if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["list_agent_keys","list_agent_keys_with_http_info"])
|
|
431
|
+
begin
|
|
432
|
+
post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
|
|
433
|
+
rescue
|
|
434
|
+
raise
|
|
435
|
+
end
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["list_agent_keys","list_agent_keys_with_http_info"])
|
|
439
|
+
|
|
440
|
+
auth_names = []
|
|
441
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
442
|
+
:header_params => header_params,
|
|
443
|
+
:query_params => query_params,
|
|
444
|
+
:form_params => form_params,
|
|
445
|
+
:body => post_body,
|
|
446
|
+
:auth_names => auth_names,
|
|
447
|
+
:return_type => 'ListAgentKeysResponse200',
|
|
448
|
+
:isResponseMLEForApi => is_response_mle_for_api)
|
|
449
|
+
if @api_client.config.debugging
|
|
450
|
+
begin
|
|
451
|
+
raise
|
|
452
|
+
@api_client.config.logger.debug "API called: AgentRegistrationApi#list_agent_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
453
|
+
rescue
|
|
454
|
+
puts 'Cannot write to log'
|
|
455
|
+
end
|
|
456
|
+
end
|
|
457
|
+
return data, status_code, headers
|
|
458
|
+
end
|
|
459
|
+
# Register an agent
|
|
460
|
+
# **Register an Agent**<br>Registers a new AI agent in the Visa Agent Registry Service (VARS). Once registered, the agent can upload public keys that merchants and Visa services use to verify request signatures.<br><br> **Key Behavior**<br>If an optional `keys` array is included in the request, those keys are created alongside the agent registration in a single operation.<br> Returns **409 Conflict** if an agent with the same domain already exists.
|
|
461
|
+
#
|
|
462
|
+
# @param agent_request Agent registration request
|
|
463
|
+
# @param [Hash] opts the optional parameters
|
|
464
|
+
# @return [AgentRegistrationResponse201]
|
|
465
|
+
#
|
|
466
|
+
def register_agent(agent_request, opts = {})
|
|
467
|
+
data, status_code, headers = register_agent_with_http_info(agent_request, opts)
|
|
468
|
+
return data, status_code, headers
|
|
469
|
+
end
|
|
470
|
+
|
|
471
|
+
# Register an agent
|
|
472
|
+
# **Register an Agent**<br>Registers a new AI agent in the Visa Agent Registry Service (VARS). Once registered, the agent can upload public keys that merchants and Visa services use to verify request signatures.<br><br> **Key Behavior**<br>If an optional `keys` array is included in the request, those keys are created alongside the agent registration in a single operation.<br> Returns **409 Conflict** if an agent with the same domain already exists.
|
|
473
|
+
# @param agent_request Agent registration request
|
|
474
|
+
# @param [Hash] opts the optional parameters
|
|
475
|
+
# @return [Array<(AgentRegistrationResponse201, Fixnum, Hash)>] AgentRegistrationResponse201 data, response status code and response headers
|
|
476
|
+
def register_agent_with_http_info(agent_request, opts = {})
|
|
477
|
+
|
|
478
|
+
if @api_client.config.debugging
|
|
479
|
+
begin
|
|
480
|
+
raise
|
|
481
|
+
@api_client.config.logger.debug 'Calling API: AgentRegistrationApi.register_agent ...'
|
|
482
|
+
rescue
|
|
483
|
+
puts 'Cannot write to log'
|
|
484
|
+
end
|
|
485
|
+
end
|
|
486
|
+
# verify the required parameter 'agent_request' is set
|
|
487
|
+
if @api_client.config.client_side_validation && agent_request.nil?
|
|
488
|
+
fail ArgumentError, "Missing the required parameter 'agent_request' when calling AgentRegistrationApi.register_agent"
|
|
489
|
+
end
|
|
490
|
+
# resource path
|
|
491
|
+
local_var_path = 'icc/v1/agents'
|
|
492
|
+
|
|
493
|
+
# query parameters
|
|
494
|
+
query_params = {}
|
|
495
|
+
|
|
496
|
+
# header parameters
|
|
497
|
+
header_params = {}
|
|
498
|
+
# HTTP header 'Accept' (if needed)
|
|
499
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
|
|
500
|
+
# HTTP header 'Content-Type'
|
|
501
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
|
502
|
+
|
|
503
|
+
# form parameters
|
|
504
|
+
form_params = {}
|
|
505
|
+
|
|
506
|
+
# http body (model)
|
|
507
|
+
post_body = @api_client.object_to_http_body(agent_request)
|
|
508
|
+
sdk_tracker = SdkTracker.new
|
|
509
|
+
post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AgentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
|
|
510
|
+
inbound_mle_status = "mandatory"
|
|
511
|
+
if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["register_agent","register_agent_with_http_info"])
|
|
512
|
+
begin
|
|
513
|
+
post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
|
|
514
|
+
rescue
|
|
515
|
+
raise
|
|
516
|
+
end
|
|
517
|
+
end
|
|
518
|
+
|
|
519
|
+
is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["register_agent","register_agent_with_http_info"])
|
|
520
|
+
|
|
521
|
+
auth_names = []
|
|
522
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
523
|
+
:header_params => header_params,
|
|
524
|
+
:query_params => query_params,
|
|
525
|
+
:form_params => form_params,
|
|
526
|
+
:body => post_body,
|
|
527
|
+
:auth_names => auth_names,
|
|
528
|
+
:return_type => 'AgentRegistrationResponse201',
|
|
529
|
+
:isResponseMLEForApi => is_response_mle_for_api)
|
|
530
|
+
if @api_client.config.debugging
|
|
531
|
+
begin
|
|
532
|
+
raise
|
|
533
|
+
@api_client.config.logger.debug "API called: AgentRegistrationApi#register_agent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
534
|
+
rescue
|
|
535
|
+
puts 'Cannot write to log'
|
|
536
|
+
end
|
|
537
|
+
end
|
|
538
|
+
return data, status_code, headers
|
|
539
|
+
end
|
|
540
|
+
# Update an agent
|
|
541
|
+
# **Update an Agent**<br>Updates agent information. Only the following fields can be modified: `name`, `domain`, `description`, `contactEmail`, and `agentMetadata`.<br><br> Submitting any other field (e.g., `tokenRequestorId`, `keys`) returns **422 Validation Error**.<br> Returns **404** if the agent is not found, **403** if the agent is deactivated, **409** if the new domain is already registered.
|
|
542
|
+
#
|
|
543
|
+
# @param agent_id Unique agent identifier
|
|
544
|
+
# @param agent_update Agent update request
|
|
545
|
+
# @param [Hash] opts the optional parameters
|
|
546
|
+
# @return [AgentRegistrationResponse201]
|
|
547
|
+
#
|
|
548
|
+
def update_agent(agent_id, agent_update, opts = {})
|
|
549
|
+
data, status_code, headers = update_agent_with_http_info(agent_id, agent_update, opts)
|
|
550
|
+
return data, status_code, headers
|
|
551
|
+
end
|
|
552
|
+
|
|
553
|
+
# Update an agent
|
|
554
|
+
# **Update an Agent**<br>Updates agent information. Only the following fields can be modified: `name`, `domain`, `description`, `contactEmail`, and `agentMetadata`.<br><br> Submitting any other field (e.g., `tokenRequestorId`, `keys`) returns **422 Validation Error**.<br> Returns **404** if the agent is not found, **403** if the agent is deactivated, **409** if the new domain is already registered.
|
|
555
|
+
# @param agent_id Unique agent identifier
|
|
556
|
+
# @param agent_update Agent update request
|
|
557
|
+
# @param [Hash] opts the optional parameters
|
|
558
|
+
# @return [Array<(AgentRegistrationResponse201, Fixnum, Hash)>] AgentRegistrationResponse201 data, response status code and response headers
|
|
559
|
+
def update_agent_with_http_info(agent_id, agent_update, opts = {})
|
|
560
|
+
|
|
561
|
+
if @api_client.config.debugging
|
|
562
|
+
begin
|
|
563
|
+
raise
|
|
564
|
+
@api_client.config.logger.debug 'Calling API: AgentRegistrationApi.update_agent ...'
|
|
565
|
+
rescue
|
|
566
|
+
puts 'Cannot write to log'
|
|
567
|
+
end
|
|
568
|
+
end
|
|
569
|
+
# verify the required parameter 'agent_id' is set
|
|
570
|
+
if @api_client.config.client_side_validation && agent_id.nil?
|
|
571
|
+
fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentRegistrationApi.update_agent"
|
|
572
|
+
end
|
|
573
|
+
# verify the required parameter 'agent_update' is set
|
|
574
|
+
if @api_client.config.client_side_validation && agent_update.nil?
|
|
575
|
+
fail ArgumentError, "Missing the required parameter 'agent_update' when calling AgentRegistrationApi.update_agent"
|
|
576
|
+
end
|
|
577
|
+
# resource path
|
|
578
|
+
local_var_path = 'icc/v1/agents/{agentId}'.sub('{' + 'agentId' + '}', agent_id.to_s)
|
|
579
|
+
|
|
580
|
+
# query parameters
|
|
581
|
+
query_params = {}
|
|
582
|
+
|
|
583
|
+
# header parameters
|
|
584
|
+
header_params = {}
|
|
585
|
+
# HTTP header 'Accept' (if needed)
|
|
586
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
|
|
587
|
+
# HTTP header 'Content-Type'
|
|
588
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
|
589
|
+
|
|
590
|
+
# form parameters
|
|
591
|
+
form_params = {}
|
|
592
|
+
|
|
593
|
+
# http body (model)
|
|
594
|
+
post_body = @api_client.object_to_http_body(agent_update)
|
|
595
|
+
sdk_tracker = SdkTracker.new
|
|
596
|
+
post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AgentUpdate', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
|
|
597
|
+
inbound_mle_status = "mandatory"
|
|
598
|
+
if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["update_agent","update_agent_with_http_info"])
|
|
599
|
+
begin
|
|
600
|
+
post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
|
|
601
|
+
rescue
|
|
602
|
+
raise
|
|
603
|
+
end
|
|
604
|
+
end
|
|
605
|
+
|
|
606
|
+
is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["update_agent","update_agent_with_http_info"])
|
|
607
|
+
|
|
608
|
+
auth_names = []
|
|
609
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
|
610
|
+
:header_params => header_params,
|
|
611
|
+
:query_params => query_params,
|
|
612
|
+
:form_params => form_params,
|
|
613
|
+
:body => post_body,
|
|
614
|
+
:auth_names => auth_names,
|
|
615
|
+
:return_type => 'AgentRegistrationResponse201',
|
|
616
|
+
:isResponseMLEForApi => is_response_mle_for_api)
|
|
617
|
+
if @api_client.config.debugging
|
|
618
|
+
begin
|
|
619
|
+
raise
|
|
620
|
+
@api_client.config.logger.debug "API called: AgentRegistrationApi#update_agent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
621
|
+
rescue
|
|
622
|
+
puts 'Cannot write to log'
|
|
623
|
+
end
|
|
624
|
+
end
|
|
625
|
+
return data, status_code, headers
|
|
626
|
+
end
|
|
627
|
+
# Update a key
|
|
628
|
+
# **Update a Key**<br>Updates key information. The following fields can be modified: `keyName`, `publicKey`, `algorithm`, and `expirationDate`.<br><br> **Note:** `publicKey` and `algorithm` must always be updated together.<br> Returns **404** if the agent or key is not found, **403** if the agent or key is deactivated, **409** if the new `keyName` already exists.
|
|
629
|
+
#
|
|
630
|
+
# @param agent_id Unique agent identifier
|
|
631
|
+
# @param key_id Unique key identifier
|
|
632
|
+
# @param key_update Key update request
|
|
633
|
+
# @param [Hash] opts the optional parameters
|
|
634
|
+
# @return [AddAgentKeyResponse201]
|
|
635
|
+
#
|
|
636
|
+
def update_agent_key(agent_id, key_id, key_update, opts = {})
|
|
637
|
+
data, status_code, headers = update_agent_key_with_http_info(agent_id, key_id, key_update, opts)
|
|
638
|
+
return data, status_code, headers
|
|
639
|
+
end
|
|
640
|
+
|
|
641
|
+
# Update a key
|
|
642
|
+
# **Update a Key**<br>Updates key information. The following fields can be modified: `keyName`, `publicKey`, `algorithm`, and `expirationDate`.<br><br> **Note:** `publicKey` and `algorithm` must always be updated together.<br> Returns **404** if the agent or key is not found, **403** if the agent or key is deactivated, **409** if the new `keyName` already exists.
|
|
643
|
+
# @param agent_id Unique agent identifier
|
|
644
|
+
# @param key_id Unique key identifier
|
|
645
|
+
# @param key_update Key update request
|
|
646
|
+
# @param [Hash] opts the optional parameters
|
|
647
|
+
# @return [Array<(AddAgentKeyResponse201, Fixnum, Hash)>] AddAgentKeyResponse201 data, response status code and response headers
|
|
648
|
+
def update_agent_key_with_http_info(agent_id, key_id, key_update, opts = {})
|
|
649
|
+
|
|
650
|
+
if @api_client.config.debugging
|
|
651
|
+
begin
|
|
652
|
+
raise
|
|
653
|
+
@api_client.config.logger.debug 'Calling API: AgentRegistrationApi.update_agent_key ...'
|
|
654
|
+
rescue
|
|
655
|
+
puts 'Cannot write to log'
|
|
656
|
+
end
|
|
657
|
+
end
|
|
658
|
+
# verify the required parameter 'agent_id' is set
|
|
659
|
+
if @api_client.config.client_side_validation && agent_id.nil?
|
|
660
|
+
fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentRegistrationApi.update_agent_key"
|
|
661
|
+
end
|
|
662
|
+
# verify the required parameter 'key_id' is set
|
|
663
|
+
if @api_client.config.client_side_validation && key_id.nil?
|
|
664
|
+
fail ArgumentError, "Missing the required parameter 'key_id' when calling AgentRegistrationApi.update_agent_key"
|
|
665
|
+
end
|
|
666
|
+
# verify the required parameter 'key_update' is set
|
|
667
|
+
if @api_client.config.client_side_validation && key_update.nil?
|
|
668
|
+
fail ArgumentError, "Missing the required parameter 'key_update' when calling AgentRegistrationApi.update_agent_key"
|
|
669
|
+
end
|
|
670
|
+
# resource path
|
|
671
|
+
local_var_path = 'icc/v1/agents/{agentId}/keys/{keyId}'.sub('{' + 'agentId' + '}', agent_id.to_s).sub('{' + 'keyId' + '}', key_id.to_s)
|
|
672
|
+
|
|
673
|
+
# query parameters
|
|
674
|
+
query_params = {}
|
|
675
|
+
|
|
676
|
+
# header parameters
|
|
677
|
+
header_params = {}
|
|
678
|
+
# HTTP header 'Accept' (if needed)
|
|
679
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
|
|
680
|
+
# HTTP header 'Content-Type'
|
|
681
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
|
|
682
|
+
|
|
683
|
+
# form parameters
|
|
684
|
+
form_params = {}
|
|
685
|
+
|
|
686
|
+
# http body (model)
|
|
687
|
+
post_body = @api_client.object_to_http_body(key_update)
|
|
688
|
+
sdk_tracker = SdkTracker.new
|
|
689
|
+
post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'KeyUpdate', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
|
|
690
|
+
inbound_mle_status = "mandatory"
|
|
691
|
+
if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["update_agent_key","update_agent_key_with_http_info"])
|
|
692
|
+
begin
|
|
693
|
+
post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
|
|
694
|
+
rescue
|
|
695
|
+
raise
|
|
696
|
+
end
|
|
697
|
+
end
|
|
698
|
+
|
|
699
|
+
is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["update_agent_key","update_agent_key_with_http_info"])
|
|
700
|
+
|
|
701
|
+
auth_names = []
|
|
702
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
|
703
|
+
:header_params => header_params,
|
|
704
|
+
:query_params => query_params,
|
|
705
|
+
:form_params => form_params,
|
|
706
|
+
:body => post_body,
|
|
707
|
+
:auth_names => auth_names,
|
|
708
|
+
:return_type => 'AddAgentKeyResponse201',
|
|
709
|
+
:isResponseMLEForApi => is_response_mle_for_api)
|
|
710
|
+
if @api_client.config.debugging
|
|
711
|
+
begin
|
|
712
|
+
raise
|
|
713
|
+
@api_client.config.logger.debug "API called: AgentRegistrationApi#update_agent_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
714
|
+
rescue
|
|
715
|
+
puts 'Cannot write to log'
|
|
716
|
+
end
|
|
717
|
+
end
|
|
718
|
+
return data, status_code, headers
|
|
719
|
+
end
|
|
720
|
+
end
|
|
721
|
+
end
|