smplkit 3.0.38 → 3.0.39
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.
- checksums.yaml +4 -4
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/{actions_api.rb → event_types_api.rb} +15 -15
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/events_api.rb +3 -3
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb +21 -21
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb +9 -9
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/{action_attributes.rb → event_type_attributes.rb} +21 -21
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/{action_list_response.rb → event_type_list_response.rb} +4 -4
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/{action_resource.rb → event_type_resource.rb} +6 -6
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client.rb +4 -4
- data/lib/smplkit/_generated/audit/spec/api/{actions_api_spec.rb → event_types_api_spec.rb} +11 -11
- data/lib/smplkit/_generated/audit/spec/api/events_api_spec.rb +1 -1
- data/lib/smplkit/_generated/audit/spec/models/event_search_request_spec.rb +1 -1
- data/lib/smplkit/_generated/audit/spec/models/event_spec.rb +1 -1
- data/lib/smplkit/_generated/audit/spec/models/{action_attributes_spec.rb → event_type_attributes_spec.rb} +7 -7
- data/lib/smplkit/_generated/audit/spec/models/{action_list_response_spec.rb → event_type_list_response_spec.rb} +6 -6
- data/lib/smplkit/_generated/audit/spec/models/{action_resource_spec.rb → event_type_resource_spec.rb} +6 -6
- data/lib/smplkit/audit/client.rb +2 -2
- data/lib/smplkit/audit/{actions.rb → event_types.rb} +8 -8
- data/lib/smplkit/audit/events.rb +5 -5
- data/lib/smplkit/audit/models.rb +15 -15
- data/lib/smplkit.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 11488119828863f978e3b7c3780b41c9e87cbc02809ceb1284fa6dc7574f374f
|
|
4
|
+
data.tar.gz: 1fef1181d7ae0a83b4c9d82ec7b36ad9c353c714d16cf9757b1a5f9718e21272
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: abcea7cbf71f8a05c542c30e0b4b024213220e4ba1b07708a08ea2332f4b6b9b2f87e6d6c2eec77a29c47d29252126f6aa0fd74568574f6d5a7f79398ff69814
|
|
7
|
+
data.tar.gz: 11982cc8a2d20fac366e597610bf3e36f6dbcad72bd10eb579430c7a76a718bc15881991e6b2558e2f5a381f0ad1923fa2b91a9744174600b089c5252e74d07f
|
data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/{actions_api.rb → event_types_api.rb}
RENAMED
|
@@ -13,45 +13,45 @@ Generator version: 7.22.0
|
|
|
13
13
|
require 'cgi'
|
|
14
14
|
|
|
15
15
|
module SmplkitGeneratedClient::Audit
|
|
16
|
-
class
|
|
16
|
+
class EventTypesApi
|
|
17
17
|
attr_accessor :api_client
|
|
18
18
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
-
# List
|
|
23
|
-
# List the distinct `
|
|
22
|
+
# List Event Types
|
|
23
|
+
# List the distinct `event_type` slugs recorded for this account. Default sort is `key` ascending; pass `sort=-key` for descending. Without `filter[resource_type]`, returns one row per distinct event_type. With `filter[resource_type]`, returns the event_types recorded for that specific resource type.
|
|
24
24
|
# @param [Hash] opts the optional parameters
|
|
25
25
|
# @option opts [String] :filter_resource_type
|
|
26
26
|
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `key`, `-key`. (default to 'key')
|
|
27
27
|
# @option opts [Integer] :page_number 1-based page number to return. Optional; defaults to `1` when omitted. Must be `>= 1` — requests with a smaller value are rejected with a 400 error. (default to 1)
|
|
28
28
|
# @option opts [Integer] :page_size Number of items per page. Optional; defaults to `1000` when omitted. Must be between `1` and `1000` inclusive — requests outside that range are rejected with a 400 error. (default to 1000)
|
|
29
29
|
# @option opts [Boolean] :meta_total When `true`, the response's `meta.pagination` block includes `total` (the total number of matching items across all pages) and `total_pages`. Computing these requires an extra `COUNT` query, so omit (or pass `false`) when the totals are not needed. Defaults to `false`. (default to false)
|
|
30
|
-
# @return [
|
|
31
|
-
def
|
|
32
|
-
data, _status_code, _headers =
|
|
30
|
+
# @return [EventTypeListResponse]
|
|
31
|
+
def list_event_types(opts = {})
|
|
32
|
+
data, _status_code, _headers = list_event_types_with_http_info(opts)
|
|
33
33
|
data
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
# List
|
|
37
|
-
# List the distinct `
|
|
36
|
+
# List Event Types
|
|
37
|
+
# List the distinct `event_type` slugs recorded for this account. Default sort is `key` ascending; pass `sort=-key` for descending. Without `filter[resource_type]`, returns one row per distinct event_type. With `filter[resource_type]`, returns the event_types recorded for that specific resource type.
|
|
38
38
|
# @param [Hash] opts the optional parameters
|
|
39
39
|
# @option opts [String] :filter_resource_type
|
|
40
40
|
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `key`, `-key`. (default to 'key')
|
|
41
41
|
# @option opts [Integer] :page_number 1-based page number to return. Optional; defaults to `1` when omitted. Must be `>= 1` — requests with a smaller value are rejected with a 400 error. (default to 1)
|
|
42
42
|
# @option opts [Integer] :page_size Number of items per page. Optional; defaults to `1000` when omitted. Must be between `1` and `1000` inclusive — requests outside that range are rejected with a 400 error. (default to 1000)
|
|
43
43
|
# @option opts [Boolean] :meta_total When `true`, the response's `meta.pagination` block includes `total` (the total number of matching items across all pages) and `total_pages`. Computing these requires an extra `COUNT` query, so omit (or pass `false`) when the totals are not needed. Defaults to `false`. (default to false)
|
|
44
|
-
# @return [Array<(
|
|
45
|
-
def
|
|
44
|
+
# @return [Array<(EventTypeListResponse, Integer, Hash)>] EventTypeListResponse data, response status code and response headers
|
|
45
|
+
def list_event_types_with_http_info(opts = {})
|
|
46
46
|
if @api_client.config.debugging
|
|
47
|
-
@api_client.config.logger.debug 'Calling API:
|
|
47
|
+
@api_client.config.logger.debug 'Calling API: EventTypesApi.list_event_types ...'
|
|
48
48
|
end
|
|
49
49
|
allowable_values = ["key", "-key"]
|
|
50
50
|
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
51
51
|
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
52
52
|
end
|
|
53
53
|
# resource path
|
|
54
|
-
local_var_path = '/api/v1/
|
|
54
|
+
local_var_path = '/api/v1/event_types'
|
|
55
55
|
|
|
56
56
|
# query parameters
|
|
57
57
|
query_params = opts[:query_params] || {}
|
|
@@ -73,13 +73,13 @@ module SmplkitGeneratedClient::Audit
|
|
|
73
73
|
post_body = opts[:debug_body]
|
|
74
74
|
|
|
75
75
|
# return_type
|
|
76
|
-
return_type = opts[:debug_return_type] || '
|
|
76
|
+
return_type = opts[:debug_return_type] || 'EventTypeListResponse'
|
|
77
77
|
|
|
78
78
|
# auth_names
|
|
79
79
|
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
80
80
|
|
|
81
81
|
new_options = opts.merge(
|
|
82
|
-
:operation => :"
|
|
82
|
+
:operation => :"EventTypesApi.list_event_types",
|
|
83
83
|
:header_params => header_params,
|
|
84
84
|
:query_params => query_params,
|
|
85
85
|
:form_params => form_params,
|
|
@@ -90,7 +90,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
90
90
|
|
|
91
91
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
92
92
|
if @api_client.config.debugging
|
|
93
|
-
@api_client.config.logger.debug "API called:
|
|
93
|
+
@api_client.config.logger.debug "API called: EventTypesApi#list_event_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
94
94
|
end
|
|
95
95
|
return data, status_code, headers
|
|
96
96
|
end
|
|
@@ -88,7 +88,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
88
88
|
# @option opts [String] :filter_occurred_at
|
|
89
89
|
# @option opts [String] :filter_actor_type
|
|
90
90
|
# @option opts [String] :filter_actor_id
|
|
91
|
-
# @option opts [String] :
|
|
91
|
+
# @option opts [String] :filter_event_type
|
|
92
92
|
# @option opts [String] :filter_resource_type
|
|
93
93
|
# @option opts [String] :filter_resource_id
|
|
94
94
|
# @option opts [String] :filter_search Case-insensitive substring match against `resource_id` or `description`. Use `filter[resource_id]` for an exact match on `resource_id`.
|
|
@@ -108,7 +108,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
108
108
|
# @option opts [String] :filter_occurred_at
|
|
109
109
|
# @option opts [String] :filter_actor_type
|
|
110
110
|
# @option opts [String] :filter_actor_id
|
|
111
|
-
# @option opts [String] :
|
|
111
|
+
# @option opts [String] :filter_event_type
|
|
112
112
|
# @option opts [String] :filter_resource_type
|
|
113
113
|
# @option opts [String] :filter_resource_id
|
|
114
114
|
# @option opts [String] :filter_search Case-insensitive substring match against `resource_id` or `description`. Use `filter[resource_id]` for an exact match on `resource_id`.
|
|
@@ -137,7 +137,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
137
137
|
query_params[:'filter[occurred_at]'] = opts[:'filter_occurred_at'] if !opts[:'filter_occurred_at'].nil?
|
|
138
138
|
query_params[:'filter[actor_type]'] = opts[:'filter_actor_type'] if !opts[:'filter_actor_type'].nil?
|
|
139
139
|
query_params[:'filter[actor_id]'] = opts[:'filter_actor_id'] if !opts[:'filter_actor_id'].nil?
|
|
140
|
-
query_params[:'filter[
|
|
140
|
+
query_params[:'filter[event_type]'] = opts[:'filter_event_type'] if !opts[:'filter_event_type'].nil?
|
|
141
141
|
query_params[:'filter[resource_type]'] = opts[:'filter_resource_type'] if !opts[:'filter_resource_type'].nil?
|
|
142
142
|
query_params[:'filter[resource_id]'] = opts[:'filter_resource_id'] if !opts[:'filter_resource_id'].nil?
|
|
143
143
|
query_params[:'filter[search]'] = opts[:'filter_search'] if !opts[:'filter_search'].nil?
|
|
@@ -17,7 +17,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
17
17
|
# An audit event — a record that something happened, attributed to an actor and a resource. When recording a snapshot of the resource at the time of the event, place it inside `data`. smplkit's own integrations nest it under `data.snapshot`, but the slot is yours to use however you like.
|
|
18
18
|
class Event < ApiModelBase
|
|
19
19
|
# What happened, e.g. `user.created`. Any non-empty string.
|
|
20
|
-
attr_accessor :
|
|
20
|
+
attr_accessor :event_type
|
|
21
21
|
|
|
22
22
|
# Kind of resource the event is about, e.g. `user`. Any non-empty string.
|
|
23
23
|
attr_accessor :resource_type
|
|
@@ -55,7 +55,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
55
55
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
56
56
|
def self.attribute_map
|
|
57
57
|
{
|
|
58
|
-
:'
|
|
58
|
+
:'event_type' => :'event_type',
|
|
59
59
|
:'resource_type' => :'resource_type',
|
|
60
60
|
:'resource_id' => :'resource_id',
|
|
61
61
|
:'description' => :'description',
|
|
@@ -83,7 +83,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
83
83
|
# Attribute type mapping.
|
|
84
84
|
def self.openapi_types
|
|
85
85
|
{
|
|
86
|
-
:'
|
|
86
|
+
:'event_type' => :'String',
|
|
87
87
|
:'resource_type' => :'String',
|
|
88
88
|
:'resource_id' => :'String',
|
|
89
89
|
:'description' => :'String',
|
|
@@ -127,10 +127,10 @@ module SmplkitGeneratedClient::Audit
|
|
|
127
127
|
h[k.to_sym] = v
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
if attributes.key?(:'
|
|
131
|
-
self.
|
|
130
|
+
if attributes.key?(:'event_type')
|
|
131
|
+
self.event_type = attributes[:'event_type']
|
|
132
132
|
else
|
|
133
|
-
self.
|
|
133
|
+
self.event_type = nil
|
|
134
134
|
end
|
|
135
135
|
|
|
136
136
|
if attributes.key?(:'resource_type')
|
|
@@ -191,12 +191,12 @@ module SmplkitGeneratedClient::Audit
|
|
|
191
191
|
def list_invalid_properties
|
|
192
192
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
193
193
|
invalid_properties = Array.new
|
|
194
|
-
if @
|
|
195
|
-
invalid_properties.push('invalid value for "
|
|
194
|
+
if @event_type.nil?
|
|
195
|
+
invalid_properties.push('invalid value for "event_type", event_type cannot be nil.')
|
|
196
196
|
end
|
|
197
197
|
|
|
198
|
-
if @
|
|
199
|
-
invalid_properties.push('invalid value for "
|
|
198
|
+
if @event_type.to_s.length < 1
|
|
199
|
+
invalid_properties.push('invalid value for "event_type", the character length must be greater than or equal to 1.')
|
|
200
200
|
end
|
|
201
201
|
|
|
202
202
|
if @resource_type.nil?
|
|
@@ -222,8 +222,8 @@ module SmplkitGeneratedClient::Audit
|
|
|
222
222
|
# @return true if the model is valid
|
|
223
223
|
def valid?
|
|
224
224
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
225
|
-
return false if @
|
|
226
|
-
return false if @
|
|
225
|
+
return false if @event_type.nil?
|
|
226
|
+
return false if @event_type.to_s.length < 1
|
|
227
227
|
return false if @resource_type.nil?
|
|
228
228
|
return false if @resource_type.to_s.length < 1
|
|
229
229
|
return false if @resource_id.nil?
|
|
@@ -232,17 +232,17 @@ module SmplkitGeneratedClient::Audit
|
|
|
232
232
|
end
|
|
233
233
|
|
|
234
234
|
# Custom attribute writer method with validation
|
|
235
|
-
# @param [Object]
|
|
236
|
-
def
|
|
237
|
-
if
|
|
238
|
-
fail ArgumentError, '
|
|
235
|
+
# @param [Object] event_type Value to be assigned
|
|
236
|
+
def event_type=(event_type)
|
|
237
|
+
if event_type.nil?
|
|
238
|
+
fail ArgumentError, 'event_type cannot be nil'
|
|
239
239
|
end
|
|
240
240
|
|
|
241
|
-
if
|
|
242
|
-
fail ArgumentError, 'invalid value for "
|
|
241
|
+
if event_type.to_s.length < 1
|
|
242
|
+
fail ArgumentError, 'invalid value for "event_type", the character length must be greater than or equal to 1.'
|
|
243
243
|
end
|
|
244
244
|
|
|
245
|
-
@
|
|
245
|
+
@event_type = event_type
|
|
246
246
|
end
|
|
247
247
|
|
|
248
248
|
# Custom attribute writer method with validation
|
|
@@ -278,7 +278,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
278
278
|
def ==(o)
|
|
279
279
|
return true if self.equal?(o)
|
|
280
280
|
self.class == o.class &&
|
|
281
|
-
|
|
281
|
+
event_type == o.event_type &&
|
|
282
282
|
resource_type == o.resource_type &&
|
|
283
283
|
resource_id == o.resource_id &&
|
|
284
284
|
description == o.description &&
|
|
@@ -301,7 +301,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
301
301
|
# Calculates hash code according to all attributes.
|
|
302
302
|
# @return [Integer] Hash code
|
|
303
303
|
def hash
|
|
304
|
-
[
|
|
304
|
+
[event_type, resource_type, resource_id, description, occurred_at, actor_type, actor_id, actor_label, data, do_not_forward, created_at, idempotency_key].hash
|
|
305
305
|
end
|
|
306
306
|
|
|
307
307
|
# Builds the object from hash
|
|
@@ -19,8 +19,8 @@ module SmplkitGeneratedClient::Audit
|
|
|
19
19
|
# Optional JSON Logic expression evaluated against each row after column filters narrow the candidate set. Null, absent, or an empty object disables JSON Logic filtering. When present, the search is silently capped to the last 30 days by `occurred_at` (intersected with any explicit `filter[occurred_at]` the caller supplied).
|
|
20
20
|
attr_accessor :filter
|
|
21
21
|
|
|
22
|
-
# Exact match on the event's `
|
|
23
|
-
attr_accessor :
|
|
22
|
+
# Exact match on the event's `event_type` field.
|
|
23
|
+
attr_accessor :filter_event_type
|
|
24
24
|
|
|
25
25
|
# Exact match on the event's `resource_type` field.
|
|
26
26
|
attr_accessor :filter_resource_type
|
|
@@ -56,7 +56,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
56
56
|
def self.attribute_map
|
|
57
57
|
{
|
|
58
58
|
:'filter' => :'filter',
|
|
59
|
-
:'
|
|
59
|
+
:'filter_event_type' => :'filter[event_type]',
|
|
60
60
|
:'filter_resource_type' => :'filter[resource_type]',
|
|
61
61
|
:'filter_resource_id' => :'filter[resource_id]',
|
|
62
62
|
:'filter_actor_type' => :'filter[actor_type]',
|
|
@@ -84,7 +84,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
84
84
|
def self.openapi_types
|
|
85
85
|
{
|
|
86
86
|
:'filter' => :'Hash<String, Object>',
|
|
87
|
-
:'
|
|
87
|
+
:'filter_event_type' => :'String',
|
|
88
88
|
:'filter_resource_type' => :'String',
|
|
89
89
|
:'filter_resource_id' => :'String',
|
|
90
90
|
:'filter_actor_type' => :'String',
|
|
@@ -102,7 +102,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
102
102
|
def self.openapi_nullable
|
|
103
103
|
Set.new([
|
|
104
104
|
:'filter',
|
|
105
|
-
:'
|
|
105
|
+
:'filter_event_type',
|
|
106
106
|
:'filter_resource_type',
|
|
107
107
|
:'filter_resource_id',
|
|
108
108
|
:'filter_actor_type',
|
|
@@ -136,8 +136,8 @@ module SmplkitGeneratedClient::Audit
|
|
|
136
136
|
end
|
|
137
137
|
end
|
|
138
138
|
|
|
139
|
-
if attributes.key?(:'
|
|
140
|
-
self.
|
|
139
|
+
if attributes.key?(:'filter_event_type')
|
|
140
|
+
self.filter_event_type = attributes[:'filter_event_type']
|
|
141
141
|
end
|
|
142
142
|
|
|
143
143
|
if attributes.key?(:'filter_resource_type')
|
|
@@ -234,7 +234,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
234
234
|
return true if self.equal?(o)
|
|
235
235
|
self.class == o.class &&
|
|
236
236
|
filter == o.filter &&
|
|
237
|
-
|
|
237
|
+
filter_event_type == o.filter_event_type &&
|
|
238
238
|
filter_resource_type == o.filter_resource_type &&
|
|
239
239
|
filter_resource_id == o.filter_resource_id &&
|
|
240
240
|
filter_actor_type == o.filter_actor_type &&
|
|
@@ -256,7 +256,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
256
256
|
# Calculates hash code according to all attributes.
|
|
257
257
|
# @return [Integer] Hash code
|
|
258
258
|
def hash
|
|
259
|
-
[filter,
|
|
259
|
+
[filter, filter_event_type, filter_resource_type, filter_resource_id, filter_actor_type, filter_actor_id, filter_occurred_at, filter_search, filter_do_not_forward, page_size, page_after, sort].hash
|
|
260
260
|
end
|
|
261
261
|
|
|
262
262
|
# Builds the object from hash
|
|
@@ -14,17 +14,17 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
class
|
|
18
|
-
# The
|
|
19
|
-
attr_accessor :
|
|
17
|
+
class EventTypeAttributes < ApiModelBase
|
|
18
|
+
# The event_type slug. Same as the JSON:API ``id``.
|
|
19
|
+
attr_accessor :event_type
|
|
20
20
|
|
|
21
|
-
# First sighting of this
|
|
21
|
+
# First sighting of this event_type for the account. When the request includes ``filter[resource_type]``, this is the first sighting of the (event_type, resource_type) triple rather than the event_type overall.
|
|
22
22
|
attr_accessor :created_at
|
|
23
23
|
|
|
24
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
25
|
def self.attribute_map
|
|
26
26
|
{
|
|
27
|
-
:'
|
|
27
|
+
:'event_type' => :'event_type',
|
|
28
28
|
:'created_at' => :'created_at'
|
|
29
29
|
}
|
|
30
30
|
end
|
|
@@ -42,7 +42,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
42
42
|
# Attribute type mapping.
|
|
43
43
|
def self.openapi_types
|
|
44
44
|
{
|
|
45
|
-
:'
|
|
45
|
+
:'event_type' => :'String',
|
|
46
46
|
:'created_at' => :'Time'
|
|
47
47
|
}
|
|
48
48
|
end
|
|
@@ -57,22 +57,22 @@ module SmplkitGeneratedClient::Audit
|
|
|
57
57
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
58
|
def initialize(attributes = {})
|
|
59
59
|
if (!attributes.is_a?(Hash))
|
|
60
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::EventTypeAttributes` initialize method"
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
64
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
65
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
66
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::EventTypeAttributes`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
68
|
end
|
|
69
69
|
h[k.to_sym] = v
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
if attributes.key?(:'
|
|
73
|
-
self.
|
|
72
|
+
if attributes.key?(:'event_type')
|
|
73
|
+
self.event_type = attributes[:'event_type']
|
|
74
74
|
else
|
|
75
|
-
self.
|
|
75
|
+
self.event_type = nil
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
if attributes.key?(:'created_at')
|
|
@@ -87,8 +87,8 @@ module SmplkitGeneratedClient::Audit
|
|
|
87
87
|
def list_invalid_properties
|
|
88
88
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
89
89
|
invalid_properties = Array.new
|
|
90
|
-
if @
|
|
91
|
-
invalid_properties.push('invalid value for "
|
|
90
|
+
if @event_type.nil?
|
|
91
|
+
invalid_properties.push('invalid value for "event_type", event_type cannot be nil.')
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
if @created_at.nil?
|
|
@@ -102,19 +102,19 @@ module SmplkitGeneratedClient::Audit
|
|
|
102
102
|
# @return true if the model is valid
|
|
103
103
|
def valid?
|
|
104
104
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
105
|
-
return false if @
|
|
105
|
+
return false if @event_type.nil?
|
|
106
106
|
return false if @created_at.nil?
|
|
107
107
|
true
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
# Custom attribute writer method with validation
|
|
111
|
-
# @param [Object]
|
|
112
|
-
def
|
|
113
|
-
if
|
|
114
|
-
fail ArgumentError, '
|
|
111
|
+
# @param [Object] event_type Value to be assigned
|
|
112
|
+
def event_type=(event_type)
|
|
113
|
+
if event_type.nil?
|
|
114
|
+
fail ArgumentError, 'event_type cannot be nil'
|
|
115
115
|
end
|
|
116
116
|
|
|
117
|
-
@
|
|
117
|
+
@event_type = event_type
|
|
118
118
|
end
|
|
119
119
|
|
|
120
120
|
# Custom attribute writer method with validation
|
|
@@ -132,7 +132,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
132
132
|
def ==(o)
|
|
133
133
|
return true if self.equal?(o)
|
|
134
134
|
self.class == o.class &&
|
|
135
|
-
|
|
135
|
+
event_type == o.event_type &&
|
|
136
136
|
created_at == o.created_at
|
|
137
137
|
end
|
|
138
138
|
|
|
@@ -145,7 +145,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
145
145
|
# Calculates hash code according to all attributes.
|
|
146
146
|
# @return [Integer] Hash code
|
|
147
147
|
def hash
|
|
148
|
-
[
|
|
148
|
+
[event_type, created_at].hash
|
|
149
149
|
end
|
|
150
150
|
|
|
151
151
|
# Builds the object from hash
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
class
|
|
17
|
+
class EventTypeListResponse < ApiModelBase
|
|
18
18
|
attr_accessor :data
|
|
19
19
|
|
|
20
20
|
attr_accessor :meta
|
|
@@ -40,7 +40,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
40
40
|
# Attribute type mapping.
|
|
41
41
|
def self.openapi_types
|
|
42
42
|
{
|
|
43
|
-
:'data' => :'Array<
|
|
43
|
+
:'data' => :'Array<EventTypeResource>',
|
|
44
44
|
:'meta' => :'ListMeta'
|
|
45
45
|
}
|
|
46
46
|
end
|
|
@@ -55,14 +55,14 @@ module SmplkitGeneratedClient::Audit
|
|
|
55
55
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
56
|
def initialize(attributes = {})
|
|
57
57
|
if (!attributes.is_a?(Hash))
|
|
58
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::EventTypeListResponse` initialize method"
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
62
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
63
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
64
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::EventTypeListResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
66
|
end
|
|
67
67
|
h[k.to_sym] = v
|
|
68
68
|
}
|
|
@@ -14,8 +14,8 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
class
|
|
18
|
-
# The
|
|
17
|
+
class EventTypeResource < ApiModelBase
|
|
18
|
+
# The event_type slug.
|
|
19
19
|
attr_accessor :id
|
|
20
20
|
|
|
21
21
|
attr_accessor :type
|
|
@@ -46,7 +46,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
46
46
|
{
|
|
47
47
|
:'id' => :'String',
|
|
48
48
|
:'type' => :'String',
|
|
49
|
-
:'attributes' => :'
|
|
49
|
+
:'attributes' => :'EventTypeAttributes'
|
|
50
50
|
}
|
|
51
51
|
end
|
|
52
52
|
|
|
@@ -60,14 +60,14 @@ module SmplkitGeneratedClient::Audit
|
|
|
60
60
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
61
61
|
def initialize(attributes = {})
|
|
62
62
|
if (!attributes.is_a?(Hash))
|
|
63
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::
|
|
63
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::EventTypeResource` initialize method"
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
67
67
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
68
68
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
69
69
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
70
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::
|
|
70
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::EventTypeResource`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
71
71
|
end
|
|
72
72
|
h[k.to_sym] = v
|
|
73
73
|
}
|
|
@@ -81,7 +81,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
81
81
|
if attributes.key?(:'type')
|
|
82
82
|
self.type = attributes[:'type']
|
|
83
83
|
else
|
|
84
|
-
self.type = '
|
|
84
|
+
self.type = 'event_type'
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
if attributes.key?(:'attributes')
|
|
@@ -18,9 +18,6 @@ require 'smplkit_audit_client/version'
|
|
|
18
18
|
require 'smplkit_audit_client/configuration'
|
|
19
19
|
|
|
20
20
|
# Models
|
|
21
|
-
require 'smplkit_audit_client/models/action_attributes'
|
|
22
|
-
require 'smplkit_audit_client/models/action_list_response'
|
|
23
|
-
require 'smplkit_audit_client/models/action_resource'
|
|
24
21
|
require 'smplkit_audit_client/models/event'
|
|
25
22
|
require 'smplkit_audit_client/models/event_list_links'
|
|
26
23
|
require 'smplkit_audit_client/models/event_list_meta'
|
|
@@ -33,6 +30,9 @@ require 'smplkit_audit_client/models/event_search_list_meta'
|
|
|
33
30
|
require 'smplkit_audit_client/models/event_search_request'
|
|
34
31
|
require 'smplkit_audit_client/models/event_search_response'
|
|
35
32
|
require 'smplkit_audit_client/models/event_search_scan_meta'
|
|
33
|
+
require 'smplkit_audit_client/models/event_type_attributes'
|
|
34
|
+
require 'smplkit_audit_client/models/event_type_list_response'
|
|
35
|
+
require 'smplkit_audit_client/models/event_type_resource'
|
|
36
36
|
require 'smplkit_audit_client/models/forwarder'
|
|
37
37
|
require 'smplkit_audit_client/models/forwarder_delivery'
|
|
38
38
|
require 'smplkit_audit_client/models/forwarder_delivery_list_links'
|
|
@@ -68,7 +68,7 @@ require 'smplkit_audit_client/models/usage_resource'
|
|
|
68
68
|
require 'smplkit_audit_client/models/usage_response'
|
|
69
69
|
|
|
70
70
|
# APIs
|
|
71
|
-
require 'smplkit_audit_client/api/
|
|
71
|
+
require 'smplkit_audit_client/api/event_types_api'
|
|
72
72
|
require 'smplkit_audit_client/api/events_api'
|
|
73
73
|
require 'smplkit_audit_client/api/forwarder_types_api'
|
|
74
74
|
require 'smplkit_audit_client/api/forwarders_api'
|
|
@@ -13,36 +13,36 @@ Generator version: 7.22.0
|
|
|
13
13
|
require 'spec_helper'
|
|
14
14
|
require 'json'
|
|
15
15
|
|
|
16
|
-
# Unit tests for SmplkitGeneratedClient::Audit::
|
|
16
|
+
# Unit tests for SmplkitGeneratedClient::Audit::EventTypesApi
|
|
17
17
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
18
|
# Please update as you see appropriate
|
|
19
|
-
describe '
|
|
19
|
+
describe 'EventTypesApi' do
|
|
20
20
|
before do
|
|
21
21
|
# run before each test
|
|
22
|
-
@api_instance = SmplkitGeneratedClient::Audit::
|
|
22
|
+
@api_instance = SmplkitGeneratedClient::Audit::EventTypesApi.new
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
after do
|
|
26
26
|
# run after each test
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
describe 'test an instance of
|
|
30
|
-
it 'should create an instance of
|
|
31
|
-
expect(@api_instance).to be_instance_of(SmplkitGeneratedClient::Audit::
|
|
29
|
+
describe 'test an instance of EventTypesApi' do
|
|
30
|
+
it 'should create an instance of EventTypesApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(SmplkitGeneratedClient::Audit::EventTypesApi)
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
# unit tests for
|
|
36
|
-
# List
|
|
37
|
-
# List the distinct `
|
|
35
|
+
# unit tests for list_event_types
|
|
36
|
+
# List Event Types
|
|
37
|
+
# List the distinct `event_type` slugs recorded for this account. Default sort is `key` ascending; pass `sort=-key` for descending. Without `filter[resource_type]`, returns one row per distinct event_type. With `filter[resource_type]`, returns the event_types recorded for that specific resource type.
|
|
38
38
|
# @param [Hash] opts the optional parameters
|
|
39
39
|
# @option opts [String] :filter_resource_type
|
|
40
40
|
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `key`, `-key`.
|
|
41
41
|
# @option opts [Integer] :page_number 1-based page number to return. Optional; defaults to `1` when omitted. Must be `>= 1` — requests with a smaller value are rejected with a 400 error.
|
|
42
42
|
# @option opts [Integer] :page_size Number of items per page. Optional; defaults to `1000` when omitted. Must be between `1` and `1000` inclusive — requests outside that range are rejected with a 400 error.
|
|
43
43
|
# @option opts [Boolean] :meta_total When `true`, the response's `meta.pagination` block includes `total` (the total number of matching items across all pages) and `total_pages`. Computing these requires an extra `COUNT` query, so omit (or pass `false`) when the totals are not needed. Defaults to `false`.
|
|
44
|
-
# @return [
|
|
45
|
-
describe '
|
|
44
|
+
# @return [EventTypeListResponse]
|
|
45
|
+
describe 'list_event_types test' do
|
|
46
46
|
it 'should work' do
|
|
47
47
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
48
48
|
end
|
|
@@ -51,7 +51,7 @@ describe 'EventsApi' do
|
|
|
51
51
|
# @option opts [String] :filter_occurred_at
|
|
52
52
|
# @option opts [String] :filter_actor_type
|
|
53
53
|
# @option opts [String] :filter_actor_id
|
|
54
|
-
# @option opts [String] :
|
|
54
|
+
# @option opts [String] :filter_event_type
|
|
55
55
|
# @option opts [String] :filter_resource_type
|
|
56
56
|
# @option opts [String] :filter_resource_id
|
|
57
57
|
# @option opts [String] :filter_search Case-insensitive substring match against `resource_id` or `description`. Use `filter[resource_id]` for an exact match on `resource_id`.
|
|
@@ -33,7 +33,7 @@ describe SmplkitGeneratedClient::Audit::EventSearchRequest do
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
describe 'test attribute "
|
|
36
|
+
describe 'test attribute "filter_event_type"' do
|
|
37
37
|
it 'should work' do
|
|
38
38
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
39
|
end
|
|
@@ -27,7 +27,7 @@ describe SmplkitGeneratedClient::Audit::Event do
|
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
describe 'test attribute "
|
|
30
|
+
describe 'test attribute "event_type"' do
|
|
31
31
|
it 'should work' do
|
|
32
32
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
33
|
end
|
|
@@ -14,20 +14,20 @@ require 'spec_helper'
|
|
|
14
14
|
require 'json'
|
|
15
15
|
require 'date'
|
|
16
16
|
|
|
17
|
-
# Unit tests for SmplkitGeneratedClient::Audit::
|
|
17
|
+
# Unit tests for SmplkitGeneratedClient::Audit::EventTypeAttributes
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
|
-
describe SmplkitGeneratedClient::Audit::
|
|
21
|
-
#let(:instance) { SmplkitGeneratedClient::Audit::
|
|
20
|
+
describe SmplkitGeneratedClient::Audit::EventTypeAttributes do
|
|
21
|
+
#let(:instance) { SmplkitGeneratedClient::Audit::EventTypeAttributes.new }
|
|
22
22
|
|
|
23
|
-
describe 'test an instance of
|
|
24
|
-
it 'should create an instance of
|
|
23
|
+
describe 'test an instance of EventTypeAttributes' do
|
|
24
|
+
it 'should create an instance of EventTypeAttributes' do
|
|
25
25
|
# uncomment below to test the instance creation
|
|
26
|
-
#expect(instance).to be_instance_of(SmplkitGeneratedClient::Audit::
|
|
26
|
+
#expect(instance).to be_instance_of(SmplkitGeneratedClient::Audit::EventTypeAttributes)
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
describe 'test attribute "
|
|
30
|
+
describe 'test attribute "event_type"' do
|
|
31
31
|
it 'should work' do
|
|
32
32
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
33
|
end
|
|
@@ -14,16 +14,16 @@ require 'spec_helper'
|
|
|
14
14
|
require 'json'
|
|
15
15
|
require 'date'
|
|
16
16
|
|
|
17
|
-
# Unit tests for SmplkitGeneratedClient::Audit::
|
|
17
|
+
# Unit tests for SmplkitGeneratedClient::Audit::EventTypeListResponse
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
|
-
describe SmplkitGeneratedClient::Audit::
|
|
21
|
-
#let(:instance) { SmplkitGeneratedClient::Audit::
|
|
20
|
+
describe SmplkitGeneratedClient::Audit::EventTypeListResponse do
|
|
21
|
+
#let(:instance) { SmplkitGeneratedClient::Audit::EventTypeListResponse.new }
|
|
22
22
|
|
|
23
|
-
describe 'test an instance of
|
|
24
|
-
it 'should create an instance of
|
|
23
|
+
describe 'test an instance of EventTypeListResponse' do
|
|
24
|
+
it 'should create an instance of EventTypeListResponse' do
|
|
25
25
|
# uncomment below to test the instance creation
|
|
26
|
-
#expect(instance).to be_instance_of(SmplkitGeneratedClient::Audit::
|
|
26
|
+
#expect(instance).to be_instance_of(SmplkitGeneratedClient::Audit::EventTypeListResponse)
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
@@ -14,16 +14,16 @@ require 'spec_helper'
|
|
|
14
14
|
require 'json'
|
|
15
15
|
require 'date'
|
|
16
16
|
|
|
17
|
-
# Unit tests for SmplkitGeneratedClient::Audit::
|
|
17
|
+
# Unit tests for SmplkitGeneratedClient::Audit::EventTypeResource
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
|
-
describe SmplkitGeneratedClient::Audit::
|
|
21
|
-
#let(:instance) { SmplkitGeneratedClient::Audit::
|
|
20
|
+
describe SmplkitGeneratedClient::Audit::EventTypeResource do
|
|
21
|
+
#let(:instance) { SmplkitGeneratedClient::Audit::EventTypeResource.new }
|
|
22
22
|
|
|
23
|
-
describe 'test an instance of
|
|
24
|
-
it 'should create an instance of
|
|
23
|
+
describe 'test an instance of EventTypeResource' do
|
|
24
|
+
it 'should create an instance of EventTypeResource' do
|
|
25
25
|
# uncomment below to test the instance creation
|
|
26
|
-
#expect(instance).to be_instance_of(SmplkitGeneratedClient::Audit::
|
|
26
|
+
#expect(instance).to be_instance_of(SmplkitGeneratedClient::Audit::EventTypeResource)
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
data/lib/smplkit/audit/client.rb
CHANGED
|
@@ -12,7 +12,7 @@ module Smplkit
|
|
|
12
12
|
# SIEM forwarder CRUD lives on {Smplkit::ManagementClient} under
|
|
13
13
|
# +mgmt.audit.forwarders.*+.
|
|
14
14
|
class AuditClient
|
|
15
|
-
attr_reader :events, :resource_types, :
|
|
15
|
+
attr_reader :events, :resource_types, :event_types
|
|
16
16
|
|
|
17
17
|
SDK_OWNED_HEADERS = %w[authorization content-type user-agent].freeze
|
|
18
18
|
|
|
@@ -29,7 +29,7 @@ module Smplkit
|
|
|
29
29
|
end
|
|
30
30
|
@events = Events.new(SmplkitGeneratedClient::Audit::EventsApi.new(api_client))
|
|
31
31
|
@resource_types = ResourceTypes.new(SmplkitGeneratedClient::Audit::ResourceTypesApi.new(api_client))
|
|
32
|
-
@
|
|
32
|
+
@event_types = EventTypes.new(SmplkitGeneratedClient::Audit::EventTypesApi.new(api_client))
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def _close
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
module Smplkit
|
|
4
4
|
module Audit
|
|
5
|
-
# +client.audit.
|
|
5
|
+
# +client.audit.event_types.list+ — distinct +event_type+ slugs seen for
|
|
6
6
|
# the account.
|
|
7
7
|
#
|
|
8
8
|
# Without +filter_resource_type+, returns one row per distinct
|
|
9
|
-
#
|
|
10
|
-
# once. With the filter, returns the
|
|
9
|
+
# event type — an event type recorded with multiple resource_types appears
|
|
10
|
+
# once. With the filter, returns the event types seen with that
|
|
11
11
|
# specific resource_type, powering the cascading-filter behavior
|
|
12
12
|
# on the Activity tab.
|
|
13
13
|
#
|
|
14
14
|
# ADR-047 §2.5. Sorted alphabetically; offset pagination
|
|
15
15
|
# (+page_number+ / +page_size+) per ADR-014.
|
|
16
|
-
class
|
|
16
|
+
class EventTypes
|
|
17
17
|
def initialize(api)
|
|
18
18
|
@api = api
|
|
19
19
|
end
|
|
@@ -25,12 +25,12 @@ module Smplkit
|
|
|
25
25
|
opts[:page_size] = page_size if page_size
|
|
26
26
|
opts[:meta_total] = meta_total unless meta_total.nil?
|
|
27
27
|
|
|
28
|
-
resp = Smplkit::Audit.call_api { @api.
|
|
29
|
-
rows = (resp.data || []).map { |r|
|
|
30
|
-
|
|
28
|
+
resp = Smplkit::Audit.call_api { @api.list_event_types(opts) }
|
|
29
|
+
rows = (resp.data || []).map { |r| EventType.from_resource(r) }
|
|
30
|
+
EventTypeListPage.new(rows, Smplkit::Audit.extract_pagination(resp.meta))
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
EventTypeListPage = Struct.new(:event_types, :pagination)
|
|
35
35
|
end
|
|
36
36
|
end
|
data/lib/smplkit/audit/events.rb
CHANGED
|
@@ -24,11 +24,11 @@ module Smplkit
|
|
|
24
24
|
# Customer attempts to record events with +resource_type+ starting
|
|
25
25
|
# with +smpl.+ are rejected by the server with a 403 (the buffer
|
|
26
26
|
# logs and drops permanent failures).
|
|
27
|
-
def record(
|
|
27
|
+
def record(event_type:, resource_type:, resource_id:,
|
|
28
28
|
occurred_at: nil, actor_type: nil, actor_id: nil,
|
|
29
29
|
actor_label: nil, data: nil, idempotency_key: nil,
|
|
30
30
|
do_not_forward: false)
|
|
31
|
-
raise ArgumentError, "
|
|
31
|
+
raise ArgumentError, "event_type is required" if event_type.nil? || event_type.to_s.empty?
|
|
32
32
|
raise ArgumentError, "resource_type is required" if resource_type.nil? || resource_type.to_s.empty?
|
|
33
33
|
raise ArgumentError, "resource_id is required" if resource_id.nil? || resource_id.to_s.empty?
|
|
34
34
|
|
|
@@ -48,7 +48,7 @@ module Smplkit
|
|
|
48
48
|
# is required-non-null in the OpenAPI schema). Always default to
|
|
49
49
|
# an empty hash so users who omit ``data:`` don't trip the gate.
|
|
50
50
|
attrs = SmplkitGeneratedClient::Audit::Event.new(
|
|
51
|
-
|
|
51
|
+
event_type: event_type,
|
|
52
52
|
resource_type: resource_type,
|
|
53
53
|
resource_id: resource_id,
|
|
54
54
|
occurred_at: normalized_occurred_at,
|
|
@@ -79,7 +79,7 @@ module Smplkit
|
|
|
79
79
|
# List events with filters and cursor pagination. Returns a
|
|
80
80
|
# +Smplkit::Audit::ListEventsPage+ whose +#events+ is the page and
|
|
81
81
|
# +#next_cursor+ is the opaque token for the next page (or nil).
|
|
82
|
-
def list(
|
|
82
|
+
def list(event_type: nil, resource_type: nil, resource_id: nil,
|
|
83
83
|
actor_type: nil, actor_id: nil, occurred_at_range: nil,
|
|
84
84
|
search: nil, page_size: nil, page_after: nil)
|
|
85
85
|
# Generated client opts use snake_case keys that internally map
|
|
@@ -88,7 +88,7 @@ module Smplkit
|
|
|
88
88
|
# underscores these silently fall through and the filters never
|
|
89
89
|
# reach the server.
|
|
90
90
|
opts = {}
|
|
91
|
-
opts[:
|
|
91
|
+
opts[:filter_event_type] = event_type if event_type
|
|
92
92
|
opts[:filter_resource_type] = resource_type if resource_type
|
|
93
93
|
opts[:filter_resource_id] = resource_id if resource_id
|
|
94
94
|
opts[:filter_actor_type] = actor_type if actor_type
|
data/lib/smplkit/audit/models.rb
CHANGED
|
@@ -143,14 +143,14 @@ module Smplkit
|
|
|
143
143
|
#
|
|
144
144
|
# @!attribute [rw] id
|
|
145
145
|
# @return [String] Server-assigned UUID for this event.
|
|
146
|
-
# @!attribute [rw]
|
|
147
|
-
# @return [String]
|
|
146
|
+
# @!attribute [rw] event_type
|
|
147
|
+
# @return [String] Event type slug — e.g. +"user.created"+, +"invoice.paid"+.
|
|
148
148
|
# @!attribute [rw] resource_type
|
|
149
|
-
# @return [String] Type of resource the
|
|
149
|
+
# @return [String] Type of resource the event operated on — e.g. +"invoice"+.
|
|
150
150
|
# @!attribute [rw] resource_id
|
|
151
|
-
# @return [String] Customer-facing id of the resource the
|
|
151
|
+
# @return [String] Customer-facing id of the resource the event operated on.
|
|
152
152
|
# @!attribute [rw] occurred_at
|
|
153
|
-
# @return [String] ISO-8601 timestamp of when the
|
|
153
|
+
# @return [String] ISO-8601 timestamp of when the event happened, as reported by the source.
|
|
154
154
|
# @!attribute [rw] created_at
|
|
155
155
|
# @return [String] ISO-8601 timestamp of when the audit service first ingested this event.
|
|
156
156
|
# @!attribute [rw] actor_type
|
|
@@ -166,7 +166,7 @@ module Smplkit
|
|
|
166
166
|
# @!attribute [rw] do_not_forward
|
|
167
167
|
# @return [Boolean] When +true+, skip SIEM forwarder delivery regardless of any matching filter.
|
|
168
168
|
AuditEvent = Struct.new(
|
|
169
|
-
:id, :
|
|
169
|
+
:id, :event_type, :resource_type, :resource_id,
|
|
170
170
|
:occurred_at, :created_at,
|
|
171
171
|
:actor_type, :actor_id, :actor_label,
|
|
172
172
|
:data, :idempotency_key, :do_not_forward,
|
|
@@ -176,7 +176,7 @@ module Smplkit
|
|
|
176
176
|
attrs = resource.attributes
|
|
177
177
|
new(
|
|
178
178
|
id: resource.id,
|
|
179
|
-
|
|
179
|
+
event_type: attrs.event_type,
|
|
180
180
|
resource_type: attrs.resource_type,
|
|
181
181
|
resource_id: attrs.resource_id,
|
|
182
182
|
occurred_at: attrs.occurred_at,
|
|
@@ -215,25 +215,25 @@ module Smplkit
|
|
|
215
215
|
end
|
|
216
216
|
end
|
|
217
217
|
|
|
218
|
-
# A distinct +
|
|
218
|
+
# A distinct +event_type+ slug seen for the account.
|
|
219
219
|
#
|
|
220
|
-
# Same shape as {ResourceType} — +id+ and +
|
|
220
|
+
# Same shape as {ResourceType} — +id+ and +event_type+ are the same value.
|
|
221
221
|
# +created_at+ is the earliest sighting; when the parent list call
|
|
222
222
|
# filtered by +resource_type+, this is the first sighting of that
|
|
223
|
-
# specific (
|
|
223
|
+
# specific (event_type, resource_type) triple, not the event type overall.
|
|
224
224
|
#
|
|
225
225
|
# @!attribute [rw] id
|
|
226
|
-
# @return [String] JSON:API resource id (same as +
|
|
227
|
-
# @!attribute [rw]
|
|
228
|
-
# @return [String] The distinct
|
|
226
|
+
# @return [String] JSON:API resource id (same as +event_type+).
|
|
227
|
+
# @!attribute [rw] event_type
|
|
228
|
+
# @return [String] The distinct event type slug.
|
|
229
229
|
# @!attribute [rw] created_at
|
|
230
230
|
# @return [String] ISO-8601 timestamp of the earliest sighting for this slug.
|
|
231
|
-
|
|
231
|
+
EventType = Struct.new(:id, :event_type, :created_at, keyword_init: true) do
|
|
232
232
|
def self.from_resource(resource)
|
|
233
233
|
attrs = resource.attributes
|
|
234
234
|
new(
|
|
235
235
|
id: resource.id,
|
|
236
|
-
|
|
236
|
+
event_type: attrs.event_type || resource.id,
|
|
237
237
|
created_at: attrs.created_at
|
|
238
238
|
)
|
|
239
239
|
end
|
data/lib/smplkit.rb
CHANGED
|
@@ -63,7 +63,7 @@ require_relative "smplkit/audit/models"
|
|
|
63
63
|
require_relative "smplkit/audit/buffer"
|
|
64
64
|
require_relative "smplkit/audit/events"
|
|
65
65
|
require_relative "smplkit/audit/resource_types"
|
|
66
|
-
require_relative "smplkit/audit/
|
|
66
|
+
require_relative "smplkit/audit/event_types"
|
|
67
67
|
require_relative "smplkit/audit/client"
|
|
68
68
|
require_relative "smplkit/management/types"
|
|
69
69
|
require_relative "smplkit/management/models"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: smplkit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.
|
|
4
|
+
version: 3.0.39
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Smpl Solutions LLC
|
|
@@ -427,7 +427,7 @@ files:
|
|
|
427
427
|
- lib/smplkit/_generated/app/spec/models/verify_email_request_spec.rb
|
|
428
428
|
- lib/smplkit/_generated/app/spec/spec_helper.rb
|
|
429
429
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client.rb
|
|
430
|
-
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/
|
|
430
|
+
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/event_types_api.rb
|
|
431
431
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/events_api.rb
|
|
432
432
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/forwarder_types_api.rb
|
|
433
433
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/forwarders_api.rb
|
|
@@ -438,9 +438,6 @@ files:
|
|
|
438
438
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/api_error.rb
|
|
439
439
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/api_model_base.rb
|
|
440
440
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/configuration.rb
|
|
441
|
-
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/action_attributes.rb
|
|
442
|
-
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/action_list_response.rb
|
|
443
|
-
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/action_resource.rb
|
|
444
441
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb
|
|
445
442
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_list_links.rb
|
|
446
443
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_list_meta.rb
|
|
@@ -453,6 +450,9 @@ files:
|
|
|
453
450
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_request.rb
|
|
454
451
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_response.rb
|
|
455
452
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_search_scan_meta.rb
|
|
453
|
+
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_type_attributes.rb
|
|
454
|
+
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_type_list_response.rb
|
|
455
|
+
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_type_resource.rb
|
|
456
456
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder.rb
|
|
457
457
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery.rb
|
|
458
458
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_list_links.rb
|
|
@@ -487,16 +487,13 @@ files:
|
|
|
487
487
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/usage_resource.rb
|
|
488
488
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/usage_response.rb
|
|
489
489
|
- lib/smplkit/_generated/audit/lib/smplkit_audit_client/version.rb
|
|
490
|
-
- lib/smplkit/_generated/audit/spec/api/
|
|
490
|
+
- lib/smplkit/_generated/audit/spec/api/event_types_api_spec.rb
|
|
491
491
|
- lib/smplkit/_generated/audit/spec/api/events_api_spec.rb
|
|
492
492
|
- lib/smplkit/_generated/audit/spec/api/forwarder_types_api_spec.rb
|
|
493
493
|
- lib/smplkit/_generated/audit/spec/api/forwarders_api_spec.rb
|
|
494
494
|
- lib/smplkit/_generated/audit/spec/api/resource_types_api_spec.rb
|
|
495
495
|
- lib/smplkit/_generated/audit/spec/api/search_api_spec.rb
|
|
496
496
|
- lib/smplkit/_generated/audit/spec/api/usage_api_spec.rb
|
|
497
|
-
- lib/smplkit/_generated/audit/spec/models/action_attributes_spec.rb
|
|
498
|
-
- lib/smplkit/_generated/audit/spec/models/action_list_response_spec.rb
|
|
499
|
-
- lib/smplkit/_generated/audit/spec/models/action_resource_spec.rb
|
|
500
497
|
- lib/smplkit/_generated/audit/spec/models/event_list_links_spec.rb
|
|
501
498
|
- lib/smplkit/_generated/audit/spec/models/event_list_meta_spec.rb
|
|
502
499
|
- lib/smplkit/_generated/audit/spec/models/event_list_response_spec.rb
|
|
@@ -509,6 +506,9 @@ files:
|
|
|
509
506
|
- lib/smplkit/_generated/audit/spec/models/event_search_response_spec.rb
|
|
510
507
|
- lib/smplkit/_generated/audit/spec/models/event_search_scan_meta_spec.rb
|
|
511
508
|
- lib/smplkit/_generated/audit/spec/models/event_spec.rb
|
|
509
|
+
- lib/smplkit/_generated/audit/spec/models/event_type_attributes_spec.rb
|
|
510
|
+
- lib/smplkit/_generated/audit/spec/models/event_type_list_response_spec.rb
|
|
511
|
+
- lib/smplkit/_generated/audit/spec/models/event_type_resource_spec.rb
|
|
512
512
|
- lib/smplkit/_generated/audit/spec/models/forwarder_delivery_list_links_spec.rb
|
|
513
513
|
- lib/smplkit/_generated/audit/spec/models/forwarder_delivery_list_meta_spec.rb
|
|
514
514
|
- lib/smplkit/_generated/audit/spec/models/forwarder_delivery_list_response_spec.rb
|
|
@@ -712,9 +712,9 @@ files:
|
|
|
712
712
|
- lib/smplkit/_generated/logging/spec/models/usage_list_response_spec.rb
|
|
713
713
|
- lib/smplkit/_generated/logging/spec/models/usage_resource_spec.rb
|
|
714
714
|
- lib/smplkit/_generated/logging/spec/spec_helper.rb
|
|
715
|
-
- lib/smplkit/audit/actions.rb
|
|
716
715
|
- lib/smplkit/audit/buffer.rb
|
|
717
716
|
- lib/smplkit/audit/client.rb
|
|
717
|
+
- lib/smplkit/audit/event_types.rb
|
|
718
718
|
- lib/smplkit/audit/events.rb
|
|
719
719
|
- lib/smplkit/audit/models.rb
|
|
720
720
|
- lib/smplkit/audit/resource_types.rb
|