Class: Telnyx::Resources::BundlePricing::UserBundles
- Inherits:
-
Object
- Object
- Telnyx::Resources::BundlePricing::UserBundles
- Defined in:
- lib/telnyx/resources/bundle_pricing/user_bundles.rb
Instance Method Summary collapse
-
#create(idempotency_key: nil, items: nil, authorization_bearer: nil, request_options: {}) ⇒ Telnyx::Models::BundlePricing::UserBundleCreateResponse
Some parameter documentations has been truncated, see Models::BundlePricing::UserBundleCreateParams for more details.
-
#deactivate(user_bundle_id, authorization_bearer: nil, request_options: {}) ⇒ Telnyx::Models::BundlePricing::UserBundleDeactivateResponse
Deactivates a user bundle by its ID.
-
#initialize(client:) ⇒ UserBundles
constructor
private
A new instance of UserBundles.
-
#list(filter: nil, page_number: nil, page_size: nil, authorization_bearer: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::BundlePricing::UserBundle>
Some parameter documentations has been truncated, see Models::BundlePricing::UserBundleListParams for more details.
-
#list_resources(user_bundle_id, authorization_bearer: nil, request_options: {}) ⇒ Telnyx::Models::BundlePricing::UserBundleListResourcesResponse
Retrieves the resources of a user bundle by its ID.
-
#list_unused(filter: nil, authorization_bearer: nil, request_options: {}) ⇒ Telnyx::Models::BundlePricing::UserBundleListUnusedResponse
Some parameter documentations has been truncated, see Models::BundlePricing::UserBundleListUnusedParams for more details.
-
#retrieve(user_bundle_id, authorization_bearer: nil, request_options: {}) ⇒ Telnyx::Models::BundlePricing::UserBundleRetrieveResponse
Retrieves a user bundle by its ID.
Constructor Details
#initialize(client:) ⇒ UserBundles
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 UserBundles.
178 179 180 |
# File 'lib/telnyx/resources/bundle_pricing/user_bundles.rb', line 178 def initialize(client:) @client = client end |
Instance Method Details
#create(idempotency_key: nil, items: nil, authorization_bearer: nil, request_options: {}) ⇒ Telnyx::Models::BundlePricing::UserBundleCreateResponse
Some parameter documentations has been truncated, see Models::BundlePricing::UserBundleCreateParams for more details.
Creates multiple user bundles for the user.
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/telnyx/resources/bundle_pricing/user_bundles.rb', line 25 def create(params = {}) parsed, = Telnyx::BundlePricing::UserBundleCreateParams.dump_request(params) header_params = {authorization_bearer: "authorization_bearer"} @client.request( method: :post, path: "bundle_pricing/user_bundles/bulk", headers: parsed.slice(*header_params.keys), body: parsed.except(*header_params.keys), model: Telnyx::Models::BundlePricing::UserBundleCreateResponse, options: ) end |
#deactivate(user_bundle_id, authorization_bearer: nil, request_options: {}) ⇒ Telnyx::Models::BundlePricing::UserBundleDeactivateResponse
Deactivates a user bundle by its ID.
110 111 112 113 114 115 116 117 118 119 |
# File 'lib/telnyx/resources/bundle_pricing/user_bundles.rb', line 110 def deactivate(user_bundle_id, params = {}) parsed, = Telnyx::BundlePricing::UserBundleDeactivateParams.dump_request(params) @client.request( method: :delete, path: ["bundle_pricing/user_bundles/%1$s", user_bundle_id], headers: parsed, model: Telnyx::Models::BundlePricing::UserBundleDeactivateResponse, options: ) end |
#list(filter: nil, page_number: nil, page_size: nil, authorization_bearer: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::BundlePricing::UserBundle>
Some parameter documentations has been truncated, see Models::BundlePricing::UserBundleListParams for more details.
Get a paginated list of user bundles.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/telnyx/resources/bundle_pricing/user_bundles.rb', line 82 def list(params = {}) query_params = [:filter, :page_number, :page_size] parsed, = Telnyx::BundlePricing::UserBundleListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "bundle_pricing/user_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::UserBundle, options: ) end |
#list_resources(user_bundle_id, authorization_bearer: nil, request_options: {}) ⇒ Telnyx::Models::BundlePricing::UserBundleListResourcesResponse
Retrieves the resources of a user bundle by its ID.
134 135 136 137 138 139 140 141 142 143 |
# File 'lib/telnyx/resources/bundle_pricing/user_bundles.rb', line 134 def list_resources(user_bundle_id, params = {}) parsed, = Telnyx::BundlePricing::UserBundleListResourcesParams.dump_request(params) @client.request( method: :get, path: ["bundle_pricing/user_bundles/%1$s/resources", user_bundle_id], headers: parsed, model: Telnyx::Models::BundlePricing::UserBundleListResourcesResponse, options: ) end |
#list_unused(filter: nil, authorization_bearer: nil, request_options: {}) ⇒ Telnyx::Models::BundlePricing::UserBundleListUnusedResponse
Some parameter documentations has been truncated, see Models::BundlePricing::UserBundleListUnusedParams for more details.
Returns all user bundles that aren’t in use.
161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/telnyx/resources/bundle_pricing/user_bundles.rb', line 161 def list_unused(params = {}) query_params = [:filter] parsed, = Telnyx::BundlePricing::UserBundleListUnusedParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "bundle_pricing/user_bundles/unused", query: query, headers: parsed.except(*query_params), model: Telnyx::Models::BundlePricing::UserBundleListUnusedResponse, options: ) end |
#retrieve(user_bundle_id, authorization_bearer: nil, request_options: {}) ⇒ Telnyx::Models::BundlePricing::UserBundleRetrieveResponse
Retrieves a user bundle by its ID.
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/telnyx/resources/bundle_pricing/user_bundles.rb', line 51 def retrieve(user_bundle_id, params = {}) parsed, = Telnyx::BundlePricing::UserBundleRetrieveParams.dump_request(params) @client.request( method: :get, path: ["bundle_pricing/user_bundles/%1$s", user_bundle_id], headers: parsed, model: Telnyx::Models::BundlePricing::UserBundleRetrieveResponse, options: ) end |