operationParameter.d.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { QueryCollectionFormat } from "./queryCollectionFormat";
  2. import { Mapper } from "./serializer";
  3. export declare type ParameterPath = string | string[] | {
  4. [propertyName: string]: ParameterPath;
  5. };
  6. /**
  7. * A common interface that all Operation parameter's extend.
  8. */
  9. export interface OperationParameter {
  10. /**
  11. * The path to this parameter's value in OperationArguments or the object that contains paths for
  12. * each property's value in OperationArguments.
  13. */
  14. parameterPath: ParameterPath;
  15. /**
  16. * The mapper that defines how to validate and serialize this parameter's value.
  17. */
  18. mapper: Mapper;
  19. }
  20. /**
  21. * A parameter for an operation that will be substituted into the operation's request URL.
  22. */
  23. export interface OperationURLParameter extends OperationParameter {
  24. /**
  25. * Whether or not to skip encoding the URL parameter's value before adding it to the URL.
  26. */
  27. skipEncoding?: boolean;
  28. }
  29. /**
  30. * A parameter for an operation that will be added as a query parameter to the operation's HTTP
  31. * request.
  32. */
  33. export interface OperationQueryParameter extends OperationParameter {
  34. /**
  35. * Whether or not to skip encoding the query parameter's value before adding it to the URL.
  36. */
  37. skipEncoding?: boolean;
  38. /**
  39. * If this query parameter's value is a collection, what type of format should the value be
  40. * converted to.
  41. */
  42. collectionFormat?: QueryCollectionFormat;
  43. }
  44. /**
  45. * Get the path to this parameter's value as a dotted string (a.b.c).
  46. * @param parameter The parameter to get the path string for.
  47. * @returns The path to this parameter's value as a dotted string.
  48. */
  49. export declare function getPathStringFromParameter(parameter: OperationParameter): string;
  50. export declare function getPathStringFromParameterPath(parameterPath: ParameterPath, mapper: Mapper): string;
  51. //# sourceMappingURL=operationParameter.d.ts.map