Files
immich-to-cloud-exporter/generated/immich/openapi_client/api/search_api.py
T

3417 lines
135 KiB
Python

# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated
from datetime import datetime
from pydantic import Field, StrictBool, StrictStr, field_validator
from typing import List, Optional
from typing_extensions import Annotated
from generated.immich.openapi_client.models.asset_response_dto import AssetResponseDto
from generated.immich.openapi_client.models.asset_type_enum import AssetTypeEnum
from generated.immich.openapi_client.models.asset_visibility import AssetVisibility
from generated.immich.openapi_client.models.metadata_search_dto import MetadataSearchDto
from generated.immich.openapi_client.models.person_response_dto import PersonResponseDto
from generated.immich.openapi_client.models.places_response_dto import PlacesResponseDto
from generated.immich.openapi_client.models.random_search_dto import RandomSearchDto
from generated.immich.openapi_client.models.search_explore_response_dto import SearchExploreResponseDto
from generated.immich.openapi_client.models.search_response_dto import SearchResponseDto
from generated.immich.openapi_client.models.search_statistics_response_dto import SearchStatisticsResponseDto
from generated.immich.openapi_client.models.search_suggestion_type import SearchSuggestionType
from generated.immich.openapi_client.models.smart_search_dto import SmartSearchDto
from generated.immich.openapi_client.models.statistics_search_dto import StatisticsSearchDto
from generated.immich.openapi_client.api_client import ApiClient, RequestSerialized
from generated.immich.openapi_client.api_response import ApiResponse
from generated.immich.openapi_client.rest import RESTResponseType
class SearchApi:
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
def __init__(self, api_client=None) -> None:
if api_client is None:
api_client = ApiClient.get_default()
self.api_client = api_client
@validate_call
def get_assets_by_city(
self,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> List[AssetResponseDto]:
"""Retrieve assets by city
Retrieve a list of assets with each asset belonging to a different city. This endpoint is used on the places pages to show a single thumbnail for each city the user has assets in.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_assets_by_city_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[AssetResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def get_assets_by_city_with_http_info(
self,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[List[AssetResponseDto]]:
"""Retrieve assets by city
Retrieve a list of assets with each asset belonging to a different city. This endpoint is used on the places pages to show a single thumbnail for each city the user has assets in.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_assets_by_city_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[AssetResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def get_assets_by_city_without_preload_content(
self,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Retrieve assets by city
Retrieve a list of assets with each asset belonging to a different city. This endpoint is used on the places pages to show a single thumbnail for each city the user has assets in.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_assets_by_city_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[AssetResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _get_assets_by_city_serialize(
self,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json'
]
)
# authentication setting
_auth_settings: List[str] = [
'cookie',
'api_key',
'bearer'
]
return self.api_client.param_serialize(
method='GET',
resource_path='/search/cities',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def get_explore_data(
self,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> List[SearchExploreResponseDto]:
"""Retrieve explore data
Retrieve data for the explore section, such as popular people and places.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_explore_data_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[SearchExploreResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def get_explore_data_with_http_info(
self,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[List[SearchExploreResponseDto]]:
"""Retrieve explore data
Retrieve data for the explore section, such as popular people and places.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_explore_data_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[SearchExploreResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def get_explore_data_without_preload_content(
self,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Retrieve explore data
Retrieve data for the explore section, such as popular people and places.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_explore_data_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[SearchExploreResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _get_explore_data_serialize(
self,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json'
]
)
# authentication setting
_auth_settings: List[str] = [
'cookie',
'api_key',
'bearer'
]
return self.api_client.param_serialize(
method='GET',
resource_path='/search/explore',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def get_search_suggestions(
self,
type: SearchSuggestionType,
country: Annotated[Optional[StrictStr], Field(description="Filter by country")] = None,
include_null: Annotated[Optional[StrictBool], Field(description="Include null values in suggestions")] = None,
lens_model: Annotated[Optional[StrictStr], Field(description="Filter by lens model")] = None,
make: Annotated[Optional[StrictStr], Field(description="Filter by camera make")] = None,
model: Annotated[Optional[StrictStr], Field(description="Filter by camera model")] = None,
state: Annotated[Optional[StrictStr], Field(description="Filter by state/province")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> List[str]:
"""Retrieve search suggestions
Retrieve search suggestions based on partial input. This endpoint is used for typeahead search features.
:param type: (required)
:type type: SearchSuggestionType
:param country: Filter by country
:type country: str
:param include_null: Include null values in suggestions
:type include_null: bool
:param lens_model: Filter by lens model
:type lens_model: str
:param make: Filter by camera make
:type make: str
:param model: Filter by camera model
:type model: str
:param state: Filter by state/province
:type state: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_search_suggestions_serialize(
type=type,
country=country,
include_null=include_null,
lens_model=lens_model,
make=make,
model=model,
state=state,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[str]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def get_search_suggestions_with_http_info(
self,
type: SearchSuggestionType,
country: Annotated[Optional[StrictStr], Field(description="Filter by country")] = None,
include_null: Annotated[Optional[StrictBool], Field(description="Include null values in suggestions")] = None,
lens_model: Annotated[Optional[StrictStr], Field(description="Filter by lens model")] = None,
make: Annotated[Optional[StrictStr], Field(description="Filter by camera make")] = None,
model: Annotated[Optional[StrictStr], Field(description="Filter by camera model")] = None,
state: Annotated[Optional[StrictStr], Field(description="Filter by state/province")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[List[str]]:
"""Retrieve search suggestions
Retrieve search suggestions based on partial input. This endpoint is used for typeahead search features.
:param type: (required)
:type type: SearchSuggestionType
:param country: Filter by country
:type country: str
:param include_null: Include null values in suggestions
:type include_null: bool
:param lens_model: Filter by lens model
:type lens_model: str
:param make: Filter by camera make
:type make: str
:param model: Filter by camera model
:type model: str
:param state: Filter by state/province
:type state: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_search_suggestions_serialize(
type=type,
country=country,
include_null=include_null,
lens_model=lens_model,
make=make,
model=model,
state=state,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[str]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def get_search_suggestions_without_preload_content(
self,
type: SearchSuggestionType,
country: Annotated[Optional[StrictStr], Field(description="Filter by country")] = None,
include_null: Annotated[Optional[StrictBool], Field(description="Include null values in suggestions")] = None,
lens_model: Annotated[Optional[StrictStr], Field(description="Filter by lens model")] = None,
make: Annotated[Optional[StrictStr], Field(description="Filter by camera make")] = None,
model: Annotated[Optional[StrictStr], Field(description="Filter by camera model")] = None,
state: Annotated[Optional[StrictStr], Field(description="Filter by state/province")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Retrieve search suggestions
Retrieve search suggestions based on partial input. This endpoint is used for typeahead search features.
:param type: (required)
:type type: SearchSuggestionType
:param country: Filter by country
:type country: str
:param include_null: Include null values in suggestions
:type include_null: bool
:param lens_model: Filter by lens model
:type lens_model: str
:param make: Filter by camera make
:type make: str
:param model: Filter by camera model
:type model: str
:param state: Filter by state/province
:type state: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_search_suggestions_serialize(
type=type,
country=country,
include_null=include_null,
lens_model=lens_model,
make=make,
model=model,
state=state,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[str]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _get_search_suggestions_serialize(
self,
type,
country,
include_null,
lens_model,
make,
model,
state,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
if country is not None:
_query_params.append(('country', country))
if include_null is not None:
_query_params.append(('includeNull', include_null))
if lens_model is not None:
_query_params.append(('lensModel', lens_model))
if make is not None:
_query_params.append(('make', make))
if model is not None:
_query_params.append(('model', model))
if state is not None:
_query_params.append(('state', state))
if type is not None:
_query_params.append(('type', type.value))
# process the header parameters
# process the form parameters
# process the body parameter
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json'
]
)
# authentication setting
_auth_settings: List[str] = [
'cookie',
'api_key',
'bearer'
]
return self.api_client.param_serialize(
method='GET',
resource_path='/search/suggestions',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def search_asset_statistics(
self,
statistics_search_dto: StatisticsSearchDto,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> SearchStatisticsResponseDto:
"""Search asset statistics
Retrieve statistical data about assets based on search criteria, such as the total matching count.
:param statistics_search_dto: (required)
:type statistics_search_dto: StatisticsSearchDto
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_asset_statistics_serialize(
statistics_search_dto=statistics_search_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "SearchStatisticsResponseDto",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def search_asset_statistics_with_http_info(
self,
statistics_search_dto: StatisticsSearchDto,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[SearchStatisticsResponseDto]:
"""Search asset statistics
Retrieve statistical data about assets based on search criteria, such as the total matching count.
:param statistics_search_dto: (required)
:type statistics_search_dto: StatisticsSearchDto
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_asset_statistics_serialize(
statistics_search_dto=statistics_search_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "SearchStatisticsResponseDto",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def search_asset_statistics_without_preload_content(
self,
statistics_search_dto: StatisticsSearchDto,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Search asset statistics
Retrieve statistical data about assets based on search criteria, such as the total matching count.
:param statistics_search_dto: (required)
:type statistics_search_dto: StatisticsSearchDto
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_asset_statistics_serialize(
statistics_search_dto=statistics_search_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "SearchStatisticsResponseDto",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _search_asset_statistics_serialize(
self,
statistics_search_dto,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if statistics_search_dto is not None:
_body_params = statistics_search_dto
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json'
]
)
# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type
# authentication setting
_auth_settings: List[str] = [
'cookie',
'api_key',
'bearer'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/search/statistics',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def search_assets(
self,
metadata_search_dto: MetadataSearchDto,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> SearchResponseDto:
"""Search assets by metadata
Search for assets based on various metadata criteria.
:param metadata_search_dto: (required)
:type metadata_search_dto: MetadataSearchDto
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_assets_serialize(
metadata_search_dto=metadata_search_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "SearchResponseDto",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def search_assets_with_http_info(
self,
metadata_search_dto: MetadataSearchDto,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[SearchResponseDto]:
"""Search assets by metadata
Search for assets based on various metadata criteria.
:param metadata_search_dto: (required)
:type metadata_search_dto: MetadataSearchDto
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_assets_serialize(
metadata_search_dto=metadata_search_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "SearchResponseDto",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def search_assets_without_preload_content(
self,
metadata_search_dto: MetadataSearchDto,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Search assets by metadata
Search for assets based on various metadata criteria.
:param metadata_search_dto: (required)
:type metadata_search_dto: MetadataSearchDto
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_assets_serialize(
metadata_search_dto=metadata_search_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "SearchResponseDto",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _search_assets_serialize(
self,
metadata_search_dto,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if metadata_search_dto is not None:
_body_params = metadata_search_dto
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json'
]
)
# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type
# authentication setting
_auth_settings: List[str] = [
'cookie',
'api_key',
'bearer'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/search/metadata',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def search_large_assets(
self,
album_ids: Annotated[Optional[List[Annotated[str, Field(strict=True)]]], Field(description="Filter by album IDs")] = None,
city: Annotated[Optional[StrictStr], Field(description="Filter by city name")] = None,
country: Annotated[Optional[StrictStr], Field(description="Filter by country name")] = None,
created_after: Annotated[Optional[datetime], Field(description="Filter by creation date (after)")] = None,
created_before: Annotated[Optional[datetime], Field(description="Filter by creation date (before)")] = None,
is_encoded: Annotated[Optional[StrictBool], Field(description="Filter by encoded status")] = None,
is_favorite: Annotated[Optional[StrictBool], Field(description="Filter by favorite status")] = None,
is_motion: Annotated[Optional[StrictBool], Field(description="Filter by motion photo status")] = None,
is_not_in_album: Annotated[Optional[StrictBool], Field(description="Filter assets not in any album")] = None,
is_offline: Annotated[Optional[StrictBool], Field(description="Filter by offline status")] = None,
lens_model: Annotated[Optional[StrictStr], Field(description="Filter by lens model")] = None,
library_id: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="Library ID to filter by")] = None,
make: Annotated[Optional[StrictStr], Field(description="Filter by camera make")] = None,
min_file_size: Annotated[Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=0)]], Field(description="Minimum file size in bytes")] = None,
model: Annotated[Optional[StrictStr], Field(description="Filter by camera model")] = None,
ocr: Annotated[Optional[StrictStr], Field(description="Filter by OCR text content")] = None,
person_ids: Annotated[Optional[List[Annotated[str, Field(strict=True)]]], Field(description="Filter by person IDs")] = None,
rating: Annotated[Optional[Annotated[int, Field(le=5, strict=True, ge=1)]], Field(description="Filter by rating [1-5], or null for unrated")] = None,
size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of results to return")] = None,
state: Annotated[Optional[StrictStr], Field(description="Filter by state/province name")] = None,
tag_ids: Annotated[Optional[List[Annotated[str, Field(strict=True)]]], Field(description="Filter by tag IDs")] = None,
taken_after: Annotated[Optional[datetime], Field(description="Filter by taken date (after)")] = None,
taken_before: Annotated[Optional[datetime], Field(description="Filter by taken date (before)")] = None,
trashed_after: Annotated[Optional[datetime], Field(description="Filter by trash date (after)")] = None,
trashed_before: Annotated[Optional[datetime], Field(description="Filter by trash date (before)")] = None,
type: Optional[AssetTypeEnum] = None,
updated_after: Annotated[Optional[datetime], Field(description="Filter by update date (after)")] = None,
updated_before: Annotated[Optional[datetime], Field(description="Filter by update date (before)")] = None,
visibility: Optional[AssetVisibility] = None,
with_deleted: Annotated[Optional[StrictBool], Field(description="Include deleted assets")] = None,
with_exif: Annotated[Optional[StrictBool], Field(description="Include EXIF data in response")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> List[AssetResponseDto]:
"""Search large assets
Search for assets that are considered large based on specified criteria.
:param album_ids: Filter by album IDs
:type album_ids: List[str]
:param city: Filter by city name
:type city: str
:param country: Filter by country name
:type country: str
:param created_after: Filter by creation date (after)
:type created_after: datetime
:param created_before: Filter by creation date (before)
:type created_before: datetime
:param is_encoded: Filter by encoded status
:type is_encoded: bool
:param is_favorite: Filter by favorite status
:type is_favorite: bool
:param is_motion: Filter by motion photo status
:type is_motion: bool
:param is_not_in_album: Filter assets not in any album
:type is_not_in_album: bool
:param is_offline: Filter by offline status
:type is_offline: bool
:param lens_model: Filter by lens model
:type lens_model: str
:param library_id: Library ID to filter by
:type library_id: str
:param make: Filter by camera make
:type make: str
:param min_file_size: Minimum file size in bytes
:type min_file_size: int
:param model: Filter by camera model
:type model: str
:param ocr: Filter by OCR text content
:type ocr: str
:param person_ids: Filter by person IDs
:type person_ids: List[str]
:param rating: Filter by rating [1-5], or null for unrated
:type rating: int
:param size: Number of results to return
:type size: int
:param state: Filter by state/province name
:type state: str
:param tag_ids: Filter by tag IDs
:type tag_ids: List[str]
:param taken_after: Filter by taken date (after)
:type taken_after: datetime
:param taken_before: Filter by taken date (before)
:type taken_before: datetime
:param trashed_after: Filter by trash date (after)
:type trashed_after: datetime
:param trashed_before: Filter by trash date (before)
:type trashed_before: datetime
:param type:
:type type: AssetTypeEnum
:param updated_after: Filter by update date (after)
:type updated_after: datetime
:param updated_before: Filter by update date (before)
:type updated_before: datetime
:param visibility:
:type visibility: AssetVisibility
:param with_deleted: Include deleted assets
:type with_deleted: bool
:param with_exif: Include EXIF data in response
:type with_exif: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_large_assets_serialize(
album_ids=album_ids,
city=city,
country=country,
created_after=created_after,
created_before=created_before,
is_encoded=is_encoded,
is_favorite=is_favorite,
is_motion=is_motion,
is_not_in_album=is_not_in_album,
is_offline=is_offline,
lens_model=lens_model,
library_id=library_id,
make=make,
min_file_size=min_file_size,
model=model,
ocr=ocr,
person_ids=person_ids,
rating=rating,
size=size,
state=state,
tag_ids=tag_ids,
taken_after=taken_after,
taken_before=taken_before,
trashed_after=trashed_after,
trashed_before=trashed_before,
type=type,
updated_after=updated_after,
updated_before=updated_before,
visibility=visibility,
with_deleted=with_deleted,
with_exif=with_exif,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[AssetResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def search_large_assets_with_http_info(
self,
album_ids: Annotated[Optional[List[Annotated[str, Field(strict=True)]]], Field(description="Filter by album IDs")] = None,
city: Annotated[Optional[StrictStr], Field(description="Filter by city name")] = None,
country: Annotated[Optional[StrictStr], Field(description="Filter by country name")] = None,
created_after: Annotated[Optional[datetime], Field(description="Filter by creation date (after)")] = None,
created_before: Annotated[Optional[datetime], Field(description="Filter by creation date (before)")] = None,
is_encoded: Annotated[Optional[StrictBool], Field(description="Filter by encoded status")] = None,
is_favorite: Annotated[Optional[StrictBool], Field(description="Filter by favorite status")] = None,
is_motion: Annotated[Optional[StrictBool], Field(description="Filter by motion photo status")] = None,
is_not_in_album: Annotated[Optional[StrictBool], Field(description="Filter assets not in any album")] = None,
is_offline: Annotated[Optional[StrictBool], Field(description="Filter by offline status")] = None,
lens_model: Annotated[Optional[StrictStr], Field(description="Filter by lens model")] = None,
library_id: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="Library ID to filter by")] = None,
make: Annotated[Optional[StrictStr], Field(description="Filter by camera make")] = None,
min_file_size: Annotated[Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=0)]], Field(description="Minimum file size in bytes")] = None,
model: Annotated[Optional[StrictStr], Field(description="Filter by camera model")] = None,
ocr: Annotated[Optional[StrictStr], Field(description="Filter by OCR text content")] = None,
person_ids: Annotated[Optional[List[Annotated[str, Field(strict=True)]]], Field(description="Filter by person IDs")] = None,
rating: Annotated[Optional[Annotated[int, Field(le=5, strict=True, ge=1)]], Field(description="Filter by rating [1-5], or null for unrated")] = None,
size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of results to return")] = None,
state: Annotated[Optional[StrictStr], Field(description="Filter by state/province name")] = None,
tag_ids: Annotated[Optional[List[Annotated[str, Field(strict=True)]]], Field(description="Filter by tag IDs")] = None,
taken_after: Annotated[Optional[datetime], Field(description="Filter by taken date (after)")] = None,
taken_before: Annotated[Optional[datetime], Field(description="Filter by taken date (before)")] = None,
trashed_after: Annotated[Optional[datetime], Field(description="Filter by trash date (after)")] = None,
trashed_before: Annotated[Optional[datetime], Field(description="Filter by trash date (before)")] = None,
type: Optional[AssetTypeEnum] = None,
updated_after: Annotated[Optional[datetime], Field(description="Filter by update date (after)")] = None,
updated_before: Annotated[Optional[datetime], Field(description="Filter by update date (before)")] = None,
visibility: Optional[AssetVisibility] = None,
with_deleted: Annotated[Optional[StrictBool], Field(description="Include deleted assets")] = None,
with_exif: Annotated[Optional[StrictBool], Field(description="Include EXIF data in response")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[List[AssetResponseDto]]:
"""Search large assets
Search for assets that are considered large based on specified criteria.
:param album_ids: Filter by album IDs
:type album_ids: List[str]
:param city: Filter by city name
:type city: str
:param country: Filter by country name
:type country: str
:param created_after: Filter by creation date (after)
:type created_after: datetime
:param created_before: Filter by creation date (before)
:type created_before: datetime
:param is_encoded: Filter by encoded status
:type is_encoded: bool
:param is_favorite: Filter by favorite status
:type is_favorite: bool
:param is_motion: Filter by motion photo status
:type is_motion: bool
:param is_not_in_album: Filter assets not in any album
:type is_not_in_album: bool
:param is_offline: Filter by offline status
:type is_offline: bool
:param lens_model: Filter by lens model
:type lens_model: str
:param library_id: Library ID to filter by
:type library_id: str
:param make: Filter by camera make
:type make: str
:param min_file_size: Minimum file size in bytes
:type min_file_size: int
:param model: Filter by camera model
:type model: str
:param ocr: Filter by OCR text content
:type ocr: str
:param person_ids: Filter by person IDs
:type person_ids: List[str]
:param rating: Filter by rating [1-5], or null for unrated
:type rating: int
:param size: Number of results to return
:type size: int
:param state: Filter by state/province name
:type state: str
:param tag_ids: Filter by tag IDs
:type tag_ids: List[str]
:param taken_after: Filter by taken date (after)
:type taken_after: datetime
:param taken_before: Filter by taken date (before)
:type taken_before: datetime
:param trashed_after: Filter by trash date (after)
:type trashed_after: datetime
:param trashed_before: Filter by trash date (before)
:type trashed_before: datetime
:param type:
:type type: AssetTypeEnum
:param updated_after: Filter by update date (after)
:type updated_after: datetime
:param updated_before: Filter by update date (before)
:type updated_before: datetime
:param visibility:
:type visibility: AssetVisibility
:param with_deleted: Include deleted assets
:type with_deleted: bool
:param with_exif: Include EXIF data in response
:type with_exif: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_large_assets_serialize(
album_ids=album_ids,
city=city,
country=country,
created_after=created_after,
created_before=created_before,
is_encoded=is_encoded,
is_favorite=is_favorite,
is_motion=is_motion,
is_not_in_album=is_not_in_album,
is_offline=is_offline,
lens_model=lens_model,
library_id=library_id,
make=make,
min_file_size=min_file_size,
model=model,
ocr=ocr,
person_ids=person_ids,
rating=rating,
size=size,
state=state,
tag_ids=tag_ids,
taken_after=taken_after,
taken_before=taken_before,
trashed_after=trashed_after,
trashed_before=trashed_before,
type=type,
updated_after=updated_after,
updated_before=updated_before,
visibility=visibility,
with_deleted=with_deleted,
with_exif=with_exif,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[AssetResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def search_large_assets_without_preload_content(
self,
album_ids: Annotated[Optional[List[Annotated[str, Field(strict=True)]]], Field(description="Filter by album IDs")] = None,
city: Annotated[Optional[StrictStr], Field(description="Filter by city name")] = None,
country: Annotated[Optional[StrictStr], Field(description="Filter by country name")] = None,
created_after: Annotated[Optional[datetime], Field(description="Filter by creation date (after)")] = None,
created_before: Annotated[Optional[datetime], Field(description="Filter by creation date (before)")] = None,
is_encoded: Annotated[Optional[StrictBool], Field(description="Filter by encoded status")] = None,
is_favorite: Annotated[Optional[StrictBool], Field(description="Filter by favorite status")] = None,
is_motion: Annotated[Optional[StrictBool], Field(description="Filter by motion photo status")] = None,
is_not_in_album: Annotated[Optional[StrictBool], Field(description="Filter assets not in any album")] = None,
is_offline: Annotated[Optional[StrictBool], Field(description="Filter by offline status")] = None,
lens_model: Annotated[Optional[StrictStr], Field(description="Filter by lens model")] = None,
library_id: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="Library ID to filter by")] = None,
make: Annotated[Optional[StrictStr], Field(description="Filter by camera make")] = None,
min_file_size: Annotated[Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=0)]], Field(description="Minimum file size in bytes")] = None,
model: Annotated[Optional[StrictStr], Field(description="Filter by camera model")] = None,
ocr: Annotated[Optional[StrictStr], Field(description="Filter by OCR text content")] = None,
person_ids: Annotated[Optional[List[Annotated[str, Field(strict=True)]]], Field(description="Filter by person IDs")] = None,
rating: Annotated[Optional[Annotated[int, Field(le=5, strict=True, ge=1)]], Field(description="Filter by rating [1-5], or null for unrated")] = None,
size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of results to return")] = None,
state: Annotated[Optional[StrictStr], Field(description="Filter by state/province name")] = None,
tag_ids: Annotated[Optional[List[Annotated[str, Field(strict=True)]]], Field(description="Filter by tag IDs")] = None,
taken_after: Annotated[Optional[datetime], Field(description="Filter by taken date (after)")] = None,
taken_before: Annotated[Optional[datetime], Field(description="Filter by taken date (before)")] = None,
trashed_after: Annotated[Optional[datetime], Field(description="Filter by trash date (after)")] = None,
trashed_before: Annotated[Optional[datetime], Field(description="Filter by trash date (before)")] = None,
type: Optional[AssetTypeEnum] = None,
updated_after: Annotated[Optional[datetime], Field(description="Filter by update date (after)")] = None,
updated_before: Annotated[Optional[datetime], Field(description="Filter by update date (before)")] = None,
visibility: Optional[AssetVisibility] = None,
with_deleted: Annotated[Optional[StrictBool], Field(description="Include deleted assets")] = None,
with_exif: Annotated[Optional[StrictBool], Field(description="Include EXIF data in response")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Search large assets
Search for assets that are considered large based on specified criteria.
:param album_ids: Filter by album IDs
:type album_ids: List[str]
:param city: Filter by city name
:type city: str
:param country: Filter by country name
:type country: str
:param created_after: Filter by creation date (after)
:type created_after: datetime
:param created_before: Filter by creation date (before)
:type created_before: datetime
:param is_encoded: Filter by encoded status
:type is_encoded: bool
:param is_favorite: Filter by favorite status
:type is_favorite: bool
:param is_motion: Filter by motion photo status
:type is_motion: bool
:param is_not_in_album: Filter assets not in any album
:type is_not_in_album: bool
:param is_offline: Filter by offline status
:type is_offline: bool
:param lens_model: Filter by lens model
:type lens_model: str
:param library_id: Library ID to filter by
:type library_id: str
:param make: Filter by camera make
:type make: str
:param min_file_size: Minimum file size in bytes
:type min_file_size: int
:param model: Filter by camera model
:type model: str
:param ocr: Filter by OCR text content
:type ocr: str
:param person_ids: Filter by person IDs
:type person_ids: List[str]
:param rating: Filter by rating [1-5], or null for unrated
:type rating: int
:param size: Number of results to return
:type size: int
:param state: Filter by state/province name
:type state: str
:param tag_ids: Filter by tag IDs
:type tag_ids: List[str]
:param taken_after: Filter by taken date (after)
:type taken_after: datetime
:param taken_before: Filter by taken date (before)
:type taken_before: datetime
:param trashed_after: Filter by trash date (after)
:type trashed_after: datetime
:param trashed_before: Filter by trash date (before)
:type trashed_before: datetime
:param type:
:type type: AssetTypeEnum
:param updated_after: Filter by update date (after)
:type updated_after: datetime
:param updated_before: Filter by update date (before)
:type updated_before: datetime
:param visibility:
:type visibility: AssetVisibility
:param with_deleted: Include deleted assets
:type with_deleted: bool
:param with_exif: Include EXIF data in response
:type with_exif: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_large_assets_serialize(
album_ids=album_ids,
city=city,
country=country,
created_after=created_after,
created_before=created_before,
is_encoded=is_encoded,
is_favorite=is_favorite,
is_motion=is_motion,
is_not_in_album=is_not_in_album,
is_offline=is_offline,
lens_model=lens_model,
library_id=library_id,
make=make,
min_file_size=min_file_size,
model=model,
ocr=ocr,
person_ids=person_ids,
rating=rating,
size=size,
state=state,
tag_ids=tag_ids,
taken_after=taken_after,
taken_before=taken_before,
trashed_after=trashed_after,
trashed_before=trashed_before,
type=type,
updated_after=updated_after,
updated_before=updated_before,
visibility=visibility,
with_deleted=with_deleted,
with_exif=with_exif,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[AssetResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _search_large_assets_serialize(
self,
album_ids,
city,
country,
created_after,
created_before,
is_encoded,
is_favorite,
is_motion,
is_not_in_album,
is_offline,
lens_model,
library_id,
make,
min_file_size,
model,
ocr,
person_ids,
rating,
size,
state,
tag_ids,
taken_after,
taken_before,
trashed_after,
trashed_before,
type,
updated_after,
updated_before,
visibility,
with_deleted,
with_exif,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
'albumIds': 'multi',
'personIds': 'multi',
'tagIds': 'multi',
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
if album_ids is not None:
_query_params.append(('albumIds', album_ids))
if city is not None:
_query_params.append(('city', city))
if country is not None:
_query_params.append(('country', country))
if created_after is not None:
if isinstance(created_after, datetime):
_query_params.append(
(
'createdAfter',
created_after.strftime(
self.api_client.configuration.datetime_format
)
)
)
else:
_query_params.append(('createdAfter', created_after))
if created_before is not None:
if isinstance(created_before, datetime):
_query_params.append(
(
'createdBefore',
created_before.strftime(
self.api_client.configuration.datetime_format
)
)
)
else:
_query_params.append(('createdBefore', created_before))
if is_encoded is not None:
_query_params.append(('isEncoded', is_encoded))
if is_favorite is not None:
_query_params.append(('isFavorite', is_favorite))
if is_motion is not None:
_query_params.append(('isMotion', is_motion))
if is_not_in_album is not None:
_query_params.append(('isNotInAlbum', is_not_in_album))
if is_offline is not None:
_query_params.append(('isOffline', is_offline))
if lens_model is not None:
_query_params.append(('lensModel', lens_model))
if library_id is not None:
_query_params.append(('libraryId', library_id))
if make is not None:
_query_params.append(('make', make))
if min_file_size is not None:
_query_params.append(('minFileSize', min_file_size))
if model is not None:
_query_params.append(('model', model))
if ocr is not None:
_query_params.append(('ocr', ocr))
if person_ids is not None:
_query_params.append(('personIds', person_ids))
if rating is not None:
_query_params.append(('rating', rating))
if size is not None:
_query_params.append(('size', size))
if state is not None:
_query_params.append(('state', state))
if tag_ids is not None:
_query_params.append(('tagIds', tag_ids))
if taken_after is not None:
if isinstance(taken_after, datetime):
_query_params.append(
(
'takenAfter',
taken_after.strftime(
self.api_client.configuration.datetime_format
)
)
)
else:
_query_params.append(('takenAfter', taken_after))
if taken_before is not None:
if isinstance(taken_before, datetime):
_query_params.append(
(
'takenBefore',
taken_before.strftime(
self.api_client.configuration.datetime_format
)
)
)
else:
_query_params.append(('takenBefore', taken_before))
if trashed_after is not None:
if isinstance(trashed_after, datetime):
_query_params.append(
(
'trashedAfter',
trashed_after.strftime(
self.api_client.configuration.datetime_format
)
)
)
else:
_query_params.append(('trashedAfter', trashed_after))
if trashed_before is not None:
if isinstance(trashed_before, datetime):
_query_params.append(
(
'trashedBefore',
trashed_before.strftime(
self.api_client.configuration.datetime_format
)
)
)
else:
_query_params.append(('trashedBefore', trashed_before))
if type is not None:
_query_params.append(('type', type.value))
if updated_after is not None:
if isinstance(updated_after, datetime):
_query_params.append(
(
'updatedAfter',
updated_after.strftime(
self.api_client.configuration.datetime_format
)
)
)
else:
_query_params.append(('updatedAfter', updated_after))
if updated_before is not None:
if isinstance(updated_before, datetime):
_query_params.append(
(
'updatedBefore',
updated_before.strftime(
self.api_client.configuration.datetime_format
)
)
)
else:
_query_params.append(('updatedBefore', updated_before))
if visibility is not None:
_query_params.append(('visibility', visibility.value))
if with_deleted is not None:
_query_params.append(('withDeleted', with_deleted))
if with_exif is not None:
_query_params.append(('withExif', with_exif))
# process the header parameters
# process the form parameters
# process the body parameter
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json'
]
)
# authentication setting
_auth_settings: List[str] = [
'cookie',
'api_key',
'bearer'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/search/large-assets',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def search_person(
self,
name: Annotated[StrictStr, Field(description="Person name to search for")],
with_hidden: Annotated[Optional[StrictBool], Field(description="Include hidden people")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> List[PersonResponseDto]:
"""Search people
Search for people by name.
:param name: Person name to search for (required)
:type name: str
:param with_hidden: Include hidden people
:type with_hidden: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_person_serialize(
name=name,
with_hidden=with_hidden,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[PersonResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def search_person_with_http_info(
self,
name: Annotated[StrictStr, Field(description="Person name to search for")],
with_hidden: Annotated[Optional[StrictBool], Field(description="Include hidden people")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[List[PersonResponseDto]]:
"""Search people
Search for people by name.
:param name: Person name to search for (required)
:type name: str
:param with_hidden: Include hidden people
:type with_hidden: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_person_serialize(
name=name,
with_hidden=with_hidden,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[PersonResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def search_person_without_preload_content(
self,
name: Annotated[StrictStr, Field(description="Person name to search for")],
with_hidden: Annotated[Optional[StrictBool], Field(description="Include hidden people")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Search people
Search for people by name.
:param name: Person name to search for (required)
:type name: str
:param with_hidden: Include hidden people
:type with_hidden: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_person_serialize(
name=name,
with_hidden=with_hidden,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[PersonResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _search_person_serialize(
self,
name,
with_hidden,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
if name is not None:
_query_params.append(('name', name))
if with_hidden is not None:
_query_params.append(('withHidden', with_hidden))
# process the header parameters
# process the form parameters
# process the body parameter
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json'
]
)
# authentication setting
_auth_settings: List[str] = [
'cookie',
'api_key',
'bearer'
]
return self.api_client.param_serialize(
method='GET',
resource_path='/search/person',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def search_places(
self,
name: Annotated[StrictStr, Field(description="Place name to search for")],
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> List[PlacesResponseDto]:
"""Search places
Search for places by name.
:param name: Place name to search for (required)
:type name: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_places_serialize(
name=name,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[PlacesResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def search_places_with_http_info(
self,
name: Annotated[StrictStr, Field(description="Place name to search for")],
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[List[PlacesResponseDto]]:
"""Search places
Search for places by name.
:param name: Place name to search for (required)
:type name: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_places_serialize(
name=name,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[PlacesResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def search_places_without_preload_content(
self,
name: Annotated[StrictStr, Field(description="Place name to search for")],
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Search places
Search for places by name.
:param name: Place name to search for (required)
:type name: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_places_serialize(
name=name,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[PlacesResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _search_places_serialize(
self,
name,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
if name is not None:
_query_params.append(('name', name))
# process the header parameters
# process the form parameters
# process the body parameter
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json'
]
)
# authentication setting
_auth_settings: List[str] = [
'cookie',
'api_key',
'bearer'
]
return self.api_client.param_serialize(
method='GET',
resource_path='/search/places',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def search_random(
self,
random_search_dto: RandomSearchDto,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> List[AssetResponseDto]:
"""Search random assets
Retrieve a random selection of assets based on the provided criteria.
:param random_search_dto: (required)
:type random_search_dto: RandomSearchDto
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_random_serialize(
random_search_dto=random_search_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[AssetResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def search_random_with_http_info(
self,
random_search_dto: RandomSearchDto,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[List[AssetResponseDto]]:
"""Search random assets
Retrieve a random selection of assets based on the provided criteria.
:param random_search_dto: (required)
:type random_search_dto: RandomSearchDto
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_random_serialize(
random_search_dto=random_search_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[AssetResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def search_random_without_preload_content(
self,
random_search_dto: RandomSearchDto,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Search random assets
Retrieve a random selection of assets based on the provided criteria.
:param random_search_dto: (required)
:type random_search_dto: RandomSearchDto
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_random_serialize(
random_search_dto=random_search_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[AssetResponseDto]",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _search_random_serialize(
self,
random_search_dto,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if random_search_dto is not None:
_body_params = random_search_dto
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json'
]
)
# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type
# authentication setting
_auth_settings: List[str] = [
'cookie',
'api_key',
'bearer'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/search/random',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def search_smart(
self,
smart_search_dto: SmartSearchDto,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> SearchResponseDto:
"""Smart asset search
Perform a smart search for assets by using machine learning vectors to determine relevance.
:param smart_search_dto: (required)
:type smart_search_dto: SmartSearchDto
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_smart_serialize(
smart_search_dto=smart_search_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "SearchResponseDto",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def search_smart_with_http_info(
self,
smart_search_dto: SmartSearchDto,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[SearchResponseDto]:
"""Smart asset search
Perform a smart search for assets by using machine learning vectors to determine relevance.
:param smart_search_dto: (required)
:type smart_search_dto: SmartSearchDto
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_smart_serialize(
smart_search_dto=smart_search_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "SearchResponseDto",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def search_smart_without_preload_content(
self,
smart_search_dto: SmartSearchDto,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Smart asset search
Perform a smart search for assets by using machine learning vectors to determine relevance.
:param smart_search_dto: (required)
:type smart_search_dto: SmartSearchDto
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._search_smart_serialize(
smart_search_dto=smart_search_dto,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "SearchResponseDto",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _search_smart_serialize(
self,
smart_search_dto,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if smart_search_dto is not None:
_body_params = smart_search_dto
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json'
]
)
# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type
# authentication setting
_auth_settings: List[str] = [
'cookie',
'api_key',
'bearer'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/search/smart',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)