Sha256: cd9917112c91eea59e7012c25bbb6f5c7107c612aa2fd598d76f84a0fc197f77
Contents?: true
Size: 1.02 KB
Versions: 27
Compression:
Stored size: 1.02 KB
Contents
# bandwidth # # This file was automatically generated by APIMATIC v2.0 # ( https://apimatic.io ). module Bandwidth # Http response received. class ApiResponse attr_reader(:status_code, :reason_phrase, :headers, :raw_body, :request, :data, :errors) # The constructor # @param [HttpResponse] The original, raw response from the api. # @param [Object] The data field specified for the response. # @param [Array<String>] Any errors returned by the server. def initialize(http_response, data: nil, errors: nil) @status_code = http_response.status_code @reason_phrase = http_response.reason_phrase @headers = http_response.headers @raw_body = http_response.raw_body @request = http_response.request @data = data @errors = errors end def success? status_code >= 200 && status_code < 300 end def error? status_code >= 400 && status_code < 600 end end end
Version data entries
27 entries across 27 versions & 1 rubygems