setIdentityPoolConfiguration method

Future<SetIdentityPoolConfigurationResponse> setIdentityPoolConfiguration({
  1. required String identityPoolId,
  2. CognitoStreams? cognitoStreams,
  3. PushSync? pushSync,
})

Sets the necessary configuration for push sync.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

May throw NotAuthorizedException. May throw InvalidParameterException. May throw ResourceNotFoundException. May throw InternalErrorException. May throw TooManyRequestsException. May throw ConcurrentModificationException.

Parameter identityPoolId : A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. This is the ID of the pool to modify.

Parameter cognitoStreams : Options to apply to this identity pool for Amazon Cognito streams.

Parameter pushSync : Options to apply to this identity pool for push synchronization.

Implementation

Future<SetIdentityPoolConfigurationResponse> setIdentityPoolConfiguration({
  required String identityPoolId,
  CognitoStreams? cognitoStreams,
  PushSync? pushSync,
}) async {
  ArgumentError.checkNotNull(identityPoolId, 'identityPoolId');
  _s.validateStringLength(
    'identityPoolId',
    identityPoolId,
    1,
    55,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    if (cognitoStreams != null) 'CognitoStreams': cognitoStreams,
    if (pushSync != null) 'PushSync': pushSync,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/identitypools/${Uri.encodeComponent(identityPoolId)}/configuration',
    exceptionFnMap: _exceptionFns,
  );
  return SetIdentityPoolConfigurationResponse.fromJson(response);
}