agentcat-api 0.0.2 → 0.0.4
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 +17 -19
- data/docs/AlertsApi.md +141 -0
- data/docs/EmailChannelVerifyRequest.md +18 -0
- data/docs/EmailChannelVerifyResponse.md +20 -0
- data/docs/NotificationsApi.md +67 -0
- data/docs/PublishEventRequest.md +4 -0
- data/docs/PublishServerInfoRequest.md +28 -0
- data/docs/ServerInfoAcceptedResponse.md +18 -0
- data/docs/ServerInfoApi.md +74 -0
- data/lib/agentcat-api/api/alerts_api.rb +142 -0
- data/lib/agentcat-api/api/notifications_api.rb +65 -0
- data/lib/agentcat-api/api/server_info_api.rb +86 -0
- data/lib/agentcat-api/models/email_channel_verify_request.rb +239 -0
- data/lib/agentcat-api/models/email_channel_verify_response.rb +263 -0
- data/lib/agentcat-api/models/publish_event_request.rb +23 -3
- data/lib/agentcat-api/models/publish_server_info_request.rb +307 -0
- data/lib/agentcat-api/models/server_info_accepted_response.rb +222 -0
- data/lib/agentcat-api/version.rb +1 -1
- data/lib/agentcat-api.rb +6 -0
- data/spec/api/alerts_api_spec.rb +59 -0
- data/spec/api/notifications_api_spec.rb +12 -0
- data/spec/api/server_info_api_spec.rb +47 -0
- data/spec/models/email_channel_verify_request_spec.rb +36 -0
- data/spec/models/email_channel_verify_response_spec.rb +42 -0
- data/spec/models/publish_event_request_spec.rb +13 -1
- data/spec/models/publish_server_info_request_spec.rb +66 -0
- data/spec/models/server_info_accepted_response_spec.rb +36 -0
- metadata +31 -10
|
@@ -45,6 +45,12 @@ module AgentCatApi
|
|
|
45
45
|
# Duration of the operation in milliseconds
|
|
46
46
|
attr_accessor :duration
|
|
47
47
|
|
|
48
|
+
# Token count of the request side as measured by the SDK. When absent, the server estimates it from the stored parameters.
|
|
49
|
+
attr_accessor :input_tokens
|
|
50
|
+
|
|
51
|
+
# Token count of the response side as measured by the SDK. When absent, the server estimates it from the stored response. Drives the oversized-tool-response rule.
|
|
52
|
+
attr_accessor :output_tokens
|
|
53
|
+
|
|
48
54
|
# Agent-provided timestamp of when the event occurred
|
|
49
55
|
attr_accessor :timestamp
|
|
50
56
|
|
|
@@ -128,6 +134,8 @@ module AgentCatApi
|
|
|
128
134
|
:'error' => :'error',
|
|
129
135
|
:'resource_name' => :'resource_name',
|
|
130
136
|
:'duration' => :'duration',
|
|
137
|
+
:'input_tokens' => :'input_tokens',
|
|
138
|
+
:'output_tokens' => :'output_tokens',
|
|
131
139
|
:'timestamp' => :'timestamp',
|
|
132
140
|
:'user_intent' => :'user_intent',
|
|
133
141
|
:'parameters' => :'parameters',
|
|
@@ -170,6 +178,8 @@ module AgentCatApi
|
|
|
170
178
|
:'error' => :'Object',
|
|
171
179
|
:'resource_name' => :'String',
|
|
172
180
|
:'duration' => :'Integer',
|
|
181
|
+
:'input_tokens' => :'Integer',
|
|
182
|
+
:'output_tokens' => :'Integer',
|
|
173
183
|
:'timestamp' => :'Time',
|
|
174
184
|
:'user_intent' => :'String',
|
|
175
185
|
:'parameters' => :'Object',
|
|
@@ -254,6 +264,14 @@ module AgentCatApi
|
|
|
254
264
|
self.duration = attributes[:'duration']
|
|
255
265
|
end
|
|
256
266
|
|
|
267
|
+
if attributes.key?(:'input_tokens')
|
|
268
|
+
self.input_tokens = attributes[:'input_tokens']
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
if attributes.key?(:'output_tokens')
|
|
272
|
+
self.output_tokens = attributes[:'output_tokens']
|
|
273
|
+
end
|
|
274
|
+
|
|
257
275
|
if attributes.key?(:'timestamp')
|
|
258
276
|
self.timestamp = attributes[:'timestamp']
|
|
259
277
|
end
|
|
@@ -338,7 +356,7 @@ module AgentCatApi
|
|
|
338
356
|
def valid?
|
|
339
357
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
340
358
|
return false if @project_id.nil?
|
|
341
|
-
event_type_validator = EnumAttributeValidator.new('String', ["mcp:ping", "mcp:initialize", "mcp:completion/complete", "mcp:logging/setLevel", "mcp:prompts/get", "mcp:prompts/list", "mcp:resources/list", "mcp:resources/templates/list", "mcp:resources/read", "mcp:resources/subscribe", "mcp:resources/unsubscribe", "mcp:tools/call", "mcp:tools/list", "mcp:tasks/get", "mcp:tasks/result", "mcp:tasks/list", "mcp:tasks/cancel", "agentcat:identify"])
|
|
359
|
+
event_type_validator = EnumAttributeValidator.new('String', ["mcp:ping", "mcp:initialize", "mcp:completion/complete", "mcp:logging/setLevel", "mcp:prompts/get", "mcp:prompts/list", "mcp:resources/list", "mcp:resources/templates/list", "mcp:resources/read", "mcp:resources/subscribe", "mcp:resources/unsubscribe", "mcp:tools/call", "mcp:tools/list", "mcp:tasks/get", "mcp:tasks/result", "mcp:tasks/list", "mcp:tasks/cancel", "agentcat:identify", "agentcat:custom"])
|
|
342
360
|
return false unless event_type_validator.valid?(@event_type)
|
|
343
361
|
true
|
|
344
362
|
end
|
|
@@ -356,7 +374,7 @@ module AgentCatApi
|
|
|
356
374
|
# Custom attribute writer method checking allowed values (enum).
|
|
357
375
|
# @param [Object] event_type Object to be assigned
|
|
358
376
|
def event_type=(event_type)
|
|
359
|
-
validator = EnumAttributeValidator.new('String', ["mcp:ping", "mcp:initialize", "mcp:completion/complete", "mcp:logging/setLevel", "mcp:prompts/get", "mcp:prompts/list", "mcp:resources/list", "mcp:resources/templates/list", "mcp:resources/read", "mcp:resources/subscribe", "mcp:resources/unsubscribe", "mcp:tools/call", "mcp:tools/list", "mcp:tasks/get", "mcp:tasks/result", "mcp:tasks/list", "mcp:tasks/cancel", "agentcat:identify"])
|
|
377
|
+
validator = EnumAttributeValidator.new('String', ["mcp:ping", "mcp:initialize", "mcp:completion/complete", "mcp:logging/setLevel", "mcp:prompts/get", "mcp:prompts/list", "mcp:resources/list", "mcp:resources/templates/list", "mcp:resources/read", "mcp:resources/subscribe", "mcp:resources/unsubscribe", "mcp:tools/call", "mcp:tools/list", "mcp:tasks/get", "mcp:tasks/result", "mcp:tasks/list", "mcp:tasks/cancel", "agentcat:identify", "agentcat:custom"])
|
|
360
378
|
unless validator.valid?(event_type)
|
|
361
379
|
fail ArgumentError, "invalid value for \"event_type\", must be one of #{validator.allowable_values}."
|
|
362
380
|
end
|
|
@@ -378,6 +396,8 @@ module AgentCatApi
|
|
|
378
396
|
error == o.error &&
|
|
379
397
|
resource_name == o.resource_name &&
|
|
380
398
|
duration == o.duration &&
|
|
399
|
+
input_tokens == o.input_tokens &&
|
|
400
|
+
output_tokens == o.output_tokens &&
|
|
381
401
|
timestamp == o.timestamp &&
|
|
382
402
|
user_intent == o.user_intent &&
|
|
383
403
|
parameters == o.parameters &&
|
|
@@ -405,7 +425,7 @@ module AgentCatApi
|
|
|
405
425
|
# Calculates hash code according to all attributes.
|
|
406
426
|
# @return [Integer] Hash code
|
|
407
427
|
def hash
|
|
408
|
-
[id, project_id, session_id, actor_id, event_id, event_type, is_error, error, resource_name, duration, timestamp, user_intent, parameters, response, identify_actor_given_id, identify_actor_name, identify_data, tags, properties, ip_address, sdk_language, agentcat_version, server_name, server_version, client_name, client_version].hash
|
|
428
|
+
[id, project_id, session_id, actor_id, event_id, event_type, is_error, error, resource_name, duration, input_tokens, output_tokens, timestamp, user_intent, parameters, response, identify_actor_given_id, identify_actor_name, identify_data, tags, properties, ip_address, sdk_language, agentcat_version, server_name, server_version, client_name, client_version].hash
|
|
409
429
|
end
|
|
410
430
|
|
|
411
431
|
# Builds the object from hash
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#AgentCat API
|
|
3
|
+
|
|
4
|
+
#API for AgentCat application
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module AgentCatApi
|
|
17
|
+
class PublishServerInfoRequest
|
|
18
|
+
# ID of the project that the MCP server reports to.
|
|
19
|
+
attr_accessor :project_id
|
|
20
|
+
|
|
21
|
+
# Name of the MCP server. Send the same value as server_name on events.
|
|
22
|
+
attr_accessor :server_name
|
|
23
|
+
|
|
24
|
+
# Version of the MCP server, as on events.
|
|
25
|
+
attr_accessor :server_version
|
|
26
|
+
|
|
27
|
+
# Display title of the MCP server.
|
|
28
|
+
attr_accessor :server_title
|
|
29
|
+
|
|
30
|
+
# Instructions that the MCP server gives to agents. AgentCat keeps the first 100,000 characters.
|
|
31
|
+
attr_accessor :instructions
|
|
32
|
+
|
|
33
|
+
# What the MCP server offers to agents. Each key is a list type of the MCP specification (tools, resources, resourceTemplates, prompts) with the items as the server lists them. Send every item with its full description. AgentCat stores keys that it does not know.
|
|
34
|
+
attr_accessor :features
|
|
35
|
+
|
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
37
|
+
def self.attribute_map
|
|
38
|
+
{
|
|
39
|
+
:'project_id' => :'project_id',
|
|
40
|
+
:'server_name' => :'server_name',
|
|
41
|
+
:'server_version' => :'server_version',
|
|
42
|
+
:'server_title' => :'server_title',
|
|
43
|
+
:'instructions' => :'instructions',
|
|
44
|
+
:'features' => :'features'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns attribute mapping this model knows about
|
|
49
|
+
def self.acceptable_attribute_map
|
|
50
|
+
attribute_map
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Returns all the JSON keys this model knows about
|
|
54
|
+
def self.acceptable_attributes
|
|
55
|
+
acceptable_attribute_map.values
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Attribute type mapping.
|
|
59
|
+
def self.openapi_types
|
|
60
|
+
{
|
|
61
|
+
:'project_id' => :'String',
|
|
62
|
+
:'server_name' => :'String',
|
|
63
|
+
:'server_version' => :'String',
|
|
64
|
+
:'server_title' => :'String',
|
|
65
|
+
:'instructions' => :'String',
|
|
66
|
+
:'features' => :'Object'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# List of attributes with nullable: true
|
|
71
|
+
def self.openapi_nullable
|
|
72
|
+
Set.new([
|
|
73
|
+
])
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Initializes the object
|
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
78
|
+
def initialize(attributes = {})
|
|
79
|
+
if (!attributes.is_a?(Hash))
|
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AgentCatApi::PublishServerInfoRequest` initialize method"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
86
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
87
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `AgentCatApi::PublishServerInfoRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
88
|
+
end
|
|
89
|
+
h[k.to_sym] = v
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'project_id')
|
|
93
|
+
self.project_id = attributes[:'project_id']
|
|
94
|
+
else
|
|
95
|
+
self.project_id = nil
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'server_name')
|
|
99
|
+
self.server_name = attributes[:'server_name']
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'server_version')
|
|
103
|
+
self.server_version = attributes[:'server_version']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'server_title')
|
|
107
|
+
self.server_title = attributes[:'server_title']
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'instructions')
|
|
111
|
+
self.instructions = attributes[:'instructions']
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'features')
|
|
115
|
+
self.features = attributes[:'features']
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
120
|
+
# @return Array for valid properties with the reasons
|
|
121
|
+
def list_invalid_properties
|
|
122
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
123
|
+
invalid_properties = Array.new
|
|
124
|
+
if @project_id.nil?
|
|
125
|
+
invalid_properties.push('invalid value for "project_id", project_id cannot be nil.')
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if !@server_name.nil? && @server_name.to_s.length > 255
|
|
129
|
+
invalid_properties.push('invalid value for "server_name", the character length must be smaller than or equal to 255.')
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
invalid_properties
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Check to see if the all the properties in the model are valid
|
|
136
|
+
# @return true if the model is valid
|
|
137
|
+
def valid?
|
|
138
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
139
|
+
return false if @project_id.nil?
|
|
140
|
+
return false if !@server_name.nil? && @server_name.to_s.length > 255
|
|
141
|
+
true
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Custom attribute writer method with validation
|
|
145
|
+
# @param [Object] project_id Value to be assigned
|
|
146
|
+
def project_id=(project_id)
|
|
147
|
+
if project_id.nil?
|
|
148
|
+
fail ArgumentError, 'project_id cannot be nil'
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
@project_id = project_id
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Custom attribute writer method with validation
|
|
155
|
+
# @param [Object] server_name Value to be assigned
|
|
156
|
+
def server_name=(server_name)
|
|
157
|
+
if server_name.nil?
|
|
158
|
+
fail ArgumentError, 'server_name cannot be nil'
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if server_name.to_s.length > 255
|
|
162
|
+
fail ArgumentError, 'invalid value for "server_name", the character length must be smaller than or equal to 255.'
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
@server_name = server_name
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Checks equality by comparing each attribute.
|
|
169
|
+
# @param [Object] Object to be compared
|
|
170
|
+
def ==(o)
|
|
171
|
+
return true if self.equal?(o)
|
|
172
|
+
self.class == o.class &&
|
|
173
|
+
project_id == o.project_id &&
|
|
174
|
+
server_name == o.server_name &&
|
|
175
|
+
server_version == o.server_version &&
|
|
176
|
+
server_title == o.server_title &&
|
|
177
|
+
instructions == o.instructions &&
|
|
178
|
+
features == o.features
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# @see the `==` method
|
|
182
|
+
# @param [Object] Object to be compared
|
|
183
|
+
def eql?(o)
|
|
184
|
+
self == o
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Calculates hash code according to all attributes.
|
|
188
|
+
# @return [Integer] Hash code
|
|
189
|
+
def hash
|
|
190
|
+
[project_id, server_name, server_version, server_title, instructions, features].hash
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Builds the object from hash
|
|
194
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
195
|
+
# @return [Object] Returns the model itself
|
|
196
|
+
def self.build_from_hash(attributes)
|
|
197
|
+
return nil unless attributes.is_a?(Hash)
|
|
198
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
199
|
+
transformed_hash = {}
|
|
200
|
+
openapi_types.each_pair do |key, type|
|
|
201
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
202
|
+
transformed_hash["#{key}"] = nil
|
|
203
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
204
|
+
# check to ensure the input is an array given that the attribute
|
|
205
|
+
# is documented as an array but the input is not
|
|
206
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
207
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
208
|
+
end
|
|
209
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
210
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
new(transformed_hash)
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Deserializes the data based on type
|
|
217
|
+
# @param string type Data type
|
|
218
|
+
# @param string value Value to be deserialized
|
|
219
|
+
# @return [Object] Deserialized data
|
|
220
|
+
def self._deserialize(type, value)
|
|
221
|
+
case type.to_sym
|
|
222
|
+
when :Time
|
|
223
|
+
Time.parse(value)
|
|
224
|
+
when :Date
|
|
225
|
+
Date.parse(value)
|
|
226
|
+
when :String
|
|
227
|
+
value.to_s
|
|
228
|
+
when :Integer
|
|
229
|
+
value.to_i
|
|
230
|
+
when :Float
|
|
231
|
+
value.to_f
|
|
232
|
+
when :Boolean
|
|
233
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
234
|
+
true
|
|
235
|
+
else
|
|
236
|
+
false
|
|
237
|
+
end
|
|
238
|
+
when :Object
|
|
239
|
+
# generic object (usually a Hash), return directly
|
|
240
|
+
value
|
|
241
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
242
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
243
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
244
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
245
|
+
k_type = Regexp.last_match[:k_type]
|
|
246
|
+
v_type = Regexp.last_match[:v_type]
|
|
247
|
+
{}.tap do |hash|
|
|
248
|
+
value.each do |k, v|
|
|
249
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
250
|
+
end
|
|
251
|
+
end
|
|
252
|
+
else # model
|
|
253
|
+
# models (e.g. Pet) or oneOf
|
|
254
|
+
klass = AgentCatApi.const_get(type)
|
|
255
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
256
|
+
end
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# Returns the string representation of the object
|
|
260
|
+
# @return [String] String presentation of the object
|
|
261
|
+
def to_s
|
|
262
|
+
to_hash.to_s
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
266
|
+
# @return [Hash] Returns the object in the form of hash
|
|
267
|
+
def to_body
|
|
268
|
+
to_hash
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# Returns the object in the form of hash
|
|
272
|
+
# @return [Hash] Returns the object in the form of hash
|
|
273
|
+
def to_hash
|
|
274
|
+
hash = {}
|
|
275
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
276
|
+
value = self.send(attr)
|
|
277
|
+
if value.nil?
|
|
278
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
279
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
hash[param] = _to_hash(value)
|
|
283
|
+
end
|
|
284
|
+
hash
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# Outputs non-array value in the form of hash
|
|
288
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
289
|
+
# @param [Object] value Any valid value
|
|
290
|
+
# @return [Hash] Returns the value in the form of hash
|
|
291
|
+
def _to_hash(value)
|
|
292
|
+
if value.is_a?(Array)
|
|
293
|
+
value.compact.map { |v| _to_hash(v) }
|
|
294
|
+
elsif value.is_a?(Hash)
|
|
295
|
+
{}.tap do |hash|
|
|
296
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
297
|
+
end
|
|
298
|
+
elsif value.respond_to? :to_hash
|
|
299
|
+
value.to_hash
|
|
300
|
+
else
|
|
301
|
+
value
|
|
302
|
+
end
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
end
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#AgentCat API
|
|
3
|
+
|
|
4
|
+
#API for AgentCat application
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module AgentCatApi
|
|
17
|
+
class ServerInfoAcceptedResponse
|
|
18
|
+
attr_accessor :status
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'status' => :'status'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns attribute mapping this model knows about
|
|
28
|
+
def self.acceptable_attribute_map
|
|
29
|
+
attribute_map
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
acceptable_attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'status' => :'String'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
if (!attributes.is_a?(Hash))
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AgentCatApi::ServerInfoAcceptedResponse` initialize method"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `AgentCatApi::ServerInfoAcceptedResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'status')
|
|
67
|
+
self.status = attributes[:'status']
|
|
68
|
+
else
|
|
69
|
+
self.status = 'accepted'
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
74
|
+
# @return Array for valid properties with the reasons
|
|
75
|
+
def list_invalid_properties
|
|
76
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
77
|
+
invalid_properties = Array.new
|
|
78
|
+
invalid_properties
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Check to see if the all the properties in the model are valid
|
|
82
|
+
# @return true if the model is valid
|
|
83
|
+
def valid?
|
|
84
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
85
|
+
true
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Checks equality by comparing each attribute.
|
|
89
|
+
# @param [Object] Object to be compared
|
|
90
|
+
def ==(o)
|
|
91
|
+
return true if self.equal?(o)
|
|
92
|
+
self.class == o.class &&
|
|
93
|
+
status == o.status
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# @see the `==` method
|
|
97
|
+
# @param [Object] Object to be compared
|
|
98
|
+
def eql?(o)
|
|
99
|
+
self == o
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Calculates hash code according to all attributes.
|
|
103
|
+
# @return [Integer] Hash code
|
|
104
|
+
def hash
|
|
105
|
+
[status].hash
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Builds the object from hash
|
|
109
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
110
|
+
# @return [Object] Returns the model itself
|
|
111
|
+
def self.build_from_hash(attributes)
|
|
112
|
+
return nil unless attributes.is_a?(Hash)
|
|
113
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
114
|
+
transformed_hash = {}
|
|
115
|
+
openapi_types.each_pair do |key, type|
|
|
116
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
117
|
+
transformed_hash["#{key}"] = nil
|
|
118
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
119
|
+
# check to ensure the input is an array given that the attribute
|
|
120
|
+
# is documented as an array but the input is not
|
|
121
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
122
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
123
|
+
end
|
|
124
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
125
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
new(transformed_hash)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Deserializes the data based on type
|
|
132
|
+
# @param string type Data type
|
|
133
|
+
# @param string value Value to be deserialized
|
|
134
|
+
# @return [Object] Deserialized data
|
|
135
|
+
def self._deserialize(type, value)
|
|
136
|
+
case type.to_sym
|
|
137
|
+
when :Time
|
|
138
|
+
Time.parse(value)
|
|
139
|
+
when :Date
|
|
140
|
+
Date.parse(value)
|
|
141
|
+
when :String
|
|
142
|
+
value.to_s
|
|
143
|
+
when :Integer
|
|
144
|
+
value.to_i
|
|
145
|
+
when :Float
|
|
146
|
+
value.to_f
|
|
147
|
+
when :Boolean
|
|
148
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
149
|
+
true
|
|
150
|
+
else
|
|
151
|
+
false
|
|
152
|
+
end
|
|
153
|
+
when :Object
|
|
154
|
+
# generic object (usually a Hash), return directly
|
|
155
|
+
value
|
|
156
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
157
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
158
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
159
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
160
|
+
k_type = Regexp.last_match[:k_type]
|
|
161
|
+
v_type = Regexp.last_match[:v_type]
|
|
162
|
+
{}.tap do |hash|
|
|
163
|
+
value.each do |k, v|
|
|
164
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
else # model
|
|
168
|
+
# models (e.g. Pet) or oneOf
|
|
169
|
+
klass = AgentCatApi.const_get(type)
|
|
170
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Returns the string representation of the object
|
|
175
|
+
# @return [String] String presentation of the object
|
|
176
|
+
def to_s
|
|
177
|
+
to_hash.to_s
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
181
|
+
# @return [Hash] Returns the object in the form of hash
|
|
182
|
+
def to_body
|
|
183
|
+
to_hash
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Returns the object in the form of hash
|
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
|
188
|
+
def to_hash
|
|
189
|
+
hash = {}
|
|
190
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
191
|
+
value = self.send(attr)
|
|
192
|
+
if value.nil?
|
|
193
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
194
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
hash[param] = _to_hash(value)
|
|
198
|
+
end
|
|
199
|
+
hash
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Outputs non-array value in the form of hash
|
|
203
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
204
|
+
# @param [Object] value Any valid value
|
|
205
|
+
# @return [Hash] Returns the value in the form of hash
|
|
206
|
+
def _to_hash(value)
|
|
207
|
+
if value.is_a?(Array)
|
|
208
|
+
value.compact.map { |v| _to_hash(v) }
|
|
209
|
+
elsif value.is_a?(Hash)
|
|
210
|
+
{}.tap do |hash|
|
|
211
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
212
|
+
end
|
|
213
|
+
elsif value.respond_to? :to_hash
|
|
214
|
+
value.to_hash
|
|
215
|
+
else
|
|
216
|
+
value
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
end
|
data/lib/agentcat-api/version.rb
CHANGED
data/lib/agentcat-api.rb
CHANGED
|
@@ -17,16 +17,22 @@ require 'agentcat-api/version'
|
|
|
17
17
|
require 'agentcat-api/configuration'
|
|
18
18
|
|
|
19
19
|
# Models
|
|
20
|
+
require 'agentcat-api/models/email_channel_verify_request'
|
|
21
|
+
require 'agentcat-api/models/email_channel_verify_response'
|
|
20
22
|
require 'agentcat-api/models/error'
|
|
21
23
|
require 'agentcat-api/models/event_accepted_response'
|
|
22
24
|
require 'agentcat-api/models/publish_event_request'
|
|
25
|
+
require 'agentcat-api/models/publish_server_info_request'
|
|
23
26
|
require 'agentcat-api/models/query_timeout'
|
|
27
|
+
require 'agentcat-api/models/server_info_accepted_response'
|
|
24
28
|
require 'agentcat-api/models/unsubscribe_request_request'
|
|
25
29
|
require 'agentcat-api/models/validation_error_value'
|
|
26
30
|
|
|
27
31
|
# APIs
|
|
32
|
+
require 'agentcat-api/api/alerts_api'
|
|
28
33
|
require 'agentcat-api/api/events_api'
|
|
29
34
|
require 'agentcat-api/api/notifications_api'
|
|
35
|
+
require 'agentcat-api/api/server_info_api'
|
|
30
36
|
|
|
31
37
|
module AgentCatApi
|
|
32
38
|
class << self
|