Sha256: 3c5ffed4701faffea65a8efae1b515bb151e8c442102e9363ecea70189ee422d

Contents?: true

Size: 1.1 KB

Versions: 95

Compression:

Stored size: 1.1 KB

Contents

module Plivo
  module Resources
    include Plivo::Utils
    class Pricing < Base::Resource
      def initialize(client, options = nil)
        @_name = 'Pricing'
        @_identifier_string = 'country_iso'
        super
      end

      def to_s
        {
          api_id: @api_id,
          country: @country,
          country_code: @country_code,
          country_iso: @country_iso,
          message: @message,
          phone_numbers: @phone_numbers,
          voice: @voice
        }.to_s
      end
    end

    class PricingInterface < Base::ResourceInterface
      def initialize(client, resource_list_json = nil)
        @_name = 'Pricing'
        @_resource_type = Pricing
        @_identifier_string = 'country_iso'
        super
      end

      # @param [String] country_iso
      def get(country_iso)
        valid_param?(:country_iso, country_iso, [String, Symbol], true)
        unless country_iso.length == 2
          raise_invalid_request('country_iso should be of length 2')
        end
        params = { country_iso: country_iso }
        perform_get_without_identifier(params)
      end
    end
  end
end

Version data entries

95 entries across 95 versions & 1 rubygems

Version Path
plivo-4.61.2 lib/plivo/resources/pricings.rb
plivo-4.61.1 lib/plivo/resources/pricings.rb
plivo-4.61.0 lib/plivo/resources/pricings.rb
plivo-4.60.3 lib/plivo/resources/pricings.rb
plivo-4.60.2 lib/plivo/resources/pricings.rb
plivo-4.60.1 lib/plivo/resources/pricings.rb
plivo-4.60.0 lib/plivo/resources/pricings.rb
plivo-4.59.1 lib/plivo/resources/pricings.rb
plivo-4.59.0 lib/plivo/resources/pricings.rb
plivo-4.56.0 lib/plivo/resources/pricings.rb
plivo-4.55.2 lib/plivo/resources/pricings.rb
plivo-4.55.1 lib/plivo/resources/pricings.rb
plivo-4.55.0 lib/plivo/resources/pricings.rb
plivo-4.54.0 lib/plivo/resources/pricings.rb
plivo-4.53.1 lib/plivo/resources/pricings.rb
plivo-4.53.0 lib/plivo/resources/pricings.rb
plivo-4.52.0 lib/plivo/resources/pricings.rb
plivo-4.51.0 lib/plivo/resources/pricings.rb
plivo-4.50.0 lib/plivo/resources/pricings.rb
plivo-4.49.0 lib/plivo/resources/pricings.rb