createProfilingGroup method

Future<CreateProfilingGroupResponse> createProfilingGroup({
  1. required String profilingGroupName,
  2. AgentOrchestrationConfig? agentOrchestrationConfig,
  3. String? clientToken,
  4. ComputePlatform? computePlatform,
  5. Map<String, String>? tags,
})

Creates a profiling group.

May throw ServiceQuotaExceededException. May throw InternalServerException. May throw ConflictException. May throw ValidationException. May throw ThrottlingException.

Parameter profilingGroupName : The name of the profiling group to create.

Parameter agentOrchestrationConfig : Specifies whether profiling is enabled or disabled for the created profiling group.

Parameter clientToken : Amazon CodeGuru Profiler uses this universally unique identifier (UUID) to prevent the accidental creation of duplicate profiling groups if there are failures and retries.

Parameter computePlatform : The compute platform of the profiling group. Use AWSLambda if your application runs on AWS Lambda. Use Default if your application runs on a compute platform that is not AWS Lambda, such an Amazon EC2 instance, an on-premises server, or a different platform. If not specified, Default is used.

Parameter tags : A list of tags to add to the created profiling group.

Implementation

Future<CreateProfilingGroupResponse> createProfilingGroup({
  required String profilingGroupName,
  AgentOrchestrationConfig? agentOrchestrationConfig,
  String? clientToken,
  ComputePlatform? computePlatform,
  Map<String, String>? tags,
}) async {
  ArgumentError.checkNotNull(profilingGroupName, 'profilingGroupName');
  _s.validateStringLength(
    'profilingGroupName',
    profilingGroupName,
    1,
    255,
    isRequired: true,
  );
  _s.validateStringLength(
    'clientToken',
    clientToken,
    1,
    64,
  );
  final $query = <String, List<String>>{
    if (clientToken != null) 'clientToken': [clientToken],
  };
  final $payload = <String, dynamic>{
    'profilingGroupName': profilingGroupName,
    if (agentOrchestrationConfig != null)
      'agentOrchestrationConfig': agentOrchestrationConfig,
    if (computePlatform != null) 'computePlatform': computePlatform.toValue(),
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.sendRaw(
    payload: $payload,
    method: 'POST',
    requestUri: '/profilingGroups',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return CreateProfilingGroupResponse(
    profilingGroup: ProfilingGroupDescription.fromJson($json),
  );
}