testAvailabilityConfiguration method

Future<TestAvailabilityConfigurationResponse> testAvailabilityConfiguration({
  1. required String organizationId,
  2. String? domainName,
  3. EwsAvailabilityProvider? ewsProvider,
  4. LambdaAvailabilityProvider? lambdaProvider,
})

Performs a test on an availability provider to ensure that access is allowed. For EWS, it verifies the provided credentials can be used to successfully log in. For Lambda, it verifies that the Lambda function can be invoked and that the resource access policy was configured to deny anonymous access. An anonymous invocation is one done without providing either a SourceArn or SourceAccount header.

May throw InvalidParameterException. May throw OrganizationNotFoundException. May throw OrganizationStateException. May throw ResourceNotFoundException.

Parameter organizationId : The WorkMail organization where the availability provider will be tested.

Parameter domainName : The domain to which the provider applies. If this field is provided, a stored availability provider associated to this domain name will be tested.

Implementation

Future<TestAvailabilityConfigurationResponse> testAvailabilityConfiguration({
  required String organizationId,
  String? domainName,
  EwsAvailabilityProvider? ewsProvider,
  LambdaAvailabilityProvider? lambdaProvider,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkMailService.TestAvailabilityConfiguration'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'OrganizationId': organizationId,
      if (domainName != null) 'DomainName': domainName,
      if (ewsProvider != null) 'EwsProvider': ewsProvider,
      if (lambdaProvider != null) 'LambdaProvider': lambdaProvider,
    },
  );

  return TestAvailabilityConfigurationResponse.fromJson(jsonResponse.body);
}