smplkit 3.0.2 → 3.0.4
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/app/lib/smplkit_app_client/api/environments_api.rb +68 -2
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_usage.rb +283 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_usage_resource.rb +225 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/environment_usage_response.rb +165 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client.rb +3 -0
- data/lib/smplkit/_generated/app/spec/api/environments_api_spec.rb +14 -1
- data/lib/smplkit/_generated/app/spec/models/environment_usage_resource_spec.rb +52 -0
- data/lib/smplkit/_generated/app/spec/models/environment_usage_response_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/environment_usage_spec.rb +54 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/actions_api.rb +9 -2
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/events_api.rb +9 -2
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/forwarders_api.rb +18 -4
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/resource_types_api.rb +9 -2
- data/lib/smplkit/_generated/audit/spec/api/actions_api_spec.rb +2 -1
- data/lib/smplkit/_generated/audit/spec/api/events_api_spec.rb +2 -1
- data/lib/smplkit/_generated/audit/spec/api/forwarders_api_spec.rb +4 -2
- data/lib/smplkit/_generated/audit/spec/api/resource_types_api_spec.rb +2 -1
- metadata +7 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#smplkit API
|
|
3
|
+
|
|
4
|
+
#API for the smplkit platform.
|
|
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 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module SmplkitGeneratedClient::App
|
|
17
|
+
# JSON:API single-resource response envelope for environment-usage counts.
|
|
18
|
+
class EnvironmentUsageResponse < ApiModelBase
|
|
19
|
+
attr_accessor :data
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'data' => :'data'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
acceptable_attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'data' => :'EnvironmentUsageResource'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::EnvironmentUsageResponse` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::EnvironmentUsageResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'data')
|
|
68
|
+
self.data = attributes[:'data']
|
|
69
|
+
else
|
|
70
|
+
self.data = nil
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
75
|
+
# @return Array for valid properties with the reasons
|
|
76
|
+
def list_invalid_properties
|
|
77
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
78
|
+
invalid_properties = Array.new
|
|
79
|
+
if @data.nil?
|
|
80
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
invalid_properties
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Check to see if the all the properties in the model are valid
|
|
87
|
+
# @return true if the model is valid
|
|
88
|
+
def valid?
|
|
89
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
90
|
+
return false if @data.nil?
|
|
91
|
+
true
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Custom attribute writer method with validation
|
|
95
|
+
# @param [Object] data Value to be assigned
|
|
96
|
+
def data=(data)
|
|
97
|
+
if data.nil?
|
|
98
|
+
fail ArgumentError, 'data cannot be nil'
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
@data = data
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Checks equality by comparing each attribute.
|
|
105
|
+
# @param [Object] Object to be compared
|
|
106
|
+
def ==(o)
|
|
107
|
+
return true if self.equal?(o)
|
|
108
|
+
self.class == o.class &&
|
|
109
|
+
data == o.data
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# @see the `==` method
|
|
113
|
+
# @param [Object] Object to be compared
|
|
114
|
+
def eql?(o)
|
|
115
|
+
self == o
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Calculates hash code according to all attributes.
|
|
119
|
+
# @return [Integer] Hash code
|
|
120
|
+
def hash
|
|
121
|
+
[data].hash
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Builds the object from hash
|
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
126
|
+
# @return [Object] Returns the model itself
|
|
127
|
+
def self.build_from_hash(attributes)
|
|
128
|
+
return nil unless attributes.is_a?(Hash)
|
|
129
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
130
|
+
transformed_hash = {}
|
|
131
|
+
openapi_types.each_pair do |key, type|
|
|
132
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
133
|
+
transformed_hash["#{key}"] = nil
|
|
134
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
135
|
+
# check to ensure the input is an array given that the attribute
|
|
136
|
+
# is documented as an array but the input is not
|
|
137
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
138
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
139
|
+
end
|
|
140
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
141
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
new(transformed_hash)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Returns the object in the form of hash
|
|
148
|
+
# @return [Hash] Returns the object in the form of hash
|
|
149
|
+
def to_hash
|
|
150
|
+
hash = {}
|
|
151
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
152
|
+
value = self.send(attr)
|
|
153
|
+
if value.nil?
|
|
154
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
155
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
hash[param] = _to_hash(value)
|
|
159
|
+
end
|
|
160
|
+
hash
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
end
|
|
@@ -57,6 +57,9 @@ require 'smplkit_app_client/models/environment_list_response'
|
|
|
57
57
|
require 'smplkit_app_client/models/environment_request'
|
|
58
58
|
require 'smplkit_app_client/models/environment_resource'
|
|
59
59
|
require 'smplkit_app_client/models/environment_response'
|
|
60
|
+
require 'smplkit_app_client/models/environment_usage'
|
|
61
|
+
require 'smplkit_app_client/models/environment_usage_resource'
|
|
62
|
+
require 'smplkit_app_client/models/environment_usage_response'
|
|
60
63
|
require 'smplkit_app_client/models/error'
|
|
61
64
|
require 'smplkit_app_client/models/error_response'
|
|
62
65
|
require 'smplkit_app_client/models/invitation'
|
|
@@ -46,9 +46,10 @@ describe 'EnvironmentsApi' do
|
|
|
46
46
|
|
|
47
47
|
# unit tests for delete_environment
|
|
48
48
|
# Delete Environment
|
|
49
|
-
# Delete an environment by id.
|
|
49
|
+
# Delete an environment by id. When `cascade=true` is set, also remove every per-environment reference held by flags, configs, and loggers in the corresponding services before deleting the environment row. The default `cascade=false` deletes only the environment row, leaving downstream references in place.
|
|
50
50
|
# @param id
|
|
51
51
|
# @param [Hash] opts the optional parameters
|
|
52
|
+
# @option opts [Boolean] :cascade When `true`, remove every flag rule, env-level flag default, config override, and logger override scoped to this environment before deleting the environment row.
|
|
52
53
|
# @return [nil]
|
|
53
54
|
describe 'delete_environment test' do
|
|
54
55
|
it 'should work' do
|
|
@@ -68,6 +69,18 @@ describe 'EnvironmentsApi' do
|
|
|
68
69
|
end
|
|
69
70
|
end
|
|
70
71
|
|
|
72
|
+
# unit tests for get_environment_usage
|
|
73
|
+
# Report Environment Usage
|
|
74
|
+
# Report how many flag rules, env-level flag defaults, config overrides, and logger overrides reference this environment. Used by the console's delete dialog so the user can see what would survive a non-cascading delete.
|
|
75
|
+
# @param id
|
|
76
|
+
# @param [Hash] opts the optional parameters
|
|
77
|
+
# @return [EnvironmentUsageResponse]
|
|
78
|
+
describe 'get_environment_usage test' do
|
|
79
|
+
it 'should work' do
|
|
80
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
71
84
|
# unit tests for list_environments
|
|
72
85
|
# List Environments
|
|
73
86
|
# List all environments for the authenticated account.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#smplkit API
|
|
3
|
+
|
|
4
|
+
#API for the smplkit platform.
|
|
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::App::EnvironmentUsageResource
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe SmplkitGeneratedClient::App::EnvironmentUsageResource do
|
|
21
|
+
#let(:instance) { SmplkitGeneratedClient::App::EnvironmentUsageResource.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of EnvironmentUsageResource' do
|
|
24
|
+
it 'should create an instance of EnvironmentUsageResource' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(SmplkitGeneratedClient::App::EnvironmentUsageResource)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "id"' 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
|
+
describe 'test attribute "type"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["environment_usage"])
|
|
40
|
+
# validator.allowable_values.each do |value|
|
|
41
|
+
# expect { instance.type = value }.not_to raise_error
|
|
42
|
+
# end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
describe 'test attribute "attributes"' do
|
|
47
|
+
it 'should work' do
|
|
48
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#smplkit API
|
|
3
|
+
|
|
4
|
+
#API for the smplkit platform.
|
|
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::App::EnvironmentUsageResponse
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe SmplkitGeneratedClient::App::EnvironmentUsageResponse do
|
|
21
|
+
#let(:instance) { SmplkitGeneratedClient::App::EnvironmentUsageResponse.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of EnvironmentUsageResponse' do
|
|
24
|
+
it 'should create an instance of EnvironmentUsageResponse' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(SmplkitGeneratedClient::App::EnvironmentUsageResponse)
|
|
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
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#smplkit API
|
|
3
|
+
|
|
4
|
+
#API for the smplkit platform.
|
|
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::App::EnvironmentUsage
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe SmplkitGeneratedClient::App::EnvironmentUsage do
|
|
21
|
+
#let(:instance) { SmplkitGeneratedClient::App::EnvironmentUsage.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of EnvironmentUsage' do
|
|
24
|
+
it 'should create an instance of EnvironmentUsage' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(SmplkitGeneratedClient::App::EnvironmentUsage)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "flag_rules"' 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
|
+
describe 'test attribute "flag_env_defaults"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "config_overrides"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe 'test attribute "logger_overrides"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
end
|
|
@@ -20,11 +20,12 @@ module SmplkitGeneratedClient::Audit
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# List Actions
|
|
23
|
-
# 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.
|
|
23
|
+
# List the distinct `action` slugs recorded for this account. Default sort is `key` ascending; pass `sort=-key` for descending. Without `filter[resource_type]`, returns one row per distinct action. With `filter[resource_type]`, returns the actions 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 [Integer] :page_size
|
|
27
27
|
# @option opts [String] :page_after
|
|
28
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `key`, `-key`. (default to 'key')
|
|
28
29
|
# @return [ActionListResponse]
|
|
29
30
|
def list_actions(opts = {})
|
|
30
31
|
data, _status_code, _headers = list_actions_with_http_info(opts)
|
|
@@ -32,11 +33,12 @@ module SmplkitGeneratedClient::Audit
|
|
|
32
33
|
end
|
|
33
34
|
|
|
34
35
|
# List Actions
|
|
35
|
-
# 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.
|
|
36
|
+
# List the distinct `action` slugs recorded for this account. Default sort is `key` ascending; pass `sort=-key` for descending. Without `filter[resource_type]`, returns one row per distinct action. With `filter[resource_type]`, returns the actions recorded for that specific resource type.
|
|
36
37
|
# @param [Hash] opts the optional parameters
|
|
37
38
|
# @option opts [String] :filter_resource_type
|
|
38
39
|
# @option opts [Integer] :page_size
|
|
39
40
|
# @option opts [String] :page_after
|
|
41
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `key`, `-key`. (default to 'key')
|
|
40
42
|
# @return [Array<(ActionListResponse, Integer, Hash)>] ActionListResponse data, response status code and response headers
|
|
41
43
|
def list_actions_with_http_info(opts = {})
|
|
42
44
|
if @api_client.config.debugging
|
|
@@ -46,6 +48,10 @@ module SmplkitGeneratedClient::Audit
|
|
|
46
48
|
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ActionsApi.list_actions, must be greater than or equal to 1.'
|
|
47
49
|
end
|
|
48
50
|
|
|
51
|
+
allowable_values = ["key", "-key"]
|
|
52
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
53
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
54
|
+
end
|
|
49
55
|
# resource path
|
|
50
56
|
local_var_path = '/api/v1/actions'
|
|
51
57
|
|
|
@@ -54,6 +60,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
54
60
|
query_params[:'filter[resource_type]'] = opts[:'filter_resource_type'] if !opts[:'filter_resource_type'].nil?
|
|
55
61
|
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
56
62
|
query_params[:'page[after]'] = opts[:'page_after'] if !opts[:'page_after'].nil?
|
|
63
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
57
64
|
|
|
58
65
|
# header parameters
|
|
59
66
|
header_params = opts[:header_params] || {}
|
|
@@ -83,7 +83,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
# List Events
|
|
86
|
-
# 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,2026-01-31T00:00:00Z)`), and `filter[search]`, which is a case-insensitive substring match against `resource_id` or `description`. To bound the rows scanned per request, the endpoint requires either: - `filter[resource_id]` (which must be accompanied by `filter[resource_type]`), or - `filter[occurred_at]` with a span no greater than 30 days. `page[size]` defaults to 50 and must not exceed 1000.
|
|
86
|
+
# List audit events for this account. Default sort is `-occurred_at` (newest occurrence first). Sort by `occurred_at` or `created_at`, ascending or descending — keep the same `sort` value across paginated requests so the cursor stays consistent. Filters are exact-match except `filter[occurred_at]`, which uses interval notation (e.g. `[2026-01-01T00:00:00Z,2026-01-31T00:00:00Z)`), and `filter[search]`, which is a case-insensitive substring match against `resource_id` or `description`. To bound the rows scanned per request, the endpoint requires either: - `filter[resource_id]` (which must be accompanied by `filter[resource_type]`), or - `filter[occurred_at]` with a span no greater than 30 days. `page[size]` defaults to 50 and must not exceed 1000.
|
|
87
87
|
# @param [Hash] opts the optional parameters
|
|
88
88
|
# @option opts [String] :filter_occurred_at
|
|
89
89
|
# @option opts [String] :filter_actor_type
|
|
@@ -94,6 +94,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
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`.
|
|
95
95
|
# @option opts [Integer] :page_size
|
|
96
96
|
# @option opts [String] :page_after
|
|
97
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `-occurred_at`. Allowed values: `created_at`, `-created_at`, `occurred_at`, `-occurred_at`. (default to '-occurred_at')
|
|
97
98
|
# @return [EventListResponse]
|
|
98
99
|
def list_events(opts = {})
|
|
99
100
|
data, _status_code, _headers = list_events_with_http_info(opts)
|
|
@@ -101,7 +102,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
101
102
|
end
|
|
102
103
|
|
|
103
104
|
# List Events
|
|
104
|
-
# 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,2026-01-31T00:00:00Z)`), and `filter[search]`, which is a case-insensitive substring match against `resource_id` or `description`. To bound the rows scanned per request, the endpoint requires either: - `filter[resource_id]` (which must be accompanied by `filter[resource_type]`), or - `filter[occurred_at]` with a span no greater than 30 days. `page[size]` defaults to 50 and must not exceed 1000.
|
|
105
|
+
# List audit events for this account. Default sort is `-occurred_at` (newest occurrence first). Sort by `occurred_at` or `created_at`, ascending or descending — keep the same `sort` value across paginated requests so the cursor stays consistent. Filters are exact-match except `filter[occurred_at]`, which uses interval notation (e.g. `[2026-01-01T00:00:00Z,2026-01-31T00:00:00Z)`), and `filter[search]`, which is a case-insensitive substring match against `resource_id` or `description`. To bound the rows scanned per request, the endpoint requires either: - `filter[resource_id]` (which must be accompanied by `filter[resource_type]`), or - `filter[occurred_at]` with a span no greater than 30 days. `page[size]` defaults to 50 and must not exceed 1000.
|
|
105
106
|
# @param [Hash] opts the optional parameters
|
|
106
107
|
# @option opts [String] :filter_occurred_at
|
|
107
108
|
# @option opts [String] :filter_actor_type
|
|
@@ -112,6 +113,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
112
113
|
# @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`.
|
|
113
114
|
# @option opts [Integer] :page_size
|
|
114
115
|
# @option opts [String] :page_after
|
|
116
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `-occurred_at`. Allowed values: `created_at`, `-created_at`, `occurred_at`, `-occurred_at`. (default to '-occurred_at')
|
|
115
117
|
# @return [Array<(EventListResponse, Integer, Hash)>] EventListResponse data, response status code and response headers
|
|
116
118
|
def list_events_with_http_info(opts = {})
|
|
117
119
|
if @api_client.config.debugging
|
|
@@ -121,6 +123,10 @@ module SmplkitGeneratedClient::Audit
|
|
|
121
123
|
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling EventsApi.list_events, must be greater than or equal to 1.'
|
|
122
124
|
end
|
|
123
125
|
|
|
126
|
+
allowable_values = ["created_at", "-created_at", "occurred_at", "-occurred_at"]
|
|
127
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
128
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
129
|
+
end
|
|
124
130
|
# resource path
|
|
125
131
|
local_var_path = '/api/v1/events'
|
|
126
132
|
|
|
@@ -135,6 +141,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
135
141
|
query_params[:'filter[search]'] = opts[:'filter_search'] if !opts[:'filter_search'].nil?
|
|
136
142
|
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
137
143
|
query_params[:'page[after]'] = opts[:'page_after'] if !opts[:'page_after'].nil?
|
|
144
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
138
145
|
|
|
139
146
|
# header parameters
|
|
140
147
|
header_params = opts[:header_params] || {}
|
|
@@ -280,7 +280,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
280
280
|
end
|
|
281
281
|
|
|
282
282
|
# List Forwarder Deliveries
|
|
283
|
-
# 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,*)`).
|
|
283
|
+
# List delivery log entries for a forwarder. Default sort is `-created_at` (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,*)`).
|
|
284
284
|
# @param forwarder_id [String]
|
|
285
285
|
# @param [Hash] opts the optional parameters
|
|
286
286
|
# @option opts [String] :filter_status
|
|
@@ -288,6 +288,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
288
288
|
# @option opts [String] :filter_event_id
|
|
289
289
|
# @option opts [Integer] :page_size
|
|
290
290
|
# @option opts [String] :page_after
|
|
291
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `-created_at`. Allowed values: `created_at`, `-created_at`. (default to '-created_at')
|
|
291
292
|
# @return [ForwarderDeliveryListResponse]
|
|
292
293
|
def list_forwarder_deliveries(forwarder_id, opts = {})
|
|
293
294
|
data, _status_code, _headers = list_forwarder_deliveries_with_http_info(forwarder_id, opts)
|
|
@@ -295,7 +296,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
295
296
|
end
|
|
296
297
|
|
|
297
298
|
# List Forwarder Deliveries
|
|
298
|
-
# 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,*)`).
|
|
299
|
+
# List delivery log entries for a forwarder. Default sort is `-created_at` (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,*)`).
|
|
299
300
|
# @param forwarder_id [String]
|
|
300
301
|
# @param [Hash] opts the optional parameters
|
|
301
302
|
# @option opts [String] :filter_status
|
|
@@ -303,6 +304,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
303
304
|
# @option opts [String] :filter_event_id
|
|
304
305
|
# @option opts [Integer] :page_size
|
|
305
306
|
# @option opts [String] :page_after
|
|
307
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `-created_at`. Allowed values: `created_at`, `-created_at`. (default to '-created_at')
|
|
306
308
|
# @return [Array<(ForwarderDeliveryListResponse, Integer, Hash)>] ForwarderDeliveryListResponse data, response status code and response headers
|
|
307
309
|
def list_forwarder_deliveries_with_http_info(forwarder_id, opts = {})
|
|
308
310
|
if @api_client.config.debugging
|
|
@@ -316,6 +318,10 @@ module SmplkitGeneratedClient::Audit
|
|
|
316
318
|
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ForwardersApi.list_forwarder_deliveries, must be greater than or equal to 1.'
|
|
317
319
|
end
|
|
318
320
|
|
|
321
|
+
allowable_values = ["created_at", "-created_at"]
|
|
322
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
323
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
324
|
+
end
|
|
319
325
|
# resource path
|
|
320
326
|
local_var_path = '/api/v1/forwarders/{forwarder_id}/deliveries'.sub('{forwarder_id}', CGI.escape(forwarder_id.to_s))
|
|
321
327
|
|
|
@@ -326,6 +332,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
326
332
|
query_params[:'filter[event_id]'] = opts[:'filter_event_id'] if !opts[:'filter_event_id'].nil?
|
|
327
333
|
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
328
334
|
query_params[:'page[after]'] = opts[:'page_after'] if !opts[:'page_after'].nil?
|
|
335
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
329
336
|
|
|
330
337
|
# header parameters
|
|
331
338
|
header_params = opts[:header_params] || {}
|
|
@@ -362,12 +369,13 @@ module SmplkitGeneratedClient::Audit
|
|
|
362
369
|
end
|
|
363
370
|
|
|
364
371
|
# List Forwarders
|
|
365
|
-
# List forwarders for this account.
|
|
372
|
+
# List forwarders for this account. Default sort is `-created_at` (newest first). Pagination uses cursor tokens; keep the same `sort` value across paginated requests.
|
|
366
373
|
# @param [Hash] opts the optional parameters
|
|
367
374
|
# @option opts [String] :filter_forwarder_type
|
|
368
375
|
# @option opts [Boolean] :filter_enabled
|
|
369
376
|
# @option opts [Integer] :page_size
|
|
370
377
|
# @option opts [String] :page_after
|
|
378
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `-created_at`. Allowed values: `created_at`, `-created_at`, `updated_at`, `-updated_at`. (default to '-created_at')
|
|
371
379
|
# @return [ForwarderListResponse]
|
|
372
380
|
def list_forwarders(opts = {})
|
|
373
381
|
data, _status_code, _headers = list_forwarders_with_http_info(opts)
|
|
@@ -375,12 +383,13 @@ module SmplkitGeneratedClient::Audit
|
|
|
375
383
|
end
|
|
376
384
|
|
|
377
385
|
# List Forwarders
|
|
378
|
-
# List forwarders for this account.
|
|
386
|
+
# List forwarders for this account. Default sort is `-created_at` (newest first). Pagination uses cursor tokens; keep the same `sort` value across paginated requests.
|
|
379
387
|
# @param [Hash] opts the optional parameters
|
|
380
388
|
# @option opts [String] :filter_forwarder_type
|
|
381
389
|
# @option opts [Boolean] :filter_enabled
|
|
382
390
|
# @option opts [Integer] :page_size
|
|
383
391
|
# @option opts [String] :page_after
|
|
392
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `-created_at`. Allowed values: `created_at`, `-created_at`, `updated_at`, `-updated_at`. (default to '-created_at')
|
|
384
393
|
# @return [Array<(ForwarderListResponse, Integer, Hash)>] ForwarderListResponse data, response status code and response headers
|
|
385
394
|
def list_forwarders_with_http_info(opts = {})
|
|
386
395
|
if @api_client.config.debugging
|
|
@@ -390,6 +399,10 @@ module SmplkitGeneratedClient::Audit
|
|
|
390
399
|
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ForwardersApi.list_forwarders, must be greater than or equal to 1.'
|
|
391
400
|
end
|
|
392
401
|
|
|
402
|
+
allowable_values = ["created_at", "-created_at", "updated_at", "-updated_at"]
|
|
403
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
404
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
405
|
+
end
|
|
393
406
|
# resource path
|
|
394
407
|
local_var_path = '/api/v1/forwarders'
|
|
395
408
|
|
|
@@ -399,6 +412,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
399
412
|
query_params[:'filter[enabled]'] = opts[:'filter_enabled'] if !opts[:'filter_enabled'].nil?
|
|
400
413
|
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
401
414
|
query_params[:'page[after]'] = opts[:'page_after'] if !opts[:'page_after'].nil?
|
|
415
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
402
416
|
|
|
403
417
|
# header parameters
|
|
404
418
|
header_params = opts[:header_params] || {}
|
|
@@ -20,10 +20,11 @@ module SmplkitGeneratedClient::Audit
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# List Resource Types
|
|
23
|
-
# 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.
|
|
23
|
+
# List the distinct `resource_type` slugs recorded for this account. The resource `id` is the slug itself. Default sort is `key` ascending; pass `sort=-key` for descending. Useful for populating filter dropdowns in a UI.
|
|
24
24
|
# @param [Hash] opts the optional parameters
|
|
25
25
|
# @option opts [Integer] :page_size
|
|
26
26
|
# @option opts [String] :page_after
|
|
27
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `key`, `-key`. (default to 'key')
|
|
27
28
|
# @return [ResourceTypeListResponse]
|
|
28
29
|
def list_resource_types(opts = {})
|
|
29
30
|
data, _status_code, _headers = list_resource_types_with_http_info(opts)
|
|
@@ -31,10 +32,11 @@ module SmplkitGeneratedClient::Audit
|
|
|
31
32
|
end
|
|
32
33
|
|
|
33
34
|
# List Resource Types
|
|
34
|
-
# 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.
|
|
35
|
+
# List the distinct `resource_type` slugs recorded for this account. The resource `id` is the slug itself. Default sort is `key` ascending; pass `sort=-key` for descending. Useful for populating filter dropdowns in a UI.
|
|
35
36
|
# @param [Hash] opts the optional parameters
|
|
36
37
|
# @option opts [Integer] :page_size
|
|
37
38
|
# @option opts [String] :page_after
|
|
39
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `key`, `-key`. (default to 'key')
|
|
38
40
|
# @return [Array<(ResourceTypeListResponse, Integer, Hash)>] ResourceTypeListResponse data, response status code and response headers
|
|
39
41
|
def list_resource_types_with_http_info(opts = {})
|
|
40
42
|
if @api_client.config.debugging
|
|
@@ -44,6 +46,10 @@ module SmplkitGeneratedClient::Audit
|
|
|
44
46
|
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ResourceTypesApi.list_resource_types, must be greater than or equal to 1.'
|
|
45
47
|
end
|
|
46
48
|
|
|
49
|
+
allowable_values = ["key", "-key"]
|
|
50
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
51
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
52
|
+
end
|
|
47
53
|
# resource path
|
|
48
54
|
local_var_path = '/api/v1/resource_types'
|
|
49
55
|
|
|
@@ -51,6 +57,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
51
57
|
query_params = opts[:query_params] || {}
|
|
52
58
|
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
53
59
|
query_params[:'page[after]'] = opts[:'page_after'] if !opts[:'page_after'].nil?
|
|
60
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
54
61
|
|
|
55
62
|
# header parameters
|
|
56
63
|
header_params = opts[:header_params] || {}
|
|
@@ -34,11 +34,12 @@ describe 'ActionsApi' do
|
|
|
34
34
|
|
|
35
35
|
# unit tests for list_actions
|
|
36
36
|
# List Actions
|
|
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.
|
|
37
|
+
# List the distinct `action` slugs recorded for this account. Default sort is `key` ascending; pass `sort=-key` for descending. 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
|
|
41
41
|
# @option opts [String] :page_after
|
|
42
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `key`, `-key`.
|
|
42
43
|
# @return [ActionListResponse]
|
|
43
44
|
describe 'list_actions test' do
|
|
44
45
|
it 'should work' do
|
|
@@ -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 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,2026-01-31T00:00:00Z)`), and `filter[search]`, which is a case-insensitive substring match against `resource_id` or `description`. To bound the rows scanned per request, the endpoint requires either: - `filter[resource_id]` (which must be accompanied by `filter[resource_type]`), or - `filter[occurred_at]` with a span no greater than 30 days. `page[size]` defaults to 50 and must not exceed 1000.
|
|
49
|
+
# List audit events for this account. Default sort is `-occurred_at` (newest occurrence first). Sort by `occurred_at` or `created_at`, ascending or descending — keep the same `sort` value across paginated requests so the cursor stays consistent. Filters are exact-match except `filter[occurred_at]`, which uses interval notation (e.g. `[2026-01-01T00:00:00Z,2026-01-31T00:00:00Z)`), and `filter[search]`, which is a case-insensitive substring match against `resource_id` or `description`. To bound the rows scanned per request, the endpoint requires either: - `filter[resource_id]` (which must be accompanied by `filter[resource_type]`), or - `filter[occurred_at]` with a span no greater than 30 days. `page[size]` defaults to 50 and must not exceed 1000.
|
|
50
50
|
# @param [Hash] opts the optional parameters
|
|
51
51
|
# @option opts [String] :filter_occurred_at
|
|
52
52
|
# @option opts [String] :filter_actor_type
|
|
@@ -57,6 +57,7 @@ describe 'EventsApi' do
|
|
|
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`.
|
|
58
58
|
# @option opts [Integer] :page_size
|
|
59
59
|
# @option opts [String] :page_after
|
|
60
|
+
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `-occurred_at`. Allowed values: `created_at`, `-created_at`, `occurred_at`, `-occurred_at`.
|
|
60
61
|
# @return [EventListResponse]
|
|
61
62
|
describe 'list_events test' do
|
|
62
63
|
it 'should work' do
|