Skip to content

Commit ebec84d

Browse files
committed
fix: nullable operator fix
1 parent 3b84893 commit ebec84d

7 files changed

Lines changed: 28 additions & 28 deletions

File tree

Contentstack.Management.Core/Abstractions/IExtensionInterface.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
public interface IExtensionInterface : IUploadInterface
44
{
55
string Title { get; set; }
6-
string Tags { get; set; }
6+
string? Tags { get; set; }
77
}
88
}

Contentstack.Management.Core/Models/AuditLog.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ namespace Contentstack.Management.Core.Models
99
public class AuditLog
1010
{
1111
internal Stack stack;
12-
public string Uid { get; set; }
12+
public string? Uid { get; set; }
1313

1414
internal string resourcePath;
1515

16-
internal AuditLog(Stack stack, string uid = null)
16+
internal AuditLog(Stack stack, string? uid = null)
1717
{
1818
stack.ThrowIfAPIKeyEmpty();
1919

@@ -33,7 +33,7 @@ internal AuditLog(Stack stack, string uid = null)
3333
/// </code></pre>
3434
/// </example>
3535
/// <returns>The <see cref="ContentstackResponse"/>.</returns>
36-
public virtual ContentstackResponse FindAll(ParameterCollection collection = null)
36+
public virtual ContentstackResponse FindAll(ParameterCollection? collection = null)
3737
{
3838
stack.ThrowIfNotLoggedIn();
3939
ThrowIfUidNotEmpty();
@@ -53,7 +53,7 @@ public virtual ContentstackResponse FindAll(ParameterCollection collection = nul
5353
/// </code></pre>
5454
/// </example>
5555
/// <returns>The <see cref="ContentstackResponse"/>.</returns>
56-
public virtual Task<ContentstackResponse> FindAllAsync(ParameterCollection collection = null)
56+
public virtual Task<ContentstackResponse> FindAllAsync(ParameterCollection? collection = null)
5757
{
5858
stack.ThrowIfNotLoggedIn();
5959
ThrowIfUidNotEmpty();
@@ -73,7 +73,7 @@ public virtual Task<ContentstackResponse> FindAllAsync(ParameterCollection colle
7373
/// </code></pre>
7474
/// </example>
7575
/// <returns>The <see cref="ContentstackResponse"/>.</returns>
76-
public virtual ContentstackResponse Fetch(ParameterCollection collection = null)
76+
public virtual ContentstackResponse Fetch(ParameterCollection? collection = null)
7777
{
7878
stack.ThrowIfNotLoggedIn();
7979
ThrowIfUidEmpty();
@@ -93,7 +93,7 @@ public virtual ContentstackResponse Fetch(ParameterCollection collection = null)
9393
/// </code></pre>
9494
/// </example>
9595
/// <returns>The <see cref="ContentstackResponse"/>.</returns>
96-
public virtual Task<ContentstackResponse> FetchAsync(ParameterCollection collection = null)
96+
public virtual Task<ContentstackResponse> FetchAsync(ParameterCollection? collection = null)
9797
{
9898
stack.ThrowIfNotLoggedIn();
9999
ThrowIfUidEmpty();

Contentstack.Management.Core/Models/CustomExtension/CustomFieldModel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ public class CustomFieldModel : IExtensionInterface
1010
{
1111
public string Title { get; set; }
1212
public string DataType { get; set; }
13-
public string Tags { get; set; }
13+
public string? Tags { get; set; }
1414
public bool Multiple { get; set; }
1515
public string ContentType { get; set; }
1616

1717
internal ByteArrayContent byteArray;
1818

19-
public CustomFieldModel(string filePath, string contentType, string title, string dataType, bool isMultiple = false, string tags = null) :
19+
public CustomFieldModel(string filePath, string contentType, string title, string dataType, bool isMultiple = false, string? tags = null) :
2020
this(File.OpenRead(filePath), contentType, title, dataType, isMultiple, tags)
2121
{ }
2222

23-
public CustomFieldModel(Stream stream, string contentType, string title, string dataType, bool isMultiple = false, string tags = null) :
23+
public CustomFieldModel(Stream stream, string contentType, string title, string dataType, bool isMultiple = false, string? tags = null) :
2424
this(getBytes(stream), contentType, title, dataType, isMultiple, tags)
2525
{ }
2626

27-
public CustomFieldModel(byte[] bytes, string contentType, string title, string dataType, bool isMultiple = false, string tags = null) :
27+
public CustomFieldModel(byte[] bytes, string contentType, string title, string dataType, bool isMultiple = false, string? tags = null) :
2828
this(getByteArray(bytes), contentType, title, dataType, isMultiple, tags)
2929
{ }
3030

31-
public CustomFieldModel(ByteArrayContent byteArray, string contentType, string title, string dataType, bool isMultiple = false, string tags = null)
31+
public CustomFieldModel(ByteArrayContent byteArray, string contentType, string title, string dataType, bool isMultiple = false, string? tags = null)
3232
{
3333

3434
if (byteArray == null)

Contentstack.Management.Core/Models/CustomExtension/CustomWidgetModel.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ namespace Contentstack.Management.Core.Models.CustomExtension
1111
public class CustomWidgetModel : IExtensionInterface
1212
{
1313
public string Title { get; set; }
14-
public string Tags { get; set; }
15-
public ExtensionScope Scope { get; set; }
14+
public string? Tags { get; set; }
15+
public ExtensionScope? Scope { get; set; }
1616
public string ContentType { get; set; }
1717

1818
internal ByteArrayContent byteArray;
1919

20-
public CustomWidgetModel(string filePath, string contentType, string title, string tags = null, ExtensionScope scope = null) :
20+
public CustomWidgetModel(string filePath, string contentType, string title, string? tags = null, ExtensionScope? scope = null) :
2121
this(File.OpenRead(filePath), contentType, title, tags, scope)
2222
{ }
2323

24-
public CustomWidgetModel(Stream stream, string contentType, string title, string tags = null, ExtensionScope scope = null) :
24+
public CustomWidgetModel(Stream stream, string contentType, string title, string? tags = null, ExtensionScope? scope = null) :
2525
this(getBytes(stream), contentType, title, tags, scope)
2626
{ }
2727

28-
public CustomWidgetModel(byte[] bytes, string contentType, string title, string tags = null, ExtensionScope scope = null) :
28+
public CustomWidgetModel(byte[] bytes, string contentType, string title, string? tags = null, ExtensionScope? scope = null) :
2929
this(getByteArray(bytes), contentType, title, tags, scope)
3030
{ }
3131

32-
public CustomWidgetModel(ByteArrayContent byteArray, string contentType, string title, string tags = null, ExtensionScope scope = null)
32+
public CustomWidgetModel(ByteArrayContent byteArray, string contentType, string title, string? tags = null, ExtensionScope? scope = null)
3333
{
3434
if (byteArray == null)
3535
{

Contentstack.Management.Core/Models/CustomExtension/DashboardWidgetModel.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@ namespace Contentstack.Management.Core.Models.CustomExtension
99
public class DashboardWidgetModel : IExtensionInterface
1010
{
1111
public string Title { get; set; }
12-
public string Tags { get; set; }
12+
public string? Tags { get; set; }
1313
public string ContentType { get; set; }
14-
public string DefaultWidth { get; set; }
14+
public string? DefaultWidth { get; set; }
1515
public bool Enable { get; set; }
1616

1717
internal ByteArrayContent byteArray;
1818

19-
public DashboardWidgetModel(string filePath, string contentType, string title, bool isEnable = false, string defaultWidth = null, string tags = null) :
19+
public DashboardWidgetModel(string filePath, string contentType, string title, bool isEnable = false, string? defaultWidth = null, string? tags = null) :
2020
this(File.OpenRead(filePath), contentType, title, isEnable, defaultWidth, tags)
2121
{ }
2222

23-
public DashboardWidgetModel(Stream stream, string contentType, string title, bool isEnable = false, string defaultWidth = null, string tags = null) :
23+
public DashboardWidgetModel(Stream stream, string contentType, string title, bool isEnable = false, string? defaultWidth = null, string? tags = null) :
2424
this(getBytes(stream), contentType, title, isEnable, defaultWidth, tags)
2525
{ }
2626

27-
public DashboardWidgetModel(byte[] bytes, string contentType, string title, bool isEnable = false, string defaultWidth = null, string tags = null) :
27+
public DashboardWidgetModel(byte[] bytes, string contentType, string title, bool isEnable = false, string? defaultWidth = null, string? tags = null) :
2828
this(getByteArray(bytes), contentType, title, isEnable, defaultWidth, tags)
2929
{ }
3030

31-
public DashboardWidgetModel(ByteArrayContent byteArray, string contentType, string title, bool isEnable = false, string defaultWidth = null, string tags = null)
31+
public DashboardWidgetModel(ByteArrayContent byteArray, string contentType, string title, bool isEnable = false, string? defaultWidth = null, string? tags = null)
3232
{
3333

3434
if (byteArray == null)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ namespace Contentstack.Management.Core.Services.OAuth
1212
internal class OAuthAppAuthorizationService : ContentstackService
1313
{
1414
private readonly string _appId;
15-
private readonly string _organizationUid;
15+
private readonly string? _organizationUid;
1616

1717
/// <summary>
1818
/// Initializes a new instance of the OAuthAppAuthorizationService class.
1919
/// </summary>
2020
/// <param name="serializer">The JSON serializer.</param>
2121
/// <param name="appId">The OAuth app ID.</param>
2222
/// <param name="organizationUid">The organization UID for OAuth operations.</param>
23-
internal OAuthAppAuthorizationService(JsonSerializerOptions serializer, string appId, string organizationUid = null)
23+
internal OAuthAppAuthorizationService(JsonSerializerOptions serializer, string appId, string? organizationUid = null)
2424
: base(serializer)
2525
{
2626
if (string.IsNullOrEmpty(appId))
@@ -49,7 +49,7 @@ private void InitializeService()
4949
/// <param name="addAcceptMediaHeader">Whether to add accept media headers.</param>
5050
/// <param name="apiVersion">The API version to use.</param>
5151
/// <returns>The HTTP request for OAuth app authorization operations.</returns>
52-
public override IHttpRequest CreateHttpRequest(System.Net.Http.HttpClient httpClient, ContentstackClientOptions config, bool addAcceptMediaHeader = false, string apiVersion = null)
52+
public override IHttpRequest CreateHttpRequest(System.Net.Http.HttpClient httpClient, ContentstackClientOptions config, bool addAcceptMediaHeader = false, string? apiVersion = null)
5353
{
5454
// Create a custom config with Developer Hub hostname for OAuth app authorization operations
5555
// OAuth endpoints don't use API versioning, so we set Version to empty

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private void InitializeService()
5252
/// <param name="addAcceptMediaHeader">Whether to add accept media headers.</param>
5353
/// <param name="apiVersion">The API version to use.</param>
5454
/// <returns>The HTTP request for OAuth app revocation operations.</returns>
55-
public override IHttpRequest CreateHttpRequest(System.Net.Http.HttpClient httpClient, ContentstackClientOptions config, bool addAcceptMediaHeader = false, string apiVersion = null)
55+
public override IHttpRequest CreateHttpRequest(System.Net.Http.HttpClient httpClient, ContentstackClientOptions config, bool addAcceptMediaHeader = false, string? apiVersion = null)
5656
{
5757
// Create a custom config with Developer Hub hostname for OAuth app revocation operations
5858
// OAuth endpoints don't use API versioning, so we set Version to empty

0 commit comments

Comments
 (0)