openlayer 0.4.0 → 0.5.0

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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/README.md +1 -1
  4. data/lib/openlayer/internal/transport/base_client.rb +7 -1
  5. data/lib/openlayer/internal/transport/pooled_net_requester.rb +36 -26
  6. data/lib/openlayer/internal/util.rb +5 -5
  7. data/lib/openlayer/models/inference_pipeline_retrieve_response.rb +507 -1
  8. data/lib/openlayer/models/inference_pipeline_update_response.rb +507 -1
  9. data/lib/openlayer/models/projects/inference_pipeline_create_params.rb +609 -1
  10. data/lib/openlayer/models/projects/inference_pipeline_create_response.rb +507 -1
  11. data/lib/openlayer/models/projects/inference_pipeline_list_response.rb +507 -1
  12. data/lib/openlayer/models/projects/test_create_params.rb +49 -1
  13. data/lib/openlayer/models/projects/test_create_response.rb +49 -1
  14. data/lib/openlayer/models/projects/test_list_response.rb +49 -1
  15. data/lib/openlayer/resources/projects/inference_pipelines.rb +3 -1
  16. data/lib/openlayer/resources/projects/tests.rb +9 -1
  17. data/lib/openlayer/version.rb +1 -1
  18. data/lib/openlayer.rb +2 -0
  19. data/manifest.yaml +2 -0
  20. data/rbi/openlayer/internal/transport/base_client.rbi +5 -0
  21. data/rbi/openlayer/internal/transport/pooled_net_requester.rbi +6 -2
  22. data/rbi/openlayer/internal/type/base_model.rbi +8 -4
  23. data/rbi/openlayer/models/inference_pipeline_retrieve_response.rbi +948 -0
  24. data/rbi/openlayer/models/inference_pipeline_update_response.rbi +948 -0
  25. data/rbi/openlayer/models/projects/inference_pipeline_create_params.rbi +1095 -0
  26. data/rbi/openlayer/models/projects/inference_pipeline_create_response.rbi +952 -0
  27. data/rbi/openlayer/models/projects/inference_pipeline_list_response.rbi +952 -0
  28. data/rbi/openlayer/models/projects/test_create_params.rbi +40 -0
  29. data/rbi/openlayer/models/projects/test_create_response.rbi +40 -0
  30. data/rbi/openlayer/models/projects/test_list_response.rbi +40 -0
  31. data/rbi/openlayer/resources/projects/inference_pipelines.rbi +12 -0
  32. data/rbi/openlayer/resources/projects/tests.rbi +16 -0
  33. data/sig/openlayer/internal/transport/base_client.rbs +2 -0
  34. data/sig/openlayer/internal/transport/pooled_net_requester.rbs +4 -1
  35. data/sig/openlayer/models/inference_pipeline_retrieve_response.rbs +473 -0
  36. data/sig/openlayer/models/inference_pipeline_update_response.rbs +473 -0
  37. data/sig/openlayer/models/projects/inference_pipeline_create_params.rbs +493 -0
  38. data/sig/openlayer/models/projects/inference_pipeline_create_response.rbs +473 -0
  39. data/sig/openlayer/models/projects/inference_pipeline_list_response.rbs +473 -0
  40. data/sig/openlayer/models/projects/test_create_params.rbs +20 -0
  41. data/sig/openlayer/models/projects/test_create_response.rbs +20 -0
  42. data/sig/openlayer/models/projects/test_list_response.rbs +20 -0
  43. data/sig/openlayer/resources/projects/inference_pipelines.rbs +1 -0
  44. data/sig/openlayer/resources/projects/tests.rbs +4 -0
  45. metadata +2 -2
@@ -41,6 +41,16 @@ module Openlayer
41
41
  # @return [Boolean, nil]
42
42
  optional :archived, Openlayer::Internal::Type::Boolean
43
43
 
44
+ # @!attribute default_to_all_pipelines
45
+ # Whether to apply the test to all pipelines (data sources) or to a specific set
46
+ # of pipelines. Only applies to tests that use production data.
47
+ #
48
+ # @return [Boolean, nil]
49
+ optional :default_to_all_pipelines,
50
+ Openlayer::Internal::Type::Boolean,
51
+ api_name: :defaultToAllPipelines,
52
+ nil?: true
53
+
44
54
  # @!attribute delay_window
45
55
  # The delay window in seconds. Only applies to tests that use production data.
46
56
  #
@@ -54,6 +64,36 @@ module Openlayer
54
64
  # @return [Float, nil]
55
65
  optional :evaluation_window, Float, api_name: :evaluationWindow, nil?: true
56
66
 
67
+ # @!attribute exclude_pipelines
68
+ # Array of pipelines (data sources) to which the test should not be applied. Only
69
+ # applies to tests that use production data.
70
+ #
71
+ # @return [Array<String>, nil]
72
+ optional :exclude_pipelines,
73
+ Openlayer::Internal::Type::ArrayOf[String],
74
+ api_name: :excludePipelines,
75
+ nil?: true
76
+
77
+ # @!attribute include_historical_data
78
+ # Whether to include historical data in the test result. Only applies to tests
79
+ # that use production data.
80
+ #
81
+ # @return [Boolean, nil]
82
+ optional :include_historical_data,
83
+ Openlayer::Internal::Type::Boolean,
84
+ api_name: :includeHistoricalData,
85
+ nil?: true
86
+
87
+ # @!attribute include_pipelines
88
+ # Array of pipelines (data sources) to which the test should be applied. Only
89
+ # applies to tests that use production data.
90
+ #
91
+ # @return [Array<String>, nil]
92
+ optional :include_pipelines,
93
+ Openlayer::Internal::Type::ArrayOf[String],
94
+ api_name: :includePipelines,
95
+ nil?: true
96
+
57
97
  # @!attribute uses_ml_model
58
98
  # Whether the test uses an ML model.
59
99
  #
@@ -142,7 +182,7 @@ module Openlayer
142
182
  required :suggested, Openlayer::Internal::Type::Boolean
143
183
  end
144
184
 
145
- # @!method initialize(id:, comment_count:, creator_id:, date_archived:, date_created:, date_updated:, description:, name:, number:, origin_project_version_id:, subtype:, suggested:, thresholds:, type:, archived: nil, delay_window: nil, evaluation_window: nil, uses_ml_model: nil, uses_production_data: nil, uses_reference_dataset: nil, uses_training_dataset: nil, uses_validation_dataset: nil)
185
+ # @!method initialize(id:, comment_count:, creator_id:, date_archived:, date_created:, date_updated:, description:, name:, number:, origin_project_version_id:, subtype:, suggested:, thresholds:, type:, archived: nil, default_to_all_pipelines: nil, delay_window: nil, evaluation_window: nil, exclude_pipelines: nil, include_historical_data: nil, include_pipelines: nil, uses_ml_model: nil, uses_production_data: nil, uses_reference_dataset: nil, uses_training_dataset: nil, uses_validation_dataset: nil)
146
186
  # Some parameter documentations has been truncated, see
147
187
  # {Openlayer::Models::Projects::TestCreateResponse} for more details.
148
188
  #
@@ -176,10 +216,18 @@ module Openlayer
176
216
  #
177
217
  # @param archived [Boolean] Whether the test is archived.
178
218
  #
219
+ # @param default_to_all_pipelines [Boolean, nil] Whether to apply the test to all pipelines (data sources) or to a specific set o
220
+ #
179
221
  # @param delay_window [Float, nil] The delay window in seconds. Only applies to tests that use production data.
180
222
  #
181
223
  # @param evaluation_window [Float, nil] The evaluation window in seconds. Only applies to tests that use production data
182
224
  #
225
+ # @param exclude_pipelines [Array<String>, nil] Array of pipelines (data sources) to which the test should not be applied. Only
226
+ #
227
+ # @param include_historical_data [Boolean, nil] Whether to include historical data in the test result. Only applies to tests tha
228
+ #
229
+ # @param include_pipelines [Array<String>, nil] Array of pipelines (data sources) to which the test should be applied. Only appl
230
+ #
183
231
  # @param uses_ml_model [Boolean] Whether the test uses an ML model.
184
232
  #
185
233
  # @param uses_production_data [Boolean] Whether the test uses production data (monitoring mode only).
@@ -51,6 +51,16 @@ module Openlayer
51
51
  # @return [Boolean, nil]
52
52
  optional :archived, Openlayer::Internal::Type::Boolean
53
53
 
54
+ # @!attribute default_to_all_pipelines
55
+ # Whether to apply the test to all pipelines (data sources) or to a specific set
56
+ # of pipelines. Only applies to tests that use production data.
57
+ #
58
+ # @return [Boolean, nil]
59
+ optional :default_to_all_pipelines,
60
+ Openlayer::Internal::Type::Boolean,
61
+ api_name: :defaultToAllPipelines,
62
+ nil?: true
63
+
54
64
  # @!attribute delay_window
55
65
  # The delay window in seconds. Only applies to tests that use production data.
56
66
  #
@@ -64,6 +74,36 @@ module Openlayer
64
74
  # @return [Float, nil]
65
75
  optional :evaluation_window, Float, api_name: :evaluationWindow, nil?: true
66
76
 
77
+ # @!attribute exclude_pipelines
78
+ # Array of pipelines (data sources) to which the test should not be applied. Only
79
+ # applies to tests that use production data.
80
+ #
81
+ # @return [Array<String>, nil]
82
+ optional :exclude_pipelines,
83
+ Openlayer::Internal::Type::ArrayOf[String],
84
+ api_name: :excludePipelines,
85
+ nil?: true
86
+
87
+ # @!attribute include_historical_data
88
+ # Whether to include historical data in the test result. Only applies to tests
89
+ # that use production data.
90
+ #
91
+ # @return [Boolean, nil]
92
+ optional :include_historical_data,
93
+ Openlayer::Internal::Type::Boolean,
94
+ api_name: :includeHistoricalData,
95
+ nil?: true
96
+
97
+ # @!attribute include_pipelines
98
+ # Array of pipelines (data sources) to which the test should be applied. Only
99
+ # applies to tests that use production data.
100
+ #
101
+ # @return [Array<String>, nil]
102
+ optional :include_pipelines,
103
+ Openlayer::Internal::Type::ArrayOf[String],
104
+ api_name: :includePipelines,
105
+ nil?: true
106
+
67
107
  # @!attribute uses_ml_model
68
108
  # Whether the test uses an ML model.
69
109
  #
@@ -154,7 +194,7 @@ module Openlayer
154
194
  required :suggested, Openlayer::Internal::Type::Boolean
155
195
  end
156
196
 
157
- # @!method initialize(id:, comment_count:, creator_id:, date_archived:, date_created:, date_updated:, description:, name:, number:, origin_project_version_id:, subtype:, suggested:, thresholds:, type:, archived: nil, delay_window: nil, evaluation_window: nil, uses_ml_model: nil, uses_production_data: nil, uses_reference_dataset: nil, uses_training_dataset: nil, uses_validation_dataset: nil)
197
+ # @!method initialize(id:, comment_count:, creator_id:, date_archived:, date_created:, date_updated:, description:, name:, number:, origin_project_version_id:, subtype:, suggested:, thresholds:, type:, archived: nil, default_to_all_pipelines: nil, delay_window: nil, evaluation_window: nil, exclude_pipelines: nil, include_historical_data: nil, include_pipelines: nil, uses_ml_model: nil, uses_production_data: nil, uses_reference_dataset: nil, uses_training_dataset: nil, uses_validation_dataset: nil)
158
198
  # Some parameter documentations has been truncated, see
159
199
  # {Openlayer::Models::Projects::TestListResponse::Item} for more details.
160
200
  #
@@ -188,10 +228,18 @@ module Openlayer
188
228
  #
189
229
  # @param archived [Boolean] Whether the test is archived.
190
230
  #
231
+ # @param default_to_all_pipelines [Boolean, nil] Whether to apply the test to all pipelines (data sources) or to a specific set o
232
+ #
191
233
  # @param delay_window [Float, nil] The delay window in seconds. Only applies to tests that use production data.
192
234
  #
193
235
  # @param evaluation_window [Float, nil] The evaluation window in seconds. Only applies to tests that use production data
194
236
  #
237
+ # @param exclude_pipelines [Array<String>, nil] Array of pipelines (data sources) to which the test should not be applied. Only
238
+ #
239
+ # @param include_historical_data [Boolean, nil] Whether to include historical data in the test result. Only applies to tests tha
240
+ #
241
+ # @param include_pipelines [Array<String>, nil] Array of pipelines (data sources) to which the test should be applied. Only appl
242
+ #
195
243
  # @param uses_ml_model [Boolean] Whether the test uses an ML model.
196
244
  #
197
245
  # @param uses_production_data [Boolean] Whether the test uses production data (monitoring mode only).
@@ -6,7 +6,7 @@ module Openlayer
6
6
  class InferencePipelines
7
7
  # Create an inference pipeline in a project.
8
8
  #
9
- # @overload create(project_id, description:, name:, project: nil, workspace: nil, request_options: {})
9
+ # @overload create(project_id, description:, name:, data_backend: nil, project: nil, workspace: nil, request_options: {})
10
10
  #
11
11
  # @param project_id [String] The project id.
12
12
  #
@@ -14,6 +14,8 @@ module Openlayer
14
14
  #
15
15
  # @param name [String] The inference pipeline name.
16
16
  #
17
+ # @param data_backend [Openlayer::Models::Projects::InferencePipelineCreateParams::DataBackend::UnionMember0, Openlayer::Models::Projects::InferencePipelineCreateParams::DataBackend::BackendType, Openlayer::Models::Projects::InferencePipelineCreateParams::DataBackend::UnionMember2, Openlayer::Models::Projects::InferencePipelineCreateParams::DataBackend::UnionMember3, Openlayer::Models::Projects::InferencePipelineCreateParams::DataBackend::UnionMember4, Openlayer::Models::Projects::InferencePipelineCreateParams::DataBackend::UnionMember5, nil]
18
+ #
17
19
  # @param project [Openlayer::Models::Projects::InferencePipelineCreateParams::Project, nil]
18
20
  #
19
21
  # @param workspace [Openlayer::Models::Projects::InferencePipelineCreateParams::Workspace, nil]
@@ -9,7 +9,7 @@ module Openlayer
9
9
  #
10
10
  # Create a test.
11
11
  #
12
- # @overload create(project_id, description:, name:, subtype:, thresholds:, type:, archived: nil, delay_window: nil, evaluation_window: nil, uses_ml_model: nil, uses_production_data: nil, uses_reference_dataset: nil, uses_training_dataset: nil, uses_validation_dataset: nil, request_options: {})
12
+ # @overload create(project_id, description:, name:, subtype:, thresholds:, type:, archived: nil, default_to_all_pipelines: nil, delay_window: nil, evaluation_window: nil, exclude_pipelines: nil, include_historical_data: nil, include_pipelines: nil, uses_ml_model: nil, uses_production_data: nil, uses_reference_dataset: nil, uses_training_dataset: nil, uses_validation_dataset: nil, request_options: {})
13
13
  #
14
14
  # @param project_id [String] The project id.
15
15
  #
@@ -25,10 +25,18 @@ module Openlayer
25
25
  #
26
26
  # @param archived [Boolean] Whether the test is archived.
27
27
  #
28
+ # @param default_to_all_pipelines [Boolean, nil] Whether to apply the test to all pipelines (data sources) or to a specific set o
29
+ #
28
30
  # @param delay_window [Float, nil] The delay window in seconds. Only applies to tests that use production data.
29
31
  #
30
32
  # @param evaluation_window [Float, nil] The evaluation window in seconds. Only applies to tests that use production data
31
33
  #
34
+ # @param exclude_pipelines [Array<String>, nil] Array of pipelines (data sources) to which the test should not be applied. Only
35
+ #
36
+ # @param include_historical_data [Boolean, nil] Whether to include historical data in the test result. Only applies to tests tha
37
+ #
38
+ # @param include_pipelines [Array<String>, nil] Array of pipelines (data sources) to which the test should be applied. Only appl
39
+ #
32
40
  # @param uses_ml_model [Boolean] Whether the test uses an ML model.
33
41
  #
34
42
  # @param uses_production_data [Boolean] Whether the test uses production data (monitoring mode only).
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Openlayer
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
data/lib/openlayer.rb CHANGED
@@ -3,12 +3,14 @@
3
3
  # Standard libraries.
4
4
  # rubocop:disable Lint/RedundantRequireStatement
5
5
  require "English"
6
+ require "base64"
6
7
  require "cgi"
7
8
  require "date"
8
9
  require "erb"
9
10
  require "etc"
10
11
  require "json"
11
12
  require "net/http"
13
+ require "openssl"
12
14
  require "pathname"
13
15
  require "rbconfig"
14
16
  require "securerandom"
data/manifest.yaml CHANGED
@@ -1,11 +1,13 @@
1
1
  dependencies:
2
2
  - English
3
+ - base64
3
4
  - cgi
4
5
  - date
5
6
  - erb
6
7
  - etc
7
8
  - json
8
9
  - net/http
10
+ - openssl
9
11
  - pathname
10
12
  - rbconfig
11
13
  - securerandom
@@ -176,6 +176,11 @@ module Openlayer
176
176
  private def auth_headers
177
177
  end
178
178
 
179
+ # @api private
180
+ sig { returns(String) }
181
+ private def user_agent
182
+ end
183
+
179
184
  # @api private
180
185
  sig { returns(String) }
181
186
  private def generate_idempotency_key
@@ -26,8 +26,12 @@ module Openlayer
26
26
 
27
27
  class << self
28
28
  # @api private
29
- sig { params(url: URI::Generic).returns(Net::HTTP) }
30
- def connect(url)
29
+ sig do
30
+ params(cert_store: OpenSSL::X509::Store, url: URI::Generic).returns(
31
+ Net::HTTP
32
+ )
33
+ end
34
+ def connect(cert_store:, url:)
31
35
  end
32
36
 
33
37
  # @api private
@@ -31,7 +31,7 @@ module Openlayer
31
31
  #
32
32
  # Assumes superclass fields are totally defined before fields are accessed /
33
33
  # defined on subclasses.
34
- sig { params(child: T.self_type).void }
34
+ sig { params(child: Openlayer::Internal::Type::BaseModel).void }
35
35
  def inherited(child)
36
36
  end
37
37
 
@@ -276,9 +276,13 @@ module Openlayer
276
276
 
277
277
  # Create a new instance of a model.
278
278
  sig do
279
- params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).returns(
280
- T.attached_class
281
- )
279
+ params(
280
+ data:
281
+ T.any(
282
+ T::Hash[Symbol, T.anything],
283
+ Openlayer::Internal::Type::BaseModel
284
+ )
285
+ ).returns(T.attached_class)
282
286
  end
283
287
  def self.new(data = {})
284
288
  end