Class: Telnyx::Resources::Messaging10dlc::PhoneNumberCampaigns
- Inherits:
-
Object
- Object
- Telnyx::Resources::Messaging10dlc::PhoneNumberCampaigns
- Defined in:
- lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb
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.
132 133 134 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 132 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
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 20 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`.
120 121 122 123 124 125 126 127 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 120 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
97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 97 def list(params = {}) parsed, = Telnyx::Messaging10dlc::PhoneNumberCampaignListParams.dump_request(params) @client.request( method: :get, path: "10dlc/phone_number_campaigns", query: parsed.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`.
41 42 43 44 45 46 47 48 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 41 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
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/telnyx/resources/messaging_10dlc/phone_number_campaigns.rb', line 65 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 |