Skip to content

Latest commit

 

History

History
97 lines (71 loc) · 4.2 KB

information-barrier-segments.md

File metadata and controls

97 lines (71 loc) · 4.2 KB

Information Barrier Segments

Information barrier segments (or just segments) are defined groups of users. They are different from user groups, however, because with segments, a user can be a member of one, and only one, segment. This requirement for uniqueness in segments also means that you can add only individual users to segments, not user groups.

Get shield information barrier segment with specified ID

To get a shield information barrier segment based on provided ID by, call the shieldInformationBarrierSegments.getById(options, callback) method.

const barrierSegment = await client.shieldInformationBarrierSegments.getById({
	shield_information_barrier_segment_id: '12345',
});
console.log(`Shield information barrier segment id ${barrierSegment.id}`);

List shield information barrier segments

To retrieve a list of shield information barrier segment objects for the specified Information Barrier ID, call the shieldInformationBarrierSegments.getAll(options, callback) method.

const result = await client.shieldInformationBarrierSegments.getAll({
	shield_information_barrier_id: '123'
});
console.log(`There are ${result.entries.length} shield information barrier segments`);

Create shield information barrier segment

To create a shield information barrier segment, call the shieldInformationBarrierSegments.create(options, callback) method. The name and shield_information_barrier fields are required in the body, and the description is optional.

const barrierSegment = await client.shieldInformationBarrierSegments.create({
	name: 'barrier segment name',
	description: 'barrier segment description',
	shield_information_barrier: {
		id: '123',
		type: 'shield_information_barrier'
	},
});
console.log(`Shield information barrier segment id ${barrierSegment.id} created`);

Update shield information barrier segment

Updates the shield information barrier segment based on provided ID by calling shieldInformationBarrierSegments.update(body, options, callback) method.

const barrierSegment = await client.shieldInformationBarrierSegments.update({
	name: 'updated name',
	description: 'updated description',
}, {
	shield_information_barrier_segment_id: '12345'
});
console.log(`Shield information barrier segment id ${barrierSegment.id} updated`);

Delete shield information barrier segment

To delete the shield information barrier segment based on provided ID, call the shieldInformationBarrierSegments.delete(options, callback) method.

await client.shieldInformationBarrierSegments.deleteById({
	shield_information_barrier_segment_id: '12345'
});