updateWorkteam method

Future<UpdateWorkteamResponse> updateWorkteam({
  1. required String workteamName,
  2. String? description,
  3. List<MemberDefinition>? memberDefinitions,
  4. NotificationConfiguration? notificationConfiguration,
})

Updates an existing work team with new member definitions or description.

May throw ResourceLimitExceeded.

Parameter workteamName : The name of the work team to update.

Parameter description : An updated description for the work team.

Parameter memberDefinitions : A list of MemberDefinition objects that contains objects that identify the workers that make up the work team.

Workforces can be created using Amazon Cognito or your own OIDC Identity Provider (IdP). For private workforces created using Amazon Cognito use CognitoMemberDefinition. For workforces created using your own OIDC identity provider (IdP) use OidcMemberDefinition. You should not provide input for both of these parameters in a single request.

For workforces created using Amazon Cognito, private work teams correspond to Amazon Cognito user groups within the user pool used to create a workforce. All of the CognitoMemberDefinition objects that make up the member definition must have the same ClientId and UserPool values. To add a Amazon Cognito user group to an existing worker pool, see Adding groups to a User Pool. For more information about user pools, see Amazon Cognito User Pools.

For workforces created using your own OIDC IdP, specify the user groups that you want to include in your private work team in OidcMemberDefinition by listing those groups in Groups. Be aware that user groups that are already in the work team must also be listed in Groups when you make this request to remain on the work team. If you do not include these user groups, they will no longer be associated with the work team you update.

Parameter notificationConfiguration : Configures SNS topic notifications for available or expiring work items

Implementation

Future<UpdateWorkteamResponse> updateWorkteam({
  required String workteamName,
  String? description,
  List<MemberDefinition>? memberDefinitions,
  NotificationConfiguration? notificationConfiguration,
}) async {
  ArgumentError.checkNotNull(workteamName, 'workteamName');
  _s.validateStringLength(
    'workteamName',
    workteamName,
    1,
    63,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    1,
    200,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.UpdateWorkteam'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'WorkteamName': workteamName,
      if (description != null) 'Description': description,
      if (memberDefinitions != null) 'MemberDefinitions': memberDefinitions,
      if (notificationConfiguration != null)
        'NotificationConfiguration': notificationConfiguration,
    },
  );

  return UpdateWorkteamResponse.fromJson(jsonResponse.body);
}