|
| 1 | +# ------------------------------------------------------------------------- |
| 2 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | +# Licensed under the MIT License. See License.txt in the project root for |
| 4 | +# license information. |
| 5 | +# -------------------------------------------------------------------------- |
| 6 | +# pylint: skip-file |
| 7 | + |
| 8 | +from datetime import datetime |
| 9 | +from typing import ( |
| 10 | + Any, |
| 11 | + Dict, |
| 12 | + Optional, |
| 13 | + Union, |
| 14 | +) |
| 15 | +from types import TracebackType |
| 16 | +from typing_extensions import Self |
| 17 | + |
| 18 | +from azure.core import MatchConditions |
| 19 | +from azure.core.credentials import AzureNamedKeyCredential, AzureSasCredential, TokenCredential |
| 20 | +from azure.core.paging import ItemPaged |
| 21 | +from azure.core.tracing.decorator import distributed_trace |
| 22 | +from ._data_lake_lease import DataLakeLeaseClient |
| 23 | +from ._data_lake_file_client import DataLakeFileClient |
| 24 | +from ._models import ContentSettings, CustomerProvidedEncryptionKey, DirectoryProperties, FileProperties, PathProperties |
| 25 | +from ._path_client import PathClient |
| 26 | + |
| 27 | +class DataLakeDirectoryClient(PathClient): |
| 28 | + url: str |
| 29 | + primary_endpoint: str |
| 30 | + primary_hostname: str |
| 31 | + def __init__( |
| 32 | + self, |
| 33 | + account_url: str, |
| 34 | + file_system_name: str, |
| 35 | + directory_name: str, |
| 36 | + credential: Optional[ |
| 37 | + Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, TokenCredential] |
| 38 | + ] = None, |
| 39 | + *, |
| 40 | + api_version: Optional[str] = None, |
| 41 | + audience: Optional[str] = None, |
| 42 | + **kwargs: Any |
| 43 | + ) -> None: ... |
| 44 | + def __enter__(self) -> Self: ... |
| 45 | + def __exit__( |
| 46 | + self, typ: Optional[type[BaseException]], exc: Optional[BaseException], tb: Optional[TracebackType] |
| 47 | + ) -> None: ... |
| 48 | + def close(self) -> None: ... |
| 49 | + @classmethod |
| 50 | + def from_connection_string( |
| 51 | + cls, |
| 52 | + conn_str: str, |
| 53 | + file_system_name: str, |
| 54 | + directory_name: str, |
| 55 | + credential: Optional[ |
| 56 | + Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, TokenCredential] |
| 57 | + ] = None, |
| 58 | + *, |
| 59 | + api_version: Optional[str] = None, |
| 60 | + audience: Optional[str] = None, |
| 61 | + **kwargs: Any |
| 62 | + ) -> Self: ... |
| 63 | + @distributed_trace |
| 64 | + def create_directory( |
| 65 | + self, |
| 66 | + metadata: Optional[Dict[str, str]] = None, |
| 67 | + *, |
| 68 | + content_settings: Optional[ContentSettings] = None, |
| 69 | + lease: Optional[Union[DataLakeLeaseClient, str]] = None, |
| 70 | + umask: Optional[str] = None, |
| 71 | + owner: Optional[str] = None, |
| 72 | + group: Optional[str] = None, |
| 73 | + acl: Optional[str] = None, |
| 74 | + lease_id: Optional[str] = None, |
| 75 | + lease_duration: Optional[int] = None, |
| 76 | + permissions: Optional[str] = None, |
| 77 | + if_modified_since: Optional[datetime] = None, |
| 78 | + if_unmodified_since: Optional[datetime] = None, |
| 79 | + etag: Optional[str] = None, |
| 80 | + match_condition: Optional[MatchConditions] = None, |
| 81 | + cpk: Optional[CustomerProvidedEncryptionKey] = None, |
| 82 | + timeout: Optional[int] = None, |
| 83 | + **kwargs: Any |
| 84 | + ) -> Dict[str, Union[str, datetime]]: ... |
| 85 | + @distributed_trace |
| 86 | + def delete_directory( |
| 87 | + self, |
| 88 | + *, |
| 89 | + lease: Optional[Union[DataLakeLeaseClient, str]] = None, |
| 90 | + if_modified_since: Optional[datetime] = None, |
| 91 | + if_unmodified_since: Optional[datetime] = None, |
| 92 | + etag: Optional[str] = None, |
| 93 | + match_condition: Optional[MatchConditions] = None, |
| 94 | + timeout: Optional[int] = None, |
| 95 | + **kwargs: Any |
| 96 | + ) -> None: ... |
| 97 | + @distributed_trace |
| 98 | + def get_directory_properties( |
| 99 | + self, |
| 100 | + *, |
| 101 | + lease: Optional[Union[DataLakeLeaseClient, str]] = None, |
| 102 | + if_modified_since: Optional[datetime] = None, |
| 103 | + if_unmodified_since: Optional[datetime] = None, |
| 104 | + etag: Optional[str] = None, |
| 105 | + match_condition: Optional[MatchConditions] = None, |
| 106 | + cpk: Optional[CustomerProvidedEncryptionKey] = None, |
| 107 | + upn: Optional[bool] = None, |
| 108 | + timeout: Optional[int] = None, |
| 109 | + **kwargs: Any |
| 110 | + ) -> DirectoryProperties: ... |
| 111 | + @distributed_trace |
| 112 | + def exists(self, *, timeout: Optional[int] = None, **kwargs: Any) -> bool: ... |
| 113 | + @distributed_trace |
| 114 | + def rename_directory( |
| 115 | + self, |
| 116 | + new_name: str, |
| 117 | + *, |
| 118 | + source_lease: Optional[Union[DataLakeLeaseClient, str]] = None, |
| 119 | + lease: Optional[Union[DataLakeLeaseClient, str]] = None, |
| 120 | + if_modified_since: Optional[datetime] = None, |
| 121 | + if_unmodified_since: Optional[datetime] = None, |
| 122 | + etag: Optional[str] = None, |
| 123 | + match_condition: Optional[MatchConditions] = None, |
| 124 | + source_if_modified_since: Optional[datetime] = None, |
| 125 | + source_if_unmodified_since: Optional[datetime] = None, |
| 126 | + source_etag: Optional[str] = None, |
| 127 | + source_match_condition: Optional[MatchConditions] = None, |
| 128 | + timeout: Optional[int] = None, |
| 129 | + **kwargs: Any |
| 130 | + ) -> "DataLakeDirectoryClient": ... |
| 131 | + @distributed_trace |
| 132 | + def create_sub_directory( |
| 133 | + self, |
| 134 | + sub_directory: Union[DirectoryProperties, str], |
| 135 | + metadata: Optional[Dict[str, str]] = None, |
| 136 | + *, |
| 137 | + content_settings: Optional[ContentSettings] = None, |
| 138 | + lease: Optional[Union[DataLakeLeaseClient, str]] = None, |
| 139 | + umask: Optional[str] = None, |
| 140 | + owner: Optional[str] = None, |
| 141 | + group: Optional[str] = None, |
| 142 | + acl: Optional[str] = None, |
| 143 | + lease_id: Optional[str] = None, |
| 144 | + lease_duration: Optional[int] = None, |
| 145 | + permissions: Optional[str] = None, |
| 146 | + if_modified_since: Optional[datetime] = None, |
| 147 | + if_unmodified_since: Optional[datetime] = None, |
| 148 | + etag: Optional[str] = None, |
| 149 | + match_condition: Optional[MatchConditions] = None, |
| 150 | + cpk: Optional[CustomerProvidedEncryptionKey] = None, |
| 151 | + timeout: Optional[int] = None, |
| 152 | + **kwargs: Any |
| 153 | + ) -> "DataLakeDirectoryClient": ... |
| 154 | + @distributed_trace |
| 155 | + def delete_sub_directory( |
| 156 | + self, |
| 157 | + sub_directory: Union[DirectoryProperties, str], |
| 158 | + *, |
| 159 | + lease: Optional[Union[DataLakeLeaseClient, str]] = None, |
| 160 | + if_modified_since: Optional[datetime] = None, |
| 161 | + if_unmodified_since: Optional[datetime] = None, |
| 162 | + etag: Optional[str] = None, |
| 163 | + match_condition: Optional[MatchConditions] = None, |
| 164 | + timeout: Optional[int] = None, |
| 165 | + **kwargs: Any |
| 166 | + ) -> "DataLakeDirectoryClient": ... |
| 167 | + @distributed_trace |
| 168 | + def create_file( |
| 169 | + self, |
| 170 | + file: Union[FileProperties, str], |
| 171 | + *, |
| 172 | + content_settings: Optional[ContentSettings] = None, |
| 173 | + metadata: Optional[Dict[str, str]] = None, |
| 174 | + lease: Optional[Union[DataLakeLeaseClient, str]] = None, |
| 175 | + umask: Optional[str] = None, |
| 176 | + owner: Optional[str] = None, |
| 177 | + group: Optional[str] = None, |
| 178 | + acl: Optional[str] = None, |
| 179 | + lease_id: Optional[str] = None, |
| 180 | + lease_duration: Optional[int] = None, |
| 181 | + expires_on: Optional[Union[datetime, int]] = None, |
| 182 | + permissions: Optional[str] = None, |
| 183 | + if_modified_since: Optional[datetime] = None, |
| 184 | + if_unmodified_since: Optional[datetime] = None, |
| 185 | + etag: Optional[str] = None, |
| 186 | + match_condition: Optional[MatchConditions] = None, |
| 187 | + cpk: Optional[CustomerProvidedEncryptionKey] = None, |
| 188 | + timeout: Optional[int] = None, |
| 189 | + **kwargs: Any |
| 190 | + ) -> DataLakeFileClient: ... |
| 191 | + @distributed_trace |
| 192 | + def get_paths( |
| 193 | + self, |
| 194 | + *, |
| 195 | + recursive: bool = True, |
| 196 | + max_results: Optional[int] = None, |
| 197 | + upn: Optional[bool] = None, |
| 198 | + timeout: Optional[int] = None, |
| 199 | + **kwargs: Any |
| 200 | + ) -> ItemPaged[PathProperties]: ... |
| 201 | + def get_file_client(self, file: Union[FileProperties, str]) -> DataLakeFileClient: ... |
| 202 | + def get_sub_directory_client(self, sub_directory: Union[DirectoryProperties, str]) -> "DataLakeDirectoryClient": ... |
0 commit comments