Sha256: 670cf159088df1b67ff6a4ad11c198eaa371d254c2226ec89f3c016983daf0db

Contents?: true

Size: 1.67 KB

Versions: 3

Compression:

Stored size: 1.67 KB

Contents

# bandwidth
#
# This file was automatically generated by APIMATIC v2.0
# ( https://apimatic.io ).

module Bandwidth
  # BandwidthRateLimitError class.
  class BandwidthRateLimitErrorException < APIException
    # TODO: Write general description for this method
    # @return [String]
    attr_accessor :type

    # TODO: Write general description for this method
    # @return [String]
    attr_accessor :description

    # TODO: Write general description for this method
    # @return [String]
    attr_accessor :id

    # TODO: Write general description for this method
    # @return [String]
    attr_accessor :status

    # TODO: Write general description for this method
    # @return [List of FieldError]
    attr_accessor :field_errors

    # The constructor.
    # @param [String] The reason for raising an exception.
    # @param [HttpResponse] The HttpReponse of the API call.
    def initialize(reason, response)
      super(reason, response)
      hash = APIHelper.json_deserialize(@response.raw_body)
      unbox(hash)
    end

    # Populates this object by extracting properties from a hash.
    # @param [Hash] The deserialized response sent by the server in the
    # response body.
    def unbox(hash)
      @type = hash['type']
      @description = hash['description']
      @id = hash['id']
      @status = hash['status']
      # Parameter is an array, so we need to iterate through it
      @field_errors = nil
      unless hash['fieldErrors'].nil?
        @field_errors = []
        hash['fieldErrors'].each do |structure|
          @field_errors << (FieldError.from_hash(structure) if structure)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bandwidth-sdk-1.0.1 lib/bandwidth/voice_lib/voice/exceptions/bandwidth_rate_limit_error_exception.rb
bandwidth-sdk-1.0.0 lib/bandwidth/voice_lib/voice/exceptions/bandwidth_rate_limit_error_exception.rb
bandwidth-sdk-1.0.0.pre lib/bandwidth/voice_lib/voice/exceptions/bandwidth_rate_limit_error_exception.rb