|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +# This file is automatically generated by pyo3_stub_gen |
| 19 | +# ruff: noqa: E501, F401 |
| 20 | + |
| 21 | +import builtins |
| 22 | +import datetime |
| 23 | +import enum |
| 24 | +import typing |
| 25 | + |
| 26 | +@typing.final |
| 27 | +class Entry: |
| 28 | + r""" |
| 29 | + Entry. |
| 30 | +
|
| 31 | + An entry representing a path and its associated metadata. |
| 32 | +
|
| 33 | + Notes |
| 34 | + ----- |
| 35 | + If this entry is a directory, ``path`` **must** end with ``/``. |
| 36 | + Otherwise, ``path`` **must not** end with ``/``. |
| 37 | + """ |
| 38 | + |
| 39 | + @property |
| 40 | + def path(self) -> builtins.str: |
| 41 | + r"""The path of entry relative to the operator's root.""" |
| 42 | + @property |
| 43 | + def name(self) -> builtins.str: |
| 44 | + r"""The name of entry, representing the last segment of the path.""" |
| 45 | + @property |
| 46 | + def metadata(self) -> Metadata: |
| 47 | + r"""The metadata of this entry.""" |
| 48 | + |
| 49 | +@typing.final |
| 50 | +class Metadata: |
| 51 | + r""" |
| 52 | + The metadata of an ``Entry``. |
| 53 | +
|
| 54 | + The metadata is always tied to a specific context and is not a global |
| 55 | + state. For example, two versions of the same path might have different |
| 56 | + content lengths. |
| 57 | +
|
| 58 | + Notes |
| 59 | + ----- |
| 60 | + In systems that support versioning, such as AWS S3, the metadata may |
| 61 | + represent a specific version of a file. Use :attr:`version` to get |
| 62 | + the version of a file if it is available. |
| 63 | + """ |
| 64 | + |
| 65 | + @property |
| 66 | + def content_disposition(self) -> builtins.str | None: |
| 67 | + r"""The content disposition of this entry.""" |
| 68 | + @property |
| 69 | + def content_length(self) -> builtins.int: |
| 70 | + r"""The content length of this entry.""" |
| 71 | + @property |
| 72 | + def content_md5(self) -> builtins.str | None: |
| 73 | + r"""The content MD5 of this entry.""" |
| 74 | + @property |
| 75 | + def content_type(self) -> builtins.str | None: |
| 76 | + r"""The content type of this entry.""" |
| 77 | + @property |
| 78 | + def content_encoding(self) -> builtins.str | None: |
| 79 | + r"""The content encoding of this entry.""" |
| 80 | + @property |
| 81 | + def etag(self) -> builtins.str | None: |
| 82 | + r"""The ETag of this entry.""" |
| 83 | + @property |
| 84 | + def mode(self) -> EntryMode: |
| 85 | + r"""The mode of this entry.""" |
| 86 | + @property |
| 87 | + def is_file(self) -> builtins.bool: |
| 88 | + r"""Whether this entry is a file.""" |
| 89 | + @property |
| 90 | + def is_dir(self) -> builtins.bool: |
| 91 | + r"""Whether this entry is a directory.""" |
| 92 | + @property |
| 93 | + def last_modified(self) -> datetime.datetime: |
| 94 | + r"""The last modified timestamp of this entry.""" |
| 95 | + @property |
| 96 | + def version(self) -> builtins.str | None: |
| 97 | + r"""The version of this entry.""" |
| 98 | + @property |
| 99 | + def user_metadata(self) -> builtins.dict[builtins.str, builtins.str] | None: |
| 100 | + r"""The user-defined metadata of this entry.""" |
| 101 | + |
| 102 | +@typing.final |
| 103 | +class EntryMode(enum.Enum): |
| 104 | + r""" |
| 105 | + EntryMode. |
| 106 | +
|
| 107 | + The mode of an entry, indicating if it is a file or a directory. |
| 108 | + """ |
| 109 | + |
| 110 | + File = ... |
| 111 | + r""" |
| 112 | + The entry is a file and has data to read. |
| 113 | + """ |
| 114 | + Dir = ... |
| 115 | + r""" |
| 116 | + The entry is a directory and can be listed. |
| 117 | + """ |
| 118 | + Unknown = ... |
| 119 | + r""" |
| 120 | + The mode of the entry is unknown. |
| 121 | + """ |
| 122 | + |
| 123 | + def is_file(self) -> builtins.bool: |
| 124 | + r""" |
| 125 | + Check if the entry mode is `File`. |
| 126 | +
|
| 127 | + Returns |
| 128 | + ------- |
| 129 | + bool |
| 130 | + True if the entry is a file. |
| 131 | + """ |
| 132 | + def is_dir(self) -> builtins.bool: |
| 133 | + r""" |
| 134 | + Check if the entry mode is `Dir`. |
| 135 | +
|
| 136 | + Returns |
| 137 | + ------- |
| 138 | + bool |
| 139 | + True if the entry is a directory. |
| 140 | + """ |
0 commit comments