Skip to content

Commit 6416b4c

Browse files
chore: improve yard docs readability (#197)
1 parent d2e04d6 commit 6416b4c

25 files changed

Lines changed: 745 additions & 1882 deletions

lib/orb/resources/alerts.rb

Lines changed: 44 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ module Resources
55
class Alerts
66
# This endpoint retrieves an alert by its ID.
77
#
8-
# @param alert_id [String]
9-
#
10-
# @param params [Orb::Models::AlertRetrieveParams, Hash{Symbol=>Object}] .
8+
# @overload retrieve(alert_id, request_options: {})
119
#
12-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
10+
# @param alert_id [String]
11+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
1312
#
1413
# @return [Orb::Models::Alert]
1514
#
@@ -25,13 +24,11 @@ def retrieve(alert_id, params = {})
2524

2625
# This endpoint updates the thresholds of an alert.
2726
#
28-
# @param alert_configuration_id [String]
29-
#
30-
# @param params [Orb::Models::AlertUpdateParams, Hash{Symbol=>Object}] .
31-
#
32-
# @option params [Array<Orb::Models::AlertUpdateParams::Threshold>] :thresholds The thresholds that define the values at which the alert will be triggered.
27+
# @overload update(alert_configuration_id, thresholds:, request_options: {})
3328
#
34-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
29+
# @param alert_configuration_id [String]
30+
# @param thresholds [Array<Orb::Models::AlertUpdateParams::Threshold>]
31+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
3532
#
3633
# @return [Orb::Models::Alert]
3734
#
@@ -59,28 +56,18 @@ def update(alert_configuration_id, params)
5956
# This endpoint follows Orb's
6057
# [standardized pagination format](/api-reference/pagination).
6158
#
62-
# @param params [Orb::Models::AlertListParams, Hash{Symbol=>Object}] .
63-
#
64-
# @option params [Time, nil] :created_at_gt
65-
#
66-
# @option params [Time, nil] :created_at_gte
67-
#
68-
# @option params [Time, nil] :created_at_lt
69-
#
70-
# @option params [Time, nil] :created_at_lte
59+
# @overload list(created_at_gt: nil, created_at_gte: nil, created_at_lt: nil, created_at_lte: nil, cursor: nil, customer_id: nil, external_customer_id: nil, limit: nil, subscription_id: nil, request_options: {})
7160
#
72-
# @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned
73-
# from the initial request.
74-
#
75-
# @option params [String, nil] :customer_id Fetch alerts scoped to this customer_id
76-
#
77-
# @option params [String, nil] :external_customer_id Fetch alerts scoped to this external_customer_id
78-
#
79-
# @option params [Integer] :limit The number of items to fetch. Defaults to 20.
80-
#
81-
# @option params [String, nil] :subscription_id Fetch alerts scoped to this subscription_id
82-
#
83-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
61+
# @param created_at_gt [Time, nil]
62+
# @param created_at_gte [Time, nil]
63+
# @param created_at_lt [Time, nil]
64+
# @param created_at_lte [Time, nil]
65+
# @param cursor [String, nil]
66+
# @param customer_id [String, nil]
67+
# @param external_customer_id [String, nil]
68+
# @param limit [Integer]
69+
# @param subscription_id [String, nil]
70+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
8471
#
8572
# @return [Orb::Page<Orb::Models::Alert>]
8673
#
@@ -106,17 +93,13 @@ def list(params = {})
10693
# while `credit_balance_depleted` and `credit_balance_recovered` alerts do not
10794
# require thresholds.
10895
#
109-
# @param customer_id [String]
110-
#
111-
# @param params [Orb::Models::AlertCreateForCustomerParams, Hash{Symbol=>Object}] .
112-
#
113-
# @option params [String] :currency The case sensitive currency or custom pricing unit to use for this alert.
114-
#
115-
# @option params [Symbol, Orb::Models::AlertCreateForCustomerParams::Type] :type The type of alert to create. This must be a valid alert type.
116-
#
117-
# @option params [Array<Orb::Models::AlertCreateForCustomerParams::Threshold>, nil] :thresholds The thresholds that define the values at which the alert will be triggered.
96+
# @overload create_for_customer(customer_id, currency:, type:, thresholds: nil, request_options: {})
11897
#
119-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
98+
# @param customer_id [String]
99+
# @param currency [String]
100+
# @param type [Symbol, Orb::Models::AlertCreateForCustomerParams::Type]
101+
# @param thresholds [Array<Orb::Models::AlertCreateForCustomerParams::Threshold>, nil]
102+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
120103
#
121104
# @return [Orb::Models::Alert]
122105
#
@@ -141,17 +124,13 @@ def create_for_customer(customer_id, params)
141124
# while `credit_balance_depleted` and `credit_balance_recovered` alerts do not
142125
# require thresholds.
143126
#
144-
# @param external_customer_id [String]
145-
#
146-
# @param params [Orb::Models::AlertCreateForExternalCustomerParams, Hash{Symbol=>Object}] .
147-
#
148-
# @option params [String] :currency The case sensitive currency or custom pricing unit to use for this alert.
149-
#
150-
# @option params [Symbol, Orb::Models::AlertCreateForExternalCustomerParams::Type] :type The type of alert to create. This must be a valid alert type.
151-
#
152-
# @option params [Array<Orb::Models::AlertCreateForExternalCustomerParams::Threshold>, nil] :thresholds The thresholds that define the values at which the alert will be triggered.
127+
# @overload create_for_external_customer(external_customer_id, currency:, type:, thresholds: nil, request_options: {})
153128
#
154-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
129+
# @param external_customer_id [String]
130+
# @param currency [String]
131+
# @param type [Symbol, Orb::Models::AlertCreateForExternalCustomerParams::Type]
132+
# @param thresholds [Array<Orb::Models::AlertCreateForExternalCustomerParams::Threshold>, nil]
133+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
155134
#
156135
# @return [Orb::Models::Alert]
157136
#
@@ -179,17 +158,13 @@ def create_for_external_customer(external_customer_id, params)
179158
# per metric that is a part of the subscription. Alerts are triggered based on
180159
# usage or cost conditions met during the current billing cycle.
181160
#
182-
# @param subscription_id [String]
183-
#
184-
# @param params [Orb::Models::AlertCreateForSubscriptionParams, Hash{Symbol=>Object}] .
185-
#
186-
# @option params [Array<Orb::Models::AlertCreateForSubscriptionParams::Threshold>] :thresholds The thresholds that define the values at which the alert will be triggered.
187-
#
188-
# @option params [Symbol, Orb::Models::AlertCreateForSubscriptionParams::Type] :type The type of alert to create. This must be a valid alert type.
161+
# @overload create_for_subscription(subscription_id, thresholds:, type:, metric_id: nil, request_options: {})
189162
#
190-
# @option params [String, nil] :metric_id The metric to track usage for.
191-
#
192-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
163+
# @param subscription_id [String]
164+
# @param thresholds [Array<Orb::Models::AlertCreateForSubscriptionParams::Threshold>]
165+
# @param type [Symbol, Orb::Models::AlertCreateForSubscriptionParams::Type]
166+
# @param metric_id [String, nil]
167+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
193168
#
194169
# @return [Orb::Models::Alert]
195170
#
@@ -209,13 +184,11 @@ def create_for_subscription(subscription_id, params)
209184
# a specific subscription, you must include the `subscription_id`. The
210185
# `subscription_id` is not required for customer or subscription level alerts.
211186
#
212-
# @param alert_configuration_id [String]
213-
#
214-
# @param params [Orb::Models::AlertDisableParams, Hash{Symbol=>Object}] .
215-
#
216-
# @option params [String, nil] :subscription_id Used to update the status of a plan alert scoped to this subscription_id
187+
# @overload disable(alert_configuration_id, subscription_id: nil, request_options: {})
217188
#
218-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
189+
# @param alert_configuration_id [String]
190+
# @param subscription_id [String, nil]
191+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
219192
#
220193
# @return [Orb::Models::Alert]
221194
#
@@ -235,13 +208,11 @@ def disable(alert_configuration_id, params = {})
235208
# specific subscription, you must include the `subscription_id`. The
236209
# `subscription_id` is not required for customer or subscription level alerts.
237210
#
238-
# @param alert_configuration_id [String]
239-
#
240-
# @param params [Orb::Models::AlertEnableParams, Hash{Symbol=>Object}] .
211+
# @overload enable(alert_configuration_id, subscription_id: nil, request_options: {})
241212
#
242-
# @option params [String, nil] :subscription_id Used to update the status of a plan alert scoped to this subscription_id
243-
#
244-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
213+
# @param alert_configuration_id [String]
214+
# @param subscription_id [String, nil]
215+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
245216
#
246217
# @return [Orb::Models::Alert]
247218
#

lib/orb/resources/coupons.rb

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,13 @@ class Coupons
99
# This endpoint allows the creation of coupons, which can then be redeemed at
1010
# subscription creation or plan change.
1111
#
12-
# @param params [Orb::Models::CouponCreateParams, Hash{Symbol=>Object}] .
12+
# @overload create(discount:, redemption_code:, duration_in_months: nil, max_redemptions: nil, request_options: {})
1313
#
14-
# @option params [Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount, Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount] :discount
15-
#
16-
# @option params [String] :redemption_code This string can be used to redeem this coupon for a given subscription.
17-
#
18-
# @option params [Integer, nil] :duration_in_months This allows for a coupon's discount to apply for a limited time (determined in
19-
# months); a `null` value here means "unlimited time".
20-
#
21-
# @option params [Integer, nil] :max_redemptions The maximum number of redemptions allowed for this coupon before it is
22-
# exhausted;`null` here means "unlimited".
23-
#
24-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
14+
# @param discount [Orb::Models::CouponCreateParams::Discount::NewCouponPercentageDiscount, Orb::Models::CouponCreateParams::Discount::NewCouponAmountDiscount]
15+
# @param redemption_code [String]
16+
# @param duration_in_months [Integer, nil]
17+
# @param max_redemptions [Integer, nil]
18+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
2519
#
2620
# @return [Orb::Models::Coupon]
2721
#
@@ -44,19 +38,13 @@ def create(params)
4438
# the next page of results if they exist. More information about pagination can be
4539
# found in the Pagination-metadata schema.
4640
#
47-
# @param params [Orb::Models::CouponListParams, Hash{Symbol=>Object}] .
48-
#
49-
# @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned
50-
# from the initial request.
51-
#
52-
# @option params [Integer] :limit The number of items to fetch. Defaults to 20.
53-
#
54-
# @option params [String, nil] :redemption_code Filter to coupons matching this redemption code.
41+
# @overload list(cursor: nil, limit: nil, redemption_code: nil, show_archived: nil, request_options: {})
5542
#
56-
# @option params [Boolean, nil] :show_archived Show archived coupons as well (by default, this endpoint only returns active
57-
# coupons).
58-
#
59-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
43+
# @param cursor [String, nil]
44+
# @param limit [Integer]
45+
# @param redemption_code [String, nil]
46+
# @param show_archived [Boolean, nil]
47+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
6048
#
6149
# @return [Orb::Page<Orb::Models::Coupon>]
6250
#
@@ -77,11 +65,10 @@ def list(params = {})
7765
# redeemed, and will be hidden from lists of active coupons. Additionally, once a
7866
# coupon is archived, its redemption code can be reused for a different coupon.
7967
#
80-
# @param coupon_id [String]
81-
#
82-
# @param params [Orb::Models::CouponArchiveParams, Hash{Symbol=>Object}] .
68+
# @overload archive(coupon_id, request_options: {})
8369
#
84-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
70+
# @param coupon_id [String]
71+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
8572
#
8673
# @return [Orb::Models::Coupon]
8774
#
@@ -99,11 +86,10 @@ def archive(coupon_id, params = {})
9986
# code, use the [List coupons](list-coupons) endpoint with the redemption_code
10087
# parameter.
10188
#
102-
# @param coupon_id [String]
103-
#
104-
# @param params [Orb::Models::CouponFetchParams, Hash{Symbol=>Object}] .
89+
# @overload fetch(coupon_id, request_options: {})
10590
#
106-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
91+
# @param coupon_id [String]
92+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
10793
#
10894
# @return [Orb::Models::Coupon]
10995
#

lib/orb/resources/coupons/subscriptions.rb

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ class Subscriptions
99
# the most recently created subscription. For a full discussion of the
1010
# subscription resource, see [Subscription](/core-concepts#subscription).
1111
#
12-
# @param coupon_id [String]
13-
#
14-
# @param params [Orb::Models::Coupons::SubscriptionListParams, Hash{Symbol=>Object}] .
15-
#
16-
# @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned
17-
# from the initial request.
12+
# @overload list(coupon_id, cursor: nil, limit: nil, request_options: {})
1813
#
19-
# @option params [Integer] :limit The number of items to fetch. Defaults to 20.
20-
#
21-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
14+
# @param coupon_id [String]
15+
# @param cursor [String, nil]
16+
# @param limit [Integer]
17+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
2218
#
2319
# @return [Orb::Page<Orb::Models::Subscription>]
2420
#

lib/orb/resources/credit_notes.rb

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@ class CreditNotes
66
# This endpoint is used to create a single
77
# [`Credit Note`](/invoicing/credit-notes).
88
#
9-
# @param params [Orb::Models::CreditNoteCreateParams, Hash{Symbol=>Object}] .
9+
# @overload create(line_items:, memo: nil, reason: nil, request_options: {})
1010
#
11-
# @option params [Array<Orb::Models::CreditNoteCreateParams::LineItem>] :line_items
12-
#
13-
# @option params [String, nil] :memo An optional memo to attach to the credit note.
14-
#
15-
# @option params [Symbol, Orb::Models::CreditNoteCreateParams::Reason, nil] :reason An optional reason for the credit note.
16-
#
17-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
11+
# @param line_items [Array<Orb::Models::CreditNoteCreateParams::LineItem>]
12+
# @param memo [String, nil]
13+
# @param reason [Symbol, Orb::Models::CreditNoteCreateParams::Reason, nil]
14+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
1815
#
1916
# @return [Orb::Models::CreditNote]
2017
#
@@ -34,22 +31,15 @@ def create(params)
3431
# subscription_id, or external_customer_id. The credit notes will be returned in
3532
# reverse chronological order by `creation_time`.
3633
#
37-
# @param params [Orb::Models::CreditNoteListParams, Hash{Symbol=>Object}] .
38-
#
39-
# @option params [Time, nil] :created_at_gt
40-
#
41-
# @option params [Time, nil] :created_at_gte
42-
#
43-
# @option params [Time, nil] :created_at_lt
34+
# @overload list(created_at_gt: nil, created_at_gte: nil, created_at_lt: nil, created_at_lte: nil, cursor: nil, limit: nil, request_options: {})
4435
#
45-
# @option params [Time, nil] :created_at_lte
46-
#
47-
# @option params [String, nil] :cursor Cursor for pagination. This can be populated by the `next_cursor` value returned
48-
# from the initial request.
49-
#
50-
# @option params [Integer] :limit The number of items to fetch. Defaults to 20.
51-
#
52-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
36+
# @param created_at_gt [Time, nil]
37+
# @param created_at_gte [Time, nil]
38+
# @param created_at_lt [Time, nil]
39+
# @param created_at_lte [Time, nil]
40+
# @param cursor [String, nil]
41+
# @param limit [Integer]
42+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
5343
#
5444
# @return [Orb::Page<Orb::Models::CreditNote>]
5545
#
@@ -69,11 +59,10 @@ def list(params = {})
6959
# This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes)
7060
# given an identifier.
7161
#
72-
# @param credit_note_id [String]
73-
#
74-
# @param params [Orb::Models::CreditNoteFetchParams, Hash{Symbol=>Object}] .
62+
# @overload fetch(credit_note_id, request_options: {})
7563
#
76-
# @option params [Orb::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
64+
# @param credit_note_id [String]
65+
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
7766
#
7867
# @return [Orb::Models::CreditNote]
7968
#

0 commit comments

Comments
 (0)