Class: Telnyx::Resources::BillingGroups
- Inherits:
-
Object
- Object
- Telnyx::Resources::BillingGroups
- Defined in:
- lib/telnyx/resources/billing_groups.rb
Instance Method Summary collapse
-
#create(name: nil, request_options: {}) ⇒ Telnyx::Models::BillingGroupCreateResponse
Create a billing group.
-
#delete(id, request_options: {}) ⇒ Telnyx::Models::BillingGroupDeleteResponse
Delete a billing group.
-
#initialize(client:) ⇒ BillingGroups
constructor
private
A new instance of BillingGroups.
-
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::BillingGroup>
List all billing groups.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::BillingGroupRetrieveResponse
Get a billing group.
-
#update(id, name: nil, request_options: {}) ⇒ Telnyx::Models::BillingGroupUpdateResponse
Update a billing group.
Constructor Details
#initialize(client:) ⇒ BillingGroups
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 BillingGroups.
118 119 120 |
# File 'lib/telnyx/resources/billing_groups.rb', line 118 def initialize(client:) @client = client end |
Instance Method Details
#create(name: nil, request_options: {}) ⇒ Telnyx::Models::BillingGroupCreateResponse
Create a billing group
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/telnyx/resources/billing_groups.rb', line 17 def create(params = {}) parsed, = Telnyx::BillingGroupCreateParams.dump_request(params) @client.request( method: :post, path: "billing_groups", body: parsed, model: Telnyx::Models::BillingGroupCreateResponse, options: ) end |
#delete(id, request_options: {}) ⇒ Telnyx::Models::BillingGroupDeleteResponse
Delete a billing group
106 107 108 109 110 111 112 113 |
# File 'lib/telnyx/resources/billing_groups.rb', line 106 def delete(id, params = {}) @client.request( method: :delete, path: ["billing_groups/%1$s", id], model: Telnyx::Models::BillingGroupDeleteResponse, options: params[:request_options] ) end |
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::BillingGroup>
List all billing groups
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/telnyx/resources/billing_groups.rb', line 83 def list(params = {}) parsed, = Telnyx::BillingGroupListParams.dump_request(params) @client.request( method: :get, path: "billing_groups", query: parsed.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::BillingGroup, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::BillingGroupRetrieveResponse
Get a billing group
39 40 41 42 43 44 45 46 |
# File 'lib/telnyx/resources/billing_groups.rb', line 39 def retrieve(id, params = {}) @client.request( method: :get, path: ["billing_groups/%1$s", id], model: Telnyx::Models::BillingGroupRetrieveResponse, options: params[:request_options] ) end |
#update(id, name: nil, request_options: {}) ⇒ Telnyx::Models::BillingGroupUpdateResponse
Update a billing group
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/telnyx/resources/billing_groups.rb', line 61 def update(id, params = {}) parsed, = Telnyx::BillingGroupUpdateParams.dump_request(params) @client.request( method: :patch, path: ["billing_groups/%1$s", id], body: parsed, model: Telnyx::Models::BillingGroupUpdateResponse, options: ) end |