# -*- coding: utf-8 -*-
"""
Automatically generated by DeachSword-DearSakura
Author: YinMo (WEDeach)
Version: 1.0.5
"""


class InterlockService(object):
    InterlockService_REQ_TYPE = 4  # BASE_VAL
    InterlockService_RES_TYPE = 4  # BASE_VAL
    InterlockService_API_PATH = None  # BASE_VAL

    def __init__(self):
        self.InterlockService_API_PATH = self.LINE_EXTERNAL_INTERLOCK_ENDPOINT

    def getPlaceSearchProviderList(self, region: str):
        """
        Get place search provider list.

        GENERATED BY YinMo0913_DeachSword-DearSakura_v1.0.5.py
        DATETIME: 02/03/2023, 23:02:07
        """
        METHOD_NAME = "getPlaceSearchProviderList"
        params = [[11, 1, region]]
        sqrd = self.generateDummyProtocol(
            METHOD_NAME, params, self.InterlockService_REQ_TYPE
        )
        return self.postPackDataAndGetUnpackRespData(
            self.InterlockService_API_PATH, sqrd, self.InterlockService_RES_TYPE
        )

    def getPlaceSearchInfo(
        self,
        provider: int,
        keyword: str,
        clientLocale: str,
        latitude: float,
        longitude: float,
        radius: int,
    ):
        """
        Get place search info.

        GENERATED BY YinMo0913_DeachSword-DearSakura_v1.0.5.py
        DATETIME: 02/03/2023, 23:02:07
        """
        METHOD_NAME = "getPlaceSearchInfo"
        params = [
            [8, 2, provider],  # 0
            [11, 3, keyword],  # 台北101
            [11, 4, clientLocale],
            [4, 5, latitude],  # 25.03303
            [4, 6, longitude],  # 121.562759
            [8, 7, radius],
        ]
        sqrd = self.generateDummyProtocol(
            METHOD_NAME, params, self.InterlockService_REQ_TYPE
        )
        return self.postPackDataAndGetUnpackRespData(
            self.InterlockService_API_PATH, sqrd, self.InterlockService_RES_TYPE
        )
