Join BoxWorks 2024 to discover what's possible with content and AI!
Register now!Creates a shield information barrier segment restriction object.
"shield_information_barrier_segment_restriction"
The type of the shield barrier segment restriction for this member.
Value is always shield_information_barrier_segment_restriction
The type
and id
of the restricted
shield information barrier segment.
"1910967"
The ID reference of the restricted shield information barrier segment.
"shield_information_barrier_segment"
The type of the restricted shield information barrier segment.
Value is always shield_information_barrier_segment
A base representation of a shield information barrier object
The type
and id
of the requested
shield information barrier segment.
"1910967"
The ID reference of the requesting shield information barrier segment.
"shield_information_barrier_segment"
The type of the shield barrier segment for this member.
Value is always shield_information_barrier_segment
Returns the newly created Shield Information Barrier Segment Restriction object.
Returns a not_found
error if the
shield information barrier or segment was not found.
An unexpected client error.
await client.shieldInformationBarrierSegmentRestrictions.createShieldInformationBarrierSegmentRestriction(
{
restrictedSegment: {
id: segmentToRestrictId,
type: 'shield_information_barrier_segment' as CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentTypeField,
} satisfies CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField,
shieldInformationBarrierSegment: {
id: segmentId,
type: 'shield_information_barrier_segment' as CreateShieldInformationBarrierSegmentRestrictionRequestBodyShieldInformationBarrierSegmentTypeField,
} satisfies CreateShieldInformationBarrierSegmentRestrictionRequestBodyShieldInformationBarrierSegmentField,
type: 'shield_information_barrier_segment_restriction' as CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField,
} satisfies CreateShieldInformationBarrierSegmentRestrictionRequestBodyInput
);
client.shield_information_barrier_segment_restrictions.create_shield_information_barrier_segment_restriction(
CreateShieldInformationBarrierSegmentRestrictionShieldInformationBarrierSegment(
id=segment_id,
type=CreateShieldInformationBarrierSegmentRestrictionShieldInformationBarrierSegmentTypeField.SHIELD_INFORMATION_BARRIER_SEGMENT.value,
),
CreateShieldInformationBarrierSegmentRestrictionRestrictedSegment(
id=segment_to_restrict_id,
type=CreateShieldInformationBarrierSegmentRestrictionRestrictedSegmentTypeField.SHIELD_INFORMATION_BARRIER_SEGMENT.value,
),
type=CreateShieldInformationBarrierSegmentRestrictionType.SHIELD_INFORMATION_BARRIER_SEGMENT_RESTRICTION.value,
)
await client.ShieldInformationBarrierSegmentRestrictions.CreateShieldInformationBarrierSegmentRestrictionAsync(requestBody: new CreateShieldInformationBarrierSegmentRestrictionRequestBody(restrictedSegment: new CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField() { Id = segmentToRestrictId, Type = CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentTypeField.ShieldInformationBarrierSegment }, shieldInformationBarrierSegment: new CreateShieldInformationBarrierSegmentRestrictionRequestBodyShieldInformationBarrierSegmentField() { Id = segmentId, Type = CreateShieldInformationBarrierSegmentRestrictionRequestBodyShieldInformationBarrierSegmentTypeField.ShieldInformationBarrierSegment }, type: CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField.ShieldInformationBarrierSegmentRestriction));
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`);
{
"id": "11446498",
"type": "shield_information_barrier_segment_restriction",
"created_at": "2020-06-26T18:44:45.869Z",
"created_by": {
"id": "11446498",
"type": "user"
},
"restricted_segment": {
"id": "1910967",
"type": "shield_information_barrier_segment"
},
"shield_information_barrier": {
"id": "11446498",
"type": "shield_information_barrier"
},
"shield_information_barrier_segment": {
"id": "1910967",
"type": "shield_information_barrier_segment"
},
"updated_at": "2020-07-26T18:44:45.869Z",
"updated_by": {
"id": "11446498",
"type": "user"
}
}