createTags method

Future<void> createTags({
  1. required String resourceId,
  2. required List<Tag> tags,
})

Creates the specified tags for the specified WorkSpaces resource.

May throw ResourceNotFoundException. May throw InvalidParameterValuesException. May throw ResourceLimitExceededException.

Parameter resourceId : The identifier of the WorkSpaces resource. The supported resource types are WorkSpaces, registered directories, images, custom bundles, IP access control groups, and connection aliases.

Parameter tags : The tags. Each WorkSpaces resource can have a maximum of 50 tags.

Implementation

Future<void> createTags({
  required String resourceId,
  required List<Tag> tags,
}) async {
  ArgumentError.checkNotNull(resourceId, 'resourceId');
  _s.validateStringLength(
    'resourceId',
    resourceId,
    1,
    1152921504606846976,
    isRequired: true,
  );
  ArgumentError.checkNotNull(tags, 'tags');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkspacesService.CreateTags'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceId': resourceId,
      'Tags': tags,
    },
  );
}