
    q	hp
                        S r SSKrSSKJr  S\S\4S jrS\S\4S jrS	\S\4S
 jrS\S\4S jr	S\S\4S jr
S\R                  S\4S jrS\S\4S jrS\S\4S jrS\S\4S jrS\S\4S jrS\S\4S jrS\S\R                  4S jrg)z"Contains the Duration helper APIs.    N)Durationvaluereturnc                 <    [        5       nUR                  U 5        U$ )a   Converts a string to Duration.

Args:
  value: A string to be converted. The string must end with 's'. Any
    fractional digits (or none) are accepted as long as they fit into
    precision. For example: "1s", "1.01s", "1.0000001s", "-3.100s"

Raises:
  ValueError: On parsing problems.
)r   FromJsonString)r   durations     J/var/www/html/env/lib/python3.13/site-packages/google/protobuf/duration.pyfrom_json_stringr
      s     Z(
% 	/    microsc                 <    [        5       nUR                  U 5        U$ )z"Converts microseconds to Duration.)r   FromMicroseconds)r   r   s     r	   from_microsecondsr          Z(
F#	/r   millisc                 <    [        5       nUR                  U 5        U$ )z"Converts milliseconds to Duration.)r   FromMilliseconds)r   r   s     r	   from_millisecondsr   &   r   r   nanosc                 <    [        5       nUR                  U 5        U$ )z!Converts nanoseconds to Duration.)r   FromNanoseconds)r   r   s     r	   from_nanosecondsr   -   s    Z(
5!	/r   secondsc                 <    [        5       nUR                  U 5        U$ )zConverts seconds to Duration.)r   FromSeconds)r   r   s     r	   from_secondsr   4   s    Z(
w	/r   tdc                 <    [        5       nUR                  U 5        U$ )zConverts timedelta to Duration.)r   FromTimedelta)r   r   s     r	   from_timedeltar    ;   s    Z(
	/r   r   c                 "    U R                  5       $ )a  Converts Duration to string format.

Returns:
  A string converted from self. The string format will contains
  3, 6, or 9 fractional digits depending on the precision required to
  represent the exact Duration value. For example: "1s", "1.010s",
  "1.000000100s", "-3.100s"
)ToJsonStringr   s    r	   to_json_stringr$   B   s     
			  r   c                 "    U R                  5       $ )z$Converts a Duration to microseconds.)ToMicrosecondsr#   s    r	   to_microsecondsr'   N       		 	 	""r   c                 "    U R                  5       $ )z$Converts a Duration to milliseconds.)ToMillisecondsr#   s    r	   to_millisecondsr+   S   r(   r   c                 "    U R                  5       $ )z#Converts a Duration to nanoseconds.)ToNanosecondsr#   s    r	   to_nanosecondsr.   X   s    				!!r   c                 "    U R                  5       $ )zConverts a Duration to seconds.)	ToSecondsr#   s    r	   
to_secondsr1   ]   s    				r   c                 "    U R                  5       $ )zConverts Duration to timedelta.)ToTimedeltar#   s    r	   to_timedeltar4   b   s    				r   )__doc__datetimegoogle.protobuf.duration_pb2r   strr
   floatr   r   r   r   	timedeltar    r$   intr'   r+   r.   r1   r4    r   r	   <module>r=      s    )  1C H  e  e  E h % H x)) h 	!X 	!# 	!#h #3 #
#h #3 #
"X "# "
 c 
 8  (:(:  r   