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