createInput method

Future<CreateInputResponse> createInput({
  1. required InputDefinition inputDefinition,
  2. required String inputName,
  3. String? inputDescription,
  4. List<Tag>? tags,
})

Creates an input.

May throw InvalidRequestException. May throw ThrottlingException. May throw InternalFailureException. May throw ServiceUnavailableException. May throw ResourceAlreadyExistsException.

Parameter inputDefinition : The definition of the input.

Parameter inputName : The name you want to give to the input.

Parameter inputDescription : A brief description of the input.

Parameter tags : Metadata that can be used to manage the input.

Implementation

Future<CreateInputResponse> createInput({
  required InputDefinition inputDefinition,
  required String inputName,
  String? inputDescription,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(inputDefinition, 'inputDefinition');
  ArgumentError.checkNotNull(inputName, 'inputName');
  _s.validateStringLength(
    'inputName',
    inputName,
    1,
    128,
    isRequired: true,
  );
  _s.validateStringLength(
    'inputDescription',
    inputDescription,
    0,
    128,
  );
  final $payload = <String, dynamic>{
    'inputDefinition': inputDefinition,
    'inputName': inputName,
    if (inputDescription != null) 'inputDescription': inputDescription,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/inputs',
    exceptionFnMap: _exceptionFns,
  );
  return CreateInputResponse.fromJson(response);
}