apiKeyCredentials.d.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { WebResource } from "../webResource";
  2. import { ServiceClientCredentials } from "./serviceClientCredentials";
  3. /**
  4. * @interface ApiKeyCredentialOptions
  5. * Describes the options to be provided while creating an instance of ApiKeyCredentials
  6. */
  7. export interface ApiKeyCredentialOptions {
  8. /**
  9. * A key value pair of the header parameters that need to be applied to the request.
  10. */
  11. inHeader?: {
  12. [x: string]: any;
  13. };
  14. /**
  15. * A key value pair of the query parameters that need to be applied to the request.
  16. */
  17. inQuery?: {
  18. [x: string]: any;
  19. };
  20. }
  21. /**
  22. * Authenticates to a service using an API key.
  23. */
  24. export declare class ApiKeyCredentials implements ServiceClientCredentials {
  25. /**
  26. * A key value pair of the header parameters that need to be applied to the request.
  27. */
  28. private readonly inHeader?;
  29. /**
  30. * A key value pair of the query parameters that need to be applied to the request.
  31. */
  32. private readonly inQuery?;
  33. /**
  34. * @constructor
  35. * @param {object} options Specifies the options to be provided for auth. Either header or query needs to be provided.
  36. */
  37. constructor(options: ApiKeyCredentialOptions);
  38. /**
  39. * Signs a request with the values provided in the inHeader and inQuery parameter.
  40. *
  41. * @param {WebResource} webResource The WebResource to be signed.
  42. * @returns {Promise<WebResource>} The signed request object.
  43. */
  44. signRequest(webResource: WebResource): Promise<WebResource>;
  45. }
  46. //# sourceMappingURL=apiKeyCredentials.d.ts.map