Exemple #1
0
        /// <summary>
        /// Returns a list of alerts for a given organization with the specified type.
        /// </summary>
        /// <param name="orgToken">The Whitesource organization token for the target organization.</param>
        /// <param name="alertType">Type of the alert to use to filter the alerts.</param>
        /// <param name="fromDate">An optional parameter that filters alerts after this date.</param>
        /// <param name="toDate">An optional parameter that filters alerts before this date.</param>
        /// <returns>Returns a list of alerts for the given organization token filtered by the specified type.</returns>
        /// <exception cref="WhitesourceRequestException">Thrown if an exception occurs calling Whitesource service.</exception>
        public List <Alert> GetOrganizationAlertsByType(OrgToken orgToken, string alertType, DateTime?fromDate = null, DateTime?toDate = null)
        {
            var request  = new AlertTypeRequest("getOrganizationAlertsByType", UserKey, orgToken: orgToken, alertType: alertType, fromDate: fromDate, toDate: toDate);
            var response = request.MakeRequest <AlertsResponse>(this);

            return(response.Data.Alerts);
        }
Exemple #2
0
        /// <summary>
        /// Returns a list of alerts for a given project with the specified type.
        /// </summary>
        /// <param name="projectToken">The Whitesource project token for the target project.</param>
        /// <param name="alertType">The alert type to use to filter the alerts.</param>
        /// <param name="fromDate">An optional parameter that filters alerts after this date.</param>
        /// <param name="toDate">An optional parameter that filters alerts before this date.</param>
        /// <returns>Returns a list of alerts for the given project token.</returns>
        /// <exception cref="WhitesourceRequestException">Thrown if an exception occurs calling Whitesource service.</exception>
        public List <Alert> GetProjectAlertsByType(ProjectToken projectToken, string alertType, DateTime?fromDate = null, DateTime?toDate = null)
        {
            var request  = new AlertTypeRequest("getProjectAlertsByType", UserKey, projectToken: projectToken, alertType: alertType, fromDate: fromDate, toDate: toDate);
            var response = request.MakeRequest <AlertsResponse>(this);

            return(response.Data.Alerts);
        }