deeprails 0.7.0 → 0.9.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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +1 -1
  4. data/lib/deeprails/client.rb +0 -4
  5. data/lib/deeprails/internal/transport/pooled_net_requester.rb +30 -24
  6. data/lib/deeprails/models/defend_create_workflow_params.rb +4 -4
  7. data/lib/deeprails/models/defend_response.rb +4 -4
  8. data/lib/deeprails/models/defend_submit_event_params.rb +4 -4
  9. data/lib/deeprails/models/monitor_detail_response.rb +378 -0
  10. data/lib/deeprails/models/monitor_event_response.rb +41 -0
  11. data/lib/deeprails/models/monitor_response.rb +83 -0
  12. data/lib/deeprails/models/monitor_submit_event_params.rb +2 -2
  13. data/lib/deeprails/models.rb +4 -6
  14. data/lib/deeprails/resources/defend.rb +2 -2
  15. data/lib/deeprails/resources/monitor.rb +8 -8
  16. data/lib/deeprails/version.rb +1 -1
  17. data/lib/deeprails.rb +3 -7
  18. data/rbi/deeprails/client.rbi +0 -3
  19. data/rbi/deeprails/models/defend_create_workflow_params.rbi +6 -6
  20. data/rbi/deeprails/models/defend_response.rbi +6 -6
  21. data/rbi/deeprails/models/defend_submit_event_params.rbi +5 -5
  22. data/rbi/deeprails/models/monitor_detail_response.rbi +730 -0
  23. data/rbi/deeprails/models/monitor_event_response.rbi +64 -0
  24. data/rbi/deeprails/models/monitor_response.rbi +142 -0
  25. data/rbi/deeprails/models/monitor_submit_event_params.rbi +3 -3
  26. data/rbi/deeprails/models.rbi +4 -6
  27. data/rbi/deeprails/resources/defend.rbi +3 -3
  28. data/rbi/deeprails/resources/monitor.rbi +5 -5
  29. data/sig/deeprails/client.rbs +0 -2
  30. data/sig/deeprails/models/defend_create_workflow_params.rbs +5 -5
  31. data/sig/deeprails/models/defend_response.rbs +5 -5
  32. data/sig/deeprails/models/monitor_detail_response.rbs +335 -0
  33. data/sig/deeprails/models/monitor_event_response.rbs +37 -0
  34. data/sig/deeprails/models/monitor_response.rbs +73 -0
  35. data/sig/deeprails/models.rbs +4 -6
  36. data/sig/deeprails/resources/defend.rbs +1 -1
  37. data/sig/deeprails/resources/monitor.rbs +4 -4
  38. metadata +11 -23
  39. data/lib/deeprails/models/api_response.rb +0 -116
  40. data/lib/deeprails/models/evaluate_create_params.rb +0 -134
  41. data/lib/deeprails/models/evaluate_retrieve_params.rb +0 -14
  42. data/lib/deeprails/models/evaluation.rb +0 -233
  43. data/lib/deeprails/models/monitor_retrieve_response.rb +0 -183
  44. data/lib/deeprails/models/monitor_submit_event_response.rb +0 -74
  45. data/lib/deeprails/resources/evaluate.rb +0 -70
  46. data/rbi/deeprails/models/api_response.rbi +0 -201
  47. data/rbi/deeprails/models/evaluate_create_params.rbi +0 -280
  48. data/rbi/deeprails/models/evaluate_retrieve_params.rbi +0 -27
  49. data/rbi/deeprails/models/evaluation.rbi +0 -402
  50. data/rbi/deeprails/models/monitor_retrieve_response.rbi +0 -333
  51. data/rbi/deeprails/models/monitor_submit_event_response.rbi +0 -131
  52. data/rbi/deeprails/resources/evaluate.rbi +0 -66
  53. data/sig/deeprails/models/api_response.rbs +0 -100
  54. data/sig/deeprails/models/evaluate_create_params.rbs +0 -122
  55. data/sig/deeprails/models/evaluate_retrieve_params.rbs +0 -15
  56. data/sig/deeprails/models/evaluation.rbs +0 -204
  57. data/sig/deeprails/models/monitor_retrieve_response.rbs +0 -167
  58. data/sig/deeprails/models/monitor_submit_event_response.rbs +0 -70
  59. data/sig/deeprails/resources/evaluate.rbs +0 -22
@@ -1,116 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Deeprails
4
- module Models
5
- # @see Deeprails::Resources::Monitor#create
6
- class APIResponse < Deeprails::Internal::Type::BaseModel
7
- # @!attribute success
8
- # Represents whether the request was completed successfully.
9
- #
10
- # @return [Boolean]
11
- required :success, Deeprails::Internal::Type::Boolean
12
-
13
- # @!attribute data
14
- #
15
- # @return [Deeprails::Models::APIResponse::Data, nil]
16
- optional :data, -> { Deeprails::APIResponse::Data }
17
-
18
- # @!attribute message
19
- # The accompanying message for the request. Includes error details when
20
- # applicable.
21
- #
22
- # @return [String, nil]
23
- optional :message, String
24
-
25
- # @!method initialize(success:, data: nil, message: nil)
26
- # Some parameter documentations has been truncated, see
27
- # {Deeprails::Models::APIResponse} for more details.
28
- #
29
- # Response wrapper for operations returning a MonitorResponse.
30
- #
31
- # @param success [Boolean] Represents whether the request was completed successfully.
32
- #
33
- # @param data [Deeprails::Models::APIResponse::Data]
34
- #
35
- # @param message [String] The accompanying message for the request. Includes error details when applicable
36
-
37
- # @see Deeprails::Models::APIResponse#data
38
- class Data < Deeprails::Internal::Type::BaseModel
39
- # @!attribute monitor_id
40
- # A unique monitor ID.
41
- #
42
- # @return [String]
43
- required :monitor_id, String
44
-
45
- # @!attribute name
46
- # Name of the monitor.
47
- #
48
- # @return [String]
49
- required :name, String
50
-
51
- # @!attribute created_at
52
- # The time the monitor was created in UTC.
53
- #
54
- # @return [Time, nil]
55
- optional :created_at, Time
56
-
57
- # @!attribute description
58
- # Description of the monitor.
59
- #
60
- # @return [String, nil]
61
- optional :description, String
62
-
63
- # @!attribute monitor_status
64
- # Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
65
- # longer record and evaluate events.
66
- #
67
- # @return [Symbol, Deeprails::Models::APIResponse::Data::MonitorStatus, nil]
68
- optional :monitor_status, enum: -> { Deeprails::APIResponse::Data::MonitorStatus }
69
-
70
- # @!attribute updated_at
71
- # The most recent time the monitor was modified in UTC.
72
- #
73
- # @return [Time, nil]
74
- optional :updated_at, Time
75
-
76
- # @!attribute user_id
77
- # User ID of the user who created the monitor.
78
- #
79
- # @return [String, nil]
80
- optional :user_id, String
81
-
82
- # @!method initialize(monitor_id:, name:, created_at: nil, description: nil, monitor_status: nil, updated_at: nil, user_id: nil)
83
- # Some parameter documentations has been truncated, see
84
- # {Deeprails::Models::APIResponse::Data} for more details.
85
- #
86
- # @param monitor_id [String] A unique monitor ID.
87
- #
88
- # @param name [String] Name of the monitor.
89
- #
90
- # @param created_at [Time] The time the monitor was created in UTC.
91
- #
92
- # @param description [String] Description of the monitor.
93
- #
94
- # @param monitor_status [Symbol, Deeprails::Models::APIResponse::Data::MonitorStatus] Status of the monitor. Can be `active` or `inactive`. Inactive monitors no lon
95
- #
96
- # @param updated_at [Time] The most recent time the monitor was modified in UTC.
97
- #
98
- # @param user_id [String] User ID of the user who created the monitor.
99
-
100
- # Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
101
- # longer record and evaluate events.
102
- #
103
- # @see Deeprails::Models::APIResponse::Data#monitor_status
104
- module MonitorStatus
105
- extend Deeprails::Internal::Type::Enum
106
-
107
- ACTIVE = :active
108
- INACTIVE = :inactive
109
-
110
- # @!method self.values
111
- # @return [Array<Symbol>]
112
- end
113
- end
114
- end
115
- end
116
- end
@@ -1,134 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Deeprails
4
- module Models
5
- # @see Deeprails::Resources::Evaluate#create
6
- class EvaluateCreateParams < Deeprails::Internal::Type::BaseModel
7
- extend Deeprails::Internal::Type::RequestParameters::Converter
8
- include Deeprails::Internal::Type::RequestParameters
9
-
10
- # @!attribute model_input
11
- # A dictionary of inputs sent to the LLM to generate output. The dictionary must
12
- # contain at least `user_prompt` or `system_prompt` field. For
13
- # ground_truth_adherence guardrail metric, `ground_truth` should be provided.
14
- #
15
- # @return [Deeprails::Models::EvaluateCreateParams::ModelInput]
16
- required :model_input, -> { Deeprails::EvaluateCreateParams::ModelInput }
17
-
18
- # @!attribute model_output
19
- # Output generated by the LLM to be evaluated.
20
- #
21
- # @return [String]
22
- required :model_output, String
23
-
24
- # @!attribute run_mode
25
- # Run mode for the evaluation. The run mode allows the user to optimize for speed,
26
- # accuracy, and cost by determining which models are used to evaluate the event.
27
- # Available run modes include `precision_plus`, `precision`, `smart`, and
28
- # `economy`. Defaults to `smart`.
29
- #
30
- # @return [Symbol, Deeprails::Models::EvaluateCreateParams::RunMode]
31
- required :run_mode, enum: -> { Deeprails::EvaluateCreateParams::RunMode }
32
-
33
- # @!attribute guardrail_metrics
34
- # An array of guardrail metrics that the model input and output pair will be
35
- # evaluated on. For non-enterprise users, these will be limited to the allowed
36
- # guardrail metrics.
37
- #
38
- # @return [Array<Symbol, Deeprails::Models::EvaluateCreateParams::GuardrailMetric>, nil]
39
- optional :guardrail_metrics,
40
- -> { Deeprails::Internal::Type::ArrayOf[enum: Deeprails::EvaluateCreateParams::GuardrailMetric] }
41
-
42
- # @!attribute model_used
43
- # Model ID used to generate the output, like `gpt-4o` or `o3`.
44
- #
45
- # @return [String, nil]
46
- optional :model_used, String
47
-
48
- # @!attribute nametag
49
- # An optional, user-defined tag for the evaluation.
50
- #
51
- # @return [String, nil]
52
- optional :nametag, String
53
-
54
- # @!method initialize(model_input:, model_output:, run_mode:, guardrail_metrics: nil, model_used: nil, nametag: nil, request_options: {})
55
- # Some parameter documentations has been truncated, see
56
- # {Deeprails::Models::EvaluateCreateParams} for more details.
57
- #
58
- # @param model_input [Deeprails::Models::EvaluateCreateParams::ModelInput] A dictionary of inputs sent to the LLM to generate output. The dictionary must c
59
- #
60
- # @param model_output [String] Output generated by the LLM to be evaluated.
61
- #
62
- # @param run_mode [Symbol, Deeprails::Models::EvaluateCreateParams::RunMode] Run mode for the evaluation. The run mode allows the user to optimize for speed
63
- #
64
- # @param guardrail_metrics [Array<Symbol, Deeprails::Models::EvaluateCreateParams::GuardrailMetric>] An array of guardrail metrics that the model input and output pair will be evalu
65
- #
66
- # @param model_used [String] Model ID used to generate the output, like `gpt-4o` or `o3`.
67
- #
68
- # @param nametag [String] An optional, user-defined tag for the evaluation.
69
- #
70
- # @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}]
71
-
72
- class ModelInput < Deeprails::Internal::Type::BaseModel
73
- # @!attribute ground_truth
74
- # The ground truth for evaluating Ground Truth Adherence guardrail.
75
- #
76
- # @return [String, nil]
77
- optional :ground_truth, String
78
-
79
- # @!attribute system_prompt
80
- # The system prompt used to generate the output.
81
- #
82
- # @return [String, nil]
83
- optional :system_prompt, String
84
-
85
- # @!attribute user_prompt
86
- # The user prompt used to generate the output.
87
- #
88
- # @return [String, nil]
89
- optional :user_prompt, String
90
-
91
- # @!method initialize(ground_truth: nil, system_prompt: nil, user_prompt: nil)
92
- # A dictionary of inputs sent to the LLM to generate output. The dictionary must
93
- # contain at least `user_prompt` or `system_prompt` field. For
94
- # ground_truth_adherence guardrail metric, `ground_truth` should be provided.
95
- #
96
- # @param ground_truth [String] The ground truth for evaluating Ground Truth Adherence guardrail.
97
- #
98
- # @param system_prompt [String] The system prompt used to generate the output.
99
- #
100
- # @param user_prompt [String] The user prompt used to generate the output.
101
- end
102
-
103
- # Run mode for the evaluation. The run mode allows the user to optimize for speed,
104
- # accuracy, and cost by determining which models are used to evaluate the event.
105
- # Available run modes include `precision_plus`, `precision`, `smart`, and
106
- # `economy`. Defaults to `smart`.
107
- module RunMode
108
- extend Deeprails::Internal::Type::Enum
109
-
110
- PRECISION_PLUS = :precision_plus
111
- PRECISION = :precision
112
- SMART = :smart
113
- ECONOMY = :economy
114
-
115
- # @!method self.values
116
- # @return [Array<Symbol>]
117
- end
118
-
119
- module GuardrailMetric
120
- extend Deeprails::Internal::Type::Enum
121
-
122
- CORRECTNESS = :correctness
123
- COMPLETENESS = :completeness
124
- INSTRUCTION_ADHERENCE = :instruction_adherence
125
- CONTEXT_ADHERENCE = :context_adherence
126
- GROUND_TRUTH_ADHERENCE = :ground_truth_adherence
127
- COMPREHENSIVE_SAFETY = :comprehensive_safety
128
-
129
- # @!method self.values
130
- # @return [Array<Symbol>]
131
- end
132
- end
133
- end
134
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Deeprails
4
- module Models
5
- # @see Deeprails::Resources::Evaluate#retrieve
6
- class EvaluateRetrieveParams < Deeprails::Internal::Type::BaseModel
7
- extend Deeprails::Internal::Type::RequestParameters::Converter
8
- include Deeprails::Internal::Type::RequestParameters
9
-
10
- # @!method initialize(request_options: {})
11
- # @param request_options [Deeprails::RequestOptions, Hash{Symbol=>Object}]
12
- end
13
- end
14
- end
@@ -1,233 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Deeprails
4
- module Models
5
- # @see Deeprails::Resources::Evaluate#create
6
- class Evaluation < Deeprails::Internal::Type::BaseModel
7
- # @!attribute eval_id
8
- # A unique evaluation ID.
9
- #
10
- # @return [String]
11
- required :eval_id, String
12
-
13
- # @!attribute evaluation_status
14
- # Status of the evaluation.
15
- #
16
- # @return [Symbol, Deeprails::Models::Evaluation::EvaluationStatus]
17
- required :evaluation_status, enum: -> { Deeprails::Evaluation::EvaluationStatus }
18
-
19
- # @!attribute model_input
20
- # A dictionary of inputs sent to the LLM to generate output. The dictionary must
21
- # contain at least `user_prompt` or `system_prompt` field. For
22
- # ground_truth_adherence guardrail metric, `ground_truth` should be provided.
23
- #
24
- # @return [Deeprails::Models::Evaluation::ModelInput]
25
- required :model_input, -> { Deeprails::Evaluation::ModelInput }
26
-
27
- # @!attribute model_output
28
- # Output generated by the LLM to be evaluated.
29
- #
30
- # @return [String]
31
- required :model_output, String
32
-
33
- # @!attribute run_mode
34
- # Run mode for the evaluation. The run mode allows the user to optimize for speed,
35
- # accuracy, and cost by determining which models are used to evaluate the event.
36
- #
37
- # @return [Symbol, Deeprails::Models::Evaluation::RunMode]
38
- required :run_mode, enum: -> { Deeprails::Evaluation::RunMode }
39
-
40
- # @!attribute created_at
41
- # The time the evaluation was created in UTC.
42
- #
43
- # @return [Time, nil]
44
- optional :created_at, Time
45
-
46
- # @!attribute end_timestamp
47
- # The time the evaluation completed in UTC.
48
- #
49
- # @return [Time, nil]
50
- optional :end_timestamp, Time
51
-
52
- # @!attribute error_message
53
- # Description of the error causing the evaluation to fail, if any.
54
- #
55
- # @return [String, nil]
56
- optional :error_message, String
57
-
58
- # @!attribute error_timestamp
59
- # The time the error causing the evaluation to fail was recorded.
60
- #
61
- # @return [Time, nil]
62
- optional :error_timestamp, Time
63
-
64
- # @!attribute evaluation_result
65
- # Evaluation result consisting of average scores and rationales for each of the
66
- # evaluated guardrail metrics.
67
- #
68
- # @return [Hash{Symbol=>Object}, nil]
69
- optional :evaluation_result, Deeprails::Internal::Type::HashOf[Deeprails::Internal::Type::Unknown]
70
-
71
- # @!attribute evaluation_total_cost
72
- # Total cost of the evaluation.
73
- #
74
- # @return [Float, nil]
75
- optional :evaluation_total_cost, Float
76
-
77
- # @!attribute guardrail_metrics
78
- # An array of guardrail metrics that the model input and output pair will be
79
- # evaluated on.
80
- #
81
- # @return [Array<Symbol, Deeprails::Models::Evaluation::GuardrailMetric>, nil]
82
- optional :guardrail_metrics,
83
- -> { Deeprails::Internal::Type::ArrayOf[enum: Deeprails::Evaluation::GuardrailMetric] }
84
-
85
- # @!attribute model_used
86
- # Model ID used to generate the output, like `gpt-4o` or `o3`.
87
- #
88
- # @return [String, nil]
89
- optional :model_used, String
90
-
91
- # @!attribute modified_at
92
- # The most recent time the evaluation was modified in UTC.
93
- #
94
- # @return [Time, nil]
95
- optional :modified_at, Time
96
-
97
- # @!attribute nametag
98
- # An optional, user-defined tag for the evaluation.
99
- #
100
- # @return [String, nil]
101
- optional :nametag, String
102
-
103
- # @!attribute progress
104
- # Evaluation progress. Values range between 0 and 100; 100 corresponds to a
105
- # completed `evaluation_status`.
106
- #
107
- # @return [Integer, nil]
108
- optional :progress, Integer
109
-
110
- # @!attribute start_timestamp
111
- # The time the evaluation started in UTC.
112
- #
113
- # @return [Time, nil]
114
- optional :start_timestamp, Time
115
-
116
- # @!method initialize(eval_id:, evaluation_status:, model_input:, model_output:, run_mode:, created_at: nil, end_timestamp: nil, error_message: nil, error_timestamp: nil, evaluation_result: nil, evaluation_total_cost: nil, guardrail_metrics: nil, model_used: nil, modified_at: nil, nametag: nil, progress: nil, start_timestamp: nil)
117
- # Some parameter documentations has been truncated, see
118
- # {Deeprails::Models::Evaluation} for more details.
119
- #
120
- # @param eval_id [String] A unique evaluation ID.
121
- #
122
- # @param evaluation_status [Symbol, Deeprails::Models::Evaluation::EvaluationStatus] Status of the evaluation.
123
- #
124
- # @param model_input [Deeprails::Models::Evaluation::ModelInput] A dictionary of inputs sent to the LLM to generate output. The dictionary must c
125
- #
126
- # @param model_output [String] Output generated by the LLM to be evaluated.
127
- #
128
- # @param run_mode [Symbol, Deeprails::Models::Evaluation::RunMode] Run mode for the evaluation. The run mode allows the user to optimize for speed
129
- #
130
- # @param created_at [Time] The time the evaluation was created in UTC.
131
- #
132
- # @param end_timestamp [Time] The time the evaluation completed in UTC.
133
- #
134
- # @param error_message [String] Description of the error causing the evaluation to fail, if any.
135
- #
136
- # @param error_timestamp [Time] The time the error causing the evaluation to fail was recorded.
137
- #
138
- # @param evaluation_result [Hash{Symbol=>Object}] Evaluation result consisting of average scores and rationales for each of the ev
139
- #
140
- # @param evaluation_total_cost [Float] Total cost of the evaluation.
141
- #
142
- # @param guardrail_metrics [Array<Symbol, Deeprails::Models::Evaluation::GuardrailMetric>] An array of guardrail metrics that the model input and output pair will be evalu
143
- #
144
- # @param model_used [String] Model ID used to generate the output, like `gpt-4o` or `o3`.
145
- #
146
- # @param modified_at [Time] The most recent time the evaluation was modified in UTC.
147
- #
148
- # @param nametag [String] An optional, user-defined tag for the evaluation.
149
- #
150
- # @param progress [Integer] Evaluation progress. Values range between 0 and 100; 100 corresponds to a compl
151
- #
152
- # @param start_timestamp [Time] The time the evaluation started in UTC.
153
-
154
- # Status of the evaluation.
155
- #
156
- # @see Deeprails::Models::Evaluation#evaluation_status
157
- module EvaluationStatus
158
- extend Deeprails::Internal::Type::Enum
159
-
160
- IN_PROGRESS = :in_progress
161
- COMPLETED = :completed
162
- CANCELED = :canceled
163
- QUEUED = :queued
164
- FAILED = :failed
165
-
166
- # @!method self.values
167
- # @return [Array<Symbol>]
168
- end
169
-
170
- # @see Deeprails::Models::Evaluation#model_input
171
- class ModelInput < Deeprails::Internal::Type::BaseModel
172
- # @!attribute ground_truth
173
- # The ground truth for evaluating Ground Truth Adherence guardrail.
174
- #
175
- # @return [String, nil]
176
- optional :ground_truth, String
177
-
178
- # @!attribute system_prompt
179
- # The system prompt used to generate the output.
180
- #
181
- # @return [String, nil]
182
- optional :system_prompt, String
183
-
184
- # @!attribute user_prompt
185
- # The user prompt used to generate the output.
186
- #
187
- # @return [String, nil]
188
- optional :user_prompt, String
189
-
190
- # @!method initialize(ground_truth: nil, system_prompt: nil, user_prompt: nil)
191
- # A dictionary of inputs sent to the LLM to generate output. The dictionary must
192
- # contain at least `user_prompt` or `system_prompt` field. For
193
- # ground_truth_adherence guardrail metric, `ground_truth` should be provided.
194
- #
195
- # @param ground_truth [String] The ground truth for evaluating Ground Truth Adherence guardrail.
196
- #
197
- # @param system_prompt [String] The system prompt used to generate the output.
198
- #
199
- # @param user_prompt [String] The user prompt used to generate the output.
200
- end
201
-
202
- # Run mode for the evaluation. The run mode allows the user to optimize for speed,
203
- # accuracy, and cost by determining which models are used to evaluate the event.
204
- #
205
- # @see Deeprails::Models::Evaluation#run_mode
206
- module RunMode
207
- extend Deeprails::Internal::Type::Enum
208
-
209
- PRECISION_PLUS = :precision_plus
210
- PRECISION = :precision
211
- SMART = :smart
212
- ECONOMY = :economy
213
-
214
- # @!method self.values
215
- # @return [Array<Symbol>]
216
- end
217
-
218
- module GuardrailMetric
219
- extend Deeprails::Internal::Type::Enum
220
-
221
- CORRECTNESS = :correctness
222
- COMPLETENESS = :completeness
223
- INSTRUCTION_ADHERENCE = :instruction_adherence
224
- CONTEXT_ADHERENCE = :context_adherence
225
- GROUND_TRUTH_ADHERENCE = :ground_truth_adherence
226
- COMPREHENSIVE_SAFETY = :comprehensive_safety
227
-
228
- # @!method self.values
229
- # @return [Array<Symbol>]
230
- end
231
- end
232
- end
233
- end
@@ -1,183 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Deeprails
4
- module Models
5
- # @see Deeprails::Resources::Monitor#retrieve
6
- class MonitorRetrieveResponse < Deeprails::Internal::Type::BaseModel
7
- # @!attribute success
8
- # Represents whether the request was completed successfully.
9
- #
10
- # @return [Boolean]
11
- required :success, Deeprails::Internal::Type::Boolean
12
-
13
- # @!attribute data
14
- #
15
- # @return [Deeprails::Models::MonitorRetrieveResponse::Data, nil]
16
- optional :data, -> { Deeprails::Models::MonitorRetrieveResponse::Data }
17
-
18
- # @!attribute message
19
- # The accompanying message for the request. Includes error details when
20
- # applicable.
21
- #
22
- # @return [String, nil]
23
- optional :message, String
24
-
25
- # @!method initialize(success:, data: nil, message: nil)
26
- # Some parameter documentations has been truncated, see
27
- # {Deeprails::Models::MonitorRetrieveResponse} for more details.
28
- #
29
- # Response wrapper for operations returning a MonitorDetailResponse.
30
- #
31
- # @param success [Boolean] Represents whether the request was completed successfully.
32
- #
33
- # @param data [Deeprails::Models::MonitorRetrieveResponse::Data]
34
- #
35
- # @param message [String] The accompanying message for the request. Includes error details when applicable
36
-
37
- # @see Deeprails::Models::MonitorRetrieveResponse#data
38
- class Data < Deeprails::Internal::Type::BaseModel
39
- # @!attribute monitor_id
40
- # A unique monitor ID.
41
- #
42
- # @return [String]
43
- required :monitor_id, String
44
-
45
- # @!attribute monitor_status
46
- # Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
47
- # longer record and evaluate events.
48
- #
49
- # @return [Symbol, Deeprails::Models::MonitorRetrieveResponse::Data::MonitorStatus]
50
- required :monitor_status, enum: -> { Deeprails::Models::MonitorRetrieveResponse::Data::MonitorStatus }
51
-
52
- # @!attribute name
53
- # Name of this monitor.
54
- #
55
- # @return [String]
56
- required :name, String
57
-
58
- # @!attribute created_at
59
- # The time the monitor was created in UTC.
60
- #
61
- # @return [Time, nil]
62
- optional :created_at, Time
63
-
64
- # @!attribute description
65
- # Description of this monitor.
66
- #
67
- # @return [String, nil]
68
- optional :description, String
69
-
70
- # @!attribute evaluations
71
- # An array of all evaluations performed by this monitor. Each one corresponds to a
72
- # separate monitor event.
73
- #
74
- # @return [Array<Deeprails::Models::Evaluation>, nil]
75
- optional :evaluations, -> { Deeprails::Internal::Type::ArrayOf[Deeprails::Evaluation] }
76
-
77
- # @!attribute stats
78
- # Contains five fields used for stats of this monitor: total evaluations,
79
- # completed evaluations, failed evaluations, queued evaluations, and in progress
80
- # evaluations.
81
- #
82
- # @return [Deeprails::Models::MonitorRetrieveResponse::Data::Stats, nil]
83
- optional :stats, -> { Deeprails::Models::MonitorRetrieveResponse::Data::Stats }
84
-
85
- # @!attribute updated_at
86
- # The most recent time the monitor was modified in UTC.
87
- #
88
- # @return [Time, nil]
89
- optional :updated_at, Time
90
-
91
- # @!attribute user_id
92
- # User ID of the user who created the monitor.
93
- #
94
- # @return [String, nil]
95
- optional :user_id, String
96
-
97
- # @!method initialize(monitor_id:, monitor_status:, name:, created_at: nil, description: nil, evaluations: nil, stats: nil, updated_at: nil, user_id: nil)
98
- # Some parameter documentations has been truncated, see
99
- # {Deeprails::Models::MonitorRetrieveResponse::Data} for more details.
100
- #
101
- # @param monitor_id [String] A unique monitor ID.
102
- #
103
- # @param monitor_status [Symbol, Deeprails::Models::MonitorRetrieveResponse::Data::MonitorStatus] Status of the monitor. Can be `active` or `inactive`. Inactive monitors no lon
104
- #
105
- # @param name [String] Name of this monitor.
106
- #
107
- # @param created_at [Time] The time the monitor was created in UTC.
108
- #
109
- # @param description [String] Description of this monitor.
110
- #
111
- # @param evaluations [Array<Deeprails::Models::Evaluation>] An array of all evaluations performed by this monitor. Each one corresponds to
112
- #
113
- # @param stats [Deeprails::Models::MonitorRetrieveResponse::Data::Stats] Contains five fields used for stats of this monitor: total evaluations, complete
114
- #
115
- # @param updated_at [Time] The most recent time the monitor was modified in UTC.
116
- #
117
- # @param user_id [String] User ID of the user who created the monitor.
118
-
119
- # Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
120
- # longer record and evaluate events.
121
- #
122
- # @see Deeprails::Models::MonitorRetrieveResponse::Data#monitor_status
123
- module MonitorStatus
124
- extend Deeprails::Internal::Type::Enum
125
-
126
- ACTIVE = :active
127
- INACTIVE = :inactive
128
-
129
- # @!method self.values
130
- # @return [Array<Symbol>]
131
- end
132
-
133
- # @see Deeprails::Models::MonitorRetrieveResponse::Data#stats
134
- class Stats < Deeprails::Internal::Type::BaseModel
135
- # @!attribute completed_evaluations
136
- # Number of evaluations that completed successfully.
137
- #
138
- # @return [Integer, nil]
139
- optional :completed_evaluations, Integer
140
-
141
- # @!attribute failed_evaluations
142
- # Number of evaluations that failed.
143
- #
144
- # @return [Integer, nil]
145
- optional :failed_evaluations, Integer
146
-
147
- # @!attribute in_progress_evaluations
148
- # Number of evaluations currently in progress.
149
- #
150
- # @return [Integer, nil]
151
- optional :in_progress_evaluations, Integer
152
-
153
- # @!attribute queued_evaluations
154
- # Number of evaluations currently queued.
155
- #
156
- # @return [Integer, nil]
157
- optional :queued_evaluations, Integer
158
-
159
- # @!attribute total_evaluations
160
- # Total number of evaluations performed by this monitor.
161
- #
162
- # @return [Integer, nil]
163
- optional :total_evaluations, Integer
164
-
165
- # @!method initialize(completed_evaluations: nil, failed_evaluations: nil, in_progress_evaluations: nil, queued_evaluations: nil, total_evaluations: nil)
166
- # Contains five fields used for stats of this monitor: total evaluations,
167
- # completed evaluations, failed evaluations, queued evaluations, and in progress
168
- # evaluations.
169
- #
170
- # @param completed_evaluations [Integer] Number of evaluations that completed successfully.
171
- #
172
- # @param failed_evaluations [Integer] Number of evaluations that failed.
173
- #
174
- # @param in_progress_evaluations [Integer] Number of evaluations currently in progress.
175
- #
176
- # @param queued_evaluations [Integer] Number of evaluations currently queued.
177
- #
178
- # @param total_evaluations [Integer] Total number of evaluations performed by this monitor.
179
- end
180
- end
181
- end
182
- end
183
- end