Branch

Branch

Methods

(static) delete() → {Object}

Source:
The Delete Branch call is used to delete an existing Branch permanently from your Stack.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()

client.stack({ api_key: 'api_key'}).branch('branch_uid').delete()
.then((response) => console.log(response.notice))
Returns:
Response Object.
Type
Object

(static) fetch() → {Promise.<Branch.Branch>}

Source:
The fetch Branch call fetches Branch details.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()

client.stack({ api_key: 'api_key'}).branch('branch_uid').fetch()
.then((branch) => console.log(branch))
Returns:
Promise for Branch instance
Type
Promise.<Branch.Branch>

(static) create() → {Promise.<Branch.Branch>}

Source:
The Create a Branch call creates a new branch in a particular stack of your Contentstack account.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
const branch = {
     name: 'branch_name',
     source: 'master'
}
client.stack({ api_key: 'api_key'}).branch().create({ branch })
.then((branch) => { console.log(branch) })
Returns:
Promise for Branch instance
Type
Promise.<Branch.Branch>

(static) query() → {Promise.<ContentstackCollection.ContentstackCollection>}

Source:
The 'Get all Branch' request returns comprehensive information about branch created in a Stack.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()

client.stack({ api_key: 'api_key'}).branch().query().find()
.then((collection) => { console.log(collection) })
Returns:
Promise for ContentstackCollection instance
Type
Promise.<ContentstackCollection.ContentstackCollection>