Class: Telnyx::Resources::BundlePricing::BillingBundles

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/bundle_pricing/billing_bundles.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ BillingBundles

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 BillingBundles.

Parameters:



69
70
71
# File 'lib/telnyx/resources/bundle_pricing/billing_bundles.rb', line 69

def initialize(client:)
  @client = client
end

Instance Method Details

#list(filter: nil, page_number: nil, page_size: nil, authorization_bearer: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::BundlePricing::BillingBundleSummary>

Some parameter documentations has been truncated, see Models::BundlePricing::BillingBundleListParams for more details.

Get all allowed bundles.

Parameters:

Returns:

See Also:



51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/telnyx/resources/bundle_pricing/billing_bundles.rb', line 51

def list(params = {})
  query_params = [:filter, :page_number, :page_size]
  parsed, options = Telnyx::BundlePricing::BillingBundleListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :get,
    path: "bundle_pricing/billing_bundles",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    headers: parsed.except(*query_params),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::BundlePricing::BillingBundleSummary,
    options: options
  )
end

#retrieve(bundle_id, authorization_bearer: nil, request_options: {}) ⇒ Telnyx::Models::BundlePricing::BillingBundleRetrieveResponse

Get a single bundle by ID.

Parameters:

  • bundle_id (String)

    Billing bundle’s ID, this is used to identify the billing bundle in the API.

  • authorization_bearer (String)

    Authenticates the request with your Telnyx API V2 KEY

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



20
21
22
23
24
25
26
27
28
29
# File 'lib/telnyx/resources/bundle_pricing/billing_bundles.rb', line 20

def retrieve(bundle_id, params = {})
  parsed, options = Telnyx::BundlePricing::BillingBundleRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["bundle_pricing/billing_bundles/%1$s", bundle_id],
    headers: parsed,
    model: Telnyx::Models::BundlePricing::BillingBundleRetrieveResponse,
    options: options
  )
end