fetch_hive 0.2.6 → 0.2.8

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.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/fetch_hive/client.rb +139 -13
  4. data/lib/fetch_hive/generated/api/agent_chat_messages_api.rb +97 -0
  5. data/lib/fetch_hive/generated/api/agent_chats_api.rb +413 -0
  6. data/lib/fetch_hive/generated/api/agents_api.rb +359 -4
  7. data/lib/fetch_hive/generated/api/assets_api.rb +153 -0
  8. data/lib/fetch_hive/generated/api/hive_agents_api.rb +90 -0
  9. data/lib/fetch_hive/generated/api/knowledge_base_items_api.rb +482 -0
  10. data/lib/fetch_hive/generated/api/knowledge_bases_api.rb +457 -0
  11. data/lib/fetch_hive/generated/api/models_api.rb +79 -0
  12. data/lib/fetch_hive/generated/api/prompts_api.rb +3 -3
  13. data/lib/fetch_hive/generated/api/requests_api.rb +85 -0
  14. data/lib/fetch_hive/generated/api/search_services_api.rb +147 -0
  15. data/lib/fetch_hive/generated/api/workflows_api.rb +2 -2
  16. data/lib/fetch_hive/generated/api_client.rb +2 -2
  17. data/lib/fetch_hive/generated/api_error.rb +2 -2
  18. data/lib/fetch_hive/generated/api_model_base.rb +2 -2
  19. data/lib/fetch_hive/generated/configuration.rb +2 -2
  20. data/lib/fetch_hive/generated/models/agent_attachment.rb +104 -0
  21. data/lib/fetch_hive/generated/models/agent_attachment_one_of.rb +191 -0
  22. data/lib/fetch_hive/generated/models/agent_message.rb +11 -11
  23. data/lib/fetch_hive/generated/models/asset_object.rb +350 -0
  24. data/lib/fetch_hive/generated/models/asset_object_transcription.rb +212 -0
  25. data/lib/fetch_hive/generated/models/async_config.rb +2 -2
  26. data/lib/fetch_hive/generated/models/delete_public_workspaces_agents200_response.rb +164 -0
  27. data/lib/fetch_hive/generated/models/delete_public_workspaces_agents_chats200_response.rb +164 -0
  28. data/lib/fetch_hive/generated/models/delete_public_workspaces_agents_chats404_response.rb +164 -0
  29. data/lib/fetch_hive/generated/models/delete_public_workspaces_knowledge_bases200_response.rb +164 -0
  30. data/lib/fetch_hive/generated/models/delete_public_workspaces_knowledge_bases_items200_response.rb +164 -0
  31. data/lib/fetch_hive/generated/models/error_response.rb +23 -17
  32. data/lib/fetch_hive/generated/models/generated_artifact.rb +236 -0
  33. data/lib/fetch_hive/generated/models/get_public_models200_response_inner.rb +474 -0
  34. data/lib/fetch_hive/generated/models/get_public_requests200_response.rb +319 -0
  35. data/lib/fetch_hive/generated/models/get_public_requests404_response.rb +164 -0
  36. data/lib/fetch_hive/generated/models/get_public_search_services_countries200_response.rb +166 -0
  37. data/lib/fetch_hive/generated/models/get_public_search_services_countries200_response_services_inner.rb +294 -0
  38. data/lib/fetch_hive/generated/models/get_public_search_services_countries200_response_services_inner_countries_inner.rb +216 -0
  39. data/lib/fetch_hive/generated/models/get_public_search_services_countries2404_response.rb +175 -0
  40. data/lib/fetch_hive/generated/models/get_public_workspaces_agents200_response.rb +164 -0
  41. data/lib/fetch_hive/generated/models/get_public_workspaces_agents2200_response.rb +166 -0
  42. data/lib/fetch_hive/generated/models/get_public_workspaces_agents_chats200_response.rb +164 -0
  43. data/lib/fetch_hive/generated/models/get_public_workspaces_agents_chats_messages200_response.rb +166 -0
  44. data/lib/fetch_hive/generated/models/get_public_workspaces_agents_chats_messages200_response_messages_inner.rb +276 -0
  45. data/lib/fetch_hive/generated/models/get_public_workspaces_agents_chats_messages422_response.rb +164 -0
  46. data/lib/fetch_hive/generated/models/get_public_workspaces_assets200_response.rb +166 -0
  47. data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases200_response.rb +166 -0
  48. data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases2200_response.rb +164 -0
  49. data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases2422_response.rb +164 -0
  50. data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases_items200_response.rb +166 -0
  51. data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases_items200_response_knowledge_base_items_inner.rb +294 -0
  52. data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases_items2200_response.rb +164 -0
  53. data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases_items2422_response.rb +164 -0
  54. data/lib/fetch_hive/generated/models/hive_agent_async_config.rb +192 -0
  55. data/lib/fetch_hive/generated/models/hive_agent_sources.rb +187 -0
  56. data/lib/fetch_hive/generated/models/invoke_agent_request.rb +92 -11
  57. data/lib/fetch_hive/generated/models/invoke_agent_response.rb +18 -6
  58. data/lib/fetch_hive/generated/models/invoke_hive_agent_request.rb +239 -0
  59. data/lib/fetch_hive/generated/models/invoke_hive_agent_response.rb +213 -0
  60. data/lib/fetch_hive/generated/models/invoke_prompt_request.rb +2 -2
  61. data/lib/fetch_hive/generated/models/invoke_prompt_response.rb +2 -2
  62. data/lib/fetch_hive/generated/models/invoke_workflow_async_response.rb +2 -2
  63. data/lib/fetch_hive/generated/models/invoke_workflow_request.rb +2 -2
  64. data/lib/fetch_hive/generated/models/invoke_workflow_response.rb +2 -2
  65. data/lib/fetch_hive/generated/models/knowledge_base_object.rb +470 -0
  66. data/lib/fetch_hive/generated/models/metadata_value.rb +2 -2
  67. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents200_response.rb +190 -0
  68. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_chats200_response.rb +190 -0
  69. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_chats_clear_messages200_response.rb +190 -0
  70. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_chats_request.rb +164 -0
  71. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_chats_request_chat.rb +147 -0
  72. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_request.rb +164 -0
  73. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_request_agent.rb +304 -0
  74. data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases200_response.rb +190 -0
  75. data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_items200_response.rb +190 -0
  76. data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_items_request.rb +164 -0
  77. data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_items_request_knowledge_base_item.rb +265 -0
  78. data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_request.rb +147 -0
  79. data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_request_knowledge_base.rb +217 -0
  80. data/lib/fetch_hive/generated/models/post_public_workspaces_agents200_response.rb +190 -0
  81. data/lib/fetch_hive/generated/models/post_public_workspaces_agents422_response.rb +164 -0
  82. data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats200_response.rb +190 -0
  83. data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats200_response_chat.rb +305 -0
  84. data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats422_response.rb +175 -0
  85. data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats_request.rb +164 -0
  86. data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats_request_chat.rb +164 -0
  87. data/lib/fetch_hive/generated/models/post_public_workspaces_agents_request.rb +164 -0
  88. data/lib/fetch_hive/generated/models/post_public_workspaces_agents_request_agent.rb +252 -0
  89. data/lib/fetch_hive/generated/models/post_public_workspaces_assets200_response.rb +190 -0
  90. data/lib/fetch_hive/generated/models/post_public_workspaces_assets422_response.rb +216 -0
  91. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases200_response.rb +190 -0
  92. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items200_response.rb +190 -0
  93. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items422_response.rb +158 -0
  94. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items_regenerate200_response.rb +190 -0
  95. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items_request.rb +164 -0
  96. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items_request_knowledge_base_item.rb +322 -0
  97. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_request.rb +164 -0
  98. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_request_knowledge_base.rb +234 -0
  99. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_search200_response.rb +190 -0
  100. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_search422_response.rb +164 -0
  101. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_search_request.rb +302 -0
  102. data/lib/fetch_hive/generated/models/sse_chunk.rb +13 -4
  103. data/lib/fetch_hive/generated/models/token_usage.rb +2 -2
  104. data/lib/fetch_hive/generated/models/tool_invocation.rb +2 -2
  105. data/lib/fetch_hive/generated/version.rb +2 -2
  106. metadata +83 -3
@@ -0,0 +1,294 @@
1
+ =begin
2
+ #Fetch Hive Public API
3
+
4
+ #The Fetch Hive public API lets you invoke prompts, workflows, agents, and Hive Agents programmatically using an API token. ## Authentication All requests require a Bearer token in the `Authorization` header: ``` Authorization: Bearer <your-api-token> ``` ## Streaming Pass `\"streaming\": true` in the request body to receive a `text/event-stream` response. Each event is a JSON object sent as `data: <json>\\n\\n`. The stream ends with `data: [DONE]\\n\\n`.
5
+
6
+ The version of the OpenAPI document: 0.2.8
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FetchHive::Generated
17
+ class GetPublicSearchServicesCountries200ResponseServicesInner < ApiModelBase
18
+ attr_accessor :service
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :country_value_field
23
+
24
+ attr_accessor :country_value_format
25
+
26
+ attr_accessor :countries
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'service' => :'service',
54
+ :'name' => :'name',
55
+ :'country_value_field' => :'country_value_field',
56
+ :'country_value_format' => :'country_value_format',
57
+ :'countries' => :'countries'
58
+ }
59
+ end
60
+
61
+ # Returns attribute mapping this model knows about
62
+ def self.acceptable_attribute_map
63
+ attribute_map
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ acceptable_attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'service' => :'String',
75
+ :'name' => :'String',
76
+ :'country_value_field' => :'String',
77
+ :'country_value_format' => :'String',
78
+ :'countries' => :'Array<GetPublicSearchServicesCountries200ResponseServicesInnerCountriesInner>'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FetchHive::Generated::GetPublicSearchServicesCountries200ResponseServicesInner` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ acceptable_attribute_map = self.class.acceptable_attribute_map
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!acceptable_attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FetchHive::Generated::GetPublicSearchServicesCountries200ResponseServicesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'service')
105
+ self.service = attributes[:'service']
106
+ else
107
+ self.service = nil
108
+ end
109
+
110
+ if attributes.key?(:'name')
111
+ self.name = attributes[:'name']
112
+ else
113
+ self.name = nil
114
+ end
115
+
116
+ if attributes.key?(:'country_value_field')
117
+ self.country_value_field = attributes[:'country_value_field']
118
+ else
119
+ self.country_value_field = nil
120
+ end
121
+
122
+ if attributes.key?(:'country_value_format')
123
+ self.country_value_format = attributes[:'country_value_format']
124
+ else
125
+ self.country_value_format = nil
126
+ end
127
+
128
+ if attributes.key?(:'countries')
129
+ if (value = attributes[:'countries']).is_a?(Array)
130
+ self.countries = value
131
+ end
132
+ else
133
+ self.countries = nil
134
+ end
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properties with the reasons
139
+ def list_invalid_properties
140
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
141
+ invalid_properties = Array.new
142
+ if @service.nil?
143
+ invalid_properties.push('invalid value for "service", service cannot be nil.')
144
+ end
145
+
146
+ if @name.nil?
147
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
148
+ end
149
+
150
+ if @country_value_field.nil?
151
+ invalid_properties.push('invalid value for "country_value_field", country_value_field cannot be nil.')
152
+ end
153
+
154
+ if @country_value_format.nil?
155
+ invalid_properties.push('invalid value for "country_value_format", country_value_format cannot be nil.')
156
+ end
157
+
158
+ if @countries.nil?
159
+ invalid_properties.push('invalid value for "countries", countries cannot be nil.')
160
+ end
161
+
162
+ invalid_properties
163
+ end
164
+
165
+ # Check to see if the all the properties in the model are valid
166
+ # @return true if the model is valid
167
+ def valid?
168
+ warn '[DEPRECATED] the `valid?` method is obsolete'
169
+ return false if @service.nil?
170
+ return false if @name.nil?
171
+ return false if @country_value_field.nil?
172
+ return false if @country_value_format.nil?
173
+ country_value_format_validator = EnumAttributeValidator.new('String', ["country_name", "alpha2"])
174
+ return false unless country_value_format_validator.valid?(@country_value_format)
175
+ return false if @countries.nil?
176
+ true
177
+ end
178
+
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] service Value to be assigned
181
+ def service=(service)
182
+ if service.nil?
183
+ fail ArgumentError, 'service cannot be nil'
184
+ end
185
+
186
+ @service = service
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] name Value to be assigned
191
+ def name=(name)
192
+ if name.nil?
193
+ fail ArgumentError, 'name cannot be nil'
194
+ end
195
+
196
+ @name = name
197
+ end
198
+
199
+ # Custom attribute writer method with validation
200
+ # @param [Object] country_value_field Value to be assigned
201
+ def country_value_field=(country_value_field)
202
+ if country_value_field.nil?
203
+ fail ArgumentError, 'country_value_field cannot be nil'
204
+ end
205
+
206
+ @country_value_field = country_value_field
207
+ end
208
+
209
+ # Custom attribute writer method checking allowed values (enum).
210
+ # @param [Object] country_value_format Object to be assigned
211
+ def country_value_format=(country_value_format)
212
+ validator = EnumAttributeValidator.new('String', ["country_name", "alpha2"])
213
+ unless validator.valid?(country_value_format)
214
+ fail ArgumentError, "invalid value for \"country_value_format\", must be one of #{validator.allowable_values}."
215
+ end
216
+ @country_value_format = country_value_format
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] countries Value to be assigned
221
+ def countries=(countries)
222
+ if countries.nil?
223
+ fail ArgumentError, 'countries cannot be nil'
224
+ end
225
+
226
+ @countries = countries
227
+ end
228
+
229
+ # Checks equality by comparing each attribute.
230
+ # @param [Object] Object to be compared
231
+ def ==(o)
232
+ return true if self.equal?(o)
233
+ self.class == o.class &&
234
+ service == o.service &&
235
+ name == o.name &&
236
+ country_value_field == o.country_value_field &&
237
+ country_value_format == o.country_value_format &&
238
+ countries == o.countries
239
+ end
240
+
241
+ # @see the `==` method
242
+ # @param [Object] Object to be compared
243
+ def eql?(o)
244
+ self == o
245
+ end
246
+
247
+ # Calculates hash code according to all attributes.
248
+ # @return [Integer] Hash code
249
+ def hash
250
+ [service, name, country_value_field, country_value_format, countries].hash
251
+ end
252
+
253
+ # Builds the object from hash
254
+ # @param [Hash] attributes Model attributes in the form of hash
255
+ # @return [Object] Returns the model itself
256
+ def self.build_from_hash(attributes)
257
+ return nil unless attributes.is_a?(Hash)
258
+ attributes = attributes.transform_keys(&:to_sym)
259
+ transformed_hash = {}
260
+ openapi_types.each_pair do |key, type|
261
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
262
+ transformed_hash["#{key}"] = nil
263
+ elsif type =~ /\AArray<(.*)>/i
264
+ # check to ensure the input is an array given that the attribute
265
+ # is documented as an array but the input is not
266
+ if attributes[attribute_map[key]].is_a?(Array)
267
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
268
+ end
269
+ elsif !attributes[attribute_map[key]].nil?
270
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
271
+ end
272
+ end
273
+ new(transformed_hash)
274
+ end
275
+
276
+ # Returns the object in the form of hash
277
+ # @return [Hash] Returns the object in the form of hash
278
+ def to_hash
279
+ hash = {}
280
+ self.class.attribute_map.each_pair do |attr, param|
281
+ value = self.send(attr)
282
+ if value.nil?
283
+ is_nullable = self.class.openapi_nullable.include?(attr)
284
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
285
+ end
286
+
287
+ hash[param] = _to_hash(value)
288
+ end
289
+ hash
290
+ end
291
+
292
+ end
293
+
294
+ end
@@ -0,0 +1,216 @@
1
+ =begin
2
+ #Fetch Hive Public API
3
+
4
+ #The Fetch Hive public API lets you invoke prompts, workflows, agents, and Hive Agents programmatically using an API token. ## Authentication All requests require a Bearer token in the `Authorization` header: ``` Authorization: Bearer <your-api-token> ``` ## Streaming Pass `\"streaming\": true` in the request body to receive a `text/event-stream` response. Each event is a JSON object sent as `data: <json>\\n\\n`. The stream ends with `data: [DONE]\\n\\n`.
5
+
6
+ The version of the OpenAPI document: 0.2.8
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FetchHive::Generated
17
+ class GetPublicSearchServicesCountries200ResponseServicesInnerCountriesInner < ApiModelBase
18
+ attr_accessor :country_name
19
+
20
+ attr_accessor :alpha2
21
+
22
+ attr_accessor :value
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'country_name' => :'country_name',
28
+ :'alpha2' => :'alpha2',
29
+ :'value' => :'value'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'country_name' => :'String',
47
+ :'alpha2' => :'String',
48
+ :'value' => :'String'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FetchHive::Generated::GetPublicSearchServicesCountries200ResponseServicesInnerCountriesInner` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FetchHive::Generated::GetPublicSearchServicesCountries200ResponseServicesInnerCountriesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'country_name')
75
+ self.country_name = attributes[:'country_name']
76
+ else
77
+ self.country_name = nil
78
+ end
79
+
80
+ if attributes.key?(:'alpha2')
81
+ self.alpha2 = attributes[:'alpha2']
82
+ else
83
+ self.alpha2 = nil
84
+ end
85
+
86
+ if attributes.key?(:'value')
87
+ self.value = attributes[:'value']
88
+ else
89
+ self.value = nil
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ if @country_name.nil?
99
+ invalid_properties.push('invalid value for "country_name", country_name cannot be nil.')
100
+ end
101
+
102
+ if @alpha2.nil?
103
+ invalid_properties.push('invalid value for "alpha2", alpha2 cannot be nil.')
104
+ end
105
+
106
+ if @value.nil?
107
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
108
+ end
109
+
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ warn '[DEPRECATED] the `valid?` method is obsolete'
117
+ return false if @country_name.nil?
118
+ return false if @alpha2.nil?
119
+ return false if @value.nil?
120
+ true
121
+ end
122
+
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] country_name Value to be assigned
125
+ def country_name=(country_name)
126
+ if country_name.nil?
127
+ fail ArgumentError, 'country_name cannot be nil'
128
+ end
129
+
130
+ @country_name = country_name
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] alpha2 Value to be assigned
135
+ def alpha2=(alpha2)
136
+ if alpha2.nil?
137
+ fail ArgumentError, 'alpha2 cannot be nil'
138
+ end
139
+
140
+ @alpha2 = alpha2
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] value Value to be assigned
145
+ def value=(value)
146
+ if value.nil?
147
+ fail ArgumentError, 'value cannot be nil'
148
+ end
149
+
150
+ @value = value
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ country_name == o.country_name &&
159
+ alpha2 == o.alpha2 &&
160
+ value == o.value
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [country_name, alpha2, value].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ return nil unless attributes.is_a?(Hash)
180
+ attributes = attributes.transform_keys(&:to_sym)
181
+ transformed_hash = {}
182
+ openapi_types.each_pair do |key, type|
183
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = nil
185
+ elsif type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[attribute_map[key]].is_a?(Array)
189
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
190
+ end
191
+ elsif !attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
193
+ end
194
+ end
195
+ new(transformed_hash)
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ end
215
+
216
+ end
@@ -0,0 +1,175 @@
1
+ =begin
2
+ #Fetch Hive Public API
3
+
4
+ #The Fetch Hive public API lets you invoke prompts, workflows, agents, and Hive Agents programmatically using an API token. ## Authentication All requests require a Bearer token in the `Authorization` header: ``` Authorization: Bearer <your-api-token> ``` ## Streaming Pass `\"streaming\": true` in the request body to receive a `text/event-stream` response. Each event is a JSON object sent as `data: <json>\\n\\n`. The stream ends with `data: [DONE]\\n\\n`.
5
+
6
+ The version of the OpenAPI document: 0.2.8
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FetchHive::Generated
17
+ class GetPublicSearchServicesCountries2404Response < ApiModelBase
18
+ attr_accessor :error
19
+
20
+ attr_accessor :supported_services
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'error' => :'error',
26
+ :'supported_services' => :'supported_services'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'error' => :'String',
44
+ :'supported_services' => :'Array<String>'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FetchHive::Generated::GetPublicSearchServicesCountries2404Response` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FetchHive::Generated::GetPublicSearchServicesCountries2404Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'error')
71
+ self.error = attributes[:'error']
72
+ else
73
+ self.error = nil
74
+ end
75
+
76
+ if attributes.key?(:'supported_services')
77
+ if (value = attributes[:'supported_services']).is_a?(Array)
78
+ self.supported_services = value
79
+ end
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @error.nil?
89
+ invalid_properties.push('invalid value for "error", error cannot be nil.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ return false if @error.nil?
100
+ true
101
+ end
102
+
103
+ # Custom attribute writer method with validation
104
+ # @param [Object] error Value to be assigned
105
+ def error=(error)
106
+ if error.nil?
107
+ fail ArgumentError, 'error cannot be nil'
108
+ end
109
+
110
+ @error = error
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ error == o.error &&
119
+ supported_services == o.supported_services
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [error, supported_services].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ attributes = attributes.transform_keys(&:to_sym)
140
+ transformed_hash = {}
141
+ openapi_types.each_pair do |key, type|
142
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = nil
144
+ elsif type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[attribute_map[key]].is_a?(Array)
148
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
149
+ end
150
+ elsif !attributes[attribute_map[key]].nil?
151
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
152
+ end
153
+ end
154
+ new(transformed_hash)
155
+ end
156
+
157
+ # Returns the object in the form of hash
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_hash
160
+ hash = {}
161
+ self.class.attribute_map.each_pair do |attr, param|
162
+ value = self.send(attr)
163
+ if value.nil?
164
+ is_nullable = self.class.openapi_nullable.include?(attr)
165
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
166
+ end
167
+
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+
173
+ end
174
+
175
+ end