UNPKG

7.68 kBTypeScriptView Raw
1import basem = require('./ClientApiBases');
2import VsoBaseInterfaces = require('./interfaces/common/VsoBaseInterfaces');
3import ManagementInterfaces = require("./interfaces/ManagementInterfaces");
4export interface IManagementApi extends basem.ClientApiBase {
5 deleteBillingInfo(organizationId: string): Promise<void>;
6 deleteMeterUsageHistory(organizationId: string): Promise<void>;
7 getBillingInfo(organizationId: string): Promise<ManagementInterfaces.BillingInfo>;
8 saveBillingInfo(billingInfo: ManagementInterfaces.BillingInfo, organizationId: string): Promise<void>;
9 createBillingSnapshot(meterUsage: ManagementInterfaces.MeterUsage): Promise<void>;
10 getBillableCommitterDetails(billingDate?: Date): Promise<ManagementInterfaces.BillableCommitterDetails[]>;
11 getLastMeterUsage(): Promise<ManagementInterfaces.MeterUsage>;
12 getMeterUsage(billingDate?: Date): Promise<ManagementInterfaces.MeterUsage>;
13 getOrgEnablementStatus(includeAllProperties?: boolean): Promise<ManagementInterfaces.AdvSecEnablementSettings>;
14 updateOrgEnablementStatus(savedAdvSecEnablementStatus: ManagementInterfaces.AdvSecEnablementSettingsUpdate): Promise<void>;
15 getEstimatedOrgBillablePushers(): Promise<string[]>;
16 getProjectEnablementStatus(project: string, includeAllProperties?: boolean): Promise<ManagementInterfaces.AdvSecEnablementSettings>;
17 updateProjectEnablementStatus(savedAdvSecEnablementStatus: ManagementInterfaces.AdvSecEnablementSettingsUpdate, project: string): Promise<void>;
18 getEstimatedProjectBillablePushers(project: string): Promise<string[]>;
19 getRepoEnablementStatus(project: string, repository: string, includeAllProperties?: boolean): Promise<ManagementInterfaces.AdvSecEnablementStatus>;
20 updateRepoAdvSecEnablementStatus(savedAdvSecEnablementStatus: ManagementInterfaces.AdvSecEnablementStatusUpdate, project: string, repository: string): Promise<void>;
21 getEstimatedRepoBillableCommitters(project: string, repository: string): Promise<string[]>;
22}
23export declare class ManagementApi extends basem.ClientApiBase implements IManagementApi {
24 constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], options?: VsoBaseInterfaces.IRequestOptions);
25 /**
26 * Delete the billing info for an organization.
27 *
28 * @param {string} organizationId
29 */
30 deleteBillingInfo(organizationId: string): Promise<void>;
31 /**
32 * Delete the meter usage history from Primary SU for an organization.
33 *
34 * @param {string} organizationId
35 */
36 deleteMeterUsageHistory(organizationId: string): Promise<void>;
37 /**
38 * Get the billing info for an organization.
39 *
40 * @param {string} organizationId - Organization ID to get billing info for.
41 */
42 getBillingInfo(organizationId: string): Promise<ManagementInterfaces.BillingInfo>;
43 /**
44 * Save the billing info for an organization.
45 *
46 * @param {ManagementInterfaces.BillingInfo} billingInfo
47 * @param {string} organizationId
48 */
49 saveBillingInfo(billingInfo: ManagementInterfaces.BillingInfo, organizationId: string): Promise<void>;
50 /**
51 * During multi-org billing computation in primary scale unit(EUS21), this API is used to create billing snapshot for a specific org. Primary scale unit will call this API for each org in different scsle units to create billing snapshot. Data will be stored in the org specific partition DB -> billing snapshot table. This is needed as customers will fetch billing data from their org specific partition DB.
52 *
53 * @param {ManagementInterfaces.MeterUsage} meterUsage
54 */
55 createBillingSnapshot(meterUsage: ManagementInterfaces.MeterUsage): Promise<void>;
56 /**
57 * Get all billable committers details, including those not matched with a VSID.
58 *
59 * @param {Date} billingDate - The date to query, or if not provided, today
60 */
61 getBillableCommitterDetails(billingDate?: Date): Promise<ManagementInterfaces.BillableCommitterDetails[]>;
62 /**
63 */
64 getLastMeterUsage(): Promise<ManagementInterfaces.MeterUsage>;
65 /**
66 * Get commiters used when calculating billing information.
67 *
68 * @param {Date} billingDate - The date to query, or if not provided, today
69 */
70 getMeterUsage(billingDate?: Date): Promise<ManagementInterfaces.MeterUsage>;
71 /**
72 * Get the current status of Advanced Security for the organization
73 *
74 * @param {boolean} includeAllProperties - When true, also determine if pushes are blocked if they contain secrets
75 */
76 getOrgEnablementStatus(includeAllProperties?: boolean): Promise<ManagementInterfaces.AdvSecEnablementSettings>;
77 /**
78 * Update the status of Advanced Security for the organization
79 *
80 * @param {ManagementInterfaces.AdvSecEnablementSettingsUpdate} savedAdvSecEnablementStatus - The new status
81 */
82 updateOrgEnablementStatus(savedAdvSecEnablementStatus: ManagementInterfaces.AdvSecEnablementSettingsUpdate): Promise<void>;
83 /**
84 * Estimate the committers that would be added to the customer's usage if Advanced Security was enabled for this organization.
85 *
86 */
87 getEstimatedOrgBillablePushers(): Promise<string[]>;
88 /**
89 * Get the current status of Advanced Security for a project
90 *
91 * @param {string} project - Project ID or project name
92 * @param {boolean} includeAllProperties - When true, also determine if pushes are blocked if they contain secrets
93 */
94 getProjectEnablementStatus(project: string, includeAllProperties?: boolean): Promise<ManagementInterfaces.AdvSecEnablementSettings>;
95 /**
96 * Update the status of Advanced Security for the project
97 *
98 * @param {ManagementInterfaces.AdvSecEnablementSettingsUpdate} savedAdvSecEnablementStatus - The new status
99 * @param {string} project - Project ID or project name
100 */
101 updateProjectEnablementStatus(savedAdvSecEnablementStatus: ManagementInterfaces.AdvSecEnablementSettingsUpdate, project: string): Promise<void>;
102 /**
103 * Estimate the number of committers that would be added to the customer's usage if Advanced Security was enabled for this project.
104 *
105 * @param {string} project - Project ID or project name
106 */
107 getEstimatedProjectBillablePushers(project: string): Promise<string[]>;
108 /**
109 * Determine if Advanced Security is enabled for a repository
110 *
111 * @param {string} project - Project ID or project name
112 * @param {string} repository - The name or ID of the repository
113 * @param {boolean} includeAllProperties - When true, will also determine if pushes are blocked when secrets are detected
114 */
115 getRepoEnablementStatus(project: string, repository: string, includeAllProperties?: boolean): Promise<ManagementInterfaces.AdvSecEnablementStatus>;
116 /**
117 * Update the enablement of Advanced Security for a repository
118 *
119 * @param {ManagementInterfaces.AdvSecEnablementStatusUpdate} savedAdvSecEnablementStatus - new status
120 * @param {string} project - Project ID or project name
121 * @param {string} repository - Name or ID of the repository
122 */
123 updateRepoAdvSecEnablementStatus(savedAdvSecEnablementStatus: ManagementInterfaces.AdvSecEnablementStatusUpdate, project: string, repository: string): Promise<void>;
124 /**
125 * Estimate the committers that would be added to the customer's usage if Advanced Security was enabled for this repository.
126 *
127 * @param {string} project - Project ID or project name
128 * @param {string} repository - The name or ID of the repository
129 */
130 getEstimatedRepoBillableCommitters(project: string, repository: string): Promise<string[]>;
131}