public async getDeployments()

in api/ReleaseApi.ts [1239:1307]


    public async getDeployments(
        project: string,
        definitionId?: number,
        definitionEnvironmentId?: number,
        createdBy?: string,
        minModifiedTime?: Date,
        maxModifiedTime?: Date,
        deploymentStatus?: ReleaseInterfaces.DeploymentStatus,
        operationStatus?: ReleaseInterfaces.DeploymentOperationStatus,
        latestAttemptsOnly?: boolean,
        queryOrder?: ReleaseInterfaces.ReleaseQueryOrder,
        top?: number,
        continuationToken?: number,
        createdFor?: string,
        minStartedTime?: Date,
        maxStartedTime?: Date,
        sourceBranch?: string
        ): Promise<ReleaseInterfaces.Deployment[]> {

        return new Promise<ReleaseInterfaces.Deployment[]>(async (resolve, reject) => {
            let routeValues: any = {
                project: project
            };

            let queryValues: any = {
                definitionId: definitionId,
                definitionEnvironmentId: definitionEnvironmentId,
                createdBy: createdBy,
                minModifiedTime: minModifiedTime,
                maxModifiedTime: maxModifiedTime,
                deploymentStatus: deploymentStatus,
                operationStatus: operationStatus,
                latestAttemptsOnly: latestAttemptsOnly,
                queryOrder: queryOrder,
                '$top': top,
                continuationToken: continuationToken,
                createdFor: createdFor,
                minStartedTime: minStartedTime,
                maxStartedTime: maxStartedTime,
                sourceBranch: sourceBranch,
            };
            
            try {
                let verData: vsom.ClientVersioningData = await this.vsoClient.getVersioningData(
                    "6.1-preview.2",
                    "Release",
                    "b005ef73-cddc-448e-9ba2-5193bf36b19f",
                    routeValues,
                    queryValues);

                let url: string = verData.requestUrl!;
                let options: restm.IRequestOptions = this.createRequestOptions('application/json', 
                                                                                verData.apiVersion);

                let res: restm.IRestResponse<ReleaseInterfaces.Deployment[]>;
                res = await this.rest.get<ReleaseInterfaces.Deployment[]>(url, options);

                let ret = this.formatResponse(res.result,
                                              ReleaseInterfaces.TypeInfo.Deployment,
                                              true);

                resolve(ret);
                
            }
            catch (err) {
                reject(err);
            }
        });
    }