Class: Telnyx::Resources::Messaging10dlc::PhoneNumberCampaigns
- Inherits:
-
Object
- Object
- Telnyx::Resources::Messaging10dlc::PhoneNumberCampaigns
- Defined in:
- lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb
Overview
Phone number campaign assignment
Instance Method Summary collapse
-
#create(campaign_id:, phone_number:, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::PhoneNumberCampaign
Create New Phone Number Campaign.
-
#delete(phone_number, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::PhoneNumberCampaign
This endpoint allows you to remove a campaign assignment from the supplied ‘phoneNumber`.
-
#initialize(client:) ⇒ PhoneNumberCampaigns
constructor
private
A new instance of PhoneNumberCampaigns.
-
#list(filter: nil, page: nil, records_per_page: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::PerPagePaginationV2<Telnyx::Models::Messaging10dlc::PhoneNumberCampaign>
Some parameter documentations has been truncated, see Models::Messaging10dlc::PhoneNumberCampaignListParams for more details.
-
#retrieve(phone_number, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::PhoneNumberCampaign
Retrieve an individual phone number/campaign assignment by ‘phoneNumber`.
-
#update(campaign_phone_number, campaign_id:, phone_number:, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::PhoneNumberCampaign
Create New Phone Number Campaign.
Constructor Details
#initialize(client:) ⇒ PhoneNumberCampaigns
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 PhoneNumberCampaigns.
134 135 136 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 134 def initialize(client:) @client = client end |
Instance Method Details
#create(campaign_id:, phone_number:, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::PhoneNumberCampaign
Create New Phone Number Campaign
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 21 def create(params) parsed, = Telnyx::Messaging10dlc::PhoneNumberCampaignCreateParams.dump_request(params) @client.request( method: :post, path: "10dlc/phone_number_campaigns", body: parsed, model: Telnyx::Messaging10dlc::PhoneNumberCampaign, options: ) end |
#delete(phone_number, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::PhoneNumberCampaign
This endpoint allows you to remove a campaign assignment from the supplied ‘phoneNumber`.
122 123 124 125 126 127 128 129 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 122 def delete(phone_number, params = {}) @client.request( method: :delete, path: ["10dlc/phone_number_campaigns/%1$s", phone_number], model: Telnyx::Messaging10dlc::PhoneNumberCampaign, options: params[:request_options] ) end |
#list(filter: nil, page: nil, records_per_page: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::PerPagePaginationV2<Telnyx::Models::Messaging10dlc::PhoneNumberCampaign>
Some parameter documentations has been truncated, see Models::Messaging10dlc::PhoneNumberCampaignListParams for more details.
List phone number campaigns
98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 98 def list(params = {}) parsed, = Telnyx::Messaging10dlc::PhoneNumberCampaignListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "10dlc/phone_number_campaigns", query: query.transform_keys(records_per_page: "recordsPerPage"), page: Telnyx::Internal::PerPagePaginationV2, model: Telnyx::Messaging10dlc::PhoneNumberCampaign, options: ) end |
#retrieve(phone_number, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::PhoneNumberCampaign
Retrieve an individual phone number/campaign assignment by ‘phoneNumber`.
42 43 44 45 46 47 48 49 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 42 def retrieve(phone_number, params = {}) @client.request( method: :get, path: ["10dlc/phone_number_campaigns/%1$s", phone_number], model: Telnyx::Messaging10dlc::PhoneNumberCampaign, options: params[:request_options] ) end |
#update(campaign_phone_number, campaign_id:, phone_number:, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::PhoneNumberCampaign
Create New Phone Number Campaign
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 66 def update(campaign_phone_number, params) parsed, = Telnyx::Messaging10dlc::PhoneNumberCampaignUpdateParams.dump_request(params) @client.request( method: :put, path: ["10dlc/phone_number_campaigns/%1$s", campaign_phone_number], body: parsed, model: Telnyx::Messaging10dlc::PhoneNumberCampaign, options: ) end |