|
| 1 | +// Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | +// Licensed under the MIT License. |
| 3 | + |
| 4 | +#nullable disable |
| 5 | + |
| 6 | +using System; |
| 7 | +using System.ComponentModel; |
| 8 | +using System.Threading; |
| 9 | +using System.Threading.Tasks; |
| 10 | +using Azure.ResourceManager.Elastic.Models; |
| 11 | + |
| 12 | +namespace Azure.ResourceManager.Elastic |
| 13 | +{ |
| 14 | + // Added these methods because the PATCH operation changed to LRO in API version 2025-06-01. |
| 15 | + public partial class ElasticMonitorResource |
| 16 | + { |
| 17 | + /// <summary> |
| 18 | + /// Update a monitor resource. |
| 19 | + /// <list type="bullet"> |
| 20 | + /// <item> |
| 21 | + /// <term>Request Path</term> |
| 22 | + /// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}</description> |
| 23 | + /// </item> |
| 24 | + /// <item> |
| 25 | + /// <term>Operation Id</term> |
| 26 | + /// <description>Monitors_Update</description> |
| 27 | + /// </item> |
| 28 | + /// <item> |
| 29 | + /// <term>Default Api Version</term> |
| 30 | + /// <description>2024-03-01</description> |
| 31 | + /// </item> |
| 32 | + /// <item> |
| 33 | + /// <term>Resource</term> |
| 34 | + /// <description><see cref="ElasticMonitorResource"/></description> |
| 35 | + /// </item> |
| 36 | + /// </list> |
| 37 | + /// </summary> |
| 38 | + /// <param name="patch"> Elastic resource model update parameters. </param> |
| 39 | + /// <param name="cancellationToken"> The cancellation token to use. </param> |
| 40 | + /// <exception cref="ArgumentNullException"> <paramref name="patch"/> is null. </exception> |
| 41 | + [EditorBrowsable(EditorBrowsableState.Never)] |
| 42 | + public virtual async Task<Response<ElasticMonitorResource>> UpdateAsync(ElasticMonitorPatch patch, CancellationToken cancellationToken = default) |
| 43 | + { |
| 44 | + Argument.AssertNotNull(patch, nameof(patch)); |
| 45 | + var response = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken).ConfigureAwait(false); |
| 46 | + return Response.FromValue(new ElasticMonitorResource(Client, response.Value.Data), response.GetRawResponse()); |
| 47 | + } |
| 48 | + |
| 49 | + /// <summary> |
| 50 | + /// Update a monitor resource. |
| 51 | + /// <list type="bullet"> |
| 52 | + /// <item> |
| 53 | + /// <term>Request Path</term> |
| 54 | + /// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}</description> |
| 55 | + /// </item> |
| 56 | + /// <item> |
| 57 | + /// <term>Operation Id</term> |
| 58 | + /// <description>Monitors_Update</description> |
| 59 | + /// </item> |
| 60 | + /// <item> |
| 61 | + /// <term>Default Api Version</term> |
| 62 | + /// <description>2024-03-01</description> |
| 63 | + /// </item> |
| 64 | + /// <item> |
| 65 | + /// <term>Resource</term> |
| 66 | + /// <description><see cref="ElasticMonitorResource"/></description> |
| 67 | + /// </item> |
| 68 | + /// </list> |
| 69 | + /// </summary> |
| 70 | + /// <param name="patch"> Elastic resource model update parameters. </param> |
| 71 | + /// <param name="cancellationToken"> The cancellation token to use. </param> |
| 72 | + /// <exception cref="ArgumentNullException"> <paramref name="patch"/> is null. </exception> |
| 73 | + [EditorBrowsable(EditorBrowsableState.Never)] |
| 74 | + public virtual Response<ElasticMonitorResource> Update(ElasticMonitorPatch patch, CancellationToken cancellationToken = default) |
| 75 | + { |
| 76 | + Argument.AssertNotNull(patch, nameof(patch)); |
| 77 | + var response = Update(WaitUntil.Completed, patch, cancellationToken); |
| 78 | + return Response.FromValue(new ElasticMonitorResource(Client, response.Value.Data), response.GetRawResponse()); |
| 79 | + } |
| 80 | + |
| 81 | + /// <summary> |
| 82 | + /// List all traffic filters associated with your Elastic monitor resource, helping you manage network traffic control. |
| 83 | + /// <list type="bullet"> |
| 84 | + /// <item> |
| 85 | + /// <term>Request Path</term> |
| 86 | + /// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listAllTrafficFilters</description> |
| 87 | + /// </item> |
| 88 | + /// <item> |
| 89 | + /// <term>Operation Id</term> |
| 90 | + /// <description>AllTrafficFilters_List</description> |
| 91 | + /// </item> |
| 92 | + /// <item> |
| 93 | + /// <term>Default Api Version</term> |
| 94 | + /// <description>2025-06-01</description> |
| 95 | + /// </item> |
| 96 | + /// </list> |
| 97 | + /// </summary> |
| 98 | + /// <param name="cancellationToken"> The cancellation token to use. </param> |
| 99 | + [EditorBrowsable(EditorBrowsableState.Never)] |
| 100 | + public virtual async Task<Response<ElasticTrafficFilterListResult>> GetAllTrafficFilterAsync(CancellationToken cancellationToken = default) |
| 101 | + => await GetAllTrafficFiltersAsync(cancellationToken).ConfigureAwait(false); |
| 102 | + |
| 103 | + /// <summary> |
| 104 | + /// List all traffic filters associated with your Elastic monitor resource, helping you manage network traffic control. |
| 105 | + /// <list type="bullet"> |
| 106 | + /// <item> |
| 107 | + /// <term>Request Path</term> |
| 108 | + /// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listAllTrafficFilters</description> |
| 109 | + /// </item> |
| 110 | + /// <item> |
| 111 | + /// <term>Operation Id</term> |
| 112 | + /// <description>AllTrafficFilters_List</description> |
| 113 | + /// </item> |
| 114 | + /// <item> |
| 115 | + /// <term>Default Api Version</term> |
| 116 | + /// <description>2025-06-01</description> |
| 117 | + /// </item> |
| 118 | + /// </list> |
| 119 | + /// </summary> |
| 120 | + /// <param name="cancellationToken"> The cancellation token to use. </param> |
| 121 | + [EditorBrowsable(EditorBrowsableState.Never)] |
| 122 | + public virtual Response<ElasticTrafficFilterListResult> GetAllTrafficFilter(CancellationToken cancellationToken = default) |
| 123 | + => GetAllTrafficFilters(cancellationToken); |
| 124 | + } |
| 125 | +} |
0 commit comments