createGroup method

Future<CreateGroupResponse> createGroup({
  1. required String identityStoreId,
  2. String? description,
  3. String? displayName,
})

Creates a group within the specified identity store.

May throw ConflictException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ValidationException.

Parameter identityStoreId : The globally unique identifier for the identity store.

Parameter description : A string containing the description of the group.

Parameter displayName : A string containing the name of the group. This value is commonly displayed when the group is referenced. Administrator and AWSAdministrators are reserved names and can't be used for users or groups.

Implementation

Future<CreateGroupResponse> createGroup({
  required String identityStoreId,
  String? description,
  String? displayName,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSIdentityStore.CreateGroup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'IdentityStoreId': identityStoreId,
      if (description != null) 'Description': description,
      if (displayName != null) 'DisplayName': displayName,
    },
  );

  return CreateGroupResponse.fromJson(jsonResponse.body);
}