/
TagResource.cs
70 lines (66 loc) · 4.16 KB
/
TagResource.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#nullable disable
using System;
using System.Threading;
using System.Threading.Tasks;
using Azure.Core;
using Azure.ResourceManager.Resources.Models;
namespace Azure.ResourceManager.Resources
{
/// <summary>
/// A Class representing a TagResource along with the instance operations that can be performed on it.
/// If you have a <see cref="ResourceIdentifier" /> you can construct a <see cref="TagResource" />
/// from an instance of <see cref="ArmClient" /> using the GetTagResource method.
/// Otherwise you can get one from its parent resource <see cref="ArmResource" /> using the GetTagResource method.
/// </summary>
public partial class TagResource : ArmResource
{
/// <summary>
/// This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{scope}/providers/Microsoft.Resources/tags/default</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Tags_UpdateAtScope</description>
/// </item>
/// </list>
/// </summary>
/// <param name="patch"> The TagResourcePatch to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="patch"/> is null. </exception>
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This method is obsolete and will be removed in a future release.", false)]
public virtual async Task<Response<TagResource>> UpdateAsync(TagResourcePatch patch, CancellationToken cancellationToken = default)
{
var operation = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken).ConfigureAwait(false);
return Response.FromValue(operation.Value, operation.GetRawResponse());
}
/// <summary>
/// This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs.
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/{scope}/providers/Microsoft.Resources/tags/default</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>Tags_UpdateAtScope</description>
/// </item>
/// </list>
/// </summary>
/// <param name="patch"> The TagResourcePatch to use. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="patch"/> is null. </exception>
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This method is obsolete and will be removed in a future release.", false)]
public virtual Response<TagResource> Update(TagResourcePatch patch, CancellationToken cancellationToken = default)
{
var operation = Update(WaitUntil.Completed, patch, cancellationToken);
return Response.FromValue(operation.Value, operation.GetRawResponse());
}
}
}