How to use the vortexasdk.operations.Search function in vortexasdk

To help you get started, we’ve selected a few vortexasdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github V0RT3X4 / python-sdk / vortexasdk / endpoints / corporations.py View on Github external
"""Corporations Endpoint."""
from typing import List, Union, Dict

from vortexasdk.api import ID
from vortexasdk.endpoints.corporations_result import CorporationsResult
from vortexasdk.endpoints.endpoints import CORPORATIONS_REFERENCE
from vortexasdk.operations import Reference, Search
from vortexasdk.utils import convert_values_to_list


class Corporations(Reference, Search):
    """Corporations Endpoint."""

    def __init__(self):
        Reference.__init__(self, CORPORATIONS_REFERENCE)
        Search.__init__(self, CORPORATIONS_REFERENCE)

    def load_all(self) -> CorporationsResult:
        """Load all corporations."""
        return self.search()

    def search(self, term: Union[str, List[str]] = None) -> CorporationsResult:
        """
        Find all Corporations matching given search terms.

        # Arguments
            term: The corporation name(s) we're filtering on