createAttributeGroup method

Future<CreateAttributeGroupResponse> createAttributeGroup({
  1. required String attributes,
  2. required String name,
  3. String? clientToken,
  4. String? description,
  5. Map<String, String>? tags,
})

Creates a new attribute group as a container for user-defined attributes. This feature enables users to have full control over their cloud application's metadata in a rich machine-readable format to facilitate integration with automated workflows and third-party tools.

May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ValidationException.

Parameter attributes : A JSON string in the form of nested key-value pairs that represent the attributes in the group and describes an application and its components.

Parameter name : The name of the attribute group.

Parameter clientToken : A unique identifier that you provide to ensure idempotency. If you retry a request that completed successfully using the same client token and the same parameters, the retry succeeds without performing any further actions. If you retry a successful request using the same client token, but one or more of the parameters are different, the retry fails.

Parameter description : The description of the attribute group that the user provides.

Parameter tags : Key-value pairs you can use to associate with the attribute group.

Implementation

Future<CreateAttributeGroupResponse> createAttributeGroup({
  required String attributes,
  required String name,
  String? clientToken,
  String? description,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'attributes': attributes,
    'name': name,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/attribute-groups',
    exceptionFnMap: _exceptionFns,
  );
  return CreateAttributeGroupResponse.fromJson(response);
}