listSkills method

Future<ListSkillsResponse> listSkills({
  1. EnablementTypeFilter? enablementType,
  2. int? maxResults,
  3. String? nextToken,
  4. String? skillGroupArn,
  5. SkillTypeFilter? skillType,
})

Lists all enabled skills in a specific skill group.

Parameter enablementType : Whether the skill is enabled under the user's account.

Parameter maxResults : The maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

Parameter nextToken : An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

Parameter skillGroupArn : The ARN of the skill group for which to list enabled skills.

Parameter skillType : Whether the skill is publicly available or is a private skill.

Implementation

Future<ListSkillsResponse> listSkills({
  EnablementTypeFilter? enablementType,
  int? maxResults,
  String? nextToken,
  String? skillGroupArn,
  SkillTypeFilter? skillType,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    10,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AlexaForBusiness.ListSkills'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (enablementType != null) 'EnablementType': enablementType.toValue(),
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (skillGroupArn != null) 'SkillGroupArn': skillGroupArn,
      if (skillType != null) 'SkillType': skillType.toValue(),
    },
  );

  return ListSkillsResponse.fromJson(jsonResponse.body);
}