smplkit 2.0.14 → 2.0.15
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 +2 -69
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/events_api.rb +17 -17
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/forwarders_api.rb +36 -36
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/functions_api.rb +2 -2
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/resource_types_api.rb +2 -72
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/usage_api.rb +4 -4
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb +12 -2
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_list_response.rb +1 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_request.rb +165 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_resource.rb +2 -18
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_response.rb +1 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder.rb +17 -17
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery.rb +11 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_list_response.rb +1 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_resource.rb +1 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_response.rb +1 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_http.rb +40 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_list_response.rb +1 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_request.rb +165 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_resource.rb +2 -17
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_response.rb +1 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/http_header.rb +3 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/retry_failed_deliveries_summary.rb +4 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_request.rb +41 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_response.rb +7 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/usage_attributes.rb +4 -1
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/wipe_response.rb +3 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/wipe_tables_summary.rb +7 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client.rb +2 -0
- data/lib/smplkit/_generated/audit/spec/api/actions_api_spec.rb +1 -14
- data/lib/smplkit/_generated/audit/spec/api/events_api_spec.rb +5 -5
- data/lib/smplkit/_generated/audit/spec/api/forwarders_api_spec.rb +11 -11
- data/lib/smplkit/_generated/audit/spec/api/functions_api_spec.rb +1 -1
- data/lib/smplkit/_generated/audit/spec/api/resource_types_api_spec.rb +1 -15
- data/lib/smplkit/_generated/audit/spec/api/usage_api_spec.rb +2 -2
- data/lib/smplkit/_generated/audit/spec/models/event_request_spec.rb +36 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_http_spec.rb +4 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_request_spec.rb +36 -0
- data/lib/smplkit/_generated/audit/spec/models/forwarder_spec.rb +0 -6
- data/lib/smplkit/_generated/audit/spec/models/test_forwarder_request_spec.rb +4 -0
- data/lib/smplkit/audit/actions.rb +35 -0
- data/lib/smplkit/audit/client.rb +11 -9
- data/lib/smplkit/audit/events.rb +8 -45
- data/lib/smplkit/audit/models.rb +197 -0
- data/lib/smplkit/audit/resource_types.rb +30 -0
- data/lib/smplkit/errors.rb +5 -0
- data/lib/smplkit/management/audit.rb +111 -0
- data/lib/smplkit/management/client.rb +4 -1
- data/lib/smplkit.rb +7 -5
- metadata +9 -3
- data/lib/smplkit/audit/forwarders.rb +0 -282
- data/lib/smplkit/audit/functions.rb +0 -58
|
@@ -14,6 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
+
# JSON:API resource envelope for a forwarder. `id` must not be specified for create requests (the server assigns it).
|
|
17
18
|
class ForwarderResource < ApiModelBase
|
|
18
19
|
attr_accessor :id
|
|
19
20
|
|
|
@@ -52,6 +53,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
52
53
|
# List of attributes with nullable: true
|
|
53
54
|
def self.openapi_nullable
|
|
54
55
|
Set.new([
|
|
56
|
+
:'id',
|
|
55
57
|
])
|
|
56
58
|
end
|
|
57
59
|
|
|
@@ -73,8 +75,6 @@ module SmplkitGeneratedClient::Audit
|
|
|
73
75
|
|
|
74
76
|
if attributes.key?(:'id')
|
|
75
77
|
self.id = attributes[:'id']
|
|
76
|
-
else
|
|
77
|
-
self.id = nil
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
if attributes.key?(:'type')
|
|
@@ -95,10 +95,6 @@ module SmplkitGeneratedClient::Audit
|
|
|
95
95
|
def list_invalid_properties
|
|
96
96
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
97
97
|
invalid_properties = Array.new
|
|
98
|
-
if @id.nil?
|
|
99
|
-
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
100
|
-
end
|
|
101
|
-
|
|
102
98
|
if @attributes.nil?
|
|
103
99
|
invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
|
|
104
100
|
end
|
|
@@ -110,21 +106,10 @@ module SmplkitGeneratedClient::Audit
|
|
|
110
106
|
# @return true if the model is valid
|
|
111
107
|
def valid?
|
|
112
108
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
113
|
-
return false if @id.nil?
|
|
114
109
|
return false if @attributes.nil?
|
|
115
110
|
true
|
|
116
111
|
end
|
|
117
112
|
|
|
118
|
-
# Custom attribute writer method with validation
|
|
119
|
-
# @param [Object] id Value to be assigned
|
|
120
|
-
def id=(id)
|
|
121
|
-
if id.nil?
|
|
122
|
-
fail ArgumentError, 'id cannot be nil'
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
@id = id
|
|
126
|
-
end
|
|
127
|
-
|
|
128
113
|
# Custom attribute writer method with validation
|
|
129
114
|
# @param [Object] attributes Value to be assigned
|
|
130
115
|
def attributes=(attributes)
|
|
@@ -14,10 +14,12 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
# A single header
|
|
17
|
+
# A single HTTP header attached to a forwarder delivery request.
|
|
18
18
|
class HttpHeader < ApiModelBase
|
|
19
|
+
# Header name.
|
|
19
20
|
attr_accessor :name
|
|
20
21
|
|
|
22
|
+
# Header value.
|
|
21
23
|
attr_accessor :value
|
|
22
24
|
|
|
23
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/retry_failed_deliveries_summary.rb
CHANGED
|
@@ -14,11 +14,15 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
+
# Counts returned by the retry-failed-deliveries action.
|
|
17
18
|
class RetryFailedDeliveriesSummary < ApiModelBase
|
|
19
|
+
# Number of failed deliveries that were re-attempted.
|
|
18
20
|
attr_accessor :attempted
|
|
19
21
|
|
|
22
|
+
# Number of re-attempts that succeeded.
|
|
20
23
|
attr_accessor :succeeded
|
|
21
24
|
|
|
25
|
+
# Number of re-attempts that failed again.
|
|
22
26
|
attr_accessor :failed
|
|
23
27
|
|
|
24
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -14,20 +14,48 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
#
|
|
17
|
+
# Inputs to the test-forwarder action. Mirrors a forwarder's HTTP destination configuration with one addition: `timeout_ms`, applied per-request and capped server-side.
|
|
18
18
|
class TestForwarderRequest < ApiModelBase
|
|
19
|
+
# HTTP method used for the test request.
|
|
19
20
|
attr_accessor :method
|
|
20
21
|
|
|
22
|
+
# Destination URL.
|
|
21
23
|
attr_accessor :url
|
|
22
24
|
|
|
25
|
+
# HTTP headers attached to the test request.
|
|
23
26
|
attr_accessor :headers
|
|
24
27
|
|
|
28
|
+
# Request body. If omitted, an empty body is sent.
|
|
25
29
|
attr_accessor :body
|
|
26
30
|
|
|
31
|
+
# HTTP response status that indicates success. Either a specific status code (e.g. `200`, `204`) or a status class (`1xx`, `2xx`, `3xx`, `4xx`, `5xx`).
|
|
27
32
|
attr_accessor :success_status
|
|
28
33
|
|
|
34
|
+
# Per-request timeout in milliseconds. Capped at 30 seconds.
|
|
29
35
|
attr_accessor :timeout_ms
|
|
30
36
|
|
|
37
|
+
class EnumAttributeValidator
|
|
38
|
+
attr_reader :datatype
|
|
39
|
+
attr_reader :allowable_values
|
|
40
|
+
|
|
41
|
+
def initialize(datatype, allowable_values)
|
|
42
|
+
@allowable_values = allowable_values.map do |value|
|
|
43
|
+
case datatype.to_s
|
|
44
|
+
when /Integer/i
|
|
45
|
+
value.to_i
|
|
46
|
+
when /Float/i
|
|
47
|
+
value.to_f
|
|
48
|
+
else
|
|
49
|
+
value
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def valid?(value)
|
|
55
|
+
!value || allowable_values.include?(value)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
31
59
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
60
|
def self.attribute_map
|
|
33
61
|
{
|
|
@@ -159,6 +187,8 @@ module SmplkitGeneratedClient::Audit
|
|
|
159
187
|
# @return true if the model is valid
|
|
160
188
|
def valid?
|
|
161
189
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
190
|
+
method_validator = EnumAttributeValidator.new('String', ["GET", "POST", "PUT", "PATCH", "DELETE"])
|
|
191
|
+
return false unless method_validator.valid?(@method)
|
|
162
192
|
return false if @url.nil?
|
|
163
193
|
return false if @url.to_s.length > 2048
|
|
164
194
|
return false if @url.to_s.length < 1
|
|
@@ -169,6 +199,16 @@ module SmplkitGeneratedClient::Audit
|
|
|
169
199
|
true
|
|
170
200
|
end
|
|
171
201
|
|
|
202
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
203
|
+
# @param [Object] method Object to be assigned
|
|
204
|
+
def method=(method)
|
|
205
|
+
validator = EnumAttributeValidator.new('String', ["GET", "POST", "PUT", "PATCH", "DELETE"])
|
|
206
|
+
unless validator.valid?(method)
|
|
207
|
+
fail ArgumentError, "invalid value for \"method\", must be one of #{validator.allowable_values}."
|
|
208
|
+
end
|
|
209
|
+
@method = method
|
|
210
|
+
end
|
|
211
|
+
|
|
172
212
|
# Custom attribute writer method with validation
|
|
173
213
|
# @param [Object] url Value to be assigned
|
|
174
214
|
def url=(url)
|
data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_response.rb
CHANGED
|
@@ -14,18 +14,24 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
#
|
|
17
|
+
# Result of a test-forwarder execution.
|
|
18
18
|
class TestForwarderResponse < ApiModelBase
|
|
19
|
+
# True if the destination responded with a status matching `success_status`.
|
|
19
20
|
attr_accessor :succeeded
|
|
20
21
|
|
|
22
|
+
# HTTP status code returned by the destination.
|
|
21
23
|
attr_accessor :response_status
|
|
22
24
|
|
|
25
|
+
# Headers returned by the destination.
|
|
23
26
|
attr_accessor :response_headers
|
|
24
27
|
|
|
28
|
+
# Response body returned by the destination.
|
|
25
29
|
attr_accessor :response_body
|
|
26
30
|
|
|
31
|
+
# Elapsed time of the request in milliseconds.
|
|
27
32
|
attr_accessor :latency_ms
|
|
28
33
|
|
|
34
|
+
# Error message if the request did not complete.
|
|
29
35
|
attr_accessor :error
|
|
30
36
|
|
|
31
37
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -14,12 +14,15 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
#
|
|
17
|
+
# Usage counter for a single metered limit.
|
|
18
18
|
class UsageAttributes < ApiModelBase
|
|
19
|
+
# Identifier of the metered limit, e.g. `audit.customer_events_per_month`.
|
|
19
20
|
attr_accessor :limit_key
|
|
20
21
|
|
|
22
|
+
# Period the counter covers. `current` is the only supported value.
|
|
21
23
|
attr_accessor :period
|
|
22
24
|
|
|
25
|
+
# Count for the period.
|
|
23
26
|
attr_accessor :value
|
|
24
27
|
|
|
25
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -14,11 +14,14 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
+
# Summary of a completed wipe action.
|
|
17
18
|
class WipeResponse < ApiModelBase
|
|
19
|
+
# Always `true` for a successful wipe.
|
|
18
20
|
attr_accessor :wiped
|
|
19
21
|
|
|
20
22
|
attr_accessor :tables
|
|
21
23
|
|
|
24
|
+
# When the wipe completed.
|
|
22
25
|
attr_accessor :completed_at
|
|
23
26
|
|
|
24
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -14,17 +14,24 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
+
# Counts of records deleted, broken down by record kind.
|
|
17
18
|
class WipeTablesSummary < ApiModelBase
|
|
19
|
+
# Number of audit events deleted.
|
|
18
20
|
attr_accessor :audit_event
|
|
19
21
|
|
|
22
|
+
# Number of monthly usage-quota counters deleted.
|
|
20
23
|
attr_accessor :audit_event_quota
|
|
21
24
|
|
|
25
|
+
# Number of forwarders deleted.
|
|
22
26
|
attr_accessor :forwarder
|
|
23
27
|
|
|
28
|
+
# Number of forwarder delivery log entries deleted.
|
|
24
29
|
attr_accessor :forwarder_delivery
|
|
25
30
|
|
|
31
|
+
# Number of distinct `resource_type` entries deleted.
|
|
26
32
|
attr_accessor :resource_type
|
|
27
33
|
|
|
34
|
+
# Number of distinct `action` entries deleted.
|
|
28
35
|
attr_accessor :action
|
|
29
36
|
|
|
30
37
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -27,6 +27,7 @@ require 'smplkit_audit_client/models/event'
|
|
|
27
27
|
require 'smplkit_audit_client/models/event_list_links'
|
|
28
28
|
require 'smplkit_audit_client/models/event_list_meta'
|
|
29
29
|
require 'smplkit_audit_client/models/event_list_response'
|
|
30
|
+
require 'smplkit_audit_client/models/event_request'
|
|
30
31
|
require 'smplkit_audit_client/models/event_resource'
|
|
31
32
|
require 'smplkit_audit_client/models/event_response'
|
|
32
33
|
require 'smplkit_audit_client/models/forwarder'
|
|
@@ -38,6 +39,7 @@ require 'smplkit_audit_client/models/forwarder_http'
|
|
|
38
39
|
require 'smplkit_audit_client/models/forwarder_list_links'
|
|
39
40
|
require 'smplkit_audit_client/models/forwarder_list_meta'
|
|
40
41
|
require 'smplkit_audit_client/models/forwarder_list_response'
|
|
42
|
+
require 'smplkit_audit_client/models/forwarder_request'
|
|
41
43
|
require 'smplkit_audit_client/models/forwarder_resource'
|
|
42
44
|
require 'smplkit_audit_client/models/forwarder_response'
|
|
43
45
|
require 'smplkit_audit_client/models/forwarder_type'
|
|
@@ -34,7 +34,7 @@ describe 'ActionsApi' do
|
|
|
34
34
|
|
|
35
35
|
# unit tests for list_actions
|
|
36
36
|
# List Actions
|
|
37
|
-
# List the distinct `
|
|
37
|
+
# List the distinct `action` slugs recorded for this account. Without `filter[resource_type]`, returns one row per distinct action. With `filter[resource_type]`, returns the actions 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 [Integer] :page_size
|
|
@@ -46,17 +46,4 @@ describe 'ActionsApi' do
|
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
-
# unit tests for list_resource_types
|
|
50
|
-
# List Resource Types
|
|
51
|
-
# List the distinct ``resource_type`` slugs seen in the account. Each row's ``id`` is the slug itself, mirroring the smplkit convention of using customer-provided identifiers as the public-facing resource id (ADR-014).
|
|
52
|
-
# @param [Hash] opts the optional parameters
|
|
53
|
-
# @option opts [Integer] :page_size
|
|
54
|
-
# @option opts [String] :page_after
|
|
55
|
-
# @return [ResourceTypeListResponse]
|
|
56
|
-
describe 'list_resource_types test' do
|
|
57
|
-
it 'should work' do
|
|
58
|
-
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
49
|
end
|
|
@@ -34,7 +34,7 @@ describe 'EventsApi' do
|
|
|
34
34
|
|
|
35
35
|
# unit tests for get_event
|
|
36
36
|
# Get Event
|
|
37
|
-
# Retrieve a single audit event by id.
|
|
37
|
+
# Retrieve a single audit event by id.
|
|
38
38
|
# @param event_id
|
|
39
39
|
# @param [Hash] opts the optional parameters
|
|
40
40
|
# @return [EventResponse]
|
|
@@ -46,7 +46,7 @@ describe 'EventsApi' do
|
|
|
46
46
|
|
|
47
47
|
# unit tests for list_events
|
|
48
48
|
# List Events
|
|
49
|
-
# List audit events for
|
|
49
|
+
# List audit events for this account. Default sort is newest first. Filters are exact-match except `filter[occurred_at]`, which uses interval notation (e.g. `[2026-01-01T00:00:00Z,*)`), and `filter[search]`, which is a case-insensitive substring match against `resource_id`.
|
|
50
50
|
# @param [Hash] opts the optional parameters
|
|
51
51
|
# @option opts [String] :filter_occurred_at
|
|
52
52
|
# @option opts [String] :filter_actor_type
|
|
@@ -54,7 +54,7 @@ describe 'EventsApi' do
|
|
|
54
54
|
# @option opts [String] :filter_action
|
|
55
55
|
# @option opts [String] :filter_resource_type
|
|
56
56
|
# @option opts [String] :filter_resource_id
|
|
57
|
-
# @option opts [String] :filter_search Case-insensitive substring match
|
|
57
|
+
# @option opts [String] :filter_search Case-insensitive substring match against `resource_id`. Use `filter[resource_id]` for an exact match.
|
|
58
58
|
# @option opts [Integer] :page_size
|
|
59
59
|
# @option opts [String] :page_after
|
|
60
60
|
# @return [EventListResponse]
|
|
@@ -66,8 +66,8 @@ describe 'EventsApi' do
|
|
|
66
66
|
|
|
67
67
|
# unit tests for record_event
|
|
68
68
|
# Record Event
|
|
69
|
-
# Record an audit event for
|
|
70
|
-
# @param
|
|
69
|
+
# Record an audit event for this account. Returns `201 Created` on first write, `200 OK` if the request was a duplicate (matched by `Idempotency-Key` or a key derived from the event's content). `resource_type` values beginning with `smpl.` are reserved for events that smplkit emits about its own resources and cannot be used here.
|
|
70
|
+
# @param event_request
|
|
71
71
|
# @param [Hash] opts the optional parameters
|
|
72
72
|
# @option opts [String] :idempotency_key
|
|
73
73
|
# @return [EventResponse]
|
|
@@ -34,8 +34,8 @@ describe 'ForwardersApi' do
|
|
|
34
34
|
|
|
35
35
|
# unit tests for create_forwarder
|
|
36
36
|
# Create Forwarder
|
|
37
|
-
# Create a forwarder
|
|
38
|
-
# @param
|
|
37
|
+
# Create a forwarder for this account.
|
|
38
|
+
# @param forwarder_request
|
|
39
39
|
# @param [Hash] opts the optional parameters
|
|
40
40
|
# @return [ForwarderResponse]
|
|
41
41
|
describe 'create_forwarder test' do
|
|
@@ -46,7 +46,7 @@ describe 'ForwardersApi' do
|
|
|
46
46
|
|
|
47
47
|
# unit tests for delete_forwarder
|
|
48
48
|
# Delete Forwarder
|
|
49
|
-
#
|
|
49
|
+
# Delete a forwarder. Past delivery log entries are retained. A new forwarder may be created later under the same name.
|
|
50
50
|
# @param forwarder_id
|
|
51
51
|
# @param [Hash] opts the optional parameters
|
|
52
52
|
# @return [nil]
|
|
@@ -58,7 +58,7 @@ describe 'ForwardersApi' do
|
|
|
58
58
|
|
|
59
59
|
# unit tests for execute_test_forwarder
|
|
60
60
|
# Execute Test Forwarder
|
|
61
|
-
#
|
|
61
|
+
# Send a test HTTP request to a forwarder destination and return the result. Useful for verifying a destination URL, credentials, or transform before saving the forwarder. The same network-safety rules that apply to live deliveries (private/internal address blocking, port allowlist) apply here.
|
|
62
62
|
# @param test_forwarder_request
|
|
63
63
|
# @param [Hash] opts the optional parameters
|
|
64
64
|
# @return [TestForwarderResponse]
|
|
@@ -70,7 +70,7 @@ describe 'ForwardersApi' do
|
|
|
70
70
|
|
|
71
71
|
# unit tests for get_forwarder
|
|
72
72
|
# Get Forwarder
|
|
73
|
-
# Retrieve a single forwarder by id.
|
|
73
|
+
# Retrieve a single forwarder by id. Header values are returned in plaintext so the resource can be round-tripped with `GET`, mutate, `PUT` without re-entering secrets.
|
|
74
74
|
# @param forwarder_id
|
|
75
75
|
# @param [Hash] opts the optional parameters
|
|
76
76
|
# @return [ForwarderResponse]
|
|
@@ -82,7 +82,7 @@ describe 'ForwardersApi' do
|
|
|
82
82
|
|
|
83
83
|
# unit tests for list_forwarder_deliveries
|
|
84
84
|
# List Forwarder Deliveries
|
|
85
|
-
# List delivery
|
|
85
|
+
# List delivery log entries for a forwarder. Default sort is newest first. Filter by `status` (one of `SUCCEEDED`, `FAILED`, `FILTERED_OUT`, `SKIPPED_DO_NOT_FORWARD` — case-insensitive), by `event_id`, or by a `created_at` range using interval notation (e.g. `[2026-01-01T00:00:00Z,*)`).
|
|
86
86
|
# @param forwarder_id
|
|
87
87
|
# @param [Hash] opts the optional parameters
|
|
88
88
|
# @option opts [String] :filter_status
|
|
@@ -99,7 +99,7 @@ describe 'ForwardersApi' do
|
|
|
99
99
|
|
|
100
100
|
# unit tests for list_forwarders
|
|
101
101
|
# List Forwarders
|
|
102
|
-
# List forwarders for
|
|
102
|
+
# List forwarders for this account.
|
|
103
103
|
# @param [Hash] opts the optional parameters
|
|
104
104
|
# @option opts [String] :filter_forwarder_type
|
|
105
105
|
# @option opts [Boolean] :filter_enabled
|
|
@@ -114,7 +114,7 @@ describe 'ForwardersApi' do
|
|
|
114
114
|
|
|
115
115
|
# unit tests for retry_failed_forwarder_deliveries
|
|
116
116
|
# Retry Failed Forwarder Deliveries
|
|
117
|
-
# Retry every failed delivery for
|
|
117
|
+
# Retry every failed delivery for this forwarder. Each failed delivery is re-attempted using the forwarder's current configuration and the original event. Returns the counts.
|
|
118
118
|
# @param forwarder_id
|
|
119
119
|
# @param [Hash] opts the optional parameters
|
|
120
120
|
# @return [RetryFailedDeliveriesSummary]
|
|
@@ -126,7 +126,7 @@ describe 'ForwardersApi' do
|
|
|
126
126
|
|
|
127
127
|
# unit tests for retry_forwarder_delivery
|
|
128
128
|
# Retry Forwarder Delivery
|
|
129
|
-
# Retry a single failed delivery.
|
|
129
|
+
# Retry a single failed delivery. Returns the new delivery log entry. The prior entry is left in place.
|
|
130
130
|
# @param forwarder_id
|
|
131
131
|
# @param delivery_id
|
|
132
132
|
# @param [Hash] opts the optional parameters
|
|
@@ -139,9 +139,9 @@ describe 'ForwardersApi' do
|
|
|
139
139
|
|
|
140
140
|
# unit tests for update_forwarder
|
|
141
141
|
# Update Forwarder
|
|
142
|
-
#
|
|
142
|
+
# Replace an existing forwarder. Every writable field is overwritten.
|
|
143
143
|
# @param forwarder_id
|
|
144
|
-
# @param
|
|
144
|
+
# @param forwarder_request
|
|
145
145
|
# @param [Hash] opts the optional parameters
|
|
146
146
|
# @return [ForwarderResponse]
|
|
147
147
|
describe 'update_forwarder test' do
|
|
@@ -34,7 +34,7 @@ describe 'FunctionsApi' do
|
|
|
34
34
|
|
|
35
35
|
# unit tests for execute_wipe
|
|
36
36
|
# Execute Wipe
|
|
37
|
-
# Delete every audit
|
|
37
|
+
# Delete every audit record this account has stored. Atomic: either every record is deleted, or none is. Returns the per-table counts and the completion timestamp. The request body must be `{}`.
|
|
38
38
|
# @param body
|
|
39
39
|
# @param [Hash] opts the optional parameters
|
|
40
40
|
# @return [WipeResponse]
|
|
@@ -32,23 +32,9 @@ describe 'ResourceTypesApi' do
|
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
# unit tests for list_actions
|
|
36
|
-
# List Actions
|
|
37
|
-
# List the distinct ``action`` slugs seen in the account. Without ``filter[resource_type]``, returns one row per distinct action — the same action may have been recorded with multiple resource types and the unfiltered dropdown shows it once. With ``filter[resource_type]``, returns the actions seen with that specific resource type, powering the Activity tab's cascading filter behavior.
|
|
38
|
-
# @param [Hash] opts the optional parameters
|
|
39
|
-
# @option opts [String] :filter_resource_type
|
|
40
|
-
# @option opts [Integer] :page_size
|
|
41
|
-
# @option opts [String] :page_after
|
|
42
|
-
# @return [ActionListResponse]
|
|
43
|
-
describe 'list_actions test' do
|
|
44
|
-
it 'should work' do
|
|
45
|
-
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
35
|
# unit tests for list_resource_types
|
|
50
36
|
# List Resource Types
|
|
51
|
-
# List the distinct `
|
|
37
|
+
# List the distinct `resource_type` slugs recorded for this account. The resource `id` is the slug itself. Useful for populating filter dropdowns in a UI.
|
|
52
38
|
# @param [Hash] opts the optional parameters
|
|
53
39
|
# @option opts [Integer] :page_size
|
|
54
40
|
# @option opts [String] :page_after
|
|
@@ -34,8 +34,8 @@ describe 'UsageApi' do
|
|
|
34
34
|
|
|
35
35
|
# unit tests for list_usage
|
|
36
36
|
# List Usage
|
|
37
|
-
#
|
|
38
|
-
# @param filter_period
|
|
37
|
+
# Report the current-period usage counters for this account.
|
|
38
|
+
# @param filter_period Period to report. `current` is the only supported value.
|
|
39
39
|
# @param [Hash] opts the optional parameters
|
|
40
40
|
# @return [UsageResponse]
|
|
41
41
|
describe 'list_usage test' do
|
|
@@ -0,0 +1,36 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for SmplkitGeneratedClient::Audit::EventRequest
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe SmplkitGeneratedClient::Audit::EventRequest do
|
|
21
|
+
#let(:instance) { SmplkitGeneratedClient::Audit::EventRequest.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of EventRequest' do
|
|
24
|
+
it 'should create an instance of EventRequest' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(SmplkitGeneratedClient::Audit::EventRequest)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "data"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end
|
|
@@ -30,6 +30,10 @@ describe SmplkitGeneratedClient::Audit::ForwarderHttp do
|
|
|
30
30
|
describe 'test attribute "method"' do
|
|
31
31
|
it 'should work' do
|
|
32
32
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["GET", "POST", "PUT", "PATCH", "DELETE"])
|
|
34
|
+
# validator.allowable_values.each do |value|
|
|
35
|
+
# expect { instance.method = value }.not_to raise_error
|
|
36
|
+
# end
|
|
33
37
|
end
|
|
34
38
|
end
|
|
35
39
|
|
|
@@ -0,0 +1,36 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for SmplkitGeneratedClient::Audit::ForwarderRequest
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe SmplkitGeneratedClient::Audit::ForwarderRequest do
|
|
21
|
+
#let(:instance) { SmplkitGeneratedClient::Audit::ForwarderRequest.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of ForwarderRequest' do
|
|
24
|
+
it 'should create an instance of ForwarderRequest' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(SmplkitGeneratedClient::Audit::ForwarderRequest)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "data"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end
|
|
@@ -30,6 +30,10 @@ describe SmplkitGeneratedClient::Audit::TestForwarderRequest do
|
|
|
30
30
|
describe 'test attribute "method"' do
|
|
31
31
|
it 'should work' do
|
|
32
32
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["GET", "POST", "PUT", "PATCH", "DELETE"])
|
|
34
|
+
# validator.allowable_values.each do |value|
|
|
35
|
+
# expect { instance.method = value }.not_to raise_error
|
|
36
|
+
# end
|
|
33
37
|
end
|
|
34
38
|
end
|
|
35
39
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Smplkit
|
|
4
|
+
module Audit
|
|
5
|
+
# +client.audit.actions.list+ — distinct +action+ slugs seen for
|
|
6
|
+
# the account.
|
|
7
|
+
#
|
|
8
|
+
# Without +filter_resource_type+, returns one row per distinct
|
|
9
|
+
# action — an action recorded with multiple resource_types appears
|
|
10
|
+
# once. With the filter, returns the actions seen with that
|
|
11
|
+
# specific resource_type, powering the cascading-filter behavior
|
|
12
|
+
# on the Activity tab.
|
|
13
|
+
#
|
|
14
|
+
# ADR-047 §2.5. Sorted alphabetically; cursor pagination via
|
|
15
|
+
# +page_after+.
|
|
16
|
+
class Actions
|
|
17
|
+
def initialize(api)
|
|
18
|
+
@api = api
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def list(filter_resource_type: nil, page_size: nil, page_after: nil)
|
|
22
|
+
opts = {}
|
|
23
|
+
opts[:filter_resource_type] = filter_resource_type if filter_resource_type
|
|
24
|
+
opts[:page_size] = page_size if page_size
|
|
25
|
+
opts[:page_after] = page_after if page_after
|
|
26
|
+
|
|
27
|
+
resp = Smplkit::Audit.call_api { @api.list_actions(opts) }
|
|
28
|
+
rows = (resp.data || []).map { |r| Action.from_resource(r) }
|
|
29
|
+
ActionListPage.new(rows, Smplkit::Audit.next_cursor(resp.links&._next))
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
ActionListPage = Struct.new(:actions, :next_cursor)
|
|
34
|
+
end
|
|
35
|
+
end
|