orb-billing 0.5.5 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/README.md +1 -1
- data/lib/orb/client.rb +4 -0
- data/lib/orb/internal/type/base_model.rb +2 -2
- data/lib/orb/internal/type/union.rb +6 -6
- data/lib/orb/models/alert.rb +33 -1
- data/lib/orb/models/amount_discount.rb +10 -10
- data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +17940 -0
- data/lib/orb/models/beta/external_plan_id_fetch_plan_version_params.rb +22 -0
- data/lib/orb/models/beta/external_plan_id_set_default_plan_version_params.rb +24 -0
- data/lib/orb/models/beta_create_plan_version_params.rb +17758 -0
- data/lib/orb/models/beta_fetch_plan_version_params.rb +20 -0
- data/lib/orb/models/beta_set_default_plan_version_params.rb +22 -0
- data/lib/orb/models/credit_note_create_params.rb +9 -9
- data/lib/orb/models/customer_create_params.rb +21 -3
- data/lib/orb/models/customer_update_by_external_id_params.rb +21 -3
- data/lib/orb/models/customer_update_params.rb +21 -3
- data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb +9 -1
- data/lib/orb/models/customers/credits/ledger_create_entry_response.rb +9 -1
- data/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb +9 -1
- data/lib/orb/models/customers/credits/ledger_list_response.rb +9 -1
- data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +1 -1
- data/lib/orb/models/customers/credits/top_up_create_params.rb +1 -1
- data/lib/orb/models/invoice.rb +626 -9
- data/lib/orb/models/invoice_fetch_upcoming_response.rb +624 -9
- data/lib/orb/models/invoice_line_item_create_response.rb +486 -7
- data/lib/orb/models/item.rb +18 -1
- data/lib/orb/models/item_archive_params.rb +14 -0
- data/lib/orb/models/item_create_params.rb +14 -1
- data/lib/orb/models/item_update_params.rb +16 -1
- data/lib/orb/models/percentage_discount.rb +10 -10
- data/lib/orb/models/plan.rb +618 -9
- data/lib/orb/models/plan_create_params.rb +2066 -30
- data/lib/orb/models/plan_version.rb +735 -0
- data/lib/orb/models/plan_version_phase.rb +70 -0
- data/lib/orb/models/price.rb +4124 -70
- data/lib/orb/models/price_create_params.rb +45 -1
- data/lib/orb/models/price_evaluate_multiple_params.rb +8620 -0
- data/lib/orb/models/price_evaluate_multiple_response.rb +51 -0
- data/lib/orb/models/subscription.rb +730 -54
- data/lib/orb/models/subscription_cancel_response.rb +706 -54
- data/lib/orb/models/subscription_change_apply_response.rb +728 -54
- data/lib/orb/models/subscription_change_cancel_response.rb +728 -54
- data/lib/orb/models/subscription_change_retrieve_response.rb +728 -54
- data/lib/orb/models/subscription_create_params.rb +5992 -1698
- data/lib/orb/models/subscription_create_response.rb +706 -54
- data/lib/orb/models/subscription_fetch_schedule_response.rb +3 -3
- data/lib/orb/models/subscription_price_intervals_params.rb +1392 -76
- data/lib/orb/models/subscription_price_intervals_response.rb +712 -54
- data/lib/orb/models/subscription_schedule_plan_change_params.rb +6005 -1723
- data/lib/orb/models/subscription_schedule_plan_change_response.rb +716 -54
- data/lib/orb/models/subscription_trigger_phase_response.rb +708 -54
- data/lib/orb/models/subscription_unschedule_cancellation_response.rb +720 -54
- data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb +728 -54
- data/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb +728 -54
- data/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb +1 -1
- data/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb +720 -54
- data/lib/orb/models/subscription_update_trial_response.rb +706 -54
- data/lib/orb/models/trial_discount.rb +10 -10
- data/lib/orb/models/usage_discount.rb +10 -10
- data/lib/orb/models.rb +16 -0
- data/lib/orb/resources/beta/external_plan_id.rb +113 -0
- data/lib/orb/resources/beta.rb +115 -0
- data/lib/orb/resources/credit_notes.rb +3 -3
- data/lib/orb/resources/customers/balance_transactions.rb +0 -7
- data/lib/orb/resources/customers.rb +4 -7
- data/lib/orb/resources/dimensional_price_groups.rb +1 -1
- data/lib/orb/resources/items.rb +34 -2
- data/lib/orb/resources/plans/external_plan_id.rb +1 -1
- data/lib/orb/resources/plans.rb +2 -2
- data/lib/orb/resources/prices.rb +69 -2
- data/lib/orb/resources/subscriptions.rb +5 -1
- data/lib/orb/version.rb +1 -1
- data/lib/orb.rb +13 -0
- data/rbi/orb/client.rbi +3 -0
- data/rbi/orb/models/alert.rbi +50 -3
- data/rbi/orb/models/amount_discount.rbi +8 -8
- data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +32652 -0
- data/rbi/orb/models/beta/external_plan_id_fetch_plan_version_params.rbi +40 -0
- data/rbi/orb/models/beta/external_plan_id_set_default_plan_version_params.rbi +45 -0
- data/rbi/orb/models/beta_create_plan_version_params.rbi +32595 -0
- data/rbi/orb/models/beta_fetch_plan_version_params.rbi +35 -0
- data/rbi/orb/models/beta_set_default_plan_version_params.rbi +40 -0
- data/rbi/orb/models/credit_note_create_params.rbi +8 -8
- data/rbi/orb/models/customer_create_params.rbi +38 -4
- data/rbi/orb/models/customer_update_by_external_id_params.rbi +38 -4
- data/rbi/orb/models/customer_update_params.rbi +38 -4
- data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi +9 -1
- data/rbi/orb/models/customers/credits/ledger_create_entry_response.rbi +9 -1
- data/rbi/orb/models/customers/credits/ledger_list_by_external_id_response.rbi +9 -1
- data/rbi/orb/models/customers/credits/ledger_list_response.rbi +9 -1
- data/rbi/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +2 -2
- data/rbi/orb/models/customers/credits/top_up_create_params.rbi +2 -2
- data/rbi/orb/models/invoice.rbi +1451 -35
- data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +1524 -4
- data/rbi/orb/models/invoice_line_item_create_response.rbi +1184 -2
- data/rbi/orb/models/item.rbi +20 -1
- data/rbi/orb/models/item_archive_params.rbi +25 -0
- data/rbi/orb/models/item_create_params.rbi +18 -1
- data/rbi/orb/models/item_update_params.rbi +17 -1
- data/rbi/orb/models/percentage_discount.rbi +10 -10
- data/rbi/orb/models/plan.rbi +1339 -4
- data/rbi/orb/models/plan_create_params.rbi +3833 -29
- data/rbi/orb/models/plan_version.rbi +1367 -0
- data/rbi/orb/models/plan_version_phase.rbi +99 -0
- data/rbi/orb/models/price.rbi +9447 -441
- data/rbi/orb/models/price_create_params.rbi +80 -0
- data/rbi/orb/models/price_evaluate_multiple_params.rbi +15764 -0
- data/rbi/orb/models/price_evaluate_multiple_response.rbi +96 -0
- data/rbi/orb/models/subscription.rbi +1654 -44
- data/rbi/orb/models/subscription_cancel_response.rbi +1692 -44
- data/rbi/orb/models/subscription_change_apply_response.rbi +1692 -44
- data/rbi/orb/models/subscription_change_cancel_response.rbi +1692 -44
- data/rbi/orb/models/subscription_change_retrieve_response.rbi +1692 -44
- data/rbi/orb/models/subscription_create_params.rbi +10400 -2710
- data/rbi/orb/models/subscription_create_response.rbi +1692 -44
- data/rbi/orb/models/subscription_fetch_schedule_response.rbi +13 -4
- data/rbi/orb/models/subscription_price_intervals_params.rbi +2401 -49
- data/rbi/orb/models/subscription_price_intervals_response.rbi +1692 -44
- data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +10423 -2753
- data/rbi/orb/models/subscription_schedule_plan_change_response.rbi +1692 -44
- data/rbi/orb/models/subscription_trigger_phase_response.rbi +1692 -44
- data/rbi/orb/models/subscription_unschedule_cancellation_response.rbi +1692 -44
- data/rbi/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi +1692 -44
- data/rbi/orb/models/subscription_unschedule_pending_plan_changes_response.rbi +1692 -44
- data/rbi/orb/models/subscription_update_fixed_fee_quantity_params.rbi +2 -2
- data/rbi/orb/models/subscription_update_fixed_fee_quantity_response.rbi +1692 -44
- data/rbi/orb/models/subscription_update_trial_response.rbi +1692 -44
- data/rbi/orb/models/trial_discount.rbi +8 -8
- data/rbi/orb/models/usage_discount.rbi +10 -10
- data/rbi/orb/models.rbi +16 -0
- data/rbi/orb/resources/beta/external_plan_id.rbi +118 -0
- data/rbi/orb/resources/beta.rbi +111 -0
- data/rbi/orb/resources/credit_notes.rbi +3 -3
- data/rbi/orb/resources/customers/balance_transactions.rbi +0 -7
- data/rbi/orb/resources/customers/credits/top_ups.rbi +2 -2
- data/rbi/orb/resources/customers.rbi +7 -7
- data/rbi/orb/resources/dimensional_price_groups.rbi +1 -1
- data/rbi/orb/resources/items.rbi +20 -0
- data/rbi/orb/resources/plans/external_plan_id.rbi +1 -1
- data/rbi/orb/resources/plans.rbi +5 -2
- data/rbi/orb/resources/prices.rbi +73 -1
- data/rbi/orb/resources/subscriptions.rbi +9 -1
- data/sig/orb/client.rbs +2 -0
- data/sig/orb/models/alert.rbs +20 -3
- data/sig/orb/models/amount_discount.rbs +5 -5
- data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +12898 -0
- data/sig/orb/models/beta/external_plan_id_fetch_plan_version_params.rbs +25 -0
- data/sig/orb/models/beta/external_plan_id_set_default_plan_version_params.rbs +25 -0
- data/sig/orb/models/beta_create_plan_version_params.rbs +12877 -0
- data/sig/orb/models/beta_fetch_plan_version_params.rbs +20 -0
- data/sig/orb/models/beta_set_default_plan_version_params.rbs +20 -0
- data/sig/orb/models/credit_note_create_params.rbs +6 -6
- data/sig/orb/models/customer_create_params.rbs +13 -0
- data/sig/orb/models/customer_update_by_external_id_params.rbs +13 -0
- data/sig/orb/models/customer_update_params.rbs +13 -0
- data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbs +7 -2
- data/sig/orb/models/customers/credits/ledger_create_entry_response.rbs +7 -2
- data/sig/orb/models/customers/credits/ledger_list_by_external_id_response.rbs +7 -2
- data/sig/orb/models/customers/credits/ledger_list_response.rbs +7 -2
- data/sig/orb/models/invoice.rbs +558 -4
- data/sig/orb/models/invoice_fetch_upcoming_response.rbs +558 -4
- data/sig/orb/models/invoice_line_item_create_response.rbs +414 -2
- data/sig/orb/models/item.rbs +5 -0
- data/sig/orb/models/item_archive_params.rbs +14 -0
- data/sig/orb/models/item_create_params.rbs +10 -2
- data/sig/orb/models/item_update_params.rbs +5 -0
- data/sig/orb/models/percentage_discount.rbs +5 -5
- data/sig/orb/models/plan.rbs +538 -4
- data/sig/orb/models/plan_create_params.rbs +1460 -3
- data/sig/orb/models/plan_version.rbs +583 -0
- data/sig/orb/models/plan_version_phase.rbs +60 -0
- data/sig/orb/models/price.rbs +3512 -96
- data/sig/orb/models/price_create_params.rbs +32 -0
- data/sig/orb/models/price_evaluate_multiple_params.rbs +6230 -0
- data/sig/orb/models/price_evaluate_multiple_response.rbs +50 -0
- data/sig/orb/models/subscription.rbs +609 -29
- data/sig/orb/models/subscription_cancel_response.rbs +609 -29
- data/sig/orb/models/subscription_change_apply_response.rbs +621 -29
- data/sig/orb/models/subscription_change_cancel_response.rbs +621 -29
- data/sig/orb/models/subscription_change_retrieve_response.rbs +621 -29
- data/sig/orb/models/subscription_create_params.rbs +4450 -1466
- data/sig/orb/models/subscription_create_response.rbs +609 -29
- data/sig/orb/models/subscription_fetch_schedule_response.rbs +4 -4
- data/sig/orb/models/subscription_price_intervals_params.rbs +920 -24
- data/sig/orb/models/subscription_price_intervals_response.rbs +609 -29
- data/sig/orb/models/subscription_schedule_plan_change_params.rbs +4440 -1466
- data/sig/orb/models/subscription_schedule_plan_change_response.rbs +609 -29
- data/sig/orb/models/subscription_trigger_phase_response.rbs +609 -29
- data/sig/orb/models/subscription_unschedule_cancellation_response.rbs +609 -29
- data/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbs +609 -29
- data/sig/orb/models/subscription_unschedule_pending_plan_changes_response.rbs +609 -29
- data/sig/orb/models/subscription_update_fixed_fee_quantity_response.rbs +609 -29
- data/sig/orb/models/subscription_update_trial_response.rbs +609 -29
- data/sig/orb/models/trial_discount.rbs +5 -5
- data/sig/orb/models/usage_discount.rbs +5 -5
- data/sig/orb/models.rbs +16 -0
- data/sig/orb/resources/beta/external_plan_id.rbs +34 -0
- data/sig/orb/resources/beta.rbs +34 -0
- data/sig/orb/resources/credit_notes.rbs +1 -1
- data/sig/orb/resources/items.rbs +7 -0
- data/sig/orb/resources/prices.rbs +11 -0
- data/sig/orb/resources/subscriptions.rbs +2 -0
- metadata +40 -1
@@ -3,18 +3,18 @@
|
|
3
3
|
module Orb
|
4
4
|
module Models
|
5
5
|
class TrialDiscount < Orb::Internal::Type::BaseModel
|
6
|
-
# @!attribute applies_to_price_ids
|
7
|
-
# List of price_ids that this discount applies to. For plan/plan phase discounts,
|
8
|
-
# this can be a subset of prices.
|
9
|
-
#
|
10
|
-
# @return [Array<String>]
|
11
|
-
required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
|
12
|
-
|
13
6
|
# @!attribute discount_type
|
14
7
|
#
|
15
8
|
# @return [Symbol, Orb::Models::TrialDiscount::DiscountType]
|
16
9
|
required :discount_type, enum: -> { Orb::TrialDiscount::DiscountType }
|
17
10
|
|
11
|
+
# @!attribute applies_to_price_ids
|
12
|
+
# List of price_ids that this discount applies to. For plan/plan phase discounts,
|
13
|
+
# this can be a subset of prices.
|
14
|
+
#
|
15
|
+
# @return [Array<String>, nil]
|
16
|
+
optional :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String], nil?: true
|
17
|
+
|
18
18
|
# @!attribute reason
|
19
19
|
#
|
20
20
|
# @return [String, nil]
|
@@ -32,14 +32,14 @@ module Orb
|
|
32
32
|
# @return [Float, nil]
|
33
33
|
optional :trial_percentage_discount, Float, nil?: true
|
34
34
|
|
35
|
-
# @!method initialize(
|
35
|
+
# @!method initialize(discount_type:, applies_to_price_ids: nil, reason: nil, trial_amount_discount: nil, trial_percentage_discount: nil)
|
36
36
|
# Some parameter documentations has been truncated, see
|
37
37
|
# {Orb::Models::TrialDiscount} for more details.
|
38
38
|
#
|
39
|
-
# @param applies_to_price_ids [Array<String>] List of price_ids that this discount applies to. For plan/plan phase discounts,
|
40
|
-
#
|
41
39
|
# @param discount_type [Symbol, Orb::Models::TrialDiscount::DiscountType]
|
42
40
|
#
|
41
|
+
# @param applies_to_price_ids [Array<String>, nil] List of price_ids that this discount applies to. For plan/plan phase discounts,
|
42
|
+
#
|
43
43
|
# @param reason [String, nil]
|
44
44
|
#
|
45
45
|
# @param trial_amount_discount [String, nil] Only available if discount_type is `trial`
|
@@ -3,13 +3,6 @@
|
|
3
3
|
module Orb
|
4
4
|
module Models
|
5
5
|
class UsageDiscount < Orb::Internal::Type::BaseModel
|
6
|
-
# @!attribute applies_to_price_ids
|
7
|
-
# List of price_ids that this discount applies to. For plan/plan phase discounts,
|
8
|
-
# this can be a subset of prices.
|
9
|
-
#
|
10
|
-
# @return [Array<String>]
|
11
|
-
required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
|
12
|
-
|
13
6
|
# @!attribute discount_type
|
14
7
|
#
|
15
8
|
# @return [Symbol, Orb::Models::UsageDiscount::DiscountType]
|
@@ -22,21 +15,28 @@ module Orb
|
|
22
15
|
# @return [Float]
|
23
16
|
required :usage_discount, Float
|
24
17
|
|
18
|
+
# @!attribute applies_to_price_ids
|
19
|
+
# List of price_ids that this discount applies to. For plan/plan phase discounts,
|
20
|
+
# this can be a subset of prices.
|
21
|
+
#
|
22
|
+
# @return [Array<String>, nil]
|
23
|
+
optional :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String], nil?: true
|
24
|
+
|
25
25
|
# @!attribute reason
|
26
26
|
#
|
27
27
|
# @return [String, nil]
|
28
28
|
optional :reason, String, nil?: true
|
29
29
|
|
30
|
-
# @!method initialize(
|
30
|
+
# @!method initialize(discount_type:, usage_discount:, applies_to_price_ids: nil, reason: nil)
|
31
31
|
# Some parameter documentations has been truncated, see
|
32
32
|
# {Orb::Models::UsageDiscount} for more details.
|
33
33
|
#
|
34
|
-
# @param applies_to_price_ids [Array<String>] List of price_ids that this discount applies to. For plan/plan phase discounts,
|
35
|
-
#
|
36
34
|
# @param discount_type [Symbol, Orb::Models::UsageDiscount::DiscountType]
|
37
35
|
#
|
38
36
|
# @param usage_discount [Float] Only available if discount_type is `usage`. Number of usage units that this disc
|
39
37
|
#
|
38
|
+
# @param applies_to_price_ids [Array<String>, nil] List of price_ids that this discount applies to. For plan/plan phase discounts,
|
39
|
+
#
|
40
40
|
# @param reason [String, nil]
|
41
41
|
|
42
42
|
# @see Orb::Models::UsageDiscount#discount_type
|
data/lib/orb/models.rb
CHANGED
@@ -59,6 +59,14 @@ module Orb
|
|
59
59
|
|
60
60
|
AmountDiscount = Orb::Models::AmountDiscount
|
61
61
|
|
62
|
+
Beta = Orb::Models::Beta
|
63
|
+
|
64
|
+
BetaCreatePlanVersionParams = Orb::Models::BetaCreatePlanVersionParams
|
65
|
+
|
66
|
+
BetaFetchPlanVersionParams = Orb::Models::BetaFetchPlanVersionParams
|
67
|
+
|
68
|
+
BetaSetDefaultPlanVersionParams = Orb::Models::BetaSetDefaultPlanVersionParams
|
69
|
+
|
62
70
|
BillableMetric = Orb::Models::BillableMetric
|
63
71
|
|
64
72
|
BillingCycleRelativeDate = Orb::Models::BillingCycleRelativeDate
|
@@ -158,6 +166,8 @@ module Orb
|
|
158
166
|
|
159
167
|
Item = Orb::Models::Item
|
160
168
|
|
169
|
+
ItemArchiveParams = Orb::Models::ItemArchiveParams
|
170
|
+
|
161
171
|
ItemCreateParams = Orb::Models::ItemCreateParams
|
162
172
|
|
163
173
|
ItemFetchParams = Orb::Models::ItemFetchParams
|
@@ -190,10 +200,16 @@ module Orb
|
|
190
200
|
|
191
201
|
PlanUpdateParams = Orb::Models::PlanUpdateParams
|
192
202
|
|
203
|
+
PlanVersion = Orb::Models::PlanVersion
|
204
|
+
|
205
|
+
PlanVersionPhase = Orb::Models::PlanVersionPhase
|
206
|
+
|
193
207
|
Price = Orb::Models::Price
|
194
208
|
|
195
209
|
PriceCreateParams = Orb::Models::PriceCreateParams
|
196
210
|
|
211
|
+
PriceEvaluateMultipleParams = Orb::Models::PriceEvaluateMultipleParams
|
212
|
+
|
197
213
|
PriceEvaluateParams = Orb::Models::PriceEvaluateParams
|
198
214
|
|
199
215
|
PriceFetchParams = Orb::Models::PriceFetchParams
|
@@ -0,0 +1,113 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Orb
|
4
|
+
module Resources
|
5
|
+
class Beta
|
6
|
+
class ExternalPlanID
|
7
|
+
# This API endpoint is in beta and its interface may change. It is recommended for
|
8
|
+
# use only in test mode.
|
9
|
+
#
|
10
|
+
# This endpoint allows the creation of a new plan version for an existing plan.
|
11
|
+
#
|
12
|
+
# @overload create_plan_version(external_plan_id, version:, add_adjustments: nil, add_prices: nil, remove_adjustments: nil, remove_prices: nil, replace_adjustments: nil, replace_prices: nil, set_as_default: nil, request_options: {})
|
13
|
+
#
|
14
|
+
# @param external_plan_id [String]
|
15
|
+
#
|
16
|
+
# @param version [Integer] New version number.
|
17
|
+
#
|
18
|
+
# @param add_adjustments [Array<Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddAdjustment>, nil] Additional adjustments to be added to the plan.
|
19
|
+
#
|
20
|
+
# @param add_prices [Array<Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::AddPrice>, nil] Additional prices to be added to the plan.
|
21
|
+
#
|
22
|
+
# @param remove_adjustments [Array<Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::RemoveAdjustment>, nil] Adjustments to be removed from the plan.
|
23
|
+
#
|
24
|
+
# @param remove_prices [Array<Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::RemovePrice>, nil] Prices to be removed from the plan.
|
25
|
+
#
|
26
|
+
# @param replace_adjustments [Array<Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplaceAdjustment>, nil] Adjustments to be replaced with additional adjustments on the plan.
|
27
|
+
#
|
28
|
+
# @param replace_prices [Array<Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams::ReplacePrice>, nil] Prices to be replaced with additional prices on the plan.
|
29
|
+
#
|
30
|
+
# @param set_as_default [Boolean, nil] Set this new plan version as the default
|
31
|
+
#
|
32
|
+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
33
|
+
#
|
34
|
+
# @return [Orb::Models::PlanVersion]
|
35
|
+
#
|
36
|
+
# @see Orb::Models::Beta::ExternalPlanIDCreatePlanVersionParams
|
37
|
+
def create_plan_version(external_plan_id, params)
|
38
|
+
parsed, options = Orb::Beta::ExternalPlanIDCreatePlanVersionParams.dump_request(params)
|
39
|
+
@client.request(
|
40
|
+
method: :post,
|
41
|
+
path: ["plans/external_plan_id/%1$s/versions", external_plan_id],
|
42
|
+
body: parsed,
|
43
|
+
model: Orb::PlanVersion,
|
44
|
+
options: options
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
# This API endpoint is in beta and its interface may change. It is recommended for
|
49
|
+
# use only in test mode.
|
50
|
+
#
|
51
|
+
# This endpoint is used to fetch a plan version. It returns the phases, prices,
|
52
|
+
# and adjustments present on this version of the plan.
|
53
|
+
#
|
54
|
+
# @overload fetch_plan_version(version, external_plan_id:, request_options: {})
|
55
|
+
#
|
56
|
+
# @param version [String]
|
57
|
+
# @param external_plan_id [String]
|
58
|
+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
59
|
+
#
|
60
|
+
# @return [Orb::Models::PlanVersion]
|
61
|
+
#
|
62
|
+
# @see Orb::Models::Beta::ExternalPlanIDFetchPlanVersionParams
|
63
|
+
def fetch_plan_version(version, params)
|
64
|
+
parsed, options = Orb::Beta::ExternalPlanIDFetchPlanVersionParams.dump_request(params)
|
65
|
+
external_plan_id =
|
66
|
+
parsed.delete(:external_plan_id) do
|
67
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
68
|
+
end
|
69
|
+
@client.request(
|
70
|
+
method: :get,
|
71
|
+
path: ["plans/external_plan_id/%1$s/versions/%2$s", external_plan_id, version],
|
72
|
+
model: Orb::PlanVersion,
|
73
|
+
options: options
|
74
|
+
)
|
75
|
+
end
|
76
|
+
|
77
|
+
# This API endpoint is in beta and its interface may change. It is recommended for
|
78
|
+
# use only in test mode.
|
79
|
+
#
|
80
|
+
# This endpoint allows setting the default version of a plan.
|
81
|
+
#
|
82
|
+
# @overload set_default_plan_version(external_plan_id, version:, request_options: {})
|
83
|
+
#
|
84
|
+
# @param external_plan_id [String]
|
85
|
+
#
|
86
|
+
# @param version [Integer] Plan version to set as the default.
|
87
|
+
#
|
88
|
+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
89
|
+
#
|
90
|
+
# @return [Orb::Models::Plan]
|
91
|
+
#
|
92
|
+
# @see Orb::Models::Beta::ExternalPlanIDSetDefaultPlanVersionParams
|
93
|
+
def set_default_plan_version(external_plan_id, params)
|
94
|
+
parsed, options = Orb::Beta::ExternalPlanIDSetDefaultPlanVersionParams.dump_request(params)
|
95
|
+
@client.request(
|
96
|
+
method: :post,
|
97
|
+
path: ["plans/external_plan_id/%1$s/set_default_version", external_plan_id],
|
98
|
+
body: parsed,
|
99
|
+
model: Orb::Plan,
|
100
|
+
options: options
|
101
|
+
)
|
102
|
+
end
|
103
|
+
|
104
|
+
# @api private
|
105
|
+
#
|
106
|
+
# @param client [Orb::Client]
|
107
|
+
def initialize(client:)
|
108
|
+
@client = client
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Orb
|
4
|
+
module Resources
|
5
|
+
class Beta
|
6
|
+
# @return [Orb::Resources::Beta::ExternalPlanID]
|
7
|
+
attr_reader :external_plan_id
|
8
|
+
|
9
|
+
# This API endpoint is in beta and its interface may change. It is recommended for
|
10
|
+
# use only in test mode.
|
11
|
+
#
|
12
|
+
# This endpoint allows the creation of a new plan version for an existing plan.
|
13
|
+
#
|
14
|
+
# @overload create_plan_version(plan_id, version:, add_adjustments: nil, add_prices: nil, remove_adjustments: nil, remove_prices: nil, replace_adjustments: nil, replace_prices: nil, set_as_default: nil, request_options: {})
|
15
|
+
#
|
16
|
+
# @param plan_id [String]
|
17
|
+
#
|
18
|
+
# @param version [Integer] New version number.
|
19
|
+
#
|
20
|
+
# @param add_adjustments [Array<Orb::Models::BetaCreatePlanVersionParams::AddAdjustment>, nil] Additional adjustments to be added to the plan.
|
21
|
+
#
|
22
|
+
# @param add_prices [Array<Orb::Models::BetaCreatePlanVersionParams::AddPrice>, nil] Additional prices to be added to the plan.
|
23
|
+
#
|
24
|
+
# @param remove_adjustments [Array<Orb::Models::BetaCreatePlanVersionParams::RemoveAdjustment>, nil] Adjustments to be removed from the plan.
|
25
|
+
#
|
26
|
+
# @param remove_prices [Array<Orb::Models::BetaCreatePlanVersionParams::RemovePrice>, nil] Prices to be removed from the plan.
|
27
|
+
#
|
28
|
+
# @param replace_adjustments [Array<Orb::Models::BetaCreatePlanVersionParams::ReplaceAdjustment>, nil] Adjustments to be replaced with additional adjustments on the plan.
|
29
|
+
#
|
30
|
+
# @param replace_prices [Array<Orb::Models::BetaCreatePlanVersionParams::ReplacePrice>, nil] Prices to be replaced with additional prices on the plan.
|
31
|
+
#
|
32
|
+
# @param set_as_default [Boolean, nil] Set this new plan version as the default
|
33
|
+
#
|
34
|
+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
35
|
+
#
|
36
|
+
# @return [Orb::Models::PlanVersion]
|
37
|
+
#
|
38
|
+
# @see Orb::Models::BetaCreatePlanVersionParams
|
39
|
+
def create_plan_version(plan_id, params)
|
40
|
+
parsed, options = Orb::BetaCreatePlanVersionParams.dump_request(params)
|
41
|
+
@client.request(
|
42
|
+
method: :post,
|
43
|
+
path: ["plans/%1$s/versions", plan_id],
|
44
|
+
body: parsed,
|
45
|
+
model: Orb::PlanVersion,
|
46
|
+
options: options
|
47
|
+
)
|
48
|
+
end
|
49
|
+
|
50
|
+
# This API endpoint is in beta and its interface may change. It is recommended for
|
51
|
+
# use only in test mode.
|
52
|
+
#
|
53
|
+
# This endpoint is used to fetch a plan version. It returns the phases, prices,
|
54
|
+
# and adjustments present on this version of the plan.
|
55
|
+
#
|
56
|
+
# @overload fetch_plan_version(version, plan_id:, request_options: {})
|
57
|
+
#
|
58
|
+
# @param version [String]
|
59
|
+
# @param plan_id [String]
|
60
|
+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
61
|
+
#
|
62
|
+
# @return [Orb::Models::PlanVersion]
|
63
|
+
#
|
64
|
+
# @see Orb::Models::BetaFetchPlanVersionParams
|
65
|
+
def fetch_plan_version(version, params)
|
66
|
+
parsed, options = Orb::BetaFetchPlanVersionParams.dump_request(params)
|
67
|
+
plan_id =
|
68
|
+
parsed.delete(:plan_id) do
|
69
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
70
|
+
end
|
71
|
+
@client.request(
|
72
|
+
method: :get,
|
73
|
+
path: ["plans/%1$s/versions/%2$s", plan_id, version],
|
74
|
+
model: Orb::PlanVersion,
|
75
|
+
options: options
|
76
|
+
)
|
77
|
+
end
|
78
|
+
|
79
|
+
# This API endpoint is in beta and its interface may change. It is recommended for
|
80
|
+
# use only in test mode.
|
81
|
+
#
|
82
|
+
# This endpoint allows setting the default version of a plan.
|
83
|
+
#
|
84
|
+
# @overload set_default_plan_version(plan_id, version:, request_options: {})
|
85
|
+
#
|
86
|
+
# @param plan_id [String]
|
87
|
+
#
|
88
|
+
# @param version [Integer] Plan version to set as the default.
|
89
|
+
#
|
90
|
+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
91
|
+
#
|
92
|
+
# @return [Orb::Models::Plan]
|
93
|
+
#
|
94
|
+
# @see Orb::Models::BetaSetDefaultPlanVersionParams
|
95
|
+
def set_default_plan_version(plan_id, params)
|
96
|
+
parsed, options = Orb::BetaSetDefaultPlanVersionParams.dump_request(params)
|
97
|
+
@client.request(
|
98
|
+
method: :post,
|
99
|
+
path: ["plans/%1$s/set_default_version", plan_id],
|
100
|
+
body: parsed,
|
101
|
+
model: Orb::Plan,
|
102
|
+
options: options
|
103
|
+
)
|
104
|
+
end
|
105
|
+
|
106
|
+
# @api private
|
107
|
+
#
|
108
|
+
# @param client [Orb::Client]
|
109
|
+
def initialize(client:)
|
110
|
+
@client = client
|
111
|
+
@external_plan_id = Orb::Resources::Beta::ExternalPlanID.new(client: client)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
@@ -6,13 +6,13 @@ module Orb
|
|
6
6
|
# This endpoint is used to create a single
|
7
7
|
# [`Credit Note`](/invoicing/credit-notes).
|
8
8
|
#
|
9
|
-
# @overload create(line_items:, memo: nil,
|
9
|
+
# @overload create(line_items:, reason:, memo: nil, request_options: {})
|
10
10
|
#
|
11
11
|
# @param line_items [Array<Orb::Models::CreditNoteCreateParams::LineItem>]
|
12
12
|
#
|
13
|
-
# @param
|
13
|
+
# @param reason [Symbol, Orb::Models::CreditNoteCreateParams::Reason] An optional reason for the credit note.
|
14
14
|
#
|
15
|
-
# @param
|
15
|
+
# @param memo [String, nil] An optional memo to attach to the credit note.
|
16
16
|
#
|
17
17
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
18
18
|
#
|
@@ -58,13 +58,6 @@ module Orb
|
|
58
58
|
# chronological order for a single customer, providing a complete audit trail of
|
59
59
|
# all adjustments and invoice applications.
|
60
60
|
#
|
61
|
-
# ## Eligibility
|
62
|
-
#
|
63
|
-
# The customer balance can only be applied to invoices or adjusted manually if
|
64
|
-
# invoices are not synced to a separate invoicing provider. If a payment gateway
|
65
|
-
# such as Stripe is used, the balance will be applied to the invoice before
|
66
|
-
# forwarding payment to the gateway.
|
67
|
-
#
|
68
61
|
# @overload list(customer_id, cursor: nil, limit: nil, operation_time_gt: nil, operation_time_gte: nil, operation_time_lt: nil, operation_time_lte: nil, request_options: {})
|
69
62
|
#
|
70
63
|
# @param customer_id [String]
|
@@ -60,7 +60,7 @@ module Orb
|
|
60
60
|
#
|
61
61
|
# @param shipping_address [Orb::Models::CustomerCreateParams::ShippingAddress, nil]
|
62
62
|
#
|
63
|
-
# @param tax_configuration [Orb::Models::CustomerCreateParams::TaxConfiguration::Avalara, Orb::Models::CustomerCreateParams::TaxConfiguration::Taxjar, nil]
|
63
|
+
# @param tax_configuration [Orb::Models::CustomerCreateParams::TaxConfiguration::Avalara, Orb::Models::CustomerCreateParams::TaxConfiguration::Taxjar, Orb::Models::CustomerCreateParams::TaxConfiguration::Sphere, nil]
|
64
64
|
#
|
65
65
|
# @param tax_id [Orb::Models::CustomerCreateParams::TaxID, nil] Tax IDs are commonly required to be displayed on customer invoices, which are ad
|
66
66
|
#
|
@@ -125,7 +125,7 @@ module Orb
|
|
125
125
|
#
|
126
126
|
# @param shipping_address [Orb::Models::CustomerUpdateParams::ShippingAddress, nil]
|
127
127
|
#
|
128
|
-
# @param tax_configuration [Orb::Models::CustomerUpdateParams::TaxConfiguration::Avalara, Orb::Models::CustomerUpdateParams::TaxConfiguration::Taxjar, nil]
|
128
|
+
# @param tax_configuration [Orb::Models::CustomerUpdateParams::TaxConfiguration::Avalara, Orb::Models::CustomerUpdateParams::TaxConfiguration::Taxjar, Orb::Models::CustomerUpdateParams::TaxConfiguration::Sphere, nil]
|
129
129
|
#
|
130
130
|
# @param tax_id [Orb::Models::CustomerUpdateParams::TaxID, nil] Tax IDs are commonly required to be displayed on customer invoices, which are ad
|
131
131
|
#
|
@@ -202,10 +202,7 @@ module Orb
|
|
202
202
|
# **Note**: This operation happens asynchronously and can be expected to take a
|
203
203
|
# few minutes to propagate to related resources. However, querying for the
|
204
204
|
# customer on subsequent GET requests while deletion is in process will reflect
|
205
|
-
# its deletion
|
206
|
-
# been fully processed, the customer will not be returned in the API.
|
207
|
-
#
|
208
|
-
# On successful processing, this returns an empty dictionary (`{}`) in the API.
|
205
|
+
# its deletion.
|
209
206
|
#
|
210
207
|
# @overload delete(customer_id, request_options: {})
|
211
208
|
#
|
@@ -364,7 +361,7 @@ module Orb
|
|
364
361
|
#
|
365
362
|
# @param shipping_address [Orb::Models::CustomerUpdateByExternalIDParams::ShippingAddress, nil]
|
366
363
|
#
|
367
|
-
# @param tax_configuration [Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Avalara, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Taxjar, nil]
|
364
|
+
# @param tax_configuration [Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Avalara, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Taxjar, Orb::Models::CustomerUpdateByExternalIDParams::TaxConfiguration::Sphere, nil]
|
368
365
|
#
|
369
366
|
# @param tax_id [Orb::Models::CustomerUpdateByExternalIDParams::TaxID, nil] Tax IDs are commonly required to be displayed on customer invoices, which are ad
|
370
367
|
#
|
@@ -16,7 +16,7 @@ module Orb
|
|
16
16
|
# For example, suppose we have a billable metric that measures the number of
|
17
17
|
# widgets used and we want to charge differently depending on the color of the
|
18
18
|
# widget. We can create a price group with a dimension "color" and two prices: one
|
19
|
-
# that charges
|
19
|
+
# that charges \$10 per red widget and one that charges \$20 per blue widget.
|
20
20
|
#
|
21
21
|
# @overload create(billable_metric_id:, dimensions:, name:, external_dimensional_price_group_id: nil, metadata: nil, request_options: {})
|
22
22
|
#
|
data/lib/orb/resources/items.rb
CHANGED
@@ -3,12 +3,17 @@
|
|
3
3
|
module Orb
|
4
4
|
module Resources
|
5
5
|
class Items
|
6
|
+
# Some parameter documentations has been truncated, see
|
7
|
+
# {Orb::Models::ItemCreateParams} for more details.
|
8
|
+
#
|
6
9
|
# This endpoint is used to create an [Item](/core-concepts#item).
|
7
10
|
#
|
8
|
-
# @overload create(name:, request_options: {})
|
11
|
+
# @overload create(name:, metadata: nil, request_options: {})
|
9
12
|
#
|
10
13
|
# @param name [String] The name of the item.
|
11
14
|
#
|
15
|
+
# @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
|
16
|
+
#
|
12
17
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
13
18
|
#
|
14
19
|
# @return [Orb::Models::Item]
|
@@ -19,13 +24,21 @@ module Orb
|
|
19
24
|
@client.request(method: :post, path: "items", body: parsed, model: Orb::Item, options: options)
|
20
25
|
end
|
21
26
|
|
27
|
+
# Some parameter documentations has been truncated, see
|
28
|
+
# {Orb::Models::ItemUpdateParams} for more details.
|
29
|
+
#
|
22
30
|
# This endpoint can be used to update properties on the Item.
|
23
31
|
#
|
24
|
-
# @overload update(item_id, external_connections: nil, name: nil, request_options: {})
|
32
|
+
# @overload update(item_id, external_connections: nil, metadata: nil, name: nil, request_options: {})
|
25
33
|
#
|
26
34
|
# @param item_id [String]
|
35
|
+
#
|
27
36
|
# @param external_connections [Array<Orb::Models::ItemUpdateParams::ExternalConnection>, nil]
|
37
|
+
#
|
38
|
+
# @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
|
39
|
+
#
|
28
40
|
# @param name [String, nil]
|
41
|
+
#
|
29
42
|
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
30
43
|
#
|
31
44
|
# @return [Orb::Models::Item]
|
@@ -71,6 +84,25 @@ module Orb
|
|
71
84
|
)
|
72
85
|
end
|
73
86
|
|
87
|
+
# Archive item
|
88
|
+
#
|
89
|
+
# @overload archive(item_id, request_options: {})
|
90
|
+
#
|
91
|
+
# @param item_id [String]
|
92
|
+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
93
|
+
#
|
94
|
+
# @return [Orb::Models::Item]
|
95
|
+
#
|
96
|
+
# @see Orb::Models::ItemArchiveParams
|
97
|
+
def archive(item_id, params = {})
|
98
|
+
@client.request(
|
99
|
+
method: :post,
|
100
|
+
path: ["items/%1$s/archive", item_id],
|
101
|
+
model: Orb::Item,
|
102
|
+
options: params[:request_options]
|
103
|
+
)
|
104
|
+
end
|
105
|
+
|
74
106
|
# This endpoint returns an item identified by its item_id.
|
75
107
|
#
|
76
108
|
# @overload fetch(item_id, request_options: {})
|
@@ -10,7 +10,7 @@ module Orb
|
|
10
10
|
# This endpoint can be used to update the `external_plan_id`, and `metadata` of an
|
11
11
|
# existing plan.
|
12
12
|
#
|
13
|
-
# Other fields on a
|
13
|
+
# Other fields on a plan are currently immutable.
|
14
14
|
#
|
15
15
|
# @overload update(other_external_plan_id, external_plan_id: nil, metadata: nil, request_options: {})
|
16
16
|
#
|
data/lib/orb/resources/plans.rb
CHANGED
@@ -17,7 +17,7 @@ module Orb
|
|
17
17
|
#
|
18
18
|
# @param name [String]
|
19
19
|
#
|
20
|
-
# @param prices [Array<Orb::Models::PlanCreateParams::Price::Unit, Orb::Models::PlanCreateParams::Price::Package, Orb::Models::PlanCreateParams::Price::Matrix, Orb::Models::PlanCreateParams::Price::Tiered, Orb::Models::PlanCreateParams::Price::TieredBps, Orb::Models::PlanCreateParams::Price::Bps, Orb::Models::PlanCreateParams::Price::BulkBps, Orb::Models::PlanCreateParams::Price::Bulk, Orb::Models::PlanCreateParams::Price::ThresholdTotalAmount, Orb::Models::PlanCreateParams::Price::TieredPackage, Orb::Models::PlanCreateParams::Price::TieredWithMinimum, Orb::Models::PlanCreateParams::Price::UnitWithPercent, Orb::Models::PlanCreateParams::Price::PackageWithAllocation, Orb::Models::PlanCreateParams::Price::TieredWithProration, Orb::Models::PlanCreateParams::Price::UnitWithProration, Orb::Models::PlanCreateParams::Price::GroupedAllocation, Orb::Models::PlanCreateParams::Price::GroupedWithProratedMinimum, Orb::Models::PlanCreateParams::Price::GroupedWithMeteredMinimum, Orb::Models::PlanCreateParams::Price::MatrixWithDisplayName, Orb::Models::PlanCreateParams::Price::BulkWithProration, Orb::Models::PlanCreateParams::Price::GroupedTieredPackage, Orb::Models::PlanCreateParams::Price::MaxGroupTieredPackage, Orb::Models::PlanCreateParams::Price::ScalableMatrixWithUnitPricing, Orb::Models::PlanCreateParams::Price::ScalableMatrixWithTieredPricing, Orb::Models::PlanCreateParams::Price::CumulativeGroupedBulk>] Prices for this plan. If the plan has phases, this includes prices across all ph
|
20
|
+
# @param prices [Array<Orb::Models::PlanCreateParams::Price::Unit, Orb::Models::PlanCreateParams::Price::Package, Orb::Models::PlanCreateParams::Price::Matrix, Orb::Models::PlanCreateParams::Price::Tiered, Orb::Models::PlanCreateParams::Price::TieredBps, Orb::Models::PlanCreateParams::Price::Bps, Orb::Models::PlanCreateParams::Price::BulkBps, Orb::Models::PlanCreateParams::Price::Bulk, Orb::Models::PlanCreateParams::Price::ThresholdTotalAmount, Orb::Models::PlanCreateParams::Price::TieredPackage, Orb::Models::PlanCreateParams::Price::TieredWithMinimum, Orb::Models::PlanCreateParams::Price::UnitWithPercent, Orb::Models::PlanCreateParams::Price::PackageWithAllocation, Orb::Models::PlanCreateParams::Price::TieredWithProration, Orb::Models::PlanCreateParams::Price::UnitWithProration, Orb::Models::PlanCreateParams::Price::GroupedAllocation, Orb::Models::PlanCreateParams::Price::GroupedWithProratedMinimum, Orb::Models::PlanCreateParams::Price::GroupedWithMeteredMinimum, Orb::Models::PlanCreateParams::Price::MatrixWithDisplayName, Orb::Models::PlanCreateParams::Price::BulkWithProration, Orb::Models::PlanCreateParams::Price::GroupedTieredPackage, Orb::Models::PlanCreateParams::Price::MaxGroupTieredPackage, Orb::Models::PlanCreateParams::Price::ScalableMatrixWithUnitPricing, Orb::Models::PlanCreateParams::Price::ScalableMatrixWithTieredPricing, Orb::Models::PlanCreateParams::Price::CumulativeGroupedBulk, Orb::Models::PlanCreateParams::Price::TieredPackageWithMinimum, Orb::Models::PlanCreateParams::Price::MatrixWithAllocation, Orb::Models::PlanCreateParams::Price::GroupedTiered>] Prices for this plan. If the plan has phases, this includes prices across all ph
|
21
21
|
#
|
22
22
|
# @param default_invoice_memo [String, nil] Free-form text which is available on the invoice PDF and the Orb invoice portal.
|
23
23
|
#
|
@@ -45,7 +45,7 @@ module Orb
|
|
45
45
|
# This endpoint can be used to update the `external_plan_id`, and `metadata` of an
|
46
46
|
# existing plan.
|
47
47
|
#
|
48
|
-
# Other fields on a
|
48
|
+
# Other fields on a plan are currently immutable.
|
49
49
|
#
|
50
50
|
# @overload update(plan_id, external_plan_id: nil, metadata: nil, request_options: {})
|
51
51
|
#
|
data/lib/orb/resources/prices.rb
CHANGED
@@ -10,7 +10,7 @@ module Orb
|
|
10
10
|
# {Orb::Models::PriceCreateParams} for more details.
|
11
11
|
#
|
12
12
|
# This endpoint is used to create a [price](/product-catalog/price-configuration).
|
13
|
-
# A price created using this endpoint is always an add-on, meaning that it
|
13
|
+
# A price created using this endpoint is always an add-on, meaning that it's not
|
14
14
|
# associated with a specific plan and can instead be individually added to
|
15
15
|
# subscriptions, including subscriptions on different plans.
|
16
16
|
#
|
@@ -20,7 +20,7 @@ module Orb
|
|
20
20
|
# See the [Price resource](/product-catalog/price-configuration) for the
|
21
21
|
# specification of different price model configurations possible in this endpoint.
|
22
22
|
#
|
23
|
-
# @overload create(cadence:, currency:, item_id:, model_type:, name:, unit_config:, package_config:, matrix_config:, matrix_with_allocation_config:, tiered_config:, tiered_bps_config:, bps_config:, bulk_bps_config:, bulk_config:, threshold_total_amount_config:, tiered_package_config:, grouped_tiered_config:, max_group_tiered_package_config:, tiered_with_minimum_config:, package_with_allocation_config:, tiered_package_with_minimum_config:, unit_with_percent_config:, tiered_with_proration_config:, unit_with_proration_config:, grouped_allocation_config:, grouped_with_prorated_minimum_config:, grouped_with_metered_minimum_config:, matrix_with_display_name_config:, bulk_with_proration_config:, grouped_tiered_package_config:, scalable_matrix_with_unit_pricing_config:, scalable_matrix_with_tiered_pricing_config:, cumulative_grouped_bulk_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, request_options: {})
|
23
|
+
# @overload create(cadence:, currency:, item_id:, model_type:, name:, unit_config:, package_config:, matrix_config:, matrix_with_allocation_config:, tiered_config:, tiered_bps_config:, bps_config:, bulk_bps_config:, bulk_config:, threshold_total_amount_config:, tiered_package_config:, grouped_tiered_config:, max_group_tiered_package_config:, tiered_with_minimum_config:, package_with_allocation_config:, tiered_package_with_minimum_config:, unit_with_percent_config:, tiered_with_proration_config:, unit_with_proration_config:, grouped_allocation_config:, grouped_with_prorated_minimum_config:, grouped_with_metered_minimum_config:, matrix_with_display_name_config:, bulk_with_proration_config:, grouped_tiered_package_config:, scalable_matrix_with_unit_pricing_config:, scalable_matrix_with_tiered_pricing_config:, cumulative_grouped_bulk_config:, billable_metric_id: nil, billed_in_advance: nil, billing_cycle_configuration: nil, conversion_rate: nil, dimensional_price_configuration: nil, external_price_id: nil, fixed_price_quantity: nil, invoice_grouping_key: nil, invoicing_cycle_configuration: nil, metadata: nil, request_options: {})
|
24
24
|
#
|
25
25
|
# @param cadence [Symbol, Orb::Models::PriceCreateParams::Cadence] The cadence to bill for this price on.
|
26
26
|
#
|
@@ -96,6 +96,8 @@ module Orb
|
|
96
96
|
#
|
97
97
|
# @param conversion_rate [Float, nil] The per unit conversion rate of the price currency to the invoicing currency.
|
98
98
|
#
|
99
|
+
# @param dimensional_price_configuration [Orb::Models::PriceCreateParams::DimensionalPriceConfiguration, nil] For dimensional price: specifies a price group and dimension values
|
100
|
+
#
|
99
101
|
# @param external_price_id [String, nil] An alias for the price.
|
100
102
|
#
|
101
103
|
# @param fixed_price_quantity [Float, nil] If the Price represents a fixed cost, this represents the quantity of units appl
|
@@ -177,6 +179,10 @@ module Orb
|
|
177
179
|
# Some parameter documentations has been truncated, see
|
178
180
|
# {Orb::Models::PriceEvaluateParams} for more details.
|
179
181
|
#
|
182
|
+
# [NOTE] It is recommended to use the `/v1/prices/evaluate` which offers further
|
183
|
+
# functionality, such as multiple prices, inline price definitions, and querying
|
184
|
+
# over preview events.
|
185
|
+
#
|
180
186
|
# This endpoint is used to evaluate the output of a price for a given customer and
|
181
187
|
# time range. It enables filtering and grouping the output using
|
182
188
|
# [computed properties](/extensibility/advanced-metrics#computed-properties),
|
@@ -231,6 +237,67 @@ module Orb
|
|
231
237
|
)
|
232
238
|
end
|
233
239
|
|
240
|
+
# This endpoint is used to evaluate the output of price(s) for a given customer
|
241
|
+
# and time range over either ingested events or preview events. It enables
|
242
|
+
# filtering and grouping the output using
|
243
|
+
# [computed properties](/extensibility/advanced-metrics#computed-properties),
|
244
|
+
# supporting the following workflows:
|
245
|
+
#
|
246
|
+
# 1. Showing detailed usage and costs to the end customer.
|
247
|
+
# 2. Auditing subtotals on invoice line items.
|
248
|
+
#
|
249
|
+
# Prices may either reference existing prices in your Orb account or be defined
|
250
|
+
# inline in the request body. Up to 100 prices can be evaluated in a single
|
251
|
+
# request.
|
252
|
+
#
|
253
|
+
# Price evaluation by default uses ingested events, but you can also provide a
|
254
|
+
# list of preview events to use instead. Up to 500 preview events can be provided
|
255
|
+
# in a single request. When using ingested events, the start of the time range
|
256
|
+
# must be no more than 100 days ago.
|
257
|
+
#
|
258
|
+
# For these workflows, the expressiveness of computed properties in both the
|
259
|
+
# filters and grouping is critical. For example, if you'd like to show your
|
260
|
+
# customer their usage grouped by hour and another property, you can do so with
|
261
|
+
# the following `grouping_keys`:
|
262
|
+
# `["hour_floor_timestamp_millis(timestamp_millis)", "my_property"]`. If you'd
|
263
|
+
# like to examine a customer's usage for a specific property value, you can do so
|
264
|
+
# with the following `filter`:
|
265
|
+
# `my_property = 'foo' AND my_other_property = 'bar'`.
|
266
|
+
#
|
267
|
+
# The length of the results must be no greater than 1000. Note that this is a POST
|
268
|
+
# endpoint rather than a GET endpoint because it employs a JSON body rather than
|
269
|
+
# query parameters.
|
270
|
+
#
|
271
|
+
# @overload evaluate_multiple(timeframe_end:, timeframe_start:, customer_id: nil, events: nil, external_customer_id: nil, price_evaluations: nil, request_options: {})
|
272
|
+
#
|
273
|
+
# @param timeframe_end [Time] The exclusive upper bound for event timestamps
|
274
|
+
#
|
275
|
+
# @param timeframe_start [Time] The inclusive lower bound for event timestamps
|
276
|
+
#
|
277
|
+
# @param customer_id [String, nil] The ID of the customer to which this evaluation is scoped.
|
278
|
+
#
|
279
|
+
# @param events [Array<Orb::Models::PriceEvaluateMultipleParams::Event>, nil] Optional list of preview events to use instead of actual usage data (max 500)
|
280
|
+
#
|
281
|
+
# @param external_customer_id [String, nil] The external customer ID of the customer to which this evaluation is scoped.
|
282
|
+
#
|
283
|
+
# @param price_evaluations [Array<Orb::Models::PriceEvaluateMultipleParams::PriceEvaluation>] List of prices to evaluate (max 100)
|
284
|
+
#
|
285
|
+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
|
286
|
+
#
|
287
|
+
# @return [Orb::Models::PriceEvaluateMultipleResponse]
|
288
|
+
#
|
289
|
+
# @see Orb::Models::PriceEvaluateMultipleParams
|
290
|
+
def evaluate_multiple(params)
|
291
|
+
parsed, options = Orb::PriceEvaluateMultipleParams.dump_request(params)
|
292
|
+
@client.request(
|
293
|
+
method: :post,
|
294
|
+
path: "prices/evaluate",
|
295
|
+
body: parsed,
|
296
|
+
model: Orb::Models::PriceEvaluateMultipleResponse,
|
297
|
+
options: options
|
298
|
+
)
|
299
|
+
end
|
300
|
+
|
234
301
|
# This endpoint returns a price given an identifier.
|
235
302
|
#
|
236
303
|
# @overload fetch(price_id, request_options: {})
|