ultracart_api 4.1.29 → 4.1.31

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.
@@ -102,6 +102,76 @@ module UltracartClient
102
102
  return data, status_code, headers
103
103
  end
104
104
 
105
+ # Delete an agent MCP server
106
+ # Delete an agent MCP server
107
+ # @param user_id [Integer]
108
+ # @param mcp_server_uuid [String]
109
+ # @param [Hash] opts the optional parameters
110
+ # @return [nil]
111
+ def delete_agent_profile_mcp(user_id, mcp_server_uuid, opts = {})
112
+ delete_agent_profile_mcp_with_http_info(user_id, mcp_server_uuid, opts)
113
+ nil
114
+ end
115
+
116
+ # Delete an agent MCP server
117
+ # Delete an agent MCP server
118
+ # @param user_id [Integer]
119
+ # @param mcp_server_uuid [String]
120
+ # @param [Hash] opts the optional parameters
121
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
122
+ def delete_agent_profile_mcp_with_http_info(user_id, mcp_server_uuid, opts = {})
123
+ if @api_client.config.debugging
124
+ @api_client.config.logger.debug 'Calling API: ConversationApi.delete_agent_profile_mcp ...'
125
+ end
126
+ # verify the required parameter 'user_id' is set
127
+ if @api_client.config.client_side_validation && user_id.nil?
128
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.delete_agent_profile_mcp"
129
+ end
130
+ # verify the required parameter 'mcp_server_uuid' is set
131
+ if @api_client.config.client_side_validation && mcp_server_uuid.nil?
132
+ fail ArgumentError, "Missing the required parameter 'mcp_server_uuid' when calling ConversationApi.delete_agent_profile_mcp"
133
+ end
134
+ # resource path
135
+ local_var_path = '/conversation/agent/profiles/{user_id}/mcps/{mcp_server_uuid}'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'mcp_server_uuid' + '}', CGI.escape(mcp_server_uuid.to_s))
136
+
137
+ # query parameters
138
+ query_params = opts[:query_params] || {}
139
+
140
+ # header parameters
141
+ header_params = opts[:header_params] || {}
142
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
143
+ # HTTP header 'Accept' (if needed)
144
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
145
+
146
+ # form parameters
147
+ form_params = opts[:form_params] || {}
148
+
149
+ # http body (model)
150
+ post_body = opts[:debug_body]
151
+
152
+ # return_type
153
+ return_type = opts[:debug_return_type]
154
+
155
+ # auth_names
156
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
157
+
158
+ new_options = opts.merge(
159
+ :operation => :"ConversationApi.delete_agent_profile_mcp",
160
+ :header_params => header_params,
161
+ :query_params => query_params,
162
+ :form_params => form_params,
163
+ :body => post_body,
164
+ :auth_names => auth_names,
165
+ :return_type => return_type
166
+ )
167
+
168
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug "API called: ConversationApi#delete_agent_profile_mcp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
171
+ end
172
+ return data, status_code, headers
173
+ end
174
+
105
175
  # Delete a conversation canned message
106
176
  # Delete a conversation canned message
107
177
  # @param conversation_canned_message_oid [Integer]
@@ -992,6 +1062,210 @@ module UltracartClient
992
1062
  return data, status_code, headers
993
1063
  end
994
1064
 
1065
+ # Get an MCP server associated with this agent
1066
+ # Retrieve MCP server associated with this agent
1067
+ # @param user_id [Integer]
1068
+ # @param mcp_server_uuid [String]
1069
+ # @param [Hash] opts the optional parameters
1070
+ # @return [ConversationMcpServerResponse]
1071
+ def get_agent_profile_mcp(user_id, mcp_server_uuid, opts = {})
1072
+ data, _status_code, _headers = get_agent_profile_mcp_with_http_info(user_id, mcp_server_uuid, opts)
1073
+ data
1074
+ end
1075
+
1076
+ # Get an MCP server associated with this agent
1077
+ # Retrieve MCP server associated with this agent
1078
+ # @param user_id [Integer]
1079
+ # @param mcp_server_uuid [String]
1080
+ # @param [Hash] opts the optional parameters
1081
+ # @return [Array<(ConversationMcpServerResponse, Integer, Hash)>] ConversationMcpServerResponse data, response status code and response headers
1082
+ def get_agent_profile_mcp_with_http_info(user_id, mcp_server_uuid, opts = {})
1083
+ if @api_client.config.debugging
1084
+ @api_client.config.logger.debug 'Calling API: ConversationApi.get_agent_profile_mcp ...'
1085
+ end
1086
+ # verify the required parameter 'user_id' is set
1087
+ if @api_client.config.client_side_validation && user_id.nil?
1088
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.get_agent_profile_mcp"
1089
+ end
1090
+ # verify the required parameter 'mcp_server_uuid' is set
1091
+ if @api_client.config.client_side_validation && mcp_server_uuid.nil?
1092
+ fail ArgumentError, "Missing the required parameter 'mcp_server_uuid' when calling ConversationApi.get_agent_profile_mcp"
1093
+ end
1094
+ # resource path
1095
+ local_var_path = '/conversation/agent/profiles/{user_id}/mcps/{mcp_server_uuid}'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'mcp_server_uuid' + '}', CGI.escape(mcp_server_uuid.to_s))
1096
+
1097
+ # query parameters
1098
+ query_params = opts[:query_params] || {}
1099
+
1100
+ # header parameters
1101
+ header_params = opts[:header_params] || {}
1102
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1103
+ # HTTP header 'Accept' (if needed)
1104
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1105
+
1106
+ # form parameters
1107
+ form_params = opts[:form_params] || {}
1108
+
1109
+ # http body (model)
1110
+ post_body = opts[:debug_body]
1111
+
1112
+ # return_type
1113
+ return_type = opts[:debug_return_type] || 'ConversationMcpServerResponse'
1114
+
1115
+ # auth_names
1116
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1117
+
1118
+ new_options = opts.merge(
1119
+ :operation => :"ConversationApi.get_agent_profile_mcp",
1120
+ :header_params => header_params,
1121
+ :query_params => query_params,
1122
+ :form_params => form_params,
1123
+ :body => post_body,
1124
+ :auth_names => auth_names,
1125
+ :return_type => return_type
1126
+ )
1127
+
1128
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1129
+ if @api_client.config.debugging
1130
+ @api_client.config.logger.debug "API called: ConversationApi#get_agent_profile_mcp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1131
+ end
1132
+ return data, status_code, headers
1133
+ end
1134
+
1135
+ # Get the tools available from the MCP server
1136
+ # Get the tools available from the MCP server
1137
+ # @param user_id [Integer]
1138
+ # @param mcp_server_uuid [String]
1139
+ # @param [Hash] opts the optional parameters
1140
+ # @return [ConversationMcpServerToolsResponse]
1141
+ def get_agent_profile_mcp_tools(user_id, mcp_server_uuid, opts = {})
1142
+ data, _status_code, _headers = get_agent_profile_mcp_tools_with_http_info(user_id, mcp_server_uuid, opts)
1143
+ data
1144
+ end
1145
+
1146
+ # Get the tools available from the MCP server
1147
+ # Get the tools available from the MCP server
1148
+ # @param user_id [Integer]
1149
+ # @param mcp_server_uuid [String]
1150
+ # @param [Hash] opts the optional parameters
1151
+ # @return [Array<(ConversationMcpServerToolsResponse, Integer, Hash)>] ConversationMcpServerToolsResponse data, response status code and response headers
1152
+ def get_agent_profile_mcp_tools_with_http_info(user_id, mcp_server_uuid, opts = {})
1153
+ if @api_client.config.debugging
1154
+ @api_client.config.logger.debug 'Calling API: ConversationApi.get_agent_profile_mcp_tools ...'
1155
+ end
1156
+ # verify the required parameter 'user_id' is set
1157
+ if @api_client.config.client_side_validation && user_id.nil?
1158
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.get_agent_profile_mcp_tools"
1159
+ end
1160
+ # verify the required parameter 'mcp_server_uuid' is set
1161
+ if @api_client.config.client_side_validation && mcp_server_uuid.nil?
1162
+ fail ArgumentError, "Missing the required parameter 'mcp_server_uuid' when calling ConversationApi.get_agent_profile_mcp_tools"
1163
+ end
1164
+ # resource path
1165
+ local_var_path = '/conversation/agent/profiles/{user_id}/mcps/{mcp_server_uuid}/tools'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'mcp_server_uuid' + '}', CGI.escape(mcp_server_uuid.to_s))
1166
+
1167
+ # query parameters
1168
+ query_params = opts[:query_params] || {}
1169
+
1170
+ # header parameters
1171
+ header_params = opts[:header_params] || {}
1172
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1173
+ # HTTP header 'Accept' (if needed)
1174
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1175
+
1176
+ # form parameters
1177
+ form_params = opts[:form_params] || {}
1178
+
1179
+ # http body (model)
1180
+ post_body = opts[:debug_body]
1181
+
1182
+ # return_type
1183
+ return_type = opts[:debug_return_type] || 'ConversationMcpServerToolsResponse'
1184
+
1185
+ # auth_names
1186
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1187
+
1188
+ new_options = opts.merge(
1189
+ :operation => :"ConversationApi.get_agent_profile_mcp_tools",
1190
+ :header_params => header_params,
1191
+ :query_params => query_params,
1192
+ :form_params => form_params,
1193
+ :body => post_body,
1194
+ :auth_names => auth_names,
1195
+ :return_type => return_type
1196
+ )
1197
+
1198
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1199
+ if @api_client.config.debugging
1200
+ @api_client.config.logger.debug "API called: ConversationApi#get_agent_profile_mcp_tools\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1201
+ end
1202
+ return data, status_code, headers
1203
+ end
1204
+
1205
+ # Get the list of MCP servers associated with this agent
1206
+ # Retrieve MCP servers associated with this agent
1207
+ # @param user_id [Integer]
1208
+ # @param [Hash] opts the optional parameters
1209
+ # @return [ConversationMcpServersResponse]
1210
+ def get_agent_profile_mcps(user_id, opts = {})
1211
+ data, _status_code, _headers = get_agent_profile_mcps_with_http_info(user_id, opts)
1212
+ data
1213
+ end
1214
+
1215
+ # Get the list of MCP servers associated with this agent
1216
+ # Retrieve MCP servers associated with this agent
1217
+ # @param user_id [Integer]
1218
+ # @param [Hash] opts the optional parameters
1219
+ # @return [Array<(ConversationMcpServersResponse, Integer, Hash)>] ConversationMcpServersResponse data, response status code and response headers
1220
+ def get_agent_profile_mcps_with_http_info(user_id, opts = {})
1221
+ if @api_client.config.debugging
1222
+ @api_client.config.logger.debug 'Calling API: ConversationApi.get_agent_profile_mcps ...'
1223
+ end
1224
+ # verify the required parameter 'user_id' is set
1225
+ if @api_client.config.client_side_validation && user_id.nil?
1226
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.get_agent_profile_mcps"
1227
+ end
1228
+ # resource path
1229
+ local_var_path = '/conversation/agent/profiles/{user_id}/mcps'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
1230
+
1231
+ # query parameters
1232
+ query_params = opts[:query_params] || {}
1233
+
1234
+ # header parameters
1235
+ header_params = opts[:header_params] || {}
1236
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1237
+ # HTTP header 'Accept' (if needed)
1238
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1239
+
1240
+ # form parameters
1241
+ form_params = opts[:form_params] || {}
1242
+
1243
+ # http body (model)
1244
+ post_body = opts[:debug_body]
1245
+
1246
+ # return_type
1247
+ return_type = opts[:debug_return_type] || 'ConversationMcpServersResponse'
1248
+
1249
+ # auth_names
1250
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1251
+
1252
+ new_options = opts.merge(
1253
+ :operation => :"ConversationApi.get_agent_profile_mcps",
1254
+ :header_params => header_params,
1255
+ :query_params => query_params,
1256
+ :form_params => form_params,
1257
+ :body => post_body,
1258
+ :auth_names => auth_names,
1259
+ :return_type => return_type
1260
+ )
1261
+
1262
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1263
+ if @api_client.config.debugging
1264
+ @api_client.config.logger.debug "API called: ConversationApi#get_agent_profile_mcps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1265
+ end
1266
+ return data, status_code, headers
1267
+ end
1268
+
995
1269
  # Get agent profiles
996
1270
  # Retrieve the agents profile
997
1271
  # @param [Hash] opts the optional parameters
@@ -3744,6 +4018,81 @@ module UltracartClient
3744
4018
  return data, status_code, headers
3745
4019
  end
3746
4020
 
4021
+ # Insert an agent MCP server
4022
+ # Insert an agent MCP server
4023
+ # @param user_id [Integer]
4024
+ # @param mcp_server [ConversationMcpServer] MCP Server
4025
+ # @param [Hash] opts the optional parameters
4026
+ # @return [ConversationMcpServerResponse]
4027
+ def insert_agent_profile_mcp(user_id, mcp_server, opts = {})
4028
+ data, _status_code, _headers = insert_agent_profile_mcp_with_http_info(user_id, mcp_server, opts)
4029
+ data
4030
+ end
4031
+
4032
+ # Insert an agent MCP server
4033
+ # Insert an agent MCP server
4034
+ # @param user_id [Integer]
4035
+ # @param mcp_server [ConversationMcpServer] MCP Server
4036
+ # @param [Hash] opts the optional parameters
4037
+ # @return [Array<(ConversationMcpServerResponse, Integer, Hash)>] ConversationMcpServerResponse data, response status code and response headers
4038
+ def insert_agent_profile_mcp_with_http_info(user_id, mcp_server, opts = {})
4039
+ if @api_client.config.debugging
4040
+ @api_client.config.logger.debug 'Calling API: ConversationApi.insert_agent_profile_mcp ...'
4041
+ end
4042
+ # verify the required parameter 'user_id' is set
4043
+ if @api_client.config.client_side_validation && user_id.nil?
4044
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.insert_agent_profile_mcp"
4045
+ end
4046
+ # verify the required parameter 'mcp_server' is set
4047
+ if @api_client.config.client_side_validation && mcp_server.nil?
4048
+ fail ArgumentError, "Missing the required parameter 'mcp_server' when calling ConversationApi.insert_agent_profile_mcp"
4049
+ end
4050
+ # resource path
4051
+ local_var_path = '/conversation/agent/profiles/{user_id}/mcps'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
4052
+
4053
+ # query parameters
4054
+ query_params = opts[:query_params] || {}
4055
+
4056
+ # header parameters
4057
+ header_params = opts[:header_params] || {}
4058
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
4059
+ # HTTP header 'Accept' (if needed)
4060
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
4061
+ # HTTP header 'Content-Type'
4062
+ content_type = @api_client.select_header_content_type(['application/json'])
4063
+ if !content_type.nil?
4064
+ header_params['Content-Type'] = content_type
4065
+ end
4066
+
4067
+ # form parameters
4068
+ form_params = opts[:form_params] || {}
4069
+
4070
+ # http body (model)
4071
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(mcp_server)
4072
+
4073
+ # return_type
4074
+ return_type = opts[:debug_return_type] || 'ConversationMcpServerResponse'
4075
+
4076
+ # auth_names
4077
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
4078
+
4079
+ new_options = opts.merge(
4080
+ :operation => :"ConversationApi.insert_agent_profile_mcp",
4081
+ :header_params => header_params,
4082
+ :query_params => query_params,
4083
+ :form_params => form_params,
4084
+ :body => post_body,
4085
+ :auth_names => auth_names,
4086
+ :return_type => return_type
4087
+ )
4088
+
4089
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
4090
+ if @api_client.config.debugging
4091
+ @api_client.config.logger.debug "API called: ConversationApi#insert_agent_profile_mcp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
4092
+ end
4093
+ return data, status_code, headers
4094
+ end
4095
+
3747
4096
  # Insert a canned message
3748
4097
  # Insert a canned message
3749
4098
  # @param canned_message [ConversationCannedMessage] Canned message
@@ -0,0 +1,324 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class ConversationMcpServer
18
+ # Authorization Method
19
+ attr_accessor :auth_method
20
+
21
+ # Basic password
22
+ attr_accessor :basic_password
23
+
24
+ # Basic user name
25
+ attr_accessor :basic_user_name
26
+
27
+ # Header name
28
+ attr_accessor :header_name
29
+
30
+ # Header value
31
+ attr_accessor :header_value
32
+
33
+ # UUID of the MCP server configuration
34
+ attr_accessor :mcp_server_uuid
35
+
36
+ # Priority on which the MCP server tools are incorporated into the model. Lower number comes first
37
+ attr_accessor :priority
38
+
39
+ # URL to the MCP server (must be https)
40
+ attr_accessor :url
41
+
42
+ class EnumAttributeValidator
43
+ attr_reader :datatype
44
+ attr_reader :allowable_values
45
+
46
+ def initialize(datatype, allowable_values)
47
+ @allowable_values = allowable_values.map do |value|
48
+ case datatype.to_s
49
+ when /Integer/i
50
+ value.to_i
51
+ when /Float/i
52
+ value.to_f
53
+ else
54
+ value
55
+ end
56
+ end
57
+ end
58
+
59
+ def valid?(value)
60
+ !value || allowable_values.include?(value)
61
+ end
62
+ end
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'auth_method' => :'auth_method',
68
+ :'basic_password' => :'basic_password',
69
+ :'basic_user_name' => :'basic_user_name',
70
+ :'header_name' => :'header_name',
71
+ :'header_value' => :'header_value',
72
+ :'mcp_server_uuid' => :'mcp_server_uuid',
73
+ :'priority' => :'priority',
74
+ :'url' => :'url'
75
+ }
76
+ end
77
+
78
+ # Returns all the JSON keys this model knows about
79
+ def self.acceptable_attributes
80
+ attribute_map.values
81
+ end
82
+
83
+ # Attribute type mapping.
84
+ def self.openapi_types
85
+ {
86
+ :'auth_method' => :'String',
87
+ :'basic_password' => :'String',
88
+ :'basic_user_name' => :'String',
89
+ :'header_name' => :'String',
90
+ :'header_value' => :'String',
91
+ :'mcp_server_uuid' => :'String',
92
+ :'priority' => :'Integer',
93
+ :'url' => :'String'
94
+ }
95
+ end
96
+
97
+ # List of attributes with nullable: true
98
+ def self.openapi_nullable
99
+ Set.new([
100
+ ])
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ if (!attributes.is_a?(Hash))
107
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationMcpServer` initialize method"
108
+ end
109
+
110
+ # check to see if the attribute exists and convert string to symbol for hash key
111
+ attributes = attributes.each_with_object({}) { |(k, v), h|
112
+ if (!self.class.attribute_map.key?(k.to_sym))
113
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationMcpServer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
114
+ end
115
+ h[k.to_sym] = v
116
+ }
117
+
118
+ if attributes.key?(:'auth_method')
119
+ self.auth_method = attributes[:'auth_method']
120
+ end
121
+
122
+ if attributes.key?(:'basic_password')
123
+ self.basic_password = attributes[:'basic_password']
124
+ end
125
+
126
+ if attributes.key?(:'basic_user_name')
127
+ self.basic_user_name = attributes[:'basic_user_name']
128
+ end
129
+
130
+ if attributes.key?(:'header_name')
131
+ self.header_name = attributes[:'header_name']
132
+ end
133
+
134
+ if attributes.key?(:'header_value')
135
+ self.header_value = attributes[:'header_value']
136
+ end
137
+
138
+ if attributes.key?(:'mcp_server_uuid')
139
+ self.mcp_server_uuid = attributes[:'mcp_server_uuid']
140
+ end
141
+
142
+ if attributes.key?(:'priority')
143
+ self.priority = attributes[:'priority']
144
+ end
145
+
146
+ if attributes.key?(:'url')
147
+ self.url = attributes[:'url']
148
+ end
149
+ end
150
+
151
+ # Show invalid properties with the reasons. Usually used together with valid?
152
+ # @return Array for valid properties with the reasons
153
+ def list_invalid_properties
154
+ invalid_properties = Array.new
155
+ invalid_properties
156
+ end
157
+
158
+ # Check to see if the all the properties in the model are valid
159
+ # @return true if the model is valid
160
+ def valid?
161
+ auth_method_validator = EnumAttributeValidator.new('String', ["none", "header", "basic"])
162
+ return false unless auth_method_validator.valid?(@auth_method)
163
+ true
164
+ end
165
+
166
+ # Custom attribute writer method checking allowed values (enum).
167
+ # @param [Object] auth_method Object to be assigned
168
+ def auth_method=(auth_method)
169
+ validator = EnumAttributeValidator.new('String', ["none", "header", "basic"])
170
+ unless validator.valid?(auth_method)
171
+ fail ArgumentError, "invalid value for \"auth_method\", must be one of #{validator.allowable_values}."
172
+ end
173
+ @auth_method = auth_method
174
+ end
175
+
176
+ # Checks equality by comparing each attribute.
177
+ # @param [Object] Object to be compared
178
+ def ==(o)
179
+ return true if self.equal?(o)
180
+ self.class == o.class &&
181
+ auth_method == o.auth_method &&
182
+ basic_password == o.basic_password &&
183
+ basic_user_name == o.basic_user_name &&
184
+ header_name == o.header_name &&
185
+ header_value == o.header_value &&
186
+ mcp_server_uuid == o.mcp_server_uuid &&
187
+ priority == o.priority &&
188
+ url == o.url
189
+ end
190
+
191
+ # @see the `==` method
192
+ # @param [Object] Object to be compared
193
+ def eql?(o)
194
+ self == o
195
+ end
196
+
197
+ # Calculates hash code according to all attributes.
198
+ # @return [Integer] Hash code
199
+ def hash
200
+ [auth_method, basic_password, basic_user_name, header_name, header_value, mcp_server_uuid, priority, url].hash
201
+ end
202
+
203
+ # Builds the object from hash
204
+ # @param [Hash] attributes Model attributes in the form of hash
205
+ # @return [Object] Returns the model itself
206
+ def self.build_from_hash(attributes)
207
+ new.build_from_hash(attributes)
208
+ end
209
+
210
+ # Builds the object from hash
211
+ # @param [Hash] attributes Model attributes in the form of hash
212
+ # @return [Object] Returns the model itself
213
+ def build_from_hash(attributes)
214
+ return nil unless attributes.is_a?(Hash)
215
+ attributes = attributes.transform_keys(&:to_sym)
216
+ self.class.openapi_types.each_pair do |key, type|
217
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
218
+ self.send("#{key}=", nil)
219
+ elsif type =~ /\AArray<(.*)>/i
220
+ # check to ensure the input is an array given that the attribute
221
+ # is documented as an array but the input is not
222
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
223
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
224
+ end
225
+ elsif !attributes[self.class.attribute_map[key]].nil?
226
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
227
+ end
228
+ end
229
+
230
+ self
231
+ end
232
+
233
+ # Deserializes the data based on type
234
+ # @param string type Data type
235
+ # @param string value Value to be deserialized
236
+ # @return [Object] Deserialized data
237
+ def _deserialize(type, value)
238
+ case type.to_sym
239
+ when :Time
240
+ Time.parse(value)
241
+ when :Date
242
+ Date.parse(value)
243
+ when :String
244
+ value.to_s
245
+ when :Integer
246
+ value.to_i
247
+ when :Float
248
+ value.to_f
249
+ when :Boolean
250
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
251
+ true
252
+ else
253
+ false
254
+ end
255
+ when :Object
256
+ # generic object (usually a Hash), return directly
257
+ value
258
+ when /\AArray<(?<inner_type>.+)>\z/
259
+ inner_type = Regexp.last_match[:inner_type]
260
+ value.map { |v| _deserialize(inner_type, v) }
261
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
262
+ k_type = Regexp.last_match[:k_type]
263
+ v_type = Regexp.last_match[:v_type]
264
+ {}.tap do |hash|
265
+ value.each do |k, v|
266
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
267
+ end
268
+ end
269
+ else # model
270
+ # models (e.g. Pet) or oneOf
271
+ klass = UltracartClient.const_get(type)
272
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
273
+ end
274
+ end
275
+
276
+ # Returns the string representation of the object
277
+ # @return [String] String presentation of the object
278
+ def to_s
279
+ to_hash.to_s
280
+ end
281
+
282
+ # to_body is an alias to to_hash (backward compatibility)
283
+ # @return [Hash] Returns the object in the form of hash
284
+ def to_body
285
+ to_hash
286
+ end
287
+
288
+ # Returns the object in the form of hash
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_hash
291
+ hash = {}
292
+ self.class.attribute_map.each_pair do |attr, param|
293
+ value = self.send(attr)
294
+ if value.nil?
295
+ is_nullable = self.class.openapi_nullable.include?(attr)
296
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
297
+ end
298
+
299
+ hash[param] = _to_hash(value)
300
+ end
301
+ hash
302
+ end
303
+
304
+ # Outputs non-array value in the form of hash
305
+ # For object, use to_hash. Otherwise, just return the value
306
+ # @param [Object] value Any valid value
307
+ # @return [Hash] Returns the value in the form of hash
308
+ def _to_hash(value)
309
+ if value.is_a?(Array)
310
+ value.compact.map { |v| _to_hash(v) }
311
+ elsif value.is_a?(Hash)
312
+ {}.tap do |hash|
313
+ value.each { |k, v| hash[k] = _to_hash(v) }
314
+ end
315
+ elsif value.respond_to? :to_hash
316
+ value.to_hash
317
+ else
318
+ value
319
+ end
320
+ end
321
+
322
+ end
323
+
324
+ end