vellum_ai 0.14.89 → 1.0.3

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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/requests.rb +2 -2
  3. data/lib/types_export.rb +5 -0
  4. data/lib/vellum_ai/ad_hoc/client.rb +4 -0
  5. data/lib/vellum_ai/container_images/client.rb +16 -0
  6. data/lib/vellum_ai/deployments/client.rb +32 -0
  7. data/lib/vellum_ai/document_indexes/client.rb +32 -0
  8. data/lib/vellum_ai/documents/client.rb +20 -0
  9. data/lib/vellum_ai/folder_entities/client.rb +8 -0
  10. data/lib/vellum_ai/metric_definitions/client.rb +8 -0
  11. data/lib/vellum_ai/ml_models/client.rb +4 -0
  12. data/lib/vellum_ai/organizations/client.rb +4 -0
  13. data/lib/vellum_ai/prompts/client.rb +8 -0
  14. data/lib/vellum_ai/release_reviews/client.rb +4 -0
  15. data/lib/vellum_ai/sandboxes/client.rb +12 -0
  16. data/lib/vellum_ai/test_suite_runs/client.rb +12 -0
  17. data/lib/vellum_ai/test_suites/client.rb +12 -0
  18. data/lib/vellum_ai/types/node_output_compiled_thinking_value.rb +85 -0
  19. data/lib/vellum_ai/types/node_output_compiled_value.rb +16 -0
  20. data/lib/vellum_ai/types/organization_limit_config.rb +94 -0
  21. data/lib/vellum_ai/types/organization_read.rb +15 -2
  22. data/lib/vellum_ai/types/quota.rb +70 -0
  23. data/lib/vellum_ai/types/vembda_service_tier_enum.rb +12 -0
  24. data/lib/vellum_ai/types/workflow_execution_actual.rb +3 -3
  25. data/lib/vellum_ai/types/workflow_execution_detail.rb +156 -0
  26. data/lib/vellum_ai/workflow_deployments/client.rb +32 -0
  27. data/lib/vellum_ai/workflow_executions/client.rb +100 -0
  28. data/lib/vellum_ai/workflow_sandboxes/client.rb +8 -0
  29. data/lib/vellum_ai/workflows/client.rb +8 -0
  30. data/lib/vellum_ai/workspace_secrets/client.rb +8 -0
  31. data/lib/vellum_ai/workspaces/client.rb +4 -0
  32. data/lib/vellum_ai.rb +39 -0
  33. metadata +8 -2
@@ -41,6 +41,8 @@ module Vellum
41
41
  end
42
42
  unless request_options&.api_version.nil?
43
43
  req.headers["X-API-Version"] = request_options.api_version
44
+ else
45
+ req.headers["X-API-Version"] = "2025-07-30"
44
46
  end
45
47
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}), "Accept": "application/json" }.compact
46
48
  req.params = { **(request_options&.additional_query_parameters || {}), "prompt_variant_id": prompt_variant_id }.compact
@@ -94,6 +96,8 @@ end
94
96
  end
95
97
  unless request_options&.api_version.nil?
96
98
  req.headers["X-API-Version"] = request_options.api_version
99
+ else
100
+ req.headers["X-API-Version"] = "2025-07-30"
97
101
  end
98
102
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
99
103
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -140,6 +144,8 @@ end
140
144
  end
141
145
  unless request_options&.api_version.nil?
142
146
  req.headers["X-API-Version"] = request_options.api_version
147
+ else
148
+ req.headers["X-API-Version"] = "2025-07-30"
143
149
  end
144
150
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}), "Accept": "application/json" }.compact
145
151
  req.params = { **(request_options&.additional_query_parameters || {}), "prompt_variant_id": prompt_variant_id }.compact
@@ -195,6 +201,8 @@ end
195
201
  end
196
202
  unless request_options&.api_version.nil?
197
203
  req.headers["X-API-Version"] = request_options.api_version
204
+ else
205
+ req.headers["X-API-Version"] = "2025-07-30"
198
206
  end
199
207
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
200
208
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -41,6 +41,8 @@ module Vellum
41
41
  end
42
42
  unless request_options&.api_version.nil?
43
43
  req.headers["X-API-Version"] = request_options.api_version
44
+ else
45
+ req.headers["X-API-Version"] = "2025-07-30"
44
46
  end
45
47
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
46
48
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -91,6 +93,8 @@ end
91
93
  end
92
94
  unless request_options&.api_version.nil?
93
95
  req.headers["X-API-Version"] = request_options.api_version
96
+ else
97
+ req.headers["X-API-Version"] = "2025-07-30"
94
98
  end
95
99
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
96
100
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -52,6 +52,8 @@ module Vellum
52
52
  end
53
53
  unless request_options&.api_version.nil?
54
54
  req.headers["X-API-Version"] = request_options.api_version
55
+ else
56
+ req.headers["X-API-Version"] = "2025-07-30"
55
57
  end
56
58
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
57
59
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -95,6 +97,8 @@ end
95
97
  end
96
98
  unless request_options&.api_version.nil?
97
99
  req.headers["X-API-Version"] = request_options.api_version
100
+ else
101
+ req.headers["X-API-Version"] = "2025-07-30"
98
102
  end
99
103
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
100
104
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -129,6 +133,8 @@ end
129
133
  end
130
134
  unless request_options&.api_version.nil?
131
135
  req.headers["X-API-Version"] = request_options.api_version
136
+ else
137
+ req.headers["X-API-Version"] = "2025-07-30"
132
138
  end
133
139
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
134
140
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -185,6 +191,8 @@ end
185
191
  end
186
192
  unless request_options&.api_version.nil?
187
193
  req.headers["X-API-Version"] = request_options.api_version
194
+ else
195
+ req.headers["X-API-Version"] = "2025-07-30"
188
196
  end
189
197
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
190
198
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -230,6 +238,8 @@ end
230
238
  end
231
239
  unless request_options&.api_version.nil?
232
240
  req.headers["X-API-Version"] = request_options.api_version
241
+ else
242
+ req.headers["X-API-Version"] = "2025-07-30"
233
243
  end
234
244
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
235
245
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -266,6 +276,8 @@ end
266
276
  end
267
277
  unless request_options&.api_version.nil?
268
278
  req.headers["X-API-Version"] = request_options.api_version
279
+ else
280
+ req.headers["X-API-Version"] = "2025-07-30"
269
281
  end
270
282
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
271
283
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -43,6 +43,8 @@ module Vellum
43
43
  end
44
44
  unless request_options&.api_version.nil?
45
45
  req.headers["X-API-Version"] = request_options.api_version
46
+ else
47
+ req.headers["X-API-Version"] = "2025-07-30"
46
48
  end
47
49
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
48
50
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -75,6 +77,8 @@ end
75
77
  end
76
78
  unless request_options&.api_version.nil?
77
79
  req.headers["X-API-Version"] = request_options.api_version
80
+ else
81
+ req.headers["X-API-Version"] = "2025-07-30"
78
82
  end
79
83
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
80
84
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -116,6 +120,8 @@ end
116
120
  end
117
121
  unless request_options&.api_version.nil?
118
122
  req.headers["X-API-Version"] = request_options.api_version
123
+ else
124
+ req.headers["X-API-Version"] = "2025-07-30"
119
125
  end
120
126
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
121
127
  req.params = { **(request_options&.additional_query_parameters || {}), "expand": expand, "limit": limit, "offset": offset }.compact
@@ -162,6 +168,8 @@ end
162
168
  end
163
169
  unless request_options&.api_version.nil?
164
170
  req.headers["X-API-Version"] = request_options.api_version
171
+ else
172
+ req.headers["X-API-Version"] = "2025-07-30"
165
173
  end
166
174
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
167
175
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -196,6 +204,8 @@ end
196
204
  end
197
205
  unless request_options&.api_version.nil?
198
206
  req.headers["X-API-Version"] = request_options.api_version
207
+ else
208
+ req.headers["X-API-Version"] = "2025-07-30"
199
209
  end
200
210
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
201
211
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -239,6 +249,8 @@ end
239
249
  end
240
250
  unless request_options&.api_version.nil?
241
251
  req.headers["X-API-Version"] = request_options.api_version
252
+ else
253
+ req.headers["X-API-Version"] = "2025-07-30"
242
254
  end
243
255
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
244
256
  req.params = { **(request_options&.additional_query_parameters || {}), "expand": expand, "limit": limit, "offset": offset }.compact
@@ -43,6 +43,8 @@ module Vellum
43
43
  end
44
44
  unless request_options&.api_version.nil?
45
45
  req.headers["X-API-Version"] = request_options.api_version
46
+ else
47
+ req.headers["X-API-Version"] = "2025-07-30"
46
48
  end
47
49
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
48
50
  req.params = { **(request_options&.additional_query_parameters || {}), "limit": limit, "offset": offset }.compact
@@ -88,6 +90,8 @@ end
88
90
  end
89
91
  unless request_options&.api_version.nil?
90
92
  req.headers["X-API-Version"] = request_options.api_version
93
+ else
94
+ req.headers["X-API-Version"] = "2025-07-30"
91
95
  end
92
96
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
93
97
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -121,6 +125,8 @@ end
121
125
  end
122
126
  unless request_options&.api_version.nil?
123
127
  req.headers["X-API-Version"] = request_options.api_version
128
+ else
129
+ req.headers["X-API-Version"] = "2025-07-30"
124
130
  end
125
131
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
126
132
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -168,6 +174,8 @@ end
168
174
  end
169
175
  unless request_options&.api_version.nil?
170
176
  req.headers["X-API-Version"] = request_options.api_version
177
+ else
178
+ req.headers["X-API-Version"] = "2025-07-30"
171
179
  end
172
180
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
173
181
  req.params = { **(request_options&.additional_query_parameters || {}), "limit": limit, "offset": offset }.compact
@@ -215,6 +223,8 @@ end
215
223
  end
216
224
  unless request_options&.api_version.nil?
217
225
  req.headers["X-API-Version"] = request_options.api_version
226
+ else
227
+ req.headers["X-API-Version"] = "2025-07-30"
218
228
  end
219
229
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
220
230
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -250,6 +260,8 @@ end
250
260
  end
251
261
  unless request_options&.api_version.nil?
252
262
  req.headers["X-API-Version"] = request_options.api_version
263
+ else
264
+ req.headers["X-API-Version"] = "2025-07-30"
253
265
  end
254
266
  req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
255
267
  unless request_options.nil? || request_options&.additional_query_parameters.nil?
@@ -0,0 +1,85 @@
1
+ # frozen_string_literal: true
2
+ require_relative "string_vellum_value"
3
+ require_relative "workflow_node_result_event_state"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module Vellum
8
+ # An output returned by a node that is of type THINKING.
9
+ class NodeOutputCompiledThinkingValue
10
+ # @return [String]
11
+ attr_reader :type
12
+ # @return [Vellum::StringVellumValue]
13
+ attr_reader :value
14
+ # @return [String]
15
+ attr_reader :node_output_id
16
+ # @return [Vellum::WorkflowNodeResultEventState]
17
+ attr_reader :state
18
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
19
+ attr_reader :additional_properties
20
+ # @return [Object]
21
+ attr_reader :_field_set
22
+ protected :_field_set
23
+
24
+ OMIT = Object.new
25
+
26
+ # @param type [String]
27
+ # @param value [Vellum::StringVellumValue]
28
+ # @param node_output_id [String]
29
+ # @param state [Vellum::WorkflowNodeResultEventState]
30
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
31
+ # @return [Vellum::NodeOutputCompiledThinkingValue]
32
+ def initialize(type:, value: OMIT, node_output_id:, state: OMIT, additional_properties: nil)
33
+ @type = type
34
+ @value = value if value != OMIT
35
+ @node_output_id = node_output_id
36
+ @state = state if state != OMIT
37
+ @additional_properties = additional_properties
38
+ @_field_set = { "type": type, "value": value, "node_output_id": node_output_id, "state": state }.reject do | _k, v |
39
+ v == OMIT
40
+ end
41
+ end
42
+ # Deserialize a JSON object to an instance of NodeOutputCompiledThinkingValue
43
+ #
44
+ # @param json_object [String]
45
+ # @return [Vellum::NodeOutputCompiledThinkingValue]
46
+ def self.from_json(json_object:)
47
+ struct = JSON.parse(json_object, object_class: OpenStruct)
48
+ parsed_json = JSON.parse(json_object)
49
+ type = parsed_json["type"]
50
+ unless parsed_json["value"].nil?
51
+ value = parsed_json["value"].to_json
52
+ value = Vellum::StringVellumValue.from_json(json_object: value)
53
+ else
54
+ value = nil
55
+ end
56
+ node_output_id = parsed_json["node_output_id"]
57
+ state = parsed_json["state"]
58
+ new(
59
+ type: type,
60
+ value: value,
61
+ node_output_id: node_output_id,
62
+ state: state,
63
+ additional_properties: struct
64
+ )
65
+ end
66
+ # Serialize an instance of NodeOutputCompiledThinkingValue to a JSON object
67
+ #
68
+ # @return [String]
69
+ def to_json
70
+ @_field_set&.to_json
71
+ end
72
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
73
+ # hash and check each fields type against the current object's property
74
+ # definitions.
75
+ #
76
+ # @param obj [Object]
77
+ # @return [Void]
78
+ def self.validate_raw(obj:)
79
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
80
+ obj.value.nil? || Vellum::StringVellumValue.validate_raw(obj: obj.value)
81
+ obj.node_output_id.is_a?(String) != false || raise("Passed value for field obj.node_output_id is not the expected type, validation failed.")
82
+ obj.state&.is_a?(Vellum::WorkflowNodeResultEventState) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
83
+ end
84
+ end
85
+ end
@@ -8,6 +8,7 @@ require_relative "node_output_compiled_search_results_value"
8
8
  require_relative "node_output_compiled_error_value"
9
9
  require_relative "node_output_compiled_array_value"
10
10
  require_relative "node_output_compiled_function_call_value"
11
+ require_relative "node_output_compiled_thinking_value"
11
12
 
12
13
  module Vellum
13
14
  class NodeOutputCompiledValue
@@ -95,6 +96,16 @@ end
95
96
  return Vellum::NodeOutputCompiledFunctionCallValue.from_json(json_object: struct)
96
97
  else
97
98
  return nil
99
+ end
100
+ rescue StandardError
101
+ # noop
102
+ end
103
+ begin
104
+ Vellum::NodeOutputCompiledThinkingValue.validate_raw(obj: struct)
105
+ unless struct.nil?
106
+ return Vellum::NodeOutputCompiledThinkingValue.from_json(json_object: struct)
107
+ else
108
+ return nil
98
109
  end
99
110
  rescue StandardError
100
111
  # noop
@@ -148,6 +159,11 @@ end
148
159
  rescue StandardError
149
160
  # noop
150
161
  end
162
+ begin
163
+ return Vellum::NodeOutputCompiledThinkingValue.validate_raw(obj: obj)
164
+ rescue StandardError
165
+ # noop
166
+ end
151
167
  raise("Passed value matched no type within the union, validation failed.")
152
168
  end
153
169
  end
@@ -0,0 +1,94 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vembda_service_tier_enum"
3
+ require_relative "quota"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module Vellum
8
+ class OrganizationLimitConfig
9
+ # @return [Vellum::VembdaServiceTierEnum]
10
+ attr_reader :vembda_service_tier
11
+ # @return [Vellum::Quota]
12
+ attr_reader :prompt_executions_quota
13
+ # @return [Vellum::Quota]
14
+ attr_reader :workflow_executions_quota
15
+ # @return [Vellum::Quota]
16
+ attr_reader :workflow_runtime_seconds_quota
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param vembda_service_tier [Vellum::VembdaServiceTierEnum]
26
+ # @param prompt_executions_quota [Vellum::Quota]
27
+ # @param workflow_executions_quota [Vellum::Quota]
28
+ # @param workflow_runtime_seconds_quota [Vellum::Quota]
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [Vellum::OrganizationLimitConfig]
31
+ def initialize(vembda_service_tier: OMIT, prompt_executions_quota: OMIT, workflow_executions_quota: OMIT, workflow_runtime_seconds_quota: OMIT, additional_properties: nil)
32
+ @vembda_service_tier = vembda_service_tier if vembda_service_tier != OMIT
33
+ @prompt_executions_quota = prompt_executions_quota if prompt_executions_quota != OMIT
34
+ @workflow_executions_quota = workflow_executions_quota if workflow_executions_quota != OMIT
35
+ @workflow_runtime_seconds_quota = workflow_runtime_seconds_quota if workflow_runtime_seconds_quota != OMIT
36
+ @additional_properties = additional_properties
37
+ @_field_set = { "vembda_service_tier": vembda_service_tier, "prompt_executions_quota": prompt_executions_quota, "workflow_executions_quota": workflow_executions_quota, "workflow_runtime_seconds_quota": workflow_runtime_seconds_quota }.reject do | _k, v |
38
+ v == OMIT
39
+ end
40
+ end
41
+ # Deserialize a JSON object to an instance of OrganizationLimitConfig
42
+ #
43
+ # @param json_object [String]
44
+ # @return [Vellum::OrganizationLimitConfig]
45
+ def self.from_json(json_object:)
46
+ struct = JSON.parse(json_object, object_class: OpenStruct)
47
+ parsed_json = JSON.parse(json_object)
48
+ vembda_service_tier = parsed_json["vembda_service_tier"]
49
+ unless parsed_json["prompt_executions_quota"].nil?
50
+ prompt_executions_quota = parsed_json["prompt_executions_quota"].to_json
51
+ prompt_executions_quota = Vellum::Quota.from_json(json_object: prompt_executions_quota)
52
+ else
53
+ prompt_executions_quota = nil
54
+ end
55
+ unless parsed_json["workflow_executions_quota"].nil?
56
+ workflow_executions_quota = parsed_json["workflow_executions_quota"].to_json
57
+ workflow_executions_quota = Vellum::Quota.from_json(json_object: workflow_executions_quota)
58
+ else
59
+ workflow_executions_quota = nil
60
+ end
61
+ unless parsed_json["workflow_runtime_seconds_quota"].nil?
62
+ workflow_runtime_seconds_quota = parsed_json["workflow_runtime_seconds_quota"].to_json
63
+ workflow_runtime_seconds_quota = Vellum::Quota.from_json(json_object: workflow_runtime_seconds_quota)
64
+ else
65
+ workflow_runtime_seconds_quota = nil
66
+ end
67
+ new(
68
+ vembda_service_tier: vembda_service_tier,
69
+ prompt_executions_quota: prompt_executions_quota,
70
+ workflow_executions_quota: workflow_executions_quota,
71
+ workflow_runtime_seconds_quota: workflow_runtime_seconds_quota,
72
+ additional_properties: struct
73
+ )
74
+ end
75
+ # Serialize an instance of OrganizationLimitConfig to a JSON object
76
+ #
77
+ # @return [String]
78
+ def to_json
79
+ @_field_set&.to_json
80
+ end
81
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
82
+ # hash and check each fields type against the current object's property
83
+ # definitions.
84
+ #
85
+ # @param obj [Object]
86
+ # @return [Void]
87
+ def self.validate_raw(obj:)
88
+ obj.vembda_service_tier&.is_a?(Vellum::VembdaServiceTierEnum) != false || raise("Passed value for field obj.vembda_service_tier is not the expected type, validation failed.")
89
+ obj.prompt_executions_quota.nil? || Vellum::Quota.validate_raw(obj: obj.prompt_executions_quota)
90
+ obj.workflow_executions_quota.nil? || Vellum::Quota.validate_raw(obj: obj.workflow_executions_quota)
91
+ obj.workflow_runtime_seconds_quota.nil? || Vellum::Quota.validate_raw(obj: obj.workflow_runtime_seconds_quota)
92
+ end
93
+ end
94
+ end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  require_relative "new_member_join_behavior_enum"
3
+ require_relative "organization_limit_config"
3
4
  require "ostruct"
4
5
  require "json"
5
6
 
@@ -13,6 +14,8 @@ module Vellum
13
14
  attr_reader :allow_staff_access
14
15
  # @return [Vellum::NewMemberJoinBehaviorEnum]
15
16
  attr_reader :new_member_join_behavior
17
+ # @return [Vellum::OrganizationLimitConfig]
18
+ attr_reader :limit_config
16
19
  # @return [OpenStruct] Additional properties unmapped to the current class definition
17
20
  attr_reader :additional_properties
18
21
  # @return [Object]
@@ -25,15 +28,17 @@ module Vellum
25
28
  # @param name [String]
26
29
  # @param allow_staff_access [Boolean]
27
30
  # @param new_member_join_behavior [Vellum::NewMemberJoinBehaviorEnum]
31
+ # @param limit_config [Vellum::OrganizationLimitConfig]
28
32
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
29
33
  # @return [Vellum::OrganizationRead]
30
- def initialize(id:, name:, allow_staff_access: OMIT, new_member_join_behavior:, additional_properties: nil)
34
+ def initialize(id:, name:, allow_staff_access: OMIT, new_member_join_behavior:, limit_config:, additional_properties: nil)
31
35
  @id = id
32
36
  @name = name
33
37
  @allow_staff_access = allow_staff_access if allow_staff_access != OMIT
34
38
  @new_member_join_behavior = new_member_join_behavior
39
+ @limit_config = limit_config
35
40
  @additional_properties = additional_properties
36
- @_field_set = { "id": id, "name": name, "allow_staff_access": allow_staff_access, "new_member_join_behavior": new_member_join_behavior }.reject do | _k, v |
41
+ @_field_set = { "id": id, "name": name, "allow_staff_access": allow_staff_access, "new_member_join_behavior": new_member_join_behavior, "limit_config": limit_config }.reject do | _k, v |
37
42
  v == OMIT
38
43
  end
39
44
  end
@@ -48,11 +53,18 @@ end
48
53
  name = parsed_json["name"]
49
54
  allow_staff_access = parsed_json["allow_staff_access"]
50
55
  new_member_join_behavior = parsed_json["new_member_join_behavior"]
56
+ unless parsed_json["limit_config"].nil?
57
+ limit_config = parsed_json["limit_config"].to_json
58
+ limit_config = Vellum::OrganizationLimitConfig.from_json(json_object: limit_config)
59
+ else
60
+ limit_config = nil
61
+ end
51
62
  new(
52
63
  id: id,
53
64
  name: name,
54
65
  allow_staff_access: allow_staff_access,
55
66
  new_member_join_behavior: new_member_join_behavior,
67
+ limit_config: limit_config,
56
68
  additional_properties: struct
57
69
  )
58
70
  end
@@ -73,6 +85,7 @@ end
73
85
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
74
86
  obj.allow_staff_access&.is_a?(Boolean) != false || raise("Passed value for field obj.allow_staff_access is not the expected type, validation failed.")
75
87
  obj.new_member_join_behavior.is_a?(Vellum::NewMemberJoinBehaviorEnum) != false || raise("Passed value for field obj.new_member_join_behavior is not the expected type, validation failed.")
88
+ Vellum::OrganizationLimitConfig.validate_raw(obj: obj.limit_config)
76
89
  end
77
90
  end
78
91
  end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+ require "ostruct"
3
+ require "json"
4
+
5
+ module Vellum
6
+ class Quota
7
+ # @return [String]
8
+ attr_reader :name
9
+ # @return [Integer]
10
+ attr_reader :value
11
+ # @return [Integer]
12
+ attr_reader :period_seconds
13
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
14
+ attr_reader :additional_properties
15
+ # @return [Object]
16
+ attr_reader :_field_set
17
+ protected :_field_set
18
+
19
+ OMIT = Object.new
20
+
21
+ # @param name [String]
22
+ # @param value [Integer]
23
+ # @param period_seconds [Integer]
24
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
25
+ # @return [Vellum::Quota]
26
+ def initialize(name:, value: OMIT, period_seconds: OMIT, additional_properties: nil)
27
+ @name = name
28
+ @value = value if value != OMIT
29
+ @period_seconds = period_seconds if period_seconds != OMIT
30
+ @additional_properties = additional_properties
31
+ @_field_set = { "name": name, "value": value, "period_seconds": period_seconds }.reject do | _k, v |
32
+ v == OMIT
33
+ end
34
+ end
35
+ # Deserialize a JSON object to an instance of Quota
36
+ #
37
+ # @param json_object [String]
38
+ # @return [Vellum::Quota]
39
+ def self.from_json(json_object:)
40
+ struct = JSON.parse(json_object, object_class: OpenStruct)
41
+ parsed_json = JSON.parse(json_object)
42
+ name = parsed_json["name"]
43
+ value = parsed_json["value"]
44
+ period_seconds = parsed_json["period_seconds"]
45
+ new(
46
+ name: name,
47
+ value: value,
48
+ period_seconds: period_seconds,
49
+ additional_properties: struct
50
+ )
51
+ end
52
+ # Serialize an instance of Quota to a JSON object
53
+ #
54
+ # @return [String]
55
+ def to_json
56
+ @_field_set&.to_json
57
+ end
58
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
59
+ # hash and check each fields type against the current object's property
60
+ # definitions.
61
+ #
62
+ # @param obj [Object]
63
+ # @return [Void]
64
+ def self.validate_raw(obj:)
65
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
66
+ obj.value&.is_a?(Integer) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
67
+ obj.period_seconds&.is_a?(Integer) != false || raise("Passed value for field obj.period_seconds is not the expected type, validation failed.")
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vellum
4
+ # * `FREE` - FREE
5
+ # * `PAID` - PAID
6
+ class VembdaServiceTierEnum
7
+
8
+ FREE = "FREE"
9
+ PAID = "PAID"
10
+
11
+ end
12
+ end
@@ -28,10 +28,10 @@ module Vellum
28
28
  # @param metadata [Hash{String => Object}]
29
29
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
30
  # @return [Vellum::WorkflowExecutionActual]
31
- def initialize(output:, timestamp:, quality:, metadata: OMIT, additional_properties: nil)
31
+ def initialize(output:, timestamp:, quality: OMIT, metadata: OMIT, additional_properties: nil)
32
32
  @output = output
33
33
  @timestamp = timestamp
34
- @quality = quality
34
+ @quality = quality if quality != OMIT
35
35
  @metadata = metadata if metadata != OMIT
36
36
  @additional_properties = additional_properties
37
37
  @_field_set = { "output": output, "timestamp": timestamp, "quality": quality, "metadata": metadata }.reject do | _k, v |
@@ -81,7 +81,7 @@ end
81
81
  def self.validate_raw(obj:)
82
82
  Vellum::ExecutionVellumValue.validate_raw(obj: obj.output)
83
83
  obj.timestamp.is_a?(DateTime) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
84
- obj.quality.is_a?(Float) != false || raise("Passed value for field obj.quality is not the expected type, validation failed.")
84
+ obj.quality&.is_a?(Float) != false || raise("Passed value for field obj.quality is not the expected type, validation failed.")
85
85
  obj.metadata&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
86
86
  end
87
87
  end