Example #1
0
 /// <summary>
 /// Retrieves the list of snoozed or dismissed suppressions for a subscription.
 /// The snoozed or dismissed attribute of a recommendation is referred to as a
 /// suppression.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='top'>
 /// The number of suppressions per page if a paged version of this API is being
 /// used.
 /// </param>
 /// <param name='skipToken'>
 /// The page-continuation token to use with a paged version of this API.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <SuppressionContract> > ListAsync(this ISuppressionsOperations operations, int?top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(top, skipToken, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #2
0
 /// <summary>
 /// Obtains the details of a suppression.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceUri'>
 /// The fully qualified Azure Resource Manager identifier of the resource to
 /// which the recommendation applies.
 /// </param>
 /// <param name='recommendationId'>
 /// The recommendation ID.
 /// </param>
 /// <param name='name'>
 /// The name of the suppression.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <SuppressionContract> GetAsync(this ISuppressionsOperations operations, string resourceUri, string recommendationId, string name, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, recommendationId, name, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #3
0
 /// <summary>
 /// Retrieves the list of snoozed or dismissed suppressions for a subscription.
 /// The snoozed or dismissed attribute of a recommendation is referred to as a
 /// suppression.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <SuppressionContract> > ListNextAsync(this ISuppressionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     RecommendationMetadata = new RecommendationMetadataOperations(this);
     Configurations         = new ConfigurationsOperations(this);
     Recommendations        = new RecommendationsOperations(this);
     Operations             = new Operations(this);
     Suppressions           = new SuppressionsOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2017-04-19";
     AcceptLanguage = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     SerializationSettings            = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
Example #5
0
 /// <summary>
 /// Enables the snoozed or dismissed attribute of a recommendation. The snoozed
 /// or dismissed attribute is referred to as a suppression. Use this API to
 /// create or update the snoozed or dismissed status of a recommendation.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceUri'>
 /// The fully qualified Azure Resource Manager identifier of the resource to
 /// which the recommendation applies.
 /// </param>
 /// <param name='recommendationId'>
 /// The recommendation ID.
 /// </param>
 /// <param name='name'>
 /// The name of the suppression.
 /// </param>
 /// <param name='suppressionContract'>
 /// The snoozed or dismissed attribute; for example, the snooze duration.
 /// </param>
 public static SuppressionContract Create(this ISuppressionsOperations operations, string resourceUri, string recommendationId, string name, SuppressionContract suppressionContract)
 {
     return(operations.CreateAsync(resourceUri, recommendationId, name, suppressionContract).GetAwaiter().GetResult());
 }
Example #6
0
 /// <summary>
 /// Obtains the details of a suppression.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceUri'>
 /// The fully qualified Azure Resource Manager identifier of the resource to
 /// which the recommendation applies.
 /// </param>
 /// <param name='recommendationId'>
 /// The recommendation ID.
 /// </param>
 /// <param name='name'>
 /// The name of the suppression.
 /// </param>
 public static SuppressionContract Get(this ISuppressionsOperations operations, string resourceUri, string recommendationId, string name)
 {
     return(operations.GetAsync(resourceUri, recommendationId, name).GetAwaiter().GetResult());
 }
Example #7
0
 /// <summary>
 /// Retrieves the list of snoozed or dismissed suppressions for a subscription.
 /// The snoozed or dismissed attribute of a recommendation is referred to as a
 /// suppression.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <SuppressionContract> ListNext(this ISuppressionsOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
Example #8
0
 /// <summary>
 /// Retrieves the list of snoozed or dismissed suppressions for a subscription.
 /// The snoozed or dismissed attribute of a recommendation is referred to as a
 /// suppression.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='top'>
 /// The number of suppressions per page if a paged version of this API is being
 /// used.
 /// </param>
 /// <param name='skipToken'>
 /// The page-continuation token to use with a paged version of this API.
 /// </param>
 public static IPage <SuppressionContract> List(this ISuppressionsOperations operations, int?top = default(int?), string skipToken = default(string))
 {
     return(operations.ListAsync(top, skipToken).GetAwaiter().GetResult());
 }
Example #9
0
 /// <summary>
 /// Enables the activation of a snoozed or dismissed recommendation. The
 /// snoozed or dismissed attribute of a recommendation is referred to as a
 /// suppression.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceUri'>
 /// The fully qualified Azure Resource Manager identifier of the resource to
 /// which the recommendation applies.
 /// </param>
 /// <param name='recommendationId'>
 /// The recommendation ID.
 /// </param>
 /// <param name='name'>
 /// The name of the suppression.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this ISuppressionsOperations operations, string resourceUri, string recommendationId, string name, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceUri, recommendationId, name, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Example #10
0
 /// <summary>
 /// Enables the activation of a snoozed or dismissed recommendation. The
 /// snoozed or dismissed attribute of a recommendation is referred to as a
 /// suppression.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceUri'>
 /// The fully qualified Azure Resource Manager identifier of the resource to
 /// which the recommendation applies.
 /// </param>
 /// <param name='recommendationId'>
 /// The recommendation ID.
 /// </param>
 /// <param name='name'>
 /// The name of the suppression.
 /// </param>
 public static void Delete(this ISuppressionsOperations operations, string resourceUri, string recommendationId, string name)
 {
     operations.DeleteAsync(resourceUri, recommendationId, name).GetAwaiter().GetResult();
 }