Sha256: e462932313395aa49f3b4fe1125064a995e98ea150764c97e1643e3d1dfe990f

Contents?: true

Size: 1.56 KB

Versions: 9

Compression:

Stored size: 1.56 KB

Contents

module Plivo
  module Resources
    include Plivo::Utils
    class Campaign < Base::Resource
      def initialize(client, options = nil)
        @_name = '10dlc/Campaign'
        @_identifier_string = 'campaign_id'
        super
      end
  
      def to_s
        {
          api_id: @api_id,
          campaign: @campaign
        }.to_s
      end
    end
  
    class CampaignInterface < Base::ResourceInterface
      def initialize(client, resource_list_json = nil)
        @_name = '10dlc/Campaign'
        @_resource_type = Campaign
        @_identifier_string = 'campaign_id'
        super
      end
  
        ##
        # Get an Campaign
        # @param [String] campaign_id
        # @return [Campaign] Campaign
      def get(campaign_id)
        valid_param?(:campaign_id, campaign_id, [String, Symbol], true)
        perform_get(campaign_id)
      end
  
        ##
        # List all Campaign
        # @param [Hash] options
        # @option options [String] :brand
        # @option options [Status] :usecase
        # @return [Hash]
      def list(options=nil)
        return perform_list_without_object if options.nil?
  
        params = {}
        %i[usecase brand].each do |param|
          if options.key?(param) && valid_param?(param, options[param],
                                                   [String], true)
            params[param] = options[param]
          end
        end  
        perform_list_without_object(params)
      end
  
        ##
        # Create a new Camapign
      def create(params)
          perform_create(params)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
plivo-4.29.0 lib/plivo/resources/campaign.rb
plivo-4.28.0 lib/plivo/resources/campaign.rb
plivo-4.27.1 lib/plivo/resources/campaign.rb
plivo-4.27.0 lib/plivo/resources/campaign.rb
plivo-4.26.0 lib/plivo/resources/campaign.rb
plivo-4.25.1 lib/plivo/resources/campaign.rb
plivo-4.25.0 lib/plivo/resources/campaign.rb
plivo-4.24.0 lib/plivo/resources/campaign.rb
plivo-4.23.0 lib/plivo/resources/campaign.rb