createDiscoverer method

Future<CreateDiscovererResponse> createDiscoverer({
  1. required String sourceArn,
  2. String? description,
  3. Map<String, String>? tags,
})

Creates a discoverer.

May throw BadRequestException. May throw InternalServerErrorException. May throw UnauthorizedException. May throw ForbiddenException. May throw ServiceUnavailableException. May throw ConflictException.

Parameter sourceArn : The ARN of the event bus.

Parameter description : A description for the discoverer.

Parameter tags : Tags associated with the resource.

Implementation

Future<CreateDiscovererResponse> createDiscoverer({
  required String sourceArn,
  String? description,
  Map<String, String>? tags,
}) async {
  ArgumentError.checkNotNull(sourceArn, 'sourceArn');
  _s.validateStringLength(
    'sourceArn',
    sourceArn,
    20,
    1600,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    256,
  );
  final $payload = <String, dynamic>{
    'SourceArn': sourceArn,
    if (description != null) 'Description': description,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/discoverers',
    exceptionFnMap: _exceptionFns,
  );
  return CreateDiscovererResponse.fromJson(response);
}