subscriptionUtils.d.ts 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import { TokenCredentialsBase } from "../credentials/tokenCredentialsBase";
  2. /**
  3. * @interface UserType Provides information about user type. It can currently be "user" or "servicePrincipal".
  4. */
  5. export declare type UserType = "user" | "servicePrincipal";
  6. /**
  7. * @interface LinkedUser Provides information about a user from the authentication perspective.
  8. */
  9. export interface LinkedUser {
  10. /**
  11. * @property {string} name - The user name. For ApplicationTokenCredentials it can be the clientId or SPN.
  12. */
  13. name: string;
  14. /**
  15. * @property {string} type - The user type. "user" | "servicePrincipal".
  16. */
  17. type: UserType;
  18. }
  19. /**
  20. * @interface LinkedSubscription Provides information about subscription that was found
  21. * during the authentication process. The structure of this type is different from the
  22. * subscription object that one gets by making a request to the ResourceManager API.
  23. */
  24. export interface LinkedSubscription {
  25. /**
  26. * @property {string} tenantId - The tenant that the subscription belongs to.
  27. */
  28. readonly tenantId: string;
  29. /**
  30. * @property {string} user - The user associated with the subscription. This could be a user or a serviceprincipal.
  31. */
  32. readonly user: LinkedUser;
  33. /**
  34. * @property {string} environmentName - The environment name in which the subscription exists.
  35. * Possible values: "AzureCloud", "AzureChinaCloud", "AzureUSGovernment", "AzureGermanCloud" or
  36. * some other custom/internal environment name like "Dogfood".
  37. */
  38. readonly environmentName: string;
  39. /**
  40. * @property {string} name - The display name of the subscription.
  41. */
  42. readonly name: string;
  43. /**
  44. * @property {string} id - The subscription id, usually a GUID.
  45. */
  46. readonly id: string;
  47. /**
  48. * @property {string} authorizationSource - The authorization source of the subscription: "RoleBased",
  49. * "Legacy", "Bypassed"," Direct", "Management". It could also be a comma separated string containing
  50. * more values "Bypassed, Direct, Management".
  51. */
  52. readonly authorizationSource: string;
  53. /**
  54. * @property {string} state - The state of the subscription. Example values: "Enabled", "Disabled",
  55. * "Warned", "PastDue", "Deleted".
  56. */
  57. readonly state: string;
  58. /**
  59. * @property {any} any Placeholder for unknown properties.
  60. */
  61. readonly [x: string]: any;
  62. }
  63. /**
  64. * Builds an array of tenantIds.
  65. * @param {TokenCredentialsBase} credentials The credentials.
  66. * @param {string} apiVersion default value 2016-06-01
  67. * @returns {Promise<string[]>} resolves to an array of tenantIds and rejects with an error.
  68. */
  69. export declare function buildTenantList(credentials: TokenCredentialsBase, apiVersion?: string): Promise<string[]>;
  70. export declare function getSubscriptionsFromTenants(credentials: TokenCredentialsBase, tenantList: string[], apiVersion?: string): Promise<LinkedSubscription[]>;
  71. //# sourceMappingURL=subscriptionUtils.d.ts.map