createGroupCertificateAuthority method

Future<CreateGroupCertificateAuthorityResponse> createGroupCertificateAuthority({
  1. required String groupId,
  2. String? amznClientToken,
})

Creates a CA for the group. If a CA already exists, it will rotate the existing CA.

May throw BadRequestException. May throw InternalServerErrorException.

Parameter groupId : The ID of the Greengrass group.

Parameter amznClientToken : A client token used to correlate requests and responses.

Implementation

Future<CreateGroupCertificateAuthorityResponse>
    createGroupCertificateAuthority({
  required String groupId,
  String? amznClientToken,
}) async {
  ArgumentError.checkNotNull(groupId, 'groupId');
  final headers = <String, String>{
    if (amznClientToken != null)
      'X-Amzn-Client-Token': amznClientToken.toString(),
  };
  final response = await _protocol.send(
    payload: null,
    method: 'POST',
    requestUri:
        '/greengrass/groups/${Uri.encodeComponent(groupId)}/certificateauthorities',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return CreateGroupCertificateAuthorityResponse.fromJson(response);
}