class Plivo::Resources::BrandInterface
Public Class Methods
Source
# File lib/plivo/resources/brand.rb, line 20 def initialize(client, resource_list_json = nil) @_name = '10dlc/Brand' @_resource_type = Brand @_identifier_string = 'brand_id' super end
Calls superclass method
Plivo::Base::ResourceInterface::new
Public Instance Methods
Source
# File lib/plivo/resources/brand.rb, line 66 def create(options=nil) valid_param?(:options, options, Hash, true) if not options[:brand_alias] raise_invalid_request("brand_alias must be provided") end if not options[:brand_type] raise_invalid_request("brand_type must be provided") end if not options[:profile_uuid] raise_invalid_request("profile_uuid must be provided") end perform_create(options) end
Create a new brand
Source
# File lib/plivo/resources/brand.rb, line 92 def delete(brand_id) valid_param?(:brand_id, brand_id, [String, Symbol], true) perform_delete(brand_id) end
Delete Brand
@param [String] brand_id
Source
Source
# File lib/plivo/resources/brand.rb, line 83 def get_usecases(brand_id) valid_param?(:brand_id, brand_id, [String, Symbol], true) identifier = brand_id + '/usecases' perform_action_with_identifier(identifier, 'GET', nil) end
Get BrandUsecase @param [String] brand_id
Source
# File lib/plivo/resources/brand.rb, line 44 def list(options=nil) return perform_list_without_object if options.nil? params = {} %i[status type limit offset].each do |param| if options.key?(param) && valid_param?(param, options[param], [String, Integer], true) params[param] = options[param] end end if options.key?(:limit) && (options[:limit] > 20 || options[:limit] <= 0) raise_invalid_request('The maximum number of results that can be '\ "fetched is 20. limit can't be more than 20 or less than 1") end if options.key?(:offset) && options[:offset] < 0 raise_invalid_request("Offset can't be negative") end perform_list_without_object(params) end
List all Brand
@param [Hash] options @option options [String] :type @option options [Status] :status @option options [Status] :limit @option options [Status] :offset @return [Hash]