Class: Sentdm::Resources::Brands
- Inherits:
-
Object
- Object
- Sentdm::Resources::Brands
- Defined in:
- lib/sentdm/resources/brands.rb,
lib/sentdm/resources/brands/campaigns.rb
Overview
Register and manage 10DLC brands for SMS compliance
Defined Under Namespace
Classes: Campaigns
Instance Attribute Summary collapse
-
#campaigns ⇒ Sentdm::Resources::Brands::Campaigns
readonly
Register and manage 10DLC brands for SMS compliance.
Instance Method Summary collapse
-
#create(brand:, test_mode: nil, idempotency_key: nil, request_options: {}) ⇒ Sentdm::Models::APIResponseBrandWithKYC
Some parameter documentations has been truncated, see Models::BrandCreateParams for more details.
-
#delete(brand_id, body:, request_options: {}) ⇒ nil
Delete a brand by ID.
-
#initialize(client:) ⇒ Brands
constructor
private
A new instance of Brands.
-
#list(request_options: {}) ⇒ Sentdm::Models::BrandListResponse
Retrieves all brands for the authenticated customer with information in a flattened structure.
-
#update(brand_id, brand:, test_mode: nil, idempotency_key: nil, request_options: {}) ⇒ Sentdm::Models::APIResponseBrandWithKYC
Some parameter documentations has been truncated, see Models::BrandUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Brands
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 Brands.
124 125 126 127 |
# File 'lib/sentdm/resources/brands.rb', line 124 def initialize(client:) @client = client @campaigns = Sentdm::Resources::Brands::Campaigns.new(client: client) end |
Instance Attribute Details
#campaigns ⇒ Sentdm::Resources::Brands::Campaigns (readonly)
Register and manage 10DLC brands for SMS compliance
9 10 11 |
# File 'lib/sentdm/resources/brands.rb', line 9 def campaigns @campaigns end |
Instance Method Details
#create(brand:, test_mode: nil, idempotency_key: nil, request_options: {}) ⇒ Sentdm::Models::APIResponseBrandWithKYC
Some parameter documentations has been truncated, see Models::BrandCreateParams for more details.
Creates a new brand and associated information. This endpoint automatically sets inheritTcrBrand=false when a brand is created.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/sentdm/resources/brands.rb', line 30 def create(params) parsed, = Sentdm::BrandCreateParams.dump_request(params) header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: "v3/brands", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Sentdm::APIResponseBrandWithKYC, options: ) end |
#delete(brand_id, body:, request_options: {}) ⇒ nil
Delete a brand by ID. The brand must belong to the authenticated customer.
109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/sentdm/resources/brands.rb', line 109 def delete(brand_id, params) parsed, = Sentdm::BrandDeleteParams.dump_request(params) @client.request( method: :delete, path: ["v3/brands/%1$s", brand_id], headers: {"content-type" => "*/*"}, body: parsed[:body], model: NilClass, options: ) end |
#list(request_options: {}) ⇒ Sentdm::Models::BrandListResponse
Retrieves all brands for the authenticated customer with information in a flattened structure. Includes inherited brands if inheritTcrBrand=true.
87 88 89 90 91 92 93 94 |
# File 'lib/sentdm/resources/brands.rb', line 87 def list(params = {}) @client.request( method: :get, path: "v3/brands", model: Sentdm::Models::BrandListResponse, options: params[:request_options] ) end |
#update(brand_id, brand:, test_mode: nil, idempotency_key: nil, request_options: {}) ⇒ Sentdm::Models::APIResponseBrandWithKYC
Some parameter documentations has been truncated, see Models::BrandUpdateParams for more details.
Updates an existing brand and its associated information. Cannot update brands that have already been submitted to TCR or inherited brands.
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/sentdm/resources/brands.rb', line 64 def update(brand_id, params) parsed, = Sentdm::BrandUpdateParams.dump_request(params) header_params = {idempotency_key: "idempotency-key"} @client.request( method: :put, path: ["v3/brands/%1$s", brand_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Sentdm::APIResponseBrandWithKYC, options: ) end |