postTasksIDLabelsWithHttpInfo method

Future<Response> postTasksIDLabelsWithHttpInfo(
  1. String taskID,
  2. LabelMapping labelMapping, {
  3. String? zapTraceSpan,
})

Add a label to a task

Note: This method returns the HTTP Response.

Parameters:

  • String taskID (required): The task ID.

  • LabelMapping labelMapping (required): Label to add

  • String zapTraceSpan: OpenTracing span context

Implementation

Future<Response> postTasksIDLabelsWithHttpInfo(
  String taskID,
  LabelMapping labelMapping, {
  String? zapTraceSpan,
}) async {
  final path = r'/tasks/{taskID}/labels'.replaceAll('{taskID}', taskID);

  // ignore: prefer_final_locals
  Object? postBody = labelMapping;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (zapTraceSpan != null) {
    headerParams[r'Zap-Trace-Span'] = parameterToString(zapTraceSpan);
  }

  const authNames = <String>[
    'BasicAuthentication',
    'QuerystringAuthentication',
    'TokenAuthentication'
  ];
  const contentTypes = <String>['application/json'];

  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes[0],
    authNames,
  );
}