Exemple #1
0
    def get_insurance_types(self, sub_domain, issue_insurance, x_api_key):
        """Does a GET request to /ComboData/InsuranceTypes.

        دریافت لیست نوع بیمه نامه

        Args:
            sub_domain (string): دامنه یا زیر دامنه ی مرکز بیمه
            issue_insurance (bool): دریافت بیمه نامه های قابل صدور
            x_api_key (string): کلید اختصاصی ارتباط با سرور

        Returns:
            InsuranceTypes: Response from the API. 

        Raises:
            APIException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        # Prepare query URL
        _url_path = '/ComboData/InsuranceTypes'
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_parameters = {
            'subDomain': sub_domain,
            'issueInsurance': issue_insurance
        }
        _query_builder = APIHelper.append_url_with_query_parameters(
            _query_builder, _query_parameters,
            Configuration.array_serialization)
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {'accept': 'application/json', 'x-api-key': x_api_key}

        # Prepare and execute request
        _request = self.http_client.get(_query_url, headers=_headers)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(_context.response.raw_body,
                                          InsuranceTypes.from_dictionary)
    def create_tracking_damage(self,
                               body,
                               x_api_key,
                               content_type):
        """Does a POST request to /TrackingDamage.

        ثبت خسارت بیمه

        Args:
            body (TrackingDamageRequest): اطلاعات خسارت
            x_api_key (string): کلید اختصاصی ارتباط با سرور
            content_type (string): TODO: type description here. Example: 

        Returns:
            TrackingDamage: Response from the API. 

        Raises:
            APIException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        # Prepare query URL
        _url_path = '/TrackingDamage'
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {
            'accept': 'application/json',
            'x-api-key': x_api_key,
            'Content-Type': content_type
        }

        # Prepare and execute request
        _request = self.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(_context.response.raw_body, TrackingDamage.from_dictionary)
Exemple #3
0
    def get_portal_landing_page(self, id, x_api_key):
        """Does a GET request to /InsuranceCentre/PortalLandingPage.

        در یافت اطلاعات لندینگ مراکز بیمه

        Args:
            id (string): دامنه یا زیر دامنه ی مرکز بیمه
            x_api_key (string): کلید اختصاصی ارتباط با سرور

        Returns:
            BaseModelPortalLandingPage: Response from the API. 

        Raises:
            APIException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        # Prepare query URL
        _url_path = '/InsuranceCentre/PortalLandingPage'
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_parameters = {'id': id}
        _query_builder = APIHelper.append_url_with_query_parameters(
            _query_builder, _query_parameters,
            Configuration.array_serialization)
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {'accept': 'application/json', 'x-api-key': x_api_key}

        # Prepare and execute request
        _request = self.http_client.get(_query_url, headers=_headers)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body,
            BaseModelPortalLandingPage.from_dictionary)
Exemple #4
0
    def get_electronic_equipment_insurance(self, sub_domain, x_api_key):
        """Does a GET request to /ElectronicEquipmentInsurance/Initialize.

        دریافت اطلاعات اولیه استعلام بیمه نامه ی تجهیزات الکترونیک

        Args:
            sub_domain (string): دامنه یا زیر دامنه ی مرکز بیمه
            x_api_key (string): کلید اختصاصی ارتباط با سرور

        Returns:
            BaseModelElectronicEquipmentInsurance: Response from the API. 

        Raises:
            APIException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        # Prepare query URL
        _url_path = '/ElectronicEquipmentInsurance/Initialize'
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_parameters = {'subDomain': sub_domain}
        _query_builder = APIHelper.append_url_with_query_parameters(
            _query_builder, _query_parameters,
            Configuration.array_serialization)
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {'accept': 'application/json', 'x-api-key': x_api_key}

        # Prepare and execute request
        _request = self.http_client.get(_query_url, headers=_headers)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body,
            BaseModelElectronicEquipmentInsurance.from_dictionary)
Exemple #5
0
    def get_divice_franchisee(self, device_model_id, x_api_key):
        """Does a GET request to /ElectronicEquipmentInsurance/DiviceFranchisee.

        دریافت لیست فرانشیر استعلام بیمه نامه ی تجهیزات الکترونیک

        Args:
            device_model_id (int): شناسه ی مدل دستگاه
            x_api_key (string): کلید اختصاصی ارتباط با سرور

        Returns:
            BaseModelDiviceFranchisee: Response from the API. 

        Raises:
            APIException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        # Prepare query URL
        _url_path = '/ElectronicEquipmentInsurance/DiviceFranchisee'
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_parameters = {'deviceModelId': device_model_id}
        _query_builder = APIHelper.append_url_with_query_parameters(
            _query_builder, _query_parameters,
            Configuration.array_serialization)
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {'accept': 'application/json', 'x-api-key': x_api_key}

        # Prepare and execute request
        _request = self.http_client.get(_query_url, headers=_headers)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body,
            BaseModelDiviceFranchisee.from_dictionary)
    def get_car_brand_tips(self, car_brand_id, x_api_key):
        """Does a GET request to /ComboData/CarBrandTips.

        دریافت لیست تیپ موتور سیکلت

        Args:
            car_brand_id (int): شناسه ی برند موتور سیکلت
            x_api_key (string): کلید اختصاصی ارتباط با سرور

        Returns:
            CarBrandTips: Response from the API. 

        Raises:
            APIException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        # Prepare query URL
        _url_path = '/ComboData/CarBrandTips'
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_parameters = {'carBrandId': car_brand_id}
        _query_builder = APIHelper.append_url_with_query_parameters(
            _query_builder, _query_parameters,
            Configuration.array_serialization)
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {'accept': 'application/json', 'x-api-key': x_api_key}

        # Prepare and execute request
        _request = self.http_client.get(_query_url, headers=_headers)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(_context.response.raw_body,
                                          CarBrandTips.from_dictionary)
    def get_faq_insurance_centre(self, x_api_key):
        """Does a GET request to /Faq/InsuranceCentre/hfz1.

        دریافت لیست سوالات متداول

        Args:
            x_api_key (string): کلید اختصاصی ارتباط با سرور

        Returns:
            BaseModelFaqInsuranceCentre: Response from the API. 

        Raises:
            APIException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        # Prepare query URL
        _url_path = '/Faq/InsuranceCentre/hfz1'
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {'accept': 'application/json', 'x-api-key': x_api_key}

        # Prepare and execute request
        _request = self.http_client.get(_query_url, headers=_headers)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body,
            BaseModelFaqInsuranceCentre.from_dictionary)
    def get_portal_landing_contact_about(self, x_api_key):
        """Does a GET request to /InsuranceCentre/PortalLandingContactAbout/hfz1.

        دریافت اطلاعات درباره ی ما

        Args:
            x_api_key (string): TODO: type description here. Example: 

        Returns:
            BaseModelPortalLandingContactAbout: Response from the API. 

        Raises:
            APIException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        # Prepare query URL
        _url_path = '/InsuranceCentre/PortalLandingContactAbout/hfz1'
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {'accept': 'application/json', 'x-api-key': x_api_key}

        # Prepare and execute request
        _request = self.http_client.get(_query_url, headers=_headers)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body,
            BaseModelPortalLandingContactAbout.from_dictionary)