Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Changelog

## [v1.0.0-beta.1](https://github.com/contentstack/contentstack-management-dotnet/tree/v0.11.0-beta.1)
## [v1.0.0-beta.2](https://github.com/contentstack/contentstack-management-dotnet/tree/v1.0.0-beta.2)
- **System.Text.Json Migration Complete (Beta)**
- **✅ Core Modules STJ-Only**: Client, User, Organization, and Stack modules fully migrated
- **✅ Service Layer**: All User, Organization, Stack services converted to System.Text.Json
- **✅ Model Updates**: Updated constructors and service calls to use JsonSerializerOptions
- **✅ Response Handling**: Implemented OpenJsonObjectResponse() for STJ-based JSON parsing
- **✅ Backward Compatibility**: Non-migrated modules continue using Newtonsoft.Json
- **✅ Testing Infrastructure**: Comprehensive web application for STJ validation
- **Performance**: Improved JSON serialization performance and reduced memory footprint
- **Architecture**: Clean separation between STJ and Newtonsoft implementations

## [v1.0.0-beta.1](https://github.com/contentstack/contentstack-management-dotnet/tree/v1.0.0-beta.1)
- **Breaking Change**
- **System.Text.Json Migration (Beta)**
- Migrated core serialization from Newtonsoft.Json to System.Text.Json
Expand Down
8 changes: 1 addition & 7 deletions Contentstack.Management.Core/ContentstackClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ private void ThrowIfDisposed()
}
#endregion

/*
/// <summary>
/// <see cref="Models.User" /> session consists of calls that will help you to update user of your Contentstack account.
/// </summary>
Expand All @@ -322,9 +321,7 @@ public User User()
{
return new User(this);
}
*/

/*
/// <summary>
/// <see cref="Models.Organization" /> the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources, and users.
/// <see cref="Models.Organization" /> allows easy management of projects as well as users within the Organization.
Expand All @@ -341,9 +338,7 @@ public Organization Organization(string uid = null)
{
return new Organization(this, uid);
}
*/

/*
/// <summary>
/// <see cref="Models.Stack" /> is a space that stores the content of a project (a web or mobile property).
/// Within a stack, you can create content structures, content entries, users, etc. related to the project.
Expand All @@ -352,7 +347,7 @@ public Organization Organization(string uid = null)
/// <param name="managementToken">Stack Management token </param>
/// <example>
/// <pre><code>
/// ContentstackClient client = new ContentstackClient("<AUTHTOKEN>", "<API_HOST>");
/// ContentstackClient client = new ContentstackClient("<AUTHTOKEN>", "<API_KEY>");
/// Stack Stack = client.Stack("<API_KEY>");
/// </code></pre>
/// </example>
Expand All @@ -361,7 +356,6 @@ public Stack Stack(string apiKey = null, string managementToken = null, string b
{
return new Stack(this, apiKey, managementToken, branchUid);
}
*/

#region LoginMethod
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Contentstack.Management.Core/ContentstackResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Net.Http.Headers;
Expand Down
2 changes: 1 addition & 1 deletion Contentstack.Management.Core/IResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Net;
using System.Text.Json.Nodes;
using Newtonsoft.Json.Linq;
Expand Down
40 changes: 20 additions & 20 deletions Contentstack.Management.Core/Models/BulkOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@
/// ContentstackResponse response = stack.BulkOperation().Publish(publishDetails);
/// </code></pre>
/// </example>
public ContentstackResponse Publish(BulkPublishDetails details, bool skipWorkflowStage = false, bool approvals = false, bool isNested = false, string apiVersion = null)

Check warning on line 54 in Contentstack.Management.Core/Models/BulkOperation.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkPublishService(_stack.client.serializer, _stack, details, skipWorkflowStage, approvals, isNested);
var service = new BulkPublishService(_stack.client.SerializerOptions, _stack, details, skipWorkflowStage, approvals, isNested);
return _stack.client.InvokeSync(service, false, apiVersion);
}

Expand All @@ -69,12 +69,12 @@
/// <param name="isNested">Set to true for nested publish operations.</param>
/// <param name="apiVersion">The API version to use.</param>
/// <returns>The Task</returns>
public Task<ContentstackResponse> PublishAsync(BulkPublishDetails details, bool skipWorkflowStage = false, bool approvals = false, bool isNested = false, string apiVersion = null)

Check warning on line 72 in Contentstack.Management.Core/Models/BulkOperation.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkPublishService(_stack.client.serializer, _stack, details, skipWorkflowStage, approvals, isNested);
var service = new BulkPublishService(_stack.client.SerializerOptions, _stack, details, skipWorkflowStage, approvals, isNested);
return _stack.client.InvokeAsync<BulkPublishService, ContentstackResponse>(service, false, apiVersion);
}

Expand Down Expand Up @@ -109,12 +109,12 @@
/// ContentstackResponse response = stack.BulkOperation().Unpublish(unpublishDetails);
/// </code></pre>
/// </example>
public ContentstackResponse Unpublish(BulkPublishDetails details, bool skipWorkflowStage = false, bool approvals = false, bool isNested = false, string apiVersion = null)

Check warning on line 112 in Contentstack.Management.Core/Models/BulkOperation.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkUnpublishService(_stack.client.serializer, _stack, details, skipWorkflowStage, approvals, isNested);
var service = new BulkUnpublishService(_stack.client.SerializerOptions, _stack, details, skipWorkflowStage, approvals, isNested);
return _stack.client.InvokeSync(service, false, apiVersion);
}

Expand All @@ -127,12 +127,12 @@
/// <param name="isNested">Set to true for nested unpublish operations.</param>
/// <param name="apiVersion">The API version to use.</param>
/// <returns>The Task</returns>
public Task<ContentstackResponse> UnpublishAsync(BulkPublishDetails details, bool skipWorkflowStage = false, bool approvals = false, bool isNested = false, string apiVersion = null)

Check warning on line 130 in Contentstack.Management.Core/Models/BulkOperation.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkUnpublishService(_stack.client.serializer, _stack, details, skipWorkflowStage, approvals, isNested);
var service = new BulkUnpublishService(_stack.client.SerializerOptions, _stack, details, skipWorkflowStage, approvals, isNested);
return _stack.client.InvokeAsync<BulkUnpublishService, ContentstackResponse>(service, false, apiVersion);
}

Expand Down Expand Up @@ -166,7 +166,7 @@
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkDeleteService(_stack.client.serializer, _stack, details);
var service = new BulkDeleteService(_stack.client.SerializerOptions, _stack, details);
return _stack.client.InvokeSync(service);
}

Expand All @@ -180,7 +180,7 @@
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkDeleteService(_stack.client.serializer, _stack, details);
var service = new BulkDeleteService(_stack.client.SerializerOptions, _stack, details);
return _stack.client.InvokeAsync<BulkDeleteService, ContentstackResponse>(service);
}

Expand Down Expand Up @@ -219,7 +219,7 @@
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkWorkflowUpdateService(_stack.client.serializer, _stack, updateBody);
var service = new BulkWorkflowUpdateService(_stack.client.SerializerOptions, _stack, updateBody);
return _stack.client.InvokeSync(service);
}

Expand All @@ -235,7 +235,7 @@
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkWorkflowUpdateService(_stack.client.serializer, _stack, updateBody);
var service = new BulkWorkflowUpdateService(_stack.client.SerializerOptions, _stack, updateBody);
return _stack.client.InvokeAsync<BulkWorkflowUpdateService, ContentstackResponse>(service);
}

Expand Down Expand Up @@ -289,7 +289,7 @@
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkAddItemsService(_stack.client.serializer, _stack, data, bulkVersion);
var service = new BulkAddItemsService(_stack.client.SerializerOptions, _stack, data, bulkVersion);
return _stack.client.InvokeSync(service);
}

Expand Down Expand Up @@ -327,7 +327,7 @@
/// ContentstackResponse response = stack.BulkOperation().AddItemsWithDeployment(deployData, "release_uid", "publish", new List<string> { "en-us" }, true, "2.0");
/// </code></pre>
/// </example>
public ContentstackResponse AddItemsWithDeployment(BulkAddItemsData data, string releaseUid, string action, List<string> locales = null, bool? reference = null, string bulkVersion = null)

Check warning on line 330 in Contentstack.Management.Core/Models/BulkOperation.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.

Check warning on line 330 in Contentstack.Management.Core/Models/BulkOperation.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();
Expand All @@ -338,7 +338,7 @@
data.Locale = locales;
data.Reference = reference;

var service = new BulkAddItemsService(_stack.client.serializer, _stack, data, bulkVersion);
var service = new BulkAddItemsService(_stack.client.SerializerOptions, _stack, data, bulkVersion);
return _stack.client.InvokeSync(service);
}

Expand All @@ -355,7 +355,7 @@
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkAddItemsService(_stack.client.serializer, _stack, data, bulkVersion);
var service = new BulkAddItemsService(_stack.client.SerializerOptions, _stack, data, bulkVersion);
return _stack.client.InvokeAsync<BulkAddItemsService, ContentstackResponse>(service);
}

Expand All @@ -370,7 +370,7 @@
/// <param name="reference">Whether to include references. Only used when releaseUid is specified.</param>
/// <param name="bulkVersion">The bulk version.</param>
/// <returns>The Task</returns>
public Task<ContentstackResponse> AddItemsWithDeploymentAsync(BulkAddItemsData data, string releaseUid, string action, List<string> locales = null, bool? reference = null, string bulkVersion = null)

Check warning on line 373 in Contentstack.Management.Core/Models/BulkOperation.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.

Check warning on line 373 in Contentstack.Management.Core/Models/BulkOperation.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();
Expand All @@ -381,7 +381,7 @@
data.Locale = locales;
data.Reference = reference;

var service = new BulkAddItemsService(_stack.client.serializer, _stack, data, bulkVersion);
var service = new BulkAddItemsService(_stack.client.SerializerOptions, _stack, data, bulkVersion);
return _stack.client.InvokeAsync<BulkAddItemsService, ContentstackResponse>(service);
}

Expand Down Expand Up @@ -437,7 +437,7 @@
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkUpdateItemsService(_stack.client.serializer, _stack, data, bulkVersion);
var service = new BulkUpdateItemsService(_stack.client.SerializerOptions, _stack, data, bulkVersion);
return _stack.client.InvokeSync(service);
}

Expand Down Expand Up @@ -475,7 +475,7 @@
/// ContentstackResponse response = stack.BulkOperation().UpdateItemsWithDeployment(deployData, "release_uid", "publish", new List<string> { "en-us" }, true, "2.0");
/// </code></pre>
/// </example>
public ContentstackResponse UpdateItemsWithDeployment(BulkAddItemsData data, string releaseUid, string action, List<string> locales = null, bool? reference = null, string bulkVersion = null)

Check warning on line 478 in Contentstack.Management.Core/Models/BulkOperation.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.

Check warning on line 478 in Contentstack.Management.Core/Models/BulkOperation.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();
Expand All @@ -486,7 +486,7 @@
data.Locale = locales;
data.Reference = reference;

var service = new BulkUpdateItemsService(_stack.client.serializer, _stack, data, bulkVersion);
var service = new BulkUpdateItemsService(_stack.client.SerializerOptions, _stack, data, bulkVersion);
return _stack.client.InvokeSync(service);
}

Expand All @@ -503,7 +503,7 @@
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkUpdateItemsService(_stack.client.serializer, _stack, data, bulkVersion);
var service = new BulkUpdateItemsService(_stack.client.SerializerOptions, _stack, data, bulkVersion);
return _stack.client.InvokeAsync<BulkUpdateItemsService, ContentstackResponse>(service);
}

Expand All @@ -529,7 +529,7 @@
data.Locale = locales;
data.Reference = reference;

var service = new BulkUpdateItemsService(_stack.client.serializer, _stack, data, bulkVersion);
var service = new BulkUpdateItemsService(_stack.client.SerializerOptions, _stack, data, bulkVersion);
return _stack.client.InvokeAsync<BulkUpdateItemsService, ContentstackResponse>(service);
}

Expand All @@ -554,7 +554,7 @@
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkJobStatusService(_stack.client.serializer, _stack, jobId, bulkVersion);
var service = new BulkJobStatusService(_stack.client.SerializerOptions, _stack, jobId, bulkVersion);
return _stack.client.InvokeSync(service);
}

Expand All @@ -571,7 +571,7 @@
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkJobStatusService(_stack.client.serializer, _stack, jobId, bulkVersion);
var service = new BulkJobStatusService(_stack.client.SerializerOptions, _stack, jobId, bulkVersion);
return _stack.client.InvokeAsync<BulkJobStatusService, ContentstackResponse>(service);
}

Expand Down Expand Up @@ -613,7 +613,7 @@
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkReleaseItemsService(_stack.client.serializer, _stack, data, bulkVersion);
var service = new BulkReleaseItemsService(_stack.client.SerializerOptions, _stack, data, bulkVersion);
return _stack.client.InvokeSync(service);
}

Expand All @@ -628,7 +628,7 @@
_stack.ThrowIfNotLoggedIn();
_stack.ThrowIfAPIKeyEmpty();

var service = new BulkReleaseItemsService(_stack.client.serializer, _stack, data, bulkVersion);
var service = new BulkReleaseItemsService(_stack.client.SerializerOptions, _stack, data, bulkVersion);
return _stack.client.InvokeAsync<BulkReleaseItemsService, ContentstackResponse>(service);
}
}
Expand Down
8 changes: 4 additions & 4 deletions Contentstack.Management.Core/Models/Organization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
private readonly ContentstackClient _client;

#region Constructor
public Organization(ContentstackClient contentstackClient, string uid = null)

Check warning on line 15 in Contentstack.Management.Core/Models/Organization.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_client = contentstackClient;
Uid = uid;
Expand All @@ -34,11 +34,11 @@
/// </code></pre>
/// </example>
/// <returns>The <see cref="ContentstackResponse"/></returns>
public ContentstackResponse GetOrganizations(ParameterCollection parameters = null)

Check warning on line 37 in Contentstack.Management.Core/Models/Organization.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_client.ThrowIfNotLoggedIn();

var Organizations = new GetOrganizations(_client.serializer, parameters, this.Uid);
var Organizations = new GetOrganizations(_client.SerializerOptions, parameters, this.Uid);

return _client.InvokeSync(Organizations);
}
Expand All @@ -55,11 +55,11 @@
/// </code></pre>
/// </example>
/// <returns>The Task</returns>
public Task<ContentstackResponse> GetOrganizationsAsync(ParameterCollection parameters = null)

Check warning on line 58 in Contentstack.Management.Core/Models/Organization.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_client.ThrowIfNotLoggedIn();

var Organizations = new GetOrganizations(_client.serializer, parameters, this.Uid);
var Organizations = new GetOrganizations(_client.SerializerOptions, parameters, this.Uid);

return _client.InvokeAsync<GetOrganizations, ContentstackResponse>(Organizations);
}
Expand All @@ -76,12 +76,12 @@
/// </code></pre>
/// </example>
/// <returns>The <see cref="ContentstackResponse"/></returns>
public ContentstackResponse Roles(ParameterCollection parameters = null)

Check warning on line 79 in Contentstack.Management.Core/Models/Organization.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_client.ThrowIfNotLoggedIn();
this.ThrowIfOrganizationUidNull();

var Roles = new OrganizationRolesService(_client.serializer, this.Uid, parameters);
var Roles = new OrganizationRolesService(this.Uid, parameters, _client.SerializerOptions);

return _client.InvokeSync(Roles);
}
Expand All @@ -98,12 +98,12 @@
/// </code></pre>
/// </example>
/// <returns>The Task</returns>
public Task<ContentstackResponse> RolesAsync(ParameterCollection parameters = null)

Check warning on line 101 in Contentstack.Management.Core/Models/Organization.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_client.ThrowIfNotLoggedIn();
this.ThrowIfOrganizationUidNull();

var Roles = new OrganizationRolesService(_client.serializer, this.Uid, parameters);
var Roles = new OrganizationRolesService(this.Uid, parameters, _client.SerializerOptions);

return _client.InvokeAsync<OrganizationRolesService, ContentstackResponse>(Roles);
}
Expand Down Expand Up @@ -303,7 +303,7 @@
/// </code></pre>
/// </example>
/// <returns>The <see cref="ContentstackResponse"/></returns>
public ContentstackResponse GetInvitations(ParameterCollection parameter = null)

Check warning on line 306 in Contentstack.Management.Core/Models/Organization.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_client.ThrowIfNotLoggedIn();
this.ThrowIfOrganizationUidNull();
Expand All @@ -325,7 +325,7 @@
/// </code></pre>
/// </example>
/// <returns>The Task</returns>
public Task<ContentstackResponse> GetInvitationsAsync(ParameterCollection parameter = null)

Check warning on line 328 in Contentstack.Management.Core/Models/Organization.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_client.ThrowIfNotLoggedIn();
this.ThrowIfOrganizationUidNull();
Expand Down Expand Up @@ -390,7 +390,7 @@
/// </code></pre>
/// </example>
/// <returns>The <see cref="ContentstackResponse"/></returns>
public ContentstackResponse GetStacks(ParameterCollection parameter = null)

Check warning on line 393 in Contentstack.Management.Core/Models/Organization.cs

View workflow job for this annotation

GitHub Actions / unit-test

Cannot convert null literal to non-nullable reference type.
{
_client.ThrowIfNotLoggedIn();
this.ThrowIfOrganizationUidNull();
Expand Down
Loading
Loading