getStudioSessionMapping method

Future<GetStudioSessionMappingOutput> getStudioSessionMapping({
  1. required IdentityType identityType,
  2. required String studioId,
  3. String? identityId,
  4. String? identityName,
})
Fetches mapping details for the specified Amazon EMR Studio and identity (user or group).

May throw InternalServerError. May throw InvalidRequestException.

Parameter identityType : Specifies whether the identity to fetch is a user or a group.

Parameter studioId : The ID of the Amazon EMR Studio.

Parameter identityId : The globally unique identifier (GUID) of the user or group. For more information, see UserId and GroupId in the AWS SSO Identity Store API Reference. Either IdentityName or IdentityId must be specified.

Parameter identityName : The name of the user or group to fetch. For more information, see UserName and DisplayName in the AWS SSO Identity Store API Reference. Either IdentityName or IdentityId must be specified.

Implementation

Future<GetStudioSessionMappingOutput> getStudioSessionMapping({
  required IdentityType identityType,
  required String studioId,
  String? identityId,
  String? identityName,
}) async {
  ArgumentError.checkNotNull(identityType, 'identityType');
  ArgumentError.checkNotNull(studioId, 'studioId');
  _s.validateStringLength(
    'studioId',
    studioId,
    0,
    256,
    isRequired: true,
  );
  _s.validateStringLength(
    'identityId',
    identityId,
    0,
    256,
  );
  _s.validateStringLength(
    'identityName',
    identityName,
    0,
    256,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'ElasticMapReduce.GetStudioSessionMapping'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'IdentityType': identityType.toValue(),
      'StudioId': studioId,
      if (identityId != null) 'IdentityId': identityId,
      if (identityName != null) 'IdentityName': identityName,
    },
  );

  return GetStudioSessionMappingOutput.fromJson(jsonResponse.body);
}