postAgentProfile method

Future<void> postAgentProfile({
  1. required Uint8List agentProfile,
  2. required String contentType,
  3. required String profilingGroupName,
  4. String? profileToken,
})

Submits profiling data to an aggregated profile of a profiling group. To get an aggregated profile that is created with this profiling data, use GetProfile .

May throw InternalServerException. May throw ValidationException. May throw ThrottlingException. May throw ResourceNotFoundException.

Parameter agentProfile : The submitted profiling data.

Parameter contentType : The format of the submitted profiling data. The format maps to the Accept and Content-Type headers of the HTTP request. You can specify one of the following: or the default .

 <ul> <li> <p>
<code>application/json</code> — standard JSON format
</p> </li> <li> <p>
<code>application/x-amzn-ion</code> — the Amazon Ion data
format. For more information, see <a
href="http://amzn.github.io/ion-docs/">Amazon Ion</a>.
</p> </li> </ul> 

Parameter profilingGroupName : The name of the profiling group with the aggregated profile that receives the submitted profiling data.

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

Implementation

Future<void> postAgentProfile({
  required Uint8List agentProfile,
  required String contentType,
  required String profilingGroupName,
  String? profileToken,
}) async {
  ArgumentError.checkNotNull(agentProfile, 'agentProfile');
  ArgumentError.checkNotNull(contentType, 'contentType');
  ArgumentError.checkNotNull(profilingGroupName, 'profilingGroupName');
  _s.validateStringLength(
    'profilingGroupName',
    profilingGroupName,
    1,
    255,
    isRequired: true,
  );
  _s.validateStringLength(
    'profileToken',
    profileToken,
    1,
    64,
  );
  final headers = <String, String>{
    'Content-Type': contentType.toString(),
  };
  final $query = <String, List<String>>{
    if (profileToken != null) 'profileToken': [profileToken],
  };
  final response = await _protocol.send(
    payload: agentProfile,
    method: 'POST',
    requestUri:
        '/profilingGroups/${Uri.encodeComponent(profilingGroupName)}/agentProfile',
    queryParams: $query,
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}