Class: MetronomeSDK::Resources::V1::Customers::Plans
- Inherits:
-
Object
- Object
- MetronomeSDK::Resources::V1::Customers::Plans
- Defined in:
- lib/metronome_sdk/resources/v1/customers/plans.rb
Instance Method Summary collapse
-
#add(customer_id: , plan_id: , starting_on: , ending_before: nil, net_payment_terms_days: nil, overage_rate_adjustments: nil, price_adjustments: nil, trial_spec: nil, request_options: {}) ⇒ MetronomeSDK::Models::V1::Customers::PlanAddResponse
Some parameter documentations has been truncated, see Models::V1::Customers::PlanAddParams for more details.
-
#end_(customer_id: , customer_plan_id: , ending_before: nil, void_invoices: nil, void_stripe_invoices: nil, request_options: {}) ⇒ MetronomeSDK::Models::V1::Customers::PlanEndResponse
Some parameter documentations has been truncated, see Models::V1::Customers::PlanEndParams for more details.
-
#initialize(client:) ⇒ Plans
constructor
private
A new instance of Plans.
-
#list(customer_id: , limit: nil, next_page: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::Customers::PlanListResponse>
List the given customer’s plans in reverse-chronological order.
-
#list_price_adjustments(customer_id: , customer_plan_id: , limit: nil, next_page: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::Customers::PlanListPriceAdjustmentsResponse>
Lists a customer plans adjustments.
Constructor Details
#initialize(client:) ⇒ Plans
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Plans.
171 172 173 |
# File 'lib/metronome_sdk/resources/v1/customers/plans.rb', line 171 def initialize(client:) @client = client end |
Instance Method Details
#add(customer_id: , plan_id: , starting_on: , ending_before: nil, net_payment_terms_days: nil, overage_rate_adjustments: nil, price_adjustments: nil, trial_spec: nil, request_options: {}) ⇒ MetronomeSDK::Models::V1::Customers::PlanAddResponse
Some parameter documentations has been truncated, see Models::V1::Customers::PlanAddParams for more details.
Associate an existing customer with a plan for a specified date range. See the [price adjustments documentation](plans-docs.metronome.com/pricing/managing-plans/#price-adjustments) for details on the price adjustments. This is a Plans (deprecated) endpoint. New clients should implement using Contracts.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/metronome_sdk/resources/v1/customers/plans.rb', line 71 def add(params) parsed, = MetronomeSDK::V1::Customers::PlanAddParams.dump_request(params) customer_id = parsed.delete(:customer_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["v1/customers/%1$s/plans/add", customer_id], body: parsed, model: MetronomeSDK::Models::V1::Customers::PlanAddResponse, options: ) end |
#end_(customer_id: , customer_plan_id: , ending_before: nil, void_invoices: nil, void_stripe_invoices: nil, request_options: {}) ⇒ MetronomeSDK::Models::V1::Customers::PlanEndResponse
Some parameter documentations has been truncated, see Models::V1::Customers::PlanEndParams for more details.
Change the end date of a customer’s plan. This is a Plans (deprecated) endpoint. New clients should implement using Contracts.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/metronome_sdk/resources/v1/customers/plans.rb', line 109 def end_(params) parsed, = MetronomeSDK::V1::Customers::PlanEndParams.dump_request(params) customer_id = parsed.delete(:customer_id) do raise ArgumentError.new("missing required path argument #{_1}") end customer_plan_id = parsed.delete(:customer_plan_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["v1/customers/%1$s/plans/%2$s/end", customer_id, customer_plan_id], body: parsed, model: MetronomeSDK::Models::V1::Customers::PlanEndResponse, options: ) end |
#list(customer_id: , limit: nil, next_page: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::Customers::PlanListResponse>
List the given customer’s plans in reverse-chronological order. This is a Plans (deprecated) endpoint. New clients should implement using Contracts.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/metronome_sdk/resources/v1/customers/plans.rb', line 24 def list(params) parsed, = MetronomeSDK::V1::Customers::PlanListParams.dump_request(params) customer_id = parsed.delete(:customer_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["v1/customers/%1$s/plans", customer_id], query: parsed, page: MetronomeSDK::Internal::CursorPage, model: MetronomeSDK::Models::V1::Customers::PlanListResponse, options: ) end |
#list_price_adjustments(customer_id: , customer_plan_id: , limit: nil, next_page: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::Customers::PlanListPriceAdjustmentsResponse>
Lists a customer plans adjustments. See the [price adjustments documentation](plans-docs.metronome.com/pricing/managing-plans/#price-adjustments) for details. This is a Plans (deprecated) endpoint. New clients should implement using Contracts.
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/metronome_sdk/resources/v1/customers/plans.rb', line 148 def list_price_adjustments(params) parsed, = MetronomeSDK::V1::Customers::PlanListPriceAdjustmentsParams.dump_request(params) customer_id = parsed.delete(:customer_id) do raise ArgumentError.new("missing required path argument #{_1}") end customer_plan_id = parsed.delete(:customer_plan_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["v1/customers/%1$s/plans/%2$s/priceAdjustments", customer_id, customer_plan_id], query: parsed, page: MetronomeSDK::Internal::CursorPage, model: MetronomeSDK::Models::V1::Customers::PlanListPriceAdjustmentsResponse, options: ) end |