updateServiceAction method

Future<UpdateServiceActionOutput> updateServiceAction({
  1. required String id,
  2. String? acceptLanguage,
  3. Map<ServiceActionDefinitionKey, String>? definition,
  4. String? description,
  5. String? name,
})

Updates a self-service action.

May throw ResourceNotFoundException. May throw InvalidParametersException.

Parameter id : The self-service action identifier.

Parameter acceptLanguage : The language code.

  • en - English (default)
  • jp - Japanese
  • zh - Chinese

Parameter definition : A map that defines the self-service action.

Parameter description : The self-service action description.

Parameter name : The self-service action name.

Implementation

Future<UpdateServiceActionOutput> updateServiceAction({
  required String id,
  String? acceptLanguage,
  Map<ServiceActionDefinitionKey, String>? definition,
  String? description,
  String? name,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  _s.validateStringLength(
    'id',
    id,
    1,
    100,
    isRequired: true,
  );
  _s.validateStringLength(
    'acceptLanguage',
    acceptLanguage,
    0,
    100,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    1024,
  );
  _s.validateStringLength(
    'name',
    name,
    1,
    256,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWS242ServiceCatalogService.UpdateServiceAction'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Id': id,
      if (acceptLanguage != null) 'AcceptLanguage': acceptLanguage,
      if (definition != null)
        'Definition': definition.map((k, e) => MapEntry(k.toValue(), e)),
      if (description != null) 'Description': description,
      if (name != null) 'Name': name,
    },
  );

  return UpdateServiceActionOutput.fromJson(jsonResponse.body);
}