zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
U
£ý°d¬xã@sfdZdZddlZddlZddlZddlmZdZdZ    dZ
dZ dZ dZ d    Zd
ZGd d „d eƒZej d¡Zejjdejjd ZGdd„deƒZGdd„deƒZdd„Zdd„ZGdd„deƒZdd„Zdd„Zdd„Zdd„Z Gd d!„d!eƒZ!d"d#„Z"d$d%„Z#d&d'„Z$d(d)„Z%d*d+„Z&Gd,d-„d-eƒZ'ej(j) *e'¡Gd.d/„d/eƒZ+ej(j, *e+¡eeee+e'ed0œZ-dS)1z¨Contains well known classes.
 
This files defines well known classes which need extra maintenance including:
  - Any
  - Duration
  - FieldMask
  - Struct
  - Timestamp
zjieluo@google.com (Jie Luo)éN)ÚFieldDescriptorz%Y-%m-%dT%H:%M:%Siʚ;i@Bièi€Ql—s%c@s6eZdZdZdZd dd„Zdd„Zd    d
„Zd d „ZdS)ÚAnyzClass for Any Message type.©útype.googleapis.com/NcCsPt|ƒdks|ddkr,d||jjf|_nd||jjf|_|j|d|_dS)z5Packs the specified message into current Any message.ééÿÿÿÿú/z%s/%sz%s%s)Ú deterministicN)ÚlenÚ
DESCRIPTORÚ    full_nameÚtype_urlZSerializeToStringÚvalue)ÚselfÚmsgZtype_url_prefixr    rrú`d:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\google/protobuf/internal/well_known_types.pyÚPack@szAny.PackcCs$|j}| |¡sdS| |j¡dS)z7Unpacks the current Any message into specified message.FT)r ÚIsZParseFromStringr)rrÚ
descriptorrrrÚUnpackIs
 
 z
Any.UnpackcCs|j d¡dS)z4Returns the protobuf type name of the inner message.rr)r Úsplit©rrrrÚTypeNameQsz Any.TypeNamecCsd|jko| ¡|jkS)z6Checks if this Any represents the given protobuf type.r)r rr )rrrrrrVszAny.Is)rN)    Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ú    __slots__rrrrrrrrr;sÿ
    r)Útzc@s~eZdZdZdZdd„Zdd„Zdd„Zd    d
„Zd d „Z    d d„Z
dd„Z dd„Z dd„Z dd„Zdd„Zddd„Zdd„ZdS)Ú    Timestampz!Class for Timestamp message type.rcCs¬|jt}|j|j|t}|t}||t}t ddd¡t ||¡}| ¡}|ddkrh|dS|ddkr„|d|dS|ddkr |d    |dS|d
|S) a#Converts Timestamp to RFC 3339 date string format.
 
    Returns:
      A string converted from timestamp. The string is always Z-normalized
      and uses 3, 6 or 9 fractional digits as required to represent the
      exact time. Example of the return format: '1972-01-01T10:00:20.021Z'
    é²rçeÍÍArÚZ瀄.Az.%03dZç@@z.%06dZz.%09dZ)ÚnanosÚ_NANOS_PER_SECONDÚsecondsÚ_SECONDS_PER_DAYÚdatetimeÚ    timedeltaÚ    isoformat)rr%Z    total_secr'ÚdaysÚdtÚresultrrrÚ ToJsonStringes
    zTimestamp.ToJsonStringc Cst|tƒstd |¡ƒ‚| d¡}|dkr4| d¡}|dkrF| d¡}|dkrVtdƒ‚|d|…}| d¡}|dkr~|}d    }n|d
|…}||d d
…}d |kr°td  |¡ƒ‚tj |t¡}|t dd d ¡}|j    |j
t }    t |ƒdkrútd |¡ƒ‚|rt td|ƒdƒ}
nd}
||dkrJt |ƒ|d krètd |¡ƒ‚nž||d
…} |  d¡} | dkrxtd | ¡ƒ‚| ddkr¸|    t| d | …ƒdt| | d d
…ƒd8}    n0|    t| d | …ƒdt| | d d
…ƒd7}    t|    ƒ|_    t|
ƒ|_d
S)aNParse a RFC 3339 date string format to Timestamp.
 
    Args:
      value: A date string. Any fractional digits (or none) and any offset are
          accepted as long as they fit into nano-seconds precision.
          Example of accepted format: '1972-01-01T10:00:20.021-05:00'
 
    Raises:
      ValueError: On parsing problems.
    z'Timestamp JSON value not a string: {!r}r"rú+ú-z9Failed to parse timestamp: missing valid timezone offset.rÚ.ÚNrÚtzXtime data '{0}' does not match format '%Y-%m-%dT%H:%M:%S', lowercase 't' is not acceptedr é    zCFailed to parse Timestamp: nanos {0} more than 9 fractional digits.z0.r!z5Failed to parse timestamp: invalid trailing data {0}.ú:z#Invalid timezone offset value: {0}.é<)Ú
isinstanceÚstrÚ
ValueErrorÚformatÚfindÚrfindr)ÚstrptimeÚ_TIMESTAMPFOMATr'r,r(r
ÚroundÚfloatÚintr%) rrZtimezone_offsetZ
time_valueZpoint_positionZ second_valueZ
nano_valueZ date_objectÚtdr'r%ÚtimezoneÚposrrrÚFromJsonStringsh
 
 
 
ÿ 
 ÿÿ ÿÿÿ 
 
ÿ20
zTimestamp.FromJsonStringcCs| tj ¡¡dS)z#Get the current UTC into Timestamp.N)Ú FromDatetimer)ÚutcnowrrrrÚGetCurrentTimeÁszTimestamp.GetCurrentTimecCs|jt|jS)z.Converts Timestamp to nanoseconds since epoch.©r'r&r%rrrrÚ ToNanosecondsÅszTimestamp.ToNanosecondscCs|jt|jtS)z/Converts Timestamp to microseconds since epoch.)r'Ú_MICROS_PER_SECONDr%Ú_NANOS_PER_MICROSECONDrrrrÚToMicrosecondsÉsÿzTimestamp.ToMicrosecondscCs|jt|jtS)z/Converts Timestamp to milliseconds since epoch.)r'Ú_MILLIS_PER_SECONDr%Ú_NANOS_PER_MILLISECONDrrrrÚToMillisecondsÎsÿzTimestamp.ToMillisecondscCs|jS)z*Converts Timestamp to seconds since epoch.©r'rrrrÚ    ToSecondsÓszTimestamp.ToSecondscCs|t|_|t|_dS)z.Converts nanoseconds since epoch to Timestamp.N©r&r'r%©rr%rrrÚFromNanoseconds×s
zTimestamp.FromNanosecondscCs|t|_|tt|_dS)z/Converts microseconds since epoch to Timestamp.N)rLr'rMr%©rZmicrosrrrÚFromMicrosecondsÜs
zTimestamp.FromMicrosecondscCs|t|_|tt|_dS)z/Converts milliseconds since epoch to Timestamp.N)rOr'rPr%©rZmillisrrrÚFromMillisecondsás
zTimestamp.FromMillisecondscCs||_d|_dS)z*Converts seconds since epoch to Timestamp.rN©r'r%©rr'rrrÚ FromSecondsæszTimestamp.FromSecondsNcCs:tj|jt|jtƒd}|dkr(t|St |¡|SdS)aIConverts Timestamp to a datetime.
 
    Args:
      tzinfo: A datetime.tzinfo subclass; defaults to None.
 
    Returns:
      If tzinfo is None, returns a timezone-naive UTC datetime (with no timezone
      information, i.e. not aware that it's UTC).
 
      Otherwise, returns a timezone-aware datetime in the input timezone.
    ©r'Ú microsecondsN)    r)r*r'Ú_RoundTowardZeror%rMÚ_EPOCH_DATETIME_NAIVEÚ_EPOCH_DATETIME_AWAREÚ
astimezone)rÚtzinfoÚdeltarrrÚ
ToDatetimeës 
þzTimestamp.ToDatetimecCs t | ¡¡|_|jt|_dS)zxConverts datetime to Timestamp.
 
    Args:
      dt: A datetime. If it's timezone-naive, it's assumed to be in UTC.
    N)ÚcalendarÚtimegmÚ utctimetupler'Ú microsecondrMr%)rr-rrrrGÿs zTimestamp.FromDatetime)N)rrrrrr/rFrIrKrNrQrSrVrXrZr]rfrGrrrrr`s@
rc@s|eZdZdZdZdd„Zdd„Zdd„Zd    d
„Zd d „Z    d d„Z
dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„ZdS)ÚDurationz Class for Duration message type.rcCsÖt|j|jƒ|jdks"|jdkrPd}|j td|jdƒ}d|jd}n"d}|jt|jdƒ}|jd}|d|7}|ddkr’|dS|ddkr®|d|dS|d    dkrÊ|d
|d    S|d |S) 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"
    rr1r!r3z%dÚsr#z.%03dsr$z.%06dsz.%09ds)Ú_CheckDurationValidr'r%rB)rr.r'r%rrrr/s     
    zDuration.ToJsonStringc
Cst|tƒstd |¡ƒ‚t|ƒdks0|ddkr>td |¡ƒ‚z¤| d¡}|dkrht|dd…ƒ}d}nbt|d|…ƒ}|dd    kr¨tttd
 ||d…¡ƒd ƒƒ}n"tttd  ||d…¡ƒd ƒƒ}t    ||ƒ||_
||_ Wn4tk
r}ztd  ||¡ƒ‚W5d}~XYnXdS)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.
    z&Duration JSON value not a string: {!r}rrrlz'Duration must end with letter "s": {0}.r2Nrr1z-0{0}r!z0{0}z#Couldn't parse duration: {0} : {1}.) r8r9r:r;r
r<rBr@rArmr'r%)rrrEr'r%ÚerrrrF5s,
ÿ
 $"
 
 
ÿzDuration.FromJsonStringcCs|jt|jS)z#Converts a Duration to nanoseconds.rJrrrrrKWszDuration.ToNanosecondscCst|jtƒ}|jt|S)z$Converts a Duration to microseconds.)r`r%rMr'rLrWrrrrN[s zDuration.ToMicrosecondscCst|jtƒ}|jt|S)z$Converts a Duration to milliseconds.)r`r%rPr'rOrYrrrrQ`s zDuration.ToMillisecondscCs|jS)zConverts a Duration to seconds.rRrrrrrSeszDuration.ToSecondscCs| |t|t¡dS)z!Converts nanoseconds to Duration.N)Ú_NormalizeDurationr&rUrrrrVis
ÿzDuration.FromNanosecondscCs| |t|tt¡dS)z"Converts microseconds to Duration.N)rorLrMrWrrrrXns
þzDuration.FromMicrosecondscCs| |t|tt¡dS)z"Converts milliseconds to Duration.N)rorOrPrYrrrrZts
þzDuration.FromMillisecondscCs||_d|_dS)zConverts seconds to Duration.rNr[r\rrrr]zszDuration.FromSecondscCstj|jt|jtƒdS)zConverts Duration to timedelta.r^)r)r*r'r`r%rMrrrrÚ ToTimedeltasÿÿzDuration.ToTimedeltacCs"| |j|jt|jt¡dS)zConverts timedelta to Duration.N)ror'r,r(r_rM)rrCrrrÚ FromTimedelta…sÿzDuration.FromTimedeltacCs0|dkr |dkr |d7}|t8}||_||_dS)z"Set Duration by seconds and nanos.rrNrT)rr'r%rrrroŠs
zDuration._NormalizeDurationN)rrrrrr/rFrKrNrQrSrVrXrZr]rprqrorrrrrks "rkcCsl|t ks|tkr td |¡ƒ‚|t ks2|tkr@td |¡ƒ‚|dkrP|dks`|dkrh|dkrhtdƒ‚dS)NzRDuration is not valid: Seconds {0} must be in range [-315576000000, 315576000000].zJDuration is not valid: Nanos {0} must be in range [-999999999, 999999999].rz%Duration is not valid: Sign mismatch.)Ú_DURATION_SECONDS_MAXr:r;r&r[rrrrm”s ÿÿÿÿ ÿrmcCs0||}||}|dkr(|dkr(|dS|SdS)z,Truncates the remainder part after division.rrNr)rÚdividerr.Ú    remainderrrrr`¢s
r`c@sVeZdZdZdZdd„Zdd„Zdd„Zd    d
„Zd d „Z    d d„Z
dd„Z ddd„Z dS)Ú    FieldMaskz!Class for FieldMask message type.rcCs(g}|jD]}| t|ƒ¡q
d |¡S)z;Converts FieldMask to string according to proto3 JSON spec.ú,)ÚpathsÚappendÚ_SnakeCaseToCamelCaseÚjoin)rZcamelcase_pathsÚpathrrrr/¶s
zFieldMask.ToJsonStringcCsHt|tƒstd |¡ƒ‚| ¡|rD| d¡D]}|j t|ƒ¡q.dS)z;Converts string to FieldMask according to proto3 JSON spec.z'FieldMask JSON value not a string: {!r}rvN)    r8r9r:r;ÚClearrrwrxÚ_CamelCaseToSnakeCase)rrr{rrrrF½s 
zFieldMask.FromJsonStringcCs |jD]}t||ƒsdSqdS)z=Checks whether the FieldMask is valid for Message Descriptor.FT)rwÚ _IsValidPath)rÚmessage_descriptorr{rrrÚIsValidForDescriptorÆs
 
zFieldMask.IsValidForDescriptorcCs&| ¡|jD]}|j |j¡qdS)z:Gets all direct fields of Message Descriptor to FieldMask.N)r|ÚfieldsrwrxÚname)rrÚfieldrrrÚAllFieldsFromDescriptorÍs
z!FieldMask.AllFieldsFromDescriptorcCst|ƒ}| |¡dS)a:Converts a FieldMask to the canonical form.
 
    Removes paths that are covered by another path. For example,
    "foo.bar" is covered by "foo" and will be removed if "foo"
    is also in the FieldMask. Then sorts all paths in alphabetical order.
 
    Args:
      mask: The original FieldMask to be converted.
    N)Ú_FieldMaskTreeÚ ToFieldMask)rÚmaskÚtreerrrÚCanonicalFormFromMaskÓs
zFieldMask.CanonicalFormFromMaskcCs0t|ƒt|ƒt|ƒ}| |¡| |¡dS)z+Merges mask1 and mask2 into this FieldMask.N)Ú_CheckFieldMaskMessager…ÚMergeFromFieldMaskr†)rÚmask1Úmask2rˆrrrÚUnionàs
 
zFieldMask.UnioncCsDt|ƒt|ƒt|ƒ}tƒ}|jD]}| ||¡q$| |¡dS)z/Intersects mask1 and mask2 into this FieldMask.N)rŠr…rwÚ IntersectPathr†)rrŒrrˆÚ intersectionr{rrrÚ    Intersectès
zFieldMask.IntersectFcCst|ƒ}| ||||¡dS)a„Merges fields specified in FieldMask from source to destination.
 
    Args:
      source: Source message.
      destination: The destination message to be merged into.
      replace_message_field: Replace message field if True. Merge message
          field if False.
      replace_repeated_field: Replace repeated field if True. Append
          elements of repeated field if False.
    N)r…Ú MergeMessage)rÚsourceÚ destinationZreplace_message_fieldZreplace_repeated_fieldrˆrrrr’òs ÿzFieldMask.MergeMessageN)FF) rrrrrr/rFr€r„r‰rŽr‘r’rrrrru±s      þrucCs^| d¡}| ¡}|D]<}|j |¡}|dksF|jtjksF|jtjkrLdS|j    }q||jkS)z8Checks whether the path is valid for Message Descriptor.r2NF)
rÚpopÚfields_by_nameÚgetÚlabelrÚLABEL_REPEATEDÚtypeZ TYPE_MESSAGEZ message_type)rr{ÚpartsÚlastr‚rƒrrrr~s
 
ÿ
þr~cCs0|j}|jdks|jjdkr,td |j¡ƒ‚dS)z0Raises ValueError if message is not a FieldMask.ruz google/protobuf/field_mask.protozMessage {0} is not a FieldMask.N)r r‚Úfiler:r;r )ÚmessagerrrrrŠs
 
ÿÿrŠcCsŠg}d}|D]`}| ¡r&td |¡ƒ‚|rV| ¡rF| | ¡¡d}qltd |¡ƒ‚q |dkrdd}q ||7}q |r€td |¡ƒ‚d |¡S)z2Converts a path name from snake_case to camelCase.FzYFail to print FieldMask to Json string: Path name {0} must not contain uppercase letters.znFail to print FieldMask to Json string: The character after a "_" must be a lowercase letter in path name {0}.Ú_TzFFail to print FieldMask to Json string: Trailing "_" in path name {0}.r3)Úisupperr:r;ÚislowerrxÚupperrz)Ú    path_namer.Zafter_underscoreÚcrrrrys4ÿÿþÿ
ÿrycCsTg}|D]@}|dkr"td |¡ƒ‚| ¡r@|d7}|| ¡7}q||7}qd |¡S)z3Converts a field name from camelCase to snake_case.rŸz=Fail to parse FieldMask: Path name {0} must not contain "_"s.r3)r:r;r Úlowerrz)r£r.r¤rrrr}8sÿ
r}c@sNeZdZdZdZddd„Zdd„Zdd    „Zd
d „Zd d „Z    dd„Z
dd„Z dS)r…a7Represents a FieldMask in a tree structure.
 
  For example, given a FieldMask "foo.bar,foo.baz,bar.baz",
  the FieldMaskTree will be:
      [_root] -+- foo -+- bar
            |       |
            |       +- baz
            |
            +- bar --- baz
  In the tree, each leaf node represents a field path.
  )Ú_rootNcCsi|_|r| |¡dS)z"Initializes the tree by FieldMask.N)r¦r‹©rÚ
field_maskrrrÚ__init__Vsz_FieldMaskTree.__init__cCs|jD]}| |¡qdS)zMerges a FieldMask to the tree.N)rwÚAddPath)rr¨r{rrrr‹\s
z!_FieldMaskTree.MergeFromFieldMaskcCsJ|j}| d¡D],}||kr&i||<n||s4dS||}q| ¡dS)a Adds a field path into the tree.
 
    If the field path to add is a sub-path of an existing field path
    in the tree (i.e., a leaf node), it means the tree already matches
    the given path so nothing will be added to the tree. If the path
    matches an existing non-leaf node in the tree, that non-leaf node
    will be turned into a leaf node with all its children removed because
    the path matches all the node's children. Otherwise, a new path will
    be added.
 
    Args:
      path: The field path to add.
    r2N)r¦rÚclear)rr{Únoder‚rrrrªas
 
z_FieldMaskTree.AddPathcCs| ¡t|jd|ƒdS)z!Converts the tree to a FieldMask.r3N)r|Ú_AddFieldPathsr¦r§rrrr†zsz_FieldMaskTree.ToFieldMaskcCsT|j}| d¡D]2}||kr"dS||s:| |¡dS||}q| ||¡dS)z¼Calculates the intersection part of a field path with this tree.
 
    Args:
      path: The field path to calculates.
      intersection: The out tree to record the intersection part.
    r2N)r¦rrªÚ AddLeafNodes)rr{rr¬r‚rrrrs
 
z_FieldMaskTree.IntersectPathcCs8|s| |¡|D] }|d|}| |||¡qdS)z/Adds leaf nodes begin with prefix to this tree.r2N)rªr®)rÚprefixr¬r‚Ú
child_pathrrrr®s
 
 z_FieldMaskTree.AddLeafNodescCst|j||||ƒdS)zCMerge all fields specified by this tree from source to destination.N)Ú _MergeMessager¦)rr“r”Úreplace_messageÚreplace_repeatedrrrr’˜sÿz_FieldMaskTree.MergeMessage)N) rrrrrr©r‹rªr†rr®r’rrrrr…Gs 
r…cCst|tƒs| d¡S|S)z#Converts value to str if it is not.zutf-8)r8r9Úencode)rrrrÚ _StrConvert s
 
rµc Cs,|j}|D]}||}|j|}|dkr<td ||j¡ƒ‚|r’|jtjksX|jtj    krjtd ||j¡ƒ‚| 
|¡r
t |t ||ƒt ||ƒ||ƒq
|jtjkrÐ|r°|  t|ƒ¡t ||ƒ}    t ||ƒ}
|
 |    ¡q
|jtj    kr|rð|  t|ƒ¡| 
|¡r&t ||ƒ t ||ƒ¡q
t||t ||ƒƒq
dS)zDMerge all fields specified by a sub-tree from source to destination.Nz+Error: Can't find field {0} in message {1}.z[Error: Field {0} in message {1} is not a singular message field and cannot have sub-fields.)r r–r:r;r r˜rr™Zcpp_typeZCPPTYPE_MESSAGEÚHasFieldr±ÚgetattrZ
ClearFieldrµZ    MergeFromÚsetattr) r¬r“r”r²r³Zsource_descriptorr‚ÚchildrƒZrepeated_sourceZrepeated_destinationrrrr±ªsL
 
ÿ 
ÿþ
þ 
 
  r±cCsP|s|r|j |¡dSt|ƒD]*}|r6|d|}n|}t||||ƒq dS)z7Adds the field paths descended from node to field_mask.Nr2)rwrxÚsortedr­)r¬r¯r¨r‚r°rrrr­Ðs  r­cCs¢|dkrd|_nŽt|tƒr"||_n|t|tƒr4||_njt|ttfƒrJ||_nTt|t    t
fƒrp|j   ¡|j   |¡n.t|ttfƒr–|j  ¡|j |¡ntdƒ‚dS)NrzUnexpected type)Ú
null_valuer8ÚboolÚ
bool_valuer9Ú string_valuerBrAÚ number_valueÚdictÚStructÚ struct_valuer|ÚupdateÚlistÚ    ListValueÚ
list_valueÚextendr:)rÂrrrrÚ_SetStructValueÝs
 
 
 
rÈcCsp| d¡}|dkr|jS|dkr$dS|dkr2|jS|dkr@|jS|dkrN|jS|dkr\|jS|dkrltdƒ‚dS)    NÚkindrÂr»r¿r¾r½rÆz Value not set)Z
WhichOneofrÂr¿r¾r½rÆr:)rÂÚwhichrrrÚ_GetStructValueòs
rËc@steZdZdZdZdd„Zdd„Zdd„Zd    d
„Zd d „Z    d d„Z
dd„Z dd„Z dd„Z dd„Zdd„Zdd„ZdS)rÁzClass for Struct message type.rcCst|j|ƒS©N)rËr©rÚkeyrrrÚ __getitem__    szStruct.__getitem__cCs
||jkSrÌ©r)rÚitemrrrÚ __contains__ szStruct.__contains__cCst|j||ƒdSrÌ)rÈr)rrÎrrrrÚ __setitem__szStruct.__setitem__cCs |j|=dSrÌrÐrÍrrrÚ __delitem__szStruct.__delitem__cCs
t|jƒSrÌ)r
rrrrrÚ__len__szStruct.__len__cCs
t|jƒSrÌ)ÚiterrrrrrÚ__iter__szStruct.__iter__cCs
|j ¡SrÌ)rÚkeysrrrrrØsz Struct.keyscs‡fdd„ˆDƒS)Ncsg|] }ˆ|‘qSrr©Ú.0rÎrrrÚ
<listcomp>sz!Struct.values.<locals>.<listcomp>rrrrrÚvaluessz Struct.valuescs‡fdd„ˆDƒS)Ncsg|]}|ˆ|f‘qSrrrÙrrrrÛ"sz Struct.items.<locals>.<listcomp>rrrrrÚitems!sz Struct.itemscCs,|j| d¡s |j|j ¡|j|jS)zAReturns a list for this key, creating if it didn't exist already.rÆ)rr¶rÆr|rÍrrrÚget_or_create_list$szStruct.get_or_create_listcCs,|j| d¡s |j|j ¡|j|jS)zCReturns a struct for this key, creating if it didn't exist already.rÂ)rr¶rÂr|rÍrrrÚget_or_create_struct+szStruct.get_or_create_structcCs&| ¡D]\}}t|j||ƒqdSrÌ)rÝrÈr)rÚ
dictionaryrÎrrrrrÃ2sz Struct.updateN)rrrrrrÏrÒrÓrÔrÕr×rØrÜrÝrÞrßrÃrrrrrÁsrÁc@s\eZdZdZdZdd„Zdd„Zdd„Zd    d
„Zd d „Z    d d„Z
dd„Z dd„Z dd„Z dS)rÅz!Class for ListValue message type.rcCs
t|jƒSrÌ)r
rÜrrrrrÕ>szListValue.__len__cCst|j ¡|ƒdSrÌ)rÈrÜÚadd)rrrrrrxAszListValue.appendcCs|D]}| |¡qdSrÌ)rx)rZelem_seqrrrrrÇDszListValue.extendcCst|j |¡ƒS)z&Retrieves item by the specified index.)rËrÜrÏ)rÚindexrrrrÏHszListValue.__getitem__cCst|j |¡|ƒdSrÌ)rÈrÜrÏ)rrârrrrrÓLszListValue.__setitem__cCs |j|=dSrÌ)rÜrÍrrrrÔOszListValue.__delitem__ccs tt|ƒƒD]}||Vq dSrÌ)Úranger
)rÚirrrrÝRszListValue.itemscCs|j ¡j}| ¡|S)zAAppends and returns a struct value as the next value in the list.)rÜrárÂr|)rrÂrrrÚ
add_structVs zListValue.add_structcCs|j ¡j}| ¡|S)z?Appends and returns a list value as the next value in the list.)rÜrárÆr|)rrÆrrrÚadd_list]s zListValue.add_listN)rrrrrrÕrxrÇrÏrÓrÔrÝrårærrrrrÅ9srÅ)zgoogle.protobuf.Anyzgoogle.protobuf.Durationzgoogle.protobuf.FieldMaskzgoogle.protobuf.ListValuezgoogle.protobuf.Structzgoogle.protobuf.Timestamp).rÚ
__author__rgÚcollections.abcÚ collectionsr)Zgoogle.protobuf.descriptorrr?r&rPrMrOrLr(rrÚobjectrÚutcfromtimestampraÚ fromtimestamprDÚutcrbrrkrmr`rur~rŠryr}r…rµr±r­rÈrËrÁÚabcÚMutableMappingÚregisterrÅÚMutableSequenceZWKTBASESrrrrÚ<module>s^
   ÿ1S    Y
& 2+ú