ultracart_api 3.11.28 → 3.11.30
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/README.md +13 -4
- data/docs/ConversationApi.md +216 -0
- data/docs/ConversationMcpServer.md +15 -0
- data/docs/ConversationMcpServerResponse.md +12 -0
- data/docs/ConversationMcpServersResponse.md +12 -0
- data/docs/ConversationMessage.md +1 -0
- data/docs/ConversationVirtualAgentCapabilities.md +1 -0
- data/docs/ItemShipping.md +1 -0
- data/lib/ultracart_api/api/conversation_api.rb +244 -0
- data/lib/ultracart_api/models/conversation_mcp_server.rb +289 -0
- data/lib/ultracart_api/models/conversation_mcp_server_response.rb +221 -0
- data/lib/ultracart_api/models/conversation_mcp_servers_response.rb +223 -0
- data/lib/ultracart_api/models/conversation_message.rb +10 -1
- data/lib/ultracart_api/models/conversation_virtual_agent_capabilities.rb +11 -1
- data/lib/ultracart_api/models/item_shipping.rb +11 -1
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +3 -0
- metadata +8 -2
|
@@ -851,6 +851,122 @@ module UltracartClient
|
|
|
851
851
|
end
|
|
852
852
|
return data, status_code, headers
|
|
853
853
|
end
|
|
854
|
+
# Get an MCP server associated with this agent
|
|
855
|
+
# Retrieve MCP server associated with this agent
|
|
856
|
+
# @param user_id
|
|
857
|
+
# @param mcp_server_uuid
|
|
858
|
+
# @param [Hash] opts the optional parameters
|
|
859
|
+
# @return [ConversationMcpServerResponse]
|
|
860
|
+
def get_agent_profile_mcp(user_id, mcp_server_uuid, opts = {})
|
|
861
|
+
data, _status_code, _headers = get_agent_profile_mcp_with_http_info(user_id, mcp_server_uuid, opts)
|
|
862
|
+
data
|
|
863
|
+
end
|
|
864
|
+
|
|
865
|
+
# Get an MCP server associated with this agent
|
|
866
|
+
# Retrieve MCP server associated with this agent
|
|
867
|
+
# @param user_id
|
|
868
|
+
# @param mcp_server_uuid
|
|
869
|
+
# @param [Hash] opts the optional parameters
|
|
870
|
+
# @return [Array<(ConversationMcpServerResponse, Fixnum, Hash)>] ConversationMcpServerResponse data, response status code and response headers
|
|
871
|
+
def get_agent_profile_mcp_with_http_info(user_id, mcp_server_uuid, opts = {})
|
|
872
|
+
if @api_client.config.debugging
|
|
873
|
+
@api_client.config.logger.debug 'Calling API: ConversationApi.get_agent_profile_mcp ...'
|
|
874
|
+
end
|
|
875
|
+
# verify the required parameter 'user_id' is set
|
|
876
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
877
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.get_agent_profile_mcp"
|
|
878
|
+
end
|
|
879
|
+
# verify the required parameter 'mcp_server_uuid' is set
|
|
880
|
+
if @api_client.config.client_side_validation && mcp_server_uuid.nil?
|
|
881
|
+
fail ArgumentError, "Missing the required parameter 'mcp_server_uuid' when calling ConversationApi.get_agent_profile_mcp"
|
|
882
|
+
end
|
|
883
|
+
# resource path
|
|
884
|
+
local_var_path = '/conversation/agent/profiles/{user_id}/mcps/{mcp_server_uuid}'.sub('{' + 'user_id' + '}', user_id.to_s).sub('{' + 'mcp_server_uuid' + '}', mcp_server_uuid.to_s)
|
|
885
|
+
|
|
886
|
+
# query parameters
|
|
887
|
+
query_params = {}
|
|
888
|
+
|
|
889
|
+
# header parameters
|
|
890
|
+
header_params = {}
|
|
891
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
892
|
+
# HTTP header 'Accept' (if needed)
|
|
893
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
894
|
+
# HTTP header 'Content-Type'
|
|
895
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
896
|
+
|
|
897
|
+
# form parameters
|
|
898
|
+
form_params = {}
|
|
899
|
+
|
|
900
|
+
# http body (model)
|
|
901
|
+
post_body = nil
|
|
902
|
+
auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
903
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
904
|
+
:header_params => header_params,
|
|
905
|
+
:query_params => query_params,
|
|
906
|
+
:form_params => form_params,
|
|
907
|
+
:body => post_body,
|
|
908
|
+
:auth_names => auth_names,
|
|
909
|
+
:return_type => 'ConversationMcpServerResponse')
|
|
910
|
+
if @api_client.config.debugging
|
|
911
|
+
@api_client.config.logger.debug "API called: ConversationApi#get_agent_profile_mcp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
912
|
+
end
|
|
913
|
+
return data, status_code, headers
|
|
914
|
+
end
|
|
915
|
+
# Get the list of MCP servers associated with this agent
|
|
916
|
+
# Retrieve MCP servers associated with this agent
|
|
917
|
+
# @param user_id
|
|
918
|
+
# @param [Hash] opts the optional parameters
|
|
919
|
+
# @return [ConversationMcpServersResponse]
|
|
920
|
+
def get_agent_profile_mcps(user_id, opts = {})
|
|
921
|
+
data, _status_code, _headers = get_agent_profile_mcps_with_http_info(user_id, opts)
|
|
922
|
+
data
|
|
923
|
+
end
|
|
924
|
+
|
|
925
|
+
# Get the list of MCP servers associated with this agent
|
|
926
|
+
# Retrieve MCP servers associated with this agent
|
|
927
|
+
# @param user_id
|
|
928
|
+
# @param [Hash] opts the optional parameters
|
|
929
|
+
# @return [Array<(ConversationMcpServersResponse, Fixnum, Hash)>] ConversationMcpServersResponse data, response status code and response headers
|
|
930
|
+
def get_agent_profile_mcps_with_http_info(user_id, opts = {})
|
|
931
|
+
if @api_client.config.debugging
|
|
932
|
+
@api_client.config.logger.debug 'Calling API: ConversationApi.get_agent_profile_mcps ...'
|
|
933
|
+
end
|
|
934
|
+
# verify the required parameter 'user_id' is set
|
|
935
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
936
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.get_agent_profile_mcps"
|
|
937
|
+
end
|
|
938
|
+
# resource path
|
|
939
|
+
local_var_path = '/conversation/agent/profiles/{user_id}/mcps'.sub('{' + 'user_id' + '}', user_id.to_s)
|
|
940
|
+
|
|
941
|
+
# query parameters
|
|
942
|
+
query_params = {}
|
|
943
|
+
|
|
944
|
+
# header parameters
|
|
945
|
+
header_params = {}
|
|
946
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
947
|
+
# HTTP header 'Accept' (if needed)
|
|
948
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
949
|
+
# HTTP header 'Content-Type'
|
|
950
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
951
|
+
|
|
952
|
+
# form parameters
|
|
953
|
+
form_params = {}
|
|
954
|
+
|
|
955
|
+
# http body (model)
|
|
956
|
+
post_body = nil
|
|
957
|
+
auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
958
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
959
|
+
:header_params => header_params,
|
|
960
|
+
:query_params => query_params,
|
|
961
|
+
:form_params => form_params,
|
|
962
|
+
:body => post_body,
|
|
963
|
+
:auth_names => auth_names,
|
|
964
|
+
:return_type => 'ConversationMcpServersResponse')
|
|
965
|
+
if @api_client.config.debugging
|
|
966
|
+
@api_client.config.logger.debug "API called: ConversationApi#get_agent_profile_mcps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
967
|
+
end
|
|
968
|
+
return data, status_code, headers
|
|
969
|
+
end
|
|
854
970
|
# Get agent profiles
|
|
855
971
|
# Retrieve the agents profile
|
|
856
972
|
# @param [Hash] opts the optional parameters
|
|
@@ -3187,6 +3303,67 @@ module UltracartClient
|
|
|
3187
3303
|
end
|
|
3188
3304
|
return data, status_code, headers
|
|
3189
3305
|
end
|
|
3306
|
+
# Insert an agent MCP server
|
|
3307
|
+
# Insert an agent MCP server
|
|
3308
|
+
# @param user_id
|
|
3309
|
+
# @param mcp_server MCP Server
|
|
3310
|
+
# @param [Hash] opts the optional parameters
|
|
3311
|
+
# @return [ConversationMcpServerResponse]
|
|
3312
|
+
def insert_agent_profile_mcp(user_id, mcp_server, opts = {})
|
|
3313
|
+
data, _status_code, _headers = insert_agent_profile_mcp_with_http_info(user_id, mcp_server, opts)
|
|
3314
|
+
data
|
|
3315
|
+
end
|
|
3316
|
+
|
|
3317
|
+
# Insert an agent MCP server
|
|
3318
|
+
# Insert an agent MCP server
|
|
3319
|
+
# @param user_id
|
|
3320
|
+
# @param mcp_server MCP Server
|
|
3321
|
+
# @param [Hash] opts the optional parameters
|
|
3322
|
+
# @return [Array<(ConversationMcpServerResponse, Fixnum, Hash)>] ConversationMcpServerResponse data, response status code and response headers
|
|
3323
|
+
def insert_agent_profile_mcp_with_http_info(user_id, mcp_server, opts = {})
|
|
3324
|
+
if @api_client.config.debugging
|
|
3325
|
+
@api_client.config.logger.debug 'Calling API: ConversationApi.insert_agent_profile_mcp ...'
|
|
3326
|
+
end
|
|
3327
|
+
# verify the required parameter 'user_id' is set
|
|
3328
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
3329
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.insert_agent_profile_mcp"
|
|
3330
|
+
end
|
|
3331
|
+
# verify the required parameter 'mcp_server' is set
|
|
3332
|
+
if @api_client.config.client_side_validation && mcp_server.nil?
|
|
3333
|
+
fail ArgumentError, "Missing the required parameter 'mcp_server' when calling ConversationApi.insert_agent_profile_mcp"
|
|
3334
|
+
end
|
|
3335
|
+
# resource path
|
|
3336
|
+
local_var_path = '/conversation/agent/profiles/{user_id}/mcps'.sub('{' + 'user_id' + '}', user_id.to_s)
|
|
3337
|
+
|
|
3338
|
+
# query parameters
|
|
3339
|
+
query_params = {}
|
|
3340
|
+
|
|
3341
|
+
# header parameters
|
|
3342
|
+
header_params = {}
|
|
3343
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
3344
|
+
# HTTP header 'Accept' (if needed)
|
|
3345
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
3346
|
+
# HTTP header 'Content-Type'
|
|
3347
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
3348
|
+
|
|
3349
|
+
# form parameters
|
|
3350
|
+
form_params = {}
|
|
3351
|
+
|
|
3352
|
+
# http body (model)
|
|
3353
|
+
post_body = @api_client.object_to_http_body(mcp_server)
|
|
3354
|
+
auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
3355
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
3356
|
+
:header_params => header_params,
|
|
3357
|
+
:query_params => query_params,
|
|
3358
|
+
:form_params => form_params,
|
|
3359
|
+
:body => post_body,
|
|
3360
|
+
:auth_names => auth_names,
|
|
3361
|
+
:return_type => 'ConversationMcpServerResponse')
|
|
3362
|
+
if @api_client.config.debugging
|
|
3363
|
+
@api_client.config.logger.debug "API called: ConversationApi#insert_agent_profile_mcp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
3364
|
+
end
|
|
3365
|
+
return data, status_code, headers
|
|
3366
|
+
end
|
|
3190
3367
|
# Insert a canned message
|
|
3191
3368
|
# Insert a canned message
|
|
3192
3369
|
# @param canned_message Canned message
|
|
@@ -4233,6 +4410,73 @@ module UltracartClient
|
|
|
4233
4410
|
end
|
|
4234
4411
|
return data, status_code, headers
|
|
4235
4412
|
end
|
|
4413
|
+
# Update an agent MCP server
|
|
4414
|
+
# Update an agent MCP server
|
|
4415
|
+
# @param user_id
|
|
4416
|
+
# @param mcp_server_uuid
|
|
4417
|
+
# @param mcp_server MCP Server
|
|
4418
|
+
# @param [Hash] opts the optional parameters
|
|
4419
|
+
# @return [ConversationMcpServerResponse]
|
|
4420
|
+
def update_agent_profile_mcp(user_id, mcp_server_uuid, mcp_server, opts = {})
|
|
4421
|
+
data, _status_code, _headers = update_agent_profile_mcp_with_http_info(user_id, mcp_server_uuid, mcp_server, opts)
|
|
4422
|
+
data
|
|
4423
|
+
end
|
|
4424
|
+
|
|
4425
|
+
# Update an agent MCP server
|
|
4426
|
+
# Update an agent MCP server
|
|
4427
|
+
# @param user_id
|
|
4428
|
+
# @param mcp_server_uuid
|
|
4429
|
+
# @param mcp_server MCP Server
|
|
4430
|
+
# @param [Hash] opts the optional parameters
|
|
4431
|
+
# @return [Array<(ConversationMcpServerResponse, Fixnum, Hash)>] ConversationMcpServerResponse data, response status code and response headers
|
|
4432
|
+
def update_agent_profile_mcp_with_http_info(user_id, mcp_server_uuid, mcp_server, opts = {})
|
|
4433
|
+
if @api_client.config.debugging
|
|
4434
|
+
@api_client.config.logger.debug 'Calling API: ConversationApi.update_agent_profile_mcp ...'
|
|
4435
|
+
end
|
|
4436
|
+
# verify the required parameter 'user_id' is set
|
|
4437
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
4438
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.update_agent_profile_mcp"
|
|
4439
|
+
end
|
|
4440
|
+
# verify the required parameter 'mcp_server_uuid' is set
|
|
4441
|
+
if @api_client.config.client_side_validation && mcp_server_uuid.nil?
|
|
4442
|
+
fail ArgumentError, "Missing the required parameter 'mcp_server_uuid' when calling ConversationApi.update_agent_profile_mcp"
|
|
4443
|
+
end
|
|
4444
|
+
# verify the required parameter 'mcp_server' is set
|
|
4445
|
+
if @api_client.config.client_side_validation && mcp_server.nil?
|
|
4446
|
+
fail ArgumentError, "Missing the required parameter 'mcp_server' when calling ConversationApi.update_agent_profile_mcp"
|
|
4447
|
+
end
|
|
4448
|
+
# resource path
|
|
4449
|
+
local_var_path = '/conversation/agent/profiles/{user_id}/mcps/{mcp_server_uuid}'.sub('{' + 'user_id' + '}', user_id.to_s).sub('{' + 'mcp_server_uuid' + '}', mcp_server_uuid.to_s)
|
|
4450
|
+
|
|
4451
|
+
# query parameters
|
|
4452
|
+
query_params = {}
|
|
4453
|
+
|
|
4454
|
+
# header parameters
|
|
4455
|
+
header_params = {}
|
|
4456
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
4457
|
+
# HTTP header 'Accept' (if needed)
|
|
4458
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
4459
|
+
# HTTP header 'Content-Type'
|
|
4460
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
4461
|
+
|
|
4462
|
+
# form parameters
|
|
4463
|
+
form_params = {}
|
|
4464
|
+
|
|
4465
|
+
# http body (model)
|
|
4466
|
+
post_body = @api_client.object_to_http_body(mcp_server)
|
|
4467
|
+
auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
4468
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
4469
|
+
:header_params => header_params,
|
|
4470
|
+
:query_params => query_params,
|
|
4471
|
+
:form_params => form_params,
|
|
4472
|
+
:body => post_body,
|
|
4473
|
+
:auth_names => auth_names,
|
|
4474
|
+
:return_type => 'ConversationMcpServerResponse')
|
|
4475
|
+
if @api_client.config.debugging
|
|
4476
|
+
@api_client.config.logger.debug "API called: ConversationApi#update_agent_profile_mcp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
4477
|
+
end
|
|
4478
|
+
return data, status_code, headers
|
|
4479
|
+
end
|
|
4236
4480
|
# Update a canned message
|
|
4237
4481
|
# Update a canned message
|
|
4238
4482
|
# @param conversation_canned_message_oid
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#UltraCart Rest API V2
|
|
3
|
+
|
|
4
|
+
#UltraCart REST API Version 2
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 2.0.0
|
|
7
|
+
Contact: support@ultracart.com
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.15-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module UltracartClient
|
|
16
|
+
class ConversationMcpServer
|
|
17
|
+
# Authorization Method
|
|
18
|
+
attr_accessor :auth_method
|
|
19
|
+
|
|
20
|
+
# Basic password
|
|
21
|
+
attr_accessor :basic_password
|
|
22
|
+
|
|
23
|
+
# Basic user name
|
|
24
|
+
attr_accessor :basic_user_name
|
|
25
|
+
|
|
26
|
+
# Header name
|
|
27
|
+
attr_accessor :header_name
|
|
28
|
+
|
|
29
|
+
# Header value
|
|
30
|
+
attr_accessor :header_value
|
|
31
|
+
|
|
32
|
+
# UUID of the MCP server configuration
|
|
33
|
+
attr_accessor :mcp_server_uuid
|
|
34
|
+
|
|
35
|
+
# Priority on which the MCP server tools are incorporated into the model. Lower number comes first
|
|
36
|
+
attr_accessor :priority
|
|
37
|
+
|
|
38
|
+
# URL to the MCP server (must be https)
|
|
39
|
+
attr_accessor :url
|
|
40
|
+
|
|
41
|
+
class EnumAttributeValidator
|
|
42
|
+
attr_reader :datatype
|
|
43
|
+
attr_reader :allowable_values
|
|
44
|
+
|
|
45
|
+
def initialize(datatype, allowable_values)
|
|
46
|
+
@allowable_values = allowable_values.map do |value|
|
|
47
|
+
case datatype.to_s
|
|
48
|
+
when /Integer/i
|
|
49
|
+
value.to_i
|
|
50
|
+
when /Float/i
|
|
51
|
+
value.to_f
|
|
52
|
+
else
|
|
53
|
+
value
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def valid?(value)
|
|
59
|
+
!value || allowable_values.include?(value)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
64
|
+
def self.attribute_map
|
|
65
|
+
{
|
|
66
|
+
:'auth_method' => :'auth_method',
|
|
67
|
+
:'basic_password' => :'basic_password',
|
|
68
|
+
:'basic_user_name' => :'basic_user_name',
|
|
69
|
+
:'header_name' => :'header_name',
|
|
70
|
+
:'header_value' => :'header_value',
|
|
71
|
+
:'mcp_server_uuid' => :'mcp_server_uuid',
|
|
72
|
+
:'priority' => :'priority',
|
|
73
|
+
:'url' => :'url'
|
|
74
|
+
}
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Attribute type mapping.
|
|
78
|
+
def self.swagger_types
|
|
79
|
+
{
|
|
80
|
+
:'auth_method' => :'String',
|
|
81
|
+
:'basic_password' => :'String',
|
|
82
|
+
:'basic_user_name' => :'String',
|
|
83
|
+
:'header_name' => :'String',
|
|
84
|
+
:'header_value' => :'String',
|
|
85
|
+
:'mcp_server_uuid' => :'String',
|
|
86
|
+
:'priority' => :'Integer',
|
|
87
|
+
:'url' => :'String'
|
|
88
|
+
}
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Initializes the object
|
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
93
|
+
def initialize(attributes = {})
|
|
94
|
+
return unless attributes.is_a?(Hash)
|
|
95
|
+
|
|
96
|
+
# convert string to symbol for hash key
|
|
97
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
98
|
+
|
|
99
|
+
if attributes.has_key?(:'auth_method')
|
|
100
|
+
self.auth_method = attributes[:'auth_method']
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.has_key?(:'basic_password')
|
|
104
|
+
self.basic_password = attributes[:'basic_password']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.has_key?(:'basic_user_name')
|
|
108
|
+
self.basic_user_name = attributes[:'basic_user_name']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.has_key?(:'header_name')
|
|
112
|
+
self.header_name = attributes[:'header_name']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.has_key?(:'header_value')
|
|
116
|
+
self.header_value = attributes[:'header_value']
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.has_key?(:'mcp_server_uuid')
|
|
120
|
+
self.mcp_server_uuid = attributes[:'mcp_server_uuid']
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.has_key?(:'priority')
|
|
124
|
+
self.priority = attributes[:'priority']
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if attributes.has_key?(:'url')
|
|
128
|
+
self.url = attributes[:'url']
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
133
|
+
# @return Array for valid properties with the reasons
|
|
134
|
+
def list_invalid_properties
|
|
135
|
+
invalid_properties = Array.new
|
|
136
|
+
invalid_properties
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Check to see if the all the properties in the model are valid
|
|
140
|
+
# @return true if the model is valid
|
|
141
|
+
def valid?
|
|
142
|
+
auth_method_validator = EnumAttributeValidator.new('String', ['none', 'header', 'basic'])
|
|
143
|
+
return false unless auth_method_validator.valid?(@auth_method)
|
|
144
|
+
true
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
148
|
+
# @param [Object] auth_method Object to be assigned
|
|
149
|
+
def auth_method=(auth_method)
|
|
150
|
+
validator = EnumAttributeValidator.new('String', ['none', 'header', 'basic'])
|
|
151
|
+
unless validator.valid?(auth_method)
|
|
152
|
+
fail ArgumentError, 'invalid value for "auth_method", must be one of #{validator.allowable_values}.'
|
|
153
|
+
end
|
|
154
|
+
@auth_method = auth_method
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Checks equality by comparing each attribute.
|
|
158
|
+
# @param [Object] Object to be compared
|
|
159
|
+
def ==(o)
|
|
160
|
+
return true if self.equal?(o)
|
|
161
|
+
self.class == o.class &&
|
|
162
|
+
auth_method == o.auth_method &&
|
|
163
|
+
basic_password == o.basic_password &&
|
|
164
|
+
basic_user_name == o.basic_user_name &&
|
|
165
|
+
header_name == o.header_name &&
|
|
166
|
+
header_value == o.header_value &&
|
|
167
|
+
mcp_server_uuid == o.mcp_server_uuid &&
|
|
168
|
+
priority == o.priority &&
|
|
169
|
+
url == o.url
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# @see the `==` method
|
|
173
|
+
# @param [Object] Object to be compared
|
|
174
|
+
def eql?(o)
|
|
175
|
+
self == o
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Calculates hash code according to all attributes.
|
|
179
|
+
# @return [Fixnum] Hash code
|
|
180
|
+
def hash
|
|
181
|
+
[auth_method, basic_password, basic_user_name, header_name, header_value, mcp_server_uuid, priority, url].hash
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Builds the object from hash
|
|
185
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
186
|
+
# @return [Object] Returns the model itself
|
|
187
|
+
def build_from_hash(attributes)
|
|
188
|
+
return nil unless attributes.is_a?(Hash)
|
|
189
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
190
|
+
if type =~ /\AArray<(.*)>/i
|
|
191
|
+
# check to ensure the input is an array given that the attribute
|
|
192
|
+
# is documented as an array but the input is not
|
|
193
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
194
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
195
|
+
end
|
|
196
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
197
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
198
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
self
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Deserializes the data based on type
|
|
205
|
+
# @param string type Data type
|
|
206
|
+
# @param string value Value to be deserialized
|
|
207
|
+
# @return [Object] Deserialized data
|
|
208
|
+
def _deserialize(type, value)
|
|
209
|
+
case type.to_sym
|
|
210
|
+
when :DateTime
|
|
211
|
+
DateTime.parse(value)
|
|
212
|
+
when :Date
|
|
213
|
+
Date.parse(value)
|
|
214
|
+
when :String
|
|
215
|
+
value.to_s
|
|
216
|
+
when :Integer
|
|
217
|
+
value.to_i
|
|
218
|
+
when :Float
|
|
219
|
+
value.to_f
|
|
220
|
+
when :BOOLEAN
|
|
221
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
222
|
+
true
|
|
223
|
+
else
|
|
224
|
+
false
|
|
225
|
+
end
|
|
226
|
+
when :Object
|
|
227
|
+
# generic object (usually a Hash), return directly
|
|
228
|
+
value
|
|
229
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
230
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
231
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
232
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
233
|
+
k_type = Regexp.last_match[:k_type]
|
|
234
|
+
v_type = Regexp.last_match[:v_type]
|
|
235
|
+
{}.tap do |hash|
|
|
236
|
+
value.each do |k, v|
|
|
237
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
else # model
|
|
241
|
+
temp_model = UltracartClient.const_get(type).new
|
|
242
|
+
temp_model.build_from_hash(value)
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Returns the string representation of the object
|
|
247
|
+
# @return [String] String presentation of the object
|
|
248
|
+
def to_s
|
|
249
|
+
to_hash.to_s
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
253
|
+
# @return [Hash] Returns the object in the form of hash
|
|
254
|
+
def to_body
|
|
255
|
+
to_hash
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Returns the object in the form of hash
|
|
259
|
+
# @return [Hash] Returns the object in the form of hash
|
|
260
|
+
def to_hash
|
|
261
|
+
hash = {}
|
|
262
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
263
|
+
value = self.send(attr)
|
|
264
|
+
next if value.nil?
|
|
265
|
+
hash[param] = _to_hash(value)
|
|
266
|
+
end
|
|
267
|
+
hash
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# Outputs non-array value in the form of hash
|
|
271
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
272
|
+
# @param [Object] value Any valid value
|
|
273
|
+
# @return [Hash] Returns the value in the form of hash
|
|
274
|
+
def _to_hash(value)
|
|
275
|
+
if value.is_a?(Array)
|
|
276
|
+
value.compact.map { |v| _to_hash(v) }
|
|
277
|
+
elsif value.is_a?(Hash)
|
|
278
|
+
{}.tap do |hash|
|
|
279
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
280
|
+
end
|
|
281
|
+
elsif value.respond_to? :to_hash
|
|
282
|
+
value.to_hash
|
|
283
|
+
else
|
|
284
|
+
value
|
|
285
|
+
end
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
end
|
|
289
|
+
end
|