From cc1215d25b95487765967ed1f254a36931710c84 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Wed, 27 May 2026 12:55:51 +0530 Subject: [PATCH 1/3] refactor: update exception handling in model tests to use ArgumentException --- ...entstack.Management.Core.Unit.Tests.csproj | 7 ---- .../Models/DeliveryTokenTest.cs | 12 +++---- .../Models/PublishRuleTest.cs | 32 +++++++++---------- .../Models/TaxonomyTest.cs | 26 +++++++-------- .../Models/TermTest.cs | 24 +++++++------- .../Models/WebhookTest.cs | 24 +++++++------- .../Models/WorkflowTest.cs | 12 +++---- .../Models/PublishRule.cs | 4 +-- Contentstack.Management.Core/Models/Stack.cs | 14 +++----- .../Models/Taxonomy.cs | 16 +++++----- Contentstack.Management.Core/Models/Term.cs | 24 +++++++------- .../Models/Webhook.cs | 12 +++---- .../Models/Workflow.cs | 16 +++++----- .../contentstack.management.core.csproj | 12 +++---- 14 files changed, 111 insertions(+), 124 deletions(-) diff --git a/Contentstack.Management.Core.Unit.Tests/Contentstack.Management.Core.Unit.Tests.csproj b/Contentstack.Management.Core.Unit.Tests/Contentstack.Management.Core.Unit.Tests.csproj index fa0a3b9..f5284b1 100644 --- a/Contentstack.Management.Core.Unit.Tests/Contentstack.Management.Core.Unit.Tests.csproj +++ b/Contentstack.Management.Core.Unit.Tests/Contentstack.Management.Core.Unit.Tests.csproj @@ -60,19 +60,13 @@ - - - - - - @@ -83,7 +77,6 @@ - diff --git a/Contentstack.Management.Core.Unit.Tests/Models/DeliveryTokenTest.cs b/Contentstack.Management.Core.Unit.Tests/Models/DeliveryTokenTest.cs index 88a36a9..a01124d 100644 --- a/Contentstack.Management.Core.Unit.Tests/Models/DeliveryTokenTest.cs +++ b/Contentstack.Management.Core.Unit.Tests/Models/DeliveryTokenTest.cs @@ -32,12 +32,12 @@ public void Initialize_DeliveryToken() DeliveryToken token = new DeliveryToken(_stack); Assert.IsNull(token.Uid); Assert.AreEqual("stacks/delivery_tokens", token.resourcePath); - Assert.ThrowsException(() => token.Fetch()); - Assert.ThrowsExceptionAsync(() => token.FetchAsync()); - Assert.ThrowsException(() => token.Update(_fixture.Create())); - Assert.ThrowsExceptionAsync(() => token.UpdateAsync(_fixture.Create())); - Assert.ThrowsException(() => token.Delete()); - Assert.ThrowsExceptionAsync(() => token.DeleteAsync()); + Assert.ThrowsException(() => token.Fetch()); + Assert.ThrowsExceptionAsync(() => token.FetchAsync()); + Assert.ThrowsException(() => token.Update(_fixture.Create())); + Assert.ThrowsExceptionAsync(() => token.UpdateAsync(_fixture.Create())); + Assert.ThrowsException(() => token.Delete()); + Assert.ThrowsExceptionAsync(() => token.DeleteAsync()); Assert.AreEqual(token.Query().GetType(), typeof(Query)); } diff --git a/Contentstack.Management.Core.Unit.Tests/Models/PublishRuleTest.cs b/Contentstack.Management.Core.Unit.Tests/Models/PublishRuleTest.cs index 42d3790..6c83598 100644 --- a/Contentstack.Management.Core.Unit.Tests/Models/PublishRuleTest.cs +++ b/Contentstack.Management.Core.Unit.Tests/Models/PublishRuleTest.cs @@ -29,12 +29,12 @@ public void Initialize_PublishRule() Assert.IsNull(publishRule.Uid); Assert.AreEqual($"/workflows/publishing_rules", publishRule.resourcePath); - Assert.ThrowsException(() => publishRule.Fetch()); - Assert.ThrowsExceptionAsync(() => publishRule.FetchAsync()); - Assert.ThrowsException(() => publishRule.Update(_fixture.Create())); - Assert.ThrowsExceptionAsync(() => publishRule.UpdateAsync(_fixture.Create())); - Assert.ThrowsException(() => publishRule.Delete()); - Assert.ThrowsExceptionAsync(() => publishRule.DeleteAsync()); + Assert.ThrowsException(() => publishRule.Fetch()); + Assert.ThrowsExceptionAsync(() => publishRule.FetchAsync()); + Assert.ThrowsException(() => publishRule.Update(_fixture.Create())); + Assert.ThrowsExceptionAsync(() => publishRule.UpdateAsync(_fixture.Create())); + Assert.ThrowsException(() => publishRule.Delete()); + Assert.ThrowsExceptionAsync(() => publishRule.DeleteAsync()); } [TestMethod] @@ -57,7 +57,7 @@ public void Should_Create_PublishRule() ContentstackResponse response = _stack.Workflow().PublishRule().Create(new PublishRuleModel()); Assert.AreEqual(_contentstackResponse.OpenResponse(), response.OpenResponse()); - Assert.AreEqual(_contentstackResponse.OpenJObjectResponse().ToString(), response.OpenJObjectResponse().ToString()); + Assert.AreEqual(_contentstackResponse.OpenJsonObjectResponse().ToString(), response.OpenJsonObjectResponse().ToString()); } [TestMethod] @@ -66,7 +66,7 @@ public async System.Threading.Tasks.Task Should_Create_PublishRule_Async() ContentstackResponse response = await _stack.Workflow().PublishRule().CreateAsync(new PublishRuleModel()); Assert.AreEqual(_contentstackResponse.OpenResponse(), response.OpenResponse()); - Assert.AreEqual(_contentstackResponse.OpenJObjectResponse().ToString(), response.OpenJObjectResponse().ToString()); + Assert.AreEqual(_contentstackResponse.OpenJsonObjectResponse().ToString(), response.OpenJsonObjectResponse().ToString()); } [TestMethod] @@ -75,7 +75,7 @@ public void Should_Find_All_PublishRule() ContentstackResponse response = _stack.Workflow().PublishRule().FindAll(); Assert.AreEqual(_contentstackResponse.OpenResponse(), response.OpenResponse()); - Assert.AreEqual(_contentstackResponse.OpenJObjectResponse().ToString(), response.OpenJObjectResponse().ToString()); + Assert.AreEqual(_contentstackResponse.OpenJsonObjectResponse().ToString(), response.OpenJsonObjectResponse().ToString()); } [TestMethod] @@ -84,7 +84,7 @@ public async System.Threading.Tasks.Task Should_Find_All_PublishRule_Async() ContentstackResponse response = await _stack.Workflow().PublishRule().FindAllAsync(); Assert.AreEqual(_contentstackResponse.OpenResponse(), response.OpenResponse()); - Assert.AreEqual(_contentstackResponse.OpenJObjectResponse().ToString(), response.OpenJObjectResponse().ToString()); + Assert.AreEqual(_contentstackResponse.OpenJsonObjectResponse().ToString(), response.OpenJsonObjectResponse().ToString()); } [TestMethod] @@ -93,7 +93,7 @@ public void Should_Fetch_PublishRule() ContentstackResponse response = _stack.Workflow().PublishRule(_fixture.Create()).Fetch(); Assert.AreEqual(_contentstackResponse.OpenResponse(), response.OpenResponse()); - Assert.AreEqual(_contentstackResponse.OpenJObjectResponse().ToString(), response.OpenJObjectResponse().ToString()); + Assert.AreEqual(_contentstackResponse.OpenJsonObjectResponse().ToString(), response.OpenJsonObjectResponse().ToString()); } [TestMethod] @@ -102,7 +102,7 @@ public async System.Threading.Tasks.Task Should_Find_PublishRule_Async() ContentstackResponse response = await _stack.Workflow().PublishRule(_fixture.Create()).FetchAsync(); Assert.AreEqual(_contentstackResponse.OpenResponse(), response.OpenResponse()); - Assert.AreEqual(_contentstackResponse.OpenJObjectResponse().ToString(), response.OpenJObjectResponse().ToString()); + Assert.AreEqual(_contentstackResponse.OpenJsonObjectResponse().ToString(), response.OpenJsonObjectResponse().ToString()); } [TestMethod] @@ -111,7 +111,7 @@ public void Should_Update_PublishRule() ContentstackResponse response = _stack.Workflow().PublishRule(_fixture.Create()).Update(new PublishRuleModel()); Assert.AreEqual(_contentstackResponse.OpenResponse(), response.OpenResponse()); - Assert.AreEqual(_contentstackResponse.OpenJObjectResponse().ToString(), response.OpenJObjectResponse().ToString()); + Assert.AreEqual(_contentstackResponse.OpenJsonObjectResponse().ToString(), response.OpenJsonObjectResponse().ToString()); } [TestMethod] @@ -120,7 +120,7 @@ public async System.Threading.Tasks.Task Should_Update_PublishRule_Async() ContentstackResponse response = await _stack.Workflow().PublishRule(_fixture.Create()).UpdateAsync(new PublishRuleModel()); Assert.AreEqual(_contentstackResponse.OpenResponse(), response.OpenResponse()); - Assert.AreEqual(_contentstackResponse.OpenJObjectResponse().ToString(), response.OpenJObjectResponse().ToString()); + Assert.AreEqual(_contentstackResponse.OpenJsonObjectResponse().ToString(), response.OpenJsonObjectResponse().ToString()); } [TestMethod] @@ -129,7 +129,7 @@ public void Should_Delete_PublishRule() ContentstackResponse response = _stack.Workflow().PublishRule(_fixture.Create()).Delete(); Assert.AreEqual(_contentstackResponse.OpenResponse(), response.OpenResponse()); - Assert.AreEqual(_contentstackResponse.OpenJObjectResponse().ToString(), response.OpenJObjectResponse().ToString()); + Assert.AreEqual(_contentstackResponse.OpenJsonObjectResponse().ToString(), response.OpenJsonObjectResponse().ToString()); } [TestMethod] @@ -138,7 +138,7 @@ public async System.Threading.Tasks.Task Should_Delete_PublishRule_Async() ContentstackResponse response = await _stack.Workflow().PublishRule(_fixture.Create()).DeleteAsync(); Assert.AreEqual(_contentstackResponse.OpenResponse(), response.OpenResponse()); - Assert.AreEqual(_contentstackResponse.OpenJObjectResponse().ToString(), response.OpenJObjectResponse().ToString()); + Assert.AreEqual(_contentstackResponse.OpenJsonObjectResponse().ToString(), response.OpenJsonObjectResponse().ToString()); } } } diff --git a/Contentstack.Management.Core.Unit.Tests/Models/TaxonomyTest.cs b/Contentstack.Management.Core.Unit.Tests/Models/TaxonomyTest.cs index 38ac5c9..66f7240 100644 --- a/Contentstack.Management.Core.Unit.Tests/Models/TaxonomyTest.cs +++ b/Contentstack.Management.Core.Unit.Tests/Models/TaxonomyTest.cs @@ -33,13 +33,13 @@ public void Initialize_Taxonomy() Assert.IsNull(taxonomy.Uid); Assert.AreEqual("/taxonomies", taxonomy.resourcePath); - Assert.ThrowsException(() => taxonomy.Fetch()); - Assert.ThrowsExceptionAsync(() => taxonomy.FetchAsync()); - Assert.ThrowsException(() => taxonomy.Update(_fixture.Create())); - Assert.ThrowsExceptionAsync(() => taxonomy.UpdateAsync(_fixture.Create())); - Assert.ThrowsException(() => taxonomy.Delete()); - Assert.ThrowsExceptionAsync(() => taxonomy.DeleteAsync()); - Assert.ThrowsException(() => taxonomy.Terms()); + Assert.ThrowsException(() => taxonomy.Fetch()); + Assert.ThrowsExceptionAsync(() => taxonomy.FetchAsync()); + Assert.ThrowsException(() => taxonomy.Update(_fixture.Create())); + Assert.ThrowsExceptionAsync(() => taxonomy.UpdateAsync(_fixture.Create())); + Assert.ThrowsException(() => taxonomy.Delete()); + Assert.ThrowsExceptionAsync(() => taxonomy.DeleteAsync()); + Assert.ThrowsException(() => taxonomy.Terms()); Assert.AreEqual(typeof(Query), taxonomy.Query().GetType()); } @@ -136,22 +136,22 @@ public void Should_Get_Single_Term_From_Taxonomy() [TestMethod] public void Export_Throws_When_Uid_Is_Empty() { - Assert.ThrowsException(() => _stack.Taxonomy().Export()); - Assert.ThrowsExceptionAsync(() => _stack.Taxonomy().ExportAsync()); + Assert.ThrowsException(() => _stack.Taxonomy().Export()); + Assert.ThrowsExceptionAsync(() => _stack.Taxonomy().ExportAsync()); } [TestMethod] public void Locales_Throws_When_Uid_Is_Empty() { - Assert.ThrowsException(() => _stack.Taxonomy().Locales()); - Assert.ThrowsExceptionAsync(() => _stack.Taxonomy().LocalesAsync()); + Assert.ThrowsException(() => _stack.Taxonomy().Locales()); + Assert.ThrowsExceptionAsync(() => _stack.Taxonomy().LocalesAsync()); } [TestMethod] public void Localize_Throws_When_Uid_Is_Empty() { - Assert.ThrowsException(() => _stack.Taxonomy().Localize(_fixture.Create())); - Assert.ThrowsExceptionAsync(() => _stack.Taxonomy().LocalizeAsync(_fixture.Create())); + Assert.ThrowsException(() => _stack.Taxonomy().Localize(_fixture.Create())); + Assert.ThrowsExceptionAsync(() => _stack.Taxonomy().LocalizeAsync(_fixture.Create())); } [TestMethod] diff --git a/Contentstack.Management.Core.Unit.Tests/Models/TermTest.cs b/Contentstack.Management.Core.Unit.Tests/Models/TermTest.cs index 3267ab9..7191318 100644 --- a/Contentstack.Management.Core.Unit.Tests/Models/TermTest.cs +++ b/Contentstack.Management.Core.Unit.Tests/Models/TermTest.cs @@ -32,8 +32,8 @@ public void Initialize_Term_Collection() Assert.IsNull(term.Uid); Assert.AreEqual($"/taxonomies/{taxonomyUid}/terms", term.resourcePath); - Assert.ThrowsException(() => term.Fetch()); - Assert.ThrowsExceptionAsync(() => term.FetchAsync()); + Assert.ThrowsException(() => term.Fetch()); + Assert.ThrowsExceptionAsync(() => term.FetchAsync()); Assert.AreEqual(typeof(Query), term.Query().GetType()); } @@ -139,40 +139,40 @@ public async System.Threading.Tasks.Task Should_Search_Terms_Async() public void Ancestors_Throws_When_Term_Uid_Is_Empty() { string taxonomyUid = _fixture.Create(); - Assert.ThrowsException(() => _stack.Taxonomy(taxonomyUid).Terms().Ancestors()); - Assert.ThrowsExceptionAsync(() => _stack.Taxonomy(taxonomyUid).Terms().AncestorsAsync()); + Assert.ThrowsException(() => _stack.Taxonomy(taxonomyUid).Terms().Ancestors()); + Assert.ThrowsExceptionAsync(() => _stack.Taxonomy(taxonomyUid).Terms().AncestorsAsync()); } [TestMethod] public void Descendants_Throws_When_Term_Uid_Is_Empty() { string taxonomyUid = _fixture.Create(); - Assert.ThrowsException(() => _stack.Taxonomy(taxonomyUid).Terms().Descendants()); - Assert.ThrowsExceptionAsync(() => _stack.Taxonomy(taxonomyUid).Terms().DescendantsAsync()); + Assert.ThrowsException(() => _stack.Taxonomy(taxonomyUid).Terms().Descendants()); + Assert.ThrowsExceptionAsync(() => _stack.Taxonomy(taxonomyUid).Terms().DescendantsAsync()); } [TestMethod] public void Move_Throws_When_Term_Uid_Is_Empty() { string taxonomyUid = _fixture.Create(); - Assert.ThrowsException(() => _stack.Taxonomy(taxonomyUid).Terms().Move(_fixture.Create())); - Assert.ThrowsExceptionAsync(() => _stack.Taxonomy(taxonomyUid).Terms().MoveAsync(_fixture.Create())); + Assert.ThrowsException(() => _stack.Taxonomy(taxonomyUid).Terms().Move(_fixture.Create())); + Assert.ThrowsExceptionAsync(() => _stack.Taxonomy(taxonomyUid).Terms().MoveAsync(_fixture.Create())); } [TestMethod] public void Locales_Throws_When_Term_Uid_Is_Empty() { string taxonomyUid = _fixture.Create(); - Assert.ThrowsException(() => _stack.Taxonomy(taxonomyUid).Terms().Locales()); - Assert.ThrowsExceptionAsync(() => _stack.Taxonomy(taxonomyUid).Terms().LocalesAsync()); + Assert.ThrowsException(() => _stack.Taxonomy(taxonomyUid).Terms().Locales()); + Assert.ThrowsExceptionAsync(() => _stack.Taxonomy(taxonomyUid).Terms().LocalesAsync()); } [TestMethod] public void Localize_Throws_When_Term_Uid_Is_Empty() { string taxonomyUid = _fixture.Create(); - Assert.ThrowsException(() => _stack.Taxonomy(taxonomyUid).Terms().Localize(_fixture.Create())); - Assert.ThrowsExceptionAsync(() => _stack.Taxonomy(taxonomyUid).Terms().LocalizeAsync(_fixture.Create())); + Assert.ThrowsException(() => _stack.Taxonomy(taxonomyUid).Terms().Localize(_fixture.Create())); + Assert.ThrowsExceptionAsync(() => _stack.Taxonomy(taxonomyUid).Terms().LocalizeAsync(_fixture.Create())); } } } diff --git a/Contentstack.Management.Core.Unit.Tests/Models/WebhookTest.cs b/Contentstack.Management.Core.Unit.Tests/Models/WebhookTest.cs index 2f5a905..1a85744 100644 --- a/Contentstack.Management.Core.Unit.Tests/Models/WebhookTest.cs +++ b/Contentstack.Management.Core.Unit.Tests/Models/WebhookTest.cs @@ -30,18 +30,18 @@ public void Initialize_Webhook() Assert.IsNull(webhook.Uid); Assert.AreEqual($"/webhooks", webhook.resourcePath); - Assert.ThrowsException(() => webhook.Fetch()); - Assert.ThrowsExceptionAsync(() => webhook.FetchAsync()); - Assert.ThrowsException(() => webhook.Update(_fixture.Create())); - Assert.ThrowsExceptionAsync(() => webhook.UpdateAsync(_fixture.Create())); - Assert.ThrowsException(() => webhook.Delete()); - Assert.ThrowsExceptionAsync(() => webhook.DeleteAsync()); - Assert.ThrowsException(() => webhook.Executions()); - Assert.ThrowsExceptionAsync(() => webhook.ExecutionsAsync()); - Assert.ThrowsException(() => webhook.Retry(_fixture.Create())); - Assert.ThrowsExceptionAsync(() => webhook.RetryAsync(_fixture.Create())); - Assert.ThrowsException(() => webhook.Logs(_fixture.Create())); - Assert.ThrowsExceptionAsync(() => webhook.LogsAsync(_fixture.Create())); + Assert.ThrowsException(() => webhook.Fetch()); + Assert.ThrowsExceptionAsync(() => webhook.FetchAsync()); + Assert.ThrowsException(() => webhook.Update(_fixture.Create())); + Assert.ThrowsExceptionAsync(() => webhook.UpdateAsync(_fixture.Create())); + Assert.ThrowsException(() => webhook.Delete()); + Assert.ThrowsExceptionAsync(() => webhook.DeleteAsync()); + Assert.ThrowsException(() => webhook.Executions()); + Assert.ThrowsExceptionAsync(() => webhook.ExecutionsAsync()); + Assert.ThrowsException(() => webhook.Retry(_fixture.Create())); + Assert.ThrowsExceptionAsync(() => webhook.RetryAsync(_fixture.Create())); + Assert.ThrowsException(() => webhook.Logs(_fixture.Create())); + Assert.ThrowsExceptionAsync(() => webhook.LogsAsync(_fixture.Create())); Assert.AreEqual(webhook.Query().GetType(), typeof(Query)); } diff --git a/Contentstack.Management.Core.Unit.Tests/Models/WorkflowTest.cs b/Contentstack.Management.Core.Unit.Tests/Models/WorkflowTest.cs index eb4b312..d4daaf7 100644 --- a/Contentstack.Management.Core.Unit.Tests/Models/WorkflowTest.cs +++ b/Contentstack.Management.Core.Unit.Tests/Models/WorkflowTest.cs @@ -29,12 +29,12 @@ public void Initialize_Workflow() Assert.IsNull(workflow.Uid); Assert.AreEqual($"/workflows", workflow.resourcePath); - Assert.ThrowsException(() => workflow.Fetch()); - Assert.ThrowsExceptionAsync(() => workflow.FetchAsync()); - Assert.ThrowsException(() => workflow.Update(_fixture.Create())); - Assert.ThrowsExceptionAsync(() => workflow.UpdateAsync(_fixture.Create())); - Assert.ThrowsException(() => workflow.Delete()); - Assert.ThrowsExceptionAsync(() => workflow.DeleteAsync()); + Assert.ThrowsException(() => workflow.Fetch()); + Assert.ThrowsExceptionAsync(() => workflow.FetchAsync()); + Assert.ThrowsException(() => workflow.Update(_fixture.Create())); + Assert.ThrowsExceptionAsync(() => workflow.UpdateAsync(_fixture.Create())); + Assert.ThrowsException(() => workflow.Delete()); + Assert.ThrowsExceptionAsync(() => workflow.DeleteAsync()); Assert.AreEqual(workflow.PublishRule().GetType(), typeof(PublishRule)); } diff --git a/Contentstack.Management.Core/Models/PublishRule.cs b/Contentstack.Management.Core/Models/PublishRule.cs index 60dabac..b1a7bf2 100644 --- a/Contentstack.Management.Core/Models/PublishRule.cs +++ b/Contentstack.Management.Core/Models/PublishRule.cs @@ -28,7 +28,7 @@ public virtual ContentstackResponse FindAll(ParameterCollection collection = nul stack.ThrowIfNotLoggedIn(); ThrowIfUidNotEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, resourcePath, collection: collection); + var service = new FetchDeleteService(stack, resourcePath, collection: collection); return stack.client.InvokeSync(service); } @@ -48,7 +48,7 @@ public virtual Task FindAllAsync(ParameterCollection colle stack.ThrowIfNotLoggedIn(); ThrowIfUidNotEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, resourcePath, collection: collection); + var service = new FetchDeleteService(stack, resourcePath, collection: collection); return stack.client.InvokeAsync(service); } diff --git a/Contentstack.Management.Core/Models/Stack.cs b/Contentstack.Management.Core/Models/Stack.cs index 0142054..c0f0a5e 100644 --- a/Contentstack.Management.Core/Models/Stack.cs +++ b/Contentstack.Management.Core/Models/Stack.cs @@ -5,7 +5,7 @@ using Contentstack.Management.Core.Services.Stack; using Contentstack.Management.Core.Utils; using Contentstack.Management.Core.Models; -// using Contentstack.Management.Core.Models.Token; // Excluded for now +using Contentstack.Management.Core.Models.Token; namespace Contentstack.Management.Core.Models { @@ -667,7 +667,7 @@ public GlobalField GlobalField(string uid = null, string apiVersion = null) /* /// - /// let you create custom fields and custom widgets that lets you customize Contentstack's default UI and behavior. + /// let you create custom fields and custom widgets that lets you customize Contentstack's default UI and behavior. /// /// Optional, extension uid. /// @@ -687,7 +687,7 @@ public Extension Extension(string uid = null) } /// - /// allow you to group a collection of content within a stack. Using labels you can group content types that need to work together. + /// allow you to group a collection of content within a stack. Using labels you can group content types that need to work together. /// /// Optional, label uid. /// @@ -705,6 +705,7 @@ public Label Label(string uid = null) return new Label(this, uid); } + */ /// /// allows you to organize and categorize content using a hierarchical structure of terms. @@ -726,7 +727,6 @@ public Taxonomy Taxonomy(string uid = null) return new Taxonomy(this, uid); } - */ /// /// A publishing corresponds to one or more deployment servers or a content delivery destination where the entries need to be published. @@ -748,7 +748,6 @@ public Environment Environment(string uid = null) return new Environment(this, uid); } - /* /// /// You can use to authenticate Content Delivery API (CDA) requests and retrieve the published content of an environment. /// @@ -788,7 +787,6 @@ public ManagementToken ManagementTokens(string uid = null) return new ManagementToken(this, uid); } - */ /// /// A collection of permissions that will be applicable to all the users who are assigned this role. @@ -847,7 +845,6 @@ public Release Release(string uid = null) /// /// /// The - /* public Workflow Workflow(string uid = null) { ThrowIfNotLoggedIn(); @@ -855,7 +852,6 @@ public Workflow Workflow(string uid = null) return new Workflow(this, uid); } - */ /// /// A displays the historical and current details of activities such as publish, unpublish, or delete that can be performed on entries and/or assets. @@ -891,7 +887,6 @@ public PublishQueue PublishQueue(string uid = null) /// /// /// The - /* public Webhook Webhook(string uid = null) { ThrowIfNotLoggedIn(); @@ -899,7 +894,6 @@ public Webhook Webhook(string uid = null) return new Webhook(this, uid); } - */ /// /// A displays a record of all the activities performed in a stack and helps you keep a track of all published items, updates, deletes, and current status of the existing content. diff --git a/Contentstack.Management.Core/Models/Taxonomy.cs b/Contentstack.Management.Core/Models/Taxonomy.cs index dbbaa01..3a22ea4 100644 --- a/Contentstack.Management.Core/Models/Taxonomy.cs +++ b/Contentstack.Management.Core/Models/Taxonomy.cs @@ -101,7 +101,7 @@ public ContentstackResponse Export(ParameterCollection collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, resourcePath + "/export", "GET", collection); + var service = new FetchDeleteService(stack, resourcePath + "/export", "GET", collection); return stack.client.InvokeSync(service); } @@ -112,7 +112,7 @@ public Task ExportAsync(ParameterCollection collection = n { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, resourcePath + "/export", "GET", collection); + var service = new FetchDeleteService(stack, resourcePath + "/export", "GET", collection); return stack.client.InvokeAsync(service); } @@ -123,7 +123,7 @@ public ContentstackResponse Locales(ParameterCollection collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, resourcePath + "/locales", "GET", collection); + var service = new FetchDeleteService(stack, resourcePath + "/locales", "GET", collection); return stack.client.InvokeSync(service); } @@ -134,7 +134,7 @@ public Task LocalesAsync(ParameterCollection collection = { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, resourcePath + "/locales", "GET", collection); + var service = new FetchDeleteService(stack, resourcePath + "/locales", "GET", collection); return stack.client.InvokeAsync(service); } @@ -145,7 +145,7 @@ public ContentstackResponse Localize(TaxonomyModel model, ParameterCollection co { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new CreateUpdateService(stack.client.serializer, stack, resourcePath, model, "taxonomy", "POST", collection); + var service = new CreateUpdateService(stack, resourcePath, model, "taxonomy", "POST", collection); return stack.client.InvokeSync(service); } @@ -156,7 +156,7 @@ public Task LocalizeAsync(TaxonomyModel model, ParameterCo { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new CreateUpdateService(stack.client.serializer, stack, resourcePath, model, "taxonomy", "POST", collection); + var service = new CreateUpdateService(stack, resourcePath, model, "taxonomy", "POST", collection); return stack.client.InvokeAsync, ContentstackResponse>(service); } @@ -168,7 +168,7 @@ public ContentstackResponse Import(TaxonomyImportModel model, ParameterCollectio stack.ThrowIfNotLoggedIn(); ThrowIfUidNotEmpty(); var path = resourcePath + "/import"; - var service = new UploadService(stack.client.serializer, stack, path, model, "POST", collection); + var service = new UploadService(stack, path, model, "POST", collection); return stack.client.InvokeSync(service); } @@ -180,7 +180,7 @@ public Task ImportAsync(TaxonomyImportModel model, Paramet stack.ThrowIfNotLoggedIn(); ThrowIfUidNotEmpty(); var path = resourcePath + "/import"; - var service = new UploadService(stack.client.serializer, stack, path, model, "POST", collection); + var service = new UploadService(stack, path, model, "POST", collection); return stack.client.InvokeAsync(service); } diff --git a/Contentstack.Management.Core/Models/Term.cs b/Contentstack.Management.Core/Models/Term.cs index e48df74..473527d 100644 --- a/Contentstack.Management.Core/Models/Term.cs +++ b/Contentstack.Management.Core/Models/Term.cs @@ -101,7 +101,7 @@ public ContentstackResponse Ancestors(ParameterCollection collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, resourcePath + "/ancestors", "GET", collection); + var service = new FetchDeleteService(stack, resourcePath + "/ancestors", "GET", collection); return stack.client.InvokeSync(service); } @@ -112,7 +112,7 @@ public Task AncestorsAsync(ParameterCollection collection { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, resourcePath + "/ancestors", "GET", collection); + var service = new FetchDeleteService(stack, resourcePath + "/ancestors", "GET", collection); return stack.client.InvokeAsync(service); } @@ -123,7 +123,7 @@ public ContentstackResponse Descendants(ParameterCollection collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, resourcePath + "/descendants", "GET", collection); + var service = new FetchDeleteService(stack, resourcePath + "/descendants", "GET", collection); return stack.client.InvokeSync(service); } @@ -134,7 +134,7 @@ public Task DescendantsAsync(ParameterCollection collectio { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, resourcePath + "/descendants", "GET", collection); + var service = new FetchDeleteService(stack, resourcePath + "/descendants", "GET", collection); return stack.client.InvokeAsync(service); } @@ -145,7 +145,7 @@ public ContentstackResponse Move(TermMoveModel moveModel, ParameterCollection co { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new CreateUpdateService(stack.client.serializer, stack, resourcePath + "/move", moveModel, "term", "PUT", collection); + var service = new CreateUpdateService(stack, resourcePath + "/move", moveModel, "term", "PUT", collection); return stack.client.InvokeSync(service); } @@ -156,7 +156,7 @@ public Task MoveAsync(TermMoveModel moveModel, ParameterCo { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new CreateUpdateService(stack.client.serializer, stack, resourcePath + "/move", moveModel, "term", "PUT", collection); + var service = new CreateUpdateService(stack, resourcePath + "/move", moveModel, "term", "PUT", collection); return stack.client.InvokeAsync, ContentstackResponse>(service); } @@ -167,7 +167,7 @@ public ContentstackResponse Locales(ParameterCollection collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, resourcePath + "/locales", "GET", collection); + var service = new FetchDeleteService(stack, resourcePath + "/locales", "GET", collection); return stack.client.InvokeSync(service); } @@ -178,7 +178,7 @@ public Task LocalesAsync(ParameterCollection collection = { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, resourcePath + "/locales", "GET", collection); + var service = new FetchDeleteService(stack, resourcePath + "/locales", "GET", collection); return stack.client.InvokeAsync(service); } @@ -189,7 +189,7 @@ public ContentstackResponse Localize(TermModel model, ParameterCollection collec { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new CreateUpdateService(stack.client.serializer, stack, resourcePath, model, "term", "POST", collection); + var service = new CreateUpdateService(stack, resourcePath, model, "term", "POST", collection); return stack.client.InvokeSync(service); } @@ -200,7 +200,7 @@ public Task LocalizeAsync(TermModel model, ParameterCollec { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new CreateUpdateService(stack.client.serializer, stack, resourcePath, model, "term", "POST", collection); + var service = new CreateUpdateService(stack, resourcePath, model, "term", "POST", collection); return stack.client.InvokeAsync, ContentstackResponse>(service); } @@ -215,7 +215,7 @@ public ContentstackResponse Search(string typeahead, ParameterCollection collect ThrowIfUidNotEmpty(); var coll = collection ?? new ParameterCollection(); coll.Add("typeahead", typeahead ?? string.Empty); - var service = new FetchDeleteService(stack.client.serializer, stack, "/taxonomies/$all/terms", "GET", coll); + var service = new FetchDeleteService(stack, "/taxonomies/$all/terms", "GET", coll); return stack.client.InvokeSync(service); } @@ -228,7 +228,7 @@ public Task SearchAsync(string typeahead, ParameterCollect ThrowIfUidNotEmpty(); var coll = collection ?? new ParameterCollection(); coll.Add("typeahead", typeahead ?? string.Empty); - var service = new FetchDeleteService(stack.client.serializer, stack, "/taxonomies/$all/terms", "GET", coll); + var service = new FetchDeleteService(stack, "/taxonomies/$all/terms", "GET", coll); return stack.client.InvokeAsync(service); } } diff --git a/Contentstack.Management.Core/Models/Webhook.cs b/Contentstack.Management.Core/Models/Webhook.cs index 6c579ae..62eba2a 100644 --- a/Contentstack.Management.Core/Models/Webhook.cs +++ b/Contentstack.Management.Core/Models/Webhook.cs @@ -171,7 +171,7 @@ public ContentstackResponse Executions(ParameterCollection collection = null) stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, $"{resourcePath}/executions", collection: collection); + var service = new FetchDeleteService(stack, $"{resourcePath}/executions", collection: collection); return stack.client.InvokeSync(service); } @@ -190,7 +190,7 @@ public Task ExecutionsAsync(ParameterCollection collection stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, $"{resourcePath}/executions", collection: collection); + var service = new FetchDeleteService(stack, $"{resourcePath}/executions", collection: collection); return stack.client.InvokeAsync(service); } @@ -211,7 +211,7 @@ public ContentstackResponse Retry(string executionUid) stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, $"/webhooks/{executionUid}/retry", httpMethod: "POST"); + var service = new FetchDeleteService(stack, $"/webhooks/{executionUid}/retry", httpMethod: "POST"); return stack.client.InvokeSync(service); } @@ -231,7 +231,7 @@ public Task RetryAsync(string executionUid) stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, $"/webhooks/{executionUid}/retry", httpMethod: "POST"); + var service = new FetchDeleteService(stack, $"/webhooks/{executionUid}/retry", httpMethod: "POST"); return stack.client.InvokeAsync(service); } @@ -252,7 +252,7 @@ public ContentstackResponse Logs(string executionUid) stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, $"/webhooks/{executionUid}/logs"); + var service = new FetchDeleteService(stack, $"/webhooks/{executionUid}/logs"); return stack.client.InvokeSync(service); } @@ -272,7 +272,7 @@ public Task LogsAsync(string executionUid) stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack, $"/webhooks/{executionUid}/logs"); + var service = new FetchDeleteService(stack, $"/webhooks/{executionUid}/logs"); return stack.client.InvokeAsync(service); } diff --git a/Contentstack.Management.Core/Models/Workflow.cs b/Contentstack.Management.Core/Models/Workflow.cs index 14a32d2..1871f61 100644 --- a/Contentstack.Management.Core/Models/Workflow.cs +++ b/Contentstack.Management.Core/Models/Workflow.cs @@ -30,7 +30,7 @@ public virtual ContentstackResponse FindAll(ParameterCollection collection = nul stack.ThrowIfNotLoggedIn(); ThrowIfUidNotEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack,resourcePath, collection: collection); + var service = new FetchDeleteService(stack,resourcePath, collection: collection); return stack.client.InvokeSync(service); } @@ -50,7 +50,7 @@ public virtual Task FindAllAsync(ParameterCollection colle stack.ThrowIfNotLoggedIn(); ThrowIfUidNotEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack,resourcePath, collection: collection); + var service = new FetchDeleteService(stack,resourcePath, collection: collection); return stack.client.InvokeAsync(service); } @@ -197,7 +197,7 @@ public virtual ContentstackResponse Disable() stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack,$"{resourcePath}/disable"); + var service = new FetchDeleteService(stack,$"{resourcePath}/disable"); return stack.client.InvokeSync(service); } @@ -216,7 +216,7 @@ public virtual Task DisableAsync() stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack,$"{resourcePath}/disable"); + var service = new FetchDeleteService(stack,$"{resourcePath}/disable"); return stack.client.InvokeAsync(service); } @@ -235,7 +235,7 @@ public virtual ContentstackResponse Enable() stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack,$"{resourcePath}/enable"); + var service = new FetchDeleteService(stack,$"{resourcePath}/enable"); return stack.client.InvokeSync(service); } @@ -254,7 +254,7 @@ public virtual Task EnableAsync() stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); - var service = new FetchDeleteService(stack.client.serializer, stack,$"{resourcePath}/enable"); + var service = new FetchDeleteService(stack,$"{resourcePath}/enable"); return stack.client.InvokeAsync(service); } @@ -292,7 +292,7 @@ public virtual ContentstackResponse GetPublishRule(string contentType, Parameter throw new ArgumentNullException("contentType", CSConstants.ContentTypeRequired); } - var service = new FetchDeleteService(stack.client.serializer, stack,$"/workflows/content_type/{contentType}", collection: collection); + var service = new FetchDeleteService(stack,$"/workflows/content_type/{contentType}", collection: collection); return stack.client.InvokeSync(service); } @@ -313,7 +313,7 @@ public virtual Task GetPublishRuleAsync(string contentType { throw new ArgumentNullException("contentType", CSConstants.ContentTypeRequired); } - var service = new FetchDeleteService(stack.client.serializer, stack,$"/workflows/content_type/{contentType}", collection: collection); + var service = new FetchDeleteService(stack,$"/workflows/content_type/{contentType}", collection: collection); return stack.client.InvokeAsync(service); } } diff --git a/Contentstack.Management.Core/contentstack.management.core.csproj b/Contentstack.Management.Core/contentstack.management.core.csproj index 8e04e7a..c4eba51 100644 --- a/Contentstack.Management.Core/contentstack.management.core.csproj +++ b/Contentstack.Management.Core/contentstack.management.core.csproj @@ -89,17 +89,17 @@ - + - - + + - - + + @@ -111,7 +111,7 @@ - + From 987b8afeb4e25484e29a4c3ce85552c087431794 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Thu, 28 May 2026 11:45:50 +0530 Subject: [PATCH 2/3] refactor: update WorkflowTest assertions to use GetValue for JSON properties --- .../Contentstack.Management.Core.Tests.csproj | 3 --- .../IntegrationTest/Contentstack020_WorkflowTest.cs | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Contentstack.Management.Core.Tests/Contentstack.Management.Core.Tests.csproj b/Contentstack.Management.Core.Tests/Contentstack.Management.Core.Tests.csproj index ad6ede9..ddf7b54 100644 --- a/Contentstack.Management.Core.Tests/Contentstack.Management.Core.Tests.csproj +++ b/Contentstack.Management.Core.Tests/Contentstack.Management.Core.Tests.csproj @@ -58,9 +58,6 @@ - - - diff --git a/Contentstack.Management.Core.Tests/IntegrationTest/Contentstack020_WorkflowTest.cs b/Contentstack.Management.Core.Tests/IntegrationTest/Contentstack020_WorkflowTest.cs index 79bd43d..5bd16fa 100644 --- a/Contentstack.Management.Core.Tests/IntegrationTest/Contentstack020_WorkflowTest.cs +++ b/Contentstack.Management.Core.Tests/IntegrationTest/Contentstack020_WorkflowTest.cs @@ -1326,7 +1326,7 @@ public void Test005_Should_Update_Workflow_Properties() AssertLogger.IsTrue(response.IsSuccessStatusCode, $"Workflow update failed with status {(int)response.StatusCode}", "workflowUpdateSuccess"); AssertLogger.IsNotNull(responseJson["workflow"], "workflowObject"); AssertLogger.AreEqual(updatedName, responseJson["workflow"]["name"]?.ToString(), "updatedWorkflowName"); - AssertLogger.AreEqual(false, responseJson["workflow"]["enabled"]?.Value(), "updatedEnabledStatus"); + AssertLogger.AreEqual(false, responseJson["workflow"]["enabled"]?.GetValue(), "updatedEnabledStatus"); TestOutputLogger.LogContext("UpdatedWorkflowUid", workflowUid); } @@ -1600,7 +1600,7 @@ public async Task Test012_Should_Update_Publish_Rule() // Assert AssertLogger.IsNotNull(response, "publishRuleUpdateResponse"); AssertLogger.IsTrue(response.IsSuccessStatusCode, $"Publish rule update failed with status {(int)response.StatusCode}", "publishRuleUpdateSuccess"); - AssertLogger.AreEqual(true, responseJson["publishing_rule"]["disable_approver_publishing"]?.Value(), "updatedDisableApproval"); + AssertLogger.AreEqual(true, responseJson["publishing_rule"]["disable_approver_publishing"]?.GetValue(), "updatedDisableApproval"); TestOutputLogger.LogContext("UpdatedPublishRuleUid", publishRuleUid); } From f05d48b1f2147a1cdea0d0dafd64b9e2b6ca358b Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Fri, 29 May 2026 12:56:13 +0530 Subject: [PATCH 3/3] refactor: update models to use nullable string parameters for uid and collection --- .../Models/PublishRule.cs | 22 +++++----- Contentstack.Management.Core/Models/Stack.cs | 10 ++--- .../Models/Taxonomy.cs | 36 ++++++++-------- Contentstack.Management.Core/Models/Term.cs | 42 +++++++++---------- .../Models/Token/DeliveryToken.cs | 18 ++++---- .../Models/Token/ManagementToken.cs | 18 ++++---- .../Models/Webhook.cs | 22 +++++----- .../Models/Workflow.cs | 24 +++++------ 8 files changed, 96 insertions(+), 96 deletions(-) diff --git a/Contentstack.Management.Core/Models/PublishRule.cs b/Contentstack.Management.Core/Models/PublishRule.cs index b1a7bf2..3cbd0e9 100644 --- a/Contentstack.Management.Core/Models/PublishRule.cs +++ b/Contentstack.Management.Core/Models/PublishRule.cs @@ -6,7 +6,7 @@ namespace Contentstack.Management.Core.Models { public class PublishRule: BaseModel { - internal PublishRule(Stack stack, string uid) + internal PublishRule(Stack stack, string? uid) : base(stack, "publishing_rule", uid) { resourcePath = uid == null ? "/workflows/publishing_rules" : $"/workflows/publishing_rules/{uid}"; @@ -23,7 +23,7 @@ internal PublishRule(Stack stack, string uid) /// /// /// The . - public virtual ContentstackResponse FindAll(ParameterCollection collection = null) + public virtual ContentstackResponse FindAll(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidNotEmpty(); @@ -43,7 +43,7 @@ public virtual ContentstackResponse FindAll(ParameterCollection collection = nul /// /// /// The . - public virtual Task FindAllAsync(ParameterCollection collection = null) + public virtual Task FindAllAsync(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidNotEmpty(); @@ -64,7 +64,7 @@ public virtual Task FindAllAsync(ParameterCollection colle /// /// PublishRule Model for creating workflow. /// - public override ContentstackResponse Create(PublishRuleModel model, ParameterCollection collection = null) + public override ContentstackResponse Create(PublishRuleModel model, ParameterCollection? collection = null) { return base.Create(model, collection); } @@ -81,7 +81,7 @@ public override ContentstackResponse Create(PublishRuleModel model, ParameterCol /// /// PublishRule Model for creating workflow. /// - public override Task CreateAsync(PublishRuleModel model, ParameterCollection collection = null) + public override Task CreateAsync(PublishRuleModel model, ParameterCollection? collection = null) { return base.CreateAsync(model, collection); } @@ -98,7 +98,7 @@ public override Task CreateAsync(PublishRuleModel model, P /// /// PublishRule Model for updating Content Type. /// - public override ContentstackResponse Update(PublishRuleModel model, ParameterCollection collection = null) + public override ContentstackResponse Update(PublishRuleModel model, ParameterCollection? collection = null) { return base.Update(model, collection); } @@ -115,7 +115,7 @@ public override ContentstackResponse Update(PublishRuleModel model, ParameterCol /// /// PublishRule Model for updating Content Type. /// - public override Task UpdateAsync(PublishRuleModel model, ParameterCollection collection = null) + public override Task UpdateAsync(PublishRuleModel model, ParameterCollection? collection = null) { return base.UpdateAsync(model, collection); } @@ -130,7 +130,7 @@ public override Task UpdateAsync(PublishRuleModel model, P /// /// /// The . - public override ContentstackResponse Fetch(ParameterCollection collection = null) + public override ContentstackResponse Fetch(ParameterCollection? collection = null) { return base.Fetch(collection); } @@ -145,7 +145,7 @@ public override ContentstackResponse Fetch(ParameterCollection collection = null /// /// /// The Task. - public override Task FetchAsync(ParameterCollection collection = null) + public override Task FetchAsync(ParameterCollection? collection = null) { return base.FetchAsync(collection); } @@ -160,7 +160,7 @@ public override Task FetchAsync(ParameterCollection collec /// /// /// The . - public override ContentstackResponse Delete(ParameterCollection collection = null) + public override ContentstackResponse Delete(ParameterCollection? collection = null) { return base.Delete(collection); } @@ -175,7 +175,7 @@ public override ContentstackResponse Delete(ParameterCollection collection = nul /// /// /// The Task. - public override Task DeleteAsync(ParameterCollection collection = null) + public override Task DeleteAsync(ParameterCollection? collection = null) { return base.DeleteAsync(collection); } diff --git a/Contentstack.Management.Core/Models/Stack.cs b/Contentstack.Management.Core/Models/Stack.cs index e1c6e49..322ff9b 100644 --- a/Contentstack.Management.Core/Models/Stack.cs +++ b/Contentstack.Management.Core/Models/Stack.cs @@ -718,7 +718,7 @@ public Label Label(string uid = null) /// /// /// The - public Taxonomy Taxonomy(string uid = null) + public Taxonomy Taxonomy(string? uid = null) { ThrowIfNotLoggedIn(); ThrowIfAPIKeyEmpty(); @@ -758,7 +758,7 @@ public Environment Environment(string? uid = null) /// /// /// The - public DeliveryToken DeliveryToken(string uid = null) + public DeliveryToken DeliveryToken(string? uid = null) { ThrowIfNotLoggedIn(); ThrowIfAPIKeyEmpty(); @@ -778,7 +778,7 @@ public DeliveryToken DeliveryToken(string uid = null) /// /// /// The - public ManagementToken ManagementTokens(string uid = null) + public ManagementToken ManagementTokens(string? uid = null) { ThrowIfNotLoggedIn(); ThrowIfAPIKeyEmpty(); @@ -843,7 +843,7 @@ public Release Release(string uid = null) /// /// /// The - public Workflow Workflow(string uid = null) + public Workflow Workflow(string? uid = null) { ThrowIfNotLoggedIn(); ThrowIfAPIKeyEmpty(); @@ -885,7 +885,7 @@ public PublishQueue PublishQueue(string uid = null) /// /// /// The - public Webhook Webhook(string uid = null) + public Webhook Webhook(string? uid = null) { ThrowIfNotLoggedIn(); ThrowIfAPIKeyEmpty(); diff --git a/Contentstack.Management.Core/Models/Taxonomy.cs b/Contentstack.Management.Core/Models/Taxonomy.cs index 3a22ea4..3614312 100644 --- a/Contentstack.Management.Core/Models/Taxonomy.cs +++ b/Contentstack.Management.Core/Models/Taxonomy.cs @@ -10,7 +10,7 @@ namespace Contentstack.Management.Core.Models /// public class Taxonomy : BaseModel { - internal Taxonomy(Stack stack, string uid = null) + internal Taxonomy(Stack stack, string? uid = null) : base(stack, "taxonomy", uid) { resourcePath = uid == null ? "/taxonomies" : $"/taxonomies/{uid}"; @@ -33,7 +33,7 @@ public Query Query() /// /// Create a taxonomy. /// - public override ContentstackResponse Create(TaxonomyModel model, ParameterCollection collection = null) + public override ContentstackResponse Create(TaxonomyModel model, ParameterCollection? collection = null) { return base.Create(model, collection); } @@ -41,7 +41,7 @@ public override ContentstackResponse Create(TaxonomyModel model, ParameterCollec /// /// Create a taxonomy asynchronously. /// - public override Task CreateAsync(TaxonomyModel model, ParameterCollection collection = null) + public override Task CreateAsync(TaxonomyModel model, ParameterCollection? collection = null) { return base.CreateAsync(model, collection); } @@ -49,7 +49,7 @@ public override Task CreateAsync(TaxonomyModel model, Para /// /// Update an existing taxonomy. /// - public override ContentstackResponse Update(TaxonomyModel model, ParameterCollection collection = null) + public override ContentstackResponse Update(TaxonomyModel model, ParameterCollection? collection = null) { return base.Update(model, collection); } @@ -57,7 +57,7 @@ public override ContentstackResponse Update(TaxonomyModel model, ParameterCollec /// /// Update an existing taxonomy asynchronously. /// - public override Task UpdateAsync(TaxonomyModel model, ParameterCollection collection = null) + public override Task UpdateAsync(TaxonomyModel model, ParameterCollection? collection = null) { return base.UpdateAsync(model, collection); } @@ -65,7 +65,7 @@ public override Task UpdateAsync(TaxonomyModel model, Para /// /// Fetch a single taxonomy. /// - public override ContentstackResponse Fetch(ParameterCollection collection = null) + public override ContentstackResponse Fetch(ParameterCollection? collection = null) { return base.Fetch(collection); } @@ -73,7 +73,7 @@ public override ContentstackResponse Fetch(ParameterCollection collection = null /// /// Fetch a single taxonomy asynchronously. /// - public override Task FetchAsync(ParameterCollection collection = null) + public override Task FetchAsync(ParameterCollection? collection = null) { return base.FetchAsync(collection); } @@ -81,7 +81,7 @@ public override Task FetchAsync(ParameterCollection collec /// /// Delete a taxonomy. /// - public override ContentstackResponse Delete(ParameterCollection collection = null) + public override ContentstackResponse Delete(ParameterCollection? collection = null) { return base.Delete(collection); } @@ -89,7 +89,7 @@ public override ContentstackResponse Delete(ParameterCollection collection = nul /// /// Delete a taxonomy asynchronously. /// - public override Task DeleteAsync(ParameterCollection collection = null) + public override Task DeleteAsync(ParameterCollection? collection = null) { return base.DeleteAsync(collection); } @@ -97,7 +97,7 @@ public override Task DeleteAsync(ParameterCollection colle /// /// Export taxonomy. GET {resourcePath}/export with optional query parameters. /// - public ContentstackResponse Export(ParameterCollection collection = null) + public ContentstackResponse Export(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -108,7 +108,7 @@ public ContentstackResponse Export(ParameterCollection collection = null) /// /// Export taxonomy asynchronously. /// - public Task ExportAsync(ParameterCollection collection = null) + public Task ExportAsync(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -119,7 +119,7 @@ public Task ExportAsync(ParameterCollection collection = n /// /// Get taxonomy locales. GET {resourcePath}/locales. /// - public ContentstackResponse Locales(ParameterCollection collection = null) + public ContentstackResponse Locales(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -130,7 +130,7 @@ public ContentstackResponse Locales(ParameterCollection collection = null) /// /// Get taxonomy locales asynchronously. /// - public Task LocalesAsync(ParameterCollection collection = null) + public Task LocalesAsync(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -141,7 +141,7 @@ public Task LocalesAsync(ParameterCollection collection = /// /// Localize taxonomy. POST to resourcePath with body { taxonomy: model } and query params (e.g. locale). /// - public ContentstackResponse Localize(TaxonomyModel model, ParameterCollection collection = null) + public ContentstackResponse Localize(TaxonomyModel model, ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -152,7 +152,7 @@ public ContentstackResponse Localize(TaxonomyModel model, ParameterCollection co /// /// Localize taxonomy asynchronously. /// - public Task LocalizeAsync(TaxonomyModel model, ParameterCollection collection = null) + public Task LocalizeAsync(TaxonomyModel model, ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -163,7 +163,7 @@ public Task LocalizeAsync(TaxonomyModel model, ParameterCo /// /// Import taxonomy. POST /taxonomies/import with multipart form (taxonomy file). /// - public ContentstackResponse Import(TaxonomyImportModel model, ParameterCollection collection = null) + public ContentstackResponse Import(TaxonomyImportModel model, ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidNotEmpty(); @@ -175,7 +175,7 @@ public ContentstackResponse Import(TaxonomyImportModel model, ParameterCollectio /// /// Import taxonomy asynchronously. /// - public Task ImportAsync(TaxonomyImportModel model, ParameterCollection collection = null) + public Task ImportAsync(TaxonomyImportModel model, ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidNotEmpty(); @@ -194,7 +194,7 @@ public Task ImportAsync(TaxonomyImportModel model, Paramet /// stack.Taxonomy("taxonomy_uid").Terms("term_uid").Fetch(); /// /// - public Term Terms(string termUid = null) + public Term Terms(string? termUid = null) { ThrowIfUidEmpty(); return new Term(stack, Uid, termUid); diff --git a/Contentstack.Management.Core/Models/Term.cs b/Contentstack.Management.Core/Models/Term.cs index 473527d..4b00ecc 100644 --- a/Contentstack.Management.Core/Models/Term.cs +++ b/Contentstack.Management.Core/Models/Term.cs @@ -12,7 +12,7 @@ public class Term : BaseModel { private readonly string _taxonomyUid; - internal Term(Stack stack, string taxonomyUid, string termUid = null) + internal Term(Stack stack, string taxonomyUid, string? termUid = null) : base(stack, "term", termUid) { _taxonomyUid = taxonomyUid ?? throw new ArgumentNullException(nameof(taxonomyUid)); @@ -33,7 +33,7 @@ public Query Query() /// /// Create a term in this taxonomy. /// - public override ContentstackResponse Create(TermModel model, ParameterCollection collection = null) + public override ContentstackResponse Create(TermModel model, ParameterCollection? collection = null) { return base.Create(model, collection); } @@ -41,7 +41,7 @@ public override ContentstackResponse Create(TermModel model, ParameterCollection /// /// Create a term asynchronously. /// - public override Task CreateAsync(TermModel model, ParameterCollection collection = null) + public override Task CreateAsync(TermModel model, ParameterCollection? collection = null) { return base.CreateAsync(model, collection); } @@ -49,7 +49,7 @@ public override Task CreateAsync(TermModel model, Paramete /// /// Update an existing term. /// - public override ContentstackResponse Update(TermModel model, ParameterCollection collection = null) + public override ContentstackResponse Update(TermModel model, ParameterCollection? collection = null) { return base.Update(model, collection); } @@ -57,7 +57,7 @@ public override ContentstackResponse Update(TermModel model, ParameterCollection /// /// Update an existing term asynchronously. /// - public override Task UpdateAsync(TermModel model, ParameterCollection collection = null) + public override Task UpdateAsync(TermModel model, ParameterCollection? collection = null) { return base.UpdateAsync(model, collection); } @@ -65,7 +65,7 @@ public override Task UpdateAsync(TermModel model, Paramete /// /// Fetch a single term. /// - public override ContentstackResponse Fetch(ParameterCollection collection = null) + public override ContentstackResponse Fetch(ParameterCollection? collection = null) { return base.Fetch(collection); } @@ -73,7 +73,7 @@ public override ContentstackResponse Fetch(ParameterCollection collection = null /// /// Fetch a single term asynchronously. /// - public override Task FetchAsync(ParameterCollection collection = null) + public override Task FetchAsync(ParameterCollection? collection = null) { return base.FetchAsync(collection); } @@ -81,7 +81,7 @@ public override Task FetchAsync(ParameterCollection collec /// /// Delete a term. /// - public override ContentstackResponse Delete(ParameterCollection collection = null) + public override ContentstackResponse Delete(ParameterCollection? collection = null) { return base.Delete(collection); } @@ -89,7 +89,7 @@ public override ContentstackResponse Delete(ParameterCollection collection = nul /// /// Delete a term asynchronously. /// - public override Task DeleteAsync(ParameterCollection collection = null) + public override Task DeleteAsync(ParameterCollection? collection = null) { return base.DeleteAsync(collection); } @@ -97,7 +97,7 @@ public override Task DeleteAsync(ParameterCollection colle /// /// Get ancestor terms of this term. GET {resourcePath}/ancestors. /// - public ContentstackResponse Ancestors(ParameterCollection collection = null) + public ContentstackResponse Ancestors(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -108,7 +108,7 @@ public ContentstackResponse Ancestors(ParameterCollection collection = null) /// /// Get ancestor terms asynchronously. /// - public Task AncestorsAsync(ParameterCollection collection = null) + public Task AncestorsAsync(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -119,7 +119,7 @@ public Task AncestorsAsync(ParameterCollection collection /// /// Get descendant terms of this term. GET {resourcePath}/descendants. /// - public ContentstackResponse Descendants(ParameterCollection collection = null) + public ContentstackResponse Descendants(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -130,7 +130,7 @@ public ContentstackResponse Descendants(ParameterCollection collection = null) /// /// Get descendant terms asynchronously. /// - public Task DescendantsAsync(ParameterCollection collection = null) + public Task DescendantsAsync(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -141,7 +141,7 @@ public Task DescendantsAsync(ParameterCollection collectio /// /// Move term to a new parent and/or order. PUT {resourcePath}/move with body { term: moveModel }. /// - public ContentstackResponse Move(TermMoveModel moveModel, ParameterCollection collection = null) + public ContentstackResponse Move(TermMoveModel moveModel, ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -152,7 +152,7 @@ public ContentstackResponse Move(TermMoveModel moveModel, ParameterCollection co /// /// Move term asynchronously. /// - public Task MoveAsync(TermMoveModel moveModel, ParameterCollection collection = null) + public Task MoveAsync(TermMoveModel moveModel, ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -163,7 +163,7 @@ public Task MoveAsync(TermMoveModel moveModel, ParameterCo /// /// Get term locales. GET {resourcePath}/locales. /// - public ContentstackResponse Locales(ParameterCollection collection = null) + public ContentstackResponse Locales(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -174,7 +174,7 @@ public ContentstackResponse Locales(ParameterCollection collection = null) /// /// Get term locales asynchronously. /// - public Task LocalesAsync(ParameterCollection collection = null) + public Task LocalesAsync(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -185,7 +185,7 @@ public Task LocalesAsync(ParameterCollection collection = /// /// Localize term. POST to resourcePath with body { term: model } and query params (e.g. locale). /// - public ContentstackResponse Localize(TermModel model, ParameterCollection collection = null) + public ContentstackResponse Localize(TermModel model, ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -196,7 +196,7 @@ public ContentstackResponse Localize(TermModel model, ParameterCollection collec /// /// Localize term asynchronously. /// - public Task LocalizeAsync(TermModel model, ParameterCollection collection = null) + public Task LocalizeAsync(TermModel model, ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -209,7 +209,7 @@ public Task LocalizeAsync(TermModel model, ParameterCollec /// /// Search string for typeahead. /// Optional additional query parameters. - public ContentstackResponse Search(string typeahead, ParameterCollection collection = null) + public ContentstackResponse Search(string typeahead, ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidNotEmpty(); @@ -222,7 +222,7 @@ public ContentstackResponse Search(string typeahead, ParameterCollection collect /// /// Search terms across all taxonomies asynchronously. /// - public Task SearchAsync(string typeahead, ParameterCollection collection = null) + public Task SearchAsync(string typeahead, ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidNotEmpty(); diff --git a/Contentstack.Management.Core/Models/Token/DeliveryToken.cs b/Contentstack.Management.Core/Models/Token/DeliveryToken.cs index 3840bb0..a7f7d4d 100644 --- a/Contentstack.Management.Core/Models/Token/DeliveryToken.cs +++ b/Contentstack.Management.Core/Models/Token/DeliveryToken.cs @@ -6,7 +6,7 @@ namespace Contentstack.Management.Core.Models.Token { public class DeliveryToken : BaseModel { - internal DeliveryToken(Stack stack, string uid = null) + internal DeliveryToken(Stack stack, string? uid = null) : base(stack, "token", uid) { resourcePath = uid == null ? "stacks/delivery_tokens" : $"stacks/delivery_tokens/{uid}"; @@ -40,7 +40,7 @@ public Query Query() /// /// DeliveryToken Model for creating DeliveryToken. /// The . - public override ContentstackResponse Create(DeliveryTokenModel model, ParameterCollection collection = null) + public override ContentstackResponse Create(DeliveryTokenModel model, ParameterCollection? collection = null) { return base.Create(model, collection); } @@ -57,7 +57,7 @@ public override ContentstackResponse Create(DeliveryTokenModel model, ParameterC /// /// DeliveryToken Model for creating DeliveryToken. /// The Task. - public override Task CreateAsync(DeliveryTokenModel model, ParameterCollection collection = null) + public override Task CreateAsync(DeliveryTokenModel model, ParameterCollection? collection = null) { return base.CreateAsync(model, collection); } @@ -74,7 +74,7 @@ public override Task CreateAsync(DeliveryTokenModel model, /// /// DeliveryToken Model for creating DeliveryToken. /// The . - public override ContentstackResponse Update(DeliveryTokenModel model, ParameterCollection collection = null) + public override ContentstackResponse Update(DeliveryTokenModel model, ParameterCollection? collection = null) { return base.Update(model, collection); } @@ -91,7 +91,7 @@ public override ContentstackResponse Update(DeliveryTokenModel model, ParameterC /// /// DeliveryToken Model for creating DeliveryToken. /// The Task. - public override Task UpdateAsync(DeliveryTokenModel model, ParameterCollection collection = null) + public override Task UpdateAsync(DeliveryTokenModel model, ParameterCollection? collection = null) { return base.UpdateAsync(model, collection); } @@ -106,7 +106,7 @@ public override Task UpdateAsync(DeliveryTokenModel model, /// /// /// The . - public override ContentstackResponse Fetch(ParameterCollection collection = null) + public override ContentstackResponse Fetch(ParameterCollection? collection = null) { return base.Fetch(collection); } @@ -121,7 +121,7 @@ public override ContentstackResponse Fetch(ParameterCollection collection = null /// /// /// The Task. - public override Task FetchAsync(ParameterCollection collection = null) + public override Task FetchAsync(ParameterCollection? collection = null) { return base.FetchAsync(collection); } @@ -136,7 +136,7 @@ public override Task FetchAsync(ParameterCollection collec /// /// /// The . - public override ContentstackResponse Delete(ParameterCollection collection = null) + public override ContentstackResponse Delete(ParameterCollection? collection = null) { return base.Delete(collection); } @@ -151,7 +151,7 @@ public override ContentstackResponse Delete(ParameterCollection collection = nul /// /// /// The Task. - public override Task DeleteAsync(ParameterCollection collection = null) + public override Task DeleteAsync(ParameterCollection? collection = null) { return base.DeleteAsync(collection); } diff --git a/Contentstack.Management.Core/Models/Token/ManagementToken.cs b/Contentstack.Management.Core/Models/Token/ManagementToken.cs index f05a9b6..83f51b9 100644 --- a/Contentstack.Management.Core/Models/Token/ManagementToken.cs +++ b/Contentstack.Management.Core/Models/Token/ManagementToken.cs @@ -5,7 +5,7 @@ namespace Contentstack.Management.Core.Models.Token { public class ManagementToken : BaseModel { - internal ManagementToken(Stack stack, string uid = null) + internal ManagementToken(Stack stack, string? uid = null) : base(stack, "token", uid) { resourcePath = uid == null ? "/delivery_tokens" : $"/delivery_tokens/{uid}"; @@ -40,7 +40,7 @@ public Query Query() /// /// ManagementToken Model for creating ManagementToken. /// The . - public override ContentstackResponse Create(ManagementTokenModel model, ParameterCollection collection = null) + public override ContentstackResponse Create(ManagementTokenModel model, ParameterCollection? collection = null) { return base.Create(model, collection); } @@ -58,7 +58,7 @@ public override ContentstackResponse Create(ManagementTokenModel model, Paramete /// /// ManagementToken Model for creating ManagementToken. /// The Task. - public override Task CreateAsync(ManagementTokenModel model, ParameterCollection collection = null) + public override Task CreateAsync(ManagementTokenModel model, ParameterCollection? collection = null) { return base.CreateAsync(model, collection); } @@ -78,7 +78,7 @@ public override Task CreateAsync(ManagementTokenModel mode /// /// ManagementToken Model for creating ManagementToken. /// The . - public override ContentstackResponse Update(ManagementTokenModel model, ParameterCollection collection = null) + public override ContentstackResponse Update(ManagementTokenModel model, ParameterCollection? collection = null) { return base.Update(model, collection); } @@ -98,7 +98,7 @@ public override ContentstackResponse Update(ManagementTokenModel model, Paramete /// /// ManagementToken Model for creating ManagementToken. /// The Task. - public override Task UpdateAsync(ManagementTokenModel model, ParameterCollection collection = null) + public override Task UpdateAsync(ManagementTokenModel model, ParameterCollection? collection = null) { return base.UpdateAsync(model, collection); } @@ -113,7 +113,7 @@ public override Task UpdateAsync(ManagementTokenModel mode /// /// /// The . - public override ContentstackResponse Fetch(ParameterCollection collection = null) + public override ContentstackResponse Fetch(ParameterCollection? collection = null) { return base.Fetch(collection); } @@ -128,7 +128,7 @@ public override ContentstackResponse Fetch(ParameterCollection collection = null /// /// /// The Task. - public override Task FetchAsync(ParameterCollection collection = null) + public override Task FetchAsync(ParameterCollection? collection = null) { return base.FetchAsync(collection); } @@ -143,7 +143,7 @@ public override Task FetchAsync(ParameterCollection collec /// /// /// The . - public override ContentstackResponse Delete(ParameterCollection collection = null) + public override ContentstackResponse Delete(ParameterCollection? collection = null) { return base.Delete(collection); } @@ -158,7 +158,7 @@ public override ContentstackResponse Delete(ParameterCollection collection = nul /// /// /// The Task. - public override Task DeleteAsync(ParameterCollection collection = null) + public override Task DeleteAsync(ParameterCollection? collection = null) { return base.DeleteAsync(collection); } diff --git a/Contentstack.Management.Core/Models/Webhook.cs b/Contentstack.Management.Core/Models/Webhook.cs index 62eba2a..ba19425 100644 --- a/Contentstack.Management.Core/Models/Webhook.cs +++ b/Contentstack.Management.Core/Models/Webhook.cs @@ -6,7 +6,7 @@ namespace Contentstack.Management.Core.Models { public class Webhook : BaseModel { - internal Webhook(Stack stack, string uid = null) + internal Webhook(Stack stack, string? uid = null) : base(stack, "webhook", uid) { resourcePath = uid == null ? "/webhooks" : $"/webhooks/{uid}"; @@ -40,7 +40,7 @@ public Query Query() /// /// Webhook Model for creating Webhook. /// The . - public override ContentstackResponse Create(WebhookModel model, ParameterCollection collection = null) + public override ContentstackResponse Create(WebhookModel model, ParameterCollection? collection = null) { return base.Create(model, collection); } @@ -57,7 +57,7 @@ public override ContentstackResponse Create(WebhookModel model, ParameterCollect /// /// Webhook Model for creating Webhook. /// The Task. - public override Task CreateAsync(WebhookModel model, ParameterCollection collection = null) + public override Task CreateAsync(WebhookModel model, ParameterCollection? collection = null) { return base.CreateAsync(model, collection); } @@ -74,7 +74,7 @@ public override Task CreateAsync(WebhookModel model, Param /// /// Webhook Model for creating Webhook. /// The . - public override ContentstackResponse Update(WebhookModel model, ParameterCollection collection = null) + public override ContentstackResponse Update(WebhookModel model, ParameterCollection? collection = null) { return base.Update(model, collection); } @@ -91,7 +91,7 @@ public override ContentstackResponse Update(WebhookModel model, ParameterCollect /// /// Webhook Model for creating Webhook. /// The Task. - public override Task UpdateAsync(WebhookModel model, ParameterCollection collection = null) + public override Task UpdateAsync(WebhookModel model, ParameterCollection? collection = null) { return base.UpdateAsync(model, collection); } @@ -106,7 +106,7 @@ public override Task UpdateAsync(WebhookModel model, Param /// /// /// The . - public override ContentstackResponse Fetch(ParameterCollection collection = null) + public override ContentstackResponse Fetch(ParameterCollection? collection = null) { return base.Fetch(collection); } @@ -121,7 +121,7 @@ public override ContentstackResponse Fetch(ParameterCollection collection = null /// /// /// The Task. - public override Task FetchAsync(ParameterCollection collection = null) + public override Task FetchAsync(ParameterCollection? collection = null) { return base.FetchAsync(collection); } @@ -136,7 +136,7 @@ public override Task FetchAsync(ParameterCollection collec /// /// /// The . - public override ContentstackResponse Delete(ParameterCollection collection = null) + public override ContentstackResponse Delete(ParameterCollection? collection = null) { return base.Delete(collection); } @@ -151,7 +151,7 @@ public override ContentstackResponse Delete(ParameterCollection collection = nul /// /// /// The Task. - public override Task DeleteAsync(ParameterCollection collection = null) + public override Task DeleteAsync(ParameterCollection? collection = null) { return base.DeleteAsync(collection); } @@ -166,7 +166,7 @@ public override Task DeleteAsync(ParameterCollection colle /// /// /// The . - public ContentstackResponse Executions(ParameterCollection collection = null) + public ContentstackResponse Executions(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); @@ -185,7 +185,7 @@ public ContentstackResponse Executions(ParameterCollection collection = null) /// /// /// The Task. - public Task ExecutionsAsync(ParameterCollection collection = null) + public Task ExecutionsAsync(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidEmpty(); diff --git a/Contentstack.Management.Core/Models/Workflow.cs b/Contentstack.Management.Core/Models/Workflow.cs index 1871f61..4f18302 100644 --- a/Contentstack.Management.Core/Models/Workflow.cs +++ b/Contentstack.Management.Core/Models/Workflow.cs @@ -8,7 +8,7 @@ namespace Contentstack.Management.Core.Models { public class Workflow: BaseModel { - internal Workflow(Stack stack, string uid) + internal Workflow(Stack stack, string? uid) : base(stack, "workflow", uid) { resourcePath = uid == null ? "/workflows" : $"/workflows/{uid}"; @@ -25,7 +25,7 @@ internal Workflow(Stack stack, string uid) /// /// /// The . - public virtual ContentstackResponse FindAll(ParameterCollection collection = null) + public virtual ContentstackResponse FindAll(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidNotEmpty(); @@ -45,7 +45,7 @@ public virtual ContentstackResponse FindAll(ParameterCollection collection = nul /// /// /// The . - public virtual Task FindAllAsync(ParameterCollection collection = null) + public virtual Task FindAllAsync(ParameterCollection? collection = null) { stack.ThrowIfNotLoggedIn(); ThrowIfUidNotEmpty(); @@ -66,7 +66,7 @@ public virtual Task FindAllAsync(ParameterCollection colle /// /// Workflow Model for creating workflow. /// - public override ContentstackResponse Create(WorkflowModel model, ParameterCollection collection = null) + public override ContentstackResponse Create(WorkflowModel model, ParameterCollection? collection = null) { return base.Create(model, collection); } @@ -83,7 +83,7 @@ public override ContentstackResponse Create(WorkflowModel model, ParameterCollec /// /// Workflow Model for creating workflow. /// - public override Task CreateAsync(WorkflowModel model, ParameterCollection collection = null) + public override Task CreateAsync(WorkflowModel model, ParameterCollection? collection = null) { return base.CreateAsync(model, collection); } @@ -100,7 +100,7 @@ public override Task CreateAsync(WorkflowModel model, Para /// /// Workflow Model for updating Content Type. /// - public override ContentstackResponse Update(WorkflowModel model, ParameterCollection collection = null) + public override ContentstackResponse Update(WorkflowModel model, ParameterCollection? collection = null) { return base.Update(model, collection); } @@ -117,7 +117,7 @@ public override ContentstackResponse Update(WorkflowModel model, ParameterCollec /// /// Workflow Model for updating Content Type. /// - public override Task UpdateAsync(WorkflowModel model, ParameterCollection collection = null) + public override Task UpdateAsync(WorkflowModel model, ParameterCollection? collection = null) { return base.UpdateAsync(model, collection); } @@ -132,7 +132,7 @@ public override Task UpdateAsync(WorkflowModel model, Para /// /// /// The . - public override ContentstackResponse Fetch(ParameterCollection collection = null) + public override ContentstackResponse Fetch(ParameterCollection? collection = null) { return base.Fetch(collection); } @@ -147,7 +147,7 @@ public override ContentstackResponse Fetch(ParameterCollection collection = null /// /// /// The Task. - public override Task FetchAsync(ParameterCollection collection = null) + public override Task FetchAsync(ParameterCollection? collection = null) { return base.FetchAsync(collection); } @@ -162,7 +162,7 @@ public override Task FetchAsync(ParameterCollection collec /// /// /// The . - public override ContentstackResponse Delete(ParameterCollection collection = null) + public override ContentstackResponse Delete(ParameterCollection? collection = null) { return base.Delete(collection); } @@ -177,7 +177,7 @@ public override ContentstackResponse Delete(ParameterCollection collection = nul /// /// /// The Task. - public override Task DeleteAsync(ParameterCollection collection = null) + public override Task DeleteAsync(ParameterCollection? collection = null) { return base.DeleteAsync(collection); } @@ -269,7 +269,7 @@ public virtual Task EnableAsync() /// /// Optional Publish rule uid for performing rule specific operation /// - public PublishRule PublishRule(string uid = null) + public PublishRule PublishRule(string? uid = null) { return new PublishRule(stack, uid); }