a
    ù!fþ	  ã                   @   sH   d Z ddlZddlmZ e dej¡Ze dej¡Zdd„ Zdd	„ Z	dS )
z%Helper functions for shared behavior.é    N)Ú_name_from_project_pathzÕ
    projects/            # static prefix
    (?P<project>[^/]+)   # initial letter, wordchars + hyphen
    /topics/             # static midfix
    (?P<name>[^/]+)      # initial letter, wordchars + allowed punc
zÕ
    projects/            # static prefix
    (?P<project>[^/]+)   # initial letter, wordchars + hyphen
    /subscriptions/      # static midfix
    (?P<name>[^/]+)      # initial letter, wordchars + allowed punc
c                 C   s   t | |tƒS )a  Validate a topic URI path and get the topic name.

    :type path: string
    :param path: URI path for a topic API request.

    :type project: string
    :param project: The project associated with the request. It is
                    included for validation purposes.

    :rtype: string
    :returns: Topic name parsed from ``path``.
    :raises: :class:`ValueError` if the ``path`` is ill-formed or if
             the project from the ``path`` does not agree with the
             ``project`` passed in.
    )r   Ú_TOPIC_TEMPLATE©ÚpathÚproject© r   úW/var/www/html/python-backend/venv/lib/python3.9/site-packages/gcloud/pubsub/_helpers.pyÚtopic_name_from_path&   s    r	   c                 C   s   t | |tƒS )a   Validate a subscription URI path and get the subscription name.

    :type path: string
    :param path: URI path for a subscription API request.

    :type project: string
    :param project: The project associated with the request. It is
                    included for validation purposes.

    :rtype: string
    :returns: subscription name parsed from ``path``.
    :raises: :class:`ValueError` if the ``path`` is ill-formed or if
             the project from the ``path`` does not agree with the
             ``project`` passed in.
    )r   Ú_SUBSCRIPTION_TEMPLATEr   r   r   r   Úsubscription_name_from_path9   s    r   )
Ú__doc__ÚreZgcloud._helpersr   ÚcompileÚVERBOSEr   r
   r	   r   r   r   r   r   Ú<module>   s   ûû