okhttp.d.ts 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Converts Postman sdk request object to java okhttp code snippet
  3. *
  4. * @module convert
  5. *
  6. * @param {Object} request - postman-SDK request object
  7. * @param {Object} options - Options to tweak code snippet generated in Java-OkHttp
  8. * @param {String} options.indentType - type for indentation eg: Space, Tab
  9. * @param {String} options.indentCount - number of spaces or tabs for indentation.
  10. * @param {Boolean} [options.includeBoilerplate] - indicates whether to include class definition in java
  11. * @param {Boolean} options.followRedirect - whether to enable followredirect
  12. * @param {Boolean} options.trimRequestBody - whether to trim fields in request body or not
  13. * @param {Number} options.requestTimeout : time in milli-seconds after which request will bail out
  14. * @param {Function} callback - callback function with parameters (error, snippet)
  15. */
  16. export function convert(request: any, options: {
  17. indentType: string;
  18. indentCount: string;
  19. includeBoilerplate: boolean;
  20. followRedirect: boolean;
  21. trimRequestBody: boolean;
  22. requestTimeout: number;
  23. }, callback: Function): any;
  24. /**
  25. * Used in order to get options for generation of Java okhattp code snippet (i.e. Include Boilerplate code)
  26. *
  27. * @module getOptions
  28. *
  29. * @returns {Array} Options specific to generation of Java okhattp code snippet
  30. */
  31. export function getOptions(): any[];