Example #1
0
        /// <summary>
        /// Parse the list of SuppressionContract into PsObject list
        /// </summary>
        /// <param name="suppressionContract">List of SuppressionContract to be converted</param>
        /// <returns>List of PsAzureAdvisorSuppressionContract generated</returns>
        internal static List <PsAzureAdvisorSuppressionContract> FromSuppressionContractList(IEnumerable <SuppressionContract> suppressionContract)
        {
            List <PsAzureAdvisorSuppressionContract> psAzureAdvisorSuppressionContractList = new List <PsAzureAdvisorSuppressionContract>();

            foreach (SuppressionContract contract in suppressionContract)
            {
                psAzureAdvisorSuppressionContractList.Add(PsAzureAdvisorSuppressionContract.FromSuppressionContract(contract));
            }

            return(psAzureAdvisorSuppressionContractList);
        }
Example #2
0
        /// <summary>
        /// Parse the SuppressionContract into PsObject list
        /// </summary>
        /// <param name="suppressionContract">SuppressionContract to be converted</param>
        /// <returns>PsAzureAdvisorSuppressionContract generated</returns>
        internal static PsAzureAdvisorSuppressionContract FromSuppressionContract(SuppressionContract suppressionContract)
        {
            if (suppressionContract == null)
            {
                return(null);
            }

            PsAzureAdvisorSuppressionContract psAzureAdvisorSuppressionContract = new PsAzureAdvisorSuppressionContract()
            {
                Id            = suppressionContract.Id,
                Name          = suppressionContract.Name,
                SuppressionId = suppressionContract.SuppressionId,
                Ttl           = suppressionContract.Ttl,
                Type          = suppressionContract.Type,
            };

            return(psAzureAdvisorSuppressionContract);
        }