Configuration
immichpy.client.generated.configuration.Configuration
Configuration(host: Optional[str] = None, api_key: Optional[Dict[str, str]] = None, api_key_prefix: Optional[Dict[str, str]] = None, username: Optional[str] = None, password: Optional[str] = None, access_token: Optional[str] = None, server_index: Optional[int] = None, server_variables: Optional[ServerVariablesT] = None, server_operation_index: Optional[Dict[int, int]] = None, server_operation_variables: Optional[Dict[int, ServerVariablesT]] = None, ignore_operation_servers: bool = False, ssl_ca_cert: Optional[str] = None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str] = None, key_file: Optional[str] = None, *, debug: Optional[bool] = None)
This class contains various settings of the API client.
:param host: Base url.
:param ignore_operation_servers
Boolean to ignore operation servers for the API client.
Config will use `host` as the base url regardless of the operation servers.
:param api_key: Dict to store API key(s).
Each entry in the dict specifies an API key.
The dict key is the name of the security scheme in the OAS specification.
The dict value is the API key secret.
:param api_key_prefix: Dict to store API prefix (e.g. Bearer).
The dict key is the name of the security scheme in the OAS specification.
The dict value is an API key prefix when generating the auth data.
:param username: Username for HTTP basic authentication.
:param password: Password for HTTP basic authentication.
:param access_token: Access token.
:param server_index: Index to servers configuration.
:param server_variables: Mapping with string values to replace variables in
templated server configuration. The validation of enums is performed for
variables with defined enum values before.
:param server_operation_index: Mapping from operation ID to an index to server
configuration.
:param server_operation_variables: Mapping from operation ID to a mapping with
string values to replace variables in templated server configuration.
The validation of enums is performed for variables with defined enum
values before.
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
in PEM format.
:param retries: int | aiohttp_retry.RetryOptionsBase - Retry configuration.
:param ca_cert_data: verify the peer using concatenated CA certificate data
in PEM (str) or DER (bytes) format.
:param cert_file: the path to a client certificate file, for mTLS.
:param key_file: the path to a client key file, for mTLS.
:Example:
API Key Authentication Example.
Given the following security scheme in the OpenAPI specification:
components:
securitySchemes:
cookieAuth: # name for the security scheme
type: apiKey
in: cookie
name: JSESSIONID # cookie name
You can programmatically set the cookie:
conf = generated.Configuration( api_key={'cookieAuth': 'abc123'} api_key_prefix={'cookieAuth': 'JSESSIONID'} )
The following cookie will be added to the HTTP request:
Cookie: JSESSIONID abc123
Constructor
Source code in immichpy/client/generated/configuration.py
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 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | |
access_token
instance-attribute
access_token = access_token
Access token
assert_hostname
instance-attribute
assert_hostname = None
Set this to True/False to enable/disable SSL hostname verification.
ca_cert_data
instance-attribute
ca_cert_data = ca_cert_data
Set this to verify the peer using PEM (str) or DER (bytes) certificate data.
cert_file
instance-attribute
cert_file = cert_file
client certificate file
connection_pool_maxsize
instance-attribute
connection_pool_maxsize = 100
This value is passed to the aiohttp to limit simultaneous connections. Default values is 100, None means no-limit.
date_format
instance-attribute
date_format = '%Y-%m-%d'
date format
datetime_format
instance-attribute
datetime_format = '%Y-%m-%dT%H:%M:%S.%f%z'
datetime format
debug
property
writable
debug: bool
Debug status
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
The debug status, True or False. |
required |
host
property
writable
host: str
Return generated host.
ignore_operation_servers
instance-attribute
ignore_operation_servers = ignore_operation_servers
Ignore operation servers
key_file
instance-attribute
key_file = key_file
client key file
logger
instance-attribute
logger = {}
Logging Settings
logger_file
property
writable
logger_file: Optional[str]
The logger file.
If the logger_file is None, then add stream handler and remove file handler. Otherwise, add file handler and remove stream handler.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
The logger_file path. |
required |
logger_file_handler
instance-attribute
logger_file_handler: Optional[FileHandler] = None
Log file handler
logger_format
property
writable
logger_format: str
The logger format.
The logger_formatter will be updated when sets logger_format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
The format string. |
required |
logger_stream_handler
instance-attribute
logger_stream_handler = None
Log stream handler
password
instance-attribute
password = password
Password for HTTP basic authentication
proxy
instance-attribute
proxy: Optional[str] = None
Proxy URL
proxy_headers
instance-attribute
proxy_headers = None
Proxy headers
refresh_api_key_hook
instance-attribute
refresh_api_key_hook = None
function hook to refresh API key if expired
retries
instance-attribute
retries = retries
Retry configuration
safe_chars_for_path_param
instance-attribute
safe_chars_for_path_param = ''
Safe chars for path_param
server_operation_index
instance-attribute
server_operation_index = server_operation_index or {}
Default server index
server_operation_variables
instance-attribute
server_operation_variables = server_operation_variables or {}
Default server variables
socket_options
instance-attribute
socket_options = None
Options to pass down to the underlying urllib3 socket
ssl_ca_cert
instance-attribute
ssl_ca_cert = ssl_ca_cert
Set this to customize the certificate file to verify the peer.
temp_folder_path
instance-attribute
temp_folder_path = None
Temp file folder for downloading files
tls_server_name
instance-attribute
tls_server_name = None
SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server.
username
instance-attribute
username = username
Username for HTTP basic authentication
verify_ssl
instance-attribute
verify_ssl = True
SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server.
auth_settings
auth_settings() -> AuthSettings
Gets Auth Settings dict for api client.
Returns:
| Type | Description |
|---|---|
AuthSettings
|
The Auth Settings information dict. |
Source code in immichpy/client/generated/configuration.py
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 | |
get_api_key_with_prefix
get_api_key_with_prefix(identifier: str, alias: Optional[str] = None) -> Optional[str]
Gets API key (with prefix if set).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
The identifier of apiKey. |
required |
alias
|
Optional[str]
|
The alternative identifier of apiKey. |
None
|
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The token for api key authentication. |
Source code in immichpy/client/generated/configuration.py
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | |
get_basic_auth_token
get_basic_auth_token() -> Optional[str]
Gets HTTP basic authentication header (string).
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The token for basic HTTP authentication. |
Source code in immichpy/client/generated/configuration.py
502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 | |
get_default
classmethod
get_default() -> Self
Return the default configuration.
This method returns newly created, based on default constructor, object of Configuration class or returns a copy of default configuration.
Returns:
| Type | Description |
|---|---|
Self
|
The configuration object. |
Source code in immichpy/client/generated/configuration.py
380 381 382 383 384 385 386 387 388 389 390 391 392 | |
get_default_copy
classmethod
get_default_copy() -> Self
Deprecated. Please use get_default instead.
Deprecated. Please use get_default instead.
Returns:
| Type | Description |
|---|---|
Self
|
The configuration object. |
Source code in immichpy/client/generated/configuration.py
370 371 372 373 374 375 376 377 378 | |
get_host_from_settings
get_host_from_settings(index: Optional[int], variables: Optional[ServerVariablesT] = None, servers: Optional[List[HostSetting]] = None) -> str
Gets host URL based on the index and variables
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
Optional[int]
|
array index of the host settings |
required |
variables
|
Optional[ServerVariablesT]
|
hash of variable and the corresponding value |
None
|
servers
|
Optional[List[HostSetting]]
|
an array of host settings or None |
None
|
Returns:
| Type | Description |
|---|---|
str
|
URL based on host settings |
Source code in immichpy/client/generated/configuration.py
577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 | |
get_host_settings
get_host_settings() -> List[HostSetting]
Gets an array of host settings
Returns:
| Type | Description |
|---|---|
List[HostSetting]
|
An array of host settings |
Source code in immichpy/client/generated/configuration.py
565 566 567 568 569 570 571 572 573 574 575 | |
set_default
classmethod
set_default(default: Optional[Self]) -> None
Set default instance of configuration.
It stores default configuration, which can be returned by get_default_copy method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
default
|
Optional[Self]
|
object of Configuration |
required |
Source code in immichpy/client/generated/configuration.py
359 360 361 362 363 364 365 366 367 368 | |
to_debug_report
to_debug_report() -> str
Gets the essential information for debugging.
Returns:
| Type | Description |
|---|---|
str
|
The report for debugging. |
Source code in immichpy/client/generated/configuration.py
552 553 554 555 556 557 558 559 560 561 562 563 | |