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,156 @@
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 ToolActionApprovalObjectApprovalVotesInner < ApiModelBase
18
+ attr_accessor :user_id
19
+
20
+ attr_accessor :decision
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'user_id' => :'user_id',
26
+ :'decision' => :'decision'
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
+ :'user_id' => :'String',
44
+ :'decision' => :'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::ToolActionApprovalObjectApprovalVotesInner` 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::ToolActionApprovalObjectApprovalVotesInner`. 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?(:'user_id')
71
+ self.user_id = attributes[:'user_id']
72
+ end
73
+
74
+ if attributes.key?(:'decision')
75
+ self.decision = attributes[:'decision']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ user_id == o.user_id &&
100
+ decision == o.decision
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [user_id, decision].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Returns the object in the form of hash
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_hash
141
+ hash = {}
142
+ self.class.attribute_map.each_pair do |attr, param|
143
+ value = self.send(attr)
144
+ if value.nil?
145
+ is_nullable = self.class.openapi_nullable.include?(attr)
146
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
147
+ end
148
+
149
+ hash[param] = _to_hash(value)
150
+ end
151
+ hash
152
+ end
153
+
154
+ end
155
+
156
+ end
@@ -0,0 +1,158 @@
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
+ # (value may be null)
18
+ class ToolActionApprovalObjectArgumentsEditedBy < ApiModelBase
19
+ attr_accessor :id
20
+
21
+ # (value may be null)
22
+ attr_accessor :name
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'id' => :'id',
28
+ :'name' => :'name'
29
+ }
30
+ end
31
+
32
+ # Returns attribute mapping this model knows about
33
+ def self.acceptable_attribute_map
34
+ attribute_map
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ acceptable_attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'id' => :'String',
46
+ :'name' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FetchHive::Generated::ToolActionApprovalObjectArgumentsEditedBy` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FetchHive::Generated::ToolActionApprovalObjectArgumentsEditedBy`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'id')
73
+ self.id = attributes[:'id']
74
+ end
75
+
76
+ if attributes.key?(:'name')
77
+ self.name = attributes[:'name']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ id == o.id &&
102
+ name == o.name
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [id, name].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ transformed_hash = {}
124
+ openapi_types.each_pair do |key, type|
125
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = nil
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[attribute_map[key]].is_a?(Array)
131
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
132
+ end
133
+ elsif !attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
135
+ end
136
+ end
137
+ new(transformed_hash)
138
+ end
139
+
140
+ # Returns the object in the form of hash
141
+ # @return [Hash] Returns the object in the form of hash
142
+ def to_hash
143
+ hash = {}
144
+ self.class.attribute_map.each_pair do |attr, param|
145
+ value = self.send(attr)
146
+ if value.nil?
147
+ is_nullable = self.class.openapi_nullable.include?(attr)
148
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
149
+ end
150
+
151
+ hash[param] = _to_hash(value)
152
+ end
153
+ hash
154
+ end
155
+
156
+ end
157
+
158
+ end
@@ -0,0 +1,190 @@
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 ToolActionApprovalObjectBatchItemsInner < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :summary
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'id' => :'id',
26
+ :'summary' => :'summary'
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
+ :'id' => :'String',
44
+ :'summary' => :'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::ToolActionApprovalObjectBatchItemsInner` 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::ToolActionApprovalObjectBatchItemsInner`. 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?(:'id')
71
+ self.id = attributes[:'id']
72
+ else
73
+ self.id = nil
74
+ end
75
+
76
+ if attributes.key?(:'summary')
77
+ self.summary = attributes[:'summary']
78
+ else
79
+ self.summary = nil
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 @id.nil?
89
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
90
+ end
91
+
92
+ if @summary.nil?
93
+ invalid_properties.push('invalid value for "summary", summary cannot be nil.')
94
+ end
95
+
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ return false if @id.nil?
104
+ return false if @summary.nil?
105
+ true
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] id Value to be assigned
110
+ def id=(id)
111
+ if id.nil?
112
+ fail ArgumentError, 'id cannot be nil'
113
+ end
114
+
115
+ @id = id
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param [Object] summary Value to be assigned
120
+ def summary=(summary)
121
+ if summary.nil?
122
+ fail ArgumentError, 'summary cannot be nil'
123
+ end
124
+
125
+ @summary = summary
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ id == o.id &&
134
+ summary == o.summary
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [id, summary].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ end
189
+
190
+ end
@@ -0,0 +1,157 @@
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
+ # (value may be null)
18
+ class ToolActionApprovalObjectCapabilities < ApiModelBase
19
+ attr_accessor :can_always_allow
20
+
21
+ attr_accessor :can_run_decision
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'can_always_allow' => :'can_always_allow',
27
+ :'can_run_decision' => :'can_run_decision'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'can_always_allow' => :'Boolean',
45
+ :'can_run_decision' => :'Boolean'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FetchHive::Generated::ToolActionApprovalObjectCapabilities` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FetchHive::Generated::ToolActionApprovalObjectCapabilities`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'can_always_allow')
72
+ self.can_always_allow = attributes[:'can_always_allow']
73
+ end
74
+
75
+ if attributes.key?(:'can_run_decision')
76
+ self.can_run_decision = attributes[:'can_run_decision']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ can_always_allow == o.can_always_allow &&
101
+ can_run_decision == o.can_run_decision
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [can_always_allow, can_run_decision].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ transformed_hash = {}
123
+ openapi_types.each_pair do |key, type|
124
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = nil
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[attribute_map[key]].is_a?(Array)
130
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
131
+ end
132
+ elsif !attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
134
+ end
135
+ end
136
+ new(transformed_hash)
137
+ end
138
+
139
+ # Returns the object in the form of hash
140
+ # @return [Hash] Returns the object in the form of hash
141
+ def to_hash
142
+ hash = {}
143
+ self.class.attribute_map.each_pair do |attr, param|
144
+ value = self.send(attr)
145
+ if value.nil?
146
+ is_nullable = self.class.openapi_nullable.include?(attr)
147
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
148
+ end
149
+
150
+ hash[param] = _to_hash(value)
151
+ end
152
+ hash
153
+ end
154
+
155
+ end
156
+
157
+ end