Class: Wavix::TenDlc::BrandVettingAppeals::Client
- Inherits:
-
Object
- Object
- Wavix::TenDlc::BrandVettingAppeals::Client
- Defined in:
- lib/wavix/ten_dlc/brand_vetting_appeals/client.rb
Instance Method Summary collapse
-
#create(request_options: {}, **params) ⇒ Wavix::TenDlc::BrandVettingAppeals::Types::CreateBrandVettingAppealsResponse
Submits an appeal for an external vetting of the 10DLC Brand identified by
brand_id. - #initialize(client:) ⇒ void constructor
-
#list(request_options: {}, **params) ⇒ Array[Wavix::Types::TenDlcBrandVettingAppeal]
Returns the external vetting appeals for the 10DLC Brand identified by
brand_id.
Constructor Details
#initialize(client:) ⇒ void
10 11 12 |
# File 'lib/wavix/ten_dlc/brand_vetting_appeals/client.rb', line 10 def initialize(client:) @client = client end |
Instance Method Details
#create(request_options: {}, **params) ⇒ Wavix::TenDlc::BrandVettingAppeals::Types::CreateBrandVettingAppealsResponse
Submits an appeal for an external vetting of the 10DLC Brand identified by brand_id.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/wavix/ten_dlc/brand_vetting_appeals/client.rb', line 58 def create(request_options: {}, **params) params = Wavix::Internal::Types::Utils.normalize_keys(params) request_data = Wavix::TenDlc::BrandVettingAppeals::Types::TenDlcBrandVettingAppealCreateRequest.new(params).to_h non_body_param_names = %w[brand_id] body = request_data.except(*non_body_param_names) request = Wavix::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "v3/10dlc/brands/#{URI.encode_uri_component(params[:brand_id].to_s)}/vettings/appeals", body: body, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Wavix::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Wavix::TenDlc::BrandVettingAppeals::Types::CreateBrandVettingAppealsResponse.load(response.body) else error_class = Wavix::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list(request_options: {}, **params) ⇒ Array[Wavix::Types::TenDlcBrandVettingAppeal]
Returns the external vetting appeals for the 10DLC Brand identified by brand_id.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/wavix/ten_dlc/brand_vetting_appeals/client.rb', line 26 def list(request_options: {}, **params) params = Wavix::Internal::Types::Utils.normalize_keys(params) request = Wavix::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "v3/10dlc/brands/#{URI.encode_uri_component(params[:brand_id].to_s)}/vettings/appeals", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Wavix::Errors::TimeoutError end code = response.code.to_i return if code.between?(200, 299) error_class = Wavix::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end |