Creates a new shield information barrier segment member.
"shield_information_barrier_segment_member"
-| A type of the shield barrier segment member.
Value is always shield_information_barrier_segment_member
A base representation of a shield information barrier object
The type
and id
of the
requested shield information barrier segment.
"432554"
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
User to which restriction will be applied.
Returns a new shield information barrier segment member object.
Returns an error if the shield information barrier or segment was not found.
An unexpected client error.
await client.shieldInformationBarrierSegmentMembers.createShieldInformationBarrierSegmentMember(
{
shieldInformationBarrierSegment: {
id: segment.id!,
type: 'shield_information_barrier_segment' as CreateShieldInformationBarrierSegmentMemberRequestBodyShieldInformationBarrierSegmentTypeField,
} satisfies CreateShieldInformationBarrierSegmentMemberRequestBodyShieldInformationBarrierSegmentField,
user: new UserBase({ id: getEnvVar('USER_ID') }),
} satisfies CreateShieldInformationBarrierSegmentMemberRequestBody,
);
client.shield_information_barrier_segment_members.create_shield_information_barrier_segment_member(
CreateShieldInformationBarrierSegmentMemberShieldInformationBarrierSegment(
id=segment.id,
type=CreateShieldInformationBarrierSegmentMemberShieldInformationBarrierSegmentTypeField.SHIELD_INFORMATION_BARRIER_SEGMENT.value,
),
UserBase(id=get_env_var("USER_ID")),
)
await client.ShieldInformationBarrierSegmentMembers.CreateShieldInformationBarrierSegmentMemberAsync(requestBody: new CreateShieldInformationBarrierSegmentMemberRequestBody(shieldInformationBarrierSegment: new CreateShieldInformationBarrierSegmentMemberRequestBodyShieldInformationBarrierSegmentField() { Id = NullableUtils.Unwrap(segment.Id), Type = CreateShieldInformationBarrierSegmentMemberRequestBodyShieldInformationBarrierSegmentTypeField.ShieldInformationBarrierSegment }, user: new UserBase(id: Utils.GetEnvVar(name: "USER_ID"))));
const barrierSegmentMember = await client.shieldInformationBarrierSegmentMembers.create({
shield_information_barrier_segment: {
id: '234',
type: 'shield_information_barrier_segment'
},
user: {
id: '456',
type: 'user'
}
});
console.log(`Shield information barrier segment member id ${barrierSegmentMember.id} created`);
{
"id": "11446498",
"type": "shield_information_barrier_segment_member",
"created_at": "2020-06-26T18:44:45.869Z",
"created_by": {
"id": "11446498",
"type": "user"
},
"shield_information_barrier": {
"id": "11446498",
"type": "shield_information_barrier"
},
"shield_information_barrier_segment": {
"id": "432554",
"type": "shield_information_barrier_segment"
},
"updated_at": "2020-07-26T18:44:45.869Z",
"updated_by": {
"id": "11446498",
"type": "user"
},
"user": {
"id": "11446498",
"type": "user"
}
}