putSkillAuthorization method

Future<void> putSkillAuthorization({
  1. required Map<String, String> authorizationResult,
  2. required String skillId,
  3. String? roomArn,
})

Links a user's account to a third-party skill provider. If this API operation is called by an assumed IAM role, the skill being linked must be a private skill. Also, the skill must be owned by the AWS account that assumed the IAM role.

May throw UnauthorizedException. May throw ConcurrentModificationException.

Parameter authorizationResult : The authorization result specific to OAUTH code grant output. "Code” must be populated in the AuthorizationResult map to establish the authorization.

Parameter skillId : The unique identifier of a skill.

Parameter roomArn : The room that the skill is authorized for.

Implementation

Future<void> putSkillAuthorization({
  required Map<String, String> authorizationResult,
  required String skillId,
  String? roomArn,
}) async {
  ArgumentError.checkNotNull(authorizationResult, 'authorizationResult');
  ArgumentError.checkNotNull(skillId, 'skillId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AlexaForBusiness.PutSkillAuthorization'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AuthorizationResult': authorizationResult,
      'SkillId': skillId,
      if (roomArn != null) 'RoomArn': roomArn,
    },
  );
}