Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""Vessels Endpoint."""
from typing import List, Union, Dict
from vortexasdk.api.id import ID
from vortexasdk.endpoints.endpoints import VESSELS_REFERENCE
from vortexasdk.endpoints.vessels_result import VesselsResult
from vortexasdk.operations import Reference, Search
from vortexasdk.utils import convert_to_list
class Vessels(Reference, Search):
"""Vessels endpoint."""
def __init__(self):
"""Instantiate endpoint using reference endpoint."""
Reference.__init__(self, VESSELS_REFERENCE)
Search.__init__(self, VESSELS_REFERENCE)
def load_all(self) -> VesselsResult:
"""Load all vessels."""
return self.search()
def search(
self,
term: Union[str, List[str]] = None,
ids: Union[str, List[str]] = None,
vessel_classes: Union[str, List[str]] = None,
"""Geographies Endpoint."""
from typing import Dict, List, Union
from vortexasdk.logger import get_logger
from vortexasdk.api import ID
from vortexasdk.endpoints.endpoints import GEOGRAPHIES_REFERENCE
from vortexasdk.endpoints.geographies_result import GeographyResult
from vortexasdk.operations import Reference, Search
from vortexasdk.utils import convert_values_to_list
logger = get_logger(__name__)
class Geographies(Reference, Search):
"""Geographies endpoint."""
def __init__(self):
Reference.__init__(self, GEOGRAPHIES_REFERENCE)
Search.__init__(self, GEOGRAPHIES_REFERENCE)
def load_all(self) -> GeographyResult:
"""Load all geographies."""
return self.search()
def search(
self,
term: Union[str, List[str]] = None,
exact_term_match: bool = False,
) -> GeographyResult:
"""
"""Geographies Endpoint."""
from typing import List, Union, Dict
from vortexasdk.api import ID
from vortexasdk.endpoints.endpoints import GEOGRAPHIES_REFERENCE
from vortexasdk.endpoints.geographies_result import GeographyResult
from vortexasdk.operations import Reference, Search
from vortexasdk.utils import convert_values_to_list
class Geographies(Reference, Search):
"""Geographies endpoint."""
def __init__(self):
Reference.__init__(self, GEOGRAPHIES_REFERENCE)
Search.__init__(self, GEOGRAPHIES_REFERENCE)
def load_all(self) -> GeographyResult:
"""Load all geographies."""
return self.search()
def search(self, term: Union[str, List[str]] = None) -> GeographyResult:
"""
Find all geographies matching given search terms.
# Arguments
term: The geography name (or names) we're filtering on
"""Products Endpoint."""
from typing import List, Union, Dict
from vortexasdk.api.shared_types import ID
from vortexasdk.endpoints.endpoints import PRODUCTS_REFERENCE
from vortexasdk.endpoints.products_result import ProductResult
from vortexasdk.operations import Reference, Search
from vortexasdk.utils import convert_to_list
class Products(Reference, Search):
"""Vessels endpoint."""
def __init__(self):
"""Instantiate endpoint using reference endpoint."""
Reference.__init__(self, PRODUCTS_REFERENCE)
Search.__init__(self, PRODUCTS_REFERENCE)
def load_all(self) -> ProductResult:
"""Load all products."""
return self.search()
def search(
self,
term: Union[str, List[str]] = None,
ids: Union[str, List[str]] = None,
product_parent: Union[str, List[str]] = None,
"""Attributes Endpoint."""
from typing import List, Union
from vortexasdk.endpoints.endpoints import ATTRIBUTES_REFERENCE
from vortexasdk.endpoints.attributes_result import AttributeResult
from vortexasdk.operations import Reference, Search
from vortexasdk.utils import convert_to_list
class Attributes(Reference, Search):
"""
Attributes endpoint.
An Attribute is a reference value that corresponds to an ID associated with other entities.
For example, a vessel object from the Vessel reference endpoint may have the following keys:
```json
{
"ice_class": "b09ed4e2bd6904dd",
"propulsion": "3ace0e050724707b"
}
```
These IDs represent attributes which can be found via the Attributes reference endpoint.