smplkit 3.0.9 → 3.0.10
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 +9 -10
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/forwarders_api.rb +11 -12
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/resource_types_api.rb +9 -10
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/usage_api.rb +9 -0
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/action_list_response.rb +4 -14
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_list_meta.rb +1 -0
- 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/{action_list_links.rb → forwarder_delivery_list_links.rb} +3 -3
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/{resource_type_list_meta.rb → forwarder_delivery_list_meta.rb} +4 -3
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_list_response.rb +3 -3
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_list_response.rb +4 -14
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/{action_list_meta.rb → list_meta.rb} +20 -19
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/{forwarder_list_meta.rb → pagination_meta.rb} +70 -19
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/resource_type_list_response.rb +4 -14
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/usage_response.rb +30 -4
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client.rb +4 -6
- data/lib/smplkit/_generated/audit/spec/api/actions_api_spec.rb +3 -2
- data/lib/smplkit/_generated/audit/spec/api/forwarders_api_spec.rb +4 -3
- data/lib/smplkit/_generated/audit/spec/api/resource_types_api_spec.rb +3 -2
- data/lib/smplkit/_generated/audit/spec/api/usage_api_spec.rb +3 -0
- data/lib/smplkit/_generated/audit/spec/models/action_list_response_spec.rb +0 -6
- data/lib/smplkit/_generated/audit/spec/models/{action_list_links_spec.rb → forwarder_delivery_list_links_spec.rb} +6 -6
- data/lib/smplkit/_generated/audit/spec/models/{resource_type_list_meta_spec.rb → forwarder_delivery_list_meta_spec.rb} +6 -6
- data/lib/smplkit/_generated/audit/spec/models/forwarder_list_response_spec.rb +0 -6
- data/lib/smplkit/_generated/audit/spec/models/{action_list_meta_spec.rb → list_meta_spec.rb} +7 -7
- data/lib/smplkit/_generated/audit/spec/models/pagination_meta_spec.rb +54 -0
- data/lib/smplkit/_generated/audit/spec/models/resource_type_list_response_spec.rb +0 -6
- data/lib/smplkit/_generated/audit/spec/models/usage_response_spec.rb +6 -0
- data/lib/smplkit/audit/actions.rb +7 -6
- data/lib/smplkit/audit/models.rb +14 -0
- data/lib/smplkit/audit/resource_types.rb +7 -6
- data/lib/smplkit/management/audit.rb +5 -4
- metadata +9 -13
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_list_links.rb +0 -148
- data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/resource_type_list_links.rb +0 -148
- data/lib/smplkit/_generated/audit/spec/models/forwarder_list_links_spec.rb +0 -36
- data/lib/smplkit/_generated/audit/spec/models/forwarder_list_meta_spec.rb +0 -36
- data/lib/smplkit/_generated/audit/spec/models/resource_type_list_links_spec.rb +0 -36
|
@@ -14,13 +14,27 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::Audit
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
# Pagination block returned inside ``meta`` on every list response. ``page`` and ``size`` are always present and echo the parameters that served the response (their defaults when the client omitted them). ``total`` and ``total_pages`` are present only when the request included ``meta[total]=true``.
|
|
18
|
+
class PaginationMeta < ApiModelBase
|
|
19
|
+
# 1-based page number returned.
|
|
20
|
+
attr_accessor :page
|
|
21
|
+
|
|
22
|
+
# Number of items per page.
|
|
23
|
+
attr_accessor :size
|
|
24
|
+
|
|
25
|
+
# Total number of matching items across all pages. Present only when the request included `meta[total]=true`.
|
|
26
|
+
attr_accessor :total
|
|
27
|
+
|
|
28
|
+
# Total number of pages at the requested page size. Present only when the request included `meta[total]=true`.
|
|
29
|
+
attr_accessor :total_pages
|
|
19
30
|
|
|
20
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
32
|
def self.attribute_map
|
|
22
33
|
{
|
|
23
|
-
:'
|
|
34
|
+
:'page' => :'page',
|
|
35
|
+
:'size' => :'size',
|
|
36
|
+
:'total' => :'total',
|
|
37
|
+
:'total_pages' => :'total_pages'
|
|
24
38
|
}
|
|
25
39
|
end
|
|
26
40
|
|
|
@@ -37,13 +51,18 @@ module SmplkitGeneratedClient::Audit
|
|
|
37
51
|
# Attribute type mapping.
|
|
38
52
|
def self.openapi_types
|
|
39
53
|
{
|
|
40
|
-
:'
|
|
54
|
+
:'page' => :'Integer',
|
|
55
|
+
:'size' => :'Integer',
|
|
56
|
+
:'total' => :'Integer',
|
|
57
|
+
:'total_pages' => :'Integer'
|
|
41
58
|
}
|
|
42
59
|
end
|
|
43
60
|
|
|
44
61
|
# List of attributes with nullable: true
|
|
45
62
|
def self.openapi_nullable
|
|
46
63
|
Set.new([
|
|
64
|
+
:'total',
|
|
65
|
+
:'total_pages'
|
|
47
66
|
])
|
|
48
67
|
end
|
|
49
68
|
|
|
@@ -51,22 +70,36 @@ module SmplkitGeneratedClient::Audit
|
|
|
51
70
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
71
|
def initialize(attributes = {})
|
|
53
72
|
if (!attributes.is_a?(Hash))
|
|
54
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::
|
|
73
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Audit::PaginationMeta` initialize method"
|
|
55
74
|
end
|
|
56
75
|
|
|
57
76
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
77
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
78
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
79
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
61
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::
|
|
80
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Audit::PaginationMeta`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
81
|
end
|
|
63
82
|
h[k.to_sym] = v
|
|
64
83
|
}
|
|
65
84
|
|
|
66
|
-
if attributes.key?(:'
|
|
67
|
-
self.
|
|
85
|
+
if attributes.key?(:'page')
|
|
86
|
+
self.page = attributes[:'page']
|
|
68
87
|
else
|
|
69
|
-
self.
|
|
88
|
+
self.page = nil
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'size')
|
|
92
|
+
self.size = attributes[:'size']
|
|
93
|
+
else
|
|
94
|
+
self.size = nil
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'total')
|
|
98
|
+
self.total = attributes[:'total']
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'total_pages')
|
|
102
|
+
self.total_pages = attributes[:'total_pages']
|
|
70
103
|
end
|
|
71
104
|
end
|
|
72
105
|
|
|
@@ -75,8 +108,12 @@ module SmplkitGeneratedClient::Audit
|
|
|
75
108
|
def list_invalid_properties
|
|
76
109
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
77
110
|
invalid_properties = Array.new
|
|
78
|
-
if @
|
|
79
|
-
invalid_properties.push('invalid value for "
|
|
111
|
+
if @page.nil?
|
|
112
|
+
invalid_properties.push('invalid value for "page", page cannot be nil.')
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if @size.nil?
|
|
116
|
+
invalid_properties.push('invalid value for "size", size cannot be nil.')
|
|
80
117
|
end
|
|
81
118
|
|
|
82
119
|
invalid_properties
|
|
@@ -86,18 +123,29 @@ module SmplkitGeneratedClient::Audit
|
|
|
86
123
|
# @return true if the model is valid
|
|
87
124
|
def valid?
|
|
88
125
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
89
|
-
return false if @
|
|
126
|
+
return false if @page.nil?
|
|
127
|
+
return false if @size.nil?
|
|
90
128
|
true
|
|
91
129
|
end
|
|
92
130
|
|
|
93
131
|
# Custom attribute writer method with validation
|
|
94
|
-
# @param [Object]
|
|
95
|
-
def
|
|
96
|
-
if
|
|
97
|
-
fail ArgumentError, '
|
|
132
|
+
# @param [Object] page Value to be assigned
|
|
133
|
+
def page=(page)
|
|
134
|
+
if page.nil?
|
|
135
|
+
fail ArgumentError, 'page cannot be nil'
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
@page = page
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Custom attribute writer method with validation
|
|
142
|
+
# @param [Object] size Value to be assigned
|
|
143
|
+
def size=(size)
|
|
144
|
+
if size.nil?
|
|
145
|
+
fail ArgumentError, 'size cannot be nil'
|
|
98
146
|
end
|
|
99
147
|
|
|
100
|
-
@
|
|
148
|
+
@size = size
|
|
101
149
|
end
|
|
102
150
|
|
|
103
151
|
# Checks equality by comparing each attribute.
|
|
@@ -105,7 +153,10 @@ module SmplkitGeneratedClient::Audit
|
|
|
105
153
|
def ==(o)
|
|
106
154
|
return true if self.equal?(o)
|
|
107
155
|
self.class == o.class &&
|
|
108
|
-
|
|
156
|
+
page == o.page &&
|
|
157
|
+
size == o.size &&
|
|
158
|
+
total == o.total &&
|
|
159
|
+
total_pages == o.total_pages
|
|
109
160
|
end
|
|
110
161
|
|
|
111
162
|
# @see the `==` method
|
|
@@ -117,7 +168,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
117
168
|
# Calculates hash code according to all attributes.
|
|
118
169
|
# @return [Integer] Hash code
|
|
119
170
|
def hash
|
|
120
|
-
[
|
|
171
|
+
[page, size, total, total_pages].hash
|
|
121
172
|
end
|
|
122
173
|
|
|
123
174
|
# Builds the object from hash
|
data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/resource_type_list_response.rb
CHANGED
|
@@ -19,14 +19,11 @@ module SmplkitGeneratedClient::Audit
|
|
|
19
19
|
|
|
20
20
|
attr_accessor :meta
|
|
21
21
|
|
|
22
|
-
attr_accessor :links
|
|
23
|
-
|
|
24
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
23
|
def self.attribute_map
|
|
26
24
|
{
|
|
27
25
|
:'data' => :'data',
|
|
28
|
-
:'meta' => :'meta'
|
|
29
|
-
:'links' => :'links'
|
|
26
|
+
:'meta' => :'meta'
|
|
30
27
|
}
|
|
31
28
|
end
|
|
32
29
|
|
|
@@ -44,15 +41,13 @@ module SmplkitGeneratedClient::Audit
|
|
|
44
41
|
def self.openapi_types
|
|
45
42
|
{
|
|
46
43
|
:'data' => :'Array<ResourceTypeResource>',
|
|
47
|
-
:'meta' => :'
|
|
48
|
-
:'links' => :'ResourceTypeListLinks'
|
|
44
|
+
:'meta' => :'ListMeta'
|
|
49
45
|
}
|
|
50
46
|
end
|
|
51
47
|
|
|
52
48
|
# List of attributes with nullable: true
|
|
53
49
|
def self.openapi_nullable
|
|
54
50
|
Set.new([
|
|
55
|
-
:'links'
|
|
56
51
|
])
|
|
57
52
|
end
|
|
58
53
|
|
|
@@ -85,10 +80,6 @@ module SmplkitGeneratedClient::Audit
|
|
|
85
80
|
else
|
|
86
81
|
self.meta = nil
|
|
87
82
|
end
|
|
88
|
-
|
|
89
|
-
if attributes.key?(:'links')
|
|
90
|
-
self.links = attributes[:'links']
|
|
91
|
-
end
|
|
92
83
|
end
|
|
93
84
|
|
|
94
85
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -142,8 +133,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
142
133
|
return true if self.equal?(o)
|
|
143
134
|
self.class == o.class &&
|
|
144
135
|
data == o.data &&
|
|
145
|
-
meta == o.meta
|
|
146
|
-
links == o.links
|
|
136
|
+
meta == o.meta
|
|
147
137
|
end
|
|
148
138
|
|
|
149
139
|
# @see the `==` method
|
|
@@ -155,7 +145,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
155
145
|
# Calculates hash code according to all attributes.
|
|
156
146
|
# @return [Integer] Hash code
|
|
157
147
|
def hash
|
|
158
|
-
[data, meta
|
|
148
|
+
[data, meta].hash
|
|
159
149
|
end
|
|
160
150
|
|
|
161
151
|
# Builds the object from hash
|
|
@@ -17,10 +17,13 @@ module SmplkitGeneratedClient::Audit
|
|
|
17
17
|
class UsageResponse < ApiModelBase
|
|
18
18
|
attr_accessor :data
|
|
19
19
|
|
|
20
|
+
attr_accessor :meta
|
|
21
|
+
|
|
20
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
23
|
def self.attribute_map
|
|
22
24
|
{
|
|
23
|
-
:'data' => :'data'
|
|
25
|
+
:'data' => :'data',
|
|
26
|
+
:'meta' => :'meta'
|
|
24
27
|
}
|
|
25
28
|
end
|
|
26
29
|
|
|
@@ -37,7 +40,8 @@ module SmplkitGeneratedClient::Audit
|
|
|
37
40
|
# Attribute type mapping.
|
|
38
41
|
def self.openapi_types
|
|
39
42
|
{
|
|
40
|
-
:'data' => :'Array<UsageResource>'
|
|
43
|
+
:'data' => :'Array<UsageResource>',
|
|
44
|
+
:'meta' => :'ListMeta'
|
|
41
45
|
}
|
|
42
46
|
end
|
|
43
47
|
|
|
@@ -70,6 +74,12 @@ module SmplkitGeneratedClient::Audit
|
|
|
70
74
|
else
|
|
71
75
|
self.data = nil
|
|
72
76
|
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'meta')
|
|
79
|
+
self.meta = attributes[:'meta']
|
|
80
|
+
else
|
|
81
|
+
self.meta = nil
|
|
82
|
+
end
|
|
73
83
|
end
|
|
74
84
|
|
|
75
85
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -81,6 +91,10 @@ module SmplkitGeneratedClient::Audit
|
|
|
81
91
|
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
82
92
|
end
|
|
83
93
|
|
|
94
|
+
if @meta.nil?
|
|
95
|
+
invalid_properties.push('invalid value for "meta", meta cannot be nil.')
|
|
96
|
+
end
|
|
97
|
+
|
|
84
98
|
invalid_properties
|
|
85
99
|
end
|
|
86
100
|
|
|
@@ -89,6 +103,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
89
103
|
def valid?
|
|
90
104
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
91
105
|
return false if @data.nil?
|
|
106
|
+
return false if @meta.nil?
|
|
92
107
|
true
|
|
93
108
|
end
|
|
94
109
|
|
|
@@ -102,12 +117,23 @@ module SmplkitGeneratedClient::Audit
|
|
|
102
117
|
@data = data
|
|
103
118
|
end
|
|
104
119
|
|
|
120
|
+
# Custom attribute writer method with validation
|
|
121
|
+
# @param [Object] meta Value to be assigned
|
|
122
|
+
def meta=(meta)
|
|
123
|
+
if meta.nil?
|
|
124
|
+
fail ArgumentError, 'meta cannot be nil'
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
@meta = meta
|
|
128
|
+
end
|
|
129
|
+
|
|
105
130
|
# Checks equality by comparing each attribute.
|
|
106
131
|
# @param [Object] Object to be compared
|
|
107
132
|
def ==(o)
|
|
108
133
|
return true if self.equal?(o)
|
|
109
134
|
self.class == o.class &&
|
|
110
|
-
data == o.data
|
|
135
|
+
data == o.data &&
|
|
136
|
+
meta == o.meta
|
|
111
137
|
end
|
|
112
138
|
|
|
113
139
|
# @see the `==` method
|
|
@@ -119,7 +145,7 @@ module SmplkitGeneratedClient::Audit
|
|
|
119
145
|
# Calculates hash code according to all attributes.
|
|
120
146
|
# @return [Integer] Hash code
|
|
121
147
|
def hash
|
|
122
|
-
[data].hash
|
|
148
|
+
[data, meta].hash
|
|
123
149
|
end
|
|
124
150
|
|
|
125
151
|
# Builds the object from hash
|
|
@@ -19,8 +19,6 @@ require 'smplkit_audit_client/configuration'
|
|
|
19
19
|
|
|
20
20
|
# Models
|
|
21
21
|
require 'smplkit_audit_client/models/action_attributes'
|
|
22
|
-
require 'smplkit_audit_client/models/action_list_links'
|
|
23
|
-
require 'smplkit_audit_client/models/action_list_meta'
|
|
24
22
|
require 'smplkit_audit_client/models/action_list_response'
|
|
25
23
|
require 'smplkit_audit_client/models/action_resource'
|
|
26
24
|
require 'smplkit_audit_client/models/event'
|
|
@@ -32,21 +30,21 @@ require 'smplkit_audit_client/models/event_resource'
|
|
|
32
30
|
require 'smplkit_audit_client/models/event_response'
|
|
33
31
|
require 'smplkit_audit_client/models/forwarder'
|
|
34
32
|
require 'smplkit_audit_client/models/forwarder_delivery'
|
|
33
|
+
require 'smplkit_audit_client/models/forwarder_delivery_list_links'
|
|
34
|
+
require 'smplkit_audit_client/models/forwarder_delivery_list_meta'
|
|
35
35
|
require 'smplkit_audit_client/models/forwarder_delivery_list_response'
|
|
36
36
|
require 'smplkit_audit_client/models/forwarder_delivery_resource'
|
|
37
37
|
require 'smplkit_audit_client/models/forwarder_delivery_response'
|
|
38
38
|
require 'smplkit_audit_client/models/forwarder_http'
|
|
39
|
-
require 'smplkit_audit_client/models/forwarder_list_links'
|
|
40
|
-
require 'smplkit_audit_client/models/forwarder_list_meta'
|
|
41
39
|
require 'smplkit_audit_client/models/forwarder_list_response'
|
|
42
40
|
require 'smplkit_audit_client/models/forwarder_request'
|
|
43
41
|
require 'smplkit_audit_client/models/forwarder_resource'
|
|
44
42
|
require 'smplkit_audit_client/models/forwarder_response'
|
|
45
43
|
require 'smplkit_audit_client/models/forwarder_type'
|
|
46
44
|
require 'smplkit_audit_client/models/http_header'
|
|
45
|
+
require 'smplkit_audit_client/models/list_meta'
|
|
46
|
+
require 'smplkit_audit_client/models/pagination_meta'
|
|
47
47
|
require 'smplkit_audit_client/models/resource_type_attributes'
|
|
48
|
-
require 'smplkit_audit_client/models/resource_type_list_links'
|
|
49
|
-
require 'smplkit_audit_client/models/resource_type_list_meta'
|
|
50
48
|
require 'smplkit_audit_client/models/resource_type_list_response'
|
|
51
49
|
require 'smplkit_audit_client/models/resource_type_resource'
|
|
52
50
|
require 'smplkit_audit_client/models/retry_failed_deliveries_summary'
|
|
@@ -37,9 +37,10 @@ describe 'ActionsApi' do
|
|
|
37
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
|
-
# @option opts [Integer] :page_size
|
|
41
|
-
# @option opts [String] :page_after
|
|
42
40
|
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `key`, `-key`.
|
|
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
|
+
# @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
|
+
# @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`.
|
|
43
44
|
# @return [ActionListResponse]
|
|
44
45
|
describe 'list_actions test' do
|
|
45
46
|
it 'should work' do
|
|
@@ -100,13 +100,14 @@ describe 'ForwardersApi' do
|
|
|
100
100
|
|
|
101
101
|
# unit tests for list_forwarders
|
|
102
102
|
# List Forwarders
|
|
103
|
-
# List forwarders for this account. Default sort is `-created_at` (newest first).
|
|
103
|
+
# List forwarders for this account. Default sort is `-created_at` (newest first).
|
|
104
104
|
# @param [Hash] opts the optional parameters
|
|
105
105
|
# @option opts [String] :filter_forwarder_type
|
|
106
106
|
# @option opts [Boolean] :filter_enabled
|
|
107
|
-
# @option opts [Integer] :page_size
|
|
108
|
-
# @option opts [String] :page_after
|
|
109
107
|
# @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`.
|
|
108
|
+
# @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.
|
|
109
|
+
# @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.
|
|
110
|
+
# @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`.
|
|
110
111
|
# @return [ForwarderListResponse]
|
|
111
112
|
describe 'list_forwarders test' do
|
|
112
113
|
it 'should work' do
|
|
@@ -36,9 +36,10 @@ describe 'ResourceTypesApi' do
|
|
|
36
36
|
# List Resource Types
|
|
37
37
|
# 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.
|
|
38
38
|
# @param [Hash] opts the optional parameters
|
|
39
|
-
# @option opts [Integer] :page_size
|
|
40
|
-
# @option opts [String] :page_after
|
|
41
39
|
# @option opts [String] :sort Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `key`, `-key`.
|
|
40
|
+
# @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.
|
|
41
|
+
# @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.
|
|
42
|
+
# @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`.
|
|
42
43
|
# @return [ResourceTypeListResponse]
|
|
43
44
|
describe 'list_resource_types test' do
|
|
44
45
|
it 'should work' do
|
|
@@ -37,6 +37,9 @@ describe 'UsageApi' do
|
|
|
37
37
|
# Report the current-period usage counters for this account.
|
|
38
38
|
# @param filter_period Period to report. `current` is the only supported value.
|
|
39
39
|
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @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.
|
|
41
|
+
# @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.
|
|
42
|
+
# @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`.
|
|
40
43
|
# @return [UsageResponse]
|
|
41
44
|
describe 'list_usage test' do
|
|
42
45
|
it 'should work' do
|
|
@@ -39,10 +39,4 @@ describe SmplkitGeneratedClient::Audit::ActionListResponse do
|
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
describe 'test attribute "links"' 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
42
|
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::ForwarderDeliveryListLinks
|
|
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::ForwarderDeliveryListLinks do
|
|
21
|
+
#let(:instance) { SmplkitGeneratedClient::Audit::ForwarderDeliveryListLinks.new }
|
|
22
22
|
|
|
23
|
-
describe 'test an instance of
|
|
24
|
-
it 'should create an instance of
|
|
23
|
+
describe 'test an instance of ForwarderDeliveryListLinks' do
|
|
24
|
+
it 'should create an instance of ForwarderDeliveryListLinks' 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::ForwarderDeliveryListLinks)
|
|
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::ForwarderDeliveryListMeta
|
|
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::ForwarderDeliveryListMeta do
|
|
21
|
+
#let(:instance) { SmplkitGeneratedClient::Audit::ForwarderDeliveryListMeta.new }
|
|
22
22
|
|
|
23
|
-
describe 'test an instance of
|
|
24
|
-
it 'should create an instance of
|
|
23
|
+
describe 'test an instance of ForwarderDeliveryListMeta' do
|
|
24
|
+
it 'should create an instance of ForwarderDeliveryListMeta' 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::ForwarderDeliveryListMeta)
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
@@ -39,10 +39,4 @@ describe SmplkitGeneratedClient::Audit::ForwarderListResponse do
|
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
describe 'test attribute "links"' 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
42
|
end
|
data/lib/smplkit/_generated/audit/spec/models/{action_list_meta_spec.rb → list_meta_spec.rb}
RENAMED
|
@@ -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::ListMeta
|
|
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::ListMeta do
|
|
21
|
+
#let(:instance) { SmplkitGeneratedClient::Audit::ListMeta.new }
|
|
22
22
|
|
|
23
|
-
describe 'test an instance of
|
|
24
|
-
it 'should create an instance of
|
|
23
|
+
describe 'test an instance of ListMeta' do
|
|
24
|
+
it 'should create an instance of ListMeta' 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::ListMeta)
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
describe 'test attribute "
|
|
30
|
+
describe 'test attribute "pagination"' 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
|
|
@@ -0,0 +1,54 @@
|
|
|
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::PaginationMeta
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe SmplkitGeneratedClient::Audit::PaginationMeta do
|
|
21
|
+
#let(:instance) { SmplkitGeneratedClient::Audit::PaginationMeta.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of PaginationMeta' do
|
|
24
|
+
it 'should create an instance of PaginationMeta' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(SmplkitGeneratedClient::Audit::PaginationMeta)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "page"' 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 "size"' 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 "total"' 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 "total_pages"' 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
|
|
@@ -39,10 +39,4 @@ describe SmplkitGeneratedClient::Audit::ResourceTypeListResponse do
|
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
describe 'test attribute "links"' 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
42
|
end
|
|
@@ -11,25 +11,26 @@ module Smplkit
|
|
|
11
11
|
# specific resource_type, powering the cascading-filter behavior
|
|
12
12
|
# on the Activity tab.
|
|
13
13
|
#
|
|
14
|
-
# ADR-047 §2.5. Sorted alphabetically;
|
|
15
|
-
# +
|
|
14
|
+
# ADR-047 §2.5. Sorted alphabetically; offset pagination
|
|
15
|
+
# (+page_number+ / +page_size+) per ADR-014.
|
|
16
16
|
class Actions
|
|
17
17
|
def initialize(api)
|
|
18
18
|
@api = api
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
def list(filter_resource_type: nil, page_size: nil,
|
|
21
|
+
def list(filter_resource_type: nil, page_number: nil, page_size: nil, meta_total: nil)
|
|
22
22
|
opts = {}
|
|
23
23
|
opts[:filter_resource_type] = filter_resource_type if filter_resource_type
|
|
24
|
+
opts[:page_number] = page_number if page_number
|
|
24
25
|
opts[:page_size] = page_size if page_size
|
|
25
|
-
opts[:
|
|
26
|
+
opts[:meta_total] = meta_total unless meta_total.nil?
|
|
26
27
|
|
|
27
28
|
resp = Smplkit::Audit.call_api { @api.list_actions(opts) }
|
|
28
29
|
rows = (resp.data || []).map { |r| Action.from_resource(r) }
|
|
29
|
-
ActionListPage.new(rows, Smplkit::Audit.
|
|
30
|
+
ActionListPage.new(rows, Smplkit::Audit.extract_pagination(resp.meta))
|
|
30
31
|
end
|
|
31
32
|
end
|
|
32
33
|
|
|
33
|
-
ActionListPage = Struct.new(:actions, :
|
|
34
|
+
ActionListPage = Struct.new(:actions, :pagination)
|
|
34
35
|
end
|
|
35
36
|
end
|
data/lib/smplkit/audit/models.rb
CHANGED
|
@@ -35,6 +35,20 @@ module Smplkit
|
|
|
35
35
|
amp ? token[0...amp] : token
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
+
# Pull the offset-pagination block out of a JSON:API +meta+ envelope.
|
|
39
|
+
# Returns a hash with +:page+/+:size+ (and +:total+/+:total_pages+ when
|
|
40
|
+
# the request opted into +meta[total]=true+). Always returns a hash so
|
|
41
|
+
# callers don't have to nil-check before reading individual keys.
|
|
42
|
+
def self.extract_pagination(meta)
|
|
43
|
+
pagination = meta&.pagination
|
|
44
|
+
return {} if pagination.nil?
|
|
45
|
+
|
|
46
|
+
out = { page: pagination.page, size: pagination.size }
|
|
47
|
+
out[:total] = pagination.total unless pagination.total.nil?
|
|
48
|
+
out[:total_pages] = pagination.total_pages unless pagination.total_pages.nil?
|
|
49
|
+
out
|
|
50
|
+
end
|
|
51
|
+
|
|
38
52
|
# Public-facing enum for SIEM streaming destination types.
|
|
39
53
|
#
|
|
40
54
|
# Mirrors the +ForwarderType+ enum the audit OpenAPI spec emits
|