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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nordlet/account/client.rb +293 -20
  3. data/lib/nordlet/account/types/api_keys_list_account_response_rows_item.rb +2 -0
  4. data/lib/nordlet/account/types/companies_convert_to_live_account_request.rb +11 -0
  5. data/lib/nordlet/account/types/companies_convert_to_live_account_response.rb +13 -0
  6. data/lib/nordlet/account/types/export_account_response.rb +8 -0
  7. data/lib/nordlet/account/types/export_account_response_api_keys_item.rb +25 -0
  8. data/lib/nordlet/account/types/export_account_response_auth_events_item.rb +17 -0
  9. data/lib/nordlet/account/types/export_account_response_oauth_grants_item.rb +17 -0
  10. data/lib/nordlet/account/types/export_account_response_referral_points_item.rb +15 -0
  11. data/lib/nordlet/account/types/invites_accept_account_response.rb +2 -0
  12. data/lib/nordlet/account/types/login_link_consume_account_response.rb +2 -0
  13. data/lib/nordlet/account/types/me_account_response_billing.rb +2 -0
  14. data/lib/nordlet/account/types/two_factor_disable_account_request.rb +11 -0
  15. data/lib/nordlet/account/types/two_factor_disable_account_response.rb +11 -0
  16. data/lib/nordlet/account/types/two_factor_enable_account_request.rb +11 -0
  17. data/lib/nordlet/account/types/two_factor_enable_account_response.rb +11 -0
  18. data/lib/nordlet/account/types/two_factor_get_account_request.rb +9 -0
  19. data/lib/nordlet/account/types/two_factor_get_account_response.rb +17 -0
  20. data/lib/nordlet/account/types/two_factor_get_account_response_setup.rb +13 -0
  21. data/lib/nordlet/account/types/two_factor_recovery_codes_regenerate_account_request.rb +11 -0
  22. data/lib/nordlet/account/types/two_factor_recovery_codes_regenerate_account_response.rb +11 -0
  23. data/lib/nordlet/account/types/two_factor_setup_account_request.rb +9 -0
  24. data/lib/nordlet/account/types/two_factor_setup_account_response.rb +13 -0
  25. data/lib/nordlet/account/types/two_factor_verify_account_request.rb +11 -0
  26. data/lib/nordlet/account/types/two_factor_verify_account_response.rb +11 -0
  27. data/lib/nordlet/billing/client.rb +47 -8
  28. data/lib/nordlet/billing/types/account_get_billing_response.rb +2 -0
  29. data/lib/nordlet/billing/types/account_set_account_type_billing_response.rb +2 -0
  30. data/lib/nordlet/billing/types/account_set_auto_top_up_billing_response.rb +2 -0
  31. data/lib/nordlet/billing/types/account_set_overdraft_cap_billing_response.rb +2 -0
  32. data/lib/nordlet/billing/types/account_set_plan_billing_response.rb +2 -0
  33. data/lib/nordlet/billing/types/flat_rate_confirm_billing_response.rb +2 -0
  34. data/lib/nordlet/billing/types/flat_rate_create_billing_request.rb +2 -0
  35. data/lib/nordlet/billing/types/free_sandbox_start_billing_request.rb +9 -0
  36. data/lib/nordlet/billing/types/free_sandbox_start_billing_response.rb +55 -0
  37. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_account_type.rb +14 -0
  38. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_auto_top_up.rb +15 -0
  39. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_month_to_date.rb +27 -0
  40. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_plan.rb +16 -0
  41. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_plans_value.rb +19 -0
  42. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_site.rb +14 -0
  43. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_status.rb +15 -0
  44. data/lib/nordlet/billing/types/free_sandbox_start_billing_response_top_up.rb +13 -0
  45. data/lib/nordlet/billing/types/subscription_cancel_billing_response.rb +2 -0
  46. data/lib/nordlet/billing/types/topup_confirm_billing_response.rb +2 -0
  47. data/lib/nordlet/billing/types/topup_create_billing_request.rb +2 -0
  48. data/lib/nordlet/declarations/types/configs_list_declarations_response_rows_item_fields_item_kind.rb +1 -0
  49. data/lib/nordlet/declarations/types/configs_update_declarations_response_fields_item_kind.rb +1 -0
  50. data/lib/nordlet/peppol/client.rb +4 -1
  51. data/lib/nordlet/version.rb +1 -1
  52. data/lib/nordlet/webhooks/client.rb +41 -2
  53. data/lib/nordlet/webhooks/types/subscriptions_rotate_secret_webhooks_request.rb +13 -0
  54. data/lib/nordlet/webhooks/types/subscriptions_rotate_secret_webhooks_response.rb +31 -0
  55. data/lib/nordlet/webhooks/types/subscriptions_rotate_secret_webhooks_response_last_delivery_status.rb +15 -0
  56. data/lib/nordlet.rb +32 -0
  57. data/reference.md +573 -15
  58. metadata +34 -2
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class TwoFactorGetAccountResponseSetup < Internal::Types::Model
7
+ field :secret, -> { String }, optional: false, nullable: false
8
+
9
+ field :otpauth_url, -> { String }, optional: false, nullable: false, api_name: "otpauthUrl"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class TwoFactorRecoveryCodesRegenerateAccountRequest < Internal::Types::Model
7
+ field :code, -> { String }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class TwoFactorRecoveryCodesRegenerateAccountResponse < 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,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class TwoFactorSetupAccountRequest < Internal::Types::Model; end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class TwoFactorSetupAccountResponse < Internal::Types::Model
7
+ field :secret, -> { String }, optional: false, nullable: false
8
+
9
+ field :otpauth_url, -> { String }, optional: false, nullable: false, api_name: "otpauthUrl"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class TwoFactorVerifyAccountRequest < Internal::Types::Model
7
+ field :code, -> { String }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Account
5
+ module Types
6
+ class TwoFactorVerifyAccountResponse < Internal::Types::Model
7
+ field :verified, -> { Internal::Types::Boolean }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -198,8 +198,9 @@ module Nordlet
198
198
 
199
199
  # Open a Stripe Checkout session for a one-time credit top-up of `amountCents` and return its URL; a Stripe
200
200
  # customer is created for the user when there is none. `returnTo` chooses whether Checkout returns to the credits
201
- # page or to the onboarding plan page, in `locale`. Answers 409 on a site without top-ups and 503 when online
202
- # payments are not configured.
201
+ # page or to the onboarding plan page, in `locale`; with `convertCompanyId` it returns to the onboarding plan
202
+ # page, which then converts that sandbox company to a live company. Answers 409 on a site without top-ups and 503
203
+ # when online payments are not configured.
203
204
  #
204
205
  # @param request_options [Hash]
205
206
  # @param params [Nordlet::Billing::Types::TopupCreateBillingRequest]
@@ -269,13 +270,51 @@ module Nordlet
269
270
  end
270
271
  end
271
272
 
273
+ # Start the free sandbox plan of the caller's `app` billing account: one sandbox company, free for 14 days from
274
+ # now, without a payment. A free sandbox that is already running keeps its end date. After `trialEndsAt` the
275
+ # sandbox company answers 402 until a paid plan is chosen. Answers 409 on the `invoice` site, when a paid plan is
276
+ # already active, and when the free sandbox of this account has already ended.
277
+ #
278
+ # @param request_options [Hash]
279
+ # @param params [Nordlet::Billing::Types::FreeSandboxStartBillingRequest]
280
+ # @option request_options [String] :base_url
281
+ # @option request_options [Hash{String => Object}] :additional_headers
282
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
283
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
284
+ # @option request_options [Integer] :timeout_in_seconds
285
+ #
286
+ # @return [Nordlet::Billing::Types::FreeSandboxStartBillingResponse]
287
+ def free_sandbox_start(request_options: {}, **params)
288
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
289
+ request = Nordlet::Internal::JSON::Request.new(
290
+ base_url: request_options[:base_url],
291
+ method: "POST",
292
+ path: "v1/billing/free-sandbox/start",
293
+ body: Nordlet::Billing::Types::FreeSandboxStartBillingRequest.new(params).to_h,
294
+ request_options: request_options
295
+ )
296
+ begin
297
+ response = @client.send(request)
298
+ rescue Net::HTTPRequestTimeout
299
+ raise Nordlet::Errors::TimeoutError
300
+ end
301
+ code = response.code.to_i
302
+ if code.between?(200, 299)
303
+ Nordlet::Billing::Types::FreeSandboxStartBillingResponse.load(response.body)
304
+ else
305
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
306
+ raise error_class.new(response.body, code: code)
307
+ end
308
+ end
309
+
272
310
  # Open a Stripe Checkout session for a flat-rate subscription on `plan` (by default the first plan of the
273
- # request's site) for the billing account of the request's site, with the trial period of `trialDays` days, and
274
- # return its URL; a Stripe customer is created for that account when it has none. The `invoicing` plan of the
275
- # `invoice` site takes its trial days from the server setting `INVOICE_PLAN_TRIAL_DAYS` and returns to the invoice
276
- # app. Answers 422 when the plan is not one of the site's plans, 409 when the site's flat-rate subscription is
277
- # already active and 503 when online payments are not configured, the plan has no price, or the Invoicing trial is
278
- # not set.
311
+ # request's site) for the billing account of the request's site and return its URL; a Stripe customer is created
312
+ # for that account when it has none. The plans of the `app` site have no trial period: the first month is charged
313
+ # at checkout. The `invoicing` plan of the `invoice` site takes its trial days from the server setting
314
+ # `INVOICE_PLAN_TRIAL_DAYS` and returns to the invoice app. With `convertCompanyId` Checkout returns to the
315
+ # onboarding plan page, which then converts that sandbox company to a live company. Answers 422 when the plan is
316
+ # not one of the site's plans, 409 when the site's flat-rate subscription is already active and 503 when online
317
+ # payments are not configured, the plan has no price, or the Invoicing trial is not set.
279
318
  #
280
319
  # @param request_options [Hash]
281
320
  # @param params [Nordlet::Billing::Types::FlatRateCreateBillingRequest]
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -7,6 +7,8 @@ module Nordlet
7
7
  field :locale, -> { Nordlet::Billing::Types::FlatRateCreateBillingRequestLocale }, optional: true, nullable: false
8
8
 
9
9
  field :plan, -> { Nordlet::Billing::Types::FlatRateCreateBillingRequestPlan }, optional: true, nullable: false
10
+
11
+ field :convert_company_id, -> { String }, optional: true, nullable: false, api_name: "convertCompanyId"
10
12
  end
11
13
  end
12
14
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ class FreeSandboxStartBillingRequest < Internal::Types::Model; end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ class FreeSandboxStartBillingResponse < Internal::Types::Model
7
+ field :site, -> { Nordlet::Billing::Types::FreeSandboxStartBillingResponseSite }, optional: false, nullable: false
8
+
9
+ field :plan, -> { Nordlet::Billing::Types::FreeSandboxStartBillingResponsePlan }, optional: false, nullable: false
10
+
11
+ field :account_type, -> { Nordlet::Billing::Types::FreeSandboxStartBillingResponseAccountType }, optional: false, nullable: false, api_name: "accountType"
12
+
13
+ field :status, -> { Nordlet::Billing::Types::FreeSandboxStartBillingResponseStatus }, optional: false, nullable: false
14
+
15
+ field :balance_cents, -> { Integer }, optional: false, nullable: false, api_name: "balanceCents"
16
+
17
+ field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
+
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
21
+ field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
22
+
23
+ field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
24
+
25
+ field :payments_configured, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "paymentsConfigured"
26
+
27
+ field :has_payment_account, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "hasPaymentAccount"
28
+
29
+ field :has_subscription, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "hasSubscription"
30
+
31
+ field :subscription_cancel_at, -> { String }, optional: false, nullable: true, api_name: "subscriptionCancelAt"
32
+
33
+ field :payment_failed_at, -> { String }, optional: false, nullable: true, api_name: "paymentFailedAt"
34
+
35
+ field :payment_failed_invoice_url, -> { String }, optional: false, nullable: true, api_name: "paymentFailedInvoiceUrl"
36
+
37
+ field :month_to_date, -> { Nordlet::Billing::Types::FreeSandboxStartBillingResponseMonthToDate }, optional: false, nullable: false, api_name: "monthToDate"
38
+
39
+ field :plans, -> { Internal::Types::Hash[String, Nordlet::Billing::Types::FreeSandboxStartBillingResponsePlansValue] }, optional: false, nullable: false
40
+
41
+ field :api_request_eur, -> { String }, optional: false, nullable: false, api_name: "apiRequestEur"
42
+
43
+ field :top_up, -> { Nordlet::Billing::Types::FreeSandboxStartBillingResponseTopUp }, optional: false, nullable: false, api_name: "topUp"
44
+
45
+ field :auto_top_up, -> { Nordlet::Billing::Types::FreeSandboxStartBillingResponseAutoTopUp }, optional: false, nullable: false, api_name: "autoTopUp"
46
+
47
+ field :overdraft_cap_cents, -> { Integer }, optional: false, nullable: false, api_name: "overdraftCapCents"
48
+
49
+ field :overdraft_cap_max_cents, -> { Integer }, optional: false, nullable: false, api_name: "overdraftCapMaxCents"
50
+
51
+ field :trial_days, -> { Integer }, optional: false, nullable: false, api_name: "trialDays"
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ module FreeSandboxStartBillingResponseAccountType
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ FLAT_RATE = "flat_rate"
10
+ PER_REQUEST = "per_request"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ class FreeSandboxStartBillingResponseAutoTopUp < Internal::Types::Model
7
+ field :enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
8
+
9
+ field :amount_cents, -> { Integer }, optional: false, nullable: false, api_name: "amountCents"
10
+
11
+ field :pending, -> { Internal::Types::Boolean }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ class FreeSandboxStartBillingResponseMonthToDate < Internal::Types::Model
7
+ field :from, -> { String }, optional: false, nullable: false
8
+
9
+ field :to, -> { String }, optional: false, nullable: false
10
+
11
+ field :api_requests, -> { Integer }, optional: false, nullable: false, api_name: "apiRequests"
12
+
13
+ field :sale_invoices, -> { Integer }, optional: false, nullable: false, api_name: "saleInvoices"
14
+
15
+ field :ocr_pages, -> { Integer }, optional: false, nullable: false, api_name: "ocrPages"
16
+
17
+ field :file_bytes, -> { Integer }, optional: false, nullable: false, api_name: "fileBytes"
18
+
19
+ field :database_bytes, -> { Integer }, optional: false, nullable: false, api_name: "databaseBytes"
20
+
21
+ field :archived_companies, -> { Integer }, optional: false, nullable: false, api_name: "archivedCompanies"
22
+
23
+ field :estimated_today_cents, -> { Integer }, optional: false, nullable: false, api_name: "estimatedTodayCents"
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ module FreeSandboxStartBillingResponsePlan
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ STARTER = "starter"
10
+ BUSINESS = "business"
11
+ SCALE = "scale"
12
+ INVOICING = "invoicing"
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ class FreeSandboxStartBillingResponsePlansValue < Internal::Types::Model
7
+ field :monthly_fee_eur, -> { String }, optional: false, nullable: false, api_name: "monthlyFeeEur"
8
+
9
+ field :included_invoices, -> { Integer }, optional: false, nullable: false, api_name: "includedInvoices"
10
+
11
+ field :invoice_overage_eur, -> { String }, optional: false, nullable: false, api_name: "invoiceOverageEur"
12
+
13
+ field :included_database_bytes, -> { Integer }, optional: false, nullable: false, api_name: "includedDatabaseBytes"
14
+
15
+ field :included_file_bytes, -> { Integer }, optional: false, nullable: false, api_name: "includedFileBytes"
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ module FreeSandboxStartBillingResponseSite
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ APP = "app"
10
+ INVOICE = "invoice"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ module FreeSandboxStartBillingResponseStatus
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ TRIAL = "trial"
10
+ ACTIVE = "active"
11
+ SUSPENDED = "suspended"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Billing
5
+ module Types
6
+ class FreeSandboxStartBillingResponseTopUp < Internal::Types::Model
7
+ field :min_cents, -> { Integer }, optional: false, nullable: false, api_name: "minCents"
8
+
9
+ field :max_cents, -> { Integer }, optional: false, nullable: false, api_name: "maxCents"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -16,6 +16,8 @@ module Nordlet
16
16
 
17
17
  field :trial_ends_at, -> { String }, optional: false, nullable: true, api_name: "trialEndsAt"
18
18
 
19
+ field :free_sandbox_started_at, -> { String }, optional: false, nullable: true, api_name: "freeSandboxStartedAt"
20
+
19
21
  field :first_top_up_at, -> { String }, optional: false, nullable: true, api_name: "firstTopUpAt"
20
22
 
21
23
  field :last_charged_date, -> { String }, optional: false, nullable: true, api_name: "lastChargedDate"
@@ -9,6 +9,8 @@ module Nordlet
9
9
  field :locale, -> { Nordlet::Billing::Types::TopupCreateBillingRequestLocale }, optional: true, nullable: false
10
10
 
11
11
  field :return_to, -> { Nordlet::Billing::Types::TopupCreateBillingRequestReturnTo }, optional: true, nullable: false, api_name: "returnTo"
12
+
13
+ field :convert_company_id, -> { String }, optional: true, nullable: false, api_name: "convertCompanyId"
12
14
  end
13
15
  end
14
16
  end
@@ -10,6 +10,7 @@ module Nordlet
10
10
  SECRET = "secret"
11
11
  SELECT = "select"
12
12
  URL = "url"
13
+ HOST = "host"
13
14
  CERTIFICATE = "certificate"
14
15
  end
15
16
  end
@@ -10,6 +10,7 @@ module Nordlet
10
10
  SECRET = "secret"
11
11
  SELECT = "select"
12
12
  URL = "url"
13
+ HOST = "host"
13
14
  CERTIFICATE = "certificate"
14
15
  end
15
16
  end
@@ -51,7 +51,10 @@ module Nordlet
51
51
  # `sale_invoice.peppol_failed`; a received-document event fetches the document from the access point, stores it as
52
52
  # a document capture with the matched supplier, emits `document_capture.peppol_received` and marks it read at the
53
53
  # access point (a document already stored is skipped). `handled` is false when the event matched no invoice or
54
- # document. Answers 404 when no company uses that provider account, 401 when the signature does not match.
54
+ # document. A status is not moved back: pending, failed, delivered and rejected come in that order, and an event
55
+ # with an earlier status than the stored one changes nothing. Answers 401, with the same body, when no company
56
+ # uses that provider account, when the signature does not match and, for e-invoice.be, when the `created_at` of
57
+ # the event is more than 5 minutes from the server time.
55
58
  #
56
59
  # @param request_options [Hash]
57
60
  # @param params [Hash]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nordlet
4
- VERSION = "0.6.4"
4
+ VERSION = "0.6.6"
5
5
  end
@@ -11,8 +11,9 @@ module Nordlet
11
11
  end
12
12
 
13
13
  # Register a webhook endpoint for the given event types (`*` for every event). The URL must be an https address
14
- # that resolves to a public network (422 otherwise). The signing secret is generated unless `secret` is given, and
15
- # this call is the only one that returns it.
14
+ # that resolves to a public network (422 otherwise). The signing secret is generated unless `secret` is given (at
15
+ # least 32 characters), and this call is the only one that returns it. Answers 503 when the platform encryption
16
+ # key is not configured.
16
17
  #
17
18
  # @param request_options [Hash]
18
19
  # @param params [Nordlet::Webhooks::Types::SubscriptionsCreateWebhooksRequest]
@@ -81,6 +82,44 @@ module Nordlet
81
82
  end
82
83
  end
83
84
 
85
+ # Replace the signing secret of a subscription and return the new one; this call is the only one that returns it.
86
+ # The secret is generated unless `secret` is given (at least 32 characters). For 24 hours `x-nordlet-signature-v2`
87
+ # carries two `v1=` values, one with the new secret and one with the previous one, so a receiver can switch
88
+ # secrets without refusing deliveries; `x-nordlet-signature` uses the new secret only. Answers 404 for an unknown
89
+ # subscription and 503 when the platform encryption key is not configured.
90
+ #
91
+ # @param request_options [Hash]
92
+ # @param params [Nordlet::Webhooks::Types::SubscriptionsRotateSecretWebhooksRequest]
93
+ # @option request_options [String] :base_url
94
+ # @option request_options [Hash{String => Object}] :additional_headers
95
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
96
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
97
+ # @option request_options [Integer] :timeout_in_seconds
98
+ #
99
+ # @return [Nordlet::Webhooks::Types::SubscriptionsRotateSecretWebhooksResponse]
100
+ def subscriptions_rotate_secret(request_options: {}, **params)
101
+ params = Nordlet::Internal::Types::Utils.normalize_keys(params)
102
+ request = Nordlet::Internal::JSON::Request.new(
103
+ base_url: request_options[:base_url],
104
+ method: "POST",
105
+ path: "v1/webhooks/subscriptions/rotate-secret",
106
+ body: Nordlet::Webhooks::Types::SubscriptionsRotateSecretWebhooksRequest.new(params).to_h,
107
+ request_options: request_options
108
+ )
109
+ begin
110
+ response = @client.send(request)
111
+ rescue Net::HTTPRequestTimeout
112
+ raise Nordlet::Errors::TimeoutError
113
+ end
114
+ code = response.code.to_i
115
+ if code.between?(200, 299)
116
+ Nordlet::Webhooks::Types::SubscriptionsRotateSecretWebhooksResponse.load(response.body)
117
+ else
118
+ error_class = Nordlet::Errors::ResponseError.subclass_for_code(code)
119
+ raise error_class.new(response.body, code: code)
120
+ end
121
+ end
122
+
84
123
  # Change the URL, event types or `isActive` flag of a subscription; at least one field is required (400) and a new
85
124
  # URL must be an https address that resolves to a public network (422). Setting `isActive` to true also clears
86
125
  # `pausedAt` and `consecutiveFailures`, which is how a subscription paused after 5 failed deliveries in a row is
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Webhooks
5
+ module Types
6
+ class SubscriptionsRotateSecretWebhooksRequest < Internal::Types::Model
7
+ field :id, -> { String }, optional: false, nullable: false
8
+
9
+ field :secret, -> { String }, optional: true, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Webhooks
5
+ module Types
6
+ class SubscriptionsRotateSecretWebhooksResponse < Internal::Types::Model
7
+ field :id, -> { String }, optional: false, nullable: false
8
+
9
+ field :url, -> { String }, optional: false, nullable: false
10
+
11
+ field :events, -> { Internal::Types::Array[String] }, optional: false, nullable: false
12
+
13
+ field :is_active, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "isActive"
14
+
15
+ field :consecutive_failures, -> { Integer }, optional: false, nullable: false, api_name: "consecutiveFailures"
16
+
17
+ field :last_delivery_status, -> { Nordlet::Webhooks::Types::SubscriptionsRotateSecretWebhooksResponseLastDeliveryStatus }, optional: false, nullable: true, api_name: "lastDeliveryStatus"
18
+
19
+ field :last_delivery_at, -> { String }, optional: false, nullable: true, api_name: "lastDeliveryAt"
20
+
21
+ field :paused_at, -> { String }, optional: false, nullable: true, api_name: "pausedAt"
22
+
23
+ field :created_at, -> { String }, optional: false, nullable: false, api_name: "createdAt"
24
+
25
+ field :secret, -> { String }, optional: false, nullable: false
26
+
27
+ field :previous_secret_expires_at, -> { String }, optional: false, nullable: false, api_name: "previousSecretExpiresAt"
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nordlet
4
+ module Webhooks
5
+ module Types
6
+ module SubscriptionsRotateSecretWebhooksResponseLastDeliveryStatus
7
+ extend Nordlet::Internal::Types::Enum
8
+
9
+ PENDING = "pending"
10
+ DELIVERED = "delivered"
11
+ FAILED = "failed"
12
+ end
13
+ end
14
+ end
15
+ end