createPackageGroup method

Future<CreatePackageGroupResult> createPackageGroup({
  1. required String domain,
  2. required String packageGroup,
  3. String? contactInfo,
  4. String? description,
  5. String? domainOwner,
  6. List<Tag>? tags,
})

Creates a package group. For more information about creating package groups, including example CLI commands, see Create a package group in the CodeArtifact User Guide.

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

Parameter domain : The name of the domain in which you want to create a package group.

Parameter packageGroup : The pattern of the package group to create. The pattern is also the identifier of the package group.

Parameter contactInfo : The contact information for the created package group.

Parameter description : A description of the package group.

Parameter domainOwner : The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.

Parameter tags : One or more tag key-value pairs for the package group.

Implementation

Future<CreatePackageGroupResult> createPackageGroup({
  required String domain,
  required String packageGroup,
  String? contactInfo,
  String? description,
  String? domainOwner,
  List<Tag>? tags,
}) async {
  final $query = <String, List<String>>{
    'domain': [domain],
    if (domainOwner != null) 'domain-owner': [domainOwner],
  };
  final $payload = <String, dynamic>{
    'packageGroup': packageGroup,
    if (contactInfo != null) 'contactInfo': contactInfo,
    if (description != null) 'description': description,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/package-group',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return CreatePackageGroupResult.fromJson(response);
}