createConfigurationBundle method

Future<CreateConfigurationBundleResponse> createConfigurationBundle({
  1. required String bundleName,
  2. required Map<String, ComponentConfiguration> components,
  3. String? branchName,
  4. String? clientToken,
  5. String? commitMessage,
  6. VersionCreatedBySource? createdBy,
  7. String? description,
  8. Map<String, String>? tags,
})

Creates a new configuration bundle resource. A configuration bundle stores versioned component configurations for agent evaluation workflows.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter bundleName : The name for the configuration bundle. Names must be unique within your account.

Parameter components : A map of component identifiers to their configurations. Each component represents a configurable element within the bundle.

Parameter branchName : The branch name for version tracking. Defaults to mainline if not specified.

Parameter clientToken : A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see Ensuring idempotency.

Parameter commitMessage : A commit message describing the initial version of the configuration bundle.

Parameter createdBy : The source that created this version, including the source name and optional ARN.

Parameter description : The description for the configuration bundle.

Parameter tags : A map of tag keys and values to assign to the configuration bundle. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment.

Implementation

Future<CreateConfigurationBundleResponse> createConfigurationBundle({
  required String bundleName,
  required Map<String, ComponentConfiguration> components,
  String? branchName,
  String? clientToken,
  String? commitMessage,
  VersionCreatedBySource? createdBy,
  String? description,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'bundleName': bundleName,
    'components': components,
    if (branchName != null) 'branchName': branchName,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (commitMessage != null) 'commitMessage': commitMessage,
    if (createdBy != null) 'createdBy': createdBy,
    if (description != null) 'description': description,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/configuration-bundles/create',
    exceptionFnMap: _exceptionFns,
  );
  return CreateConfigurationBundleResponse.fromJson(response);
}