firebase_admin/_user_mgt.py
def encode_action_code_settings(settings):
    """ Validates the provided action code settings for email link generation and
    populates the REST api parameters.

    settings - ``ActionCodeSettings`` object provided to be encoded
    returns  - dict of parameters to be passed for link gereration.
    """

    parameters = {}
    # url
    if not settings.url:
        raise ValueError("Dynamic action links url is mandatory")

    try:
        parsed = parse.urlparse(settings.url)
        if not parsed.netloc:
            raise ValueError('Malformed dynamic action links url: "{0}".'.format(settings.url))
        parameters['continueUrl'] = settings.url
    except Exception:
        raise ValueError('Malformed dynamic action links url: "{0}".'.format(settings.url))

    # handle_code_in_app
    if settings.handle_code_in_app is not None:
        if not isinstance(settings.handle_code_in_app, bool):
            raise ValueError('Invalid value provided for handle_code_in_app: {0}'
                             .format(settings.handle_code_in_app))
        parameters['canHandleCodeInApp'] = settings.handle_code_in_app

    # dynamic_link_domain
    if settings.dynamic_link_domain is not None:
        if not isinstance(settings.dynamic_link_domain, str):
            raise ValueError('Invalid value provided for dynamic_link_domain: {0}'
                             .format(settings.dynamic_link_domain))
        parameters['dynamicLinkDomain'] = settings.dynamic_link_domain

    # ios_bundle_id
    if settings.ios_bundle_id is not None:
        if not isinstance(settings.ios_bundle_id, str):
            raise ValueError('Invalid value provided for ios_bundle_id: {0}'
                             .format(settings.ios_bundle_id))
        parameters['iosBundleId'] = settings.ios_bundle_id

    # android_* attributes
    if (settings.android_minimum_version or settings.android_install_app) \
        and not settings.android_package_name:
        raise ValueError("Android package name is required when specifying other Android settings")

    if settings.android_package_name is not None:
        if not isinstance(settings.android_package_name, str):
            raise ValueError('Invalid value provided for android_package_name: {0}'
                             .format(settings.android_package_name))
        parameters['androidPackageName'] = settings.android_package_name

    if settings.android_minimum_version is not None:
        if not isinstance(settings.android_minimum_version, str):
            raise ValueError('Invalid value provided for android_minimum_version: {0}'
                             .format(settings.android_minimum_version))
        parameters['androidMinimumVersion'] = settings.android_minimum_version

    if settings.android_install_app is not None:
        if not isinstance(settings.android_install_app, bool):
            raise ValueError('Invalid value provided for android_install_app: {0}'
                             .format(settings.android_install_app))
        parameters['androidInstallApp'] = settings.android_install_app

    return parameters
 Validates the provided action code settings for email link generation and
    populates the REST api parameters.

    settings - ``ActionCodeSettings`` object provided to be encoded
    returns  - dict of parameters to be passed for link gereration.
    
Validates the provided action code settings for email link generation and
populates the REST api parameters.

``ActionCodeSettings`` object provided to be encoded
returns  - dict of parameters to be passed for link gereration.
Validates the provided action code settings for email link generation and populates the REST api parameters . ` ` ActionCodeSettings ` ` object provided to be encoded returns - dict of parameters to be passed for link gereration .
def encode_action_code_settings(settings):
    parameters = {}
    if not settings.url:
        raise ValueError("Dynamic action links url is mandatory")
    try:
        parsed = parse.urlparse(settings.url)
        if not parsed.netloc:
            raise ValueError('Malformed dynamic action links url: "{0}".'.format(settings.url))
        parameters['continueUrl'] = settings.url
    except Exception:
        raise ValueError('Malformed dynamic action links url: "{0}".'.format(settings.url))
    if settings.handle_code_in_app is not None:
        if not isinstance(settings.handle_code_in_app, bool):
            raise ValueError('Invalid value provided for handle_code_in_app: {0}'
                             .format(settings.handle_code_in_app))
        parameters['canHandleCodeInApp'] = settings.handle_code_in_app
    if settings.dynamic_link_domain is not None:
        if not isinstance(settings.dynamic_link_domain, str):
            raise ValueError('Invalid value provided for dynamic_link_domain: {0}'
                             .format(settings.dynamic_link_domain))
        parameters['dynamicLinkDomain'] = settings.dynamic_link_domain
    if settings.ios_bundle_id is not None:
        if not isinstance(settings.ios_bundle_id, str):
            raise ValueError('Invalid value provided for ios_bundle_id: {0}'
                             .format(settings.ios_bundle_id))
        parameters['iosBundleId'] = settings.ios_bundle_id
    if (settings.android_minimum_version or settings.android_install_app) \
        and not settings.android_package_name:
        raise ValueError("Android package name is required when specifying other Android settings")
    if settings.android_package_name is not None:
        if not isinstance(settings.android_package_name, str):
            raise ValueError('Invalid value provided for android_package_name: {0}'
                             .format(settings.android_package_name))
        parameters['androidPackageName'] = settings.android_package_name
    if settings.android_minimum_version is not None:
        if not isinstance(settings.android_minimum_version, str):
            raise ValueError('Invalid value provided for android_minimum_version: {0}'
                             .format(settings.android_minimum_version))
        parameters['androidMinimumVersion'] = settings.android_minimum_version
    if settings.android_install_app is not None:
        if not isinstance(settings.android_install_app, bool):
            raise ValueError('Invalid value provided for android_install_app: {0}'
                             .format(settings.android_install_app))
        parameters['androidInstallApp'] = settings.android_install_app
    return parameters
def encode_action_code_settings ( settings ) : parameters = { } if not settings . url : raise ValueError ( "Dynamic action links url is mandatory" ) try : parsed = parse . urlparse ( settings . url ) if not parsed . netloc : raise ValueError ( 'Malformed dynamic action links url: "{0}".' . format ( settings . url ) ) parameters [ 'continueUrl' ] = settings . url except Exception : raise ValueError ( 'Malformed dynamic action links url: "{0}".' . format ( settings . url ) ) if settings . handle_code_in_app is not None : if not isinstance ( settings . handle_code_in_app , bool ) : raise ValueError ( 'Invalid value provided for handle_code_in_app: {0}' . format ( settings . handle_code_in_app ) ) parameters [ 'canHandleCodeInApp' ] = settings . handle_code_in_app if settings . dynamic_link_domain is not None : if not isinstance ( settings . dynamic_link_domain , str ) : raise ValueError ( 'Invalid value provided for dynamic_link_domain: {0}' . format ( settings . dynamic_link_domain ) ) parameters [ 'dynamicLinkDomain' ] = settings . dynamic_link_domain if settings . ios_bundle_id is not None : if not isinstance ( settings . ios_bundle_id , str ) : raise ValueError ( 'Invalid value provided for ios_bundle_id: {0}' . format ( settings . ios_bundle_id ) ) parameters [ 'iosBundleId' ] = settings . ios_bundle_id if ( settings . android_minimum_version or settings . android_install_app ) and not settings . android_package_name : raise ValueError ( "Android package name is required when specifying other Android settings" ) if settings . android_package_name is not None : if not isinstance ( settings . android_package_name , str ) : raise ValueError ( 'Invalid value provided for android_package_name: {0}' . format ( settings . android_package_name ) ) parameters [ 'androidPackageName' ] = settings . android_package_name if settings . android_minimum_version is not None : if not isinstance ( settings . android_minimum_version , str ) : raise ValueError ( 'Invalid value provided for android_minimum_version: {0}' . format ( settings . android_minimum_version ) ) parameters [ 'androidMinimumVersion' ] = settings . android_minimum_version if settings . android_install_app is not None : if not isinstance ( settings . android_install_app , bool ) : raise ValueError ( 'Invalid value provided for android_install_app: {0}' . format ( settings . android_install_app ) ) parameters [ 'androidInstallApp' ] = settings . android_install_app return parameters
Validates the provided action code settings for email link generation and
populates the REST api parameters.
Validates the provided action code settings for email link generation and populates the REST api parameters .
""" Validates the provided action code settings for email link generation and
    populates the REST api parameters.

    settings - ``ActionCodeSettings`` object provided to be encoded
    returns  - dict of parameters to be passed for link gereration.
    """ # url # handle_code_in_app # dynamic_link_domain # ios_bundle_id # android_* attributes
settings