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.
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}`);
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`);
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`);
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`);
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'
});