elastic_enterprise_search/_async/client/__init__.py [37:71]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @staticmethod
    def create_signed_search_key(
        *,
        api_key: str,
        api_key_name: str,
        search_fields: t.Optional[t.Dict[str, t.Any]] = DEFAULT,
        result_fields: t.Optional[t.Dict[str, t.Any]] = DEFAULT,
        filters: t.Optional[t.Dict[str, t.Any]] = DEFAULT,
        facets: t.Optional[t.Dict[str, t.Any]] = DEFAULT,
    ):
        """Creates a Signed Search Key to keep your Private API Key secret
        and restrict what a user can search over.

        `<https://www.elastic.co/guide/en/app-search/current/authentication.html#authentication-signed>`_

        :arg api_key: API key to use for signing
        :arg api_key_name: Name of the API key used for signing
        :arg search_fields: Fields to search over.
        :arg result_fields: Fields to return in the result
        :arg filters: Adds filters to the search requests
        :arg facets: Sets the facets that are allowed.
            To disable aggregations set to '{}' or 'None'.
        """
        options = {
            k: v
            for k, v in (
                ("api_key_name", api_key_name),
                ("search_fields", search_fields),
                ("result_fields", result_fields),
                ("filters", filters),
                ("facets", facets),
            )
            if v is not DEFAULT
        }
        return jwt.encode(payload=options, key=api_key, algorithm="HS256")
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



elastic_enterprise_search/_sync/client/__init__.py [37:71]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @staticmethod
    def create_signed_search_key(
        *,
        api_key: str,
        api_key_name: str,
        search_fields: t.Optional[t.Dict[str, t.Any]] = DEFAULT,
        result_fields: t.Optional[t.Dict[str, t.Any]] = DEFAULT,
        filters: t.Optional[t.Dict[str, t.Any]] = DEFAULT,
        facets: t.Optional[t.Dict[str, t.Any]] = DEFAULT,
    ):
        """Creates a Signed Search Key to keep your Private API Key secret
        and restrict what a user can search over.

        `<https://www.elastic.co/guide/en/app-search/current/authentication.html#authentication-signed>`_

        :arg api_key: API key to use for signing
        :arg api_key_name: Name of the API key used for signing
        :arg search_fields: Fields to search over.
        :arg result_fields: Fields to return in the result
        :arg filters: Adds filters to the search requests
        :arg facets: Sets the facets that are allowed.
            To disable aggregations set to '{}' or 'None'.
        """
        options = {
            k: v
            for k, v in (
                ("api_key_name", api_key_name),
                ("search_fields", search_fields),
                ("result_fields", result_fields),
                ("filters", filters),
                ("facets", facets),
            )
            if v is not DEFAULT
        }
        return jwt.encode(payload=options, key=api_key, algorithm="HS256")
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



