smplkit 1.0.16 → 1.0.17

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 (27) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/default_api.rb +305 -0
  3. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api_client.rb +441 -0
  4. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api_error.rb +58 -0
  5. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api_model_base.rb +88 -0
  6. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/configuration.rb +392 -0
  7. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb +327 -0
  8. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_list_links.rb +148 -0
  9. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_list_meta.rb +164 -0
  10. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_list_response.rb +203 -0
  11. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_resource.rb +202 -0
  12. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_response.rb +165 -0
  13. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/usage_resource.rb +203 -0
  14. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/usage_response.rb +166 -0
  15. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/version.rb +15 -0
  16. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client.rb +49 -0
  17. data/lib/smplkit/_generated/audit/spec/api/default_api_spec.rb +91 -0
  18. data/lib/smplkit/_generated/audit/spec/models/event_list_links_spec.rb +36 -0
  19. data/lib/smplkit/_generated/audit/spec/models/event_list_meta_spec.rb +36 -0
  20. data/lib/smplkit/_generated/audit/spec/models/event_list_response_spec.rb +48 -0
  21. data/lib/smplkit/_generated/audit/spec/models/event_resource_spec.rb +48 -0
  22. data/lib/smplkit/_generated/audit/spec/models/event_response_spec.rb +36 -0
  23. data/lib/smplkit/_generated/audit/spec/models/event_spec.rb +96 -0
  24. data/lib/smplkit/_generated/audit/spec/models/usage_resource_spec.rb +48 -0
  25. data/lib/smplkit/_generated/audit/spec/models/usage_response_spec.rb +36 -0
  26. data/lib/smplkit/_generated/audit/spec/spec_helper.rb +111 -0
  27. metadata +26 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99035d7c61e862475d8e1d5ee5db3fab24c59d14d2ef409cf46d89354c1203fa
4
- data.tar.gz: b4d498de8b004ffa1b1546cdee62101779764e999fa0dea1a7fea542441ddd59
3
+ metadata.gz: 22da5481c89c52426de98fac54b278a253202a6a3f28aa1e7a03eac0372ec790
4
+ data.tar.gz: '0190db86b79b56f478cab2c0c3814e48e5d7e48917afc6925ca42948277f7afe'
5
5
  SHA512:
6
- metadata.gz: 82ff49d99ff687b5362c5588dc493655b1cc3308f93e1da8fd80ee0eb1a75c0537c382c78a7f75105d04b7adc652ad25d252e4ae6bd987edeb75b67cf07a482c
7
- data.tar.gz: aa729bcdf21317113547e7db5debb143592bb263f34c38a29a6aba94caa02a93a0f7591ac6fa85bcc3a952f9b0312cf131d289af4580ac2b55f8e1fa38d68206
6
+ metadata.gz: 538c86b5c363d0e38f21e1c4b009a1cdec528ebc3b6bc9dba353bc5e6ea22f91613dfe15980b044bf4aec91e3c8bfa3d3282875b0889141842bbcb9264743371
7
+ data.tar.gz: 6ca828d6c3f0b111ca911328a4a7116dfbe4e5b8807b4a7aa56e9bc2f0a4088ae69f655c16b9d64d2307ed8aa6f4030b3baf34f63eff627ddbd6a21fc0672313
@@ -0,0 +1,305 @@
1
+ =begin
2
+ #smplkit Audit API
3
+
4
+ #Append-only change-history substrate for smpl.* resources and customer-application events. ADR-047.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module SmplkitGeneratedClient::Audit
16
+ class DefaultApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create Event
23
+ # Record an audit event for the authenticated account. Returns ``201 Created`` on first write, ``200 OK`` if the request was a duplicate (matched by ``Idempotency-Key`` or auto-derived key). Customers may not emit events whose ``resource_type`` starts with ``smpl.`` — that namespace is reserved for smplkit-emitted events about platform resources.
24
+ # @param event_response [EventResponse]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :idempotency_key
27
+ # @return [EventResponse]
28
+ def create_event(event_response, opts = {})
29
+ data, _status_code, _headers = create_event_with_http_info(event_response, opts)
30
+ data
31
+ end
32
+
33
+ # Create Event
34
+ # Record an audit event for the authenticated account. Returns ``201 Created`` on first write, ``200 OK`` if the request was a duplicate (matched by ``Idempotency-Key`` or auto-derived key). Customers may not emit events whose ``resource_type`` starts with ``smpl.`` — that namespace is reserved for smplkit-emitted events about platform resources.
35
+ # @param event_response [EventResponse]
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [String] :idempotency_key
38
+ # @return [Array<(EventResponse, Integer, Hash)>] EventResponse data, response status code and response headers
39
+ def create_event_with_http_info(event_response, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: DefaultApi.create_event ...'
42
+ end
43
+ # verify the required parameter 'event_response' is set
44
+ if @api_client.config.client_side_validation && event_response.nil?
45
+ fail ArgumentError, "Missing the required parameter 'event_response' when calling DefaultApi.create_event"
46
+ end
47
+ # resource path
48
+ local_var_path = '/api/v1/events'
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+
53
+ # header parameters
54
+ header_params = opts[:header_params] || {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
57
+ # HTTP header 'Content-Type'
58
+ content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
59
+ if !content_type.nil?
60
+ header_params['Content-Type'] = content_type
61
+ end
62
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
63
+
64
+ # form parameters
65
+ form_params = opts[:form_params] || {}
66
+
67
+ # http body (model)
68
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(event_response)
69
+
70
+ # return_type
71
+ return_type = opts[:debug_return_type] || 'EventResponse'
72
+
73
+ # auth_names
74
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
75
+
76
+ new_options = opts.merge(
77
+ :operation => :"DefaultApi.create_event",
78
+ :header_params => header_params,
79
+ :query_params => query_params,
80
+ :form_params => form_params,
81
+ :body => post_body,
82
+ :auth_names => auth_names,
83
+ :return_type => return_type
84
+ )
85
+
86
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug "API called: DefaultApi#create_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+
93
+ # Get Event
94
+ # Retrieve a single audit event by id. Returns 404 if no event with that id exists in the caller's account — RLS enforces tenant isolation; this endpoint never leaks the existence of another tenant's event.
95
+ # @param event_id [String]
96
+ # @param [Hash] opts the optional parameters
97
+ # @return [EventResponse]
98
+ def get_event(event_id, opts = {})
99
+ data, _status_code, _headers = get_event_with_http_info(event_id, opts)
100
+ data
101
+ end
102
+
103
+ # Get Event
104
+ # Retrieve a single audit event by id. Returns 404 if no event with that id exists in the caller&#39;s account — RLS enforces tenant isolation; this endpoint never leaks the existence of another tenant&#39;s event.
105
+ # @param event_id [String]
106
+ # @param [Hash] opts the optional parameters
107
+ # @return [Array<(EventResponse, Integer, Hash)>] EventResponse data, response status code and response headers
108
+ def get_event_with_http_info(event_id, opts = {})
109
+ if @api_client.config.debugging
110
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_event ...'
111
+ end
112
+ # verify the required parameter 'event_id' is set
113
+ if @api_client.config.client_side_validation && event_id.nil?
114
+ fail ArgumentError, "Missing the required parameter 'event_id' when calling DefaultApi.get_event"
115
+ end
116
+ # resource path
117
+ local_var_path = '/api/v1/events/{event_id}'.sub('{event_id}', CGI.escape(event_id.to_s))
118
+
119
+ # query parameters
120
+ query_params = opts[:query_params] || {}
121
+
122
+ # header parameters
123
+ header_params = opts[:header_params] || {}
124
+ # HTTP header 'Accept' (if needed)
125
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
126
+
127
+ # form parameters
128
+ form_params = opts[:form_params] || {}
129
+
130
+ # http body (model)
131
+ post_body = opts[:debug_body]
132
+
133
+ # return_type
134
+ return_type = opts[:debug_return_type] || 'EventResponse'
135
+
136
+ # auth_names
137
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
138
+
139
+ new_options = opts.merge(
140
+ :operation => :"DefaultApi.get_event",
141
+ :header_params => header_params,
142
+ :query_params => query_params,
143
+ :form_params => form_params,
144
+ :body => post_body,
145
+ :auth_names => auth_names,
146
+ :return_type => return_type
147
+ )
148
+
149
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
150
+ if @api_client.config.debugging
151
+ @api_client.config.logger.debug "API called: DefaultApi#get_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
152
+ end
153
+ return data, status_code, headers
154
+ end
155
+
156
+ # List Events
157
+ # List audit events for the authenticated account. Default sort is ``-created_at``; cursor pagination via ``page[after]`` (the opaque cursor returned in ``links.next``). Filters are exact-match except ``filter[occurred_at]`` which uses the platform's range notation (``[2026-01-01T00:00:00Z,*)``).
158
+ # @param [Hash] opts the optional parameters
159
+ # @option opts [String] :filter_occurred_at
160
+ # @option opts [String] :filter_actor_type
161
+ # @option opts [String] :filter_actor_id
162
+ # @option opts [String] :filter_action
163
+ # @option opts [String] :filter_resource_type
164
+ # @option opts [String] :filter_resource_id
165
+ # @option opts [Integer] :page_size
166
+ # @option opts [String] :page_after
167
+ # @return [EventListResponse]
168
+ def list_events(opts = {})
169
+ data, _status_code, _headers = list_events_with_http_info(opts)
170
+ data
171
+ end
172
+
173
+ # List Events
174
+ # List audit events for the authenticated account. Default sort is &#x60;&#x60;-created_at&#x60;&#x60;; cursor pagination via &#x60;&#x60;page[after]&#x60;&#x60; (the opaque cursor returned in &#x60;&#x60;links.next&#x60;&#x60;). Filters are exact-match except &#x60;&#x60;filter[occurred_at]&#x60;&#x60; which uses the platform&#39;s range notation (&#x60;&#x60;[2026-01-01T00:00:00Z,*)&#x60;&#x60;).
175
+ # @param [Hash] opts the optional parameters
176
+ # @option opts [String] :filter_occurred_at
177
+ # @option opts [String] :filter_actor_type
178
+ # @option opts [String] :filter_actor_id
179
+ # @option opts [String] :filter_action
180
+ # @option opts [String] :filter_resource_type
181
+ # @option opts [String] :filter_resource_id
182
+ # @option opts [Integer] :page_size
183
+ # @option opts [String] :page_after
184
+ # @return [Array<(EventListResponse, Integer, Hash)>] EventListResponse data, response status code and response headers
185
+ def list_events_with_http_info(opts = {})
186
+ if @api_client.config.debugging
187
+ @api_client.config.logger.debug 'Calling API: DefaultApi.list_events ...'
188
+ end
189
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
190
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling DefaultApi.list_events, must be greater than or equal to 1.'
191
+ end
192
+
193
+ # resource path
194
+ local_var_path = '/api/v1/events'
195
+
196
+ # query parameters
197
+ query_params = opts[:query_params] || {}
198
+ query_params[:'filter[occurred_at]'] = opts[:'filter_occurred_at'] if !opts[:'filter_occurred_at'].nil?
199
+ query_params[:'filter[actor_type]'] = opts[:'filter_actor_type'] if !opts[:'filter_actor_type'].nil?
200
+ query_params[:'filter[actor_id]'] = opts[:'filter_actor_id'] if !opts[:'filter_actor_id'].nil?
201
+ query_params[:'filter[action]'] = opts[:'filter_action'] if !opts[:'filter_action'].nil?
202
+ query_params[:'filter[resource_type]'] = opts[:'filter_resource_type'] if !opts[:'filter_resource_type'].nil?
203
+ query_params[:'filter[resource_id]'] = opts[:'filter_resource_id'] if !opts[:'filter_resource_id'].nil?
204
+ query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
205
+ query_params[:'page[after]'] = opts[:'page_after'] if !opts[:'page_after'].nil?
206
+
207
+ # header parameters
208
+ header_params = opts[:header_params] || {}
209
+ # HTTP header 'Accept' (if needed)
210
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
211
+
212
+ # form parameters
213
+ form_params = opts[:form_params] || {}
214
+
215
+ # http body (model)
216
+ post_body = opts[:debug_body]
217
+
218
+ # return_type
219
+ return_type = opts[:debug_return_type] || 'EventListResponse'
220
+
221
+ # auth_names
222
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
223
+
224
+ new_options = opts.merge(
225
+ :operation => :"DefaultApi.list_events",
226
+ :header_params => header_params,
227
+ :query_params => query_params,
228
+ :form_params => form_params,
229
+ :body => post_body,
230
+ :auth_names => auth_names,
231
+ :return_type => return_type
232
+ )
233
+
234
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
235
+ if @api_client.config.debugging
236
+ @api_client.config.logger.debug "API called: DefaultApi#list_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
237
+ end
238
+ return data, status_code, headers
239
+ end
240
+
241
+ # List Usage
242
+ # Current-period usage and quota for the audit product. Only ``filter[period]=current`` is supported; historical usage is a follow-up.
243
+ # @param filter_period [String]
244
+ # @param [Hash] opts the optional parameters
245
+ # @return [UsageResponse]
246
+ def list_usage(filter_period, opts = {})
247
+ data, _status_code, _headers = list_usage_with_http_info(filter_period, opts)
248
+ data
249
+ end
250
+
251
+ # List Usage
252
+ # Current-period usage and quota for the audit product. Only &#x60;&#x60;filter[period]&#x3D;current&#x60;&#x60; is supported; historical usage is a follow-up.
253
+ # @param filter_period [String]
254
+ # @param [Hash] opts the optional parameters
255
+ # @return [Array<(UsageResponse, Integer, Hash)>] UsageResponse data, response status code and response headers
256
+ def list_usage_with_http_info(filter_period, opts = {})
257
+ if @api_client.config.debugging
258
+ @api_client.config.logger.debug 'Calling API: DefaultApi.list_usage ...'
259
+ end
260
+ # verify the required parameter 'filter_period' is set
261
+ if @api_client.config.client_side_validation && filter_period.nil?
262
+ fail ArgumentError, "Missing the required parameter 'filter_period' when calling DefaultApi.list_usage"
263
+ end
264
+ # resource path
265
+ local_var_path = '/api/v1/usage'
266
+
267
+ # query parameters
268
+ query_params = opts[:query_params] || {}
269
+ query_params[:'filter[period]'] = filter_period
270
+
271
+ # header parameters
272
+ header_params = opts[:header_params] || {}
273
+ # HTTP header 'Accept' (if needed)
274
+ header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
275
+
276
+ # form parameters
277
+ form_params = opts[:form_params] || {}
278
+
279
+ # http body (model)
280
+ post_body = opts[:debug_body]
281
+
282
+ # return_type
283
+ return_type = opts[:debug_return_type] || 'UsageResponse'
284
+
285
+ # auth_names
286
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
287
+
288
+ new_options = opts.merge(
289
+ :operation => :"DefaultApi.list_usage",
290
+ :header_params => header_params,
291
+ :query_params => query_params,
292
+ :form_params => form_params,
293
+ :body => post_body,
294
+ :auth_names => auth_names,
295
+ :return_type => return_type
296
+ )
297
+
298
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
299
+ if @api_client.config.debugging
300
+ @api_client.config.logger.debug "API called: DefaultApi#list_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
301
+ end
302
+ return data, status_code, headers
303
+ end
304
+ end
305
+ end