PublishRule
PublishRule
Publish Rules are conditions that you define for your content publishing. It allows you to govern whether entries can be published with or without someone’s approval or only when the content is at a particular stage.
Create
The Create Publish Rules request allows you to create publish rules for the workflow of a stack.
| Name | Type | Description |
|---|---|---|
| model (required) | PublishRuleModel | PublishRule Model for creating rule. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishRuleModel model = new PublishRuleModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow().PublishRule().CreateAsync(model);CreateAsync
The Create Publish Rules request allows you to create publish rules for the workflow of a stack.
| Name | Type | Description |
|---|---|---|
| model (required) | PublishRuleModel | PublishRule Model for creating rule. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishRuleModel model = new PublishRuleModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow().PublishRule().CreateAsync(model);Delete
The Delete Publish Rules request allows you to delete an existing publish rule.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow().PublishRule("<PUBLISH_RULE_UID>").Delete();DeleteAsync
The Delete Publish Rules request allows you to delete an existing publish rule.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow().PublishRule("<PUBLISH_RULE_UID>").DeleteAsync();Fetch
The fetch Publish Rule request retrieves the comprehensive details of a specific publish rule of a Workflow.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow().PublishRule("<PUBLISH_RULE_UID>").Fetch();FetchAsync
The fetch Publish Rule request retrieves the comprehensive details of a specific publish rule of a Workflow.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow().PublishRule("<PUBLISH_RULE_UID>").FetchAsync();FindAll
The Get all Publish Rules request retrieves the details of all the Publish rules of a workflow.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow().PublishRule().FindAll();FindAllAsync
The Get all Publish Rules request retrieves the details of all the Publish rules of a workflow.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow().PublishRule().FindAllAsync();Update
The Update Publish Rules request allows you to add a publish rule or update the details of the existing publish rules of a workflow.
| Name | Type | Description |
|---|---|---|
| model (required) | PublishRuleModel | PublishRule Model for updating Content Type. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishRuleModel model = new PublishRuleModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow().PublishRule("<PUBLISH_RULE_UID>").Update(model);UpdateAsync
The Update Publish Rules request allows you to add a publish rule or update the details of the existing publish rules of a workflow.
| Name | Type | Description |
|---|---|---|
| model (required) | PublishRuleModel | PublishRule Model for updating Content Type. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishRuleModel model = new PublishRuleModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow().PublishRule("<PUBLISH_RULE_UID>").UpdateAsync(model);