Skip to content

Commit 93aefe5

Browse files
committed
fix: warning issues resolved
1 parent ebec84d commit 93aefe5

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

Contentstack.Management.Core/ContentstackClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ public bool HasValidOAuthTokens(string clientId)
581581
/// This method should be called when logging out or switching authentication methods.
582582
/// </summary>
583583
/// <param name="clientId">The OAuth client ID to clear tokens for.</param>
584-
public void ClearOAuthTokens(string clientId = null)
584+
public void ClearOAuthTokens(string? clientId = null)
585585
{
586586
if (!string.IsNullOrEmpty(clientId))
587587
{

Contentstack.Management.Core/Models/Extension.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ namespace Contentstack.Management.Core.Models
1010
public class Extension
1111
{
1212
internal Stack stack;
13-
public string Uid { get; set; }
13+
public string? Uid { get; set; }
1414

1515
internal string resourcePath;
1616

17-
internal Extension(Stack stack, string uid = null)
17+
internal Extension(Stack stack, string? uid = null)
1818
{
1919
stack.ThrowIfAPIKeyEmpty();
2020

@@ -153,7 +153,7 @@ public virtual ContentstackResponse Update(ExtensionModel model)
153153
/// </code></pre>
154154
/// </example>
155155
/// <returns>The <see cref="ContentstackResponse"/>.</returns>
156-
public virtual Task<ContentstackResponse> UpdateAsync(ExtensionModel model, ParameterCollection collection = null)
156+
public virtual Task<ContentstackResponse> UpdateAsync(ExtensionModel model, ParameterCollection? collection = null)
157157
{
158158
stack.ThrowIfNotLoggedIn();
159159
ThrowIfUidEmpty();
@@ -173,7 +173,7 @@ public virtual Task<ContentstackResponse> UpdateAsync(ExtensionModel model, Para
173173
/// </code></pre>
174174
/// </example>
175175
/// <returns>The <see cref="ContentstackResponse"/>.</returns>
176-
public virtual ContentstackResponse Fetch(ParameterCollection collection = null)
176+
public virtual ContentstackResponse Fetch(ParameterCollection? collection = null)
177177
{
178178
stack.ThrowIfNotLoggedIn();
179179
ThrowIfUidEmpty();
@@ -193,7 +193,7 @@ public virtual ContentstackResponse Fetch(ParameterCollection collection = null)
193193
/// </code></pre>
194194
/// </example>
195195
/// <returns>The <see cref="ContentstackResponse"/>.</returns>
196-
public virtual Task<ContentstackResponse> FetchAsync(ParameterCollection collection = null)
196+
public virtual Task<ContentstackResponse> FetchAsync(ParameterCollection? collection = null)
197197
{
198198
stack.ThrowIfNotLoggedIn();
199199
ThrowIfUidEmpty();

Contentstack.Management.Core/Models/Stack.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ public GlobalField GlobalField(string? uid = null, string? apiVersion = null)
675675
/// </code></pre>
676676
/// </example>
677677
/// <returns>The <see cref="Models.Extension" /></returns>
678-
public Extension Extension(string uid = null)
678+
public Extension Extension(string? uid = null)
679679
{
680680
ThrowIfNotLoggedIn();
681681
ThrowIfAPIKeyEmpty();
@@ -917,7 +917,7 @@ public Webhook Webhook(string? uid = null)
917917
/// </code></pre>
918918
/// </example>
919919
/// <returns>The <see cref="Models.AuditLog" /></returns>
920-
public AuditLog AuditLog(string uid = null)
920+
public AuditLog AuditLog(string? uid = null)
921921
{
922922
ThrowIfNotLoggedIn();
923923
ThrowIfAPIKeyEmpty();

Contentstack.Management.Core/Services/OAuth/OAuthAppRevocationService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal class OAuthAppRevocationService : ContentstackService
1111
{
1212
private readonly string _appId;
1313
private readonly string _authorizationId;
14-
private readonly string _organizationUid;
14+
private readonly string? _organizationUid;
1515

1616
/// <summary>
1717
/// Initializes a new instance of the OAuthAppRevocationService class.
@@ -20,7 +20,7 @@ internal class OAuthAppRevocationService : ContentstackService
2020
/// <param name="appId">The OAuth app ID.</param>
2121
/// <param name="authorizationId">The authorization ID to revoke.</param>
2222
/// <param name="organizationUid">The organization UID for OAuth operations.</param>
23-
internal OAuthAppRevocationService(JsonSerializerOptions serializer, string appId, string authorizationId, string organizationUid = null)
23+
internal OAuthAppRevocationService(JsonSerializerOptions serializer, string appId, string authorizationId, string? organizationUid = null)
2424
: base(serializer)
2525
{
2626
if (string.IsNullOrEmpty(appId))

Contentstack.Management.Core/Services/OAuth/OAuthTokenService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public override void ContentBody()
6868
/// <param name="addAcceptMediaHeader">Whether to add accept media headers.</param>
6969
/// <param name="apiVersion">The API version to use.</param>
7070
/// <returns>The HTTP request for OAuth token operations.</returns>
71-
public override IHttpRequest CreateHttpRequest(System.Net.Http.HttpClient httpClient, ContentstackClientOptions config, bool addAcceptMediaHeader = false, string apiVersion = null)
71+
public override IHttpRequest CreateHttpRequest(System.Net.Http.HttpClient httpClient, ContentstackClientOptions config, bool addAcceptMediaHeader = false, string? apiVersion = null)
7272
{
7373
// Create a custom config with Developer Hub hostname for OAuth token operations
7474
// OAuth token endpoints don't use API versioning, so we set Version to empty
@@ -151,8 +151,8 @@ public static OAuthTokenService CreateForAuthorizationCode(
151151
string authorizationCode,
152152
string clientId,
153153
string redirectUri,
154-
string clientSecret = null,
155-
string codeVerifier = null)
154+
string? clientSecret = null,
155+
string? codeVerifier = null)
156156
{
157157
if (string.IsNullOrEmpty(authorizationCode))
158158
throw new ArgumentException("Authorization code cannot be null or empty.", nameof(authorizationCode));
@@ -231,7 +231,7 @@ public static OAuthTokenService CreateForRefreshToken(
231231
JsonSerializerOptions serializer,
232232
string refreshToken,
233233
string clientId,
234-
string clientSecret = null)
234+
string? clientSecret = null)
235235
{
236236
if (string.IsNullOrEmpty(refreshToken))
237237
throw new ArgumentException("Refresh token cannot be null or empty.", nameof(refreshToken));

0 commit comments

Comments
 (0)