noresponse 2.1.10 → 2.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/no_response/accounts.rb +288 -0
- data/lib/no_response/models/operations/deleteaccount_request.rb +29 -0
- data/lib/no_response/models/operations/deleteaccount_request.rbi +14 -0
- data/lib/no_response/models/operations/deleteaccount_response.rb +32 -0
- data/lib/no_response/models/operations/deleteaccount_response.rbi +20 -0
- data/lib/no_response/models/operations.rb +2 -0
- data/lib/no_response/models/shared/accountdeletion.rb +78 -0
- data/lib/no_response/models/shared/accountdeletion.rbi +38 -0
- data/lib/no_response/models/shared.rb +1 -0
- data/lib/no_response/sdkconfiguration.rb +2 -2
- data/lib/no_response/webhooks.rb +21 -2
- metadata +7 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f2930f120013fbdc65d25572441edcaa6743e58cb4ab5bf7ac4c1bbf2beaacd
|
|
4
|
+
data.tar.gz: 703fce4e32ad35e3fa695ec9a6019bcec5128278cd7ffbdb61350d26534d6288
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 436b3f957dd51ba98d552cdb8e00f52416b8f23df57925042758caf52d3bb91a1ee426e638c5ecd0a39afeae24e4969dd44a32cd3440b7cb9bd48a77d99e1138
|
|
7
|
+
data.tar.gz: 35539f793292c7b527c59ef792dfa7264791a8d4d621464bc08f395a7b3440fdf2fb2c241c508e110f6e3fbe4af141d5557331552af536061281e375bffc9ddb
|
data/lib/no_response/accounts.rb
CHANGED
|
@@ -326,6 +326,294 @@ module NoResponse
|
|
|
326
326
|
end
|
|
327
327
|
end
|
|
328
328
|
|
|
329
|
+
sig {
|
|
330
|
+
params(
|
|
331
|
+
account_id: ::String,
|
|
332
|
+
retries: T.nilable(Utils::RetryConfig),
|
|
333
|
+
timeout_ms: T.nilable(Integer),
|
|
334
|
+
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
335
|
+
)
|
|
336
|
+
.returns(Models::Operations::DeleteAccountResponse)
|
|
337
|
+
}
|
|
338
|
+
def delete(account_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
339
|
+
# delete - Erase an account and its history.
|
|
340
|
+
# Erases the account in the environment of your key, for an erasure request from your user: every assessment of it, with its revisions, evidence and outcomes, and the identity-graph marks its outcomes set. An assessment of the account begun before the call is refused or stopped. Afterwards the account and each erased assessment answer 404 and the history is empty. When the call deleted at least one assessment, an account.deleted event goes to your verified webhook endpoints. Requires the history scope. Idempotent and safe to retry: a repeat, or an account with nothing to erase, answers 200 with assessments_deleted 0 and sends no event. The account_id can be assessed again later, as a new account.
|
|
341
|
+
request = Models::Operations::DeleteAccountRequest.new(
|
|
342
|
+
account_id: account_id
|
|
343
|
+
)
|
|
344
|
+
url, params = @sdk_configuration.get_server_details
|
|
345
|
+
base_url = Utils.template_url(url, params)
|
|
346
|
+
url = Utils.generate_url(
|
|
347
|
+
Models::Operations::DeleteAccountRequest,
|
|
348
|
+
base_url,
|
|
349
|
+
"/v1/accounts/{account_id}",
|
|
350
|
+
request
|
|
351
|
+
)
|
|
352
|
+
headers = {}
|
|
353
|
+
headers = T.cast(headers, T::Hash[String, String])
|
|
354
|
+
headers["Accept"] = "application/json"
|
|
355
|
+
headers["user-agent"] = @sdk_configuration.user_agent
|
|
356
|
+
retries ||= @sdk_configuration.retry_config
|
|
357
|
+
retries ||= Utils::RetryConfig.new(
|
|
358
|
+
backoff: Utils::BackoffStrategy.new(
|
|
359
|
+
exponent: 2.0,
|
|
360
|
+
initial_interval: 500,
|
|
361
|
+
max_elapsed_time: 30_000,
|
|
362
|
+
max_interval: 8000
|
|
363
|
+
),
|
|
364
|
+
retry_connection_errors: true,
|
|
365
|
+
strategy: "backoff"
|
|
366
|
+
)
|
|
367
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
368
|
+
retry_options[:retry_statuses] = [408, 429, 500, 501, 502, 503, 504, 505]
|
|
369
|
+
|
|
370
|
+
security = @sdk_configuration.security_source&.call
|
|
371
|
+
|
|
372
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
373
|
+
timeout ||= @sdk_configuration.timeout
|
|
374
|
+
|
|
375
|
+
connection = @sdk_configuration.client.dup
|
|
376
|
+
connection.use(Utils::RetryMiddleware, retry_options)
|
|
377
|
+
|
|
378
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
379
|
+
config: @sdk_configuration,
|
|
380
|
+
base_url: base_url,
|
|
381
|
+
oauth2_scopes: nil,
|
|
382
|
+
operation_id: "deleteAccount",
|
|
383
|
+
security_source: @sdk_configuration.security_source
|
|
384
|
+
)
|
|
385
|
+
|
|
386
|
+
error = T.let(nil, T.nilable(StandardError))
|
|
387
|
+
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
388
|
+
|
|
389
|
+
begin
|
|
390
|
+
http_response = T.must(connection).delete(url) do |req|
|
|
391
|
+
req.headers.merge!(headers)
|
|
392
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
393
|
+
Utils.configure_request_security(req, security)
|
|
394
|
+
http_headers&.each do |key, value|
|
|
395
|
+
req.headers[key.to_s] = value
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
@sdk_configuration.hooks.before_request(
|
|
399
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
400
|
+
hook_ctx: hook_ctx
|
|
401
|
+
),
|
|
402
|
+
request: req
|
|
403
|
+
)
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
rescue StandardError => e
|
|
407
|
+
error = e
|
|
408
|
+
ensure
|
|
409
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
410
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
411
|
+
error: error,
|
|
412
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
413
|
+
hook_ctx: hook_ctx
|
|
414
|
+
),
|
|
415
|
+
response: http_response
|
|
416
|
+
)
|
|
417
|
+
else
|
|
418
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
419
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
420
|
+
hook_ctx: hook_ctx
|
|
421
|
+
),
|
|
422
|
+
response: http_response
|
|
423
|
+
)
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
if http_response.nil?
|
|
427
|
+
raise error if !error.nil?
|
|
428
|
+
raise "no response"
|
|
429
|
+
end
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
content_type = http_response.headers.fetch("Content-Type", "application/octet-stream")
|
|
433
|
+
if Utils.match_status_code(http_response.status, ["200"])
|
|
434
|
+
if Utils.match_content_type(content_type, "application/json")
|
|
435
|
+
@sdk_configuration.hooks.after_success(
|
|
436
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
437
|
+
hook_ctx: hook_ctx
|
|
438
|
+
),
|
|
439
|
+
response: http_response
|
|
440
|
+
)
|
|
441
|
+
response_data = http_response.env.response_body
|
|
442
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Shared::AccountDeletion)
|
|
443
|
+
result = obj
|
|
444
|
+
response = Models::Operations::DeleteAccountResponse.new(
|
|
445
|
+
result: result,
|
|
446
|
+
headers: http_response.headers
|
|
447
|
+
)
|
|
448
|
+
|
|
449
|
+
return response
|
|
450
|
+
else
|
|
451
|
+
raise(
|
|
452
|
+
::NoResponse::Models::Errors::APIStatusError.new(
|
|
453
|
+
status_code: http_response.status,
|
|
454
|
+
body: http_response.env.response_body,
|
|
455
|
+
raw_response: http_response
|
|
456
|
+
),
|
|
457
|
+
"Unknown content type received"
|
|
458
|
+
)
|
|
459
|
+
end
|
|
460
|
+
elsif Utils.match_status_code(http_response.status, ["400"])
|
|
461
|
+
if Utils.match_content_type(content_type, "application/problem+json")
|
|
462
|
+
@sdk_configuration.hooks.after_success(
|
|
463
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
464
|
+
hook_ctx: hook_ctx
|
|
465
|
+
),
|
|
466
|
+
response: http_response
|
|
467
|
+
)
|
|
468
|
+
response_data = http_response.env.response_body
|
|
469
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError)
|
|
470
|
+
raise obj
|
|
471
|
+
else
|
|
472
|
+
raise(
|
|
473
|
+
::NoResponse::Models::Errors::APIStatusError.new(
|
|
474
|
+
status_code: http_response.status,
|
|
475
|
+
body: http_response.env.response_body,
|
|
476
|
+
raw_response: http_response
|
|
477
|
+
),
|
|
478
|
+
"Unknown content type received"
|
|
479
|
+
)
|
|
480
|
+
end
|
|
481
|
+
elsif Utils.match_status_code(http_response.status, ["401"])
|
|
482
|
+
if Utils.match_content_type(content_type, "application/problem+json")
|
|
483
|
+
@sdk_configuration.hooks.after_success(
|
|
484
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
485
|
+
hook_ctx: hook_ctx
|
|
486
|
+
),
|
|
487
|
+
response: http_response
|
|
488
|
+
)
|
|
489
|
+
response_data = http_response.env.response_body
|
|
490
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError)
|
|
491
|
+
raise obj
|
|
492
|
+
else
|
|
493
|
+
raise(
|
|
494
|
+
::NoResponse::Models::Errors::APIStatusError.new(
|
|
495
|
+
status_code: http_response.status,
|
|
496
|
+
body: http_response.env.response_body,
|
|
497
|
+
raw_response: http_response
|
|
498
|
+
),
|
|
499
|
+
"Unknown content type received"
|
|
500
|
+
)
|
|
501
|
+
end
|
|
502
|
+
elsif Utils.match_status_code(http_response.status, ["403"])
|
|
503
|
+
if Utils.match_content_type(content_type, "application/problem+json")
|
|
504
|
+
@sdk_configuration.hooks.after_success(
|
|
505
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
506
|
+
hook_ctx: hook_ctx
|
|
507
|
+
),
|
|
508
|
+
response: http_response
|
|
509
|
+
)
|
|
510
|
+
response_data = http_response.env.response_body
|
|
511
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError)
|
|
512
|
+
raise obj
|
|
513
|
+
else
|
|
514
|
+
raise(
|
|
515
|
+
::NoResponse::Models::Errors::APIStatusError.new(
|
|
516
|
+
status_code: http_response.status,
|
|
517
|
+
body: http_response.env.response_body,
|
|
518
|
+
raw_response: http_response
|
|
519
|
+
),
|
|
520
|
+
"Unknown content type received"
|
|
521
|
+
)
|
|
522
|
+
end
|
|
523
|
+
elsif Utils.match_status_code(http_response.status, ["404"])
|
|
524
|
+
if Utils.match_content_type(content_type, "application/problem+json")
|
|
525
|
+
@sdk_configuration.hooks.after_success(
|
|
526
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
527
|
+
hook_ctx: hook_ctx
|
|
528
|
+
),
|
|
529
|
+
response: http_response
|
|
530
|
+
)
|
|
531
|
+
response_data = http_response.env.response_body
|
|
532
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError)
|
|
533
|
+
raise obj
|
|
534
|
+
else
|
|
535
|
+
raise(
|
|
536
|
+
::NoResponse::Models::Errors::APIStatusError.new(
|
|
537
|
+
status_code: http_response.status,
|
|
538
|
+
body: http_response.env.response_body,
|
|
539
|
+
raw_response: http_response
|
|
540
|
+
),
|
|
541
|
+
"Unknown content type received"
|
|
542
|
+
)
|
|
543
|
+
end
|
|
544
|
+
elsif Utils.match_status_code(http_response.status, ["409"])
|
|
545
|
+
if Utils.match_content_type(content_type, "application/problem+json")
|
|
546
|
+
@sdk_configuration.hooks.after_success(
|
|
547
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
548
|
+
hook_ctx: hook_ctx
|
|
549
|
+
),
|
|
550
|
+
response: http_response
|
|
551
|
+
)
|
|
552
|
+
response_data = http_response.env.response_body
|
|
553
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ConflictError)
|
|
554
|
+
raise obj
|
|
555
|
+
else
|
|
556
|
+
raise(
|
|
557
|
+
::NoResponse::Models::Errors::APIStatusError.new(
|
|
558
|
+
status_code: http_response.status,
|
|
559
|
+
body: http_response.env.response_body,
|
|
560
|
+
raw_response: http_response
|
|
561
|
+
),
|
|
562
|
+
"Unknown content type received"
|
|
563
|
+
)
|
|
564
|
+
end
|
|
565
|
+
elsif Utils.match_status_code(http_response.status, ["429"])
|
|
566
|
+
if Utils.match_content_type(content_type, "application/problem+json")
|
|
567
|
+
@sdk_configuration.hooks.after_success(
|
|
568
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
569
|
+
hook_ctx: hook_ctx
|
|
570
|
+
),
|
|
571
|
+
response: http_response
|
|
572
|
+
)
|
|
573
|
+
response_data = http_response.env.response_body
|
|
574
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError)
|
|
575
|
+
raise obj
|
|
576
|
+
else
|
|
577
|
+
raise(
|
|
578
|
+
::NoResponse::Models::Errors::APIStatusError.new(
|
|
579
|
+
status_code: http_response.status,
|
|
580
|
+
body: http_response.env.response_body,
|
|
581
|
+
raw_response: http_response
|
|
582
|
+
),
|
|
583
|
+
"Unknown content type received"
|
|
584
|
+
)
|
|
585
|
+
end
|
|
586
|
+
elsif Utils.match_status_code(http_response.status, ["4XX"])
|
|
587
|
+
raise(
|
|
588
|
+
::NoResponse::Models::Errors::APIStatusError.new(
|
|
589
|
+
status_code: http_response.status,
|
|
590
|
+
body: http_response.env.response_body,
|
|
591
|
+
raw_response: http_response
|
|
592
|
+
),
|
|
593
|
+
"API error occurred"
|
|
594
|
+
)
|
|
595
|
+
elsif Utils.match_status_code(http_response.status, ["5XX"])
|
|
596
|
+
raise(
|
|
597
|
+
::NoResponse::Models::Errors::APIStatusError.new(
|
|
598
|
+
status_code: http_response.status,
|
|
599
|
+
body: http_response.env.response_body,
|
|
600
|
+
raw_response: http_response
|
|
601
|
+
),
|
|
602
|
+
"API error occurred"
|
|
603
|
+
)
|
|
604
|
+
else
|
|
605
|
+
raise(
|
|
606
|
+
::NoResponse::Models::Errors::APIStatusError.new(
|
|
607
|
+
status_code: http_response.status,
|
|
608
|
+
body: http_response.env.response_body,
|
|
609
|
+
raw_response: http_response
|
|
610
|
+
),
|
|
611
|
+
"Unknown status code received"
|
|
612
|
+
)
|
|
613
|
+
|
|
614
|
+
end
|
|
615
|
+
end
|
|
616
|
+
|
|
329
617
|
sig {
|
|
330
618
|
params(
|
|
331
619
|
account_id: ::String,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Operations
|
|
7
|
+
|
|
8
|
+
class DeleteAccountRequest
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
# The account_id the tenant sends with its assessments, as one path segment (percent-encode '|' and ':' if the client requires it). A value that does not match the account_id shape answers 400 invalid_request.
|
|
13
|
+
field :account_id, ::String, {'path_param': {'field_name': "account_id", 'style': "simple", 'explode': false}}
|
|
14
|
+
|
|
15
|
+
sig { params(account_id: ::String).void }
|
|
16
|
+
def initialize(account_id:)
|
|
17
|
+
@account_id = account_id
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
21
|
+
def ==(other)
|
|
22
|
+
return false unless other.is_a?(self.class)
|
|
23
|
+
return false unless @account_id == other.account_id
|
|
24
|
+
true
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Operations::DeleteAccountRequest
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Operations::DeleteAccountRequest
|
|
9
|
+
def account_id
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def account_id=(str_)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Operations
|
|
7
|
+
|
|
8
|
+
class DeleteAccountResponse
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
field :headers, Crystalline::Hash.new(Symbol, Crystalline::Array.new(::String))
|
|
13
|
+
|
|
14
|
+
field :result, Models::Shared::AccountDeletion, {}
|
|
15
|
+
|
|
16
|
+
sig { params(headers: T::Hash[Symbol, T::Array[::String]], result: Models::Shared::AccountDeletion).void }
|
|
17
|
+
def initialize(headers:, result:)
|
|
18
|
+
@headers = headers
|
|
19
|
+
@result = result
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
23
|
+
def ==(other)
|
|
24
|
+
return false unless other.is_a?(self.class)
|
|
25
|
+
return false unless @headers == other.headers
|
|
26
|
+
return false unless @result == other.result
|
|
27
|
+
true
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Operations::DeleteAccountResponse
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Operations::DeleteAccountResponse
|
|
9
|
+
def headers
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def headers=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def result
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def result=(str_)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -8,6 +8,8 @@ module NoResponse
|
|
|
8
8
|
autoload :CreateAssessmentResponse, "no_response/models/operations/createassessment_response.rb"
|
|
9
9
|
autoload :CreateIntegrationResponse, "no_response/models/operations/createintegration_response.rb"
|
|
10
10
|
autoload :CreateWebhookEndpointResponse, "no_response/models/operations/createwebhookendpoint_response.rb"
|
|
11
|
+
autoload :DeleteAccountRequest, "no_response/models/operations/deleteaccount_request.rb"
|
|
12
|
+
autoload :DeleteAccountResponse, "no_response/models/operations/deleteaccount_response.rb"
|
|
11
13
|
autoload :DeleteIntegrationRequest, "no_response/models/operations/deleteintegration_request.rb"
|
|
12
14
|
autoload :DeleteIntegrationResponse, "no_response/models/operations/deleteintegration_response.rb"
|
|
13
15
|
autoload :DeleteWebhookEndpointRequest, "no_response/models/operations/deletewebhookendpoint_request.rb"
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module NoResponse
|
|
5
|
+
module Models
|
|
6
|
+
module Shared
|
|
7
|
+
# Body of the 200 answer to DELETE /v1/accounts/{account_id}: the calling tenant's account was erased in the environment of the calling key. Every assessment of the account went, with its revisions, evidence, outcomes and the identity-graph marks its outcomes set, and an assessment that was still running when the call arrived is stopped. Afterwards GET /v1/accounts/{account_id} and GET /v1/assessments/{assessment_id} of each erased assessment answer 404, and the history page is empty. The call is idempotent: a repeat, or an account with nothing to erase, answers 200 with assessments_deleted 0. The account_id can be assessed again later, as a new account.
|
|
8
|
+
class AccountDeletion
|
|
9
|
+
extend T::Sig
|
|
10
|
+
include Crystalline::MetadataFields
|
|
11
|
+
|
|
12
|
+
# The account_id that was erased.
|
|
13
|
+
field :id, ::String, {'format_json': {'letter_case': ::NoResponse::Utils.field_name("id"), required: true}}
|
|
14
|
+
# How many assessments this call deleted. 0 when the account had none left, so a repeat answers 0.
|
|
15
|
+
field(
|
|
16
|
+
:assessments_deleted,
|
|
17
|
+
::Integer,
|
|
18
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("assessments_deleted"), required: true}}
|
|
19
|
+
)
|
|
20
|
+
# When the erasure took effect. An assessment of the account begun before this time is refused or stopped.
|
|
21
|
+
field(
|
|
22
|
+
:deleted_at,
|
|
23
|
+
::String,
|
|
24
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("deleted_at"), required: true}}
|
|
25
|
+
)
|
|
26
|
+
# Version of the body shape.
|
|
27
|
+
field(
|
|
28
|
+
:schema_version,
|
|
29
|
+
::String,
|
|
30
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("schema_version"), required: true}}
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
field(
|
|
34
|
+
:deleted,
|
|
35
|
+
Crystalline::Boolean.new,
|
|
36
|
+
{'format_json': {'letter_case': ::NoResponse::Utils.field_name("deleted"), required: true}}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
sig {
|
|
40
|
+
params(
|
|
41
|
+
id: ::String,
|
|
42
|
+
assessments_deleted: ::Integer,
|
|
43
|
+
deleted_at: ::String,
|
|
44
|
+
schema_version: ::String,
|
|
45
|
+
deleted: T::Boolean
|
|
46
|
+
)
|
|
47
|
+
.void
|
|
48
|
+
}
|
|
49
|
+
def initialize(id:, assessments_deleted:, deleted_at:, schema_version: "1", deleted: true)
|
|
50
|
+
@id = id
|
|
51
|
+
@assessments_deleted = assessments_deleted
|
|
52
|
+
@deleted_at = deleted_at
|
|
53
|
+
unless schema_version == "1"
|
|
54
|
+
raise ArgumentError, "Invalid value for schema_version"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
@schema_version = "1"
|
|
58
|
+
unless deleted == true
|
|
59
|
+
raise ArgumentError, "Invalid value for deleted"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
@deleted = true
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
66
|
+
def ==(other)
|
|
67
|
+
return false unless other.is_a?(self.class)
|
|
68
|
+
return false unless @id == other.id
|
|
69
|
+
return false unless @assessments_deleted == other.assessments_deleted
|
|
70
|
+
return false unless @deleted_at == other.deleted_at
|
|
71
|
+
return false unless @schema_version == other.schema_version
|
|
72
|
+
return false unless @deleted == other.deleted
|
|
73
|
+
true
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class NoResponse::Models::Shared::AccountDeletion
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class NoResponse::Models::Shared::AccountDeletion
|
|
9
|
+
def id
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def id=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def assessments_deleted
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def assessments_deleted=(str_)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def deleted_at
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def deleted_at=(str_)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def schema_version
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def schema_version=(str_)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def deleted
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def deleted=(str_)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -7,6 +7,7 @@ module NoResponse
|
|
|
7
7
|
autoload :Account, "no_response/models/shared/account.rb"
|
|
8
8
|
autoload :AccountDecision, "no_response/models/shared/accountdecision.rb"
|
|
9
9
|
autoload :AccountDecisionsByFlow, "no_response/models/shared/accountdecisionsbyflow.rb"
|
|
10
|
+
autoload :AccountDeletion, "no_response/models/shared/accountdeletion.rb"
|
|
10
11
|
autoload :AccountRisk, "no_response/models/shared/accountrisk.rb"
|
|
11
12
|
autoload :AccountRiskReason, "no_response/models/shared/accountriskreason.rb"
|
|
12
13
|
autoload :Assessment, "no_response/models/shared/assessment.rb"
|
|
@@ -95,9 +95,9 @@ module NoResponse
|
|
|
95
95
|
|
|
96
96
|
@language = "ruby"
|
|
97
97
|
@openapi_doc_version = "1"
|
|
98
|
-
@sdk_version = "2.1.
|
|
98
|
+
@sdk_version = "2.1.11"
|
|
99
99
|
@gen_version = "internal"
|
|
100
|
-
@user_agent = "noresponse-sdk/ruby 2.1.
|
|
100
|
+
@user_agent = "noresponse-sdk/ruby 2.1.11 internal 1 noresponse"
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
sig { returns([String, T::Hash[Symbol, String]]) }
|
data/lib/no_response/webhooks.rb
CHANGED
|
@@ -45,10 +45,16 @@ module NoResponse
|
|
|
45
45
|
|
|
46
46
|
EndpointVerification = Struct.new(:endpoint_id, :challenge, keyword_init: true)
|
|
47
47
|
|
|
48
|
+
# An account you erased with accounts.delete: delete what you hold for it.
|
|
49
|
+
# assessments_deleted is at least 1, and deleted_at equals deleted_at in
|
|
50
|
+
# the delete answer.
|
|
51
|
+
AccountDeleted = Struct.new(:account_id, :assessments_deleted, :deleted_at, keyword_init: true)
|
|
52
|
+
|
|
48
53
|
# A verified delivery. data is a Models::Shared::Assessment (exactly as
|
|
49
54
|
# assessments.get returns it) or an AssessmentExpired for type
|
|
50
|
-
# "assessment.updated",
|
|
51
|
-
# "endpoint.verification"
|
|
55
|
+
# "assessment.updated", an EndpointVerification for
|
|
56
|
+
# "endpoint.verification" and an AccountDeleted for "account.deleted".
|
|
57
|
+
# Deliveries are at least once and unordered:
|
|
52
58
|
# deduplicate on id and keep the highest assessment_version.
|
|
53
59
|
Event = Struct.new(:id, :type, :created_at, :data, :test, keyword_init: true) do
|
|
54
60
|
# True for the terminal expiry event: delete what you hold and fetch nothing.
|
|
@@ -155,6 +161,8 @@ module NoResponse
|
|
|
155
161
|
rescue KeyError, TypeError, ArgumentError, NoMethodError
|
|
156
162
|
raise VerificationError.new(:invalid_payload, 'Webhook data is not an assessment')
|
|
157
163
|
end
|
|
164
|
+
when 'account.deleted'
|
|
165
|
+
account_deleted(data)
|
|
158
166
|
else
|
|
159
167
|
raise VerificationError.new(:invalid_payload, 'Unknown webhook event type')
|
|
160
168
|
end
|
|
@@ -171,6 +179,17 @@ module NoResponse
|
|
|
171
179
|
assessment_version: data['assessment_version'])
|
|
172
180
|
end
|
|
173
181
|
|
|
182
|
+
def account_deleted(data)
|
|
183
|
+
unless data['account_id'].is_a?(String) && ACCOUNT_ID.match?(data['account_id']) &&
|
|
184
|
+
data['assessments_deleted'].is_a?(Integer) && data['assessments_deleted'] >= 1 &&
|
|
185
|
+
data['deleted_at'].is_a?(String) && valid_datetime?(data['deleted_at'])
|
|
186
|
+
raise VerificationError.new(:invalid_payload, 'Account deleted event is malformed')
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
AccountDeleted.new(account_id: data['account_id'], assessments_deleted: data['assessments_deleted'],
|
|
190
|
+
deleted_at: data['deleted_at'])
|
|
191
|
+
end
|
|
192
|
+
|
|
174
193
|
def valid_datetime?(value)
|
|
175
194
|
Time.iso8601(value)
|
|
176
195
|
true
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: noresponse
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- NoResponse
|
|
@@ -284,6 +284,10 @@ files:
|
|
|
284
284
|
- lib/no_response/models/operations/createintegration_response.rbi
|
|
285
285
|
- lib/no_response/models/operations/createwebhookendpoint_response.rb
|
|
286
286
|
- lib/no_response/models/operations/createwebhookendpoint_response.rbi
|
|
287
|
+
- lib/no_response/models/operations/deleteaccount_request.rb
|
|
288
|
+
- lib/no_response/models/operations/deleteaccount_request.rbi
|
|
289
|
+
- lib/no_response/models/operations/deleteaccount_response.rb
|
|
290
|
+
- lib/no_response/models/operations/deleteaccount_response.rbi
|
|
287
291
|
- lib/no_response/models/operations/deleteintegration_request.rb
|
|
288
292
|
- lib/no_response/models/operations/deleteintegration_request.rbi
|
|
289
293
|
- lib/no_response/models/operations/deleteintegration_response.rb
|
|
@@ -343,6 +347,8 @@ files:
|
|
|
343
347
|
- lib/no_response/models/shared/accountdecision.rbi
|
|
344
348
|
- lib/no_response/models/shared/accountdecisionsbyflow.rb
|
|
345
349
|
- lib/no_response/models/shared/accountdecisionsbyflow.rbi
|
|
350
|
+
- lib/no_response/models/shared/accountdeletion.rb
|
|
351
|
+
- lib/no_response/models/shared/accountdeletion.rbi
|
|
346
352
|
- lib/no_response/models/shared/accountrisk.rb
|
|
347
353
|
- lib/no_response/models/shared/accountrisk.rbi
|
|
348
354
|
- lib/no_response/models/shared/accountriskreason.rb
|