Skip to content

Commit cf23a8a

Browse files
authored
Rename parameter trust to requireApproval. (Azure#53371)
1 parent 145def2 commit cf23a8a

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

sdk/ai/Azure.AI.Agents.Persistent/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Features Added
66

77
### Breaking Changes
8+
- The `trust` parameter for `MCPApproval` constructor was renamed to `requireApproval`.
89

910
### Bugs Fixed
1011

sdk/ai/Azure.AI.Agents.Persistent/api/Azure.AI.Agents.Persistent.net8.0.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write
823823
public partial class MCPApproval
824824
{
825825
public MCPApproval(Azure.AI.Agents.Persistent.MCPApprovalPerTool perToolApproval) { }
826-
public MCPApproval(string trust) { }
826+
public MCPApproval(string requireApproval) { }
827827
public bool AlwaysRequireApproval { get { throw null; } }
828828
public bool NeverRequireApproval { get { throw null; } }
829829
public Azure.AI.Agents.Persistent.MCPApprovalPerTool PerToolApproval { get { throw null; } }

sdk/ai/Azure.AI.Agents.Persistent/api/Azure.AI.Agents.Persistent.netstandard2.0.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write
823823
public partial class MCPApproval
824824
{
825825
public MCPApproval(Azure.AI.Agents.Persistent.MCPApprovalPerTool perToolApproval) { }
826-
public MCPApproval(string trust) { }
826+
public MCPApproval(string requireApproval) { }
827827
public bool AlwaysRequireApproval { get { throw null; } }
828828
public bool NeverRequireApproval { get { throw null; } }
829829
public Azure.AI.Agents.Persistent.MCPApprovalPerTool PerToolApproval { get { throw null; } }

sdk/ai/Azure.AI.Agents.Persistent/src/Custom/MCPApproval.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ public MCPApproval(MCPApprovalPerTool perToolApproval)
5151
/// <summary>
5252
/// Create an instance of an MCPApproval with trust level, equal for all tools.
5353
/// </summary>
54-
/// <param name="trust">The trust level, can be "always" or "never"</param>
55-
public MCPApproval(string trust)
54+
/// <param name="requireApproval">The approval requirement, can be "always" or "never"</param>
55+
public MCPApproval(string requireApproval)
5656
{
57-
if (!string.Equals(trust, ALWAYS) && !string.Equals(trust, NEVER))
58-
throw new ArgumentException($"The parameter \"trust\" may be only \"{ALWAYS}\" or \"{NEVER}\".");
59-
_forAllToolsApproval = trust;
57+
if (!string.Equals(requireApproval, ALWAYS) && !string.Equals(requireApproval, NEVER))
58+
throw new ArgumentException($"The parameter \"requireApproval\" may be only \"{ALWAYS}\" or \"{NEVER}\".");
59+
_forAllToolsApproval = requireApproval;
6060
}
6161
/// <summary>
6262
/// Return true if we do not trust all tools and always need to ask for approval before sending data to server.

sdk/ai/Azure.AI.Agents.Persistent/tests/UnitTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System;
44
using System.Collections.Generic;
55
using System.Text;
6-
using Microsoft.AspNetCore.Hosting.Server;
76
using NUnit.Framework;
87

98
namespace Azure.AI.Agents.Persistent.Tests
@@ -43,7 +42,7 @@ public void MCPApprovalPerTool()
4342
public void MCPApprovalRaisesString()
4443
{
4544
ArgumentException exc = Assert.Throws<ArgumentException>(() => new MCPApproval("test"));
46-
Assert.That(exc.Message.StartsWith("The parameter \"trust\" may be only \"always\" or \"never\"."), $"Unexpected message {exc.Message}");
45+
Assert.That(exc.Message.StartsWith("The parameter \"requireApproval\" may be only \"always\" or \"never\"."), $"Unexpected message {exc.Message}");
4746
}
4847

4948
[Test]

0 commit comments

Comments
 (0)