Class: Telnyx::Resources::Messaging10dlc::PhoneNumberCampaigns
- Inherits:
-
Object
- Object
- Telnyx::Resources::Messaging10dlc::PhoneNumberCampaigns
- Defined in:
- lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb,
sig/telnyx/resources/messaging_10dlc/phone_number_campaigns.rbs
Overview
Phone number campaign assignment
Instance Method Summary collapse
-
#create(campaign_id:, phone_number:, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::PhoneNumberCampaign
Assigns a phone number to a 10DLC 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
Replaces the 10DLC campaign assignment for the specified phone number.
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.
138 139 140 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 138 def initialize(client:) @client = client end |
Instance Method Details
#create(campaign_id:, phone_number:, request_options: {}) ⇒ Telnyx::Models::Messaging10dlc::PhoneNumberCampaign
Assigns a phone number to a 10DLC campaign. The assignment controls which registered campaign is used for traffic from that number.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 22 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.
126 127 128 129 130 131 132 133 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 126 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.
Returns phone-number-to-campaign assignments for the authenticated account. Apply the documented filters and pagination parameters to narrow the result set.
101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 101 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.
44 45 46 47 48 49 50 51 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 44 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
Replaces the 10DLC campaign assignment for the specified phone number.
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 68 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 |