queryObjects method

Future<QueryObjectsOutput> queryObjects({
  1. required String pipelineId,
  2. required String sphere,
  3. int? limit,
  4. String? marker,
  5. Query? query,
})

Queries the specified pipeline for the names of objects that match the specified set of conditions.

May throw PipelineNotFoundException. May throw PipelineDeletedException. May throw InternalServiceError. May throw InvalidRequestException.

Parameter pipelineId : The ID of the pipeline.

Parameter sphere : Indicates whether the query applies to components or instances. The possible values are: COMPONENT, INSTANCE, and ATTEMPT.

Parameter limit : The maximum number of object names that QueryObjects will return in a single call. The default value is 100.

Parameter marker : The starting point for the results to be returned. For the first call, this value should be empty. As long as there are more results, continue to call QueryObjects with the marker value from the previous call to retrieve the next set of results.

Parameter query : The query that defines the objects to be returned. The Query object can contain a maximum of ten selectors. The conditions in the query are limited to top-level String fields in the object. These filters can be applied to components, instances, and attempts.

Implementation

Future<QueryObjectsOutput> queryObjects({
  required String pipelineId,
  required String sphere,
  int? limit,
  String? marker,
  Query? query,
}) async {
  ArgumentError.checkNotNull(pipelineId, 'pipelineId');
  _s.validateStringLength(
    'pipelineId',
    pipelineId,
    1,
    1024,
    isRequired: true,
  );
  ArgumentError.checkNotNull(sphere, 'sphere');
  _s.validateStringLength(
    'sphere',
    sphere,
    0,
    1024,
    isRequired: true,
  );
  _s.validateStringLength(
    'marker',
    marker,
    0,
    1024,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DataPipeline.QueryObjects'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'pipelineId': pipelineId,
      'sphere': sphere,
      if (limit != null) 'limit': limit,
      if (marker != null) 'marker': marker,
      if (query != null) 'query': query,
    },
  );

  return QueryObjectsOutput.fromJson(jsonResponse.body);
}