Updates the given IdentityPoolId's properties.  All parameters except for IdentityPoolId,
    is optional.  SupportedLoginProviders should be a dictionary mapping provider names to
    provider app IDs.  OpenIdConnectProviderARNs should be a list of OpenID Connect provider
    ARNs.

    To clear SupportedLoginProviders pass '{}'

    To clear OpenIdConnectProviderARNs pass '[]'

    boto3 api prevents DeveloperProviderName to be updated after it has been set for the first time.

    Returns the updated identity pool if successful

    CLI Example:

    .. code-block:: bash

        salt myminion boto_cognitoidentity.update_identity_pool my_id_pool_id my_id_pool_name \
                             DeveloperProviderName=custom_developer_provider

def update_identity_pool(IdentityPoolId,
                         IdentityPoolName=None,
                         AllowUnauthenticatedIdentities=False,
                         SupportedLoginProviders=None,
                         DeveloperProviderName=None,
                         OpenIdConnectProviderARNs=None,
                         region=None, key=None, keyid=None, profile=None):
    '''
    Updates the given IdentityPoolId's properties.  All parameters except for IdentityPoolId,
    is optional.  SupportedLoginProviders should be a dictionary mapping provider names to
    provider app IDs.  OpenIdConnectProviderARNs should be a list of OpenID Connect provider
    ARNs.

    To clear SupportedLoginProviders pass '{}'

    To clear OpenIdConnectProviderARNs pass '[]'

    boto3 api prevents DeveloperProviderName to be updated after it has been set for the first time.

    Returns the updated identity pool if successful

    CLI Example:

    .. code-block:: bash

        salt myminion boto_cognitoidentity.update_identity_pool my_id_pool_id my_id_pool_name \
                             DeveloperProviderName=custom_developer_provider

    '''
    conn_params = dict(region=region, key=key, keyid=keyid, profile=profile)
    response = describe_identity_pools('', IdentityPoolId=IdentityPoolId, **conn_params)
    error = response.get('error')
    if error is None:
        error = 'No matching pool' if response.get('identity_pools') is None else None

    if error:
        return {'updated': False, 'error': error}

    id_pool = response.get('identity_pools')[0]
    request_params = id_pool.copy()
    # IdentityPoolName and AllowUnauthenticatedIdentities are required for the call to update_identity_pool
    if IdentityPoolName is not None and IdentityPoolName != request_params.get('IdentityPoolName'):
        request_params['IdentityPoolName'] = IdentityPoolName

    if AllowUnauthenticatedIdentities != request_params.get('AllowUnauthenticatedIdentities'):
        request_params['AllowUnauthenticatedIdentities'] = AllowUnauthenticatedIdentities

    current_val = request_params.pop('SupportedLoginProviders', None)
    if SupportedLoginProviders is not None and SupportedLoginProviders != current_val:
        request_params['SupportedLoginProviders'] = SupportedLoginProviders

    # we can only set DeveloperProviderName one time per AWS.
    current_val = request_params.pop('DeveloperProviderName', None)
    if current_val is None and DeveloperProviderName is not None:
        request_params['DeveloperProviderName'] = DeveloperProviderName

    current_val = request_params.pop('OpenIdConnectProviderARNs', None)
    if OpenIdConnectProviderARNs is not None and OpenIdConnectProviderARNs != current_val:
        request_params['OpenIdConnectProviderARNs'] = OpenIdConnectProviderARNs

    conn = _get_conn(**conn_params)

    try:
        response = conn.update_identity_pool(**request_params)
        response.pop('ResponseMetadata', None)

        return {'updated': True, 'identity_pool': response}
    except ClientError as e:
        return {'updated': False, 'error': __utils__['boto3.get_error'](e)}