Class: MetronomeSDK::Resources::V1::Plans
- Inherits:
-
Object
- Object
- MetronomeSDK::Resources::V1::Plans
- Defined in:
- lib/metronome_sdk/resources/v1/plans.rb
Instance Method Summary collapse
-
#get_details(plan_id: , request_options: {}) ⇒ MetronomeSDK::Models::V1::PlanGetDetailsResponse
Fetch high level details of a specific plan.
-
#initialize(client:) ⇒ Plans
constructor
private
A new instance of Plans.
-
#list(limit: nil, next_page: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::PlanListResponse>
List all available plans.
-
#list_charges(plan_id: , limit: nil, next_page: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::PlanListChargesResponse>
Fetches a list of charges of a specific plan.
-
#list_customers(plan_id: , limit: nil, next_page: nil, status: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::PlanListCustomersResponse>
Some parameter documentations has been truncated, see Models::V1::PlanListCustomersParams for more details.
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.
131 132 133 |
# File 'lib/metronome_sdk/resources/v1/plans.rb', line 131 def initialize(client:) @client = client end |
Instance Method Details
#get_details(plan_id: , request_options: {}) ⇒ MetronomeSDK::Models::V1::PlanGetDetailsResponse
Fetch high level details of a specific plan. This is a Plans (deprecated) endpoint. New clients should implement using Contracts.
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/metronome_sdk/resources/v1/plans.rb', line 44 def get_details(params) parsed, = MetronomeSDK::V1::PlanGetDetailsParams.dump_request(params) plan_id = parsed.delete(:plan_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["v1/planDetails/%1$s", plan_id], model: MetronomeSDK::Models::V1::PlanGetDetailsResponse, options: ) end |
#list(limit: nil, next_page: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::PlanListResponse>
List all available plans. This is a Plans (deprecated) endpoint. New clients should implement using Contracts.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/metronome_sdk/resources/v1/plans.rb', line 21 def list(params = {}) parsed, = MetronomeSDK::V1::PlanListParams.dump_request(params) @client.request( method: :get, path: "v1/plans", query: parsed, page: MetronomeSDK::Internal::CursorPage, model: MetronomeSDK::Models::V1::PlanListResponse, options: ) end |
#list_charges(plan_id: , limit: nil, next_page: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::PlanListChargesResponse>
Fetches a list of charges of a specific plan. This is a Plans (deprecated) endpoint. New clients should implement using Contracts.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/metronome_sdk/resources/v1/plans.rb', line 74 def list_charges(params) parsed, = MetronomeSDK::V1::PlanListChargesParams.dump_request(params) plan_id = parsed.delete(:plan_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["v1/planDetails/%1$s/charges", plan_id], query: parsed, page: MetronomeSDK::Internal::CursorPage, model: MetronomeSDK::Models::V1::PlanListChargesResponse, options: ) end |
#list_customers(plan_id: , limit: nil, next_page: nil, status: nil, request_options: {}) ⇒ MetronomeSDK::Internal::CursorPage<MetronomeSDK::Models::V1::PlanListCustomersResponse>
Some parameter documentations has been truncated, see Models::V1::PlanListCustomersParams for more details.
Fetches a list of customers on a specific plan (by default, only currently active plans are included). This is a Plans (deprecated) endpoint. New clients should implement using Contracts.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/metronome_sdk/resources/v1/plans.rb', line 112 def list_customers(params) parsed, = MetronomeSDK::V1::PlanListCustomersParams.dump_request(params) plan_id = parsed.delete(:plan_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["v1/planDetails/%1$s/customers", plan_id], query: parsed, page: MetronomeSDK::Internal::CursorPage, model: MetronomeSDK::Models::V1::PlanListCustomersResponse, options: ) end |