fetch_hive 0.3.0 → 0.4.1

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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -2
  3. data/lib/fetch_hive/client.rb +30 -3
  4. data/lib/fetch_hive/generated/api/agent_chat_messages_api.rb +2 -2
  5. data/lib/fetch_hive/generated/api/agent_chats_api.rb +2 -2
  6. data/lib/fetch_hive/generated/api/agents_api.rb +3 -3
  7. data/lib/fetch_hive/generated/api/assets_api.rb +2 -2
  8. data/lib/fetch_hive/generated/api/hive_agents_api.rb +2 -2
  9. data/lib/fetch_hive/generated/api/knowledge_base_items_api.rb +2 -2
  10. data/lib/fetch_hive/generated/api/knowledge_bases_api.rb +2 -2
  11. data/lib/fetch_hive/generated/api/models_api.rb +2 -2
  12. data/lib/fetch_hive/generated/api/prompts_api.rb +2 -2
  13. data/lib/fetch_hive/generated/api/requests_api.rb +2 -2
  14. data/lib/fetch_hive/generated/api/search_services_api.rb +2 -2
  15. data/lib/fetch_hive/generated/api/tool_action_approvals_api.rb +244 -0
  16. data/lib/fetch_hive/generated/api/workflows_api.rb +2 -2
  17. data/lib/fetch_hive/generated/api_client.rb +2 -2
  18. data/lib/fetch_hive/generated/api_error.rb +2 -2
  19. data/lib/fetch_hive/generated/api_model_base.rb +2 -2
  20. data/lib/fetch_hive/generated/configuration.rb +2 -2
  21. data/lib/fetch_hive/generated/models/agent_attachment.rb +2 -2
  22. data/lib/fetch_hive/generated/models/agent_attachment_one_of.rb +2 -2
  23. data/lib/fetch_hive/generated/models/agent_delegation.rb +2 -2
  24. data/lib/fetch_hive/generated/models/agent_invoke_async_config.rb +2 -2
  25. data/lib/fetch_hive/generated/models/agent_message.rb +2 -2
  26. data/lib/fetch_hive/generated/models/asset_object.rb +2 -2
  27. data/lib/fetch_hive/generated/models/asset_object_transcription.rb +2 -2
  28. data/lib/fetch_hive/generated/models/async_config.rb +2 -2
  29. data/lib/fetch_hive/generated/models/delete_public_workspaces_agents200_response.rb +2 -2
  30. data/lib/fetch_hive/generated/models/delete_public_workspaces_agents_chats200_response.rb +2 -2
  31. data/lib/fetch_hive/generated/models/delete_public_workspaces_agents_chats404_response.rb +2 -2
  32. data/lib/fetch_hive/generated/models/delete_public_workspaces_knowledge_bases200_response.rb +2 -2
  33. data/lib/fetch_hive/generated/models/delete_public_workspaces_knowledge_bases_items200_response.rb +2 -2
  34. data/lib/fetch_hive/generated/models/denied_tool_call.rb +223 -0
  35. data/lib/fetch_hive/generated/models/error_response.rb +2 -2
  36. data/lib/fetch_hive/generated/models/generated_artifact.rb +2 -2
  37. data/lib/fetch_hive/generated/models/get_public_models200_response_inner.rb +2 -2
  38. data/lib/fetch_hive/generated/models/get_public_requests200_response.rb +2 -2
  39. data/lib/fetch_hive/generated/models/get_public_requests404_response.rb +2 -2
  40. data/lib/fetch_hive/generated/models/get_public_search_services_countries200_response.rb +2 -2
  41. data/lib/fetch_hive/generated/models/get_public_search_services_countries200_response_services_inner.rb +2 -2
  42. data/lib/fetch_hive/generated/models/get_public_search_services_countries200_response_services_inner_countries_inner.rb +2 -2
  43. data/lib/fetch_hive/generated/models/get_public_search_services_countries2404_response.rb +2 -2
  44. data/lib/fetch_hive/generated/models/get_public_workspaces_agents200_response.rb +2 -2
  45. data/lib/fetch_hive/generated/models/get_public_workspaces_agents2200_response.rb +2 -2
  46. data/lib/fetch_hive/generated/models/get_public_workspaces_agents_chats200_response.rb +2 -2
  47. data/lib/fetch_hive/generated/models/get_public_workspaces_agents_chats_messages200_response.rb +2 -2
  48. data/lib/fetch_hive/generated/models/get_public_workspaces_agents_chats_messages200_response_messages_inner.rb +2 -2
  49. data/lib/fetch_hive/generated/models/get_public_workspaces_agents_chats_messages422_response.rb +2 -2
  50. data/lib/fetch_hive/generated/models/get_public_workspaces_assets200_response.rb +2 -2
  51. data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases200_response.rb +2 -2
  52. data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases2200_response.rb +2 -2
  53. data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases2422_response.rb +2 -2
  54. data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases_items200_response.rb +2 -2
  55. data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases_items200_response_knowledge_base_items_inner.rb +2 -2
  56. data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases_items2200_response.rb +2 -2
  57. data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases_items2422_response.rb +2 -2
  58. data/lib/fetch_hive/generated/models/get_public_workspaces_tool_action_approvals200_response.rb +149 -0
  59. data/lib/fetch_hive/generated/models/get_public_workspaces_tool_action_approvals2200_response.rb +147 -0
  60. data/lib/fetch_hive/generated/models/hive_agent_async_config.rb +2 -2
  61. data/lib/fetch_hive/generated/models/hive_agent_sources.rb +2 -2
  62. data/lib/fetch_hive/generated/models/invoke_agent_request.rb +62 -6
  63. data/lib/fetch_hive/generated/models/invoke_agent_request_decided_tool_approvals_inner.rb +164 -0
  64. data/lib/fetch_hive/generated/models/invoke_agent_response.rb +116 -4
  65. data/lib/fetch_hive/generated/models/invoke_agent_response_auto_approved_tool_calls_inner.rb +190 -0
  66. data/lib/fetch_hive/generated/models/invoke_hive_agent_request.rb +2 -2
  67. data/lib/fetch_hive/generated/models/invoke_hive_agent_response.rb +2 -2
  68. data/lib/fetch_hive/generated/models/invoke_prompt_request.rb +2 -2
  69. data/lib/fetch_hive/generated/models/invoke_prompt_response.rb +2 -2
  70. data/lib/fetch_hive/generated/models/invoke_workflow_async_response.rb +2 -2
  71. data/lib/fetch_hive/generated/models/invoke_workflow_request.rb +50 -6
  72. data/lib/fetch_hive/generated/models/invoke_workflow_response.rb +2 -2
  73. data/lib/fetch_hive/generated/models/knowledge_base_object.rb +2 -2
  74. data/lib/fetch_hive/generated/models/list_thread_agent_delegations200_response.rb +2 -2
  75. data/lib/fetch_hive/generated/models/metadata_value.rb +2 -2
  76. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents200_response.rb +2 -2
  77. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents422_response.rb +173 -0
  78. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_chats200_response.rb +2 -2
  79. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_chats_clear_messages200_response.rb +2 -2
  80. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_chats_request.rb +2 -2
  81. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_chats_request_chat.rb +2 -2
  82. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_request.rb +2 -2
  83. data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_request_agent.rb +28 -6
  84. data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases200_response.rb +2 -2
  85. data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_items200_response.rb +2 -2
  86. data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_items_request.rb +2 -2
  87. data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_items_request_knowledge_base_item.rb +2 -2
  88. data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_request.rb +2 -2
  89. data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_request_knowledge_base.rb +2 -2
  90. data/lib/fetch_hive/generated/models/pending_delegation.rb +2 -2
  91. data/lib/fetch_hive/generated/models/pending_tool_approval.rb +247 -0
  92. data/lib/fetch_hive/generated/models/post_public_workspaces_agents200_response.rb +2 -2
  93. data/lib/fetch_hive/generated/models/post_public_workspaces_agents422_response.rb +2 -2
  94. data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats200_response.rb +2 -2
  95. data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats200_response_chat.rb +2 -2
  96. data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats422_response.rb +2 -2
  97. data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats_request.rb +2 -2
  98. data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats_request_chat.rb +2 -2
  99. data/lib/fetch_hive/generated/models/post_public_workspaces_agents_request.rb +2 -2
  100. data/lib/fetch_hive/generated/models/post_public_workspaces_agents_request_agent.rb +2 -2
  101. data/lib/fetch_hive/generated/models/post_public_workspaces_assets200_response.rb +2 -2
  102. data/lib/fetch_hive/generated/models/post_public_workspaces_assets422_response.rb +2 -2
  103. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases200_response.rb +2 -2
  104. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items200_response.rb +2 -2
  105. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items422_response.rb +2 -2
  106. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items_regenerate200_response.rb +2 -2
  107. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items_request.rb +2 -2
  108. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items_request_knowledge_base_item.rb +2 -2
  109. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_request.rb +2 -2
  110. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_request_knowledge_base.rb +2 -2
  111. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_search200_response.rb +2 -2
  112. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_search422_response.rb +2 -2
  113. data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_search_request.rb +2 -2
  114. data/lib/fetch_hive/generated/models/post_public_workspaces_tool_action_approvals_decide_request.rb +188 -0
  115. data/lib/fetch_hive/generated/models/sse_chunk.rb +126 -4
  116. data/lib/fetch_hive/generated/models/sse_chunk_auto_approved_tool_calls_inner.rb +156 -0
  117. data/lib/fetch_hive/generated/models/token_usage.rb +2 -2
  118. data/lib/fetch_hive/generated/models/tool_action_approval_object.rb +701 -0
  119. data/lib/fetch_hive/generated/models/tool_action_approval_object_approval_votes_inner.rb +156 -0
  120. data/lib/fetch_hive/generated/models/tool_action_approval_object_arguments_edited_by.rb +158 -0
  121. data/lib/fetch_hive/generated/models/tool_action_approval_object_batch_items_inner.rb +190 -0
  122. data/lib/fetch_hive/generated/models/tool_action_approval_object_capabilities.rb +157 -0
  123. data/lib/fetch_hive/generated/models/tool_action_approval_object_decided_by_user.rb +188 -0
  124. data/lib/fetch_hive/generated/models/tool_action_approval_object_requested_by.rb +179 -0
  125. data/lib/fetch_hive/generated/models/tool_invocation.rb +2 -2
  126. data/lib/fetch_hive/generated/version.rb +2 -2
  127. metadata +19 -2
@@ -0,0 +1,701 @@
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> ``` ## Breaking Error responses use `error_code`. The previous field name `code` is not returned. ## 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.4.1
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 ToolActionApprovalObject < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :status
21
+
22
+ # (value may be null)
23
+ attr_accessor :decision
24
+
25
+ attr_accessor :summary
26
+
27
+ # (value may be null)
28
+ attr_accessor :provider_type
29
+
30
+ # (value may be null)
31
+ attr_accessor :action_slug
32
+
33
+ # (value may be null)
34
+ attr_accessor :action_label
35
+
36
+ # (value may be null)
37
+ attr_accessor :confirmation
38
+
39
+ # (value may be null)
40
+ attr_accessor :approvals_required
41
+
42
+ # (value may be null)
43
+ attr_accessor :approval_votes
44
+
45
+ # (value may be null)
46
+ attr_accessor :provider_login
47
+
48
+ # (value may be null)
49
+ attr_accessor :gateway_name
50
+
51
+ # (value may be null)
52
+ attr_accessor :token_name
53
+
54
+ # (value may be null)
55
+ attr_accessor :arguments
56
+
57
+ # (value may be null)
58
+ attr_accessor :result
59
+
60
+ # (value may be null)
61
+ attr_accessor :error
62
+
63
+ # (value may be null)
64
+ attr_accessor :risk_level
65
+
66
+ # (value may be null)
67
+ attr_accessor :requested_by_kind
68
+
69
+ attr_accessor :requested_by
70
+
71
+ # (value may be null)
72
+ attr_accessor :prompt_workflow_run_id
73
+
74
+ # (value may be null)
75
+ attr_accessor :agent_run_id
76
+
77
+ # (value may be null)
78
+ attr_accessor :ephemeral_execution_id
79
+
80
+ # (value may be null)
81
+ attr_accessor :copilot_session_id
82
+
83
+ # (value may be null)
84
+ attr_accessor :integration_connection_count
85
+
86
+ # (value may be null)
87
+ attr_accessor :created_at
88
+
89
+ # (value may be null)
90
+ attr_accessor :expires_at
91
+
92
+ # (value may be null)
93
+ attr_accessor :decided_at
94
+
95
+ # (value may be null)
96
+ attr_accessor :decided_by
97
+
98
+ # (value may be null)
99
+ attr_accessor :decided_via
100
+
101
+ # (value may be null)
102
+ attr_accessor :decided_by_api_key_name
103
+
104
+ attr_accessor :decided_by_user
105
+
106
+ # (value may be null)
107
+ attr_accessor :auto_allowed_by
108
+
109
+ # (value may be null)
110
+ attr_accessor :auto_allowed_source_id
111
+
112
+ # (value may be null)
113
+ attr_accessor :auto_allowed_source_name
114
+
115
+ # (value may be null)
116
+ attr_accessor :workspace_id
117
+
118
+ # (value may be null)
119
+ attr_accessor :original_arguments
120
+
121
+ # (value may be null)
122
+ attr_accessor :arguments_edited_at
123
+
124
+ attr_accessor :arguments_edited_by
125
+
126
+ # (value may be null)
127
+ attr_accessor :changed_fields
128
+
129
+ # (value may be null)
130
+ attr_accessor :resolved_policy_id
131
+
132
+ attr_accessor :resolved_policy_user
133
+
134
+ # (value may be null)
135
+ attr_accessor :locked_rule_effect
136
+
137
+ # (value may be null)
138
+ attr_accessor :audience_role
139
+
140
+ # (value may be null)
141
+ attr_accessor :integration_authorization_id
142
+
143
+ # (value may be null)
144
+ attr_accessor :batch_key
145
+
146
+ # (value may be null)
147
+ attr_accessor :batch_pending_count
148
+
149
+ # (value may be null)
150
+ attr_accessor :batch_items
151
+
152
+ attr_accessor :capabilities
153
+
154
+ class EnumAttributeValidator
155
+ attr_reader :datatype
156
+ attr_reader :allowable_values
157
+
158
+ def initialize(datatype, allowable_values)
159
+ @allowable_values = allowable_values.map do |value|
160
+ case datatype.to_s
161
+ when /Integer/i
162
+ value.to_i
163
+ when /Float/i
164
+ value.to_f
165
+ else
166
+ value
167
+ end
168
+ end
169
+ end
170
+
171
+ def valid?(value)
172
+ !value || allowable_values.include?(value)
173
+ end
174
+ end
175
+
176
+ # Attribute mapping from ruby-style variable name to JSON key.
177
+ def self.attribute_map
178
+ {
179
+ :'id' => :'id',
180
+ :'status' => :'status',
181
+ :'decision' => :'decision',
182
+ :'summary' => :'summary',
183
+ :'provider_type' => :'provider_type',
184
+ :'action_slug' => :'action_slug',
185
+ :'action_label' => :'action_label',
186
+ :'confirmation' => :'confirmation',
187
+ :'approvals_required' => :'approvals_required',
188
+ :'approval_votes' => :'approval_votes',
189
+ :'provider_login' => :'provider_login',
190
+ :'gateway_name' => :'gateway_name',
191
+ :'token_name' => :'token_name',
192
+ :'arguments' => :'arguments',
193
+ :'result' => :'result',
194
+ :'error' => :'error',
195
+ :'risk_level' => :'risk_level',
196
+ :'requested_by_kind' => :'requested_by_kind',
197
+ :'requested_by' => :'requested_by',
198
+ :'prompt_workflow_run_id' => :'prompt_workflow_run_id',
199
+ :'agent_run_id' => :'agent_run_id',
200
+ :'ephemeral_execution_id' => :'ephemeral_execution_id',
201
+ :'copilot_session_id' => :'copilot_session_id',
202
+ :'integration_connection_count' => :'integration_connection_count',
203
+ :'created_at' => :'created_at',
204
+ :'expires_at' => :'expires_at',
205
+ :'decided_at' => :'decided_at',
206
+ :'decided_by' => :'decided_by',
207
+ :'decided_via' => :'decided_via',
208
+ :'decided_by_api_key_name' => :'decided_by_api_key_name',
209
+ :'decided_by_user' => :'decided_by_user',
210
+ :'auto_allowed_by' => :'auto_allowed_by',
211
+ :'auto_allowed_source_id' => :'auto_allowed_source_id',
212
+ :'auto_allowed_source_name' => :'auto_allowed_source_name',
213
+ :'workspace_id' => :'workspace_id',
214
+ :'original_arguments' => :'original_arguments',
215
+ :'arguments_edited_at' => :'arguments_edited_at',
216
+ :'arguments_edited_by' => :'arguments_edited_by',
217
+ :'changed_fields' => :'changed_fields',
218
+ :'resolved_policy_id' => :'resolved_policy_id',
219
+ :'resolved_policy_user' => :'resolved_policy_user',
220
+ :'locked_rule_effect' => :'locked_rule_effect',
221
+ :'audience_role' => :'audience_role',
222
+ :'integration_authorization_id' => :'integration_authorization_id',
223
+ :'batch_key' => :'batch_key',
224
+ :'batch_pending_count' => :'batch_pending_count',
225
+ :'batch_items' => :'batch_items',
226
+ :'capabilities' => :'capabilities'
227
+ }
228
+ end
229
+
230
+ # Returns attribute mapping this model knows about
231
+ def self.acceptable_attribute_map
232
+ attribute_map
233
+ end
234
+
235
+ # Returns all the JSON keys this model knows about
236
+ def self.acceptable_attributes
237
+ acceptable_attribute_map.values
238
+ end
239
+
240
+ # Attribute type mapping.
241
+ def self.openapi_types
242
+ {
243
+ :'id' => :'String',
244
+ :'status' => :'String',
245
+ :'decision' => :'String',
246
+ :'summary' => :'String',
247
+ :'provider_type' => :'String',
248
+ :'action_slug' => :'String',
249
+ :'action_label' => :'String',
250
+ :'confirmation' => :'String',
251
+ :'approvals_required' => :'Integer',
252
+ :'approval_votes' => :'Array<ToolActionApprovalObjectApprovalVotesInner>',
253
+ :'provider_login' => :'String',
254
+ :'gateway_name' => :'String',
255
+ :'token_name' => :'String',
256
+ :'arguments' => :'Object',
257
+ :'result' => :'Object',
258
+ :'error' => :'String',
259
+ :'risk_level' => :'String',
260
+ :'requested_by_kind' => :'String',
261
+ :'requested_by' => :'ToolActionApprovalObjectRequestedBy',
262
+ :'prompt_workflow_run_id' => :'String',
263
+ :'agent_run_id' => :'String',
264
+ :'ephemeral_execution_id' => :'String',
265
+ :'copilot_session_id' => :'String',
266
+ :'integration_connection_count' => :'Integer',
267
+ :'created_at' => :'Time',
268
+ :'expires_at' => :'Time',
269
+ :'decided_at' => :'Time',
270
+ :'decided_by' => :'String',
271
+ :'decided_via' => :'String',
272
+ :'decided_by_api_key_name' => :'String',
273
+ :'decided_by_user' => :'ToolActionApprovalObjectDecidedByUser',
274
+ :'auto_allowed_by' => :'String',
275
+ :'auto_allowed_source_id' => :'String',
276
+ :'auto_allowed_source_name' => :'String',
277
+ :'workspace_id' => :'String',
278
+ :'original_arguments' => :'Object',
279
+ :'arguments_edited_at' => :'Time',
280
+ :'arguments_edited_by' => :'ToolActionApprovalObjectArgumentsEditedBy',
281
+ :'changed_fields' => :'Array<String>',
282
+ :'resolved_policy_id' => :'String',
283
+ :'resolved_policy_user' => :'ToolActionApprovalObjectArgumentsEditedBy',
284
+ :'locked_rule_effect' => :'String',
285
+ :'audience_role' => :'String',
286
+ :'integration_authorization_id' => :'String',
287
+ :'batch_key' => :'String',
288
+ :'batch_pending_count' => :'Integer',
289
+ :'batch_items' => :'Array<ToolActionApprovalObjectBatchItemsInner>',
290
+ :'capabilities' => :'ToolActionApprovalObjectCapabilities'
291
+ }
292
+ end
293
+
294
+ # List of attributes with nullable: true
295
+ def self.openapi_nullable
296
+ Set.new([
297
+ ])
298
+ end
299
+
300
+ # Initializes the object
301
+ # @param [Hash] attributes Model attributes in the form of hash
302
+ def initialize(attributes = {})
303
+ if (!attributes.is_a?(Hash))
304
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FetchHive::Generated::ToolActionApprovalObject` initialize method"
305
+ end
306
+
307
+ # check to see if the attribute exists and convert string to symbol for hash key
308
+ acceptable_attribute_map = self.class.acceptable_attribute_map
309
+ attributes = attributes.each_with_object({}) { |(k, v), h|
310
+ if (!acceptable_attribute_map.key?(k.to_sym))
311
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FetchHive::Generated::ToolActionApprovalObject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
312
+ end
313
+ h[k.to_sym] = v
314
+ }
315
+
316
+ if attributes.key?(:'id')
317
+ self.id = attributes[:'id']
318
+ else
319
+ self.id = nil
320
+ end
321
+
322
+ if attributes.key?(:'status')
323
+ self.status = attributes[:'status']
324
+ else
325
+ self.status = nil
326
+ end
327
+
328
+ if attributes.key?(:'decision')
329
+ self.decision = attributes[:'decision']
330
+ end
331
+
332
+ if attributes.key?(:'summary')
333
+ self.summary = attributes[:'summary']
334
+ else
335
+ self.summary = nil
336
+ end
337
+
338
+ if attributes.key?(:'provider_type')
339
+ self.provider_type = attributes[:'provider_type']
340
+ end
341
+
342
+ if attributes.key?(:'action_slug')
343
+ self.action_slug = attributes[:'action_slug']
344
+ end
345
+
346
+ if attributes.key?(:'action_label')
347
+ self.action_label = attributes[:'action_label']
348
+ end
349
+
350
+ if attributes.key?(:'confirmation')
351
+ self.confirmation = attributes[:'confirmation']
352
+ end
353
+
354
+ if attributes.key?(:'approvals_required')
355
+ self.approvals_required = attributes[:'approvals_required']
356
+ end
357
+
358
+ if attributes.key?(:'approval_votes')
359
+ if (value = attributes[:'approval_votes']).is_a?(Array)
360
+ self.approval_votes = value
361
+ end
362
+ end
363
+
364
+ if attributes.key?(:'provider_login')
365
+ self.provider_login = attributes[:'provider_login']
366
+ end
367
+
368
+ if attributes.key?(:'gateway_name')
369
+ self.gateway_name = attributes[:'gateway_name']
370
+ end
371
+
372
+ if attributes.key?(:'token_name')
373
+ self.token_name = attributes[:'token_name']
374
+ end
375
+
376
+ if attributes.key?(:'arguments')
377
+ self.arguments = attributes[:'arguments']
378
+ end
379
+
380
+ if attributes.key?(:'result')
381
+ self.result = attributes[:'result']
382
+ end
383
+
384
+ if attributes.key?(:'error')
385
+ self.error = attributes[:'error']
386
+ end
387
+
388
+ if attributes.key?(:'risk_level')
389
+ self.risk_level = attributes[:'risk_level']
390
+ end
391
+
392
+ if attributes.key?(:'requested_by_kind')
393
+ self.requested_by_kind = attributes[:'requested_by_kind']
394
+ end
395
+
396
+ if attributes.key?(:'requested_by')
397
+ self.requested_by = attributes[:'requested_by']
398
+ end
399
+
400
+ if attributes.key?(:'prompt_workflow_run_id')
401
+ self.prompt_workflow_run_id = attributes[:'prompt_workflow_run_id']
402
+ end
403
+
404
+ if attributes.key?(:'agent_run_id')
405
+ self.agent_run_id = attributes[:'agent_run_id']
406
+ end
407
+
408
+ if attributes.key?(:'ephemeral_execution_id')
409
+ self.ephemeral_execution_id = attributes[:'ephemeral_execution_id']
410
+ end
411
+
412
+ if attributes.key?(:'copilot_session_id')
413
+ self.copilot_session_id = attributes[:'copilot_session_id']
414
+ end
415
+
416
+ if attributes.key?(:'integration_connection_count')
417
+ self.integration_connection_count = attributes[:'integration_connection_count']
418
+ end
419
+
420
+ if attributes.key?(:'created_at')
421
+ self.created_at = attributes[:'created_at']
422
+ end
423
+
424
+ if attributes.key?(:'expires_at')
425
+ self.expires_at = attributes[:'expires_at']
426
+ end
427
+
428
+ if attributes.key?(:'decided_at')
429
+ self.decided_at = attributes[:'decided_at']
430
+ end
431
+
432
+ if attributes.key?(:'decided_by')
433
+ self.decided_by = attributes[:'decided_by']
434
+ end
435
+
436
+ if attributes.key?(:'decided_via')
437
+ self.decided_via = attributes[:'decided_via']
438
+ end
439
+
440
+ if attributes.key?(:'decided_by_api_key_name')
441
+ self.decided_by_api_key_name = attributes[:'decided_by_api_key_name']
442
+ end
443
+
444
+ if attributes.key?(:'decided_by_user')
445
+ self.decided_by_user = attributes[:'decided_by_user']
446
+ end
447
+
448
+ if attributes.key?(:'auto_allowed_by')
449
+ self.auto_allowed_by = attributes[:'auto_allowed_by']
450
+ end
451
+
452
+ if attributes.key?(:'auto_allowed_source_id')
453
+ self.auto_allowed_source_id = attributes[:'auto_allowed_source_id']
454
+ end
455
+
456
+ if attributes.key?(:'auto_allowed_source_name')
457
+ self.auto_allowed_source_name = attributes[:'auto_allowed_source_name']
458
+ end
459
+
460
+ if attributes.key?(:'workspace_id')
461
+ self.workspace_id = attributes[:'workspace_id']
462
+ end
463
+
464
+ if attributes.key?(:'original_arguments')
465
+ self.original_arguments = attributes[:'original_arguments']
466
+ end
467
+
468
+ if attributes.key?(:'arguments_edited_at')
469
+ self.arguments_edited_at = attributes[:'arguments_edited_at']
470
+ end
471
+
472
+ if attributes.key?(:'arguments_edited_by')
473
+ self.arguments_edited_by = attributes[:'arguments_edited_by']
474
+ end
475
+
476
+ if attributes.key?(:'changed_fields')
477
+ if (value = attributes[:'changed_fields']).is_a?(Array)
478
+ self.changed_fields = value
479
+ end
480
+ end
481
+
482
+ if attributes.key?(:'resolved_policy_id')
483
+ self.resolved_policy_id = attributes[:'resolved_policy_id']
484
+ end
485
+
486
+ if attributes.key?(:'resolved_policy_user')
487
+ self.resolved_policy_user = attributes[:'resolved_policy_user']
488
+ end
489
+
490
+ if attributes.key?(:'locked_rule_effect')
491
+ self.locked_rule_effect = attributes[:'locked_rule_effect']
492
+ end
493
+
494
+ if attributes.key?(:'audience_role')
495
+ self.audience_role = attributes[:'audience_role']
496
+ end
497
+
498
+ if attributes.key?(:'integration_authorization_id')
499
+ self.integration_authorization_id = attributes[:'integration_authorization_id']
500
+ end
501
+
502
+ if attributes.key?(:'batch_key')
503
+ self.batch_key = attributes[:'batch_key']
504
+ end
505
+
506
+ if attributes.key?(:'batch_pending_count')
507
+ self.batch_pending_count = attributes[:'batch_pending_count']
508
+ end
509
+
510
+ if attributes.key?(:'batch_items')
511
+ if (value = attributes[:'batch_items']).is_a?(Array)
512
+ self.batch_items = value
513
+ end
514
+ end
515
+
516
+ if attributes.key?(:'capabilities')
517
+ self.capabilities = attributes[:'capabilities']
518
+ end
519
+ end
520
+
521
+ # Show invalid properties with the reasons. Usually used together with valid?
522
+ # @return Array for valid properties with the reasons
523
+ def list_invalid_properties
524
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
525
+ invalid_properties = Array.new
526
+ if @id.nil?
527
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
528
+ end
529
+
530
+ if @status.nil?
531
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
532
+ end
533
+
534
+ if @summary.nil?
535
+ invalid_properties.push('invalid value for "summary", summary cannot be nil.')
536
+ end
537
+
538
+ invalid_properties
539
+ end
540
+
541
+ # Check to see if the all the properties in the model are valid
542
+ # @return true if the model is valid
543
+ def valid?
544
+ warn '[DEPRECATED] the `valid?` method is obsolete'
545
+ return false if @id.nil?
546
+ return false if @status.nil?
547
+ return false if @summary.nil?
548
+ audience_role_validator = EnumAttributeValidator.new('String', ["admin", "member", "none"])
549
+ return false unless audience_role_validator.valid?(@audience_role)
550
+ true
551
+ end
552
+
553
+ # Custom attribute writer method with validation
554
+ # @param [Object] id Value to be assigned
555
+ def id=(id)
556
+ if id.nil?
557
+ fail ArgumentError, 'id cannot be nil'
558
+ end
559
+
560
+ @id = id
561
+ end
562
+
563
+ # Custom attribute writer method with validation
564
+ # @param [Object] status Value to be assigned
565
+ def status=(status)
566
+ if status.nil?
567
+ fail ArgumentError, 'status cannot be nil'
568
+ end
569
+
570
+ @status = status
571
+ end
572
+
573
+ # Custom attribute writer method with validation
574
+ # @param [Object] summary Value to be assigned
575
+ def summary=(summary)
576
+ if summary.nil?
577
+ fail ArgumentError, 'summary cannot be nil'
578
+ end
579
+
580
+ @summary = summary
581
+ end
582
+
583
+ # Custom attribute writer method checking allowed values (enum).
584
+ # @param [Object] audience_role Object to be assigned
585
+ def audience_role=(audience_role)
586
+ validator = EnumAttributeValidator.new('String', ["admin", "member", "none"])
587
+ unless validator.valid?(audience_role)
588
+ fail ArgumentError, "invalid value for \"audience_role\", must be one of #{validator.allowable_values}."
589
+ end
590
+ @audience_role = audience_role
591
+ end
592
+
593
+ # Checks equality by comparing each attribute.
594
+ # @param [Object] Object to be compared
595
+ def ==(o)
596
+ return true if self.equal?(o)
597
+ self.class == o.class &&
598
+ id == o.id &&
599
+ status == o.status &&
600
+ decision == o.decision &&
601
+ summary == o.summary &&
602
+ provider_type == o.provider_type &&
603
+ action_slug == o.action_slug &&
604
+ action_label == o.action_label &&
605
+ confirmation == o.confirmation &&
606
+ approvals_required == o.approvals_required &&
607
+ approval_votes == o.approval_votes &&
608
+ provider_login == o.provider_login &&
609
+ gateway_name == o.gateway_name &&
610
+ token_name == o.token_name &&
611
+ arguments == o.arguments &&
612
+ result == o.result &&
613
+ error == o.error &&
614
+ risk_level == o.risk_level &&
615
+ requested_by_kind == o.requested_by_kind &&
616
+ requested_by == o.requested_by &&
617
+ prompt_workflow_run_id == o.prompt_workflow_run_id &&
618
+ agent_run_id == o.agent_run_id &&
619
+ ephemeral_execution_id == o.ephemeral_execution_id &&
620
+ copilot_session_id == o.copilot_session_id &&
621
+ integration_connection_count == o.integration_connection_count &&
622
+ created_at == o.created_at &&
623
+ expires_at == o.expires_at &&
624
+ decided_at == o.decided_at &&
625
+ decided_by == o.decided_by &&
626
+ decided_via == o.decided_via &&
627
+ decided_by_api_key_name == o.decided_by_api_key_name &&
628
+ decided_by_user == o.decided_by_user &&
629
+ auto_allowed_by == o.auto_allowed_by &&
630
+ auto_allowed_source_id == o.auto_allowed_source_id &&
631
+ auto_allowed_source_name == o.auto_allowed_source_name &&
632
+ workspace_id == o.workspace_id &&
633
+ original_arguments == o.original_arguments &&
634
+ arguments_edited_at == o.arguments_edited_at &&
635
+ arguments_edited_by == o.arguments_edited_by &&
636
+ changed_fields == o.changed_fields &&
637
+ resolved_policy_id == o.resolved_policy_id &&
638
+ resolved_policy_user == o.resolved_policy_user &&
639
+ locked_rule_effect == o.locked_rule_effect &&
640
+ audience_role == o.audience_role &&
641
+ integration_authorization_id == o.integration_authorization_id &&
642
+ batch_key == o.batch_key &&
643
+ batch_pending_count == o.batch_pending_count &&
644
+ batch_items == o.batch_items &&
645
+ capabilities == o.capabilities
646
+ end
647
+
648
+ # @see the `==` method
649
+ # @param [Object] Object to be compared
650
+ def eql?(o)
651
+ self == o
652
+ end
653
+
654
+ # Calculates hash code according to all attributes.
655
+ # @return [Integer] Hash code
656
+ def hash
657
+ [id, status, decision, summary, provider_type, action_slug, action_label, confirmation, approvals_required, approval_votes, provider_login, gateway_name, token_name, arguments, result, error, risk_level, requested_by_kind, requested_by, prompt_workflow_run_id, agent_run_id, ephemeral_execution_id, copilot_session_id, integration_connection_count, created_at, expires_at, decided_at, decided_by, decided_via, decided_by_api_key_name, decided_by_user, auto_allowed_by, auto_allowed_source_id, auto_allowed_source_name, workspace_id, original_arguments, arguments_edited_at, arguments_edited_by, changed_fields, resolved_policy_id, resolved_policy_user, locked_rule_effect, audience_role, integration_authorization_id, batch_key, batch_pending_count, batch_items, capabilities].hash
658
+ end
659
+
660
+ # Builds the object from hash
661
+ # @param [Hash] attributes Model attributes in the form of hash
662
+ # @return [Object] Returns the model itself
663
+ def self.build_from_hash(attributes)
664
+ return nil unless attributes.is_a?(Hash)
665
+ attributes = attributes.transform_keys(&:to_sym)
666
+ transformed_hash = {}
667
+ openapi_types.each_pair do |key, type|
668
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
669
+ transformed_hash["#{key}"] = nil
670
+ elsif type =~ /\AArray<(.*)>/i
671
+ # check to ensure the input is an array given that the attribute
672
+ # is documented as an array but the input is not
673
+ if attributes[attribute_map[key]].is_a?(Array)
674
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
675
+ end
676
+ elsif !attributes[attribute_map[key]].nil?
677
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
678
+ end
679
+ end
680
+ new(transformed_hash)
681
+ end
682
+
683
+ # Returns the object in the form of hash
684
+ # @return [Hash] Returns the object in the form of hash
685
+ def to_hash
686
+ hash = {}
687
+ self.class.attribute_map.each_pair do |attr, param|
688
+ value = self.send(attr)
689
+ if value.nil?
690
+ is_nullable = self.class.openapi_nullable.include?(attr)
691
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
692
+ end
693
+
694
+ hash[param] = _to_hash(value)
695
+ end
696
+ hash
697
+ end
698
+
699
+ end
700
+
701
+ end