diff --git a/.github/workflows/sca-scan.yml b/.github/workflows/sca-scan.yml
index 4fa4560..decebb1 100644
--- a/.github/workflows/sca-scan.yml
+++ b/.github/workflows/sca-scan.yml
@@ -6,10 +6,18 @@ jobs:
security-sca:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@master
+ - name: Checkout repository
+ uses: actions/checkout@master
+ - name: Setup .NET Core @ Latest
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: "7.0.x"
+ - name: Run Dotnet Restore
+ run: |
+ dotnet restore
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/dotnet@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
- args: --fail-on=all
+ args: --file=Contentstack.Core/obj/project.assets.json --fail-on=all
diff --git a/.talismanrc b/.talismanrc
index 420960a..944a831 100644
--- a/.talismanrc
+++ b/.talismanrc
@@ -2,6 +2,12 @@ fileignoreconfig:
- filename: Contentstack.Core/Internals/HttpRequestHandler.cs
checksum: 93c1659f3bc7527956f0fd12db46441297fac3a4366d273bcbb3425d2351300e
- filename: Contentstack.Core/Models/Entry.cs
- checksum: bc0da69dde3bebecf09aa319aa961f82d7637e200bb8539821fa6116c0129f1b
+ checksum: 79320b005882981fd7c79fe73832f28284db686927942e46b422ac9e88405023
- filename: Contentstack.Core/ContentstackClient.cs
- checksum: 1cb7c9bd62881ae71406449c948b1e85aa865d0c7191013f77f9b9a60df700d9
\ No newline at end of file
+ checksum: 1cb7c9bd62881ae71406449c948b1e85aa865d0c7191013f77f9b9a60df700d9
+- filename: Contentstack.Core/Models/AssetLibrary.cs
+ checksum: 023aed649cf09228d753a4dec2b3a9f126aad474f538ca0e21d03ee07e9f6129
+- filename: Contentstack.Core/Models/Asset.cs
+ checksum: 98b819cb9b1e6a9a9e5394ac23c07bc642a41c0c7512d169afc63afe3baa6fb3
+- filename: Contentstack.Core/Models/Query.cs
+ checksum: 9237bb4d3e862fad7f3c6d9bad47873758a18617dc9c90d28015dcea267fcd9e
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 030599c..63e3f73 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+### Version: 2.14.0
+#### Date: May-28-2024
+
+##### New Feature:
+- GCP_NA region support added
+- AddParam method added for Entry, Asset, AssetLibrary and Query
+
### Version: 2.13.0
#### Date: April-02-2024
diff --git a/Contentstack.AspNetCore/Contentstack.AspNetCore.csproj b/Contentstack.AspNetCore/Contentstack.AspNetCore.csproj
index 4329436..41f678c 100644
--- a/Contentstack.AspNetCore/Contentstack.AspNetCore.csproj
+++ b/Contentstack.AspNetCore/Contentstack.AspNetCore.csproj
@@ -31,6 +31,6 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/Contentstack.Core/Configuration/Config.cs b/Contentstack.Core/Configuration/Config.cs
index 4bdd342..ea4e353 100644
--- a/Contentstack.Core/Configuration/Config.cs
+++ b/Contentstack.Core/Configuration/Config.cs
@@ -117,7 +117,7 @@ internal string HostURL
{
get
{
- if (Region == ContentstackRegion.EU || Region == ContentstackRegion.AZURE_EU || Region == ContentstackRegion.AZURE_NA)
+ if (Region == ContentstackRegion.EU || Region == ContentstackRegion.AZURE_EU || Region == ContentstackRegion.AZURE_NA || Region == ContentstackRegion.GCP_NA)
return "cdn.contentstack.com";
return "cdn.contentstack.io";
}
diff --git a/Contentstack.Core/Internals/ContentstackRegion.cs b/Contentstack.Core/Internals/ContentstackRegion.cs
index fa0bec1..1ad09cd 100644
--- a/Contentstack.Core/Internals/ContentstackRegion.cs
+++ b/Contentstack.Core/Internals/ContentstackRegion.cs
@@ -1,28 +1,33 @@
using System;
namespace Contentstack.Core.Internals
{
- ///
- /// Contentstack region.
+ ///
+ /// Contentstack region.
///
public enum ContentstackRegion
{
- ///
- /// To specify US region.
+ ///
+ /// To specify US region.
///
US,
- ///
- /// To specify EU region.
+ ///
+ /// To specify EU region.
///
EU,
- ///
- /// To specify EU region.
+ ///
+ /// To specify AZURE_EU region.
///
AZURE_EU,
- ///
- /// To specify EU region.
+ ///
+ /// To specify AZURE_NA region.
///
- AZURE_NA
+ AZURE_NA,
+
+ ///
+ /// To specify GCP_NA region.
+ ///
+ GCP_NA
}
@@ -34,7 +39,9 @@ internal enum ContentstackRegionCode
azure_eu,
- azure_na
+ azure_na,
+
+ gcp_na
}
}
diff --git a/Contentstack.Core/Models/Asset.cs b/Contentstack.Core/Models/Asset.cs
index afffc2b..f902863 100644
--- a/Contentstack.Core/Models/Asset.cs
+++ b/Contentstack.Core/Models/Asset.cs
@@ -172,7 +172,7 @@ public void SetHeader(string key, string value)
/// });
///
///
- public Asset includeFallback()
+ public Asset IncludeFallback()
{
this.UrlQueries.Add("include_fallback", "true");
return this;
@@ -216,18 +216,39 @@ public Asset IncludeMetadata()
///
/// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
/// Asset asset = stack.Asset("asset_uid");
- /// asset.includeBranch();
+ /// asset.IncludeBranch();
/// asset.Fetch<Product>().ContinueWith((assetResult) => {
/// //Your callback code.
/// });
///
///
- public Asset includeBranch()
+ public Asset IncludeBranch()
{
this.UrlQueries.Add("include_branch", "true");
return this;
}
+
+ ///
+ /// Add param in URL query.
+ ///
+ /// Current instance of Asset, this will be useful for a chaining calls.
+ ///
+ ///
+ /// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
+ /// Asset asset = stack.Asset("asset_uid");
+ /// asset.AddParam("include_branch", "true");
+ /// asset.Fetch<Product>().ContinueWith((assetResult) => {
+ /// //Your callback code.
+ /// });
+ ///
+ ///
+ public Asset AddParam(string key, string value)
+ {
+ this.UrlQueries.Add(key, value);
+ return this;
+ }
+
public void RemoveHeader(string key)
{
if (this._Headers.ContainsKey(key))
diff --git a/Contentstack.Core/Models/AssetLibrary.cs b/Contentstack.Core/Models/AssetLibrary.cs
index 97a9f30..8bfe118 100644
--- a/Contentstack.Core/Models/AssetLibrary.cs
+++ b/Contentstack.Core/Models/AssetLibrary.cs
@@ -142,6 +142,26 @@ public AssetLibrary IncludeBranch()
return this;
}
+
+ ///
+ /// Add param in URL query.
+ ///
+ /// Current instance of Asset, this will be useful for a chaining calls.
+ ///
+ ///
+ /// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
+ /// AssetLibrary assetLibrary = stack.AssetLibrary();
+ /// assetLibrary.AddParam("include_branch", "true");
+ /// ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();
+ ///
+ ///
+ public AssetLibrary AddParam(string key, string value)
+ {
+ UrlQueries.Add(key, value);
+
+ return this;
+ }
+
///
/// Sets the locale.
///
diff --git a/Contentstack.Core/Models/Entry.cs b/Contentstack.Core/Models/Entry.cs
index 6f9c6e8..5460b29 100644
--- a/Contentstack.Core/Models/Entry.cs
+++ b/Contentstack.Core/Models/Entry.cs
@@ -1083,7 +1083,32 @@ public Entry IncludeMetadata()
}
-
+ ///
+ /// Add param in URL query.
+ ///
+ /// Current instance of Entry, this will be useful for a chaining calls.
+ ///
+ ///
+ /// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
+ /// Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
+ /// entry.AddParam("include_branch", "true");
+ /// entry.Fetch<Product>().ContinueWith((assetResult) => {
+ /// //Your callback code.
+ /// });
+ ///
+ ///
+ public Entry AddParam(string key, string value)
+ {
+ try
+ {
+ UrlQueries.Add(key, value);
+ }
+ catch (Exception e)
+ {
+ throw new Exception(StackConstants.ErrorMessage_QueryFilterException, e);
+ }
+ return this;
+ }
///
/// Include branch for publish content.
diff --git a/Contentstack.Core/Models/Query.cs b/Contentstack.Core/Models/Query.cs
index b568694..202c529 100644
--- a/Contentstack.Core/Models/Query.cs
+++ b/Contentstack.Core/Models/Query.cs
@@ -1402,6 +1402,34 @@ public Query IncludeBranch()
return this;
}
+
+ ///
+ /// Add param in URL query.
+ ///
+ /// Current instance of Entry, this will be useful for a chaining calls.
+ ///
+ ///
+ /// ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
+ /// Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
+ /// entry.AddParam("include_branch", "true");
+ /// entry.Fetch<Product>().ContinueWith((assetResult) => {
+ /// //Your callback code.
+ /// });
+ ///
+ ///
+ public Query AddParam(string key, string value)
+ {
+ try
+ {
+ UrlQueries.Add(key, value);
+ }
+ catch (Exception e)
+ {
+ throw new Exception(StackConstants.ErrorMessage_QueryFilterException, e);
+ }
+ return this;
+ }
+
///
/// Include Embedded Objects (Entries and Assets) along with entry/entries details.
///
diff --git a/Directory.Build.props b/Directory.Build.props
index 49efd35..3221139 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,5 +1,5 @@
- 2.13.0
+ 2.14.0