updateConfigurationProfile method

Future<ConfigurationProfile> updateConfigurationProfile({
  1. required String applicationId,
  2. required String configurationProfileId,
  3. String? description,
  4. String? name,
  5. String? retrievalRoleArn,
  6. List<Validator>? validators,
})

Updates a configuration profile.

May throw BadRequestException. May throw ResourceNotFoundException. May throw InternalServerException.

Parameter applicationId : The application ID.

Parameter configurationProfileId : The ID of the configuration profile.

Parameter description : A description of the configuration profile.

Parameter name : The name of the configuration profile.

Parameter retrievalRoleArn : The ARN of an IAM role with permission to access the configuration at the specified LocationUri.

Parameter validators : A list of methods for validating the configuration.

Implementation

Future<ConfigurationProfile> updateConfigurationProfile({
  required String applicationId,
  required String configurationProfileId,
  String? description,
  String? name,
  String? retrievalRoleArn,
  List<Validator>? validators,
}) async {
  ArgumentError.checkNotNull(applicationId, 'applicationId');
  ArgumentError.checkNotNull(
      configurationProfileId, 'configurationProfileId');
  _s.validateStringLength(
    'description',
    description,
    0,
    1024,
  );
  _s.validateStringLength(
    'name',
    name,
    1,
    64,
  );
  _s.validateStringLength(
    'retrievalRoleArn',
    retrievalRoleArn,
    20,
    2048,
  );
  final $payload = <String, dynamic>{
    if (description != null) 'Description': description,
    if (name != null) 'Name': name,
    if (retrievalRoleArn != null) 'RetrievalRoleArn': retrievalRoleArn,
    if (validators != null) 'Validators': validators,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/applications/${Uri.encodeComponent(applicationId)}/configurationprofiles/${Uri.encodeComponent(configurationProfileId)}',
    exceptionFnMap: _exceptionFns,
  );
  return ConfigurationProfile.fromJson(response);
}