Class: Stripe::V2::Billing::RateCardService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::V2::Billing::RateCardService
- Defined in:
- lib/stripe/services/v2/billing/rate_card_service.rb
Instance Attribute Summary collapse
-
#custom_pricing_unit_overage_rates ⇒ Object
readonly
Returns the value of attribute custom_pricing_unit_overage_rates.
-
#rates ⇒ Object
readonly
Returns the value of attribute rates.
-
#versions ⇒ Object
readonly
Returns the value of attribute versions.
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Object
Create a Rate Card object.
-
#initialize(requestor) ⇒ RateCardService
constructor
A new instance of RateCardService.
-
#list(params = {}, opts = {}) ⇒ Object
List all Rate Card objects.
-
#modify_rates(id, params = {}, opts = {}) ⇒ Object
Creates, updates, and/or deletes multiple Rates on a Rate Card atomically.
-
#retrieve(id, params = {}, opts = {}) ⇒ Object
Retrieve the latest version of a Rate Card object.
-
#update(id, params = {}, opts = {}) ⇒ Object
Update a Rate Card object.
Methods inherited from StripeService
Constructor Details
#initialize(requestor) ⇒ RateCardService
Returns a new instance of RateCardService.
10 11 12 13 14 15 16 |
# File 'lib/stripe/services/v2/billing/rate_card_service.rb', line 10 def initialize(requestor) super @custom_pricing_unit_overage_rates = Stripe::V2::Billing::RateCards::CustomPricingUnitOverageRateService .new(@requestor) @rates = Stripe::V2::Billing::RateCards::RateService.new(@requestor) @versions = Stripe::V2::Billing::RateCards::VersionService.new(@requestor) end |
Instance Attribute Details
#custom_pricing_unit_overage_rates ⇒ Object (readonly)
Returns the value of attribute custom_pricing_unit_overage_rates.
8 9 10 |
# File 'lib/stripe/services/v2/billing/rate_card_service.rb', line 8 def custom_pricing_unit_overage_rates @custom_pricing_unit_overage_rates end |
#rates ⇒ Object (readonly)
Returns the value of attribute rates.
8 9 10 |
# File 'lib/stripe/services/v2/billing/rate_card_service.rb', line 8 def rates @rates end |
#versions ⇒ Object (readonly)
Returns the value of attribute versions.
8 9 10 |
# File 'lib/stripe/services/v2/billing/rate_card_service.rb', line 8 def versions @versions end |
Instance Method Details
#create(params = {}, opts = {}) ⇒ Object
Create a Rate Card object.
19 20 21 22 23 24 25 26 27 |
# File 'lib/stripe/services/v2/billing/rate_card_service.rb', line 19 def create(params = {}, opts = {}) request( method: :post, path: "/v2/billing/rate_cards", params: params, opts: opts, base_address: :api ) end |
#list(params = {}, opts = {}) ⇒ Object
List all Rate Card objects.
30 31 32 33 34 35 36 37 38 |
# File 'lib/stripe/services/v2/billing/rate_card_service.rb', line 30 def list(params = {}, opts = {}) request( method: :get, path: "/v2/billing/rate_cards", params: params, opts: opts, base_address: :api ) end |
#modify_rates(id, params = {}, opts = {}) ⇒ Object
Creates, updates, and/or deletes multiple Rates on a Rate Card atomically.
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/stripe/services/v2/billing/rate_card_service.rb', line 41 def modify_rates(id, params = {}, opts = {}) unless params.is_a?(Stripe::RequestParams) params = V2::Billing::RateCardModifyRatesParams.coerce_params(params) end request( method: :post, path: format("/v2/billing/rate_cards/%<id>s/modify_rates", { id: CGI.escape(id) }), params: params, opts: opts, base_address: :api ) end |
#retrieve(id, params = {}, opts = {}) ⇒ Object
Retrieve the latest version of a Rate Card object.
56 57 58 59 60 61 62 63 64 |
# File 'lib/stripe/services/v2/billing/rate_card_service.rb', line 56 def retrieve(id, params = {}, opts = {}) request( method: :get, path: format("/v2/billing/rate_cards/%<id>s", { id: CGI.escape(id) }), params: params, opts: opts, base_address: :api ) end |
#update(id, params = {}, opts = {}) ⇒ Object
Update a Rate Card object.
67 68 69 70 71 72 73 74 75 |
# File 'lib/stripe/services/v2/billing/rate_card_service.rb', line 67 def update(id, params = {}, opts = {}) request( method: :post, path: format("/v2/billing/rate_cards/%<id>s", { id: CGI.escape(id) }), params: params, opts: opts, base_address: :api ) end |