Skip to content

Commit 386d829

Browse files
authored
API feedback (Azure#50734)
1 parent 81f6bb2 commit 386d829

File tree

4 files changed

+3
-30
lines changed

4 files changed

+3
-30
lines changed

sdk/core/Azure.Core/tests/samples/PipelineSamples.cs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -68,33 +68,6 @@ public override void OnSendingRequest(HttpMessage message)
6868
}
6969
#endregion
7070

71-
#region Snippet:RemoveUserAgentPolicy
72-
public class RemoveUserAgentPolicy : HttpPipelineSynchronousPolicy
73-
{
74-
public override void OnSendingRequest(HttpMessage message)
75-
{
76-
message.Request.Headers.Remove(HttpHeader.Names.UserAgent);
77-
}
78-
}
79-
#endregion
80-
81-
public void RemoveUserAgentUse()
82-
{
83-
#region Snippet:RemoveUserAgentPolicyUse
84-
Uri serviceEndpoint = new Uri("https://example.contoso.com");
85-
#if SNIPPET
86-
TokenCredential credential = new DefaultAzureCredential();
87-
#else
88-
TokenCredential credential = Mock.Of<TokenCredential>();
89-
#endif
90-
91-
SampleClientOptions clientOptions = new SampleClientOptions();
92-
clientOptions.AddPolicy(new RemoveUserAgentPolicy(), HttpPipelinePosition.PerRetry);
93-
94-
SampleClient client = new SampleClient(serviceEndpoint, credential, clientOptions);
95-
#endregion
96-
}
97-
9871
private class RequestFailedDetailsParserSample
9972
{
10073
public SampleClientOptions options;

sdk/core/System.ClientModel/api/System.ClientModel.net8.0.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected AuthenticationPolicy() { }
9696
public partial class AuthenticationToken
9797
{
9898
public AuthenticationToken(string tokenValue, string tokenType, System.DateTimeOffset expiresOn, System.DateTimeOffset? refreshOn = default(System.DateTimeOffset?)) { }
99-
public System.DateTimeOffset ExpiresOn { get { throw null; } }
99+
public System.DateTimeOffset? ExpiresOn { get { throw null; } }
100100
public System.DateTimeOffset? RefreshOn { get { throw null; } }
101101
public string TokenType { get { throw null; } }
102102
public string TokenValue { get { throw null; } }

sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected AuthenticationPolicy() { }
9696
public partial class AuthenticationToken
9797
{
9898
public AuthenticationToken(string tokenValue, string tokenType, System.DateTimeOffset expiresOn, System.DateTimeOffset? refreshOn = default(System.DateTimeOffset?)) { }
99-
public System.DateTimeOffset ExpiresOn { get { throw null; } }
99+
public System.DateTimeOffset? ExpiresOn { get { throw null; } }
100100
public System.DateTimeOffset? RefreshOn { get { throw null; } }
101101
public string TokenType { get { throw null; } }
102102
public string TokenValue { get { throw null; } }

sdk/core/System.ClientModel/src/Auth/AuthenticationToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public AuthenticationToken(string tokenValue, string tokenType, DateTimeOffset e
4141
/// <summary>
4242
/// Gets the time when the provided token expires.
4343
/// </summary>
44-
public DateTimeOffset ExpiresOn { get; }
44+
public DateTimeOffset? ExpiresOn { get; }
4545

4646
/// <summary>
4747
/// Gets the time when the token should be refreshed.

0 commit comments

Comments
 (0)