smplkit 1.0.22 → 1.0.24
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/billing_api.rb +0 -125
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/account.rb +49 -5
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{catalog_bundle_resource.rb → next_tier_meta.rb} +60 -68
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_attributes.rb +1 -11
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_list_meta.rb +302 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_list_response.rb +13 -4
- data/lib/smplkit/_generated/app/lib/smplkit_app_client.rb +2 -9
- data/lib/smplkit/_generated/app/spec/api/billing_api_spec.rb +0 -23
- data/lib/smplkit/_generated/app/spec/models/account_spec.rb +24 -0
- data/lib/smplkit/_generated/app/spec/models/{bundle_attributes_spec.rb → next_tier_meta_spec.rb} +9 -15
- data/lib/smplkit/_generated/app/spec/models/subscription_attributes_spec.rb +0 -6
- data/lib/smplkit/_generated/app/spec/models/subscription_list_meta_spec.rb +70 -0
- data/lib/smplkit/_generated/app/spec/models/subscription_list_response_spec.rb +6 -0
- data/lib/smplkit/audit/client.rb +6 -3
- data/lib/smplkit/audit/events.rb +7 -4
- data/lib/smplkit/audit/forwarders.rb +246 -0
- data/lib/smplkit/audit/functions.rb +58 -0
- data/lib/smplkit.rb +2 -0
- metadata +7 -19
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/bundle_attributes.rb +0 -246
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/bundle_list_response.rb +0 -166
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/bundle_resource.rb +0 -224
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/bundle_response.rb +0 -164
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/catalog_bundle_attributes.rb +0 -244
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_bundle_attributes.rb +0 -174
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_bundle_body.rb +0 -164
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_bundle_data.rb +0 -214
- data/lib/smplkit/_generated/app/spec/models/bundle_list_response_spec.rb +0 -36
- data/lib/smplkit/_generated/app/spec/models/bundle_resource_spec.rb +0 -52
- data/lib/smplkit/_generated/app/spec/models/bundle_response_spec.rb +0 -36
- data/lib/smplkit/_generated/app/spec/models/catalog_bundle_attributes_spec.rb +0 -54
- data/lib/smplkit/_generated/app/spec/models/catalog_bundle_resource_spec.rb +0 -52
- data/lib/smplkit/_generated/app/spec/models/create_bundle_attributes_spec.rb +0 -42
- data/lib/smplkit/_generated/app/spec/models/create_bundle_body_spec.rb +0 -36
- data/lib/smplkit/_generated/app/spec/models/create_bundle_data_spec.rb +0 -46
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Smplkit
|
|
4
|
+
module Audit
|
|
5
|
+
# SIEM streaming forwarders for the authenticated account.
|
|
6
|
+
#
|
|
7
|
+
# Pro tier only — every method here raises a wrapped 402
|
|
8
|
+
# +SmplkitGeneratedClient::Audit::ApiError+ on lower tiers.
|
|
9
|
+
class Forwarders
|
|
10
|
+
attr_reader :deliveries, :actions
|
|
11
|
+
|
|
12
|
+
def initialize(api)
|
|
13
|
+
@api = api
|
|
14
|
+
@deliveries = ForwarderDeliveries.new(api)
|
|
15
|
+
@actions = ForwarderActions.new(api)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def create(name:, forwarder_type:, http:, enabled: true,
|
|
19
|
+
filter: nil, transform: nil, data: nil)
|
|
20
|
+
body = wrap_forwarder(nil, name, forwarder_type, http, enabled, filter, transform, data)
|
|
21
|
+
resp = @api.create_forwarder(body)
|
|
22
|
+
Forwarder.from_resource(resp.data)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def list(forwarder_type: nil, enabled: nil, page_size: nil, page_after: nil)
|
|
26
|
+
opts = {}
|
|
27
|
+
opts[:filter_forwarder_type] = forwarder_type if forwarder_type
|
|
28
|
+
opts[:filter_enabled] = enabled unless enabled.nil?
|
|
29
|
+
opts[:page_size] = page_size if page_size
|
|
30
|
+
opts[:page_after] = page_after if page_after
|
|
31
|
+
resp = @api.list_forwarders(opts)
|
|
32
|
+
forwarders = (resp.data || []).map { |r| Forwarder.from_resource(r) }
|
|
33
|
+
ListForwardersPage.new(forwarders, Forwarders.next_cursor(resp.links&._next))
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def get(forwarder_id)
|
|
37
|
+
resp = @api.get_forwarder(forwarder_id)
|
|
38
|
+
Forwarder.from_resource(resp.data)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def update(forwarder_id, name:, forwarder_type:, http:, enabled: true,
|
|
42
|
+
filter: nil, transform: nil, data: nil)
|
|
43
|
+
body = wrap_forwarder(forwarder_id, name, forwarder_type, http, enabled, filter, transform, data)
|
|
44
|
+
resp = @api.update_forwarder(forwarder_id, body)
|
|
45
|
+
Forwarder.from_resource(resp.data)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def delete(forwarder_id)
|
|
49
|
+
@api.delete_forwarder(forwarder_id)
|
|
50
|
+
nil
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def self.next_cursor(link)
|
|
54
|
+
return nil unless link.is_a?(String)
|
|
55
|
+
|
|
56
|
+
idx = link.index("page[after]=")
|
|
57
|
+
return nil if idx.nil?
|
|
58
|
+
|
|
59
|
+
token = link[(idx + "page[after]=".length)..]
|
|
60
|
+
amp = token.index("&")
|
|
61
|
+
amp ? token[0...amp] : token
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
private
|
|
65
|
+
|
|
66
|
+
def wrap_forwarder(id, name, forwarder_type, http, enabled, filter, transform, data)
|
|
67
|
+
attrs = SmplkitGeneratedClient::Audit::Forwarder.new(
|
|
68
|
+
name: name,
|
|
69
|
+
forwarder_type: forwarder_type,
|
|
70
|
+
enabled: enabled,
|
|
71
|
+
# Server-side validation rejects ``data: null`` (the field is
|
|
72
|
+
# required-non-null in the OpenAPI schema). Default to an empty
|
|
73
|
+
# hash mirroring the AuditEvents.record fix.
|
|
74
|
+
data: data || {},
|
|
75
|
+
http: ForwarderHttp.to_wire(http),
|
|
76
|
+
filter: filter,
|
|
77
|
+
transform: transform
|
|
78
|
+
)
|
|
79
|
+
resource = SmplkitGeneratedClient::Audit::ForwarderResource.new(
|
|
80
|
+
id: id ? id.to_s : "",
|
|
81
|
+
type: "forwarder",
|
|
82
|
+
attributes: attrs
|
|
83
|
+
)
|
|
84
|
+
SmplkitGeneratedClient::Audit::ForwarderResponse.new(data: resource)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Sub-namespace for the per-forwarder delivery log + per-delivery retry.
|
|
89
|
+
class ForwarderDeliveries
|
|
90
|
+
attr_reader :actions
|
|
91
|
+
|
|
92
|
+
def initialize(api)
|
|
93
|
+
@api = api
|
|
94
|
+
@actions = DeliveryActions.new(api)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def list(forwarder_id, status: nil, created_at_range: nil, page_size: nil, page_after: nil)
|
|
98
|
+
opts = {}
|
|
99
|
+
opts[:filter_status] = status if status
|
|
100
|
+
opts[:filter_created_at] = created_at_range if created_at_range
|
|
101
|
+
opts[:page_size] = page_size if page_size
|
|
102
|
+
opts[:page_after] = page_after if page_after
|
|
103
|
+
resp = @api.list_forwarder_deliveries(forwarder_id, opts)
|
|
104
|
+
deliveries = (resp.data || []).map { |r| ForwarderDelivery.from_resource(r) }
|
|
105
|
+
ListDeliveriesPage.new(deliveries, Forwarders.next_cursor(resp.links&._next))
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# +client.audit.forwarders.deliveries.actions.retry(forwarder_id, delivery_id)+
|
|
110
|
+
class DeliveryActions
|
|
111
|
+
def initialize(api)
|
|
112
|
+
@api = api
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def retry(forwarder_id, delivery_id)
|
|
116
|
+
resp = @api.retry_forwarder_delivery(forwarder_id, delivery_id)
|
|
117
|
+
ForwarderDelivery.from_resource(resp.data)
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# +client.audit.forwarders.actions.retry_failed_deliveries(forwarder_id)+
|
|
122
|
+
class ForwarderActions
|
|
123
|
+
def initialize(api)
|
|
124
|
+
@api = api
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def retry_failed_deliveries(forwarder_id)
|
|
128
|
+
resp = @api.retry_failed_forwarder_deliveries(forwarder_id)
|
|
129
|
+
RetryFailedDeliveriesSummary.new(
|
|
130
|
+
attempted: resp.attempted,
|
|
131
|
+
succeeded: resp.succeeded,
|
|
132
|
+
failed: resp.failed
|
|
133
|
+
)
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# ----------------------------------------------------------------------
|
|
138
|
+
# Public-facing model structs
|
|
139
|
+
# ----------------------------------------------------------------------
|
|
140
|
+
|
|
141
|
+
HttpHeader = Struct.new(:name, :value, keyword_init: true)
|
|
142
|
+
|
|
143
|
+
# rubocop:disable Lint/StructNewOverride -- ``:method`` matches the
|
|
144
|
+
# API attribute and shadowing Struct#method is the expected ergonomics.
|
|
145
|
+
ForwarderHttp = Struct.new(:method, :url, :headers, :body, :success_status, keyword_init: true) do
|
|
146
|
+
def initialize(method: "POST", url: "", headers: nil, body: nil, success_status: "2xx")
|
|
147
|
+
super(method: method, url: url, headers: headers || [], body: body, success_status: success_status)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def self.to_wire(src)
|
|
151
|
+
h = src.is_a?(Hash) ? new(**src) : src
|
|
152
|
+
SmplkitGeneratedClient::Audit::ForwarderHttp.new(
|
|
153
|
+
method: h.method,
|
|
154
|
+
url: h.url,
|
|
155
|
+
headers: (h.headers || []).map do |hdr|
|
|
156
|
+
name, value = if hdr.is_a?(Hash)
|
|
157
|
+
[hdr[:name] || hdr["name"],
|
|
158
|
+
hdr[:value] || hdr["value"]]
|
|
159
|
+
else
|
|
160
|
+
[hdr.name, hdr.value]
|
|
161
|
+
end
|
|
162
|
+
SmplkitGeneratedClient::Audit::HttpHeader.new(name: name, value: value)
|
|
163
|
+
end,
|
|
164
|
+
body: h.body,
|
|
165
|
+
success_status: h.success_status
|
|
166
|
+
)
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
def self.from_wire(src)
|
|
170
|
+
return new if src.nil?
|
|
171
|
+
|
|
172
|
+
new(
|
|
173
|
+
method: src.method || "POST",
|
|
174
|
+
url: src.url || "",
|
|
175
|
+
headers: (src.headers || []).map { |h| HttpHeader.new(name: h.name, value: h.value) },
|
|
176
|
+
body: src.body,
|
|
177
|
+
success_status: src.success_status || "2xx"
|
|
178
|
+
)
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
# rubocop:enable Lint/StructNewOverride
|
|
182
|
+
|
|
183
|
+
# rubocop:disable Lint/StructNewOverride -- ``:filter`` matches the
|
|
184
|
+
# API attribute and shadowing Struct#filter is the expected ergonomics.
|
|
185
|
+
Forwarder = Struct.new(
|
|
186
|
+
:id, :name, :slug, :forwarder_type, :enabled,
|
|
187
|
+
:filter, :transform, :http, :data,
|
|
188
|
+
:created_at, :updated_at, :deleted_at, :version,
|
|
189
|
+
keyword_init: true
|
|
190
|
+
) do
|
|
191
|
+
def self.from_resource(resource)
|
|
192
|
+
a = resource.attributes
|
|
193
|
+
new(
|
|
194
|
+
id: resource.id,
|
|
195
|
+
name: a.name,
|
|
196
|
+
slug: a.slug,
|
|
197
|
+
forwarder_type: a.forwarder_type,
|
|
198
|
+
enabled: a.enabled.nil? || a.enabled,
|
|
199
|
+
filter: a.filter,
|
|
200
|
+
transform: a.transform,
|
|
201
|
+
http: ForwarderHttp.from_wire(a.http),
|
|
202
|
+
data: a.data || {},
|
|
203
|
+
created_at: a.created_at,
|
|
204
|
+
updated_at: a.updated_at,
|
|
205
|
+
deleted_at: a.deleted_at,
|
|
206
|
+
version: a.version
|
|
207
|
+
)
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
# rubocop:enable Lint/StructNewOverride
|
|
211
|
+
|
|
212
|
+
ListForwardersPage = Struct.new(:forwarders, :next_cursor)
|
|
213
|
+
|
|
214
|
+
ForwarderDelivery = Struct.new(
|
|
215
|
+
:id, :forwarder_id, :event_id, :attempt_number, :status,
|
|
216
|
+
:request, :response_status, :response_body, :latency_ms, :error, :created_at,
|
|
217
|
+
keyword_init: true
|
|
218
|
+
) do
|
|
219
|
+
def self.from_resource(resource)
|
|
220
|
+
a = resource.attributes
|
|
221
|
+
new(
|
|
222
|
+
id: resource.id,
|
|
223
|
+
forwarder_id: a.forwarder_id,
|
|
224
|
+
event_id: a.event_id,
|
|
225
|
+
attempt_number: a.attempt_number,
|
|
226
|
+
status: a.status,
|
|
227
|
+
request: a.request,
|
|
228
|
+
response_status: a.response_status,
|
|
229
|
+
response_body: a.response_body,
|
|
230
|
+
latency_ms: a.latency_ms,
|
|
231
|
+
error: a.error,
|
|
232
|
+
created_at: a.created_at
|
|
233
|
+
)
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
ListDeliveriesPage = Struct.new(:deliveries, :next_cursor)
|
|
238
|
+
|
|
239
|
+
RetryFailedDeliveriesSummary = Struct.new(:attempted, :succeeded, :failed, keyword_init: true)
|
|
240
|
+
|
|
241
|
+
TestForwarderResult = Struct.new(
|
|
242
|
+
:succeeded, :response_status, :response_headers, :response_body, :latency_ms, :error,
|
|
243
|
+
keyword_init: true
|
|
244
|
+
)
|
|
245
|
+
end
|
|
246
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Smplkit
|
|
4
|
+
module Audit
|
|
5
|
+
# +client.audit.functions.test_forwarder.actions.execute(...)+
|
|
6
|
+
class Functions
|
|
7
|
+
attr_reader :test_forwarder
|
|
8
|
+
|
|
9
|
+
def initialize(api)
|
|
10
|
+
@test_forwarder = TestForwarderNamespace.new(api)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Sub-namespace for the test_forwarder action.
|
|
15
|
+
class TestForwarderNamespace
|
|
16
|
+
attr_reader :actions
|
|
17
|
+
|
|
18
|
+
def initialize(api)
|
|
19
|
+
@actions = TestForwarderActions.new(api)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# +execute+ is a server-side proxy that lets the console preview a
|
|
24
|
+
# destination without browser CORS getting in the way. The audit
|
|
25
|
+
# service applies its SSRF guard before resolving the URL —
|
|
26
|
+
# private/loopback/link-local addresses (incl. the EC2 IMDS at
|
|
27
|
+
# +169.254.169.254+) and disallowed ports are rejected.
|
|
28
|
+
class TestForwarderActions
|
|
29
|
+
def initialize(api)
|
|
30
|
+
@api = api
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def execute(url:, method: "POST", headers: nil, body: nil,
|
|
34
|
+
success_status: "2xx", timeout_ms: nil)
|
|
35
|
+
req = SmplkitGeneratedClient::Audit::TestForwarderRequest.new(
|
|
36
|
+
url: url,
|
|
37
|
+
method: method,
|
|
38
|
+
headers: (headers || []).map do |h|
|
|
39
|
+
name, value = h.is_a?(Hash) ? [h[:name] || h["name"], h[:value] || h["value"]] : [h.name, h.value]
|
|
40
|
+
SmplkitGeneratedClient::Audit::HttpHeader.new(name: name, value: value)
|
|
41
|
+
end,
|
|
42
|
+
body: body,
|
|
43
|
+
success_status: success_status,
|
|
44
|
+
timeout_ms: timeout_ms
|
|
45
|
+
)
|
|
46
|
+
resp = @api.execute_test_forwarder(req)
|
|
47
|
+
TestForwarderResult.new(
|
|
48
|
+
succeeded: resp.succeeded || false,
|
|
49
|
+
response_status: resp.response_status,
|
|
50
|
+
response_headers: resp.response_headers || {},
|
|
51
|
+
response_body: resp.response_body || "",
|
|
52
|
+
latency_ms: resp.latency_ms,
|
|
53
|
+
error: resp.error
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
data/lib/smplkit.rb
CHANGED
|
@@ -64,6 +64,8 @@ require_relative "smplkit/management/buffer"
|
|
|
64
64
|
require_relative "smplkit/management/client"
|
|
65
65
|
require_relative "smplkit/audit/buffer"
|
|
66
66
|
require_relative "smplkit/audit/events"
|
|
67
|
+
require_relative "smplkit/audit/forwarders"
|
|
68
|
+
require_relative "smplkit/audit/functions"
|
|
67
69
|
require_relative "smplkit/audit/client"
|
|
68
70
|
require_relative "smplkit/client"
|
|
69
71
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: smplkit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.24
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Smpl Solutions LLC
|
|
@@ -183,12 +183,6 @@ files:
|
|
|
183
183
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/api_key_resource.rb
|
|
184
184
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/api_key_response.rb
|
|
185
185
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/auth_token_response.rb
|
|
186
|
-
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/bundle_attributes.rb
|
|
187
|
-
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/bundle_list_response.rb
|
|
188
|
-
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/bundle_resource.rb
|
|
189
|
-
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/bundle_response.rb
|
|
190
|
-
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/catalog_bundle_attributes.rb
|
|
191
|
-
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/catalog_bundle_resource.rb
|
|
192
186
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/contact_topic.rb
|
|
193
187
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/context.rb
|
|
194
188
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_batch_response.rb
|
|
@@ -201,9 +195,6 @@ files:
|
|
|
201
195
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_type_list_response.rb
|
|
202
196
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_type_resource.rb
|
|
203
197
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/context_type_response.rb
|
|
204
|
-
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_bundle_attributes.rb
|
|
205
|
-
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_bundle_body.rb
|
|
206
|
-
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_bundle_data.rb
|
|
207
198
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_subscription_attributes.rb
|
|
208
199
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_subscription_body.rb
|
|
209
200
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/create_subscription_data.rb
|
|
@@ -238,6 +229,7 @@ files:
|
|
|
238
229
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_rollup_attributes.rb
|
|
239
230
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_rollup_list_response.rb
|
|
240
231
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/metric_rollup_resource.rb
|
|
232
|
+
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/next_tier_meta.rb
|
|
241
233
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/oidc_provider.rb
|
|
242
234
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/page_meta.rb
|
|
243
235
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/payment_method.rb
|
|
@@ -261,6 +253,7 @@ files:
|
|
|
261
253
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/setup_intent_resource.rb
|
|
262
254
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/setup_intent_response.rb
|
|
263
255
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_attributes.rb
|
|
256
|
+
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_list_meta.rb
|
|
264
257
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_list_response.rb
|
|
265
258
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_resource.rb
|
|
266
259
|
- lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_response.rb
|
|
@@ -299,12 +292,6 @@ files:
|
|
|
299
292
|
- lib/smplkit/_generated/app/spec/models/api_key_response_spec.rb
|
|
300
293
|
- lib/smplkit/_generated/app/spec/models/api_key_spec.rb
|
|
301
294
|
- lib/smplkit/_generated/app/spec/models/auth_token_response_spec.rb
|
|
302
|
-
- lib/smplkit/_generated/app/spec/models/bundle_attributes_spec.rb
|
|
303
|
-
- lib/smplkit/_generated/app/spec/models/bundle_list_response_spec.rb
|
|
304
|
-
- lib/smplkit/_generated/app/spec/models/bundle_resource_spec.rb
|
|
305
|
-
- lib/smplkit/_generated/app/spec/models/bundle_response_spec.rb
|
|
306
|
-
- lib/smplkit/_generated/app/spec/models/catalog_bundle_attributes_spec.rb
|
|
307
|
-
- lib/smplkit/_generated/app/spec/models/catalog_bundle_resource_spec.rb
|
|
308
295
|
- lib/smplkit/_generated/app/spec/models/contact_topic_spec.rb
|
|
309
296
|
- lib/smplkit/_generated/app/spec/models/context_batch_response_spec.rb
|
|
310
297
|
- lib/smplkit/_generated/app/spec/models/context_bulk_item_spec.rb
|
|
@@ -317,9 +304,6 @@ files:
|
|
|
317
304
|
- lib/smplkit/_generated/app/spec/models/context_type_resource_spec.rb
|
|
318
305
|
- lib/smplkit/_generated/app/spec/models/context_type_response_spec.rb
|
|
319
306
|
- lib/smplkit/_generated/app/spec/models/context_type_spec.rb
|
|
320
|
-
- lib/smplkit/_generated/app/spec/models/create_bundle_attributes_spec.rb
|
|
321
|
-
- lib/smplkit/_generated/app/spec/models/create_bundle_body_spec.rb
|
|
322
|
-
- lib/smplkit/_generated/app/spec/models/create_bundle_data_spec.rb
|
|
323
307
|
- lib/smplkit/_generated/app/spec/models/create_subscription_attributes_spec.rb
|
|
324
308
|
- lib/smplkit/_generated/app/spec/models/create_subscription_body_spec.rb
|
|
325
309
|
- lib/smplkit/_generated/app/spec/models/create_subscription_data_spec.rb
|
|
@@ -354,6 +338,7 @@ files:
|
|
|
354
338
|
- lib/smplkit/_generated/app/spec/models/metric_rollup_attributes_spec.rb
|
|
355
339
|
- lib/smplkit/_generated/app/spec/models/metric_rollup_list_response_spec.rb
|
|
356
340
|
- lib/smplkit/_generated/app/spec/models/metric_rollup_resource_spec.rb
|
|
341
|
+
- lib/smplkit/_generated/app/spec/models/next_tier_meta_spec.rb
|
|
357
342
|
- lib/smplkit/_generated/app/spec/models/oidc_provider_spec.rb
|
|
358
343
|
- lib/smplkit/_generated/app/spec/models/page_meta_spec.rb
|
|
359
344
|
- lib/smplkit/_generated/app/spec/models/payment_method_list_response_spec.rb
|
|
@@ -377,6 +362,7 @@ files:
|
|
|
377
362
|
- lib/smplkit/_generated/app/spec/models/setup_intent_resource_spec.rb
|
|
378
363
|
- lib/smplkit/_generated/app/spec/models/setup_intent_response_spec.rb
|
|
379
364
|
- lib/smplkit/_generated/app/spec/models/subscription_attributes_spec.rb
|
|
365
|
+
- lib/smplkit/_generated/app/spec/models/subscription_list_meta_spec.rb
|
|
380
366
|
- lib/smplkit/_generated/app/spec/models/subscription_list_response_spec.rb
|
|
381
367
|
- lib/smplkit/_generated/app/spec/models/subscription_resource_spec.rb
|
|
382
368
|
- lib/smplkit/_generated/app/spec/models/subscription_response_spec.rb
|
|
@@ -597,6 +583,8 @@ files:
|
|
|
597
583
|
- lib/smplkit/audit/buffer.rb
|
|
598
584
|
- lib/smplkit/audit/client.rb
|
|
599
585
|
- lib/smplkit/audit/events.rb
|
|
586
|
+
- lib/smplkit/audit/forwarders.rb
|
|
587
|
+
- lib/smplkit/audit/functions.rb
|
|
600
588
|
- lib/smplkit/client.rb
|
|
601
589
|
- lib/smplkit/config/client.rb
|
|
602
590
|
- lib/smplkit/config/helpers.rb
|
|
@@ -1,246 +0,0 @@
|
|
|
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
|
-
class BundleAttributes < ApiModelBase
|
|
18
|
-
attr_accessor :bundle
|
|
19
|
-
|
|
20
|
-
attr_accessor :plan
|
|
21
|
-
|
|
22
|
-
attr_accessor :products
|
|
23
|
-
|
|
24
|
-
attr_accessor :subscriptions
|
|
25
|
-
|
|
26
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
|
27
|
-
def self.attribute_map
|
|
28
|
-
{
|
|
29
|
-
:'bundle' => :'bundle',
|
|
30
|
-
:'plan' => :'plan',
|
|
31
|
-
:'products' => :'products',
|
|
32
|
-
:'subscriptions' => :'subscriptions'
|
|
33
|
-
}
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# Returns attribute mapping this model knows about
|
|
37
|
-
def self.acceptable_attribute_map
|
|
38
|
-
attribute_map
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
# Returns all the JSON keys this model knows about
|
|
42
|
-
def self.acceptable_attributes
|
|
43
|
-
acceptable_attribute_map.values
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
# Attribute type mapping.
|
|
47
|
-
def self.openapi_types
|
|
48
|
-
{
|
|
49
|
-
:'bundle' => :'String',
|
|
50
|
-
:'plan' => :'String',
|
|
51
|
-
:'products' => :'Array<String>',
|
|
52
|
-
:'subscriptions' => :'Array<String>'
|
|
53
|
-
}
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
# List of attributes with nullable: true
|
|
57
|
-
def self.openapi_nullable
|
|
58
|
-
Set.new([
|
|
59
|
-
])
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
# Initializes the object
|
|
63
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
-
def initialize(attributes = {})
|
|
65
|
-
if (!attributes.is_a?(Hash))
|
|
66
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::BundleAttributes` initialize method"
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
-
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
-
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::BundleAttributes`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
-
end
|
|
75
|
-
h[k.to_sym] = v
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if attributes.key?(:'bundle')
|
|
79
|
-
self.bundle = attributes[:'bundle']
|
|
80
|
-
else
|
|
81
|
-
self.bundle = nil
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
if attributes.key?(:'plan')
|
|
85
|
-
self.plan = attributes[:'plan']
|
|
86
|
-
else
|
|
87
|
-
self.plan = nil
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
if attributes.key?(:'products')
|
|
91
|
-
if (value = attributes[:'products']).is_a?(Array)
|
|
92
|
-
self.products = value
|
|
93
|
-
end
|
|
94
|
-
else
|
|
95
|
-
self.products = nil
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
if attributes.key?(:'subscriptions')
|
|
99
|
-
if (value = attributes[:'subscriptions']).is_a?(Array)
|
|
100
|
-
self.subscriptions = value
|
|
101
|
-
end
|
|
102
|
-
else
|
|
103
|
-
self.subscriptions = nil
|
|
104
|
-
end
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
|
108
|
-
# @return Array for valid properties with the reasons
|
|
109
|
-
def list_invalid_properties
|
|
110
|
-
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
111
|
-
invalid_properties = Array.new
|
|
112
|
-
if @bundle.nil?
|
|
113
|
-
invalid_properties.push('invalid value for "bundle", bundle cannot be nil.')
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
if @plan.nil?
|
|
117
|
-
invalid_properties.push('invalid value for "plan", plan cannot be nil.')
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
if @products.nil?
|
|
121
|
-
invalid_properties.push('invalid value for "products", products cannot be nil.')
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
if @subscriptions.nil?
|
|
125
|
-
invalid_properties.push('invalid value for "subscriptions", subscriptions cannot be nil.')
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
invalid_properties
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
# Check to see if the all the properties in the model are valid
|
|
132
|
-
# @return true if the model is valid
|
|
133
|
-
def valid?
|
|
134
|
-
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
135
|
-
return false if @bundle.nil?
|
|
136
|
-
return false if @plan.nil?
|
|
137
|
-
return false if @products.nil?
|
|
138
|
-
return false if @subscriptions.nil?
|
|
139
|
-
true
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
# Custom attribute writer method with validation
|
|
143
|
-
# @param [Object] bundle Value to be assigned
|
|
144
|
-
def bundle=(bundle)
|
|
145
|
-
if bundle.nil?
|
|
146
|
-
fail ArgumentError, 'bundle cannot be nil'
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
@bundle = bundle
|
|
150
|
-
end
|
|
151
|
-
|
|
152
|
-
# Custom attribute writer method with validation
|
|
153
|
-
# @param [Object] plan Value to be assigned
|
|
154
|
-
def plan=(plan)
|
|
155
|
-
if plan.nil?
|
|
156
|
-
fail ArgumentError, 'plan cannot be nil'
|
|
157
|
-
end
|
|
158
|
-
|
|
159
|
-
@plan = plan
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
# Custom attribute writer method with validation
|
|
163
|
-
# @param [Object] products Value to be assigned
|
|
164
|
-
def products=(products)
|
|
165
|
-
if products.nil?
|
|
166
|
-
fail ArgumentError, 'products cannot be nil'
|
|
167
|
-
end
|
|
168
|
-
|
|
169
|
-
@products = products
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
# Custom attribute writer method with validation
|
|
173
|
-
# @param [Object] subscriptions Value to be assigned
|
|
174
|
-
def subscriptions=(subscriptions)
|
|
175
|
-
if subscriptions.nil?
|
|
176
|
-
fail ArgumentError, 'subscriptions cannot be nil'
|
|
177
|
-
end
|
|
178
|
-
|
|
179
|
-
@subscriptions = subscriptions
|
|
180
|
-
end
|
|
181
|
-
|
|
182
|
-
# Checks equality by comparing each attribute.
|
|
183
|
-
# @param [Object] Object to be compared
|
|
184
|
-
def ==(o)
|
|
185
|
-
return true if self.equal?(o)
|
|
186
|
-
self.class == o.class &&
|
|
187
|
-
bundle == o.bundle &&
|
|
188
|
-
plan == o.plan &&
|
|
189
|
-
products == o.products &&
|
|
190
|
-
subscriptions == o.subscriptions
|
|
191
|
-
end
|
|
192
|
-
|
|
193
|
-
# @see the `==` method
|
|
194
|
-
# @param [Object] Object to be compared
|
|
195
|
-
def eql?(o)
|
|
196
|
-
self == o
|
|
197
|
-
end
|
|
198
|
-
|
|
199
|
-
# Calculates hash code according to all attributes.
|
|
200
|
-
# @return [Integer] Hash code
|
|
201
|
-
def hash
|
|
202
|
-
[bundle, plan, products, subscriptions].hash
|
|
203
|
-
end
|
|
204
|
-
|
|
205
|
-
# Builds the object from hash
|
|
206
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
207
|
-
# @return [Object] Returns the model itself
|
|
208
|
-
def self.build_from_hash(attributes)
|
|
209
|
-
return nil unless attributes.is_a?(Hash)
|
|
210
|
-
attributes = attributes.transform_keys(&:to_sym)
|
|
211
|
-
transformed_hash = {}
|
|
212
|
-
openapi_types.each_pair do |key, type|
|
|
213
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
214
|
-
transformed_hash["#{key}"] = nil
|
|
215
|
-
elsif type =~ /\AArray<(.*)>/i
|
|
216
|
-
# check to ensure the input is an array given that the attribute
|
|
217
|
-
# is documented as an array but the input is not
|
|
218
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
|
219
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
220
|
-
end
|
|
221
|
-
elsif !attributes[attribute_map[key]].nil?
|
|
222
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
223
|
-
end
|
|
224
|
-
end
|
|
225
|
-
new(transformed_hash)
|
|
226
|
-
end
|
|
227
|
-
|
|
228
|
-
# Returns the object in the form of hash
|
|
229
|
-
# @return [Hash] Returns the object in the form of hash
|
|
230
|
-
def to_hash
|
|
231
|
-
hash = {}
|
|
232
|
-
self.class.attribute_map.each_pair do |attr, param|
|
|
233
|
-
value = self.send(attr)
|
|
234
|
-
if value.nil?
|
|
235
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
236
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
237
|
-
end
|
|
238
|
-
|
|
239
|
-
hash[param] = _to_hash(value)
|
|
240
|
-
end
|
|
241
|
-
hash
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
end
|
|
245
|
-
|
|
246
|
-
end
|