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,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 PostPublicWorkspacesAgentsChats422Response < ApiModelBase
18
+ attr_accessor :error
19
+
20
+ attr_accessor :errors
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'error' => :'error',
26
+ :'errors' => :'errors'
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
+ :'errors' => :'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::PostPublicWorkspacesAgentsChats422Response` 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::PostPublicWorkspacesAgentsChats422Response`. 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?(:'errors')
77
+ if (value = attributes[:'errors']).is_a?(Array)
78
+ self.errors = 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
+ errors == o.errors
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, errors].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
@@ -0,0 +1,164 @@
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 PostPublicWorkspacesAgentsChatsRequest < ApiModelBase
18
+ attr_accessor :chat
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'chat' => :'chat'
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
+ :'chat' => :'PostPublicWorkspacesAgentsChatsRequestChat'
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 `FetchHive::Generated::PostPublicWorkspacesAgentsChatsRequest` 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 `FetchHive::Generated::PostPublicWorkspacesAgentsChatsRequest`. 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?(:'chat')
67
+ self.chat = attributes[:'chat']
68
+ else
69
+ self.chat = nil
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
+ if @chat.nil?
79
+ invalid_properties.push('invalid value for "chat", chat cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if @chat.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] chat Value to be assigned
95
+ def chat=(chat)
96
+ if chat.nil?
97
+ fail ArgumentError, 'chat cannot be nil'
98
+ end
99
+
100
+ @chat = chat
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ chat == o.chat
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [chat].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
146
+ # Returns the object in the form of hash
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ if value.nil?
153
+ is_nullable = self.class.openapi_nullable.include?(attr)
154
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
155
+ end
156
+
157
+ hash[param] = _to_hash(value)
158
+ end
159
+ hash
160
+ end
161
+
162
+ end
163
+
164
+ end
@@ -0,0 +1,164 @@
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 PostPublicWorkspacesAgentsChatsRequestChat < ApiModelBase
18
+ attr_accessor :name
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'name' => :'name'
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
+ :'name' => :'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 `FetchHive::Generated::PostPublicWorkspacesAgentsChatsRequestChat` 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 `FetchHive::Generated::PostPublicWorkspacesAgentsChatsRequestChat`. 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?(:'name')
67
+ self.name = attributes[:'name']
68
+ else
69
+ self.name = nil
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
+ if @name.nil?
79
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if @name.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] name Value to be assigned
95
+ def name=(name)
96
+ if name.nil?
97
+ fail ArgumentError, 'name cannot be nil'
98
+ end
99
+
100
+ @name = name
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ name == o.name
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [name].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
146
+ # Returns the object in the form of hash
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ if value.nil?
153
+ is_nullable = self.class.openapi_nullable.include?(attr)
154
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
155
+ end
156
+
157
+ hash[param] = _to_hash(value)
158
+ end
159
+ hash
160
+ end
161
+
162
+ end
163
+
164
+ end
@@ -0,0 +1,164 @@
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 PostPublicWorkspacesAgentsRequest < ApiModelBase
18
+ attr_accessor :agent
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'agent' => :'agent'
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
+ :'agent' => :'PostPublicWorkspacesAgentsRequestAgent'
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 `FetchHive::Generated::PostPublicWorkspacesAgentsRequest` 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 `FetchHive::Generated::PostPublicWorkspacesAgentsRequest`. 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?(:'agent')
67
+ self.agent = attributes[:'agent']
68
+ else
69
+ self.agent = nil
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
+ if @agent.nil?
79
+ invalid_properties.push('invalid value for "agent", agent cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if @agent.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] agent Value to be assigned
95
+ def agent=(agent)
96
+ if agent.nil?
97
+ fail ArgumentError, 'agent cannot be nil'
98
+ end
99
+
100
+ @agent = agent
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ agent == o.agent
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [agent].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
146
+ # Returns the object in the form of hash
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ if value.nil?
153
+ is_nullable = self.class.openapi_nullable.include?(attr)
154
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
155
+ end
156
+
157
+ hash[param] = _to_hash(value)
158
+ end
159
+ hash
160
+ end
161
+
162
+ end
163
+
164
+ end