nordlet 0.6.4 → 0.6.6
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/nordlet/account/client.rb +293 -20
- data/lib/nordlet/account/types/api_keys_list_account_response_rows_item.rb +2 -0
- data/lib/nordlet/account/types/companies_convert_to_live_account_request.rb +11 -0
- data/lib/nordlet/account/types/companies_convert_to_live_account_response.rb +13 -0
- data/lib/nordlet/account/types/export_account_response.rb +8 -0
- data/lib/nordlet/account/types/export_account_response_api_keys_item.rb +25 -0
- data/lib/nordlet/account/types/export_account_response_auth_events_item.rb +17 -0
- data/lib/nordlet/account/types/export_account_response_oauth_grants_item.rb +17 -0
- data/lib/nordlet/account/types/export_account_response_referral_points_item.rb +15 -0
- data/lib/nordlet/account/types/invites_accept_account_response.rb +2 -0
- data/lib/nordlet/account/types/login_link_consume_account_response.rb +2 -0
- data/lib/nordlet/account/types/me_account_response_billing.rb +2 -0
- data/lib/nordlet/account/types/two_factor_disable_account_request.rb +11 -0
- data/lib/nordlet/account/types/two_factor_disable_account_response.rb +11 -0
- data/lib/nordlet/account/types/two_factor_enable_account_request.rb +11 -0
- data/lib/nordlet/account/types/two_factor_enable_account_response.rb +11 -0
- data/lib/nordlet/account/types/two_factor_get_account_request.rb +9 -0
- data/lib/nordlet/account/types/two_factor_get_account_response.rb +17 -0
- data/lib/nordlet/account/types/two_factor_get_account_response_setup.rb +13 -0
- data/lib/nordlet/account/types/two_factor_recovery_codes_regenerate_account_request.rb +11 -0
- data/lib/nordlet/account/types/two_factor_recovery_codes_regenerate_account_response.rb +11 -0
- data/lib/nordlet/account/types/two_factor_setup_account_request.rb +9 -0
- data/lib/nordlet/account/types/two_factor_setup_account_response.rb +13 -0
- data/lib/nordlet/account/types/two_factor_verify_account_request.rb +11 -0
- data/lib/nordlet/account/types/two_factor_verify_account_response.rb +11 -0
- data/lib/nordlet/billing/client.rb +47 -8
- data/lib/nordlet/billing/types/account_get_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/account_set_account_type_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/account_set_auto_top_up_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/account_set_overdraft_cap_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/account_set_plan_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/flat_rate_confirm_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/flat_rate_create_billing_request.rb +2 -0
- data/lib/nordlet/billing/types/free_sandbox_start_billing_request.rb +9 -0
- data/lib/nordlet/billing/types/free_sandbox_start_billing_response.rb +55 -0
- data/lib/nordlet/billing/types/free_sandbox_start_billing_response_account_type.rb +14 -0
- data/lib/nordlet/billing/types/free_sandbox_start_billing_response_auto_top_up.rb +15 -0
- data/lib/nordlet/billing/types/free_sandbox_start_billing_response_month_to_date.rb +27 -0
- data/lib/nordlet/billing/types/free_sandbox_start_billing_response_plan.rb +16 -0
- data/lib/nordlet/billing/types/free_sandbox_start_billing_response_plans_value.rb +19 -0
- data/lib/nordlet/billing/types/free_sandbox_start_billing_response_site.rb +14 -0
- data/lib/nordlet/billing/types/free_sandbox_start_billing_response_status.rb +15 -0
- data/lib/nordlet/billing/types/free_sandbox_start_billing_response_top_up.rb +13 -0
- data/lib/nordlet/billing/types/subscription_cancel_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/topup_confirm_billing_response.rb +2 -0
- data/lib/nordlet/billing/types/topup_create_billing_request.rb +2 -0
- data/lib/nordlet/declarations/types/configs_list_declarations_response_rows_item_fields_item_kind.rb +1 -0
- data/lib/nordlet/declarations/types/configs_update_declarations_response_fields_item_kind.rb +1 -0
- data/lib/nordlet/peppol/client.rb +4 -1
- data/lib/nordlet/version.rb +1 -1
- data/lib/nordlet/webhooks/client.rb +41 -2
- data/lib/nordlet/webhooks/types/subscriptions_rotate_secret_webhooks_request.rb +13 -0
- data/lib/nordlet/webhooks/types/subscriptions_rotate_secret_webhooks_response.rb +31 -0
- data/lib/nordlet/webhooks/types/subscriptions_rotate_secret_webhooks_response_last_delivery_status.rb +15 -0
- data/lib/nordlet.rb +32 -0
- data/reference.md +573 -15
- metadata +34 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eedd5efc8df32359e54a246907c9a3b325d2e9dffa7d452b9752c9eb8f745274
|
|
4
|
+
data.tar.gz: 835276e28ec2eb23311f6f7d0ea94e2e6b3a5eff234ef55336d725b2a2dd87e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d449387fa1acf0a830054dde08f75fca36b31437c95786111823e0af5a5b61be6e75e3a690af72c36291824ef898774df9be3e45ce8e4adf22f3de7a4966a764
|
|
7
|
+
data.tar.gz: e2b7200ef78d6055fc2b4f6a4e7f878b28b53bf0e4fc44dda77ed70f4905668d58fd14c82141eac4bdb13bd2210585f1ba7546a5d1d89179bc6f7f6be0ee6e02
|
|
@@ -12,9 +12,11 @@ module Nordlet
|
|
|
12
12
|
|
|
13
13
|
# Create a sign-in link for the e-mail address and send it; the link is valid for 15 minutes and is consumed with
|
|
14
14
|
# `account/login-link/consume`. When an unused link was requested for the same address within the last minute, the
|
|
15
|
-
# call answers `sent` without sending another
|
|
16
|
-
#
|
|
17
|
-
# `
|
|
15
|
+
# call answers `sent` without sending another; after five links for the address within an hour it answers 429;
|
|
16
|
+
# otherwise the earlier unused sign-in links for the address stop working. `locale` sets the language of the
|
|
17
|
+
# e-mail and of the link; `app` set to `invoice` makes the link open the invoice app instead of the Nordlet app;
|
|
18
|
+
# `acceptTerms`, `acceptDpa` and `referralCode` are stored with the link and used when the address has no account
|
|
19
|
+
# yet.
|
|
18
20
|
#
|
|
19
21
|
# @param request_options [Hash]
|
|
20
22
|
# @param params [Nordlet::Account::Types::LoginLinkRequestAccountRequest]
|
|
@@ -50,9 +52,14 @@ module Nordlet
|
|
|
50
52
|
|
|
51
53
|
# Exchange a sign-in link token for a session; an unknown, used or expired token is refused with 401. When no
|
|
52
54
|
# account has the address, one is created (`isNewUser`), which is refused with 422 unless the link was requested
|
|
53
|
-
# with `acceptTerms` and `acceptDpa`; a `referralCode` on the link records who referred the new user.
|
|
54
|
-
# `account/email/change-request`
|
|
55
|
-
#
|
|
55
|
+
# with `acceptTerms` and `acceptDpa`; a `referralCode` on the link records who referred the new user. The link
|
|
56
|
+
# `account/email/change-request` sends to the current address signs that user in and sends a confirmation link to
|
|
57
|
+
# the new address; that second link changes the address, deletes the user's other sessions and sends the previous
|
|
58
|
+
# address a link, valid for 24 hours, that changes the address back and deletes every session of the user. No link
|
|
59
|
+
# goes to the new address when another account has it, and the change and the change back are refused with 409
|
|
60
|
+
# when another account has the address. When the user has two-factor authentication on, `twoFactorRequired` is
|
|
61
|
+
# true and the session can make no call other than `account/two-factor/verify` and `account/logout` until a code
|
|
62
|
+
# is entered.
|
|
56
63
|
#
|
|
57
64
|
# @param request_options [Hash]
|
|
58
65
|
# @param params [Nordlet::Account::Types::LoginLinkConsumeAccountRequest]
|
|
@@ -302,7 +309,8 @@ module Nordlet
|
|
|
302
309
|
|
|
303
310
|
# Create an invitation to the active company for an e-mail address with the given role and send it by e-mail in
|
|
304
311
|
# `locale`; owners and admins may call it. The invitation is valid for 7 days and replaces an earlier pending one
|
|
305
|
-
# for the same address. Refused with 409 when the address already belongs to a member
|
|
312
|
+
# for the same address. Refused with 409 when the address already belongs to a member and with 429
|
|
313
|
+
# (`rate_limited`) after 50 invitations by the user, in all their companies, within 24 hours.
|
|
306
314
|
#
|
|
307
315
|
# @param request_options [Hash]
|
|
308
316
|
# @param params [Nordlet::Account::Types::InvitesCreateAccountRequest]
|
|
@@ -514,7 +522,9 @@ module Nordlet
|
|
|
514
522
|
|
|
515
523
|
# Create a company with the caller as its owner and payer, seed its chart of accounts from the template of
|
|
516
524
|
# `countryCode`, and make it the active company of the session. `timeZone` defaults to the country's, `isVatPayer`
|
|
517
|
-
# to true and `defaultInvoiceCurrency` to the base currency.
|
|
525
|
+
# to true and `defaultInvoiceCurrency` to the base currency. Without a paid plan the caller may create only one
|
|
526
|
+
# sandbox company, which starts the free sandbox plan; a live company, a second sandbox company, or a sandbox
|
|
527
|
+
# company after the free sandbox has ended is refused with 402. Refused with 422 when `baseCurrency` is not a
|
|
518
528
|
# supported currency.
|
|
519
529
|
#
|
|
520
530
|
# @param request_options [Hash]
|
|
@@ -728,6 +738,44 @@ module Nordlet
|
|
|
728
738
|
end
|
|
729
739
|
end
|
|
730
740
|
|
|
741
|
+
# Turn the sandbox company `companyId` into a live company and keep all of its data: from then on its filings go
|
|
742
|
+
# to the authorities' production systems and a delete is no longer purged at once. The caller must be the
|
|
743
|
+
# company's owner and payer and have a paid plan (a flat-rate subscription or per-request billing). Refused with
|
|
744
|
+
# 403 when the caller is not the owner or not the payer, 409 when the company is not a sandbox company and 402
|
|
745
|
+
# when the caller has no paid plan.
|
|
746
|
+
#
|
|
747
|
+
# @param request_options [Hash]
|
|
748
|
+
# @param params [Nordlet::Account::Types::CompaniesConvertToLiveAccountRequest]
|
|
749
|
+
# @option request_options [String] :base_url
|
|
750
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
751
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
752
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
753
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
754
|
+
#
|
|
755
|
+
# @return [Nordlet::Account::Types::CompaniesConvertToLiveAccountResponse]
|
|
756
|
+
def companies_convert_to_live(request_options: {}, **params)
|
|
757
|
+
params = Nordlet::Internal::Types::Utils.normalize_keys(params)
|
|
758
|
+
request = Nordlet::Internal::JSON::Request.new(
|
|
759
|
+
base_url: request_options[:base_url],
|
|
760
|
+
method: "POST",
|
|
761
|
+
path: "v1/account/companies/convert-to-live",
|
|
762
|
+
body: Nordlet::Account::Types::CompaniesConvertToLiveAccountRequest.new(params).to_h,
|
|
763
|
+
request_options: request_options
|
|
764
|
+
)
|
|
765
|
+
begin
|
|
766
|
+
response = @client.send(request)
|
|
767
|
+
rescue Net::HTTPRequestTimeout
|
|
768
|
+
raise Nordlet::Errors::TimeoutError
|
|
769
|
+
end
|
|
770
|
+
code = response.code.to_i
|
|
771
|
+
if code.between?(200, 299)
|
|
772
|
+
Nordlet::Account::Types::CompaniesConvertToLiveAccountResponse.load(response.body)
|
|
773
|
+
else
|
|
774
|
+
error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
|
|
775
|
+
raise error_class.new(response.body, code: code)
|
|
776
|
+
end
|
|
777
|
+
end
|
|
778
|
+
|
|
731
779
|
# Set an archived or deleted company named by `companyId` back to `active`; the caller must be its owner. Refused
|
|
732
780
|
# with 409 when it is already active.
|
|
733
781
|
#
|
|
@@ -767,7 +815,8 @@ module Nordlet
|
|
|
767
815
|
# active company may call it. The key works in every company the person is a member of, with the rights of their
|
|
768
816
|
# role in each; every call names the company in the `x-nordlet-company` header. `scopes` defaults to the caller's
|
|
769
817
|
# scopes in the active company and may not exceed them (403); in each company the key's scopes are further limited
|
|
770
|
-
# to the person's role there.
|
|
818
|
+
# to the person's role there. `expiresInDays` defaults to 90. The list shows the key's last four characters as
|
|
819
|
+
# `lastFour`.
|
|
771
820
|
#
|
|
772
821
|
# @param request_options [Hash]
|
|
773
822
|
# @param params [Nordlet::Account::Types::APIKeysCreateAccountRequest]
|
|
@@ -801,7 +850,9 @@ module Nordlet
|
|
|
801
850
|
end
|
|
802
851
|
end
|
|
803
852
|
|
|
804
|
-
# List the signed-in person's API keys, including expired and revoked ones.
|
|
853
|
+
# List the signed-in person's API keys, including expired and revoked ones. `lastFour` is the last four characters
|
|
854
|
+
# of the key (null for keys created before it was recorded); for an app connected through OAuth it is those of the
|
|
855
|
+
# current access token.
|
|
805
856
|
#
|
|
806
857
|
# @param request_options [Hash]
|
|
807
858
|
# @param params [Nordlet::Account::Types::APIKeysListAccountRequest]
|
|
@@ -837,8 +888,8 @@ module Nordlet
|
|
|
837
888
|
|
|
838
889
|
# Create a new key with the name and scopes of the signed-in person's key `id` and return it once; the old key
|
|
839
890
|
# keeps working for `overlapHours` and then expires, and its `replacedByKeyId` points to the new one.
|
|
840
|
-
# `expiresInDays` applies to the new key. Refused with 409 when the old key is revoked or
|
|
841
|
-
# connected through OAuth, which renews its own access.
|
|
891
|
+
# `expiresInDays` applies to the new key and defaults to 90. Refused with 409 when the old key is revoked or
|
|
892
|
+
# belongs to an app connected through OAuth, which renews its own access.
|
|
842
893
|
#
|
|
843
894
|
# @param request_options [Hash]
|
|
844
895
|
# @param params [Nordlet::Account::Types::APIKeysRotateAccountRequest]
|
|
@@ -975,10 +1026,12 @@ module Nordlet
|
|
|
975
1026
|
end
|
|
976
1027
|
end
|
|
977
1028
|
|
|
978
|
-
# Send a confirmation link to `newEmail
|
|
979
|
-
# `account/login-link/consume
|
|
980
|
-
#
|
|
981
|
-
# another
|
|
1029
|
+
# Send a confirmation link for the change to `newEmail` to the user's current address. When it is consumed with
|
|
1030
|
+
# `account/login-link/consume`, a second link goes to `newEmail`, and the address changes when that one is
|
|
1031
|
+
# consumed. When an unused link for `newEmail` was created within the last minute, the call answers `sent` without
|
|
1032
|
+
# sending another. Refused with 422 when it is already the user's address and with 429 (`rate_limited`) after five
|
|
1033
|
+
# requests by the user within 24 hours. When another account has `newEmail`, the call answers the same, the
|
|
1034
|
+
# confirmation link signs the user in and no link goes to `newEmail`.
|
|
982
1035
|
#
|
|
983
1036
|
# @param request_options [Hash]
|
|
984
1037
|
# @param params [Nordlet::Account::Types::EmailChangeRequestAccountRequest]
|
|
@@ -1012,7 +1065,8 @@ module Nordlet
|
|
|
1012
1065
|
end
|
|
1013
1066
|
end
|
|
1014
1067
|
|
|
1015
|
-
# List the signed-in user's sessions that have not expired
|
|
1068
|
+
# List the signed-in user's sessions that have not expired: a session ends 30 days after sign-in or after 7 days
|
|
1069
|
+
# without a call. `current` marks the one the call was made with.
|
|
1016
1070
|
#
|
|
1017
1071
|
# @param request_options [Hash]
|
|
1018
1072
|
# @param params [Nordlet::Account::Types::SessionsListAccountRequest]
|
|
@@ -1115,9 +1169,9 @@ module Nordlet
|
|
|
1115
1169
|
end
|
|
1116
1170
|
end
|
|
1117
1171
|
|
|
1118
|
-
# Return the user's profile, consent state, memberships, unexpired sessions,
|
|
1119
|
-
#
|
|
1120
|
-
#
|
|
1172
|
+
# Return the user's profile, consent state, memberships, unexpired sessions, sign-in events, API keys (without the
|
|
1173
|
+
# keys), connected OAuth apps, referral points, billing accounts (`billing` is the `app` site's, `billingAccounts`
|
|
1174
|
+
# has one per site), credit transactions and every audit entry they made in their companies.
|
|
1121
1175
|
#
|
|
1122
1176
|
# @param request_options [Hash]
|
|
1123
1177
|
# @param params [Nordlet::Account::Types::ExportAccountRequest]
|
|
@@ -1472,6 +1526,225 @@ module Nordlet
|
|
|
1472
1526
|
raise error_class.new(response.body, code: code)
|
|
1473
1527
|
end
|
|
1474
1528
|
end
|
|
1529
|
+
|
|
1530
|
+
# Return the signed-in user's two-factor authentication state: `enabled`, `required` (true for platform
|
|
1531
|
+
# administrators, who cannot use platform administration without it), the number of unused recovery codes and,
|
|
1532
|
+
# while a setup started with `two-factor/setup` is not finished, the key to add to an authenticator app as
|
|
1533
|
+
# `setup`.
|
|
1534
|
+
#
|
|
1535
|
+
# @param request_options [Hash]
|
|
1536
|
+
# @param params [Nordlet::Account::Types::TwoFactorGetAccountRequest]
|
|
1537
|
+
# @option request_options [String] :base_url
|
|
1538
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1539
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1540
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1541
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1542
|
+
#
|
|
1543
|
+
# @return [Nordlet::Account::Types::TwoFactorGetAccountResponse]
|
|
1544
|
+
def two_factor_get(request_options: {}, **params)
|
|
1545
|
+
params = Nordlet::Internal::Types::Utils.normalize_keys(params)
|
|
1546
|
+
request = Nordlet::Internal::JSON::Request.new(
|
|
1547
|
+
base_url: request_options[:base_url],
|
|
1548
|
+
method: "POST",
|
|
1549
|
+
path: "v1/account/two-factor/get",
|
|
1550
|
+
body: Nordlet::Account::Types::TwoFactorGetAccountRequest.new(params).to_h,
|
|
1551
|
+
request_options: request_options
|
|
1552
|
+
)
|
|
1553
|
+
begin
|
|
1554
|
+
response = @client.send(request)
|
|
1555
|
+
rescue Net::HTTPRequestTimeout
|
|
1556
|
+
raise Nordlet::Errors::TimeoutError
|
|
1557
|
+
end
|
|
1558
|
+
code = response.code.to_i
|
|
1559
|
+
if code.between?(200, 299)
|
|
1560
|
+
Nordlet::Account::Types::TwoFactorGetAccountResponse.load(response.body)
|
|
1561
|
+
else
|
|
1562
|
+
error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
|
|
1563
|
+
raise error_class.new(response.body, code: code)
|
|
1564
|
+
end
|
|
1565
|
+
end
|
|
1566
|
+
|
|
1567
|
+
# Start setting up two-factor authentication: create a new key for an authenticator app (time-based codes, RFC
|
|
1568
|
+
# 6238: SHA-1, 6 digits, 30 seconds) and return it with its `otpauth://` address. Nothing changes at sign-in until
|
|
1569
|
+
# `two-factor/enable` is called with a code from the app. Refused with 409 when two-factor authentication is
|
|
1570
|
+
# already on.
|
|
1571
|
+
#
|
|
1572
|
+
# @param request_options [Hash]
|
|
1573
|
+
# @param params [Nordlet::Account::Types::TwoFactorSetupAccountRequest]
|
|
1574
|
+
# @option request_options [String] :base_url
|
|
1575
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1576
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1577
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1578
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1579
|
+
#
|
|
1580
|
+
# @return [Nordlet::Account::Types::TwoFactorSetupAccountResponse]
|
|
1581
|
+
def two_factor_setup(request_options: {}, **params)
|
|
1582
|
+
params = Nordlet::Internal::Types::Utils.normalize_keys(params)
|
|
1583
|
+
request = Nordlet::Internal::JSON::Request.new(
|
|
1584
|
+
base_url: request_options[:base_url],
|
|
1585
|
+
method: "POST",
|
|
1586
|
+
path: "v1/account/two-factor/setup",
|
|
1587
|
+
body: Nordlet::Account::Types::TwoFactorSetupAccountRequest.new(params).to_h,
|
|
1588
|
+
request_options: request_options
|
|
1589
|
+
)
|
|
1590
|
+
begin
|
|
1591
|
+
response = @client.send(request)
|
|
1592
|
+
rescue Net::HTTPRequestTimeout
|
|
1593
|
+
raise Nordlet::Errors::TimeoutError
|
|
1594
|
+
end
|
|
1595
|
+
code = response.code.to_i
|
|
1596
|
+
if code.between?(200, 299)
|
|
1597
|
+
Nordlet::Account::Types::TwoFactorSetupAccountResponse.load(response.body)
|
|
1598
|
+
else
|
|
1599
|
+
error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
|
|
1600
|
+
raise error_class.new(response.body, code: code)
|
|
1601
|
+
end
|
|
1602
|
+
end
|
|
1603
|
+
|
|
1604
|
+
# Turn on two-factor authentication with a current code from the authenticator app set up by `two-factor/setup`.
|
|
1605
|
+
# Returns 10 recovery codes, shown only this once; each one works once in place of a code. The user's other
|
|
1606
|
+
# sessions are deleted. From then on a session created by a sign-in link can make no call other than
|
|
1607
|
+
# `two-factor/verify` and `account/logout` until a code is entered. A wrong code answers 422; after 5 wrong codes
|
|
1608
|
+
# the session is deleted (401).
|
|
1609
|
+
#
|
|
1610
|
+
# @param request_options [Hash]
|
|
1611
|
+
# @param params [Nordlet::Account::Types::TwoFactorEnableAccountRequest]
|
|
1612
|
+
# @option request_options [String] :base_url
|
|
1613
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1614
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1615
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1616
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1617
|
+
#
|
|
1618
|
+
# @return [Nordlet::Account::Types::TwoFactorEnableAccountResponse]
|
|
1619
|
+
def two_factor_enable(request_options: {}, **params)
|
|
1620
|
+
params = Nordlet::Internal::Types::Utils.normalize_keys(params)
|
|
1621
|
+
request = Nordlet::Internal::JSON::Request.new(
|
|
1622
|
+
base_url: request_options[:base_url],
|
|
1623
|
+
method: "POST",
|
|
1624
|
+
path: "v1/account/two-factor/enable",
|
|
1625
|
+
body: Nordlet::Account::Types::TwoFactorEnableAccountRequest.new(params).to_h,
|
|
1626
|
+
request_options: request_options
|
|
1627
|
+
)
|
|
1628
|
+
begin
|
|
1629
|
+
response = @client.send(request)
|
|
1630
|
+
rescue Net::HTTPRequestTimeout
|
|
1631
|
+
raise Nordlet::Errors::TimeoutError
|
|
1632
|
+
end
|
|
1633
|
+
code = response.code.to_i
|
|
1634
|
+
if code.between?(200, 299)
|
|
1635
|
+
Nordlet::Account::Types::TwoFactorEnableAccountResponse.load(response.body)
|
|
1636
|
+
else
|
|
1637
|
+
error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
|
|
1638
|
+
raise error_class.new(response.body, code: code)
|
|
1639
|
+
end
|
|
1640
|
+
end
|
|
1641
|
+
|
|
1642
|
+
# Finish signing in when `account/login-link/consume` answered `twoFactorRequired`: send a current code from the
|
|
1643
|
+
# authenticator app or an unused recovery code. A wrong code answers 422; after 5 wrong codes the session is
|
|
1644
|
+
# deleted (401) and the user signs in again with a new link.
|
|
1645
|
+
#
|
|
1646
|
+
# @param request_options [Hash]
|
|
1647
|
+
# @param params [Nordlet::Account::Types::TwoFactorVerifyAccountRequest]
|
|
1648
|
+
# @option request_options [String] :base_url
|
|
1649
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1650
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1651
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1652
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1653
|
+
#
|
|
1654
|
+
# @return [Nordlet::Account::Types::TwoFactorVerifyAccountResponse]
|
|
1655
|
+
def two_factor_verify(request_options: {}, **params)
|
|
1656
|
+
params = Nordlet::Internal::Types::Utils.normalize_keys(params)
|
|
1657
|
+
request = Nordlet::Internal::JSON::Request.new(
|
|
1658
|
+
base_url: request_options[:base_url],
|
|
1659
|
+
method: "POST",
|
|
1660
|
+
path: "v1/account/two-factor/verify",
|
|
1661
|
+
body: Nordlet::Account::Types::TwoFactorVerifyAccountRequest.new(params).to_h,
|
|
1662
|
+
request_options: request_options
|
|
1663
|
+
)
|
|
1664
|
+
begin
|
|
1665
|
+
response = @client.send(request)
|
|
1666
|
+
rescue Net::HTTPRequestTimeout
|
|
1667
|
+
raise Nordlet::Errors::TimeoutError
|
|
1668
|
+
end
|
|
1669
|
+
code = response.code.to_i
|
|
1670
|
+
if code.between?(200, 299)
|
|
1671
|
+
Nordlet::Account::Types::TwoFactorVerifyAccountResponse.load(response.body)
|
|
1672
|
+
else
|
|
1673
|
+
error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
|
|
1674
|
+
raise error_class.new(response.body, code: code)
|
|
1675
|
+
end
|
|
1676
|
+
end
|
|
1677
|
+
|
|
1678
|
+
# Replace the recovery codes with 10 new ones, shown only this once, after a current code from the authenticator
|
|
1679
|
+
# app. The earlier codes stop working.
|
|
1680
|
+
#
|
|
1681
|
+
# @param request_options [Hash]
|
|
1682
|
+
# @param params [Nordlet::Account::Types::TwoFactorRecoveryCodesRegenerateAccountRequest]
|
|
1683
|
+
# @option request_options [String] :base_url
|
|
1684
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1685
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1686
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1687
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1688
|
+
#
|
|
1689
|
+
# @return [Nordlet::Account::Types::TwoFactorRecoveryCodesRegenerateAccountResponse]
|
|
1690
|
+
def two_factor_recovery_codes_regenerate(request_options: {}, **params)
|
|
1691
|
+
params = Nordlet::Internal::Types::Utils.normalize_keys(params)
|
|
1692
|
+
request = Nordlet::Internal::JSON::Request.new(
|
|
1693
|
+
base_url: request_options[:base_url],
|
|
1694
|
+
method: "POST",
|
|
1695
|
+
path: "v1/account/two-factor/recovery-codes/regenerate",
|
|
1696
|
+
body: Nordlet::Account::Types::TwoFactorRecoveryCodesRegenerateAccountRequest.new(params).to_h,
|
|
1697
|
+
request_options: request_options
|
|
1698
|
+
)
|
|
1699
|
+
begin
|
|
1700
|
+
response = @client.send(request)
|
|
1701
|
+
rescue Net::HTTPRequestTimeout
|
|
1702
|
+
raise Nordlet::Errors::TimeoutError
|
|
1703
|
+
end
|
|
1704
|
+
code = response.code.to_i
|
|
1705
|
+
if code.between?(200, 299)
|
|
1706
|
+
Nordlet::Account::Types::TwoFactorRecoveryCodesRegenerateAccountResponse.load(response.body)
|
|
1707
|
+
else
|
|
1708
|
+
error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
|
|
1709
|
+
raise error_class.new(response.body, code: code)
|
|
1710
|
+
end
|
|
1711
|
+
end
|
|
1712
|
+
|
|
1713
|
+
# Turn off two-factor authentication after a current code from the authenticator app or an unused recovery code;
|
|
1714
|
+
# the key and the recovery codes are deleted. Refused with 422 for a platform administrator, for whom it is
|
|
1715
|
+
# required.
|
|
1716
|
+
#
|
|
1717
|
+
# @param request_options [Hash]
|
|
1718
|
+
# @param params [Nordlet::Account::Types::TwoFactorDisableAccountRequest]
|
|
1719
|
+
# @option request_options [String] :base_url
|
|
1720
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1721
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1722
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1723
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1724
|
+
#
|
|
1725
|
+
# @return [Nordlet::Account::Types::TwoFactorDisableAccountResponse]
|
|
1726
|
+
def two_factor_disable(request_options: {}, **params)
|
|
1727
|
+
params = Nordlet::Internal::Types::Utils.normalize_keys(params)
|
|
1728
|
+
request = Nordlet::Internal::JSON::Request.new(
|
|
1729
|
+
base_url: request_options[:base_url],
|
|
1730
|
+
method: "POST",
|
|
1731
|
+
path: "v1/account/two-factor/disable",
|
|
1732
|
+
body: Nordlet::Account::Types::TwoFactorDisableAccountRequest.new(params).to_h,
|
|
1733
|
+
request_options: request_options
|
|
1734
|
+
)
|
|
1735
|
+
begin
|
|
1736
|
+
response = @client.send(request)
|
|
1737
|
+
rescue Net::HTTPRequestTimeout
|
|
1738
|
+
raise Nordlet::Errors::TimeoutError
|
|
1739
|
+
end
|
|
1740
|
+
code = response.code.to_i
|
|
1741
|
+
if code.between?(200, 299)
|
|
1742
|
+
Nordlet::Account::Types::TwoFactorDisableAccountResponse.load(response.body)
|
|
1743
|
+
else
|
|
1744
|
+
error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
|
|
1745
|
+
raise error_class.new(response.body, code: code)
|
|
1746
|
+
end
|
|
1747
|
+
end
|
|
1475
1748
|
end
|
|
1476
1749
|
end
|
|
1477
1750
|
end
|
|
@@ -8,6 +8,8 @@ module Nordlet
|
|
|
8
8
|
|
|
9
9
|
field :name, -> { String }, optional: false, nullable: false
|
|
10
10
|
|
|
11
|
+
field :last_four, -> { String }, optional: false, nullable: true, api_name: "lastFour"
|
|
12
|
+
|
|
11
13
|
field :scopes, -> { Internal::Types::Array[String] }, optional: false, nullable: false
|
|
12
14
|
|
|
13
15
|
field :last_used_at, -> { String }, optional: false, nullable: true, api_name: "lastUsedAt"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Account
|
|
5
|
+
module Types
|
|
6
|
+
class CompaniesConvertToLiveAccountRequest < Internal::Types::Model
|
|
7
|
+
field :company_id, -> { String }, optional: false, nullable: false, api_name: "companyId"
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Account
|
|
5
|
+
module Types
|
|
6
|
+
class CompaniesConvertToLiveAccountResponse < Internal::Types::Model
|
|
7
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :is_sandbox, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "isSandbox"
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -21,6 +21,14 @@ module Nordlet
|
|
|
21
21
|
field :credit_transactions, -> { Internal::Types::Array[Nordlet::Account::Types::ExportAccountResponseCreditTransactionsItem] }, optional: false, nullable: false, api_name: "creditTransactions"
|
|
22
22
|
|
|
23
23
|
field :audit_entries, -> { Internal::Types::Array[Nordlet::Account::Types::ExportAccountResponseAuditEntriesItem] }, optional: false, nullable: false, api_name: "auditEntries"
|
|
24
|
+
|
|
25
|
+
field :auth_events, -> { Internal::Types::Array[Nordlet::Account::Types::ExportAccountResponseAuthEventsItem] }, optional: false, nullable: false, api_name: "authEvents"
|
|
26
|
+
|
|
27
|
+
field :api_keys, -> { Internal::Types::Array[Nordlet::Account::Types::ExportAccountResponseAPIKeysItem] }, optional: false, nullable: false, api_name: "apiKeys"
|
|
28
|
+
|
|
29
|
+
field :oauth_grants, -> { Internal::Types::Array[Nordlet::Account::Types::ExportAccountResponseOauthGrantsItem] }, optional: false, nullable: false, api_name: "oauthGrants"
|
|
30
|
+
|
|
31
|
+
field :referral_points, -> { Internal::Types::Array[Nordlet::Account::Types::ExportAccountResponseReferralPointsItem] }, optional: false, nullable: false, api_name: "referralPoints"
|
|
24
32
|
end
|
|
25
33
|
end
|
|
26
34
|
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Account
|
|
5
|
+
module Types
|
|
6
|
+
class ExportAccountResponseAPIKeysItem < Internal::Types::Model
|
|
7
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :name, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :last_four, -> { String }, optional: false, nullable: true, api_name: "lastFour"
|
|
12
|
+
|
|
13
|
+
field :scopes, -> { Internal::Types::Array[String] }, optional: false, nullable: false
|
|
14
|
+
|
|
15
|
+
field :last_used_at, -> { String }, optional: false, nullable: true, api_name: "lastUsedAt"
|
|
16
|
+
|
|
17
|
+
field :expires_at, -> { String }, optional: false, nullable: true, api_name: "expiresAt"
|
|
18
|
+
|
|
19
|
+
field :revoked_at, -> { String }, optional: false, nullable: true, api_name: "revokedAt"
|
|
20
|
+
|
|
21
|
+
field :created_at, -> { String }, optional: false, nullable: false, api_name: "createdAt"
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Account
|
|
5
|
+
module Types
|
|
6
|
+
class ExportAccountResponseAuthEventsItem < Internal::Types::Model
|
|
7
|
+
field :action, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :ip_address, -> { String }, optional: false, nullable: true, api_name: "ipAddress"
|
|
10
|
+
|
|
11
|
+
field :user_agent, -> { String }, optional: false, nullable: true, api_name: "userAgent"
|
|
12
|
+
|
|
13
|
+
field :created_at, -> { String }, optional: false, nullable: false, api_name: "createdAt"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Account
|
|
5
|
+
module Types
|
|
6
|
+
class ExportAccountResponseOauthGrantsItem < Internal::Types::Model
|
|
7
|
+
field :api_key_id, -> { String }, optional: false, nullable: false, api_name: "apiKeyId"
|
|
8
|
+
|
|
9
|
+
field :client_id, -> { String }, optional: false, nullable: false, api_name: "clientId"
|
|
10
|
+
|
|
11
|
+
field :client_name, -> { String }, optional: false, nullable: false, api_name: "clientName"
|
|
12
|
+
|
|
13
|
+
field :created_at, -> { String }, optional: false, nullable: false, api_name: "createdAt"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Account
|
|
5
|
+
module Types
|
|
6
|
+
class ExportAccountResponseReferralPointsItem < Internal::Types::Model
|
|
7
|
+
field :points, -> { Integer }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :reason, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :created_at, -> { String }, optional: false, nullable: false, api_name: "createdAt"
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -8,6 +8,8 @@ module Nordlet
|
|
|
8
8
|
|
|
9
9
|
field :expires_at, -> { String }, optional: false, nullable: false, api_name: "expiresAt"
|
|
10
10
|
|
|
11
|
+
field :two_factor_required, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "twoFactorRequired"
|
|
12
|
+
|
|
11
13
|
field :user, -> { Nordlet::Account::Types::InvitesAcceptAccountResponseUser }, optional: false, nullable: false
|
|
12
14
|
end
|
|
13
15
|
end
|
|
@@ -8,6 +8,8 @@ module Nordlet
|
|
|
8
8
|
|
|
9
9
|
field :expires_at, -> { String }, optional: false, nullable: false, api_name: "expiresAt"
|
|
10
10
|
|
|
11
|
+
field :two_factor_required, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "twoFactorRequired"
|
|
12
|
+
|
|
11
13
|
field :user, -> { Nordlet::Account::Types::LoginLinkConsumeAccountResponseUser }, optional: false, nullable: false
|
|
12
14
|
|
|
13
15
|
field :is_new_user, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "isNewUser"
|
|
@@ -22,6 +22,8 @@ module Nordlet
|
|
|
22
22
|
|
|
23
23
|
field :plan_chosen, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "planChosen"
|
|
24
24
|
|
|
25
|
+
field :free_sandbox, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "freeSandbox"
|
|
26
|
+
|
|
25
27
|
field :flat_rate, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "flatRate"
|
|
26
28
|
|
|
27
29
|
field :account_type, -> { Nordlet::Account::Types::MeAccountResponseBillingAccountType }, optional: false, nullable: false, api_name: "accountType"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Account
|
|
5
|
+
module Types
|
|
6
|
+
class TwoFactorEnableAccountResponse < Internal::Types::Model
|
|
7
|
+
field :recovery_codes, -> { Internal::Types::Array[String] }, optional: false, nullable: false, api_name: "recoveryCodes"
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nordlet
|
|
4
|
+
module Account
|
|
5
|
+
module Types
|
|
6
|
+
class TwoFactorGetAccountResponse < Internal::Types::Model
|
|
7
|
+
field :enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :required, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :recovery_codes_left, -> { Integer }, optional: false, nullable: false, api_name: "recoveryCodesLeft"
|
|
12
|
+
|
|
13
|
+
field :setup, -> { Nordlet::Account::Types::TwoFactorGetAccountResponseSetup }, optional: false, nullable: true
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|