hook0-client 2.0.0
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 +7 -0
- data/README.md +235 -0
- data/assets/ruby-flow.svg +153 -0
- data/lib/hook0/client.rb +691 -0
- data/lib/hook0/errors.rb +78 -0
- data/lib/hook0/generated/all.rb +7 -0
- data/lib/hook0/generated/api.rb +1097 -0
- data/lib/hook0/generated/errors.rb +235 -0
- data/lib/hook0/generated/models.rb +3093 -0
- data/lib/hook0/runtime.rb +299 -0
- data/lib/hook0/signature.rb +294 -0
- data/lib/hook0/transport.rb +359 -0
- data/lib/hook0/version.rb +6 -0
- data/lib/hook0.rb +23 -0
- metadata +90 -0
|
@@ -0,0 +1,3093 @@
|
|
|
1
|
+
# Generated by hook0-sdkgen from the OpenAPI snapshot the API crate commits.
|
|
2
|
+
# Do not edit by hand: run `UPDATE_SDK=ruby cargo test -p hook0-sdkgen sdk_targets` and commit the result.
|
|
3
|
+
# frozen_string_literal: true
|
|
4
|
+
|
|
5
|
+
require "date"
|
|
6
|
+
require "time"
|
|
7
|
+
|
|
8
|
+
require_relative "../runtime"
|
|
9
|
+
|
|
10
|
+
module Hook0
|
|
11
|
+
# Everything the API declares, as the values a caller reads and writes.
|
|
12
|
+
module Generated
|
|
13
|
+
# One of the values the API answers with.
|
|
14
|
+
module ApplicationInfoOnboardingStepsEvent
|
|
15
|
+
TO_DO = "ToDo"
|
|
16
|
+
DONE = "Done"
|
|
17
|
+
|
|
18
|
+
# Every value the API declares for this list.
|
|
19
|
+
VALUES = [
|
|
20
|
+
TO_DO,
|
|
21
|
+
DONE
|
|
22
|
+
].freeze
|
|
23
|
+
|
|
24
|
+
# Whether the API declares that value.
|
|
25
|
+
def self.member?(value)
|
|
26
|
+
VALUES.include?(value)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# One of the values the API answers with.
|
|
31
|
+
module ApplicationInfoOnboardingStepsEventType
|
|
32
|
+
TO_DO = "ToDo"
|
|
33
|
+
DONE = "Done"
|
|
34
|
+
|
|
35
|
+
# Every value the API declares for this list.
|
|
36
|
+
VALUES = [
|
|
37
|
+
TO_DO,
|
|
38
|
+
DONE
|
|
39
|
+
].freeze
|
|
40
|
+
|
|
41
|
+
# Whether the API declares that value.
|
|
42
|
+
def self.member?(value)
|
|
43
|
+
VALUES.include?(value)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# One of the values the API answers with.
|
|
48
|
+
module ApplicationInfoOnboardingStepsSubscription
|
|
49
|
+
TO_DO = "ToDo"
|
|
50
|
+
DONE = "Done"
|
|
51
|
+
|
|
52
|
+
# Every value the API declares for this list.
|
|
53
|
+
VALUES = [
|
|
54
|
+
TO_DO,
|
|
55
|
+
DONE
|
|
56
|
+
].freeze
|
|
57
|
+
|
|
58
|
+
# Whether the API declares that value.
|
|
59
|
+
def self.member?(value)
|
|
60
|
+
VALUES.include?(value)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# One of the values the API answers with.
|
|
65
|
+
module OrganizationInfoOnboardingStepsApplication
|
|
66
|
+
TO_DO = "ToDo"
|
|
67
|
+
DONE = "Done"
|
|
68
|
+
|
|
69
|
+
# Every value the API declares for this list.
|
|
70
|
+
VALUES = [
|
|
71
|
+
TO_DO,
|
|
72
|
+
DONE
|
|
73
|
+
].freeze
|
|
74
|
+
|
|
75
|
+
# Whether the API declares that value.
|
|
76
|
+
def self.member?(value)
|
|
77
|
+
VALUES.include?(value)
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# One of the values the API answers with.
|
|
82
|
+
module OrganizationInfoOnboardingStepsEvent
|
|
83
|
+
TO_DO = "ToDo"
|
|
84
|
+
DONE = "Done"
|
|
85
|
+
|
|
86
|
+
# Every value the API declares for this list.
|
|
87
|
+
VALUES = [
|
|
88
|
+
TO_DO,
|
|
89
|
+
DONE
|
|
90
|
+
].freeze
|
|
91
|
+
|
|
92
|
+
# Whether the API declares that value.
|
|
93
|
+
def self.member?(value)
|
|
94
|
+
VALUES.include?(value)
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# One of the values the API answers with.
|
|
99
|
+
module OrganizationInfoOnboardingStepsEventType
|
|
100
|
+
TO_DO = "ToDo"
|
|
101
|
+
DONE = "Done"
|
|
102
|
+
|
|
103
|
+
# Every value the API declares for this list.
|
|
104
|
+
VALUES = [
|
|
105
|
+
TO_DO,
|
|
106
|
+
DONE
|
|
107
|
+
].freeze
|
|
108
|
+
|
|
109
|
+
# Whether the API declares that value.
|
|
110
|
+
def self.member?(value)
|
|
111
|
+
VALUES.include?(value)
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# One of the values the API answers with.
|
|
116
|
+
module OrganizationInfoOnboardingStepsSubscription
|
|
117
|
+
TO_DO = "ToDo"
|
|
118
|
+
DONE = "Done"
|
|
119
|
+
|
|
120
|
+
# Every value the API declares for this list.
|
|
121
|
+
VALUES = [
|
|
122
|
+
TO_DO,
|
|
123
|
+
DONE
|
|
124
|
+
].freeze
|
|
125
|
+
|
|
126
|
+
# Whether the API declares that value.
|
|
127
|
+
def self.member?(value)
|
|
128
|
+
VALUES.include?(value)
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# One of the values the API answers with.
|
|
133
|
+
module ProblemId
|
|
134
|
+
ORGANIZATION_NAME_MISSING = "OrganizationNameMissing"
|
|
135
|
+
USER_ALREADY_EXIST = "UserAlreadyExist"
|
|
136
|
+
REGISTRATION_DISABLED = "RegistrationDisabled"
|
|
137
|
+
PASSWORD_TOO_SHORT = "PasswordTooShort"
|
|
138
|
+
PASSWORD_TOO_LONG = "PasswordTooLong"
|
|
139
|
+
PASSWORD_SIMILAR_TO_EMAIL = "PasswordSimilarToEmail"
|
|
140
|
+
PASSWORD_SIMILAR_TO_NAME = "PasswordSimilarToName"
|
|
141
|
+
PASSWORD_TOO_COMMON = "PasswordTooCommon"
|
|
142
|
+
PASSWORD_NOT_DIVERSE_ENOUGH = "PasswordNotDiverseEnough"
|
|
143
|
+
ORGANIZATION_IS_NOT_EMPTY = "OrganizationIsNotEmpty"
|
|
144
|
+
INVITED_USER_DOES_NOT_EXIST = "InvitedUserDoesNotExist"
|
|
145
|
+
INVITED_USER_ALREADY_IN_ORGANIZATION = "InvitedUserAlreadyInOrganization"
|
|
146
|
+
APPLICATION_NAME_MISSING = "ApplicationNameMissing"
|
|
147
|
+
INVALID_ROLE = "InvalidRole"
|
|
148
|
+
EVENT_TYPE_ALREADY_EXIST = "EventTypeAlreadyExist"
|
|
149
|
+
EVENT_TYPE_DOES_NOT_EXIST = "EventTypeDoesNotExist"
|
|
150
|
+
UNAUTHORIZED_WORKERS = "UnauthorizedWorkers"
|
|
151
|
+
EVENT_ALREADY_INGESTED = "EventAlreadyIngested"
|
|
152
|
+
EVENT_INVALID_PAYLOAD_CONTENT_TYPE = "EventInvalidPayloadContentType"
|
|
153
|
+
EVENT_INVALID_BASE64_PAYLOAD = "EventInvalidBase64Payload"
|
|
154
|
+
EVENT_INVALID_JSON_PAYLOAD = "EventInvalidJsonPayload"
|
|
155
|
+
LABELS_AMBIGUITY = "LabelsAmbiguity"
|
|
156
|
+
INVALID_DATE_RANGE = "InvalidDateRange"
|
|
157
|
+
AUTH_NO_AUTHORIZATION_HEADER = "AuthNoAuthorizationHeader"
|
|
158
|
+
AUTH_INVALID_AUTHORIZATION_HEADER = "AuthInvalidAuthorizationHeader"
|
|
159
|
+
AUTH_APPLICATION_SECRET_LOOKUP_ERROR = "AuthApplicationSecretLookupError"
|
|
160
|
+
AUTH_INVALID_APPLICATION_SECRET = "AuthInvalidApplicationSecret"
|
|
161
|
+
AUTH_BISCUIT_LOOKUP_ERROR = "AuthBiscuitLookupError"
|
|
162
|
+
AUTH_INVALID_BISCUIT = "AuthInvalidBiscuit"
|
|
163
|
+
AUTH_FAILED_LOGIN = "AuthFailedLogin"
|
|
164
|
+
AUTH_EMAIL_NOT_VERIFIED = "AuthEmailNotVerified"
|
|
165
|
+
AUTH_EMAIL_ALREADY_VERIFIED = "AuthEmailAlreadyVerified"
|
|
166
|
+
AUTH_FAILED_REFRESH = "AuthFailedRefresh"
|
|
167
|
+
AUTH_EMAIL_EXPIRED = "AuthEmailExpired"
|
|
168
|
+
TOO_MANY_MEMBERS_PER_ORGANIZATION = "TooManyMembersPerOrganization"
|
|
169
|
+
TOO_MANY_APPLICATIONS_PER_ORGANIZATION = "TooManyApplicationsPerOrganization"
|
|
170
|
+
TOO_MANY_EVENTS_TODAY = "TooManyEventsToday"
|
|
171
|
+
TOO_MANY_SUBSCRIPTIONS_PER_APPLICATION = "TooManySubscriptionsPerApplication"
|
|
172
|
+
TOO_MANY_EVENT_TYPES_PER_APPLICATION = "TooManyEventTypesPerApplication"
|
|
173
|
+
JSON_PAYLOAD = "JsonPayload"
|
|
174
|
+
VALIDATION = "Validation"
|
|
175
|
+
NOT_FOUND = "NotFound"
|
|
176
|
+
INTERNAL_SERVER_ERROR = "InternalServerError"
|
|
177
|
+
FORBIDDEN = "Forbidden"
|
|
178
|
+
RATE_LIMITED = "RateLimited"
|
|
179
|
+
SERVICE_UNAVAILABLE = "ServiceUnavailable"
|
|
180
|
+
|
|
181
|
+
# Every value the API declares for this list.
|
|
182
|
+
VALUES = [
|
|
183
|
+
ORGANIZATION_NAME_MISSING,
|
|
184
|
+
USER_ALREADY_EXIST,
|
|
185
|
+
REGISTRATION_DISABLED,
|
|
186
|
+
PASSWORD_TOO_SHORT,
|
|
187
|
+
PASSWORD_TOO_LONG,
|
|
188
|
+
PASSWORD_SIMILAR_TO_EMAIL,
|
|
189
|
+
PASSWORD_SIMILAR_TO_NAME,
|
|
190
|
+
PASSWORD_TOO_COMMON,
|
|
191
|
+
PASSWORD_NOT_DIVERSE_ENOUGH,
|
|
192
|
+
ORGANIZATION_IS_NOT_EMPTY,
|
|
193
|
+
INVITED_USER_DOES_NOT_EXIST,
|
|
194
|
+
INVITED_USER_ALREADY_IN_ORGANIZATION,
|
|
195
|
+
APPLICATION_NAME_MISSING,
|
|
196
|
+
INVALID_ROLE,
|
|
197
|
+
EVENT_TYPE_ALREADY_EXIST,
|
|
198
|
+
EVENT_TYPE_DOES_NOT_EXIST,
|
|
199
|
+
UNAUTHORIZED_WORKERS,
|
|
200
|
+
EVENT_ALREADY_INGESTED,
|
|
201
|
+
EVENT_INVALID_PAYLOAD_CONTENT_TYPE,
|
|
202
|
+
EVENT_INVALID_BASE64_PAYLOAD,
|
|
203
|
+
EVENT_INVALID_JSON_PAYLOAD,
|
|
204
|
+
LABELS_AMBIGUITY,
|
|
205
|
+
INVALID_DATE_RANGE,
|
|
206
|
+
AUTH_NO_AUTHORIZATION_HEADER,
|
|
207
|
+
AUTH_INVALID_AUTHORIZATION_HEADER,
|
|
208
|
+
AUTH_APPLICATION_SECRET_LOOKUP_ERROR,
|
|
209
|
+
AUTH_INVALID_APPLICATION_SECRET,
|
|
210
|
+
AUTH_BISCUIT_LOOKUP_ERROR,
|
|
211
|
+
AUTH_INVALID_BISCUIT,
|
|
212
|
+
AUTH_FAILED_LOGIN,
|
|
213
|
+
AUTH_EMAIL_NOT_VERIFIED,
|
|
214
|
+
AUTH_EMAIL_ALREADY_VERIFIED,
|
|
215
|
+
AUTH_FAILED_REFRESH,
|
|
216
|
+
AUTH_EMAIL_EXPIRED,
|
|
217
|
+
TOO_MANY_MEMBERS_PER_ORGANIZATION,
|
|
218
|
+
TOO_MANY_APPLICATIONS_PER_ORGANIZATION,
|
|
219
|
+
TOO_MANY_EVENTS_TODAY,
|
|
220
|
+
TOO_MANY_SUBSCRIPTIONS_PER_APPLICATION,
|
|
221
|
+
TOO_MANY_EVENT_TYPES_PER_APPLICATION,
|
|
222
|
+
JSON_PAYLOAD,
|
|
223
|
+
VALIDATION,
|
|
224
|
+
NOT_FOUND,
|
|
225
|
+
INTERNAL_SERVER_ERROR,
|
|
226
|
+
FORBIDDEN,
|
|
227
|
+
RATE_LIMITED,
|
|
228
|
+
SERVICE_UNAVAILABLE
|
|
229
|
+
].freeze
|
|
230
|
+
|
|
231
|
+
# Whether the API declares that value.
|
|
232
|
+
def self.member?(value)
|
|
233
|
+
VALUES.include?(value)
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# One of the values the API answers with.
|
|
238
|
+
module RequestAttemptStatusType
|
|
239
|
+
WAITING = "waiting"
|
|
240
|
+
PENDING = "pending"
|
|
241
|
+
IN_PROGRESS = "in_progress"
|
|
242
|
+
SUCCESSFUL = "successful"
|
|
243
|
+
FAILED = "failed"
|
|
244
|
+
|
|
245
|
+
# Every value the API declares for this list.
|
|
246
|
+
VALUES = [
|
|
247
|
+
WAITING,
|
|
248
|
+
PENDING,
|
|
249
|
+
IN_PROGRESS,
|
|
250
|
+
SUCCESSFUL,
|
|
251
|
+
FAILED
|
|
252
|
+
].freeze
|
|
253
|
+
|
|
254
|
+
# Whether the API declares that value.
|
|
255
|
+
def self.member?(value)
|
|
256
|
+
VALUES.include?(value)
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# The `Application` the API declares.
|
|
261
|
+
class Application
|
|
262
|
+
attr_reader :application_id,
|
|
263
|
+
:name,
|
|
264
|
+
:organization_id
|
|
265
|
+
|
|
266
|
+
# @param application_id [String] carries `application_id`: Unique identifier of the application.
|
|
267
|
+
# @param name [String] carries `name`: Name of the application. Length: 2-50 characters.
|
|
268
|
+
# @param organization_id [String] carries `organization_id`: UUID of the organization this application belongs to.
|
|
269
|
+
def initialize(application_id:, name:, organization_id:)
|
|
270
|
+
@application_id = application_id
|
|
271
|
+
@name = name
|
|
272
|
+
@organization_id = organization_id
|
|
273
|
+
freeze
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
# Read one out of what the API answered.
|
|
277
|
+
#
|
|
278
|
+
# @param value [Object] the JSON document the API answered
|
|
279
|
+
# @return [Application]
|
|
280
|
+
def self.from_json(value)
|
|
281
|
+
fields = Runtime.as_fields(value, "Application")
|
|
282
|
+
new(
|
|
283
|
+
application_id: Runtime.read(fields, "application_id", Runtime::UUID),
|
|
284
|
+
name: Runtime.read(fields, "name", Runtime::TEXT),
|
|
285
|
+
organization_id: Runtime.read(fields, "organization_id", Runtime::UUID)
|
|
286
|
+
)
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# Write one back the way the API reads it.
|
|
290
|
+
#
|
|
291
|
+
# @return [Hash{String => Object}]
|
|
292
|
+
def to_h
|
|
293
|
+
out = {}
|
|
294
|
+
out["application_id"] = @application_id
|
|
295
|
+
out["name"] = @name
|
|
296
|
+
out["organization_id"] = @organization_id
|
|
297
|
+
out
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# Whether that value carries the same members as this one.
|
|
301
|
+
#
|
|
302
|
+
# @param other [Object]
|
|
303
|
+
# @return [Boolean]
|
|
304
|
+
def ==(other)
|
|
305
|
+
other.is_a?(Application) && to_h == other.to_h
|
|
306
|
+
end
|
|
307
|
+
alias eql? ==
|
|
308
|
+
|
|
309
|
+
# A value two equal instances share, so that either may key a hash.
|
|
310
|
+
#
|
|
311
|
+
# @return [Integer]
|
|
312
|
+
def hash
|
|
313
|
+
to_h.hash
|
|
314
|
+
end
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
# The `ApplicationInfo` the API declares.
|
|
318
|
+
class ApplicationInfo
|
|
319
|
+
attr_reader :application_id,
|
|
320
|
+
:consumption,
|
|
321
|
+
:name,
|
|
322
|
+
:onboarding_steps,
|
|
323
|
+
:organization_id,
|
|
324
|
+
:quotas
|
|
325
|
+
|
|
326
|
+
# @param application_id [String] carries `application_id`: Unique identifier of the application.
|
|
327
|
+
# @param consumption [ApplicationInfoConsumption] carries `consumption`: Current consumption metrics for this
|
|
328
|
+
# application.
|
|
329
|
+
# @param name [String] carries `name`: Name of the application. Length: 2-50 characters.
|
|
330
|
+
# @param onboarding_steps [ApplicationInfoOnboardingSteps] carries `onboarding_steps`: Onboarding completion
|
|
331
|
+
# status for this application.
|
|
332
|
+
# @param organization_id [String] carries `organization_id`: UUID of the organization this application belongs to.
|
|
333
|
+
# @param quotas [ApplicationInfoQuotas] carries `quotas`: Quota limits for this application.
|
|
334
|
+
def initialize(application_id:, consumption:, name:, onboarding_steps:, organization_id:, quotas:)
|
|
335
|
+
@application_id = application_id
|
|
336
|
+
@consumption = consumption
|
|
337
|
+
@name = name
|
|
338
|
+
@onboarding_steps = onboarding_steps
|
|
339
|
+
@organization_id = organization_id
|
|
340
|
+
@quotas = quotas
|
|
341
|
+
freeze
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
# Read one out of what the API answered.
|
|
345
|
+
#
|
|
346
|
+
# @param value [Object] the JSON document the API answered
|
|
347
|
+
# @return [ApplicationInfo]
|
|
348
|
+
def self.from_json(value)
|
|
349
|
+
fields = Runtime.as_fields(value, "ApplicationInfo")
|
|
350
|
+
new(
|
|
351
|
+
application_id: Runtime.read(fields, "application_id", Runtime::UUID),
|
|
352
|
+
consumption: Runtime.read(fields, "consumption", ApplicationInfoConsumption.method(:from_json)),
|
|
353
|
+
name: Runtime.read(fields, "name", Runtime::TEXT),
|
|
354
|
+
onboarding_steps: Runtime.read(fields, "onboarding_steps", ApplicationInfoOnboardingSteps.method(:from_json)),
|
|
355
|
+
organization_id: Runtime.read(fields, "organization_id", Runtime::UUID),
|
|
356
|
+
quotas: Runtime.read(fields, "quotas", ApplicationInfoQuotas.method(:from_json))
|
|
357
|
+
)
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
# Write one back the way the API reads it.
|
|
361
|
+
#
|
|
362
|
+
# @return [Hash{String => Object}]
|
|
363
|
+
def to_h
|
|
364
|
+
out = {}
|
|
365
|
+
out["application_id"] = @application_id
|
|
366
|
+
out["consumption"] = @consumption.to_h
|
|
367
|
+
out["name"] = @name
|
|
368
|
+
out["onboarding_steps"] = @onboarding_steps.to_h
|
|
369
|
+
out["organization_id"] = @organization_id
|
|
370
|
+
out["quotas"] = @quotas.to_h
|
|
371
|
+
out
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
# Whether that value carries the same members as this one.
|
|
375
|
+
#
|
|
376
|
+
# @param other [Object]
|
|
377
|
+
# @return [Boolean]
|
|
378
|
+
def ==(other)
|
|
379
|
+
other.is_a?(ApplicationInfo) && to_h == other.to_h
|
|
380
|
+
end
|
|
381
|
+
alias eql? ==
|
|
382
|
+
|
|
383
|
+
# A value two equal instances share, so that either may key a hash.
|
|
384
|
+
#
|
|
385
|
+
# @return [Integer]
|
|
386
|
+
def hash
|
|
387
|
+
to_h.hash
|
|
388
|
+
end
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
# The `ApplicationInfoConsumption` the API declares.
|
|
392
|
+
class ApplicationInfoConsumption
|
|
393
|
+
attr_reader :events_per_day
|
|
394
|
+
|
|
395
|
+
# @param events_per_day [Integer, nil] carries `events_per_day`.
|
|
396
|
+
def initialize(events_per_day: nil)
|
|
397
|
+
@events_per_day = events_per_day
|
|
398
|
+
freeze
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
# Read one out of what the API answered.
|
|
402
|
+
#
|
|
403
|
+
# @param value [Object] the JSON document the API answered
|
|
404
|
+
# @return [ApplicationInfoConsumption]
|
|
405
|
+
def self.from_json(value)
|
|
406
|
+
fields = Runtime.as_fields(value, "ApplicationInfoConsumption")
|
|
407
|
+
new(
|
|
408
|
+
events_per_day: Runtime.maybe(fields, "events_per_day", Runtime::INTEGER)
|
|
409
|
+
)
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
# Write one back the way the API reads it.
|
|
413
|
+
#
|
|
414
|
+
# @return [Hash{String => Object}]
|
|
415
|
+
def to_h
|
|
416
|
+
out = {}
|
|
417
|
+
out["events_per_day"] = @events_per_day unless @events_per_day.nil?
|
|
418
|
+
out
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
# Whether that value carries the same members as this one.
|
|
422
|
+
#
|
|
423
|
+
# @param other [Object]
|
|
424
|
+
# @return [Boolean]
|
|
425
|
+
def ==(other)
|
|
426
|
+
other.is_a?(ApplicationInfoConsumption) && to_h == other.to_h
|
|
427
|
+
end
|
|
428
|
+
alias eql? ==
|
|
429
|
+
|
|
430
|
+
# A value two equal instances share, so that either may key a hash.
|
|
431
|
+
#
|
|
432
|
+
# @return [Integer]
|
|
433
|
+
def hash
|
|
434
|
+
to_h.hash
|
|
435
|
+
end
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
# The `ApplicationInfoOnboardingSteps` the API declares.
|
|
439
|
+
class ApplicationInfoOnboardingSteps
|
|
440
|
+
attr_reader :event,
|
|
441
|
+
:event_type,
|
|
442
|
+
:subscription
|
|
443
|
+
|
|
444
|
+
# @param event [String] carries `event`, one of `ApplicationInfoOnboardingStepsEvent::VALUES`.
|
|
445
|
+
# @param event_type [String] carries `event_type`, one of `ApplicationInfoOnboardingStepsEventType::VALUES`.
|
|
446
|
+
# @param subscription [String] carries `subscription`, one of
|
|
447
|
+
# `ApplicationInfoOnboardingStepsSubscription::VALUES`.
|
|
448
|
+
def initialize(event:, event_type:, subscription:)
|
|
449
|
+
@event = event
|
|
450
|
+
@event_type = event_type
|
|
451
|
+
@subscription = subscription
|
|
452
|
+
freeze
|
|
453
|
+
end
|
|
454
|
+
|
|
455
|
+
# Read one out of what the API answered.
|
|
456
|
+
#
|
|
457
|
+
# @param value [Object] the JSON document the API answered
|
|
458
|
+
# @return [ApplicationInfoOnboardingSteps]
|
|
459
|
+
def self.from_json(value)
|
|
460
|
+
fields = Runtime.as_fields(value, "ApplicationInfoOnboardingSteps")
|
|
461
|
+
new(
|
|
462
|
+
event: Runtime.read(fields, "event", Runtime.member_of(ApplicationInfoOnboardingStepsEvent)),
|
|
463
|
+
event_type: Runtime.read(fields, "event_type", Runtime.member_of(ApplicationInfoOnboardingStepsEventType)),
|
|
464
|
+
subscription: Runtime.read(
|
|
465
|
+
fields,
|
|
466
|
+
"subscription",
|
|
467
|
+
Runtime.member_of(ApplicationInfoOnboardingStepsSubscription)
|
|
468
|
+
)
|
|
469
|
+
)
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
# Write one back the way the API reads it.
|
|
473
|
+
#
|
|
474
|
+
# @return [Hash{String => Object}]
|
|
475
|
+
def to_h
|
|
476
|
+
out = {}
|
|
477
|
+
out["event"] = @event
|
|
478
|
+
out["event_type"] = @event_type
|
|
479
|
+
out["subscription"] = @subscription
|
|
480
|
+
out
|
|
481
|
+
end
|
|
482
|
+
|
|
483
|
+
# Whether that value carries the same members as this one.
|
|
484
|
+
#
|
|
485
|
+
# @param other [Object]
|
|
486
|
+
# @return [Boolean]
|
|
487
|
+
def ==(other)
|
|
488
|
+
other.is_a?(ApplicationInfoOnboardingSteps) && to_h == other.to_h
|
|
489
|
+
end
|
|
490
|
+
alias eql? ==
|
|
491
|
+
|
|
492
|
+
# A value two equal instances share, so that either may key a hash.
|
|
493
|
+
#
|
|
494
|
+
# @return [Integer]
|
|
495
|
+
def hash
|
|
496
|
+
to_h.hash
|
|
497
|
+
end
|
|
498
|
+
end
|
|
499
|
+
|
|
500
|
+
# The `ApplicationInfoQuotas` the API declares.
|
|
501
|
+
class ApplicationInfoQuotas
|
|
502
|
+
attr_reader :days_of_events_retention_limit,
|
|
503
|
+
:events_per_day_limit
|
|
504
|
+
|
|
505
|
+
# @param days_of_events_retention_limit [Integer] carries `days_of_events_retention_limit`.
|
|
506
|
+
# @param events_per_day_limit [Integer] carries `events_per_day_limit`.
|
|
507
|
+
def initialize(days_of_events_retention_limit:, events_per_day_limit:)
|
|
508
|
+
@days_of_events_retention_limit = days_of_events_retention_limit
|
|
509
|
+
@events_per_day_limit = events_per_day_limit
|
|
510
|
+
freeze
|
|
511
|
+
end
|
|
512
|
+
|
|
513
|
+
# Read one out of what the API answered.
|
|
514
|
+
#
|
|
515
|
+
# @param value [Object] the JSON document the API answered
|
|
516
|
+
# @return [ApplicationInfoQuotas]
|
|
517
|
+
def self.from_json(value)
|
|
518
|
+
fields = Runtime.as_fields(value, "ApplicationInfoQuotas")
|
|
519
|
+
new(
|
|
520
|
+
days_of_events_retention_limit: Runtime.read(fields, "days_of_events_retention_limit", Runtime::INTEGER),
|
|
521
|
+
events_per_day_limit: Runtime.read(fields, "events_per_day_limit", Runtime::INTEGER)
|
|
522
|
+
)
|
|
523
|
+
end
|
|
524
|
+
|
|
525
|
+
# Write one back the way the API reads it.
|
|
526
|
+
#
|
|
527
|
+
# @return [Hash{String => Object}]
|
|
528
|
+
def to_h
|
|
529
|
+
out = {}
|
|
530
|
+
out["days_of_events_retention_limit"] = @days_of_events_retention_limit
|
|
531
|
+
out["events_per_day_limit"] = @events_per_day_limit
|
|
532
|
+
out
|
|
533
|
+
end
|
|
534
|
+
|
|
535
|
+
# Whether that value carries the same members as this one.
|
|
536
|
+
#
|
|
537
|
+
# @param other [Object]
|
|
538
|
+
# @return [Boolean]
|
|
539
|
+
def ==(other)
|
|
540
|
+
other.is_a?(ApplicationInfoQuotas) && to_h == other.to_h
|
|
541
|
+
end
|
|
542
|
+
alias eql? ==
|
|
543
|
+
|
|
544
|
+
# A value two equal instances share, so that either may key a hash.
|
|
545
|
+
#
|
|
546
|
+
# @return [Integer]
|
|
547
|
+
def hash
|
|
548
|
+
to_h.hash
|
|
549
|
+
end
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
# The `ApplicationPost` the API declares.
|
|
553
|
+
class ApplicationPost
|
|
554
|
+
attr_reader :name,
|
|
555
|
+
:organization_id
|
|
556
|
+
|
|
557
|
+
# @param name [String] carries `name`: Name of the application. Length: 2-50 characters.
|
|
558
|
+
# @param organization_id [String] carries `organization_id`: UUID of the organization this application belongs to.
|
|
559
|
+
def initialize(name:, organization_id:)
|
|
560
|
+
@name = name
|
|
561
|
+
@organization_id = organization_id
|
|
562
|
+
freeze
|
|
563
|
+
end
|
|
564
|
+
|
|
565
|
+
# Read one out of what the API answered.
|
|
566
|
+
#
|
|
567
|
+
# @param value [Object] the JSON document the API answered
|
|
568
|
+
# @return [ApplicationPost]
|
|
569
|
+
def self.from_json(value)
|
|
570
|
+
fields = Runtime.as_fields(value, "ApplicationPost")
|
|
571
|
+
new(
|
|
572
|
+
name: Runtime.read(fields, "name", Runtime::TEXT),
|
|
573
|
+
organization_id: Runtime.read(fields, "organization_id", Runtime::UUID)
|
|
574
|
+
)
|
|
575
|
+
end
|
|
576
|
+
|
|
577
|
+
# Write one back the way the API reads it.
|
|
578
|
+
#
|
|
579
|
+
# @return [Hash{String => Object}]
|
|
580
|
+
def to_h
|
|
581
|
+
out = {}
|
|
582
|
+
out["name"] = @name
|
|
583
|
+
out["organization_id"] = @organization_id
|
|
584
|
+
out
|
|
585
|
+
end
|
|
586
|
+
|
|
587
|
+
# Whether that value carries the same members as this one.
|
|
588
|
+
#
|
|
589
|
+
# @param other [Object]
|
|
590
|
+
# @return [Boolean]
|
|
591
|
+
def ==(other)
|
|
592
|
+
other.is_a?(ApplicationPost) && to_h == other.to_h
|
|
593
|
+
end
|
|
594
|
+
alias eql? ==
|
|
595
|
+
|
|
596
|
+
# A value two equal instances share, so that either may key a hash.
|
|
597
|
+
#
|
|
598
|
+
# @return [Integer]
|
|
599
|
+
def hash
|
|
600
|
+
to_h.hash
|
|
601
|
+
end
|
|
602
|
+
end
|
|
603
|
+
|
|
604
|
+
# The `ApplicationSecret` the API declares.
|
|
605
|
+
class ApplicationSecret
|
|
606
|
+
attr_reader :created_at,
|
|
607
|
+
:token,
|
|
608
|
+
:deleted_at,
|
|
609
|
+
:name
|
|
610
|
+
|
|
611
|
+
# @param created_at [Time] carries `created_at`.
|
|
612
|
+
# @param token [String] carries `token`.
|
|
613
|
+
# @param deleted_at [Time, nil] carries `deleted_at`.
|
|
614
|
+
# @param name [String, nil] carries `name`.
|
|
615
|
+
def initialize(created_at:, token:, deleted_at: nil, name: nil)
|
|
616
|
+
@created_at = created_at
|
|
617
|
+
@token = token
|
|
618
|
+
@deleted_at = deleted_at
|
|
619
|
+
@name = name
|
|
620
|
+
freeze
|
|
621
|
+
end
|
|
622
|
+
|
|
623
|
+
# Read one out of what the API answered.
|
|
624
|
+
#
|
|
625
|
+
# @param value [Object] the JSON document the API answered
|
|
626
|
+
# @return [ApplicationSecret]
|
|
627
|
+
def self.from_json(value)
|
|
628
|
+
fields = Runtime.as_fields(value, "ApplicationSecret")
|
|
629
|
+
new(
|
|
630
|
+
created_at: Runtime.read(fields, "created_at", Runtime::DATE_TIME),
|
|
631
|
+
token: Runtime.read(fields, "token", Runtime::UUID),
|
|
632
|
+
deleted_at: Runtime.maybe(fields, "deleted_at", Runtime::DATE_TIME),
|
|
633
|
+
name: Runtime.maybe(fields, "name", Runtime::TEXT)
|
|
634
|
+
)
|
|
635
|
+
end
|
|
636
|
+
|
|
637
|
+
# Write one back the way the API reads it.
|
|
638
|
+
#
|
|
639
|
+
# @return [Hash{String => Object}]
|
|
640
|
+
def to_h
|
|
641
|
+
out = {}
|
|
642
|
+
out["created_at"] = Runtime.moment(@created_at)
|
|
643
|
+
out["token"] = @token
|
|
644
|
+
out["deleted_at"] = Runtime.moment(@deleted_at) unless @deleted_at.nil?
|
|
645
|
+
out["name"] = @name unless @name.nil?
|
|
646
|
+
out
|
|
647
|
+
end
|
|
648
|
+
|
|
649
|
+
# Whether that value carries the same members as this one.
|
|
650
|
+
#
|
|
651
|
+
# @param other [Object]
|
|
652
|
+
# @return [Boolean]
|
|
653
|
+
def ==(other)
|
|
654
|
+
other.is_a?(ApplicationSecret) && to_h == other.to_h
|
|
655
|
+
end
|
|
656
|
+
alias eql? ==
|
|
657
|
+
|
|
658
|
+
# A value two equal instances share, so that either may key a hash.
|
|
659
|
+
#
|
|
660
|
+
# @return [Integer]
|
|
661
|
+
def hash
|
|
662
|
+
to_h.hash
|
|
663
|
+
end
|
|
664
|
+
end
|
|
665
|
+
|
|
666
|
+
# The `ApplicationSecretPost` the API declares.
|
|
667
|
+
class ApplicationSecretPost
|
|
668
|
+
attr_reader :application_id,
|
|
669
|
+
:name
|
|
670
|
+
|
|
671
|
+
# @param application_id [String] carries `application_id`.
|
|
672
|
+
# @param name [String, nil] carries `name`.
|
|
673
|
+
def initialize(application_id:, name: nil)
|
|
674
|
+
@application_id = application_id
|
|
675
|
+
@name = name
|
|
676
|
+
freeze
|
|
677
|
+
end
|
|
678
|
+
|
|
679
|
+
# Read one out of what the API answered.
|
|
680
|
+
#
|
|
681
|
+
# @param value [Object] the JSON document the API answered
|
|
682
|
+
# @return [ApplicationSecretPost]
|
|
683
|
+
def self.from_json(value)
|
|
684
|
+
fields = Runtime.as_fields(value, "ApplicationSecretPost")
|
|
685
|
+
new(
|
|
686
|
+
application_id: Runtime.read(fields, "application_id", Runtime::UUID),
|
|
687
|
+
name: Runtime.maybe(fields, "name", Runtime::TEXT)
|
|
688
|
+
)
|
|
689
|
+
end
|
|
690
|
+
|
|
691
|
+
# Write one back the way the API reads it.
|
|
692
|
+
#
|
|
693
|
+
# @return [Hash{String => Object}]
|
|
694
|
+
def to_h
|
|
695
|
+
out = {}
|
|
696
|
+
out["application_id"] = @application_id
|
|
697
|
+
out["name"] = @name unless @name.nil?
|
|
698
|
+
out
|
|
699
|
+
end
|
|
700
|
+
|
|
701
|
+
# Whether that value carries the same members as this one.
|
|
702
|
+
#
|
|
703
|
+
# @param other [Object]
|
|
704
|
+
# @return [Boolean]
|
|
705
|
+
def ==(other)
|
|
706
|
+
other.is_a?(ApplicationSecretPost) && to_h == other.to_h
|
|
707
|
+
end
|
|
708
|
+
alias eql? ==
|
|
709
|
+
|
|
710
|
+
# A value two equal instances share, so that either may key a hash.
|
|
711
|
+
#
|
|
712
|
+
# @return [Integer]
|
|
713
|
+
def hash
|
|
714
|
+
to_h.hash
|
|
715
|
+
end
|
|
716
|
+
end
|
|
717
|
+
|
|
718
|
+
# The `Event` the API declares.
|
|
719
|
+
class Event
|
|
720
|
+
attr_reader :event_id,
|
|
721
|
+
:event_type_name,
|
|
722
|
+
:ip,
|
|
723
|
+
:labels,
|
|
724
|
+
:occurred_at,
|
|
725
|
+
:payload_content_type,
|
|
726
|
+
:received_at,
|
|
727
|
+
:metadata
|
|
728
|
+
|
|
729
|
+
# @param event_id [String] carries `event_id`.
|
|
730
|
+
# @param event_type_name [String] carries `event_type_name`.
|
|
731
|
+
# @param ip [String] carries `ip`.
|
|
732
|
+
# @param labels [Object] carries `labels`.
|
|
733
|
+
# @param occurred_at [Time] carries `occurred_at`.
|
|
734
|
+
# @param payload_content_type [String] carries `payload_content_type`.
|
|
735
|
+
# @param received_at [Time] carries `received_at`.
|
|
736
|
+
# @param metadata [Object, nil] carries `metadata`.
|
|
737
|
+
def initialize(
|
|
738
|
+
event_id:,
|
|
739
|
+
event_type_name:,
|
|
740
|
+
ip:,
|
|
741
|
+
labels:,
|
|
742
|
+
occurred_at:,
|
|
743
|
+
payload_content_type:,
|
|
744
|
+
received_at:,
|
|
745
|
+
metadata: nil
|
|
746
|
+
)
|
|
747
|
+
@event_id = event_id
|
|
748
|
+
@event_type_name = event_type_name
|
|
749
|
+
@ip = ip
|
|
750
|
+
@labels = labels
|
|
751
|
+
@occurred_at = occurred_at
|
|
752
|
+
@payload_content_type = payload_content_type
|
|
753
|
+
@received_at = received_at
|
|
754
|
+
@metadata = metadata
|
|
755
|
+
freeze
|
|
756
|
+
end
|
|
757
|
+
|
|
758
|
+
# Read one out of what the API answered.
|
|
759
|
+
#
|
|
760
|
+
# @param value [Object] the JSON document the API answered
|
|
761
|
+
# @return [Event]
|
|
762
|
+
def self.from_json(value)
|
|
763
|
+
fields = Runtime.as_fields(value, "Event")
|
|
764
|
+
new(
|
|
765
|
+
event_id: Runtime.read(fields, "event_id", Runtime::UUID),
|
|
766
|
+
event_type_name: Runtime.read(fields, "event_type_name", Runtime::TEXT),
|
|
767
|
+
ip: Runtime.read(fields, "ip", Runtime::TEXT),
|
|
768
|
+
labels: Runtime.read(fields, "labels", Runtime::JSON_VALUE),
|
|
769
|
+
occurred_at: Runtime.read(fields, "occurred_at", Runtime::DATE_TIME),
|
|
770
|
+
payload_content_type: Runtime.read(fields, "payload_content_type", Runtime::TEXT),
|
|
771
|
+
received_at: Runtime.read(fields, "received_at", Runtime::DATE_TIME),
|
|
772
|
+
metadata: Runtime.maybe(fields, "metadata", Runtime::JSON_VALUE)
|
|
773
|
+
)
|
|
774
|
+
end
|
|
775
|
+
|
|
776
|
+
# Write one back the way the API reads it.
|
|
777
|
+
#
|
|
778
|
+
# @return [Hash{String => Object}]
|
|
779
|
+
def to_h
|
|
780
|
+
out = {}
|
|
781
|
+
out["event_id"] = @event_id
|
|
782
|
+
out["event_type_name"] = @event_type_name
|
|
783
|
+
out["ip"] = @ip
|
|
784
|
+
out["labels"] = @labels
|
|
785
|
+
out["occurred_at"] = Runtime.moment(@occurred_at)
|
|
786
|
+
out["payload_content_type"] = @payload_content_type
|
|
787
|
+
out["received_at"] = Runtime.moment(@received_at)
|
|
788
|
+
out["metadata"] = @metadata unless @metadata.nil?
|
|
789
|
+
out
|
|
790
|
+
end
|
|
791
|
+
|
|
792
|
+
# Whether that value carries the same members as this one.
|
|
793
|
+
#
|
|
794
|
+
# @param other [Object]
|
|
795
|
+
# @return [Boolean]
|
|
796
|
+
def ==(other)
|
|
797
|
+
other.is_a?(Event) && to_h == other.to_h
|
|
798
|
+
end
|
|
799
|
+
alias eql? ==
|
|
800
|
+
|
|
801
|
+
# A value two equal instances share, so that either may key a hash.
|
|
802
|
+
#
|
|
803
|
+
# @return [Integer]
|
|
804
|
+
def hash
|
|
805
|
+
to_h.hash
|
|
806
|
+
end
|
|
807
|
+
end
|
|
808
|
+
|
|
809
|
+
# The `EventPost` the API declares.
|
|
810
|
+
class EventPost
|
|
811
|
+
attr_reader :application_id,
|
|
812
|
+
:event_type,
|
|
813
|
+
:labels,
|
|
814
|
+
:occurred_at,
|
|
815
|
+
:payload,
|
|
816
|
+
:payload_content_type,
|
|
817
|
+
:event_id,
|
|
818
|
+
:metadata
|
|
819
|
+
|
|
820
|
+
# @param application_id [String] carries `application_id`: UUID of the application this event belongs to.
|
|
821
|
+
# @param event_type [String] carries `event_type`: The type of event (e.g., 'user.created', 'order.completed').
|
|
822
|
+
# Length: 1-200 characters.
|
|
823
|
+
# @param labels [Hash{String => String}] carries `labels`: Labels for event filtering and routing to
|
|
824
|
+
# subscriptions.
|
|
825
|
+
# @param occurred_at [Time] carries `occurred_at`: Timestamp when the event occurred.
|
|
826
|
+
# @param payload [String] carries `payload`: The event payload. For binary content, use base64 encoding. Max
|
|
827
|
+
# length: 699050 characters (512 KiB base64-encoded).
|
|
828
|
+
# @param payload_content_type [String] carries `payload_content_type`: Content type of the payload. Valid values:
|
|
829
|
+
# text/plain, application/json, application/octet-stream+base64. Length: 1-100 characters.
|
|
830
|
+
# @param event_id [String, nil] carries `event_id`: Optional unique identifier for this event (client-generated
|
|
831
|
+
# UUID). If not provided, a UUIDv7 will be generated by the server.
|
|
832
|
+
# @param metadata [Hash{String => String}, nil] carries `metadata`: Optional metadata key-value pairs associated
|
|
833
|
+
# with the event.
|
|
834
|
+
def initialize(
|
|
835
|
+
application_id:,
|
|
836
|
+
event_type:,
|
|
837
|
+
labels:,
|
|
838
|
+
occurred_at:,
|
|
839
|
+
payload:,
|
|
840
|
+
payload_content_type:,
|
|
841
|
+
event_id: nil,
|
|
842
|
+
metadata: nil
|
|
843
|
+
)
|
|
844
|
+
@application_id = application_id
|
|
845
|
+
@event_type = event_type
|
|
846
|
+
@labels = labels
|
|
847
|
+
@occurred_at = occurred_at
|
|
848
|
+
@payload = payload
|
|
849
|
+
@payload_content_type = payload_content_type
|
|
850
|
+
@event_id = event_id
|
|
851
|
+
@metadata = metadata
|
|
852
|
+
freeze
|
|
853
|
+
end
|
|
854
|
+
|
|
855
|
+
# Read one out of what the API answered.
|
|
856
|
+
#
|
|
857
|
+
# @param value [Object] the JSON document the API answered
|
|
858
|
+
# @return [EventPost]
|
|
859
|
+
def self.from_json(value)
|
|
860
|
+
fields = Runtime.as_fields(value, "EventPost")
|
|
861
|
+
new(
|
|
862
|
+
application_id: Runtime.read(fields, "application_id", Runtime::UUID),
|
|
863
|
+
event_type: Runtime.read(fields, "event_type", Runtime::TEXT),
|
|
864
|
+
labels: Runtime.read(fields, "labels", Runtime.map(Runtime::TEXT)),
|
|
865
|
+
occurred_at: Runtime.read(fields, "occurred_at", Runtime::DATE_TIME),
|
|
866
|
+
payload: Runtime.read(fields, "payload", Runtime::TEXT),
|
|
867
|
+
payload_content_type: Runtime.read(fields, "payload_content_type", Runtime::TEXT),
|
|
868
|
+
event_id: Runtime.maybe(fields, "event_id", Runtime::UUID),
|
|
869
|
+
metadata: Runtime.maybe(fields, "metadata", Runtime.map(Runtime::TEXT))
|
|
870
|
+
)
|
|
871
|
+
end
|
|
872
|
+
|
|
873
|
+
# Write one back the way the API reads it.
|
|
874
|
+
#
|
|
875
|
+
# @return [Hash{String => Object}]
|
|
876
|
+
def to_h
|
|
877
|
+
out = {}
|
|
878
|
+
out["application_id"] = @application_id
|
|
879
|
+
out["event_type"] = @event_type
|
|
880
|
+
out["labels"] = @labels
|
|
881
|
+
out["occurred_at"] = Runtime.moment(@occurred_at)
|
|
882
|
+
out["payload"] = @payload
|
|
883
|
+
out["payload_content_type"] = @payload_content_type
|
|
884
|
+
out["event_id"] = @event_id unless @event_id.nil?
|
|
885
|
+
out["metadata"] = @metadata unless @metadata.nil?
|
|
886
|
+
out
|
|
887
|
+
end
|
|
888
|
+
|
|
889
|
+
# Whether that value carries the same members as this one.
|
|
890
|
+
#
|
|
891
|
+
# @param other [Object]
|
|
892
|
+
# @return [Boolean]
|
|
893
|
+
def ==(other)
|
|
894
|
+
other.is_a?(EventPost) && to_h == other.to_h
|
|
895
|
+
end
|
|
896
|
+
alias eql? ==
|
|
897
|
+
|
|
898
|
+
# A value two equal instances share, so that either may key a hash.
|
|
899
|
+
#
|
|
900
|
+
# @return [Integer]
|
|
901
|
+
def hash
|
|
902
|
+
to_h.hash
|
|
903
|
+
end
|
|
904
|
+
end
|
|
905
|
+
|
|
906
|
+
# The `EventType` the API declares.
|
|
907
|
+
class EventType
|
|
908
|
+
attr_reader :event_type_name,
|
|
909
|
+
:resource_type_name,
|
|
910
|
+
:service_name,
|
|
911
|
+
:verb_name
|
|
912
|
+
|
|
913
|
+
# @param event_type_name [String] carries `event_type_name`.
|
|
914
|
+
# @param resource_type_name [String] carries `resource_type_name`.
|
|
915
|
+
# @param service_name [String] carries `service_name`.
|
|
916
|
+
# @param verb_name [String] carries `verb_name`.
|
|
917
|
+
def initialize(event_type_name:, resource_type_name:, service_name:, verb_name:)
|
|
918
|
+
@event_type_name = event_type_name
|
|
919
|
+
@resource_type_name = resource_type_name
|
|
920
|
+
@service_name = service_name
|
|
921
|
+
@verb_name = verb_name
|
|
922
|
+
freeze
|
|
923
|
+
end
|
|
924
|
+
|
|
925
|
+
# Read one out of what the API answered.
|
|
926
|
+
#
|
|
927
|
+
# @param value [Object] the JSON document the API answered
|
|
928
|
+
# @return [EventType]
|
|
929
|
+
def self.from_json(value)
|
|
930
|
+
fields = Runtime.as_fields(value, "EventType")
|
|
931
|
+
new(
|
|
932
|
+
event_type_name: Runtime.read(fields, "event_type_name", Runtime::TEXT),
|
|
933
|
+
resource_type_name: Runtime.read(fields, "resource_type_name", Runtime::TEXT),
|
|
934
|
+
service_name: Runtime.read(fields, "service_name", Runtime::TEXT),
|
|
935
|
+
verb_name: Runtime.read(fields, "verb_name", Runtime::TEXT)
|
|
936
|
+
)
|
|
937
|
+
end
|
|
938
|
+
|
|
939
|
+
# Write one back the way the API reads it.
|
|
940
|
+
#
|
|
941
|
+
# @return [Hash{String => Object}]
|
|
942
|
+
def to_h
|
|
943
|
+
out = {}
|
|
944
|
+
out["event_type_name"] = @event_type_name
|
|
945
|
+
out["resource_type_name"] = @resource_type_name
|
|
946
|
+
out["service_name"] = @service_name
|
|
947
|
+
out["verb_name"] = @verb_name
|
|
948
|
+
out
|
|
949
|
+
end
|
|
950
|
+
|
|
951
|
+
# Whether that value carries the same members as this one.
|
|
952
|
+
#
|
|
953
|
+
# @param other [Object]
|
|
954
|
+
# @return [Boolean]
|
|
955
|
+
def ==(other)
|
|
956
|
+
other.is_a?(EventType) && to_h == other.to_h
|
|
957
|
+
end
|
|
958
|
+
alias eql? ==
|
|
959
|
+
|
|
960
|
+
# A value two equal instances share, so that either may key a hash.
|
|
961
|
+
#
|
|
962
|
+
# @return [Integer]
|
|
963
|
+
def hash
|
|
964
|
+
to_h.hash
|
|
965
|
+
end
|
|
966
|
+
end
|
|
967
|
+
|
|
968
|
+
# The `EventTypePost` the API declares.
|
|
969
|
+
class EventTypePost
|
|
970
|
+
attr_reader :application_id,
|
|
971
|
+
:resource_type,
|
|
972
|
+
:service,
|
|
973
|
+
:verb
|
|
974
|
+
|
|
975
|
+
# @param application_id [String] carries `application_id`.
|
|
976
|
+
# @param resource_type [String] carries `resource_type`.
|
|
977
|
+
# @param service [String] carries `service`.
|
|
978
|
+
# @param verb [String] carries `verb`.
|
|
979
|
+
def initialize(application_id:, resource_type:, service:, verb:)
|
|
980
|
+
@application_id = application_id
|
|
981
|
+
@resource_type = resource_type
|
|
982
|
+
@service = service
|
|
983
|
+
@verb = verb
|
|
984
|
+
freeze
|
|
985
|
+
end
|
|
986
|
+
|
|
987
|
+
# Read one out of what the API answered.
|
|
988
|
+
#
|
|
989
|
+
# @param value [Object] the JSON document the API answered
|
|
990
|
+
# @return [EventTypePost]
|
|
991
|
+
def self.from_json(value)
|
|
992
|
+
fields = Runtime.as_fields(value, "EventTypePost")
|
|
993
|
+
new(
|
|
994
|
+
application_id: Runtime.read(fields, "application_id", Runtime::UUID),
|
|
995
|
+
resource_type: Runtime.read(fields, "resource_type", Runtime::TEXT),
|
|
996
|
+
service: Runtime.read(fields, "service", Runtime::TEXT),
|
|
997
|
+
verb: Runtime.read(fields, "verb", Runtime::TEXT)
|
|
998
|
+
)
|
|
999
|
+
end
|
|
1000
|
+
|
|
1001
|
+
# Write one back the way the API reads it.
|
|
1002
|
+
#
|
|
1003
|
+
# @return [Hash{String => Object}]
|
|
1004
|
+
def to_h
|
|
1005
|
+
out = {}
|
|
1006
|
+
out["application_id"] = @application_id
|
|
1007
|
+
out["resource_type"] = @resource_type
|
|
1008
|
+
out["service"] = @service
|
|
1009
|
+
out["verb"] = @verb
|
|
1010
|
+
out
|
|
1011
|
+
end
|
|
1012
|
+
|
|
1013
|
+
# Whether that value carries the same members as this one.
|
|
1014
|
+
#
|
|
1015
|
+
# @param other [Object]
|
|
1016
|
+
# @return [Boolean]
|
|
1017
|
+
def ==(other)
|
|
1018
|
+
other.is_a?(EventTypePost) && to_h == other.to_h
|
|
1019
|
+
end
|
|
1020
|
+
alias eql? ==
|
|
1021
|
+
|
|
1022
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1023
|
+
#
|
|
1024
|
+
# @return [Integer]
|
|
1025
|
+
def hash
|
|
1026
|
+
to_h.hash
|
|
1027
|
+
end
|
|
1028
|
+
end
|
|
1029
|
+
|
|
1030
|
+
# The `EventWithPayload` the API declares.
|
|
1031
|
+
class EventWithPayload
|
|
1032
|
+
attr_reader :event_id,
|
|
1033
|
+
:event_type_name,
|
|
1034
|
+
:ip,
|
|
1035
|
+
:labels,
|
|
1036
|
+
:occurred_at,
|
|
1037
|
+
:payload,
|
|
1038
|
+
:payload_content_type,
|
|
1039
|
+
:received_at,
|
|
1040
|
+
:metadata
|
|
1041
|
+
|
|
1042
|
+
# @param event_id [String] carries `event_id`.
|
|
1043
|
+
# @param event_type_name [String] carries `event_type_name`.
|
|
1044
|
+
# @param ip [String] carries `ip`.
|
|
1045
|
+
# @param labels [Object] carries `labels`.
|
|
1046
|
+
# @param occurred_at [Time] carries `occurred_at`.
|
|
1047
|
+
# @param payload [String] carries `payload`.
|
|
1048
|
+
# @param payload_content_type [String] carries `payload_content_type`.
|
|
1049
|
+
# @param received_at [Time] carries `received_at`.
|
|
1050
|
+
# @param metadata [Object, nil] carries `metadata`.
|
|
1051
|
+
def initialize(
|
|
1052
|
+
event_id:,
|
|
1053
|
+
event_type_name:,
|
|
1054
|
+
ip:,
|
|
1055
|
+
labels:,
|
|
1056
|
+
occurred_at:,
|
|
1057
|
+
payload:,
|
|
1058
|
+
payload_content_type:,
|
|
1059
|
+
received_at:,
|
|
1060
|
+
metadata: nil
|
|
1061
|
+
)
|
|
1062
|
+
@event_id = event_id
|
|
1063
|
+
@event_type_name = event_type_name
|
|
1064
|
+
@ip = ip
|
|
1065
|
+
@labels = labels
|
|
1066
|
+
@occurred_at = occurred_at
|
|
1067
|
+
@payload = payload
|
|
1068
|
+
@payload_content_type = payload_content_type
|
|
1069
|
+
@received_at = received_at
|
|
1070
|
+
@metadata = metadata
|
|
1071
|
+
freeze
|
|
1072
|
+
end
|
|
1073
|
+
|
|
1074
|
+
# Read one out of what the API answered.
|
|
1075
|
+
#
|
|
1076
|
+
# @param value [Object] the JSON document the API answered
|
|
1077
|
+
# @return [EventWithPayload]
|
|
1078
|
+
def self.from_json(value)
|
|
1079
|
+
fields = Runtime.as_fields(value, "EventWithPayload")
|
|
1080
|
+
new(
|
|
1081
|
+
event_id: Runtime.read(fields, "event_id", Runtime::UUID),
|
|
1082
|
+
event_type_name: Runtime.read(fields, "event_type_name", Runtime::TEXT),
|
|
1083
|
+
ip: Runtime.read(fields, "ip", Runtime::TEXT),
|
|
1084
|
+
labels: Runtime.read(fields, "labels", Runtime::JSON_VALUE),
|
|
1085
|
+
occurred_at: Runtime.read(fields, "occurred_at", Runtime::DATE_TIME),
|
|
1086
|
+
payload: Runtime.read(fields, "payload", Runtime::TEXT),
|
|
1087
|
+
payload_content_type: Runtime.read(fields, "payload_content_type", Runtime::TEXT),
|
|
1088
|
+
received_at: Runtime.read(fields, "received_at", Runtime::DATE_TIME),
|
|
1089
|
+
metadata: Runtime.maybe(fields, "metadata", Runtime::JSON_VALUE)
|
|
1090
|
+
)
|
|
1091
|
+
end
|
|
1092
|
+
|
|
1093
|
+
# Write one back the way the API reads it.
|
|
1094
|
+
#
|
|
1095
|
+
# @return [Hash{String => Object}]
|
|
1096
|
+
def to_h
|
|
1097
|
+
out = {}
|
|
1098
|
+
out["event_id"] = @event_id
|
|
1099
|
+
out["event_type_name"] = @event_type_name
|
|
1100
|
+
out["ip"] = @ip
|
|
1101
|
+
out["labels"] = @labels
|
|
1102
|
+
out["occurred_at"] = Runtime.moment(@occurred_at)
|
|
1103
|
+
out["payload"] = @payload
|
|
1104
|
+
out["payload_content_type"] = @payload_content_type
|
|
1105
|
+
out["received_at"] = Runtime.moment(@received_at)
|
|
1106
|
+
out["metadata"] = @metadata unless @metadata.nil?
|
|
1107
|
+
out
|
|
1108
|
+
end
|
|
1109
|
+
|
|
1110
|
+
# Whether that value carries the same members as this one.
|
|
1111
|
+
#
|
|
1112
|
+
# @param other [Object]
|
|
1113
|
+
# @return [Boolean]
|
|
1114
|
+
def ==(other)
|
|
1115
|
+
other.is_a?(EventWithPayload) && to_h == other.to_h
|
|
1116
|
+
end
|
|
1117
|
+
alias eql? ==
|
|
1118
|
+
|
|
1119
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1120
|
+
#
|
|
1121
|
+
# @return [Integer]
|
|
1122
|
+
def hash
|
|
1123
|
+
to_h.hash
|
|
1124
|
+
end
|
|
1125
|
+
end
|
|
1126
|
+
|
|
1127
|
+
# The `EventsPerDayEntry` the API declares.
|
|
1128
|
+
class EventsPerDayEntry
|
|
1129
|
+
attr_reader :amount,
|
|
1130
|
+
:application_id,
|
|
1131
|
+
:application_name,
|
|
1132
|
+
:date,
|
|
1133
|
+
:is_provisional
|
|
1134
|
+
|
|
1135
|
+
# @param amount [Integer] carries `amount`.
|
|
1136
|
+
# @param application_id [String] carries `application_id`.
|
|
1137
|
+
# @param application_name [String] carries `application_name`.
|
|
1138
|
+
# @param date [Date] carries `date`.
|
|
1139
|
+
# @param is_provisional [Boolean] carries `is_provisional`.
|
|
1140
|
+
def initialize(amount:, application_id:, application_name:, date:, is_provisional:)
|
|
1141
|
+
@amount = amount
|
|
1142
|
+
@application_id = application_id
|
|
1143
|
+
@application_name = application_name
|
|
1144
|
+
@date = date
|
|
1145
|
+
@is_provisional = is_provisional
|
|
1146
|
+
freeze
|
|
1147
|
+
end
|
|
1148
|
+
|
|
1149
|
+
# Read one out of what the API answered.
|
|
1150
|
+
#
|
|
1151
|
+
# @param value [Object] the JSON document the API answered
|
|
1152
|
+
# @return [EventsPerDayEntry]
|
|
1153
|
+
def self.from_json(value)
|
|
1154
|
+
fields = Runtime.as_fields(value, "EventsPerDayEntry")
|
|
1155
|
+
new(
|
|
1156
|
+
amount: Runtime.read(fields, "amount", Runtime::INTEGER),
|
|
1157
|
+
application_id: Runtime.read(fields, "application_id", Runtime::UUID),
|
|
1158
|
+
application_name: Runtime.read(fields, "application_name", Runtime::TEXT),
|
|
1159
|
+
date: Runtime.read(fields, "date", Runtime::DATE),
|
|
1160
|
+
is_provisional: Runtime.read(fields, "is_provisional", Runtime::BOOLEAN)
|
|
1161
|
+
)
|
|
1162
|
+
end
|
|
1163
|
+
|
|
1164
|
+
# Write one back the way the API reads it.
|
|
1165
|
+
#
|
|
1166
|
+
# @return [Hash{String => Object}]
|
|
1167
|
+
def to_h
|
|
1168
|
+
out = {}
|
|
1169
|
+
out["amount"] = @amount
|
|
1170
|
+
out["application_id"] = @application_id
|
|
1171
|
+
out["application_name"] = @application_name
|
|
1172
|
+
out["date"] = Runtime.day(@date)
|
|
1173
|
+
out["is_provisional"] = @is_provisional
|
|
1174
|
+
out
|
|
1175
|
+
end
|
|
1176
|
+
|
|
1177
|
+
# Whether that value carries the same members as this one.
|
|
1178
|
+
#
|
|
1179
|
+
# @param other [Object]
|
|
1180
|
+
# @return [Boolean]
|
|
1181
|
+
def ==(other)
|
|
1182
|
+
other.is_a?(EventsPerDayEntry) && to_h == other.to_h
|
|
1183
|
+
end
|
|
1184
|
+
alias eql? ==
|
|
1185
|
+
|
|
1186
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1187
|
+
#
|
|
1188
|
+
# @return [Integer]
|
|
1189
|
+
def hash
|
|
1190
|
+
to_h.hash
|
|
1191
|
+
end
|
|
1192
|
+
end
|
|
1193
|
+
|
|
1194
|
+
# The `IngestedEvent` the API declares.
|
|
1195
|
+
class IngestedEvent
|
|
1196
|
+
attr_reader :application_id,
|
|
1197
|
+
:event_id,
|
|
1198
|
+
:received_at
|
|
1199
|
+
|
|
1200
|
+
# @param application_id [String] carries `application_id`.
|
|
1201
|
+
# @param event_id [String] carries `event_id`.
|
|
1202
|
+
# @param received_at [Time] carries `received_at`.
|
|
1203
|
+
def initialize(application_id:, event_id:, received_at:)
|
|
1204
|
+
@application_id = application_id
|
|
1205
|
+
@event_id = event_id
|
|
1206
|
+
@received_at = received_at
|
|
1207
|
+
freeze
|
|
1208
|
+
end
|
|
1209
|
+
|
|
1210
|
+
# Read one out of what the API answered.
|
|
1211
|
+
#
|
|
1212
|
+
# @param value [Object] the JSON document the API answered
|
|
1213
|
+
# @return [IngestedEvent]
|
|
1214
|
+
def self.from_json(value)
|
|
1215
|
+
fields = Runtime.as_fields(value, "IngestedEvent")
|
|
1216
|
+
new(
|
|
1217
|
+
application_id: Runtime.read(fields, "application_id", Runtime::UUID),
|
|
1218
|
+
event_id: Runtime.read(fields, "event_id", Runtime::UUID),
|
|
1219
|
+
received_at: Runtime.read(fields, "received_at", Runtime::DATE_TIME)
|
|
1220
|
+
)
|
|
1221
|
+
end
|
|
1222
|
+
|
|
1223
|
+
# Write one back the way the API reads it.
|
|
1224
|
+
#
|
|
1225
|
+
# @return [Hash{String => Object}]
|
|
1226
|
+
def to_h
|
|
1227
|
+
out = {}
|
|
1228
|
+
out["application_id"] = @application_id
|
|
1229
|
+
out["event_id"] = @event_id
|
|
1230
|
+
out["received_at"] = Runtime.moment(@received_at)
|
|
1231
|
+
out
|
|
1232
|
+
end
|
|
1233
|
+
|
|
1234
|
+
# Whether that value carries the same members as this one.
|
|
1235
|
+
#
|
|
1236
|
+
# @param other [Object]
|
|
1237
|
+
# @return [Boolean]
|
|
1238
|
+
def ==(other)
|
|
1239
|
+
other.is_a?(IngestedEvent) && to_h == other.to_h
|
|
1240
|
+
end
|
|
1241
|
+
alias eql? ==
|
|
1242
|
+
|
|
1243
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1244
|
+
#
|
|
1245
|
+
# @return [Integer]
|
|
1246
|
+
def hash
|
|
1247
|
+
to_h.hash
|
|
1248
|
+
end
|
|
1249
|
+
end
|
|
1250
|
+
|
|
1251
|
+
# The `InstanceConfig` the API declares.
|
|
1252
|
+
class InstanceConfig
|
|
1253
|
+
attr_reader :application_secret_compatibility,
|
|
1254
|
+
:auto_db_migration,
|
|
1255
|
+
:biscuit_public_key,
|
|
1256
|
+
:password_minimum_length,
|
|
1257
|
+
:quota_enforcement,
|
|
1258
|
+
:registration_disabled,
|
|
1259
|
+
:support_email_address,
|
|
1260
|
+
:cloudflare_turnstile_site_key,
|
|
1261
|
+
:formbricks,
|
|
1262
|
+
:matomo
|
|
1263
|
+
|
|
1264
|
+
# @param application_secret_compatibility [Boolean] carries `application_secret_compatibility`.
|
|
1265
|
+
# @param auto_db_migration [Boolean] carries `auto_db_migration`.
|
|
1266
|
+
# @param biscuit_public_key [String] carries `biscuit_public_key`.
|
|
1267
|
+
# @param password_minimum_length [Integer] carries `password_minimum_length`.
|
|
1268
|
+
# @param quota_enforcement [Boolean] carries `quota_enforcement`.
|
|
1269
|
+
# @param registration_disabled [Boolean] carries `registration_disabled`.
|
|
1270
|
+
# @param support_email_address [String] carries `support_email_address`.
|
|
1271
|
+
# @param cloudflare_turnstile_site_key [String, nil] carries `cloudflare_turnstile_site_key`.
|
|
1272
|
+
# @param formbricks [InstanceConfigFormbricks, nil] carries `formbricks`.
|
|
1273
|
+
# @param matomo [InstanceConfigMatomo, nil] carries `matomo`.
|
|
1274
|
+
def initialize(
|
|
1275
|
+
application_secret_compatibility:,
|
|
1276
|
+
auto_db_migration:,
|
|
1277
|
+
biscuit_public_key:,
|
|
1278
|
+
password_minimum_length:,
|
|
1279
|
+
quota_enforcement:,
|
|
1280
|
+
registration_disabled:,
|
|
1281
|
+
support_email_address:,
|
|
1282
|
+
cloudflare_turnstile_site_key: nil,
|
|
1283
|
+
formbricks: nil,
|
|
1284
|
+
matomo: nil
|
|
1285
|
+
)
|
|
1286
|
+
@application_secret_compatibility = application_secret_compatibility
|
|
1287
|
+
@auto_db_migration = auto_db_migration
|
|
1288
|
+
@biscuit_public_key = biscuit_public_key
|
|
1289
|
+
@password_minimum_length = password_minimum_length
|
|
1290
|
+
@quota_enforcement = quota_enforcement
|
|
1291
|
+
@registration_disabled = registration_disabled
|
|
1292
|
+
@support_email_address = support_email_address
|
|
1293
|
+
@cloudflare_turnstile_site_key = cloudflare_turnstile_site_key
|
|
1294
|
+
@formbricks = formbricks
|
|
1295
|
+
@matomo = matomo
|
|
1296
|
+
freeze
|
|
1297
|
+
end
|
|
1298
|
+
|
|
1299
|
+
# Read one out of what the API answered.
|
|
1300
|
+
#
|
|
1301
|
+
# @param value [Object] the JSON document the API answered
|
|
1302
|
+
# @return [InstanceConfig]
|
|
1303
|
+
def self.from_json(value)
|
|
1304
|
+
fields = Runtime.as_fields(value, "InstanceConfig")
|
|
1305
|
+
new(
|
|
1306
|
+
application_secret_compatibility: Runtime.read(fields, "application_secret_compatibility", Runtime::BOOLEAN),
|
|
1307
|
+
auto_db_migration: Runtime.read(fields, "auto_db_migration", Runtime::BOOLEAN),
|
|
1308
|
+
biscuit_public_key: Runtime.read(fields, "biscuit_public_key", Runtime::TEXT),
|
|
1309
|
+
password_minimum_length: Runtime.read(fields, "password_minimum_length", Runtime::INTEGER),
|
|
1310
|
+
quota_enforcement: Runtime.read(fields, "quota_enforcement", Runtime::BOOLEAN),
|
|
1311
|
+
registration_disabled: Runtime.read(fields, "registration_disabled", Runtime::BOOLEAN),
|
|
1312
|
+
support_email_address: Runtime.read(fields, "support_email_address", Runtime::TEXT),
|
|
1313
|
+
cloudflare_turnstile_site_key: Runtime.maybe(fields, "cloudflare_turnstile_site_key", Runtime::TEXT),
|
|
1314
|
+
formbricks: Runtime.maybe(fields, "formbricks", InstanceConfigFormbricks.method(:from_json)),
|
|
1315
|
+
matomo: Runtime.maybe(fields, "matomo", InstanceConfigMatomo.method(:from_json))
|
|
1316
|
+
)
|
|
1317
|
+
end
|
|
1318
|
+
|
|
1319
|
+
# Write one back the way the API reads it.
|
|
1320
|
+
#
|
|
1321
|
+
# @return [Hash{String => Object}]
|
|
1322
|
+
def to_h
|
|
1323
|
+
out = {}
|
|
1324
|
+
out["application_secret_compatibility"] = @application_secret_compatibility
|
|
1325
|
+
out["auto_db_migration"] = @auto_db_migration
|
|
1326
|
+
out["biscuit_public_key"] = @biscuit_public_key
|
|
1327
|
+
out["password_minimum_length"] = @password_minimum_length
|
|
1328
|
+
out["quota_enforcement"] = @quota_enforcement
|
|
1329
|
+
out["registration_disabled"] = @registration_disabled
|
|
1330
|
+
out["support_email_address"] = @support_email_address
|
|
1331
|
+
out["cloudflare_turnstile_site_key"] = @cloudflare_turnstile_site_key unless @cloudflare_turnstile_site_key.nil?
|
|
1332
|
+
out["formbricks"] = @formbricks.to_h unless @formbricks.nil?
|
|
1333
|
+
out["matomo"] = @matomo.to_h unless @matomo.nil?
|
|
1334
|
+
out
|
|
1335
|
+
end
|
|
1336
|
+
|
|
1337
|
+
# Whether that value carries the same members as this one.
|
|
1338
|
+
#
|
|
1339
|
+
# @param other [Object]
|
|
1340
|
+
# @return [Boolean]
|
|
1341
|
+
def ==(other)
|
|
1342
|
+
other.is_a?(InstanceConfig) && to_h == other.to_h
|
|
1343
|
+
end
|
|
1344
|
+
alias eql? ==
|
|
1345
|
+
|
|
1346
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1347
|
+
#
|
|
1348
|
+
# @return [Integer]
|
|
1349
|
+
def hash
|
|
1350
|
+
to_h.hash
|
|
1351
|
+
end
|
|
1352
|
+
end
|
|
1353
|
+
|
|
1354
|
+
# The `InstanceConfigFormbricks` the API declares.
|
|
1355
|
+
class InstanceConfigFormbricks
|
|
1356
|
+
attr_reader :api_host,
|
|
1357
|
+
:environment_id
|
|
1358
|
+
|
|
1359
|
+
# @param api_host [String] carries `api_host`.
|
|
1360
|
+
# @param environment_id [String] carries `environment_id`.
|
|
1361
|
+
def initialize(api_host:, environment_id:)
|
|
1362
|
+
@api_host = api_host
|
|
1363
|
+
@environment_id = environment_id
|
|
1364
|
+
freeze
|
|
1365
|
+
end
|
|
1366
|
+
|
|
1367
|
+
# Read one out of what the API answered.
|
|
1368
|
+
#
|
|
1369
|
+
# @param value [Object] the JSON document the API answered
|
|
1370
|
+
# @return [InstanceConfigFormbricks]
|
|
1371
|
+
def self.from_json(value)
|
|
1372
|
+
fields = Runtime.as_fields(value, "InstanceConfigFormbricks")
|
|
1373
|
+
new(
|
|
1374
|
+
api_host: Runtime.read(fields, "api_host", Runtime::TEXT),
|
|
1375
|
+
environment_id: Runtime.read(fields, "environment_id", Runtime::TEXT)
|
|
1376
|
+
)
|
|
1377
|
+
end
|
|
1378
|
+
|
|
1379
|
+
# Write one back the way the API reads it.
|
|
1380
|
+
#
|
|
1381
|
+
# @return [Hash{String => Object}]
|
|
1382
|
+
def to_h
|
|
1383
|
+
out = {}
|
|
1384
|
+
out["api_host"] = @api_host
|
|
1385
|
+
out["environment_id"] = @environment_id
|
|
1386
|
+
out
|
|
1387
|
+
end
|
|
1388
|
+
|
|
1389
|
+
# Whether that value carries the same members as this one.
|
|
1390
|
+
#
|
|
1391
|
+
# @param other [Object]
|
|
1392
|
+
# @return [Boolean]
|
|
1393
|
+
def ==(other)
|
|
1394
|
+
other.is_a?(InstanceConfigFormbricks) && to_h == other.to_h
|
|
1395
|
+
end
|
|
1396
|
+
alias eql? ==
|
|
1397
|
+
|
|
1398
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1399
|
+
#
|
|
1400
|
+
# @return [Integer]
|
|
1401
|
+
def hash
|
|
1402
|
+
to_h.hash
|
|
1403
|
+
end
|
|
1404
|
+
end
|
|
1405
|
+
|
|
1406
|
+
# The `InstanceConfigMatomo` the API declares.
|
|
1407
|
+
class InstanceConfigMatomo
|
|
1408
|
+
attr_reader :site_id,
|
|
1409
|
+
:url
|
|
1410
|
+
|
|
1411
|
+
# @param site_id [Integer] carries `site_id`.
|
|
1412
|
+
# @param url [String] carries `url`.
|
|
1413
|
+
def initialize(site_id:, url:)
|
|
1414
|
+
@site_id = site_id
|
|
1415
|
+
@url = url
|
|
1416
|
+
freeze
|
|
1417
|
+
end
|
|
1418
|
+
|
|
1419
|
+
# Read one out of what the API answered.
|
|
1420
|
+
#
|
|
1421
|
+
# @param value [Object] the JSON document the API answered
|
|
1422
|
+
# @return [InstanceConfigMatomo]
|
|
1423
|
+
def self.from_json(value)
|
|
1424
|
+
fields = Runtime.as_fields(value, "InstanceConfigMatomo")
|
|
1425
|
+
new(
|
|
1426
|
+
site_id: Runtime.read(fields, "site_id", Runtime::INTEGER),
|
|
1427
|
+
url: Runtime.read(fields, "url", Runtime::TEXT)
|
|
1428
|
+
)
|
|
1429
|
+
end
|
|
1430
|
+
|
|
1431
|
+
# Write one back the way the API reads it.
|
|
1432
|
+
#
|
|
1433
|
+
# @return [Hash{String => Object}]
|
|
1434
|
+
def to_h
|
|
1435
|
+
out = {}
|
|
1436
|
+
out["site_id"] = @site_id
|
|
1437
|
+
out["url"] = @url
|
|
1438
|
+
out
|
|
1439
|
+
end
|
|
1440
|
+
|
|
1441
|
+
# Whether that value carries the same members as this one.
|
|
1442
|
+
#
|
|
1443
|
+
# @param other [Object]
|
|
1444
|
+
# @return [Boolean]
|
|
1445
|
+
def ==(other)
|
|
1446
|
+
other.is_a?(InstanceConfigMatomo) && to_h == other.to_h
|
|
1447
|
+
end
|
|
1448
|
+
alias eql? ==
|
|
1449
|
+
|
|
1450
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1451
|
+
#
|
|
1452
|
+
# @return [Integer]
|
|
1453
|
+
def hash
|
|
1454
|
+
to_h.hash
|
|
1455
|
+
end
|
|
1456
|
+
end
|
|
1457
|
+
|
|
1458
|
+
# The `Organization` the API declares.
|
|
1459
|
+
class Organization
|
|
1460
|
+
attr_reader :name,
|
|
1461
|
+
:organization_id,
|
|
1462
|
+
:role,
|
|
1463
|
+
:plan
|
|
1464
|
+
|
|
1465
|
+
# @param name [String] carries `name`.
|
|
1466
|
+
# @param organization_id [String] carries `organization_id`.
|
|
1467
|
+
# @param role [String] carries `role`.
|
|
1468
|
+
# @param plan [OrganizationPlan, nil] carries `plan`.
|
|
1469
|
+
def initialize(name:, organization_id:, role:, plan: nil)
|
|
1470
|
+
@name = name
|
|
1471
|
+
@organization_id = organization_id
|
|
1472
|
+
@role = role
|
|
1473
|
+
@plan = plan
|
|
1474
|
+
freeze
|
|
1475
|
+
end
|
|
1476
|
+
|
|
1477
|
+
# Read one out of what the API answered.
|
|
1478
|
+
#
|
|
1479
|
+
# @param value [Object] the JSON document the API answered
|
|
1480
|
+
# @return [Organization]
|
|
1481
|
+
def self.from_json(value)
|
|
1482
|
+
fields = Runtime.as_fields(value, "Organization")
|
|
1483
|
+
new(
|
|
1484
|
+
name: Runtime.read(fields, "name", Runtime::TEXT),
|
|
1485
|
+
organization_id: Runtime.read(fields, "organization_id", Runtime::UUID),
|
|
1486
|
+
role: Runtime.read(fields, "role", Runtime::TEXT),
|
|
1487
|
+
plan: Runtime.maybe(fields, "plan", OrganizationPlan.method(:from_json))
|
|
1488
|
+
)
|
|
1489
|
+
end
|
|
1490
|
+
|
|
1491
|
+
# Write one back the way the API reads it.
|
|
1492
|
+
#
|
|
1493
|
+
# @return [Hash{String => Object}]
|
|
1494
|
+
def to_h
|
|
1495
|
+
out = {}
|
|
1496
|
+
out["name"] = @name
|
|
1497
|
+
out["organization_id"] = @organization_id
|
|
1498
|
+
out["role"] = @role
|
|
1499
|
+
out["plan"] = @plan.to_h unless @plan.nil?
|
|
1500
|
+
out
|
|
1501
|
+
end
|
|
1502
|
+
|
|
1503
|
+
# Whether that value carries the same members as this one.
|
|
1504
|
+
#
|
|
1505
|
+
# @param other [Object]
|
|
1506
|
+
# @return [Boolean]
|
|
1507
|
+
def ==(other)
|
|
1508
|
+
other.is_a?(Organization) && to_h == other.to_h
|
|
1509
|
+
end
|
|
1510
|
+
alias eql? ==
|
|
1511
|
+
|
|
1512
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1513
|
+
#
|
|
1514
|
+
# @return [Integer]
|
|
1515
|
+
def hash
|
|
1516
|
+
to_h.hash
|
|
1517
|
+
end
|
|
1518
|
+
end
|
|
1519
|
+
|
|
1520
|
+
# The `OrganizationInfo` the API declares.
|
|
1521
|
+
class OrganizationInfo
|
|
1522
|
+
attr_reader :consumption,
|
|
1523
|
+
:name,
|
|
1524
|
+
:onboarding_steps,
|
|
1525
|
+
:organization_id,
|
|
1526
|
+
:quotas,
|
|
1527
|
+
:users,
|
|
1528
|
+
:plan
|
|
1529
|
+
|
|
1530
|
+
# @param consumption [OrganizationInfoConsumption] carries `consumption`.
|
|
1531
|
+
# @param name [String] carries `name`.
|
|
1532
|
+
# @param onboarding_steps [OrganizationInfoOnboardingSteps] carries `onboarding_steps`.
|
|
1533
|
+
# @param organization_id [String] carries `organization_id`.
|
|
1534
|
+
# @param quotas [OrganizationInfoQuotas] carries `quotas`.
|
|
1535
|
+
# @param users [Array<OrganizationInfoUsers>] carries `users`.
|
|
1536
|
+
# @param plan [OrganizationInfoPlan, nil] carries `plan`.
|
|
1537
|
+
def initialize(consumption:, name:, onboarding_steps:, organization_id:, quotas:, users:, plan: nil)
|
|
1538
|
+
@consumption = consumption
|
|
1539
|
+
@name = name
|
|
1540
|
+
@onboarding_steps = onboarding_steps
|
|
1541
|
+
@organization_id = organization_id
|
|
1542
|
+
@quotas = quotas
|
|
1543
|
+
@users = users
|
|
1544
|
+
@plan = plan
|
|
1545
|
+
freeze
|
|
1546
|
+
end
|
|
1547
|
+
|
|
1548
|
+
# Read one out of what the API answered.
|
|
1549
|
+
#
|
|
1550
|
+
# @param value [Object] the JSON document the API answered
|
|
1551
|
+
# @return [OrganizationInfo]
|
|
1552
|
+
def self.from_json(value)
|
|
1553
|
+
fields = Runtime.as_fields(value, "OrganizationInfo")
|
|
1554
|
+
new(
|
|
1555
|
+
consumption: Runtime.read(fields, "consumption", OrganizationInfoConsumption.method(:from_json)),
|
|
1556
|
+
name: Runtime.read(fields, "name", Runtime::TEXT),
|
|
1557
|
+
onboarding_steps: Runtime.read(
|
|
1558
|
+
fields,
|
|
1559
|
+
"onboarding_steps",
|
|
1560
|
+
OrganizationInfoOnboardingSteps.method(:from_json)
|
|
1561
|
+
),
|
|
1562
|
+
organization_id: Runtime.read(fields, "organization_id", Runtime::UUID),
|
|
1563
|
+
quotas: Runtime.read(fields, "quotas", OrganizationInfoQuotas.method(:from_json)),
|
|
1564
|
+
users: Runtime.read(fields, "users", Runtime.list(OrganizationInfoUsers.method(:from_json))),
|
|
1565
|
+
plan: Runtime.maybe(fields, "plan", OrganizationInfoPlan.method(:from_json))
|
|
1566
|
+
)
|
|
1567
|
+
end
|
|
1568
|
+
|
|
1569
|
+
# Write one back the way the API reads it.
|
|
1570
|
+
#
|
|
1571
|
+
# @return [Hash{String => Object}]
|
|
1572
|
+
def to_h
|
|
1573
|
+
out = {}
|
|
1574
|
+
out["consumption"] = @consumption.to_h
|
|
1575
|
+
out["name"] = @name
|
|
1576
|
+
out["onboarding_steps"] = @onboarding_steps.to_h
|
|
1577
|
+
out["organization_id"] = @organization_id
|
|
1578
|
+
out["quotas"] = @quotas.to_h
|
|
1579
|
+
out["users"] = @users.map(&:to_h)
|
|
1580
|
+
out["plan"] = @plan.to_h unless @plan.nil?
|
|
1581
|
+
out
|
|
1582
|
+
end
|
|
1583
|
+
|
|
1584
|
+
# Whether that value carries the same members as this one.
|
|
1585
|
+
#
|
|
1586
|
+
# @param other [Object]
|
|
1587
|
+
# @return [Boolean]
|
|
1588
|
+
def ==(other)
|
|
1589
|
+
other.is_a?(OrganizationInfo) && to_h == other.to_h
|
|
1590
|
+
end
|
|
1591
|
+
alias eql? ==
|
|
1592
|
+
|
|
1593
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1594
|
+
#
|
|
1595
|
+
# @return [Integer]
|
|
1596
|
+
def hash
|
|
1597
|
+
to_h.hash
|
|
1598
|
+
end
|
|
1599
|
+
end
|
|
1600
|
+
|
|
1601
|
+
# The `OrganizationInfoConsumption` the API declares.
|
|
1602
|
+
class OrganizationInfoConsumption
|
|
1603
|
+
attr_reader :applications,
|
|
1604
|
+
:events_per_day,
|
|
1605
|
+
:members
|
|
1606
|
+
|
|
1607
|
+
# @param applications [Integer, nil] carries `applications`.
|
|
1608
|
+
# @param events_per_day [Integer, nil] carries `events_per_day`.
|
|
1609
|
+
# @param members [Integer, nil] carries `members`.
|
|
1610
|
+
def initialize(applications: nil, events_per_day: nil, members: nil)
|
|
1611
|
+
@applications = applications
|
|
1612
|
+
@events_per_day = events_per_day
|
|
1613
|
+
@members = members
|
|
1614
|
+
freeze
|
|
1615
|
+
end
|
|
1616
|
+
|
|
1617
|
+
# Read one out of what the API answered.
|
|
1618
|
+
#
|
|
1619
|
+
# @param value [Object] the JSON document the API answered
|
|
1620
|
+
# @return [OrganizationInfoConsumption]
|
|
1621
|
+
def self.from_json(value)
|
|
1622
|
+
fields = Runtime.as_fields(value, "OrganizationInfoConsumption")
|
|
1623
|
+
new(
|
|
1624
|
+
applications: Runtime.maybe(fields, "applications", Runtime::INTEGER),
|
|
1625
|
+
events_per_day: Runtime.maybe(fields, "events_per_day", Runtime::INTEGER),
|
|
1626
|
+
members: Runtime.maybe(fields, "members", Runtime::INTEGER)
|
|
1627
|
+
)
|
|
1628
|
+
end
|
|
1629
|
+
|
|
1630
|
+
# Write one back the way the API reads it.
|
|
1631
|
+
#
|
|
1632
|
+
# @return [Hash{String => Object}]
|
|
1633
|
+
def to_h
|
|
1634
|
+
out = {}
|
|
1635
|
+
out["applications"] = @applications unless @applications.nil?
|
|
1636
|
+
out["events_per_day"] = @events_per_day unless @events_per_day.nil?
|
|
1637
|
+
out["members"] = @members unless @members.nil?
|
|
1638
|
+
out
|
|
1639
|
+
end
|
|
1640
|
+
|
|
1641
|
+
# Whether that value carries the same members as this one.
|
|
1642
|
+
#
|
|
1643
|
+
# @param other [Object]
|
|
1644
|
+
# @return [Boolean]
|
|
1645
|
+
def ==(other)
|
|
1646
|
+
other.is_a?(OrganizationInfoConsumption) && to_h == other.to_h
|
|
1647
|
+
end
|
|
1648
|
+
alias eql? ==
|
|
1649
|
+
|
|
1650
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1651
|
+
#
|
|
1652
|
+
# @return [Integer]
|
|
1653
|
+
def hash
|
|
1654
|
+
to_h.hash
|
|
1655
|
+
end
|
|
1656
|
+
end
|
|
1657
|
+
|
|
1658
|
+
# The `OrganizationInfoOnboardingSteps` the API declares.
|
|
1659
|
+
class OrganizationInfoOnboardingSteps
|
|
1660
|
+
attr_reader :application,
|
|
1661
|
+
:event,
|
|
1662
|
+
:event_type,
|
|
1663
|
+
:subscription
|
|
1664
|
+
|
|
1665
|
+
# @param application [String] carries `application`, one of `OrganizationInfoOnboardingStepsApplication::VALUES`.
|
|
1666
|
+
# @param event [String] carries `event`, one of `OrganizationInfoOnboardingStepsEvent::VALUES`.
|
|
1667
|
+
# @param event_type [String] carries `event_type`, one of `OrganizationInfoOnboardingStepsEventType::VALUES`.
|
|
1668
|
+
# @param subscription [String] carries `subscription`, one of
|
|
1669
|
+
# `OrganizationInfoOnboardingStepsSubscription::VALUES`.
|
|
1670
|
+
def initialize(application:, event:, event_type:, subscription:)
|
|
1671
|
+
@application = application
|
|
1672
|
+
@event = event
|
|
1673
|
+
@event_type = event_type
|
|
1674
|
+
@subscription = subscription
|
|
1675
|
+
freeze
|
|
1676
|
+
end
|
|
1677
|
+
|
|
1678
|
+
# Read one out of what the API answered.
|
|
1679
|
+
#
|
|
1680
|
+
# @param value [Object] the JSON document the API answered
|
|
1681
|
+
# @return [OrganizationInfoOnboardingSteps]
|
|
1682
|
+
def self.from_json(value)
|
|
1683
|
+
fields = Runtime.as_fields(value, "OrganizationInfoOnboardingSteps")
|
|
1684
|
+
new(
|
|
1685
|
+
application: Runtime.read(
|
|
1686
|
+
fields,
|
|
1687
|
+
"application",
|
|
1688
|
+
Runtime.member_of(OrganizationInfoOnboardingStepsApplication)
|
|
1689
|
+
),
|
|
1690
|
+
event: Runtime.read(fields, "event", Runtime.member_of(OrganizationInfoOnboardingStepsEvent)),
|
|
1691
|
+
event_type: Runtime.read(fields, "event_type", Runtime.member_of(OrganizationInfoOnboardingStepsEventType)),
|
|
1692
|
+
subscription: Runtime.read(
|
|
1693
|
+
fields,
|
|
1694
|
+
"subscription",
|
|
1695
|
+
Runtime.member_of(OrganizationInfoOnboardingStepsSubscription)
|
|
1696
|
+
)
|
|
1697
|
+
)
|
|
1698
|
+
end
|
|
1699
|
+
|
|
1700
|
+
# Write one back the way the API reads it.
|
|
1701
|
+
#
|
|
1702
|
+
# @return [Hash{String => Object}]
|
|
1703
|
+
def to_h
|
|
1704
|
+
out = {}
|
|
1705
|
+
out["application"] = @application
|
|
1706
|
+
out["event"] = @event
|
|
1707
|
+
out["event_type"] = @event_type
|
|
1708
|
+
out["subscription"] = @subscription
|
|
1709
|
+
out
|
|
1710
|
+
end
|
|
1711
|
+
|
|
1712
|
+
# Whether that value carries the same members as this one.
|
|
1713
|
+
#
|
|
1714
|
+
# @param other [Object]
|
|
1715
|
+
# @return [Boolean]
|
|
1716
|
+
def ==(other)
|
|
1717
|
+
other.is_a?(OrganizationInfoOnboardingSteps) && to_h == other.to_h
|
|
1718
|
+
end
|
|
1719
|
+
alias eql? ==
|
|
1720
|
+
|
|
1721
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1722
|
+
#
|
|
1723
|
+
# @return [Integer]
|
|
1724
|
+
def hash
|
|
1725
|
+
to_h.hash
|
|
1726
|
+
end
|
|
1727
|
+
end
|
|
1728
|
+
|
|
1729
|
+
# The `OrganizationInfoPlan` the API declares.
|
|
1730
|
+
class OrganizationInfoPlan
|
|
1731
|
+
attr_reader :label,
|
|
1732
|
+
:name
|
|
1733
|
+
|
|
1734
|
+
# @param label [String] carries `label`.
|
|
1735
|
+
# @param name [String] carries `name`.
|
|
1736
|
+
def initialize(label:, name:)
|
|
1737
|
+
@label = label
|
|
1738
|
+
@name = name
|
|
1739
|
+
freeze
|
|
1740
|
+
end
|
|
1741
|
+
|
|
1742
|
+
# Read one out of what the API answered.
|
|
1743
|
+
#
|
|
1744
|
+
# @param value [Object] the JSON document the API answered
|
|
1745
|
+
# @return [OrganizationInfoPlan]
|
|
1746
|
+
def self.from_json(value)
|
|
1747
|
+
fields = Runtime.as_fields(value, "OrganizationInfoPlan")
|
|
1748
|
+
new(
|
|
1749
|
+
label: Runtime.read(fields, "label", Runtime::TEXT),
|
|
1750
|
+
name: Runtime.read(fields, "name", Runtime::TEXT)
|
|
1751
|
+
)
|
|
1752
|
+
end
|
|
1753
|
+
|
|
1754
|
+
# Write one back the way the API reads it.
|
|
1755
|
+
#
|
|
1756
|
+
# @return [Hash{String => Object}]
|
|
1757
|
+
def to_h
|
|
1758
|
+
out = {}
|
|
1759
|
+
out["label"] = @label
|
|
1760
|
+
out["name"] = @name
|
|
1761
|
+
out
|
|
1762
|
+
end
|
|
1763
|
+
|
|
1764
|
+
# Whether that value carries the same members as this one.
|
|
1765
|
+
#
|
|
1766
|
+
# @param other [Object]
|
|
1767
|
+
# @return [Boolean]
|
|
1768
|
+
def ==(other)
|
|
1769
|
+
other.is_a?(OrganizationInfoPlan) && to_h == other.to_h
|
|
1770
|
+
end
|
|
1771
|
+
alias eql? ==
|
|
1772
|
+
|
|
1773
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1774
|
+
#
|
|
1775
|
+
# @return [Integer]
|
|
1776
|
+
def hash
|
|
1777
|
+
to_h.hash
|
|
1778
|
+
end
|
|
1779
|
+
end
|
|
1780
|
+
|
|
1781
|
+
# The `OrganizationInfoQuotas` the API declares.
|
|
1782
|
+
class OrganizationInfoQuotas
|
|
1783
|
+
attr_reader :applications_per_organization_limit,
|
|
1784
|
+
:days_of_events_retention_limit,
|
|
1785
|
+
:events_per_day_limit,
|
|
1786
|
+
:members_per_organization_limit
|
|
1787
|
+
|
|
1788
|
+
# @param applications_per_organization_limit [Integer] carries `applications_per_organization_limit`.
|
|
1789
|
+
# @param days_of_events_retention_limit [Integer] carries `days_of_events_retention_limit`.
|
|
1790
|
+
# @param events_per_day_limit [Integer] carries `events_per_day_limit`.
|
|
1791
|
+
# @param members_per_organization_limit [Integer] carries `members_per_organization_limit`.
|
|
1792
|
+
def initialize(
|
|
1793
|
+
applications_per_organization_limit:,
|
|
1794
|
+
days_of_events_retention_limit:,
|
|
1795
|
+
events_per_day_limit:,
|
|
1796
|
+
members_per_organization_limit:
|
|
1797
|
+
)
|
|
1798
|
+
@applications_per_organization_limit = applications_per_organization_limit
|
|
1799
|
+
@days_of_events_retention_limit = days_of_events_retention_limit
|
|
1800
|
+
@events_per_day_limit = events_per_day_limit
|
|
1801
|
+
@members_per_organization_limit = members_per_organization_limit
|
|
1802
|
+
freeze
|
|
1803
|
+
end
|
|
1804
|
+
|
|
1805
|
+
# Read one out of what the API answered.
|
|
1806
|
+
#
|
|
1807
|
+
# @param value [Object] the JSON document the API answered
|
|
1808
|
+
# @return [OrganizationInfoQuotas]
|
|
1809
|
+
def self.from_json(value)
|
|
1810
|
+
fields = Runtime.as_fields(value, "OrganizationInfoQuotas")
|
|
1811
|
+
new(
|
|
1812
|
+
applications_per_organization_limit: Runtime.read(
|
|
1813
|
+
fields,
|
|
1814
|
+
"applications_per_organization_limit",
|
|
1815
|
+
Runtime::INTEGER
|
|
1816
|
+
),
|
|
1817
|
+
days_of_events_retention_limit: Runtime.read(fields, "days_of_events_retention_limit", Runtime::INTEGER),
|
|
1818
|
+
events_per_day_limit: Runtime.read(fields, "events_per_day_limit", Runtime::INTEGER),
|
|
1819
|
+
members_per_organization_limit: Runtime.read(fields, "members_per_organization_limit", Runtime::INTEGER)
|
|
1820
|
+
)
|
|
1821
|
+
end
|
|
1822
|
+
|
|
1823
|
+
# Write one back the way the API reads it.
|
|
1824
|
+
#
|
|
1825
|
+
# @return [Hash{String => Object}]
|
|
1826
|
+
def to_h
|
|
1827
|
+
out = {}
|
|
1828
|
+
out["applications_per_organization_limit"] = @applications_per_organization_limit
|
|
1829
|
+
out["days_of_events_retention_limit"] = @days_of_events_retention_limit
|
|
1830
|
+
out["events_per_day_limit"] = @events_per_day_limit
|
|
1831
|
+
out["members_per_organization_limit"] = @members_per_organization_limit
|
|
1832
|
+
out
|
|
1833
|
+
end
|
|
1834
|
+
|
|
1835
|
+
# Whether that value carries the same members as this one.
|
|
1836
|
+
#
|
|
1837
|
+
# @param other [Object]
|
|
1838
|
+
# @return [Boolean]
|
|
1839
|
+
def ==(other)
|
|
1840
|
+
other.is_a?(OrganizationInfoQuotas) && to_h == other.to_h
|
|
1841
|
+
end
|
|
1842
|
+
alias eql? ==
|
|
1843
|
+
|
|
1844
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1845
|
+
#
|
|
1846
|
+
# @return [Integer]
|
|
1847
|
+
def hash
|
|
1848
|
+
to_h.hash
|
|
1849
|
+
end
|
|
1850
|
+
end
|
|
1851
|
+
|
|
1852
|
+
# The `OrganizationInfoUsers` the API declares.
|
|
1853
|
+
class OrganizationInfoUsers
|
|
1854
|
+
attr_reader :email,
|
|
1855
|
+
:first_name,
|
|
1856
|
+
:last_name,
|
|
1857
|
+
:role,
|
|
1858
|
+
:user_id
|
|
1859
|
+
|
|
1860
|
+
# @param email [String] carries `email`.
|
|
1861
|
+
# @param first_name [String] carries `first_name`.
|
|
1862
|
+
# @param last_name [String] carries `last_name`.
|
|
1863
|
+
# @param role [String] carries `role`.
|
|
1864
|
+
# @param user_id [String] carries `user_id`.
|
|
1865
|
+
def initialize(email:, first_name:, last_name:, role:, user_id:)
|
|
1866
|
+
@email = email
|
|
1867
|
+
@first_name = first_name
|
|
1868
|
+
@last_name = last_name
|
|
1869
|
+
@role = role
|
|
1870
|
+
@user_id = user_id
|
|
1871
|
+
freeze
|
|
1872
|
+
end
|
|
1873
|
+
|
|
1874
|
+
# Read one out of what the API answered.
|
|
1875
|
+
#
|
|
1876
|
+
# @param value [Object] the JSON document the API answered
|
|
1877
|
+
# @return [OrganizationInfoUsers]
|
|
1878
|
+
def self.from_json(value)
|
|
1879
|
+
fields = Runtime.as_fields(value, "OrganizationInfoUsers")
|
|
1880
|
+
new(
|
|
1881
|
+
email: Runtime.read(fields, "email", Runtime::TEXT),
|
|
1882
|
+
first_name: Runtime.read(fields, "first_name", Runtime::TEXT),
|
|
1883
|
+
last_name: Runtime.read(fields, "last_name", Runtime::TEXT),
|
|
1884
|
+
role: Runtime.read(fields, "role", Runtime::TEXT),
|
|
1885
|
+
user_id: Runtime.read(fields, "user_id", Runtime::UUID)
|
|
1886
|
+
)
|
|
1887
|
+
end
|
|
1888
|
+
|
|
1889
|
+
# Write one back the way the API reads it.
|
|
1890
|
+
#
|
|
1891
|
+
# @return [Hash{String => Object}]
|
|
1892
|
+
def to_h
|
|
1893
|
+
out = {}
|
|
1894
|
+
out["email"] = @email
|
|
1895
|
+
out["first_name"] = @first_name
|
|
1896
|
+
out["last_name"] = @last_name
|
|
1897
|
+
out["role"] = @role
|
|
1898
|
+
out["user_id"] = @user_id
|
|
1899
|
+
out
|
|
1900
|
+
end
|
|
1901
|
+
|
|
1902
|
+
# Whether that value carries the same members as this one.
|
|
1903
|
+
#
|
|
1904
|
+
# @param other [Object]
|
|
1905
|
+
# @return [Boolean]
|
|
1906
|
+
def ==(other)
|
|
1907
|
+
other.is_a?(OrganizationInfoUsers) && to_h == other.to_h
|
|
1908
|
+
end
|
|
1909
|
+
alias eql? ==
|
|
1910
|
+
|
|
1911
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1912
|
+
#
|
|
1913
|
+
# @return [Integer]
|
|
1914
|
+
def hash
|
|
1915
|
+
to_h.hash
|
|
1916
|
+
end
|
|
1917
|
+
end
|
|
1918
|
+
|
|
1919
|
+
# The `OrganizationPlan` the API declares.
|
|
1920
|
+
class OrganizationPlan
|
|
1921
|
+
attr_reader :label,
|
|
1922
|
+
:name
|
|
1923
|
+
|
|
1924
|
+
# @param label [String] carries `label`.
|
|
1925
|
+
# @param name [String] carries `name`.
|
|
1926
|
+
def initialize(label:, name:)
|
|
1927
|
+
@label = label
|
|
1928
|
+
@name = name
|
|
1929
|
+
freeze
|
|
1930
|
+
end
|
|
1931
|
+
|
|
1932
|
+
# Read one out of what the API answered.
|
|
1933
|
+
#
|
|
1934
|
+
# @param value [Object] the JSON document the API answered
|
|
1935
|
+
# @return [OrganizationPlan]
|
|
1936
|
+
def self.from_json(value)
|
|
1937
|
+
fields = Runtime.as_fields(value, "OrganizationPlan")
|
|
1938
|
+
new(
|
|
1939
|
+
label: Runtime.read(fields, "label", Runtime::TEXT),
|
|
1940
|
+
name: Runtime.read(fields, "name", Runtime::TEXT)
|
|
1941
|
+
)
|
|
1942
|
+
end
|
|
1943
|
+
|
|
1944
|
+
# Write one back the way the API reads it.
|
|
1945
|
+
#
|
|
1946
|
+
# @return [Hash{String => Object}]
|
|
1947
|
+
def to_h
|
|
1948
|
+
out = {}
|
|
1949
|
+
out["label"] = @label
|
|
1950
|
+
out["name"] = @name
|
|
1951
|
+
out
|
|
1952
|
+
end
|
|
1953
|
+
|
|
1954
|
+
# Whether that value carries the same members as this one.
|
|
1955
|
+
#
|
|
1956
|
+
# @param other [Object]
|
|
1957
|
+
# @return [Boolean]
|
|
1958
|
+
def ==(other)
|
|
1959
|
+
other.is_a?(OrganizationPlan) && to_h == other.to_h
|
|
1960
|
+
end
|
|
1961
|
+
alias eql? ==
|
|
1962
|
+
|
|
1963
|
+
# A value two equal instances share, so that either may key a hash.
|
|
1964
|
+
#
|
|
1965
|
+
# @return [Integer]
|
|
1966
|
+
def hash
|
|
1967
|
+
to_h.hash
|
|
1968
|
+
end
|
|
1969
|
+
end
|
|
1970
|
+
|
|
1971
|
+
# The `Problem` the API declares.
|
|
1972
|
+
class Problem
|
|
1973
|
+
attr_reader :detail,
|
|
1974
|
+
:id,
|
|
1975
|
+
:status,
|
|
1976
|
+
:title,
|
|
1977
|
+
:type,
|
|
1978
|
+
:validation
|
|
1979
|
+
|
|
1980
|
+
# @param detail [String] carries `detail`.
|
|
1981
|
+
# @param id [String] carries `id`, one of `ProblemId::VALUES`: Identifier of the problem that occurred, stable
|
|
1982
|
+
# across releases
|
|
1983
|
+
# @param status [Integer] carries `status`.
|
|
1984
|
+
# @param title [String] carries `title`.
|
|
1985
|
+
# @param type [String] carries `type`: Documentation page of this problem, which is also what distinguishes one
|
|
1986
|
+
# problem type from another as RFC 7807 asks. Prefer matching on `id`: it says the same thing without parsing a
|
|
1987
|
+
# URL.
|
|
1988
|
+
# @param validation [Object, nil] carries `validation`: Which submitted values were rejected and why, keyed by the
|
|
1989
|
+
# name of the field they were submitted under. Carried by validation failures (`Validation`, status 422) and
|
|
1990
|
+
# `null` for every other problem, as
|
|
1991
|
+
def initialize(detail:, id:, status:, title:, type:, validation: nil)
|
|
1992
|
+
@detail = detail
|
|
1993
|
+
@id = id
|
|
1994
|
+
@status = status
|
|
1995
|
+
@title = title
|
|
1996
|
+
@type = type
|
|
1997
|
+
@validation = validation
|
|
1998
|
+
freeze
|
|
1999
|
+
end
|
|
2000
|
+
|
|
2001
|
+
# Read one out of what the API answered.
|
|
2002
|
+
#
|
|
2003
|
+
# @param value [Object] the JSON document the API answered
|
|
2004
|
+
# @return [Problem]
|
|
2005
|
+
def self.from_json(value)
|
|
2006
|
+
fields = Runtime.as_fields(value, "Problem")
|
|
2007
|
+
new(
|
|
2008
|
+
detail: Runtime.read(fields, "detail", Runtime::TEXT),
|
|
2009
|
+
id: Runtime.read(fields, "id", Runtime.member_of(ProblemId)),
|
|
2010
|
+
status: Runtime.read(fields, "status", Runtime::INTEGER),
|
|
2011
|
+
title: Runtime.read(fields, "title", Runtime::TEXT),
|
|
2012
|
+
type: Runtime.read(fields, "type", Runtime::TEXT),
|
|
2013
|
+
validation: Runtime.maybe(fields, "validation", Runtime::JSON_VALUE)
|
|
2014
|
+
)
|
|
2015
|
+
end
|
|
2016
|
+
|
|
2017
|
+
# Write one back the way the API reads it.
|
|
2018
|
+
#
|
|
2019
|
+
# @return [Hash{String => Object}]
|
|
2020
|
+
def to_h
|
|
2021
|
+
out = {}
|
|
2022
|
+
out["detail"] = @detail
|
|
2023
|
+
out["id"] = @id
|
|
2024
|
+
out["status"] = @status
|
|
2025
|
+
out["title"] = @title
|
|
2026
|
+
out["type"] = @type
|
|
2027
|
+
out["validation"] = @validation unless @validation.nil?
|
|
2028
|
+
out
|
|
2029
|
+
end
|
|
2030
|
+
|
|
2031
|
+
# Whether that value carries the same members as this one.
|
|
2032
|
+
#
|
|
2033
|
+
# @param other [Object]
|
|
2034
|
+
# @return [Boolean]
|
|
2035
|
+
def ==(other)
|
|
2036
|
+
other.is_a?(Problem) && to_h == other.to_h
|
|
2037
|
+
end
|
|
2038
|
+
alias eql? ==
|
|
2039
|
+
|
|
2040
|
+
# A value two equal instances share, so that either may key a hash.
|
|
2041
|
+
#
|
|
2042
|
+
# @return [Integer]
|
|
2043
|
+
def hash
|
|
2044
|
+
to_h.hash
|
|
2045
|
+
end
|
|
2046
|
+
end
|
|
2047
|
+
|
|
2048
|
+
# The `QuotasResponse` the API declares.
|
|
2049
|
+
class QuotasResponse
|
|
2050
|
+
attr_reader :enabled,
|
|
2051
|
+
:limits
|
|
2052
|
+
|
|
2053
|
+
# @param enabled [Boolean] carries `enabled`.
|
|
2054
|
+
# @param limits [QuotasResponseLimits] carries `limits`.
|
|
2055
|
+
def initialize(enabled:, limits:)
|
|
2056
|
+
@enabled = enabled
|
|
2057
|
+
@limits = limits
|
|
2058
|
+
freeze
|
|
2059
|
+
end
|
|
2060
|
+
|
|
2061
|
+
# Read one out of what the API answered.
|
|
2062
|
+
#
|
|
2063
|
+
# @param value [Object] the JSON document the API answered
|
|
2064
|
+
# @return [QuotasResponse]
|
|
2065
|
+
def self.from_json(value)
|
|
2066
|
+
fields = Runtime.as_fields(value, "QuotasResponse")
|
|
2067
|
+
new(
|
|
2068
|
+
enabled: Runtime.read(fields, "enabled", Runtime::BOOLEAN),
|
|
2069
|
+
limits: Runtime.read(fields, "limits", QuotasResponseLimits.method(:from_json))
|
|
2070
|
+
)
|
|
2071
|
+
end
|
|
2072
|
+
|
|
2073
|
+
# Write one back the way the API reads it.
|
|
2074
|
+
#
|
|
2075
|
+
# @return [Hash{String => Object}]
|
|
2076
|
+
def to_h
|
|
2077
|
+
out = {}
|
|
2078
|
+
out["enabled"] = @enabled
|
|
2079
|
+
out["limits"] = @limits.to_h
|
|
2080
|
+
out
|
|
2081
|
+
end
|
|
2082
|
+
|
|
2083
|
+
# Whether that value carries the same members as this one.
|
|
2084
|
+
#
|
|
2085
|
+
# @param other [Object]
|
|
2086
|
+
# @return [Boolean]
|
|
2087
|
+
def ==(other)
|
|
2088
|
+
other.is_a?(QuotasResponse) && to_h == other.to_h
|
|
2089
|
+
end
|
|
2090
|
+
alias eql? ==
|
|
2091
|
+
|
|
2092
|
+
# A value two equal instances share, so that either may key a hash.
|
|
2093
|
+
#
|
|
2094
|
+
# @return [Integer]
|
|
2095
|
+
def hash
|
|
2096
|
+
to_h.hash
|
|
2097
|
+
end
|
|
2098
|
+
end
|
|
2099
|
+
|
|
2100
|
+
# The `QuotasResponseLimits` the API declares.
|
|
2101
|
+
class QuotasResponseLimits
|
|
2102
|
+
attr_reader :global_applications_per_organization_limit,
|
|
2103
|
+
:global_days_of_events_retention_limit,
|
|
2104
|
+
:global_event_types_per_application_limit,
|
|
2105
|
+
:global_events_per_day_limit,
|
|
2106
|
+
:global_members_per_organization_limit,
|
|
2107
|
+
:global_subscriptions_per_application_limit
|
|
2108
|
+
|
|
2109
|
+
# @param global_applications_per_organization_limit [Integer] carries
|
|
2110
|
+
# `global_applications_per_organization_limit`.
|
|
2111
|
+
# @param global_days_of_events_retention_limit [Integer] carries `global_days_of_events_retention_limit`.
|
|
2112
|
+
# @param global_event_types_per_application_limit [Integer] carries `global_event_types_per_application_limit`.
|
|
2113
|
+
# @param global_events_per_day_limit [Integer] carries `global_events_per_day_limit`.
|
|
2114
|
+
# @param global_members_per_organization_limit [Integer] carries `global_members_per_organization_limit`.
|
|
2115
|
+
# @param global_subscriptions_per_application_limit [Integer] carries
|
|
2116
|
+
# `global_subscriptions_per_application_limit`.
|
|
2117
|
+
def initialize(
|
|
2118
|
+
global_applications_per_organization_limit:,
|
|
2119
|
+
global_days_of_events_retention_limit:,
|
|
2120
|
+
global_event_types_per_application_limit:,
|
|
2121
|
+
global_events_per_day_limit:,
|
|
2122
|
+
global_members_per_organization_limit:,
|
|
2123
|
+
global_subscriptions_per_application_limit:
|
|
2124
|
+
)
|
|
2125
|
+
@global_applications_per_organization_limit = global_applications_per_organization_limit
|
|
2126
|
+
@global_days_of_events_retention_limit = global_days_of_events_retention_limit
|
|
2127
|
+
@global_event_types_per_application_limit = global_event_types_per_application_limit
|
|
2128
|
+
@global_events_per_day_limit = global_events_per_day_limit
|
|
2129
|
+
@global_members_per_organization_limit = global_members_per_organization_limit
|
|
2130
|
+
@global_subscriptions_per_application_limit = global_subscriptions_per_application_limit
|
|
2131
|
+
freeze
|
|
2132
|
+
end
|
|
2133
|
+
|
|
2134
|
+
# Read one out of what the API answered.
|
|
2135
|
+
#
|
|
2136
|
+
# @param value [Object] the JSON document the API answered
|
|
2137
|
+
# @return [QuotasResponseLimits]
|
|
2138
|
+
def self.from_json(value)
|
|
2139
|
+
fields = Runtime.as_fields(value, "QuotasResponseLimits")
|
|
2140
|
+
new(
|
|
2141
|
+
global_applications_per_organization_limit: Runtime.read(
|
|
2142
|
+
fields,
|
|
2143
|
+
"global_applications_per_organization_limit",
|
|
2144
|
+
Runtime::INTEGER
|
|
2145
|
+
),
|
|
2146
|
+
global_days_of_events_retention_limit: Runtime.read(
|
|
2147
|
+
fields,
|
|
2148
|
+
"global_days_of_events_retention_limit",
|
|
2149
|
+
Runtime::INTEGER
|
|
2150
|
+
),
|
|
2151
|
+
global_event_types_per_application_limit: Runtime.read(
|
|
2152
|
+
fields,
|
|
2153
|
+
"global_event_types_per_application_limit",
|
|
2154
|
+
Runtime::INTEGER
|
|
2155
|
+
),
|
|
2156
|
+
global_events_per_day_limit: Runtime.read(fields, "global_events_per_day_limit", Runtime::INTEGER),
|
|
2157
|
+
global_members_per_organization_limit: Runtime.read(
|
|
2158
|
+
fields,
|
|
2159
|
+
"global_members_per_organization_limit",
|
|
2160
|
+
Runtime::INTEGER
|
|
2161
|
+
),
|
|
2162
|
+
global_subscriptions_per_application_limit: Runtime.read(
|
|
2163
|
+
fields,
|
|
2164
|
+
"global_subscriptions_per_application_limit",
|
|
2165
|
+
Runtime::INTEGER
|
|
2166
|
+
)
|
|
2167
|
+
)
|
|
2168
|
+
end
|
|
2169
|
+
|
|
2170
|
+
# Write one back the way the API reads it.
|
|
2171
|
+
#
|
|
2172
|
+
# @return [Hash{String => Object}]
|
|
2173
|
+
def to_h
|
|
2174
|
+
out = {}
|
|
2175
|
+
out["global_applications_per_organization_limit"] = @global_applications_per_organization_limit
|
|
2176
|
+
out["global_days_of_events_retention_limit"] = @global_days_of_events_retention_limit
|
|
2177
|
+
out["global_event_types_per_application_limit"] = @global_event_types_per_application_limit
|
|
2178
|
+
out["global_events_per_day_limit"] = @global_events_per_day_limit
|
|
2179
|
+
out["global_members_per_organization_limit"] = @global_members_per_organization_limit
|
|
2180
|
+
out["global_subscriptions_per_application_limit"] = @global_subscriptions_per_application_limit
|
|
2181
|
+
out
|
|
2182
|
+
end
|
|
2183
|
+
|
|
2184
|
+
# Whether that value carries the same members as this one.
|
|
2185
|
+
#
|
|
2186
|
+
# @param other [Object]
|
|
2187
|
+
# @return [Boolean]
|
|
2188
|
+
def ==(other)
|
|
2189
|
+
other.is_a?(QuotasResponseLimits) && to_h == other.to_h
|
|
2190
|
+
end
|
|
2191
|
+
alias eql? ==
|
|
2192
|
+
|
|
2193
|
+
# A value two equal instances share, so that either may key a hash.
|
|
2194
|
+
#
|
|
2195
|
+
# @return [Integer]
|
|
2196
|
+
def hash
|
|
2197
|
+
to_h.hash
|
|
2198
|
+
end
|
|
2199
|
+
end
|
|
2200
|
+
|
|
2201
|
+
# The `ReplayEvent` the API declares.
|
|
2202
|
+
class ReplayEvent
|
|
2203
|
+
attr_reader :application_id
|
|
2204
|
+
|
|
2205
|
+
# @param application_id [String] carries `application_id`.
|
|
2206
|
+
def initialize(application_id:)
|
|
2207
|
+
@application_id = application_id
|
|
2208
|
+
freeze
|
|
2209
|
+
end
|
|
2210
|
+
|
|
2211
|
+
# Read one out of what the API answered.
|
|
2212
|
+
#
|
|
2213
|
+
# @param value [Object] the JSON document the API answered
|
|
2214
|
+
# @return [ReplayEvent]
|
|
2215
|
+
def self.from_json(value)
|
|
2216
|
+
fields = Runtime.as_fields(value, "ReplayEvent")
|
|
2217
|
+
new(
|
|
2218
|
+
application_id: Runtime.read(fields, "application_id", Runtime::UUID)
|
|
2219
|
+
)
|
|
2220
|
+
end
|
|
2221
|
+
|
|
2222
|
+
# Write one back the way the API reads it.
|
|
2223
|
+
#
|
|
2224
|
+
# @return [Hash{String => Object}]
|
|
2225
|
+
def to_h
|
|
2226
|
+
out = {}
|
|
2227
|
+
out["application_id"] = @application_id
|
|
2228
|
+
out
|
|
2229
|
+
end
|
|
2230
|
+
|
|
2231
|
+
# Whether that value carries the same members as this one.
|
|
2232
|
+
#
|
|
2233
|
+
# @param other [Object]
|
|
2234
|
+
# @return [Boolean]
|
|
2235
|
+
def ==(other)
|
|
2236
|
+
other.is_a?(ReplayEvent) && to_h == other.to_h
|
|
2237
|
+
end
|
|
2238
|
+
alias eql? ==
|
|
2239
|
+
|
|
2240
|
+
# A value two equal instances share, so that either may key a hash.
|
|
2241
|
+
#
|
|
2242
|
+
# @return [Integer]
|
|
2243
|
+
def hash
|
|
2244
|
+
to_h.hash
|
|
2245
|
+
end
|
|
2246
|
+
end
|
|
2247
|
+
|
|
2248
|
+
# The `RequestAttempt` the API declares.
|
|
2249
|
+
class RequestAttempt
|
|
2250
|
+
attr_reader :created_at,
|
|
2251
|
+
:event,
|
|
2252
|
+
:event_id,
|
|
2253
|
+
:request_attempt_id,
|
|
2254
|
+
:retry_count,
|
|
2255
|
+
:status,
|
|
2256
|
+
:subscription,
|
|
2257
|
+
:delay_until,
|
|
2258
|
+
:failed_at,
|
|
2259
|
+
:http_response_status,
|
|
2260
|
+
:picked_at,
|
|
2261
|
+
:response_id,
|
|
2262
|
+
:succeeded_at
|
|
2263
|
+
|
|
2264
|
+
# @param created_at [Time] carries `created_at`.
|
|
2265
|
+
# @param event [RequestAttemptEvent] carries `event`.
|
|
2266
|
+
# @param event_id [String] carries `event_id`.
|
|
2267
|
+
# @param request_attempt_id [String] carries `request_attempt_id`.
|
|
2268
|
+
# @param retry_count [Integer] carries `retry_count`.
|
|
2269
|
+
# @param status [RequestAttemptStatus] carries `status`: Status of a request attempt. The 'type' field indicates
|
|
2270
|
+
# the status variant. - waiting: {type, since, until} - Scheduled for future delivery - pending: {type, since} -
|
|
2271
|
+
# Ready to be processed - in_progre
|
|
2272
|
+
# @param subscription [RequestAttemptSubscription] carries `subscription`.
|
|
2273
|
+
# @param delay_until [Time, nil] carries `delay_until`.
|
|
2274
|
+
# @param failed_at [Time, nil] carries `failed_at`.
|
|
2275
|
+
# @param http_response_status [Integer, nil] carries `http_response_status`.
|
|
2276
|
+
# @param picked_at [Time, nil] carries `picked_at`.
|
|
2277
|
+
# @param response_id [String, nil] carries `response_id`.
|
|
2278
|
+
# @param succeeded_at [Time, nil] carries `succeeded_at`.
|
|
2279
|
+
def initialize(
|
|
2280
|
+
created_at:,
|
|
2281
|
+
event:,
|
|
2282
|
+
event_id:,
|
|
2283
|
+
request_attempt_id:,
|
|
2284
|
+
retry_count:,
|
|
2285
|
+
status:,
|
|
2286
|
+
subscription:,
|
|
2287
|
+
delay_until: nil,
|
|
2288
|
+
failed_at: nil,
|
|
2289
|
+
http_response_status: nil,
|
|
2290
|
+
picked_at: nil,
|
|
2291
|
+
response_id: nil,
|
|
2292
|
+
succeeded_at: nil
|
|
2293
|
+
)
|
|
2294
|
+
@created_at = created_at
|
|
2295
|
+
@event = event
|
|
2296
|
+
@event_id = event_id
|
|
2297
|
+
@request_attempt_id = request_attempt_id
|
|
2298
|
+
@retry_count = retry_count
|
|
2299
|
+
@status = status
|
|
2300
|
+
@subscription = subscription
|
|
2301
|
+
@delay_until = delay_until
|
|
2302
|
+
@failed_at = failed_at
|
|
2303
|
+
@http_response_status = http_response_status
|
|
2304
|
+
@picked_at = picked_at
|
|
2305
|
+
@response_id = response_id
|
|
2306
|
+
@succeeded_at = succeeded_at
|
|
2307
|
+
freeze
|
|
2308
|
+
end
|
|
2309
|
+
|
|
2310
|
+
# Read one out of what the API answered.
|
|
2311
|
+
#
|
|
2312
|
+
# @param value [Object] the JSON document the API answered
|
|
2313
|
+
# @return [RequestAttempt]
|
|
2314
|
+
def self.from_json(value)
|
|
2315
|
+
fields = Runtime.as_fields(value, "RequestAttempt")
|
|
2316
|
+
new(
|
|
2317
|
+
created_at: Runtime.read(fields, "created_at", Runtime::DATE_TIME),
|
|
2318
|
+
event: Runtime.read(fields, "event", RequestAttemptEvent.method(:from_json)),
|
|
2319
|
+
event_id: Runtime.read(fields, "event_id", Runtime::UUID),
|
|
2320
|
+
request_attempt_id: Runtime.read(fields, "request_attempt_id", Runtime::UUID),
|
|
2321
|
+
retry_count: Runtime.read(fields, "retry_count", Runtime::INTEGER),
|
|
2322
|
+
status: Runtime.read(fields, "status", RequestAttemptStatus.method(:from_json)),
|
|
2323
|
+
subscription: Runtime.read(fields, "subscription", RequestAttemptSubscription.method(:from_json)),
|
|
2324
|
+
delay_until: Runtime.maybe(fields, "delay_until", Runtime::DATE_TIME),
|
|
2325
|
+
failed_at: Runtime.maybe(fields, "failed_at", Runtime::DATE_TIME),
|
|
2326
|
+
http_response_status: Runtime.maybe(fields, "http_response_status", Runtime::INTEGER),
|
|
2327
|
+
picked_at: Runtime.maybe(fields, "picked_at", Runtime::DATE_TIME),
|
|
2328
|
+
response_id: Runtime.maybe(fields, "response_id", Runtime::UUID),
|
|
2329
|
+
succeeded_at: Runtime.maybe(fields, "succeeded_at", Runtime::DATE_TIME)
|
|
2330
|
+
)
|
|
2331
|
+
end
|
|
2332
|
+
|
|
2333
|
+
# Write one back the way the API reads it.
|
|
2334
|
+
#
|
|
2335
|
+
# @return [Hash{String => Object}]
|
|
2336
|
+
def to_h
|
|
2337
|
+
out = {}
|
|
2338
|
+
out["created_at"] = Runtime.moment(@created_at)
|
|
2339
|
+
out["event"] = @event.to_h
|
|
2340
|
+
out["event_id"] = @event_id
|
|
2341
|
+
out["request_attempt_id"] = @request_attempt_id
|
|
2342
|
+
out["retry_count"] = @retry_count
|
|
2343
|
+
out["status"] = @status.to_h
|
|
2344
|
+
out["subscription"] = @subscription.to_h
|
|
2345
|
+
out["delay_until"] = Runtime.moment(@delay_until) unless @delay_until.nil?
|
|
2346
|
+
out["failed_at"] = Runtime.moment(@failed_at) unless @failed_at.nil?
|
|
2347
|
+
out["http_response_status"] = @http_response_status unless @http_response_status.nil?
|
|
2348
|
+
out["picked_at"] = Runtime.moment(@picked_at) unless @picked_at.nil?
|
|
2349
|
+
out["response_id"] = @response_id unless @response_id.nil?
|
|
2350
|
+
out["succeeded_at"] = Runtime.moment(@succeeded_at) unless @succeeded_at.nil?
|
|
2351
|
+
out
|
|
2352
|
+
end
|
|
2353
|
+
|
|
2354
|
+
# Whether that value carries the same members as this one.
|
|
2355
|
+
#
|
|
2356
|
+
# @param other [Object]
|
|
2357
|
+
# @return [Boolean]
|
|
2358
|
+
def ==(other)
|
|
2359
|
+
other.is_a?(RequestAttempt) && to_h == other.to_h
|
|
2360
|
+
end
|
|
2361
|
+
alias eql? ==
|
|
2362
|
+
|
|
2363
|
+
# A value two equal instances share, so that either may key a hash.
|
|
2364
|
+
#
|
|
2365
|
+
# @return [Integer]
|
|
2366
|
+
def hash
|
|
2367
|
+
to_h.hash
|
|
2368
|
+
end
|
|
2369
|
+
end
|
|
2370
|
+
|
|
2371
|
+
# The `RequestAttemptEvent` the API declares.
|
|
2372
|
+
class RequestAttemptEvent
|
|
2373
|
+
attr_reader :event_id,
|
|
2374
|
+
:event_type_name
|
|
2375
|
+
|
|
2376
|
+
# @param event_id [String] carries `event_id`.
|
|
2377
|
+
# @param event_type_name [String] carries `event_type_name`.
|
|
2378
|
+
def initialize(event_id:, event_type_name:)
|
|
2379
|
+
@event_id = event_id
|
|
2380
|
+
@event_type_name = event_type_name
|
|
2381
|
+
freeze
|
|
2382
|
+
end
|
|
2383
|
+
|
|
2384
|
+
# Read one out of what the API answered.
|
|
2385
|
+
#
|
|
2386
|
+
# @param value [Object] the JSON document the API answered
|
|
2387
|
+
# @return [RequestAttemptEvent]
|
|
2388
|
+
def self.from_json(value)
|
|
2389
|
+
fields = Runtime.as_fields(value, "RequestAttemptEvent")
|
|
2390
|
+
new(
|
|
2391
|
+
event_id: Runtime.read(fields, "event_id", Runtime::UUID),
|
|
2392
|
+
event_type_name: Runtime.read(fields, "event_type_name", Runtime::TEXT)
|
|
2393
|
+
)
|
|
2394
|
+
end
|
|
2395
|
+
|
|
2396
|
+
# Write one back the way the API reads it.
|
|
2397
|
+
#
|
|
2398
|
+
# @return [Hash{String => Object}]
|
|
2399
|
+
def to_h
|
|
2400
|
+
out = {}
|
|
2401
|
+
out["event_id"] = @event_id
|
|
2402
|
+
out["event_type_name"] = @event_type_name
|
|
2403
|
+
out
|
|
2404
|
+
end
|
|
2405
|
+
|
|
2406
|
+
# Whether that value carries the same members as this one.
|
|
2407
|
+
#
|
|
2408
|
+
# @param other [Object]
|
|
2409
|
+
# @return [Boolean]
|
|
2410
|
+
def ==(other)
|
|
2411
|
+
other.is_a?(RequestAttemptEvent) && to_h == other.to_h
|
|
2412
|
+
end
|
|
2413
|
+
alias eql? ==
|
|
2414
|
+
|
|
2415
|
+
# A value two equal instances share, so that either may key a hash.
|
|
2416
|
+
#
|
|
2417
|
+
# @return [Integer]
|
|
2418
|
+
def hash
|
|
2419
|
+
to_h.hash
|
|
2420
|
+
end
|
|
2421
|
+
end
|
|
2422
|
+
|
|
2423
|
+
# The `RequestAttemptStatus` the API declares.
|
|
2424
|
+
class RequestAttemptStatus
|
|
2425
|
+
attr_reader :type,
|
|
2426
|
+
:at,
|
|
2427
|
+
:full_processing_ms,
|
|
2428
|
+
:since,
|
|
2429
|
+
:until_
|
|
2430
|
+
|
|
2431
|
+
# @param type [String] carries `type`, one of `RequestAttemptStatusType::VALUES`: Status type discriminator. One
|
|
2432
|
+
# of: waiting, pending, in_progress, successful, failed
|
|
2433
|
+
# @param at [Time, nil] carries `at`: Timestamp when completed (present in successful, failed)
|
|
2434
|
+
# @param full_processing_ms [Integer, nil] carries `full_processing_ms`: Total processing time in milliseconds
|
|
2435
|
+
# (present in successful, failed)
|
|
2436
|
+
# @param since [Time, nil] carries `since`: Timestamp when the status started (present in waiting, pending,
|
|
2437
|
+
# in_progress)
|
|
2438
|
+
# @param until_ [Time, nil] carries `until`: Timestamp until which waiting (only present in waiting status)
|
|
2439
|
+
def initialize(type:, at: nil, full_processing_ms: nil, since: nil, until_: nil)
|
|
2440
|
+
@type = type
|
|
2441
|
+
@at = at
|
|
2442
|
+
@full_processing_ms = full_processing_ms
|
|
2443
|
+
@since = since
|
|
2444
|
+
@until_ = until_
|
|
2445
|
+
freeze
|
|
2446
|
+
end
|
|
2447
|
+
|
|
2448
|
+
# Read one out of what the API answered.
|
|
2449
|
+
#
|
|
2450
|
+
# @param value [Object] the JSON document the API answered
|
|
2451
|
+
# @return [RequestAttemptStatus]
|
|
2452
|
+
def self.from_json(value)
|
|
2453
|
+
fields = Runtime.as_fields(value, "RequestAttemptStatus")
|
|
2454
|
+
new(
|
|
2455
|
+
type: Runtime.read(fields, "type", Runtime.member_of(RequestAttemptStatusType)),
|
|
2456
|
+
at: Runtime.maybe(fields, "at", Runtime::DATE_TIME),
|
|
2457
|
+
full_processing_ms: Runtime.maybe(fields, "full_processing_ms", Runtime::INTEGER),
|
|
2458
|
+
since: Runtime.maybe(fields, "since", Runtime::DATE_TIME),
|
|
2459
|
+
until_: Runtime.maybe(fields, "until", Runtime::DATE_TIME)
|
|
2460
|
+
)
|
|
2461
|
+
end
|
|
2462
|
+
|
|
2463
|
+
# Write one back the way the API reads it.
|
|
2464
|
+
#
|
|
2465
|
+
# @return [Hash{String => Object}]
|
|
2466
|
+
def to_h
|
|
2467
|
+
out = {}
|
|
2468
|
+
out["type"] = @type
|
|
2469
|
+
out["at"] = Runtime.moment(@at) unless @at.nil?
|
|
2470
|
+
out["full_processing_ms"] = @full_processing_ms unless @full_processing_ms.nil?
|
|
2471
|
+
out["since"] = Runtime.moment(@since) unless @since.nil?
|
|
2472
|
+
out["until"] = Runtime.moment(@until_) unless @until_.nil?
|
|
2473
|
+
out
|
|
2474
|
+
end
|
|
2475
|
+
|
|
2476
|
+
# Whether that value carries the same members as this one.
|
|
2477
|
+
#
|
|
2478
|
+
# @param other [Object]
|
|
2479
|
+
# @return [Boolean]
|
|
2480
|
+
def ==(other)
|
|
2481
|
+
other.is_a?(RequestAttemptStatus) && to_h == other.to_h
|
|
2482
|
+
end
|
|
2483
|
+
alias eql? ==
|
|
2484
|
+
|
|
2485
|
+
# A value two equal instances share, so that either may key a hash.
|
|
2486
|
+
#
|
|
2487
|
+
# @return [Integer]
|
|
2488
|
+
def hash
|
|
2489
|
+
to_h.hash
|
|
2490
|
+
end
|
|
2491
|
+
end
|
|
2492
|
+
|
|
2493
|
+
# The `RequestAttemptSubscription` the API declares.
|
|
2494
|
+
class RequestAttemptSubscription
|
|
2495
|
+
attr_reader :subscription_id,
|
|
2496
|
+
:description
|
|
2497
|
+
|
|
2498
|
+
# @param subscription_id [String] carries `subscription_id`.
|
|
2499
|
+
# @param description [String, nil] carries `description`.
|
|
2500
|
+
def initialize(subscription_id:, description: nil)
|
|
2501
|
+
@subscription_id = subscription_id
|
|
2502
|
+
@description = description
|
|
2503
|
+
freeze
|
|
2504
|
+
end
|
|
2505
|
+
|
|
2506
|
+
# Read one out of what the API answered.
|
|
2507
|
+
#
|
|
2508
|
+
# @param value [Object] the JSON document the API answered
|
|
2509
|
+
# @return [RequestAttemptSubscription]
|
|
2510
|
+
def self.from_json(value)
|
|
2511
|
+
fields = Runtime.as_fields(value, "RequestAttemptSubscription")
|
|
2512
|
+
new(
|
|
2513
|
+
subscription_id: Runtime.read(fields, "subscription_id", Runtime::UUID),
|
|
2514
|
+
description: Runtime.maybe(fields, "description", Runtime::TEXT)
|
|
2515
|
+
)
|
|
2516
|
+
end
|
|
2517
|
+
|
|
2518
|
+
# Write one back the way the API reads it.
|
|
2519
|
+
#
|
|
2520
|
+
# @return [Hash{String => Object}]
|
|
2521
|
+
def to_h
|
|
2522
|
+
out = {}
|
|
2523
|
+
out["subscription_id"] = @subscription_id
|
|
2524
|
+
out["description"] = @description unless @description.nil?
|
|
2525
|
+
out
|
|
2526
|
+
end
|
|
2527
|
+
|
|
2528
|
+
# Whether that value carries the same members as this one.
|
|
2529
|
+
#
|
|
2530
|
+
# @param other [Object]
|
|
2531
|
+
# @return [Boolean]
|
|
2532
|
+
def ==(other)
|
|
2533
|
+
other.is_a?(RequestAttemptSubscription) && to_h == other.to_h
|
|
2534
|
+
end
|
|
2535
|
+
alias eql? ==
|
|
2536
|
+
|
|
2537
|
+
# A value two equal instances share, so that either may key a hash.
|
|
2538
|
+
#
|
|
2539
|
+
# @return [Integer]
|
|
2540
|
+
def hash
|
|
2541
|
+
to_h.hash
|
|
2542
|
+
end
|
|
2543
|
+
end
|
|
2544
|
+
|
|
2545
|
+
# The `Response` the API declares.
|
|
2546
|
+
class Response
|
|
2547
|
+
attr_reader :response_id,
|
|
2548
|
+
:body,
|
|
2549
|
+
:elapsed_time_ms,
|
|
2550
|
+
:headers,
|
|
2551
|
+
:http_code,
|
|
2552
|
+
:response_error_name
|
|
2553
|
+
|
|
2554
|
+
# @param response_id [String] carries `response_id`.
|
|
2555
|
+
# @param body [String, nil] carries `body`.
|
|
2556
|
+
# @param elapsed_time_ms [Integer, nil] carries `elapsed_time_ms`.
|
|
2557
|
+
# @param headers [Hash{String => String}, nil] carries `headers`.
|
|
2558
|
+
# @param http_code [Integer, nil] carries `http_code`.
|
|
2559
|
+
# @param response_error_name [String, nil] carries `response_error_name`.
|
|
2560
|
+
def initialize(
|
|
2561
|
+
response_id:,
|
|
2562
|
+
body: nil,
|
|
2563
|
+
elapsed_time_ms: nil,
|
|
2564
|
+
headers: nil,
|
|
2565
|
+
http_code: nil,
|
|
2566
|
+
response_error_name: nil
|
|
2567
|
+
)
|
|
2568
|
+
@response_id = response_id
|
|
2569
|
+
@body = body
|
|
2570
|
+
@elapsed_time_ms = elapsed_time_ms
|
|
2571
|
+
@headers = headers
|
|
2572
|
+
@http_code = http_code
|
|
2573
|
+
@response_error_name = response_error_name
|
|
2574
|
+
freeze
|
|
2575
|
+
end
|
|
2576
|
+
|
|
2577
|
+
# Read one out of what the API answered.
|
|
2578
|
+
#
|
|
2579
|
+
# @param value [Object] the JSON document the API answered
|
|
2580
|
+
# @return [Response]
|
|
2581
|
+
def self.from_json(value)
|
|
2582
|
+
fields = Runtime.as_fields(value, "Response")
|
|
2583
|
+
new(
|
|
2584
|
+
response_id: Runtime.read(fields, "response_id", Runtime::UUID),
|
|
2585
|
+
body: Runtime.maybe(fields, "body", Runtime::TEXT),
|
|
2586
|
+
elapsed_time_ms: Runtime.maybe(fields, "elapsed_time_ms", Runtime::INTEGER),
|
|
2587
|
+
headers: Runtime.maybe(fields, "headers", Runtime.map(Runtime::TEXT)),
|
|
2588
|
+
http_code: Runtime.maybe(fields, "http_code", Runtime::INTEGER),
|
|
2589
|
+
response_error_name: Runtime.maybe(fields, "response_error_name", Runtime::TEXT)
|
|
2590
|
+
)
|
|
2591
|
+
end
|
|
2592
|
+
|
|
2593
|
+
# Write one back the way the API reads it.
|
|
2594
|
+
#
|
|
2595
|
+
# @return [Hash{String => Object}]
|
|
2596
|
+
def to_h
|
|
2597
|
+
out = {}
|
|
2598
|
+
out["response_id"] = @response_id
|
|
2599
|
+
out["body"] = @body unless @body.nil?
|
|
2600
|
+
out["elapsed_time_ms"] = @elapsed_time_ms unless @elapsed_time_ms.nil?
|
|
2601
|
+
out["headers"] = @headers unless @headers.nil?
|
|
2602
|
+
out["http_code"] = @http_code unless @http_code.nil?
|
|
2603
|
+
out["response_error_name"] = @response_error_name unless @response_error_name.nil?
|
|
2604
|
+
out
|
|
2605
|
+
end
|
|
2606
|
+
|
|
2607
|
+
# Whether that value carries the same members as this one.
|
|
2608
|
+
#
|
|
2609
|
+
# @param other [Object]
|
|
2610
|
+
# @return [Boolean]
|
|
2611
|
+
def ==(other)
|
|
2612
|
+
other.is_a?(Response) && to_h == other.to_h
|
|
2613
|
+
end
|
|
2614
|
+
alias eql? ==
|
|
2615
|
+
|
|
2616
|
+
# A value two equal instances share, so that either may key a hash.
|
|
2617
|
+
#
|
|
2618
|
+
# @return [Integer]
|
|
2619
|
+
def hash
|
|
2620
|
+
to_h.hash
|
|
2621
|
+
end
|
|
2622
|
+
end
|
|
2623
|
+
|
|
2624
|
+
# The `ServiceToken` the API declares.
|
|
2625
|
+
class ServiceToken
|
|
2626
|
+
attr_reader :biscuit,
|
|
2627
|
+
:created_at,
|
|
2628
|
+
:name,
|
|
2629
|
+
:token_id
|
|
2630
|
+
|
|
2631
|
+
# @param biscuit [String] carries `biscuit`.
|
|
2632
|
+
# @param created_at [Time] carries `created_at`.
|
|
2633
|
+
# @param name [String] carries `name`.
|
|
2634
|
+
# @param token_id [String] carries `token_id`.
|
|
2635
|
+
def initialize(biscuit:, created_at:, name:, token_id:)
|
|
2636
|
+
@biscuit = biscuit
|
|
2637
|
+
@created_at = created_at
|
|
2638
|
+
@name = name
|
|
2639
|
+
@token_id = token_id
|
|
2640
|
+
freeze
|
|
2641
|
+
end
|
|
2642
|
+
|
|
2643
|
+
# Read one out of what the API answered.
|
|
2644
|
+
#
|
|
2645
|
+
# @param value [Object] the JSON document the API answered
|
|
2646
|
+
# @return [ServiceToken]
|
|
2647
|
+
def self.from_json(value)
|
|
2648
|
+
fields = Runtime.as_fields(value, "ServiceToken")
|
|
2649
|
+
new(
|
|
2650
|
+
biscuit: Runtime.read(fields, "biscuit", Runtime::TEXT),
|
|
2651
|
+
created_at: Runtime.read(fields, "created_at", Runtime::DATE_TIME),
|
|
2652
|
+
name: Runtime.read(fields, "name", Runtime::TEXT),
|
|
2653
|
+
token_id: Runtime.read(fields, "token_id", Runtime::UUID)
|
|
2654
|
+
)
|
|
2655
|
+
end
|
|
2656
|
+
|
|
2657
|
+
# Write one back the way the API reads it.
|
|
2658
|
+
#
|
|
2659
|
+
# @return [Hash{String => Object}]
|
|
2660
|
+
def to_h
|
|
2661
|
+
out = {}
|
|
2662
|
+
out["biscuit"] = @biscuit
|
|
2663
|
+
out["created_at"] = Runtime.moment(@created_at)
|
|
2664
|
+
out["name"] = @name
|
|
2665
|
+
out["token_id"] = @token_id
|
|
2666
|
+
out
|
|
2667
|
+
end
|
|
2668
|
+
|
|
2669
|
+
# Whether that value carries the same members as this one.
|
|
2670
|
+
#
|
|
2671
|
+
# @param other [Object]
|
|
2672
|
+
# @return [Boolean]
|
|
2673
|
+
def ==(other)
|
|
2674
|
+
other.is_a?(ServiceToken) && to_h == other.to_h
|
|
2675
|
+
end
|
|
2676
|
+
alias eql? ==
|
|
2677
|
+
|
|
2678
|
+
# A value two equal instances share, so that either may key a hash.
|
|
2679
|
+
#
|
|
2680
|
+
# @return [Integer]
|
|
2681
|
+
def hash
|
|
2682
|
+
to_h.hash
|
|
2683
|
+
end
|
|
2684
|
+
end
|
|
2685
|
+
|
|
2686
|
+
# The `ServiceTokenPost` the API declares.
|
|
2687
|
+
class ServiceTokenPost
|
|
2688
|
+
attr_reader :name,
|
|
2689
|
+
:organization_id
|
|
2690
|
+
|
|
2691
|
+
# @param name [String] carries `name`.
|
|
2692
|
+
# @param organization_id [String] carries `organization_id`.
|
|
2693
|
+
def initialize(name:, organization_id:)
|
|
2694
|
+
@name = name
|
|
2695
|
+
@organization_id = organization_id
|
|
2696
|
+
freeze
|
|
2697
|
+
end
|
|
2698
|
+
|
|
2699
|
+
# Read one out of what the API answered.
|
|
2700
|
+
#
|
|
2701
|
+
# @param value [Object] the JSON document the API answered
|
|
2702
|
+
# @return [ServiceTokenPost]
|
|
2703
|
+
def self.from_json(value)
|
|
2704
|
+
fields = Runtime.as_fields(value, "ServiceTokenPost")
|
|
2705
|
+
new(
|
|
2706
|
+
name: Runtime.read(fields, "name", Runtime::TEXT),
|
|
2707
|
+
organization_id: Runtime.read(fields, "organization_id", Runtime::UUID)
|
|
2708
|
+
)
|
|
2709
|
+
end
|
|
2710
|
+
|
|
2711
|
+
# Write one back the way the API reads it.
|
|
2712
|
+
#
|
|
2713
|
+
# @return [Hash{String => Object}]
|
|
2714
|
+
def to_h
|
|
2715
|
+
out = {}
|
|
2716
|
+
out["name"] = @name
|
|
2717
|
+
out["organization_id"] = @organization_id
|
|
2718
|
+
out
|
|
2719
|
+
end
|
|
2720
|
+
|
|
2721
|
+
# Whether that value carries the same members as this one.
|
|
2722
|
+
#
|
|
2723
|
+
# @param other [Object]
|
|
2724
|
+
# @return [Boolean]
|
|
2725
|
+
def ==(other)
|
|
2726
|
+
other.is_a?(ServiceTokenPost) && to_h == other.to_h
|
|
2727
|
+
end
|
|
2728
|
+
alias eql? ==
|
|
2729
|
+
|
|
2730
|
+
# A value two equal instances share, so that either may key a hash.
|
|
2731
|
+
#
|
|
2732
|
+
# @return [Integer]
|
|
2733
|
+
def hash
|
|
2734
|
+
to_h.hash
|
|
2735
|
+
end
|
|
2736
|
+
end
|
|
2737
|
+
|
|
2738
|
+
# The `Subscription` the API declares.
|
|
2739
|
+
class Subscription
|
|
2740
|
+
attr_reader :application_id,
|
|
2741
|
+
:created_at,
|
|
2742
|
+
:dedicated_workers,
|
|
2743
|
+
:event_types,
|
|
2744
|
+
:is_enabled,
|
|
2745
|
+
:label_key,
|
|
2746
|
+
:label_value,
|
|
2747
|
+
:labels,
|
|
2748
|
+
:metadata,
|
|
2749
|
+
:secret,
|
|
2750
|
+
:subscription_id,
|
|
2751
|
+
:target,
|
|
2752
|
+
:updated_at,
|
|
2753
|
+
:description
|
|
2754
|
+
|
|
2755
|
+
# @param application_id [String] carries `application_id`.
|
|
2756
|
+
# @param created_at [Time] carries `created_at`.
|
|
2757
|
+
# @param dedicated_workers [Array<String>] carries `dedicated_workers`.
|
|
2758
|
+
# @param event_types [Array<String>] carries `event_types`.
|
|
2759
|
+
# @param is_enabled [Boolean] carries `is_enabled`.
|
|
2760
|
+
# @param label_key [String] carries `label_key`: _Kept for backward compatibility, you should use `labels`_
|
|
2761
|
+
# @param label_value [String] carries `label_value`: _Kept for backward compatibility, you should use `labels`_
|
|
2762
|
+
# @param labels [Hash{String => String}] carries `labels`.
|
|
2763
|
+
# @param metadata [Hash{String => String}] carries `metadata`.
|
|
2764
|
+
# @param secret [String] carries `secret`.
|
|
2765
|
+
# @param subscription_id [String] carries `subscription_id`.
|
|
2766
|
+
# @param target [SubscriptionTarget] carries `target`.
|
|
2767
|
+
# @param updated_at [Time] carries `updated_at`.
|
|
2768
|
+
# @param description [String, nil] carries `description`.
|
|
2769
|
+
def initialize(
|
|
2770
|
+
application_id:,
|
|
2771
|
+
created_at:,
|
|
2772
|
+
dedicated_workers:,
|
|
2773
|
+
event_types:,
|
|
2774
|
+
is_enabled:,
|
|
2775
|
+
label_key:,
|
|
2776
|
+
label_value:,
|
|
2777
|
+
labels:,
|
|
2778
|
+
metadata:,
|
|
2779
|
+
secret:,
|
|
2780
|
+
subscription_id:,
|
|
2781
|
+
target:,
|
|
2782
|
+
updated_at:,
|
|
2783
|
+
description: nil
|
|
2784
|
+
)
|
|
2785
|
+
@application_id = application_id
|
|
2786
|
+
@created_at = created_at
|
|
2787
|
+
@dedicated_workers = dedicated_workers
|
|
2788
|
+
@event_types = event_types
|
|
2789
|
+
@is_enabled = is_enabled
|
|
2790
|
+
@label_key = label_key
|
|
2791
|
+
@label_value = label_value
|
|
2792
|
+
@labels = labels
|
|
2793
|
+
@metadata = metadata
|
|
2794
|
+
@secret = secret
|
|
2795
|
+
@subscription_id = subscription_id
|
|
2796
|
+
@target = target
|
|
2797
|
+
@updated_at = updated_at
|
|
2798
|
+
@description = description
|
|
2799
|
+
freeze
|
|
2800
|
+
end
|
|
2801
|
+
|
|
2802
|
+
# Read one out of what the API answered.
|
|
2803
|
+
#
|
|
2804
|
+
# @param value [Object] the JSON document the API answered
|
|
2805
|
+
# @return [Subscription]
|
|
2806
|
+
def self.from_json(value)
|
|
2807
|
+
fields = Runtime.as_fields(value, "Subscription")
|
|
2808
|
+
new(
|
|
2809
|
+
application_id: Runtime.read(fields, "application_id", Runtime::UUID),
|
|
2810
|
+
created_at: Runtime.read(fields, "created_at", Runtime::DATE_TIME),
|
|
2811
|
+
dedicated_workers: Runtime.read(fields, "dedicated_workers", Runtime.list(Runtime::TEXT)),
|
|
2812
|
+
event_types: Runtime.read(fields, "event_types", Runtime.list(Runtime::TEXT)),
|
|
2813
|
+
is_enabled: Runtime.read(fields, "is_enabled", Runtime::BOOLEAN),
|
|
2814
|
+
label_key: Runtime.read(fields, "label_key", Runtime::TEXT),
|
|
2815
|
+
label_value: Runtime.read(fields, "label_value", Runtime::TEXT),
|
|
2816
|
+
labels: Runtime.read(fields, "labels", Runtime.map(Runtime::TEXT)),
|
|
2817
|
+
metadata: Runtime.read(fields, "metadata", Runtime.map(Runtime::TEXT)),
|
|
2818
|
+
secret: Runtime.read(fields, "secret", Runtime::UUID),
|
|
2819
|
+
subscription_id: Runtime.read(fields, "subscription_id", Runtime::UUID),
|
|
2820
|
+
target: Runtime.read(fields, "target", SubscriptionTarget.method(:from_json)),
|
|
2821
|
+
updated_at: Runtime.read(fields, "updated_at", Runtime::DATE_TIME),
|
|
2822
|
+
description: Runtime.maybe(fields, "description", Runtime::TEXT)
|
|
2823
|
+
)
|
|
2824
|
+
end
|
|
2825
|
+
|
|
2826
|
+
# Write one back the way the API reads it.
|
|
2827
|
+
#
|
|
2828
|
+
# @return [Hash{String => Object}]
|
|
2829
|
+
def to_h
|
|
2830
|
+
out = {}
|
|
2831
|
+
out["application_id"] = @application_id
|
|
2832
|
+
out["created_at"] = Runtime.moment(@created_at)
|
|
2833
|
+
out["dedicated_workers"] = @dedicated_workers
|
|
2834
|
+
out["event_types"] = @event_types
|
|
2835
|
+
out["is_enabled"] = @is_enabled
|
|
2836
|
+
out["label_key"] = @label_key
|
|
2837
|
+
out["label_value"] = @label_value
|
|
2838
|
+
out["labels"] = @labels
|
|
2839
|
+
out["metadata"] = @metadata
|
|
2840
|
+
out["secret"] = @secret
|
|
2841
|
+
out["subscription_id"] = @subscription_id
|
|
2842
|
+
out["target"] = @target.to_h
|
|
2843
|
+
out["updated_at"] = Runtime.moment(@updated_at)
|
|
2844
|
+
out["description"] = @description unless @description.nil?
|
|
2845
|
+
out
|
|
2846
|
+
end
|
|
2847
|
+
|
|
2848
|
+
# Whether that value carries the same members as this one.
|
|
2849
|
+
#
|
|
2850
|
+
# @param other [Object]
|
|
2851
|
+
# @return [Boolean]
|
|
2852
|
+
def ==(other)
|
|
2853
|
+
other.is_a?(Subscription) && to_h == other.to_h
|
|
2854
|
+
end
|
|
2855
|
+
alias eql? ==
|
|
2856
|
+
|
|
2857
|
+
# A value two equal instances share, so that either may key a hash.
|
|
2858
|
+
#
|
|
2859
|
+
# @return [Integer]
|
|
2860
|
+
def hash
|
|
2861
|
+
to_h.hash
|
|
2862
|
+
end
|
|
2863
|
+
end
|
|
2864
|
+
|
|
2865
|
+
# The `SubscriptionPost` the API declares.
|
|
2866
|
+
class SubscriptionPost
|
|
2867
|
+
attr_reader :application_id,
|
|
2868
|
+
:event_types,
|
|
2869
|
+
:is_enabled,
|
|
2870
|
+
:target,
|
|
2871
|
+
:dedicated_workers,
|
|
2872
|
+
:description,
|
|
2873
|
+
:label_key,
|
|
2874
|
+
:label_value,
|
|
2875
|
+
:labels,
|
|
2876
|
+
:metadata
|
|
2877
|
+
|
|
2878
|
+
# @param application_id [String] carries `application_id`.
|
|
2879
|
+
# @param event_types [Array<String>] carries `event_types`.
|
|
2880
|
+
# @param is_enabled [Boolean] carries `is_enabled`.
|
|
2881
|
+
# @param target [SubscriptionPostTarget] carries `target`.
|
|
2882
|
+
# @param dedicated_workers [Array<String>, nil] carries `dedicated_workers`.
|
|
2883
|
+
# @param description [String, nil] carries `description`.
|
|
2884
|
+
# @param label_key [String, nil] carries `label_key`: _Kept for backward compatibility, you should use `labels`_
|
|
2885
|
+
# @param label_value [String, nil] carries `label_value`: _Kept for backward compatibility, you should use
|
|
2886
|
+
# `labels`_
|
|
2887
|
+
# @param labels [Hash{String => String}, nil] carries `labels`.
|
|
2888
|
+
# @param metadata [Hash{String => String}, nil] carries `metadata`.
|
|
2889
|
+
def initialize(
|
|
2890
|
+
application_id:,
|
|
2891
|
+
event_types:,
|
|
2892
|
+
is_enabled:,
|
|
2893
|
+
target:,
|
|
2894
|
+
dedicated_workers: nil,
|
|
2895
|
+
description: nil,
|
|
2896
|
+
label_key: nil,
|
|
2897
|
+
label_value: nil,
|
|
2898
|
+
labels: nil,
|
|
2899
|
+
metadata: nil
|
|
2900
|
+
)
|
|
2901
|
+
@application_id = application_id
|
|
2902
|
+
@event_types = event_types
|
|
2903
|
+
@is_enabled = is_enabled
|
|
2904
|
+
@target = target
|
|
2905
|
+
@dedicated_workers = dedicated_workers
|
|
2906
|
+
@description = description
|
|
2907
|
+
@label_key = label_key
|
|
2908
|
+
@label_value = label_value
|
|
2909
|
+
@labels = labels
|
|
2910
|
+
@metadata = metadata
|
|
2911
|
+
freeze
|
|
2912
|
+
end
|
|
2913
|
+
|
|
2914
|
+
# Read one out of what the API answered.
|
|
2915
|
+
#
|
|
2916
|
+
# @param value [Object] the JSON document the API answered
|
|
2917
|
+
# @return [SubscriptionPost]
|
|
2918
|
+
def self.from_json(value)
|
|
2919
|
+
fields = Runtime.as_fields(value, "SubscriptionPost")
|
|
2920
|
+
new(
|
|
2921
|
+
application_id: Runtime.read(fields, "application_id", Runtime::UUID),
|
|
2922
|
+
event_types: Runtime.read(fields, "event_types", Runtime.list(Runtime::TEXT)),
|
|
2923
|
+
is_enabled: Runtime.read(fields, "is_enabled", Runtime::BOOLEAN),
|
|
2924
|
+
target: Runtime.read(fields, "target", SubscriptionPostTarget.method(:from_json)),
|
|
2925
|
+
dedicated_workers: Runtime.maybe(fields, "dedicated_workers", Runtime.list(Runtime::TEXT)),
|
|
2926
|
+
description: Runtime.maybe(fields, "description", Runtime::TEXT),
|
|
2927
|
+
label_key: Runtime.maybe(fields, "label_key", Runtime::TEXT),
|
|
2928
|
+
label_value: Runtime.maybe(fields, "label_value", Runtime::TEXT),
|
|
2929
|
+
labels: Runtime.maybe(fields, "labels", Runtime.map(Runtime::TEXT)),
|
|
2930
|
+
metadata: Runtime.maybe(fields, "metadata", Runtime.map(Runtime::TEXT))
|
|
2931
|
+
)
|
|
2932
|
+
end
|
|
2933
|
+
|
|
2934
|
+
# Write one back the way the API reads it.
|
|
2935
|
+
#
|
|
2936
|
+
# @return [Hash{String => Object}]
|
|
2937
|
+
def to_h
|
|
2938
|
+
out = {}
|
|
2939
|
+
out["application_id"] = @application_id
|
|
2940
|
+
out["event_types"] = @event_types
|
|
2941
|
+
out["is_enabled"] = @is_enabled
|
|
2942
|
+
out["target"] = @target.to_h
|
|
2943
|
+
out["dedicated_workers"] = @dedicated_workers unless @dedicated_workers.nil?
|
|
2944
|
+
out["description"] = @description unless @description.nil?
|
|
2945
|
+
out["label_key"] = @label_key unless @label_key.nil?
|
|
2946
|
+
out["label_value"] = @label_value unless @label_value.nil?
|
|
2947
|
+
out["labels"] = @labels unless @labels.nil?
|
|
2948
|
+
out["metadata"] = @metadata unless @metadata.nil?
|
|
2949
|
+
out
|
|
2950
|
+
end
|
|
2951
|
+
|
|
2952
|
+
# Whether that value carries the same members as this one.
|
|
2953
|
+
#
|
|
2954
|
+
# @param other [Object]
|
|
2955
|
+
# @return [Boolean]
|
|
2956
|
+
def ==(other)
|
|
2957
|
+
other.is_a?(SubscriptionPost) && to_h == other.to_h
|
|
2958
|
+
end
|
|
2959
|
+
alias eql? ==
|
|
2960
|
+
|
|
2961
|
+
# A value two equal instances share, so that either may key a hash.
|
|
2962
|
+
#
|
|
2963
|
+
# @return [Integer]
|
|
2964
|
+
def hash
|
|
2965
|
+
to_h.hash
|
|
2966
|
+
end
|
|
2967
|
+
end
|
|
2968
|
+
|
|
2969
|
+
# The `SubscriptionPostTarget` the API declares.
|
|
2970
|
+
class SubscriptionPostTarget
|
|
2971
|
+
attr_reader :headers,
|
|
2972
|
+
:method_,
|
|
2973
|
+
:type,
|
|
2974
|
+
:url
|
|
2975
|
+
|
|
2976
|
+
# @param headers [Object] carries `headers`.
|
|
2977
|
+
# @param method_ [String] carries `method`.
|
|
2978
|
+
# @param type [String] carries `type`.
|
|
2979
|
+
# @param url [String] carries `url`.
|
|
2980
|
+
def initialize(headers:, method_:, type:, url:)
|
|
2981
|
+
@headers = headers
|
|
2982
|
+
@method_ = method_
|
|
2983
|
+
@type = type
|
|
2984
|
+
@url = url
|
|
2985
|
+
freeze
|
|
2986
|
+
end
|
|
2987
|
+
|
|
2988
|
+
# Read one out of what the API answered.
|
|
2989
|
+
#
|
|
2990
|
+
# @param value [Object] the JSON document the API answered
|
|
2991
|
+
# @return [SubscriptionPostTarget]
|
|
2992
|
+
def self.from_json(value)
|
|
2993
|
+
fields = Runtime.as_fields(value, "SubscriptionPostTarget")
|
|
2994
|
+
new(
|
|
2995
|
+
headers: Runtime.read(fields, "headers", Runtime::JSON_VALUE),
|
|
2996
|
+
method_: Runtime.read(fields, "method", Runtime::TEXT),
|
|
2997
|
+
type: Runtime.read(fields, "type", Runtime::TEXT),
|
|
2998
|
+
url: Runtime.read(fields, "url", Runtime::TEXT)
|
|
2999
|
+
)
|
|
3000
|
+
end
|
|
3001
|
+
|
|
3002
|
+
# Write one back the way the API reads it.
|
|
3003
|
+
#
|
|
3004
|
+
# @return [Hash{String => Object}]
|
|
3005
|
+
def to_h
|
|
3006
|
+
out = {}
|
|
3007
|
+
out["headers"] = @headers
|
|
3008
|
+
out["method"] = @method_
|
|
3009
|
+
out["type"] = @type
|
|
3010
|
+
out["url"] = @url
|
|
3011
|
+
out
|
|
3012
|
+
end
|
|
3013
|
+
|
|
3014
|
+
# Whether that value carries the same members as this one.
|
|
3015
|
+
#
|
|
3016
|
+
# @param other [Object]
|
|
3017
|
+
# @return [Boolean]
|
|
3018
|
+
def ==(other)
|
|
3019
|
+
other.is_a?(SubscriptionPostTarget) && to_h == other.to_h
|
|
3020
|
+
end
|
|
3021
|
+
alias eql? ==
|
|
3022
|
+
|
|
3023
|
+
# A value two equal instances share, so that either may key a hash.
|
|
3024
|
+
#
|
|
3025
|
+
# @return [Integer]
|
|
3026
|
+
def hash
|
|
3027
|
+
to_h.hash
|
|
3028
|
+
end
|
|
3029
|
+
end
|
|
3030
|
+
|
|
3031
|
+
# The `SubscriptionTarget` the API declares.
|
|
3032
|
+
class SubscriptionTarget
|
|
3033
|
+
attr_reader :headers,
|
|
3034
|
+
:method_,
|
|
3035
|
+
:type,
|
|
3036
|
+
:url
|
|
3037
|
+
|
|
3038
|
+
# @param headers [Object] carries `headers`.
|
|
3039
|
+
# @param method_ [String] carries `method`.
|
|
3040
|
+
# @param type [String] carries `type`.
|
|
3041
|
+
# @param url [String] carries `url`.
|
|
3042
|
+
def initialize(headers:, method_:, type:, url:)
|
|
3043
|
+
@headers = headers
|
|
3044
|
+
@method_ = method_
|
|
3045
|
+
@type = type
|
|
3046
|
+
@url = url
|
|
3047
|
+
freeze
|
|
3048
|
+
end
|
|
3049
|
+
|
|
3050
|
+
# Read one out of what the API answered.
|
|
3051
|
+
#
|
|
3052
|
+
# @param value [Object] the JSON document the API answered
|
|
3053
|
+
# @return [SubscriptionTarget]
|
|
3054
|
+
def self.from_json(value)
|
|
3055
|
+
fields = Runtime.as_fields(value, "SubscriptionTarget")
|
|
3056
|
+
new(
|
|
3057
|
+
headers: Runtime.read(fields, "headers", Runtime::JSON_VALUE),
|
|
3058
|
+
method_: Runtime.read(fields, "method", Runtime::TEXT),
|
|
3059
|
+
type: Runtime.read(fields, "type", Runtime::TEXT),
|
|
3060
|
+
url: Runtime.read(fields, "url", Runtime::TEXT)
|
|
3061
|
+
)
|
|
3062
|
+
end
|
|
3063
|
+
|
|
3064
|
+
# Write one back the way the API reads it.
|
|
3065
|
+
#
|
|
3066
|
+
# @return [Hash{String => Object}]
|
|
3067
|
+
def to_h
|
|
3068
|
+
out = {}
|
|
3069
|
+
out["headers"] = @headers
|
|
3070
|
+
out["method"] = @method_
|
|
3071
|
+
out["type"] = @type
|
|
3072
|
+
out["url"] = @url
|
|
3073
|
+
out
|
|
3074
|
+
end
|
|
3075
|
+
|
|
3076
|
+
# Whether that value carries the same members as this one.
|
|
3077
|
+
#
|
|
3078
|
+
# @param other [Object]
|
|
3079
|
+
# @return [Boolean]
|
|
3080
|
+
def ==(other)
|
|
3081
|
+
other.is_a?(SubscriptionTarget) && to_h == other.to_h
|
|
3082
|
+
end
|
|
3083
|
+
alias eql? ==
|
|
3084
|
+
|
|
3085
|
+
# A value two equal instances share, so that either may key a hash.
|
|
3086
|
+
#
|
|
3087
|
+
# @return [Integer]
|
|
3088
|
+
def hash
|
|
3089
|
+
to_h.hash
|
|
3090
|
+
end
|
|
3091
|
+
end
|
|
3092
|
+
end
|
|
3093
|
+
end
|