createUserHierarchyGroup method
Creates a new user hierarchy group.
May throw InvalidRequestException. May throw InvalidParameterException. May throw DuplicateResourceException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw InternalServiceException.
Parameter instanceId
:
The identifier of the Amazon Connect instance.
Parameter name
:
The name of the user hierarchy group. Must not be more than 100
characters.
Parameter parentGroupId
:
The identifier for the parent hierarchy group. The user hierarchy is
created at level one if the parent group ID is null.
Implementation
Future<CreateUserHierarchyGroupResponse> createUserHierarchyGroup({
required String instanceId,
required String name,
String? parentGroupId,
}) async {
ArgumentError.checkNotNull(instanceId, 'instanceId');
_s.validateStringLength(
'instanceId',
instanceId,
1,
100,
isRequired: true,
);
ArgumentError.checkNotNull(name, 'name');
final $payload = <String, dynamic>{
'Name': name,
if (parentGroupId != null) 'ParentGroupId': parentGroupId,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/user-hierarchy-groups/${Uri.encodeComponent(instanceId)}',
exceptionFnMap: _exceptionFns,
);
return CreateUserHierarchyGroupResponse.fromJson(response);
}