describeSessions method

Future<DescribeSessionsResult> describeSessions({
  1. required String fleetName,
  2. required String stackName,
  3. AuthenticationType? authenticationType,
  4. String? instanceId,
  5. int? limit,
  6. String? nextToken,
  7. String? userId,
})

Retrieves a list that describes the streaming sessions for a specified stack and fleet. If a UserId is provided for the stack and fleet, only streaming sessions for that user are described. If an authentication type is not provided, the default is to authenticate users using a streaming URL.

May throw InvalidParameterCombinationException.

Parameter fleetName : The name of the fleet. This value is case-sensitive.

Parameter stackName : The name of the stack. This value is case-sensitive.

Parameter authenticationType : The authentication method. Specify API for a user authenticated using a streaming URL or SAML for a SAML federated user. The default is to authenticate users using a streaming URL.

Parameter instanceId : The identifier for the instance hosting the session.

Parameter limit : The size of each page of results. The default value is 20 and the maximum value is 50.

Parameter nextToken : The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.

Parameter userId : The user identifier (ID). If you specify a user ID, you must also specify the authentication type.

Implementation

Future<DescribeSessionsResult> describeSessions({
  required String fleetName,
  required String stackName,
  AuthenticationType? authenticationType,
  String? instanceId,
  int? limit,
  String? nextToken,
  String? userId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'PhotonAdminProxyService.DescribeSessions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'FleetName': fleetName,
      'StackName': stackName,
      if (authenticationType != null)
        'AuthenticationType': authenticationType.value,
      if (instanceId != null) 'InstanceId': instanceId,
      if (limit != null) 'Limit': limit,
      if (nextToken != null) 'NextToken': nextToken,
      if (userId != null) 'UserId': userId,
    },
  );

  return DescribeSessionsResult.fromJson(jsonResponse.body);
}