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

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

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:



71
72
73
# File 'lib/telnyx/resources/bundle_pricing/billing_bundles.rb', line 71

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.

Returns a paginated list of the billing bundles available to your account, with support for filtering.

Parameters:

Returns:

See Also:



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

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

Returns the details of a single billing bundle by its ID, so you can inspect its contents before purchasing a user bundle.

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:



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

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