response.d.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import {HttpResponse} from './http_response';
  2. import {Request} from './request';
  3. export class Response<D, E> {
  4. /**
  5. * Whether more pages of data can be returned by further requests.
  6. */
  7. hasNextPage(): boolean;
  8. /**
  9. * Creates a new request for the next page of response data, calling the callback with the page data if a callback is provided.
  10. */
  11. nextPage(): Request<D, E> | null;
  12. nextPage(callback: (err: E, data: D) => void): void;
  13. /**
  14. * The de-serialized response data from the service.
  15. * Can be null if an error occurred.
  16. */
  17. data: D|void
  18. /**
  19. * A structure containing information about a service or networking error.
  20. */
  21. error: E|void
  22. /**
  23. * Returns the unique request ID associated with the response.
  24. * Log this value when debugging requests for AWS support.
  25. */
  26. requestId: string
  27. /**
  28. * The number of redirects that were followed before the request was completed.
  29. */
  30. redirectCount: number
  31. /**
  32. * The number of retries that were attempted before the request was completed.
  33. */
  34. retryCount: number
  35. /**
  36. * The raw HTTP response object containing the response headers and body information from the server.
  37. */
  38. httpResponse: HttpResponse;
  39. }