def parse_response(response:, params: nil, body: {})
      if response.code < 299
        body[:data] = parse_json(response.body)
        body[:success] = true
      else
        error = write_error_message(response)
        body[:error] = error
        body[:success] = false
      end
      body[:code] = response.code
      body.merge!(raw: { body: response.body, params: params })
    end
def parse_response(response:, params: nil, body: {})
      if response.code < 299
        body[:data] = parse_json(response.body)
        body[:success] = true
      else
        error = write_error_message(response)
        body[:error] = error
        body[:success] = false
      end
      body[:code] = response.code
      body.merge!(raw: { body: response.body, params: params })
    end
rubocop:enable Metrics/MethodLength