createUserHierarchyGroup method
Creates a new user hierarchy group.
May throw DuplicateResourceException.
May throw InternalServiceException.
May throw InvalidParameterException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter instanceId :
The identifier of the Connect Customer instance. You can find
the instance ID in the Amazon Resource Name (ARN) of the 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.
Parameter tags :
The tags used to organize, track, or control access for this resource. For
example, { "Tags": {"key1":"value1", "key2":"value2"} }.
Implementation
Future<CreateUserHierarchyGroupResponse> createUserHierarchyGroup({
required String instanceId,
required String name,
String? parentGroupId,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'Name': name,
if (parentGroupId != null) 'ParentGroupId': parentGroupId,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/user-hierarchy-groups/${Uri.encodeComponent(instanceId)}',
exceptionFnMap: _exceptionFns,
);
return CreateUserHierarchyGroupResponse.fromJson(response);
}