(self)
| 208 | return self._firestore_client |
| 209 | |
| 210 | def _is_firestore_ttl_policy_enabled(self): |
| 211 | client = firestore_admin_v1.FirestoreAdminClient() |
| 212 | |
| 213 | name = ( |
| 214 | f"projects/{self.firestore_project}" |
| 215 | f"/databases/(default)/collectionGroups/{self._collection_name}" |
| 216 | f"/fields/{self._field_expires}" |
| 217 | ) |
| 218 | request = firestore_admin_v1.GetFieldRequest(name=name) |
| 219 | field = client.get_field(request=request) |
| 220 | |
| 221 | ttl_config = field.ttl_config |
| 222 | return ttl_config and ttl_config.state in { |
| 223 | firestore_admin_v1.Field.TtlConfig.State.ACTIVE, |
| 224 | firestore_admin_v1.Field.TtlConfig.State.CREATING, |
| 225 | } |
| 226 | |
| 227 | def _apply_chord_incr(self, header_result_args, body, **kwargs): |
| 228 | key = self.get_key_for_chord(header_result_args[0]).decode() |
no outgoing calls