Skip to content

Latest commit

 

History

History
79 lines (58 loc) · 3.78 KB

information-barrier-segment-restrictions.md

File metadata and controls

79 lines (58 loc) · 3.78 KB

Information Barrier Segment Restrictions

Get shield information barrier segment restriction by ID

To retrieve a shield information barrier segment restriction by its ID, call the shieldInformationBarrierSegmentRestrictions.getById(options, callback) method.

const barrierSegmentRestriction = await client.shieldInformationBarrierSegmentRestrictions.getById({
	shield_information_barrier_segment_restriction_id: '12345',
});
console.log(`Shield information barrier segment restriction id ${barrierSegmentRestriction.id}`);

List shield information barrier segment restrictions

To retrieves a list of shield information barrier segment restrictions based on provided segment ID, call the shieldInformationBarrierSegmentRestrictions.getAll(options, callback) method.

const result = await client.shieldInformationBarrierSegmentRestrictions.getAll({
	shield_information_barrier_segment_id: '123'
});
console.log(`There are ${result.entries.length} shield information barrier segment restrictions`);

Create shield information barrier segment restriction

To creates a new shield information barrier segment restriction, call the shieldInformationBarrierSegmentRestrictions.create(options, callback) method. As a body parameter, you need to pass an object with the properties: type, shield_information_barrier_segment and restricted_segment, like in the following example:

const barrierSegmentRestriction = await client.shieldInformationBarrierSegmentRestrictions.create({
	type: 'shield_information_barrier_segment_restriction',
	shield_information_barrier_segment: {
		type: 'shield_information_barrier_segment',
		id: '1910967'
	},
	restricted_segment: {
		type: 'shield_information_barrier_segment',
		id: '1910968'
	}
});
console.log(`Shield information barrier segment restriction with id ${barrierSegmentRestriction.id} was created`);

Delete shield information barrier segment restriction by ID

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

await client.shieldInformationBarrierSegmentRestrictions.deleteById({
	shield_information_barrier_segment_restriction_id: '12345'
});